-
Notifications
You must be signed in to change notification settings - Fork 0
/
itowns.js
13 lines (13 loc) · 928 KB
/
itowns.js
1
2
3
4
5
6
7
8
9
10
11
12
13
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("itowns",[],e):"object"==typeof exports?exports.itowns=e():t.itowns=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r=window.webpackJsonp_name_;window.webpackJsonp_name_=function(n,a,o){for(var s,u,h,c=0,l=[];c<n.length;c++)u=n[c],i[u]&&l.push(i[u][0]),i[u]=0;for(s in a)Object.prototype.hasOwnProperty.call(a,s)&&(t[s]=a[s]);for(r&&r(n,a,o);l.length;)l.shift()();if(o)for(c=0;c<o.length;c++)h=e(e.s=o[c]);return h};var n={},i={1:0};return e.e=function(t){function r(){s.onerror=s.onload=null,clearTimeout(u);var e=i[t];0!==e&&(e&&e[1](new Error("Loading chunk "+t+" failed.")),i[t]=void 0)}var n=i[t];if(0===n)return new Promise(function(t){t()});if(n)return n[2];var a=new Promise(function(e,r){n=i[t]=[e,r]});n[2]=a;var o=document.getElementsByTagName("head")[0],s=document.createElement("script");s.type="text/javascript",s.charset="utf-8",s.async=!0,s.timeout=12e4,e.nc&&s.setAttribute("nonce",e.nc),s.src=e.p+""+t+".js";var u=setTimeout(r,12e4);return s.onerror=s.onload=r,o.appendChild(s),a},e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e.oe=function(t){throw console.error(t),t},e(e.s=507)}([,function(t,e,r){"use strict";function n(){}function i(t,e){this.x=t||0,this.y=e||0}function a(t,e,r,n,o,s,u,h,c,l){Object.defineProperty(this,"id",{value:Is++}),this.uuid=Os.generateUUID(),this.name="",this.image=void 0!==t?t:a.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:a.DEFAULT_MAPPING,this.wrapS=void 0!==r?r:Ao,this.wrapT=void 0!==n?n:Ao,this.magFilter=void 0!==o?o:Oo,this.minFilter=void 0!==s?s:Do,this.anisotropy=void 0!==c?c:1,this.format=void 0!==u?u:Zo,this.type=void 0!==h?h:No,this.offset=new i(0,0),this.repeat=new i(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==l?l:ws,this.version=0,this.onUpdate=null}function o(t,e,r,n){this.x=t||0,this.y=e||0,this.z=r||0,this.w=void 0!==n?n:1}function s(t,e,r){this.uuid=Os.generateUUID(),this.width=t,this.height=e,this.scissor=new o(0,0,t,e),this.scissorTest=!1,this.viewport=new o(0,0,t,e),r=r||{},void 0===r.minFilter&&(r.minFilter=Oo),this.texture=new a(void 0,void 0,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.depthBuffer=void 0===r.depthBuffer||r.depthBuffer,this.stencilBuffer=void 0===r.stencilBuffer||r.stencilBuffer,this.depthTexture=void 0!==r.depthTexture?r.depthTexture:null}function u(t,e,r){s.call(this,t,e,r),this.activeCubeFace=0,this.activeMipMapLevel=0}function h(t,e,r,n){this._x=t||0,this._y=e||0,this._z=r||0,this._w=void 0!==n?n:1}function c(t,e,r){this.x=t||0,this.y=e||0,this.z=r||0}function l(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function d(t,e,r,n,i,o,s,u,h,c,l,d){a.call(this,null,o,s,u,h,c,n,i,l,d),this.image={data:t,width:e,height:r},this.magFilter=void 0!==h?h:Po,this.minFilter=void 0!==c?c:Po,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function f(t,e,r,n,i,o,s,u,h,c){t=void 0!==t?t:[],e=void 0!==e?e:xo,a.call(this,t,e,r,n,i,o,s,u,h,c),this.flipY=!1}function p(){this.seq=[],this.map={}}function m(t,e,r){var n=t[0];if(n<=0||n>0)return t;var i=e*r,a=Us[i];if(void 0===a&&(a=new Float32Array(i),Us[i]=a),0!==e){n.toArray(a,0);for(var o=1,s=0;o!==e;++o)s+=r,t[o].toArray(a,s)}return a}function v(t,e){var r=Fs[e];void 0===r&&(r=new Int32Array(e),Fs[e]=r);for(var n=0;n!==e;++n)r[n]=t.allocTextureUnit();return r}function g(t,e){t.uniform1f(this.addr,e)}function y(t,e){t.uniform1i(this.addr,e)}function x(t,e){void 0===e.x?t.uniform2fv(this.addr,e):t.uniform2f(this.addr,e.x,e.y)}function _(t,e){void 0!==e.x?t.uniform3f(this.addr,e.x,e.y,e.z):void 0!==e.r?t.uniform3f(this.addr,e.r,e.g,e.b):t.uniform3fv(this.addr,e)}function b(t,e){void 0===e.x?t.uniform4fv(this.addr,e):t.uniform4f(this.addr,e.x,e.y,e.z,e.w)}function w(t,e){t.uniformMatrix2fv(this.addr,!1,e.elements||e)}function M(t,e){void 0===e.elements?t.uniformMatrix3fv(this.addr,!1,e):(zs.set(e.elements),t.uniformMatrix3fv(this.addr,!1,zs))}function E(t,e){void 0===e.elements?t.uniformMatrix4fv(this.addr,!1,e):(Bs.set(e.elements),t.uniformMatrix4fv(this.addr,!1,Bs))}function T(t,e,r){var n=r.allocTextureUnit();t.uniform1i(this.addr,n),r.setTexture2D(e||Ds,n)}function S(t,e,r){var n=r.allocTextureUnit();t.uniform1i(this.addr,n),r.setTextureCube(e||Ns,n)}function A(t,e){t.uniform2iv(this.addr,e)}function L(t,e){t.uniform3iv(this.addr,e)}function P(t,e){t.uniform4iv(this.addr,e)}function R(t){switch(t){case 5126:return g;case 35664:return x;case 35665:return _;case 35666:return b;case 35674:return w;case 35675:return M;case 35676:return E;case 35678:case 36198:return T;case 35680:return S;case 5124:case 35670:return y;case 35667:case 35671:return A;case 35668:case 35672:return L;case 35669:case 35673:return P}}function C(t,e){t.uniform1fv(this.addr,e)}function O(t,e){t.uniform1iv(this.addr,e)}function I(t,e){t.uniform2fv(this.addr,m(e,this.size,2))}function D(t,e){t.uniform3fv(this.addr,m(e,this.size,3))}function N(t,e){t.uniform4fv(this.addr,m(e,this.size,4))}function U(t,e){t.uniformMatrix2fv(this.addr,!1,m(e,this.size,4))}function F(t,e){t.uniformMatrix3fv(this.addr,!1,m(e,this.size,9))}function B(t,e){t.uniformMatrix4fv(this.addr,!1,m(e,this.size,16))}function z(t,e,r){var n=e.length,i=v(r,n);t.uniform1iv(this.addr,i);for(var a=0;a!==n;++a)r.setTexture2D(e[a]||Ds,i[a])}function G(t,e,r){var n=e.length,i=v(r,n);t.uniform1iv(this.addr,i);for(var a=0;a!==n;++a)r.setTextureCube(e[a]||Ns,i[a])}function j(t){switch(t){case 5126:return C;case 35664:return I;case 35665:return D;case 35666:return N;case 35674:return U;case 35675:return F;case 35676:return B;case 35678:return z;case 35680:return G;case 5124:case 35670:return O;case 35667:case 35671:return A;case 35668:case 35672:return L;case 35669:case 35673:return P}}function V(t,e,r){this.id=t,this.addr=r,this.setValue=R(e.type)}function k(t,e,r){this.id=t,this.addr=r,this.size=e.size,this.setValue=j(e.type)}function H(t){this.id=t,p.call(this)}function W(t,e){t.seq.push(e),t.map[e.id]=e}function q(t,e,r){var n=t.name,i=n.length;for(Gs.lastIndex=0;;){var a=Gs.exec(n),o=Gs.lastIndex,s=a[1],u="]"===a[2],h=a[3];if(u&&(s|=0),void 0===h||"["===h&&o+2===i){W(r,void 0===h?new V(s,t,e):new k(s,t,e));break}var c=r.map,l=c[s];void 0===l&&(l=new H(s),W(r,l)),r=l}}function X(t,e,r){p.call(this),this.renderer=r;for(var n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),i=0;i<n;++i){var a=t.getActiveUniform(e,i),o=a.name;q(a,t.getUniformLocation(e,o),this)}}function Y(t,e,r){return void 0===e&&void 0===r?this.set(t):this.setRGB(t,e,r)}function Z(t,e){this.min=void 0!==t?t:new i(1/0,1/0),this.max=void 0!==e?e:new i(-1/0,-1/0)}function K(t,e,r,n,a){function o(){var t=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),n=new Uint16Array([0,1,2,0,2,3]);u=e.createBuffer(),h=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,u),e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,h),e.bufferData(e.ELEMENT_ARRAY_BUFFER,n,e.STATIC_DRAW),m=e.createTexture(),v=e.createTexture(),r.bindTexture(e.TEXTURE_2D,m),e.texImage2D(e.TEXTURE_2D,0,e.RGB,16,16,0,e.RGB,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),r.bindTexture(e.TEXTURE_2D,v),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,16,16,0,e.RGBA,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),l={vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","uniform sampler2D occlusionMap;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float vVisibility;","void main() {","vUV = uv;","vec2 pos = position;","if ( renderType == 2 ) {","vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","vVisibility = visibility.r / 9.0;","vVisibility *= 1.0 - visibility.g / 9.0;","vVisibility *= visibility.b / 9.0;","vVisibility *= 1.0 - visibility.a / 9.0;","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join("\n"),fragmentShader:["uniform lowp int renderType;","uniform sampler2D map;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","varying float vVisibility;","void main() {","if ( renderType == 0 ) {","gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );","} else if ( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * vVisibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")},d=s(l),f={vertex:e.getAttribLocation(d,"position"),uv:e.getAttribLocation(d,"uv")},p={renderType:e.getUniformLocation(d,"renderType"),map:e.getUniformLocation(d,"map"),occlusionMap:e.getUniformLocation(d,"occlusionMap"),opacity:e.getUniformLocation(d,"opacity"),color:e.getUniformLocation(d,"color"),scale:e.getUniformLocation(d,"scale"),rotation:e.getUniformLocation(d,"rotation"),screenPosition:e.getUniformLocation(d,"screenPosition")}}function s(t){var r=e.createProgram(),n=e.createShader(e.FRAGMENT_SHADER),i=e.createShader(e.VERTEX_SHADER),o="precision "+a.precision+" float;\n";return e.shaderSource(n,o+t.fragmentShader),e.shaderSource(i,o+t.vertexShader),e.compileShader(n),e.compileShader(i),e.attachShader(r,n),e.attachShader(r,i),e.linkProgram(r),r}var u,h,l,d,f,p,m,v;this.render=function(t,a,s,l){if(0!==t.length){var g=new c,y=l.w/l.z,x=.5*l.z,_=.5*l.w,b=16/l.w,w=new i(b*y,b),M=new c(1,1,0),E=new i(1,1),T=new Z;T.min.set(l.x,l.y),T.max.set(l.x+(l.z-16),l.y+(l.w-16)),void 0===d&&o(),r.useProgram(d),r.initAttributes(),r.enableAttribute(f.vertex),r.enableAttribute(f.uv),r.disableUnusedAttributes(),e.uniform1i(p.occlusionMap,0),e.uniform1i(p.map,1),e.bindBuffer(e.ARRAY_BUFFER,u),e.vertexAttribPointer(f.vertex,2,e.FLOAT,!1,16,0),e.vertexAttribPointer(f.uv,2,e.FLOAT,!1,16,8),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,h),r.disable(e.CULL_FACE),r.buffers.depth.setMask(!1);for(var S=0,A=t.length;S<A;S++){b=16/l.w,w.set(b*y,b);var L=t[S];if(g.set(L.matrixWorld.elements[12],L.matrixWorld.elements[13],L.matrixWorld.elements[14]),g.applyMatrix4(s.matrixWorldInverse),g.applyMatrix4(s.projectionMatrix),M.copy(g),E.x=l.x+M.x*x+x-8,E.y=l.y+M.y*_+_-8,!0===T.containsPoint(E)){r.activeTexture(e.TEXTURE0),r.bindTexture(e.TEXTURE_2D,null),r.activeTexture(e.TEXTURE1),r.bindTexture(e.TEXTURE_2D,m),e.copyTexImage2D(e.TEXTURE_2D,0,e.RGB,E.x,E.y,16,16,0),e.uniform1i(p.renderType,0),e.uniform2f(p.scale,w.x,w.y),e.uniform3f(p.screenPosition,M.x,M.y,M.z),r.disable(e.BLEND),r.enable(e.DEPTH_TEST),e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0),r.activeTexture(e.TEXTURE0),r.bindTexture(e.TEXTURE_2D,v),e.copyTexImage2D(e.TEXTURE_2D,0,e.RGBA,E.x,E.y,16,16,0),e.uniform1i(p.renderType,1),r.disable(e.DEPTH_TEST),r.activeTexture(e.TEXTURE1),r.bindTexture(e.TEXTURE_2D,m),e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0),L.positionScreen.copy(M),L.customUpdateCallback?L.customUpdateCallback(L):L.updateLensFlares(),e.uniform1i(p.renderType,2),r.enable(e.BLEND);for(var P=0,R=L.lensFlares.length;P<R;P++){var C=L.lensFlares[P];C.opacity>.001&&C.scale>.001&&(M.x=C.x,M.y=C.y,M.z=C.z,b=C.size*C.scale/l.w,w.x=b*y,w.y=b,e.uniform3f(p.screenPosition,M.x,M.y,M.z),e.uniform2f(p.scale,w.x,w.y),e.uniform1f(p.rotation,C.rotation),e.uniform1f(p.opacity,C.opacity),e.uniform3f(p.color,C.color.r,C.color.g,C.color.b),r.setBlending(C.blending,C.blendEquation,C.blendSrc,C.blendDst),n.setTexture2D(C.texture,1),e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}}}r.enable(e.CULL_FACE),r.enable(e.DEPTH_TEST),r.buffers.depth.setMask(!0),r.reset()}}}function Q(t,e,r,n,i,o,s,u,h){a.call(this,t,e,r,n,i,o,s,u,h),this.needsUpdate=!0}function J(t,e,r,n,i){function a(){var t=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),r=new Uint16Array([0,1,2,0,2,3]);u=e.createBuffer(),l=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,u),e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,l),e.bufferData(e.ELEMENT_ARRAY_BUFFER,r,e.STATIC_DRAW),d=o(),f={position:e.getAttribLocation(d,"position"),uv:e.getAttribLocation(d,"uv")},p={uvOffset:e.getUniformLocation(d,"uvOffset"),uvScale:e.getUniformLocation(d,"uvScale"),rotation:e.getUniformLocation(d,"rotation"),scale:e.getUniformLocation(d,"scale"),color:e.getUniformLocation(d,"color"),map:e.getUniformLocation(d,"map"),opacity:e.getUniformLocation(d,"opacity"),modelViewMatrix:e.getUniformLocation(d,"modelViewMatrix"),projectionMatrix:e.getUniformLocation(d,"projectionMatrix"),fogType:e.getUniformLocation(d,"fogType"),fogDensity:e.getUniformLocation(d,"fogDensity"),fogNear:e.getUniformLocation(d,"fogNear"),fogFar:e.getUniformLocation(d,"fogFar"),fogColor:e.getUniformLocation(d,"fogColor"),alphaTest:e.getUniformLocation(d,"alphaTest")};var n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");n.width=8,n.height=8;var i=n.getContext("2d");i.fillStyle="white",i.fillRect(0,0,8,8),m=new Q(n)}function o(){var t=e.createProgram(),r=e.createShader(e.VERTEX_SHADER),n=e.createShader(e.FRAGMENT_SHADER);return e.shaderSource(r,["precision "+i.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uvOffset + uv * uvScale;","vec2 alignedPosition = position * scale;","vec2 rotatedPosition;","rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","vec4 finalPosition;","finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","finalPosition.xy += rotatedPosition;","finalPosition = projectionMatrix * finalPosition;","gl_Position = finalPosition;","}"].join("\n")),e.shaderSource(n,["precision "+i.precision+" float;","#define SHADER_NAME SpriteMaterial","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","void main() {","vec4 texture = texture2D( map, vUV );","if ( texture.a < alphaTest ) discard;","gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","if ( fogType > 0 ) {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = 0.0;","if ( fogType == 1 ) {","fogFactor = smoothstep( fogNear, fogFar, depth );","} else {","const float LOG2 = 1.442695;","fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","}","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}","}"].join("\n")),e.compileShader(r),e.compileShader(n),e.attachShader(t,r),e.attachShader(t,n),e.linkProgram(t),t}function s(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:e.id-t.id}var u,l,d,f,p,m,v=new c,g=new h,y=new c;this.render=function(i,o,h){if(0!==i.length){void 0===d&&a(),r.useProgram(d),r.initAttributes(),r.enableAttribute(f.position),r.enableAttribute(f.uv),r.disableUnusedAttributes(),r.disable(e.CULL_FACE),r.enable(e.BLEND),e.bindBuffer(e.ARRAY_BUFFER,u),e.vertexAttribPointer(f.position,2,e.FLOAT,!1,16,0),e.vertexAttribPointer(f.uv,2,e.FLOAT,!1,16,8),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,l),e.uniformMatrix4fv(p.projectionMatrix,!1,h.projectionMatrix.elements),r.activeTexture(e.TEXTURE0),e.uniform1i(p.map,0);var c=0,x=0,_=o.fog;_?(e.uniform3f(p.fogColor,_.color.r,_.color.g,_.color.b),_.isFog?(e.uniform1f(p.fogNear,_.near),e.uniform1f(p.fogFar,_.far),e.uniform1i(p.fogType,1),c=1,x=1):_.isFogExp2&&(e.uniform1f(p.fogDensity,_.density),e.uniform1i(p.fogType,2),c=2,x=2)):(e.uniform1i(p.fogType,0),c=0,x=0);for(var b=0,w=i.length;b<w;b++){var M=i[b];M.modelViewMatrix.multiplyMatrices(h.matrixWorldInverse,M.matrixWorld),M.z=-M.modelViewMatrix.elements[14]}i.sort(s);for(var E=[],b=0,w=i.length;b<w;b++){var M=i[b],T=M.material;if(!1!==T.visible){M.onBeforeRender(t,o,h,void 0,T,void 0),e.uniform1f(p.alphaTest,T.alphaTest),e.uniformMatrix4fv(p.modelViewMatrix,!1,M.modelViewMatrix.elements),M.matrixWorld.decompose(v,g,y),E[0]=y.x,E[1]=y.y;var S=0;o.fog&&T.fog&&(S=x),c!==S&&(e.uniform1i(p.fogType,S),c=S),null!==T.map?(e.uniform2f(p.uvOffset,T.map.offset.x,T.map.offset.y),e.uniform2f(p.uvScale,T.map.repeat.x,T.map.repeat.y)):(e.uniform2f(p.uvOffset,0,0),e.uniform2f(p.uvScale,1,1)),e.uniform1f(p.opacity,T.opacity),e.uniform3f(p.color,T.color.r,T.color.g,T.color.b),e.uniform1f(p.rotation,T.rotation),e.uniform2fv(p.scale,E),r.setBlending(T.blending,T.blendEquation,T.blendSrc,T.blendDst,T.blendEquationAlpha,T.blendSrcAlpha,T.blendDstAlpha,T.premultipliedAlpha),r.buffers.depth.setTest(T.depthTest),r.buffers.depth.setMask(T.depthWrite),n.setTexture2D(T.map||m,0),e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0),M.onAfterRender(t,o,h,void 0,T,void 0)}}r.enable(e.CULL_FACE),r.reset()}}}function $(){Object.defineProperty(this,"id",{value:qs++}),this.uuid=Os.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=Da,this.side=Ta,this.flatShading=!1,this.vertexColors=Ra,this.opacity=1,this.transparent=!1,this.blendSrc=Ya,this.blendDst=Za,this.blendEquation=za,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=io,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this.userData={},this.needsUpdate=!0}function tt(t){$.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function et(t){$.call(this),this.type="MeshDepthMaterial",this.depthPacking=Rs,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(t)}function rt(t){$.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new c,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(t)}function nt(t,e){this.min=void 0!==t?t:new c(1/0,1/0,1/0),this.max=void 0!==e?e:new c(-1/0,-1/0,-1/0)}function it(t,e){this.center=void 0!==t?t:new c,this.radius=void 0!==e?e:0}function at(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function ot(t,e){this.normal=void 0!==t?t:new c(1,0,0),this.constant=void 0!==e?e:0}function st(t,e,r,n,i,a){this.planes=[void 0!==t?t:new ot,void 0!==e?e:new ot,void 0!==r?r:new ot,void 0!==n?n:new ot,void 0!==i?i:new ot,void 0!==a?a:new ot]}function ut(t,e,r){function n(e,r,n,i,a,o){var s=e.geometry,u=null,h=x,c=e.customDepthMaterial;if(n&&(h=_,c=e.customDistanceMaterial),c)u=c;else{var l=!1;r.morphTargets&&(s&&s.isBufferGeometry?l=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0:s&&s.isGeometry&&(l=s.morphTargets&&s.morphTargets.length>0)),e.isSkinnedMesh&&!1===r.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e);var d=e.isSkinnedMesh&&r.skinning,f=0;l&&(f|=v),d&&(f|=g),u=h[f]}if(t.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){var p=u.uuid,m=r.uuid,y=b[p];void 0===y&&(y={},b[p]=y);var w=y[m];void 0===w&&(w=u.clone(),y[m]=w),u=w}u.visible=r.visible,u.wireframe=r.wireframe;var M=r.side;return R.renderSingleSided&&M==Aa&&(M=Ta),R.renderReverseSided&&(M===Ta?M=Sa:M===Sa&&(M=Ta)),u.side=M,u.clipShadows=r.clipShadows,u.clippingPlanes=r.clippingPlanes,u.clipIntersection=r.clipIntersection,u.wireframeLinewidth=r.wireframeLinewidth,u.linewidth=r.linewidth,n&&u.isMeshDistanceMaterial&&(u.referencePosition.copy(i),u.nearDistance=a,u.farDistance=o),u}function a(r,i,o,s){if(!1!==r.visible){if(r.layers.test(i.layers)&&(r.isMesh||r.isLine||r.isPoints)&&r.castShadow&&(!r.frustumCulled||u.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,r.matrixWorld);var h=e.update(r),c=r.material;if(Array.isArray(c))for(var l=h.groups,d=0,f=l.length;d<f;d++){var p=l[d],v=c[p.materialIndex];if(v&&v.visible){var g=n(r,v,s,m,o.near,o.far);t.renderBufferDirect(o,null,h,g,r,p)}}else if(c.visible){var g=n(r,c,s,m,o.near,o.far);t.renderBufferDirect(o,null,h,g,r,null)}}for(var y=r.children,x=0,_=y.length;x<_;x++)a(y[x],i,o,s)}}for(var u=new st,h=new l,d=new i,f=new i(r,r),p=new c,m=new c,v=1,g=2,y=1+(v|g),x=new Array(y),_=new Array(y),b={},w=[new c(1,0,0),new c(-1,0,0),new c(0,0,1),new c(0,0,-1),new c(0,1,0),new c(0,-1,0)],M=[new c(0,1,0),new c(0,1,0),new c(0,1,0),new c(0,1,0),new c(0,0,1),new c(0,0,-1)],E=[new o,new o,new o,new o,new o,new o],T=0;T!==y;++T){var S=0!=(T&v),A=0!=(T&g),L=new et({depthPacking:Cs,morphTargets:S,skinning:A});x[T]=L;var P=new rt({morphTargets:S,skinning:A});_[T]=P}var R=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ma,this.renderReverseSided=!0,this.renderSingleSided=!0,this.render=function(e,r,n){if(!1!==R.enabled&&(!1!==R.autoUpdate||!1!==R.needsUpdate)&&0!==e.length){var i=t.context,o=t.state;o.disable(i.BLEND),o.buffers.color.setClear(1,1,1,1),o.buffers.depth.setTest(!0),o.setScissorTest(!1);for(var c,l=0,v=e.length;l<v;l++){var g=e[l],y=g.shadow,x=g&&g.isPointLight;if(void 0!==y){var _=y.camera;if(d.copy(y.mapSize),d.min(f),x){var b=d.x,T=d.y;E[0].set(2*b,T,b,T),E[1].set(0,T,b,T),E[2].set(3*b,T,b,T),E[3].set(b,T,b,T),E[4].set(3*b,0,b,T),E[5].set(b,0,b,T),d.x*=4,d.y*=2}if(null===y.map){var S={minFilter:Po,magFilter:Po,format:Zo};y.map=new s(d.x,d.y,S),y.map.texture.name=g.name+".shadowMap",_.updateProjectionMatrix()}y.isSpotLightShadow&&y.update(g);var A=y.map,L=y.matrix;m.setFromMatrixPosition(g.matrixWorld),_.position.copy(m),x?(c=6,L.makeTranslation(-m.x,-m.y,-m.z)):(c=1,p.setFromMatrixPosition(g.target.matrixWorld),_.lookAt(p),_.updateMatrixWorld(),L.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),L.multiply(_.projectionMatrix),L.multiply(_.matrixWorldInverse)),t.setRenderTarget(A),t.clear();for(var P=0;P<c;P++){if(x){p.copy(_.position),p.add(w[P]),_.up.copy(M[P]),_.lookAt(p),_.updateMatrixWorld();var C=E[P];o.viewport(C)}h.multiplyMatrices(_.projectionMatrix,_.matrixWorldInverse),u.setFromMatrix(h),a(r,n,_,x)}}else console.warn("THREE.WebGLShadowMap:",g,"has no shadow.")}R.needsUpdate=!1}}}function ht(t){function e(e,r){var n=e.array,i=e.dynamic?t.DYNAMIC_DRAW:t.STATIC_DRAW,a=t.createBuffer();t.bindBuffer(r,a),t.bufferData(r,n,i),e.onUploadCallback();var o=t.FLOAT;return n instanceof Float32Array?o=t.FLOAT:n instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):n instanceof Uint16Array?o=t.UNSIGNED_SHORT:n instanceof Int16Array?o=t.SHORT:n instanceof Uint32Array?o=t.UNSIGNED_INT:n instanceof Int32Array?o=t.INT:n instanceof Int8Array?o=t.BYTE:n instanceof Uint8Array&&(o=t.UNSIGNED_BYTE),{buffer:a,type:o,bytesPerElement:n.BYTES_PER_ELEMENT,version:e.version}}function r(e,r,n){var i=r.array,a=r.updateRange;t.bindBuffer(n,e),!1===r.dynamic?t.bufferData(n,i,t.STATIC_DRAW):-1===a.count?t.bufferSubData(n,0,i):0===a.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(t.bufferSubData(n,a.offset*i.BYTES_PER_ELEMENT,i.subarray(a.offset,a.offset+a.count)),a.count=-1)}function n(t){return t.isInterleavedBufferAttribute&&(t=t.data),o[t.uuid]}function i(e){e.isInterleavedBufferAttribute&&(e=e.data);var r=o[e.uuid];r&&(t.deleteBuffer(r.buffer),delete o[e.uuid])}function a(t,n){t.isInterleavedBufferAttribute&&(t=t.data);var i=o[t.uuid];void 0===i?o[t.uuid]=e(t,n):i.version<t.version&&(r(i.buffer,t,n),i.version=t.version)}var o={};return{get:n,remove:i,update:a}}function ct(t,e,r,n){this._x=t||0,this._y=e||0,this._z=r||0,this._order=n||ct.DefaultOrder}function lt(){this.mask=1}function dt(){function t(){i.setFromEuler(n,!1)}function e(){n.setFromQuaternion(i,void 0,!1)}Object.defineProperty(this,"id",{value:Xs++}),this.uuid=Os.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=dt.DefaultUp.clone();var r=new c,n=new ct,i=new h,a=new c(1,1,1);n.onChange(t),i.onChange(e),Object.defineProperties(this,{position:{enumerable:!0,value:r},rotation:{enumerable:!0,value:n},quaternion:{enumerable:!0,value:i},scale:{enumerable:!0,value:a},modelViewMatrix:{value:new l},normalMatrix:{value:new at}}),this.matrix=new l,this.matrixWorld=new l,this.matrixAutoUpdate=dt.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new lt,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function ft(){dt.call(this),this.type="Camera",this.matrixWorldInverse=new l,this.projectionMatrix=new l}function pt(t,e,r,n,i,a){ft.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=r,this.bottom=n,this.near=void 0!==i?i:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function mt(t,e,r,n){ft.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==r?r:.1,this.far=void 0!==n?n:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function vt(t,e,r,n,i,a){this.a=t,this.b=e,this.c=r,this.normal=n&&n.isVector3?n:new c,this.vertexNormals=Array.isArray(n)?n:[],this.color=i&&i.isColor?i:new Y,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==a?a:0}function gt(){return Ys++}function yt(){Object.defineProperty(this,"id",{value:gt()}),this.uuid=Os.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function xt(t,e,r){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.uuid=Os.generateUUID(),this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===r,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function _t(t,e){xt.call(this,new Int8Array(t),e)}function bt(t,e){xt.call(this,new Uint8Array(t),e)}function wt(t,e){xt.call(this,new Uint8ClampedArray(t),e)}function Mt(t,e){xt.call(this,new Int16Array(t),e)}function Et(t,e){xt.call(this,new Uint16Array(t),e)}function Tt(t,e){xt.call(this,new Int32Array(t),e)}function St(t,e){xt.call(this,new Uint32Array(t),e)}function At(t,e){xt.call(this,new Float32Array(t),e)}function Lt(t,e){xt.call(this,new Float64Array(t),e)}function Pt(){this.indices=[],this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function Rt(t){if(0===t.length)return-1/0;for(var e=t[0],r=1,n=t.length;r<n;++r)t[r]>e&&(e=t[r]);return e}function Ct(){Object.defineProperty(this,"id",{value:gt()}),this.uuid=Os.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0}}function Ot(t,e,r,n,i,a){yt.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:r,widthSegments:n,heightSegments:i,depthSegments:a},this.fromBufferGeometry(new It(t,e,r,n,i,a)),this.mergeVertices()}function It(t,e,r,n,i,a){function o(t,e,r,n,i,a,o,m,v,g,y){var x,_,b=a/v,w=o/g,M=a/2,E=o/2,T=m/2,S=v+1,A=g+1,L=0,P=0,R=new c;for(_=0;_<A;_++){var C=_*w-E;for(x=0;x<S;x++){var O=x*b-M;R[t]=O*n,R[e]=C*i,R[r]=T,h.push(R.x,R.y,R.z),R[t]=0,R[e]=0,R[r]=m>0?1:-1,l.push(R.x,R.y,R.z),d.push(x/v),d.push(1-_/g),L+=1}}for(_=0;_<g;_++)for(x=0;x<v;x++){var I=f+x+S*_,D=f+x+S*(_+1),N=f+(x+1)+S*(_+1),U=f+(x+1)+S*_;u.push(I,D,U),u.push(D,N,U),P+=6}s.addGroup(p,P,y),p+=P,f+=L}Ct.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:r,widthSegments:n,heightSegments:i,depthSegments:a};var s=this;n=Math.floor(n)||1,i=Math.floor(i)||1,a=Math.floor(a)||1;var u=[],h=[],l=[],d=[],f=0,p=0;o("z","y","x",-1,-1,r,e,t,a,i,0),o("z","y","x",1,-1,r,e,-t,a,i,1),o("x","z","y",1,1,t,r,e,n,a,2),o("x","z","y",1,-1,t,r,-e,n,a,3),o("x","y","z",1,-1,t,e,r,n,i,4),o("x","y","z",-1,-1,t,e,-r,n,i,5),this.setIndex(u),this.addAttribute("position",new At(h,3)),this.addAttribute("normal",new At(l,3)),this.addAttribute("uv",new At(d,2))}function Dt(t,e,r,n){yt.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:r,heightSegments:n},this.fromBufferGeometry(new Nt(t,e,r,n)),this.mergeVertices()}function Nt(t,e,r,n){Ct.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:r,heightSegments:n};var i,a,o=t/2,s=e/2,u=Math.floor(r)||1,h=Math.floor(n)||1,c=u+1,l=h+1,d=t/u,f=e/h,p=[],m=[],v=[],g=[];for(a=0;a<l;a++){var y=a*f-s;for(i=0;i<c;i++){var x=i*d-o;m.push(x,-y,0),v.push(0,0,1),g.push(i/u),g.push(1-a/h)}}for(a=0;a<h;a++)for(i=0;i<u;i++){var _=i+c*a,b=i+c*(a+1),w=i+1+c*(a+1),M=i+1+c*a;p.push(_,b,M),p.push(b,w,M)}this.setIndex(p),this.addAttribute("position",new At(m,3)),this.addAttribute("normal",new At(v,3)),this.addAttribute("uv",new At(g,2))}function Ut(t){$.call(this),this.type="MeshBasicMaterial",this.color=new Y(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ho,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function Ft(t,e){this.origin=void 0!==t?t:new c,this.direction=void 0!==e?e:new c}function Bt(t,e){this.start=void 0!==t?t:new c,this.end=void 0!==e?e:new c}function zt(t,e,r){this.a=void 0!==t?t:new c,this.b=void 0!==e?e:new c,this.c=void 0!==r?r:new c}function Gt(t,e){dt.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new Ct,this.material=void 0!==e?e:new Ut({color:16777215*Math.random()}),this.drawMode=xs,this.updateMorphTargets()}function jt(t,e,r,n){function i(e,n,i,l){var d=n.background;null===d?a(h,c):d&&d.isColor&&(a(d,1),l=!0),(t.autoClear||l)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),d&&d.isCubeTexture?(void 0===u&&(u=new Gt(new It(1,1,1),new tt({uniforms:Ws.cube.uniforms,vertexShader:Ws.cube.vertexShader,fragmentShader:Ws.cube.fragmentShader,side:Sa,depthTest:!0,depthWrite:!1,polygonOffset:!0,fog:!1})),u.geometry.removeAttribute("normal"),u.geometry.removeAttribute("uv"),u.onBeforeRender=function(t,e,r){var n=r.far;this.matrixWorld.makeScale(n,n,n),this.matrixWorld.copyPosition(r.matrixWorld),this.material.polygonOffsetUnits=10*n},r.update(u.geometry)),u.material.uniforms.tCube.value=d,e.push(u,u.geometry,u.material,0,null)):d&&d.isTexture&&(void 0===o&&(o=new pt(-1,1,1,-1,0,1),s=new Gt(new Nt(2,2),new Ut({depthTest:!1,depthWrite:!1,fog:!1})),r.update(s.geometry)),s.material.map=d,t.renderBufferDirect(o,null,s.geometry,s.material,s,null))}function a(t,r){e.buffers.color.setClear(t.r,t.g,t.b,r,n)}var o,s,u,h=new Y(0),c=0;return{getClearColor:function(){return h},setClearColor:function(t,e){h.set(t),c=void 0!==e?e:1,a(h,c)},getClearAlpha:function(){return c},setClearAlpha:function(t){c=t,a(h,c)},render:i}}function Vt(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program&&e.program&&t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function kt(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Ht(){function t(){i=0,a.length=0,o.length=0}function e(t,e,r,s,u){var h=n[i];void 0===h?(h={id:t.id,object:t,geometry:e,material:r,program:r.program,renderOrder:t.renderOrder,z:s,group:u},n[i]=h):(h.id=t.id,h.object=t,h.geometry=e,h.material=r,h.program=r.program,h.renderOrder=t.renderOrder,h.z=s,h.group=u),(!0===r.transparent?o:a).push(h),i++}function r(){a.length>1&&a.sort(Vt),o.length>1&&o.sort(kt)}var n=[],i=0,a=[],o=[];return{opaque:a,transparent:o,init:t,push:e,sort:r}}function Wt(){function t(t,e){var n=t.id+","+e.id,i=r[n];return void 0===i&&(i=new Ht,r[n]=i),i}function e(){r={}}var r={};return{get:t,dispose:e}}function qt(t,e){return Math.abs(e[1])-Math.abs(t[1])}function Xt(t){function e(e,i,a,o){var s=e.morphTargetInfluences,u=s.length,h=r[i.id];if(void 0===h){h=[];for(var c=0;c<u;c++)h[c]=[c,0];r[i.id]=h}for(var l=a.morphTargets&&i.morphAttributes.position,d=a.morphNormals&&i.morphAttributes.normal,c=0;c<u;c++){var f=h[c];0!==f[1]&&(l&&i.removeAttribute("morphTarget"+c),d&&i.removeAttribute("morphNormal"+c))}for(var c=0;c<u;c++){var f=h[c];f[0]=c,f[1]=s[c]}h.sort(qt);for(var c=0;c<8;c++){var f=h[c];if(f){var p=f[0],m=f[1];if(m){l&&i.addAttribute("morphTarget"+c,l[p]),d&&i.addAttribute("morphNormal"+c,d[p]),n[c]=m;continue}}n[c]=0}o.getUniforms().setValue(t,"morphTargetInfluences",n)}var r={},n=new Float32Array(8);return{update:e}}function Yt(t,e,r){function n(t){s=t}function i(t){u=t.type,h=t.bytesPerElement}function a(e,n){t.drawElements(s,n,u,e*h),r.calls++,r.vertices+=n,s===t.TRIANGLES?r.faces+=n/3:s===t.POINTS&&(r.points+=n)}function o(n,i,a){var o=e.get("ANGLE_instanced_arrays");if(null===o)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");o.drawElementsInstancedANGLE(s,a,u,i*h,n.maxInstancedCount),r.calls++,r.vertices+=a*n.maxInstancedCount,s===t.TRIANGLES?r.faces+=n.maxInstancedCount*a/3:s===t.POINTS&&(r.points+=n.maxInstancedCount*a)}var s,u,h;this.setMode=n,this.setIndex=i,this.render=a,this.renderInstances=o}function Zt(t,e,r){function n(t){o=t}function i(e,n){t.drawArrays(o,e,n),r.calls++,r.vertices+=n,o===t.TRIANGLES?r.faces+=n/3:o===t.POINTS&&(r.points+=n)}function a(n,i,a){var s=e.get("ANGLE_instanced_arrays");if(null===s)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");var u=n.attributes.position;u.isInterleavedBufferAttribute?(a=u.data.count,s.drawArraysInstancedANGLE(o,0,a,n.maxInstancedCount)):s.drawArraysInstancedANGLE(o,i,a,n.maxInstancedCount),r.calls++,r.vertices+=a*n.maxInstancedCount,o===t.TRIANGLES?r.faces+=n.maxInstancedCount*a/3:o===t.POINTS&&(r.points+=n.maxInstancedCount*a)}var o;this.setMode=n,this.render=i,this.renderInstances=a}function Kt(t,e,r){function n(t){var i=t.target,a=s[i.id];null!==a.index&&e.remove(a.index);for(var o in a.attributes)e.remove(a.attributes[o]);i.removeEventListener("dispose",n),delete s[i.id];var h=u[i.id];h&&(e.remove(h),delete u[i.id]),h=u[a.id],h&&(e.remove(h),delete u[a.id]),r.geometries--}function i(t,e){var i=s[e.id];return i||(e.addEventListener("dispose",n),e.isBufferGeometry?i=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new Ct).setFromObject(t)),i=e._bufferGeometry),s[e.id]=i,r.geometries++,i)}function a(r){var n=r.index,i=r.attributes;null!==n&&e.update(n,t.ELEMENT_ARRAY_BUFFER);for(var a in i)e.update(i[a],t.ARRAY_BUFFER);var o=r.morphAttributes;for(var a in o)for(var s=o[a],u=0,h=s.length;u<h;u++)e.update(s[u],t.ARRAY_BUFFER)}function o(r){var n=u[r.id];if(n)return n;var i=[],a=r.index,o=r.attributes;if(null!==a)for(var s=a.array,h=0,c=s.length;h<c;h+=3){var l=s[h+0],d=s[h+1],f=s[h+2];i.push(l,d,d,f,f,l)}else for(var s=o.position.array,h=0,c=s.length/3-1;h<c;h+=3){var l=h+0,d=h+1,f=h+2;i.push(l,d,d,f,f,l)}return n=new(Rt(i)>65535?St:Et)(i,1),e.update(n,t.ELEMENT_ARRAY_BUFFER),u[r.id]=n,n}var s={},u={};return{get:i,update:a,getWireframeAttribute:o}}function Qt(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var r;switch(e.type){case"DirectionalLight":r={direction:new c,color:new Y,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"SpotLight":r={position:new c,direction:new c,color:new Y,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"PointLight":r={position:new c,color:new Y,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":r={direction:new c,skyColor:new Y,groundColor:new Y};break;case"RectAreaLight":r={color:new Y,position:new c,halfWidth:new c,halfHeight:new c}}return t[e.id]=r,r}}}function Jt(){function t(t,o,s){for(var u=0,h=0,c=0,l=0,d=0,f=0,p=0,m=0,v=s.matrixWorldInverse,g=0,y=t.length;g<y;g++){var x=t[g],_=x.color,b=x.intensity,w=x.distance,M=x.shadow&&x.shadow.map?x.shadow.map.texture:null;if(x.isAmbientLight)u+=_.r*b,h+=_.g*b,c+=_.b*b;else if(x.isDirectionalLight){var E=e.get(x);if(E.color.copy(x.color).multiplyScalar(x.intensity),E.direction.setFromMatrixPosition(x.matrixWorld),n.setFromMatrixPosition(x.target.matrixWorld),E.direction.sub(n),E.direction.transformDirection(v),E.shadow=x.castShadow,x.castShadow){var T=x.shadow;E.shadowBias=T.bias,E.shadowRadius=T.radius,E.shadowMapSize=T.mapSize}r.directionalShadowMap[l]=M,r.directionalShadowMatrix[l]=x.shadow.matrix,r.directional[l]=E,l++}else if(x.isSpotLight){var E=e.get(x);if(E.position.setFromMatrixPosition(x.matrixWorld),E.position.applyMatrix4(v),E.color.copy(_).multiplyScalar(b),E.distance=w,E.direction.setFromMatrixPosition(x.matrixWorld),n.setFromMatrixPosition(x.target.matrixWorld),E.direction.sub(n),E.direction.transformDirection(v),E.coneCos=Math.cos(x.angle),E.penumbraCos=Math.cos(x.angle*(1-x.penumbra)),E.decay=0===x.distance?0:x.decay,E.shadow=x.castShadow,x.castShadow){var T=x.shadow;E.shadowBias=T.bias,E.shadowRadius=T.radius,E.shadowMapSize=T.mapSize}r.spotShadowMap[f]=M,r.spotShadowMatrix[f]=x.shadow.matrix,r.spot[f]=E,f++}else if(x.isRectAreaLight){var E=e.get(x);E.color.copy(_).multiplyScalar(b/(x.width*x.height)),E.position.setFromMatrixPosition(x.matrixWorld),E.position.applyMatrix4(v),a.identity(),i.copy(x.matrixWorld),i.premultiply(v),a.extractRotation(i),E.halfWidth.set(.5*x.width,0,0),E.halfHeight.set(0,.5*x.height,0),E.halfWidth.applyMatrix4(a),E.halfHeight.applyMatrix4(a),r.rectArea[p]=E,p++}else if(x.isPointLight){var E=e.get(x);if(E.position.setFromMatrixPosition(x.matrixWorld),E.position.applyMatrix4(v),E.color.copy(x.color).multiplyScalar(x.intensity),E.distance=x.distance,E.decay=0===x.distance?0:x.decay,E.shadow=x.castShadow,x.castShadow){var T=x.shadow;E.shadowBias=T.bias,E.shadowRadius=T.radius,E.shadowMapSize=T.mapSize,E.shadowCameraNear=T.camera.near,E.shadowCameraFar=T.camera.far}r.pointShadowMap[d]=M,r.pointShadowMatrix[d]=x.shadow.matrix,r.point[d]=E,d++}else if(x.isHemisphereLight){var E=e.get(x);E.direction.setFromMatrixPosition(x.matrixWorld),E.direction.transformDirection(v),E.direction.normalize(),E.skyColor.copy(x.color).multiplyScalar(b),E.groundColor.copy(x.groundColor).multiplyScalar(b),r.hemi[m]=E,m++}}r.ambient[0]=u,r.ambient[1]=h,r.ambient[2]=c,r.directional.length=l,r.spot.length=f,r.rectArea.length=p,r.point.length=d,r.hemi.length=m,r.hash=l+","+d+","+f+","+p+","+m+","+o.length}var e=new Qt,r={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},n=new c,i=new l,a=new l;return{setup:t,state:r}}function $t(t,e){function r(r){var n=e.frame,a=r.geometry,o=t.get(r,a);return i[o.id]!==n&&(a.isGeometry&&o.updateFromObject(r),t.update(o),i[o.id]=n),o}function n(){i={}}var i={};return{update:r,clear:n}}function te(t){for(var e=t.split("\n"),r=0;r<e.length;r++)e[r]=r+1+": "+e[r];return e.join("\n")}function ee(t,e,r){var n=t.createShader(e);return t.shaderSource(n,r),t.compileShader(n),!1===t.getShaderParameter(n,t.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(n)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",e===t.VERTEX_SHADER?"vertex":"fragment",t.getShaderInfoLog(n),te(r)),n}function re(t){switch(t){case ws:return["Linear","( value )"];case Ms:return["sRGB","( value )"];case Ts:return["RGBE","( value )"];case As:return["RGBM","( value, 7.0 )"];case Ls:return["RGBM","( value, 16.0 )"];case Ps:return["RGBD","( value, 256.0 )"];case Es:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+t)}}function ne(t,e){var r=re(e);return"vec4 "+t+"( vec4 value ) { return "+r[0]+"ToLinear"+r[1]+"; }"}function ie(t,e){var r=re(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+r[0]+r[1]+"; }"}function ae(t,e){var r;switch(e){case po:r="Linear";break;case mo:r="Reinhard";break;case vo:r="Uncharted2";break;case go:r="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+r+"ToneMapping( color ); }"}function oe(t,e,r){return t=t||{},[t.derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&r.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&r.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&r.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(he).join("\n")}function se(t){var e=[];for(var r in t){var n=t[r];!1!==n&&e.push("#define "+r+" "+n)}return e.join("\n")}function ue(t,e,r){for(var n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),a=0;a<i;a++){var o=t.getActiveAttrib(e,a),s=o.name;n[s]=t.getAttribLocation(e,s)}return n}function he(t){return""!==t}function ce(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function le(t){function e(t,e){var r=Hs[e];if(void 0===r)throw new Error("Can not resolve #include <"+e+">");return le(r)}var r=/^[ \t]*#include +<([\w\d.]+)>/gm;return t.replace(r,e)}function de(t){function e(t,e,r,n){for(var i="",a=parseInt(e);a<parseInt(r);a++)i+=n.replace(/\[ i \]/g,"[ "+a+" ]");return i}var r=/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;return t.replace(r,e)}function fe(t,e,r,n,i,a){var o=t.context,s=n.defines,u=i.vertexShader,h=i.fragmentShader,c="SHADOWMAP_TYPE_BASIC";a.shadowMapType===Ma?c="SHADOWMAP_TYPE_PCF":a.shadowMapType===Ea&&(c="SHADOWMAP_TYPE_PCF_SOFT");var l="ENVMAP_TYPE_CUBE",d="ENVMAP_MODE_REFLECTION",f="ENVMAP_BLENDING_MULTIPLY";if(a.envMap){switch(n.envMap.mapping){case xo:case _o:l="ENVMAP_TYPE_CUBE";break;case Eo:case To:l="ENVMAP_TYPE_CUBE_UV";break;case bo:case wo:l="ENVMAP_TYPE_EQUIREC";break;case Mo:l="ENVMAP_TYPE_SPHERE"}switch(n.envMap.mapping){case _o:case wo:d="ENVMAP_MODE_REFRACTION"}switch(n.combine){case ho:f="ENVMAP_BLENDING_MULTIPLY";break;case co:f="ENVMAP_BLENDING_MIX";break;case lo:f="ENVMAP_BLENDING_ADD"}}var p,m,v=t.gammaFactor>0?t.gammaFactor:1,g=oe(n.extensions,a,e),y=se(s),x=o.createProgram();n.isRawShaderMaterial?(p=[y,"\n"].filter(he).join("\n"),m=[g,y,"\n"].filter(he).join("\n")):(p=["precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+i.name,y,a.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+v,"#define MAX_BONES "+a.maxBones,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+d:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.displacementMap&&a.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexColors?"#define USE_COLOR":"",a.flatShading?"#define FLAT_SHADED":"",a.skinning?"#define USE_SKINNING":"",a.useVertexTexture?"#define BONE_TEXTURE":"",a.morphTargets?"#define USE_MORPHTARGETS":"",a.morphNormals&&!1===a.flatShading?"#define USE_MORPHNORMALS":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+a.numClippingPlanes,a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+c:"",a.sizeAttenuation?"#define USE_SIZEATTENUATION":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&e.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(he).join("\n"),m=[g,"precision "+a.precision+" float;","precision "+a.precision+" int;","#define SHADER_NAME "+i.name,y,a.alphaTest?"#define ALPHATEST "+a.alphaTest:"","#define GAMMA_FACTOR "+v,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+l:"",a.envMap?"#define "+d:"",a.envMap?"#define "+f:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.vertexColors?"#define USE_COLOR":"",a.gradientMap?"#define USE_GRADIENTMAP":"",a.flatShading?"#define FLAT_SHADED":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+a.numClippingPlanes,"#define UNION_CLIPPING_PLANES "+(a.numClippingPlanes-a.numClipIntersection),a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+c:"",a.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",a.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&e.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",a.envMap&&e.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",a.toneMapping!==fo?"#define TONE_MAPPING":"",a.toneMapping!==fo?Hs.tonemapping_pars_fragment:"",a.toneMapping!==fo?ae("toneMapping",a.toneMapping):"",a.dithering?"#define DITHERING":"",a.outputEncoding||a.mapEncoding||a.envMapEncoding||a.emissiveMapEncoding?Hs.encodings_pars_fragment:"",a.mapEncoding?ne("mapTexelToLinear",a.mapEncoding):"",a.envMapEncoding?ne("envMapTexelToLinear",a.envMapEncoding):"",a.emissiveMapEncoding?ne("emissiveMapTexelToLinear",a.emissiveMapEncoding):"",a.outputEncoding?ie("linearToOutputTexel",a.outputEncoding):"",a.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(he).join("\n")),u=le(u),u=ce(u,a),h=le(h),h=ce(h,a),n.isShaderMaterial||(u=de(u),h=de(h));var _=p+u,b=m+h,w=ee(o,o.VERTEX_SHADER,_),M=ee(o,o.FRAGMENT_SHADER,b);o.attachShader(x,w),o.attachShader(x,M),void 0!==n.index0AttributeName?o.bindAttribLocation(x,0,n.index0AttributeName):!0===a.morphTargets&&o.bindAttribLocation(x,0,"position"),o.linkProgram(x);var E=o.getProgramInfoLog(x),T=o.getShaderInfoLog(w),S=o.getShaderInfoLog(M),A=!0,L=!0;!1===o.getProgramParameter(x,o.LINK_STATUS)?(A=!1,console.error("THREE.WebGLProgram: shader error: ",o.getError(),"gl.VALIDATE_STATUS",o.getProgramParameter(x,o.VALIDATE_STATUS),"gl.getProgramInfoLog",E,T,S)):""!==E?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",E):""!==T&&""!==S||(L=!1),L&&(this.diagnostics={runnable:A,material:n,programLog:E,vertexShader:{log:T,prefix:p},fragmentShader:{log:S,prefix:m}}),o.deleteShader(w),o.deleteShader(M);var P;this.getUniforms=function(){return void 0===P&&(P=new X(o,x,t)),P};var R;return this.getAttributes=function(){return void 0===R&&(R=ue(o,x)),R},this.destroy=function(){o.deleteProgram(x),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=Zs++,this.code=r,this.usedTimes=1,this.program=x,this.vertexShader=w,this.fragmentShader=M,this}function pe(t,e,r){function n(t){var e=t.skeleton,n=e.bones;if(r.floatVertexTextures)return 1024;var i=r.maxVertexUniforms,a=Math.floor((i-20)/4),o=Math.min(a,n.length);return o<n.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+n.length+" bones. This GPU supports "+o+"."),0):o}function i(t,e){var r;return t?t.isTexture?r=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),r=t.texture.encoding):r=ws,r===ws&&e&&(r=Es),r}var a=[],o={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow"},s=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];this.getParameters=function(e,a,s,u,h,c,l){var d=o[e.type],f=l.isSkinnedMesh?n(l):0,p=r.precision;null!==e.precision&&(p=r.getMaxPrecision(e.precision))!==e.precision&&console.warn("THREE.WebGLProgram.getParameters:",e.precision,"not supported, using",p,"instead.");var m=t.getRenderTarget();return{shaderID:d,precision:p,supportsVertexTextures:r.vertexTextures,outputEncoding:i(m?m.texture:null,t.gammaOutput),map:!!e.map,mapEncoding:i(e.map,t.gammaInput),envMap:!!e.envMap,envMapMode:e.envMap&&e.envMap.mapping,envMapEncoding:i(e.envMap,t.gammaInput),envMapCubeUV:!!e.envMap&&(e.envMap.mapping===Eo||e.envMap.mapping===To),lightMap:!!e.lightMap,aoMap:!!e.aoMap,emissiveMap:!!e.emissiveMap,emissiveMapEncoding:i(e.emissiveMap,t.gammaInput),bumpMap:!!e.bumpMap,normalMap:!!e.normalMap,displacementMap:!!e.displacementMap,roughnessMap:!!e.roughnessMap,metalnessMap:!!e.metalnessMap,specularMap:!!e.specularMap,alphaMap:!!e.alphaMap,gradientMap:!!e.gradientMap,combine:e.combine,vertexColors:e.vertexColors,fog:!!u,useFog:e.fog,fogExp:u&&u.isFogExp2,flatShading:e.flatShading,sizeAttenuation:e.sizeAttenuation,logarithmicDepthBuffer:r.logarithmicDepthBuffer,skinning:e.skinning&&f>0,maxBones:f,useVertexTexture:r.floatVertexTextures,morphTargets:e.morphTargets,morphNormals:e.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numClippingPlanes:h,numClipIntersection:c,dithering:e.dithering,shadowMapEnabled:t.shadowMap.enabled&&l.receiveShadow&&s.length>0,shadowMapType:t.shadowMap.type,toneMapping:t.toneMapping,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:e.premultipliedAlpha,alphaTest:e.alphaTest,doubleSided:e.side===Aa,flipSided:e.side===Sa,depthPacking:void 0!==e.depthPacking&&e.depthPacking}},this.getProgramCode=function(e,r){var n=[];if(r.shaderID?n.push(r.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(var i in e.defines)n.push(i),n.push(e.defines[i]);for(var a=0;a<s.length;a++)n.push(r[s[a]]);return n.push(e.onBeforeCompile.toString()),n.push(t.gammaOutput),n.join()},this.acquireProgram=function(r,n,i,o){for(var s,u=0,h=a.length;u<h;u++){var c=a[u];if(c.code===o){s=c,++s.usedTimes;break}}return void 0===s&&(s=new fe(t,e,o,r,n,i),a.push(s)),s},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=a.indexOf(t);a[e]=a[a.length-1],a.pop(),t.destroy()}},this.programs=a}function me(t,e,r,n,i,a,o){function s(t,e){if(t.width>e||t.height>e){var r=e/Math.max(t.width,t.height),n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");n.width=Math.floor(t.width*r),n.height=Math.floor(t.height*r);return n.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height),console.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+n.width+"x"+n.height,t),n}return t}function u(t){return Os.isPowerOfTwo(t.width)&&Os.isPowerOfTwo(t.height)}function h(t){if(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement){var e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");e.width=Os.nearestPowerOfTwo(t.width),e.height=Os.nearestPowerOfTwo(t.height);return e.getContext("2d").drawImage(t,0,0,e.width,e.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+t.width+"x"+t.height+"). Resized to "+e.width+"x"+e.height,t),e}return t}function c(t){return t.wrapS!==Ao||t.wrapT!==Ao||t.minFilter!==Po&&t.minFilter!==Oo}function l(t,e){return t.generateMipmaps&&e&&t.minFilter!==Po&&t.minFilter!==Oo}function d(e){return e===Po||e===Ro||e===Co?t.NEAREST:t.LINEAR}function f(t){var e=t.target;e.removeEventListener("dispose",f),m(e),o.textures--}function p(t){var e=t.target;e.removeEventListener("dispose",p),v(e),o.textures--}function m(e){var r=n.get(e);if(e.image&&r.__image__webglTextureCube)t.deleteTexture(r.__image__webglTextureCube);else{if(void 0===r.__webglInit)return;t.deleteTexture(r.__webglTexture)}n.remove(e)}function v(e){var r=n.get(e),i=n.get(e.texture);if(e){if(void 0!==i.__webglTexture&&t.deleteTexture(i.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLRenderTargetCube)for(var a=0;a<6;a++)t.deleteFramebuffer(r.__webglFramebuffer[a]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[a]);else t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer);n.remove(e.texture),n.remove(e)}}function g(e,i){var a=n.get(e);if(e.version>0&&a.__version!==e.version){var o=e.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",e);else{if(!1!==o.complete)return void b(a,e,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",e)}}r.activeTexture(t.TEXTURE0+i),r.bindTexture(t.TEXTURE_2D,a.__webglTexture)}function y(e,h){var c=n.get(e);if(6===e.image.length)if(e.version>0&&c.__version!==e.version){c.__image__webglTextureCube||(e.addEventListener("dispose",f),c.__image__webglTextureCube=t.createTexture(),o.textures++),r.activeTexture(t.TEXTURE0+h),r.bindTexture(t.TEXTURE_CUBE_MAP,c.__image__webglTextureCube),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e.flipY);for(var d=e&&e.isCompressedTexture,p=e.image[0]&&e.image[0].isDataTexture,m=[],v=0;v<6;v++)m[v]=d||p?p?e.image[v].image:e.image[v]:s(e.image[v],i.maxCubemapSize);var g=m[0],y=u(g),x=a.convert(e.format),b=a.convert(e.type);_(t.TEXTURE_CUBE_MAP,e,y);for(var v=0;v<6;v++)if(d)for(var w,M=m[v].mipmaps,E=0,T=M.length;E<T;E++)w=M[E],e.format!==Zo&&e.format!==Yo?r.getCompressedTextureFormats().indexOf(x)>-1?r.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+v,E,x,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+v,E,x,w.width,w.height,0,x,b,w.data);else p?r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+v,0,x,m[v].width,m[v].height,0,x,b,m[v].data):r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+v,0,x,x,b,m[v]);l(e,y)&&t.generateMipmap(t.TEXTURE_CUBE_MAP),c.__version=e.version,e.onUpdate&&e.onUpdate(e)}else r.activeTexture(t.TEXTURE0+h),r.bindTexture(t.TEXTURE_CUBE_MAP,c.__image__webglTextureCube)}function x(e,i){r.activeTexture(t.TEXTURE0+i),r.bindTexture(t.TEXTURE_CUBE_MAP,n.get(e).__webglTexture)}function _(r,o,s){var u;if(s?(t.texParameteri(r,t.TEXTURE_WRAP_S,a.convert(o.wrapS)),t.texParameteri(r,t.TEXTURE_WRAP_T,a.convert(o.wrapT)),t.texParameteri(r,t.TEXTURE_MAG_FILTER,a.convert(o.magFilter)),t.texParameteri(r,t.TEXTURE_MIN_FILTER,a.convert(o.minFilter))):(t.texParameteri(r,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(r,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),o.wrapS===Ao&&o.wrapT===Ao||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",o),t.texParameteri(r,t.TEXTURE_MAG_FILTER,d(o.magFilter)),t.texParameteri(r,t.TEXTURE_MIN_FILTER,d(o.minFilter)),o.minFilter!==Po&&o.minFilter!==Oo&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",o)),u=e.get("EXT_texture_filter_anisotropic")){if(o.type===jo&&null===e.get("OES_texture_float_linear"))return;if(o.type===Vo&&null===e.get("OES_texture_half_float_linear"))return;(o.anisotropy>1||n.get(o).__currentAnisotropy)&&(t.texParameterf(r,u.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),n.get(o).__currentAnisotropy=o.anisotropy)}}function b(e,n,d){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",f),e.__webglTexture=t.createTexture(),o.textures++),r.activeTexture(t.TEXTURE0+d),r.bindTexture(t.TEXTURE_2D,e.__webglTexture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,n.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,n.unpackAlignment);var p=s(n.image,i.maxTextureSize);c(n)&&!1===u(p)&&(p=h(p));var m=u(p),v=a.convert(n.format),g=a.convert(n.type);_(t.TEXTURE_2D,n,m);var y,x=n.mipmaps;if(n.isDepthTexture){var b=t.DEPTH_COMPONENT;if(n.type===jo){if(!L)throw new Error("Float Depth Texture only supported in WebGL2.0");b=t.DEPTH_COMPONENT32F}else L&&(b=t.DEPTH_COMPONENT16);n.format===$o&&b===t.DEPTH_COMPONENT&&n.type!==Bo&&n.type!==Go&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=Bo,g=a.convert(n.type)),n.format===ts&&(b=t.DEPTH_STENCIL,n.type!==qo&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=qo,g=a.convert(n.type))),r.texImage2D(t.TEXTURE_2D,0,b,p.width,p.height,0,v,g,null)}else if(n.isDataTexture)if(x.length>0&&m){for(var w=0,M=x.length;w<M;w++)y=x[w],r.texImage2D(t.TEXTURE_2D,w,v,y.width,y.height,0,v,g,y.data);n.generateMipmaps=!1}else r.texImage2D(t.TEXTURE_2D,0,v,p.width,p.height,0,v,g,p.data);else if(n.isCompressedTexture)for(var w=0,M=x.length;w<M;w++)y=x[w],n.format!==Zo&&n.format!==Yo?r.getCompressedTextureFormats().indexOf(v)>-1?r.compressedTexImage2D(t.TEXTURE_2D,w,v,y.width,y.height,0,y.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):r.texImage2D(t.TEXTURE_2D,w,v,y.width,y.height,0,v,g,y.data);else if(x.length>0&&m){for(var w=0,M=x.length;w<M;w++)y=x[w],r.texImage2D(t.TEXTURE_2D,w,v,v,g,y);n.generateMipmaps=!1}else r.texImage2D(t.TEXTURE_2D,0,v,v,g,p);l(n,m)&&t.generateMipmap(t.TEXTURE_2D),e.__version=n.version,n.onUpdate&&n.onUpdate(n)}function w(e,i,o,s){var u=a.convert(i.texture.format),h=a.convert(i.texture.type);r.texImage2D(s,0,u,i.width,i.height,0,u,h,null),t.bindFramebuffer(t.FRAMEBUFFER,e),t.framebufferTexture2D(t.FRAMEBUFFER,o,s,n.get(i.texture).__webglTexture,0),t.bindFramebuffer(t.FRAMEBUFFER,null)}function M(e,r){t.bindRenderbuffer(t.RENDERBUFFER,e),r.depthBuffer&&!r.stencilBuffer?(t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,r.width,r.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)):r.depthBuffer&&r.stencilBuffer?(t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,r.width,r.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)):t.renderbufferStorage(t.RENDERBUFFER,t.RGBA4,r.width,r.height),t.bindRenderbuffer(t.RENDERBUFFER,null)}function E(e,r){if(r&&r.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(t.FRAMEBUFFER,e),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(r.depthTexture).__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),g(r.depthTexture,0);var i=n.get(r.depthTexture).__webglTexture;if(r.depthTexture.format===$o)t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,i,0);else{if(r.depthTexture.format!==ts)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,i,0)}}function T(e){var r=n.get(e),i=!0===e.isWebGLRenderTargetCube;if(e.depthTexture){if(i)throw new Error("target.depthTexture not supported in Cube render targets");E(r.__webglFramebuffer,e)}else if(i){r.__webglDepthbuffer=[];for(var a=0;a<6;a++)t.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer[a]),r.__webglDepthbuffer[a]=t.createRenderbuffer(),M(r.__webglDepthbuffer[a],e)}else t.bindFramebuffer(t.FRAMEBUFFER,r.__webglFramebuffer),r.__webglDepthbuffer=t.createRenderbuffer(),M(r.__webglDepthbuffer,e);t.bindFramebuffer(t.FRAMEBUFFER,null)}function S(e){var i=n.get(e),a=n.get(e.texture);e.addEventListener("dispose",p),a.__webglTexture=t.createTexture(),o.textures++;var s=!0===e.isWebGLRenderTargetCube,h=u(e);if(s){i.__webglFramebuffer=[];for(var c=0;c<6;c++)i.__webglFramebuffer[c]=t.createFramebuffer()}else i.__webglFramebuffer=t.createFramebuffer();if(s){r.bindTexture(t.TEXTURE_CUBE_MAP,a.__webglTexture),_(t.TEXTURE_CUBE_MAP,e.texture,h);for(var c=0;c<6;c++)w(i.__webglFramebuffer[c],e,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+c);l(e.texture,h)&&t.generateMipmap(t.TEXTURE_CUBE_MAP),r.bindTexture(t.TEXTURE_CUBE_MAP,null)}else r.bindTexture(t.TEXTURE_2D,a.__webglTexture),_(t.TEXTURE_2D,e.texture,h),w(i.__webglFramebuffer,e,t.COLOR_ATTACHMENT0,t.TEXTURE_2D),l(e.texture,h)&&t.generateMipmap(t.TEXTURE_2D),r.bindTexture(t.TEXTURE_2D,null);e.depthBuffer&&T(e)}function A(e){var i=e.texture;if(l(i,u(e))){var a=e.isWebGLRenderTargetCube?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,o=n.get(i).__webglTexture;r.bindTexture(a,o),t.generateMipmap(a),r.bindTexture(a,null)}}var L="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext;this.setTexture2D=g,this.setTextureCube=y,this.setTextureCubeDynamic=x,this.setupRenderTarget=S,this.updateRenderTargetMipmap=A}function ve(){function t(t){var e=t.uuid,r=n[e];return void 0===r&&(r={},n[e]=r),r}function e(t){delete n[t.uuid]}function r(){n={}}var n={};return{get:t,remove:e,clear:r}}function ge(t,e,r){function n(){var e=!1,r=new o,n=null,i=new o(0,0,0,0);return{setMask:function(r){n===r||e||(t.colorMask(r,r,r,r),n=r)},setLocked:function(t){e=t},setClear:function(e,n,a,o,s){!0===s&&(e*=o,n*=o,a*=o),r.set(e,n,a,o),!1===i.equals(r)&&(t.clearColor(e,n,a,o),i.copy(r))},reset:function(){e=!1,n=null,i.set(-1,0,0,0)}}}function i(){var e=!1,r=null,n=null,i=null;return{setTest:function(e){e?d(t.DEPTH_TEST):f(t.DEPTH_TEST)},setMask:function(n){r===n||e||(t.depthMask(n),r=n)},setFunc:function(e){if(n!==e){if(e)switch(e){case eo:t.depthFunc(t.NEVER);break;case ro:t.depthFunc(t.ALWAYS);break;case no:t.depthFunc(t.LESS);break;case io:t.depthFunc(t.LEQUAL);break;case ao:t.depthFunc(t.EQUAL);break;case oo:t.depthFunc(t.GEQUAL);break;case so:t.depthFunc(t.GREATER);break;case uo:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}else t.depthFunc(t.LEQUAL);n=e}},setLocked:function(t){e=t},setClear:function(e){i!==e&&(t.clearDepth(e),i=e)},reset:function(){e=!1,r=null,n=null,i=null}}}function a(){var e=!1,r=null,n=null,i=null,a=null,o=null,s=null,u=null,h=null;return{setTest:function(e){e?d(t.STENCIL_TEST):f(t.STENCIL_TEST)},setMask:function(n){r===n||e||(t.stencilMask(n),r=n)},setFunc:function(e,r,o){n===e&&i===r&&a===o||(t.stencilFunc(e,r,o),n=e,i=r,a=o)},setOp:function(e,r,n){o===e&&s===r&&u===n||(t.stencilOp(e,r,n),o=e,s=r,u=n)},setLocked:function(t){e=t},setClear:function(e){h!==e&&(t.clearStencil(e),h=e)},reset:function(){e=!1,r=null,n=null,i=null,a=null,o=null,s=null,u=null,h=null}}}function s(e,r,n){var i=new Uint8Array(4),a=t.createTexture();t.bindTexture(e,a),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(var o=0;o<n;o++)t.texImage2D(r+o,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,i);return a}function u(){for(var t=0,e=D.length;t<e;t++)D[t]=0}function h(r){if(D[r]=1,0===N[r]&&(t.enableVertexAttribArray(r),N[r]=1),0!==U[r]){e.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(r,0),U[r]=0}}function c(r,n){if(D[r]=1,0===N[r]&&(t.enableVertexAttribArray(r),N[r]=1),U[r]!==n){e.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(r,n),U[r]=n}}function l(){for(var e=0,r=N.length;e!==r;++e)N[e]!==D[e]&&(t.disableVertexAttribArray(e),N[e]=0)}function d(e){!0!==F[e]&&(t.enable(e),F[e]=!0)}function f(e){!1!==F[e]&&(t.disable(e),F[e]=!1)}function p(){if(null===B&&(B=[],e.get("WEBGL_compressed_texture_pvrtc")||e.get("WEBGL_compressed_texture_s3tc")||e.get("WEBGL_compressed_texture_etc1")))for(var r=t.getParameter(t.COMPRESSED_TEXTURE_FORMATS),n=0;n<r.length;n++)B.push(r[n]);return B}function m(e){return z!==e&&(t.useProgram(e),z=e,!0)}function v(e,n,i,a,o,s,u,h){if(e!==Ia?d(t.BLEND):f(t.BLEND),e!==Ba){if(e!==G||h!==X)switch(e){case Na:h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE,t.ONE,t.ONE)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE));break;case Ua:h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ZERO,t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ONE_MINUS_SRC_ALPHA)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.ONE_MINUS_SRC_COLOR));break;case Fa:h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.SRC_COLOR));break;default:h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA)):(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA))}j=null,V=null,k=null,H=null,W=null,q=null}else o=o||n,s=s||i,u=u||a,n===j&&o===H||(t.blendEquationSeparate(r.convert(n),r.convert(o)),j=n,H=o),i===V&&a===k&&s===W&&u===q||(t.blendFuncSeparate(r.convert(i),r.convert(a),r.convert(s),r.convert(u)),V=i,k=a,W=s,q=u);G=e,X=h}function g(e){e.side===Aa?f(t.CULL_FACE):d(t.CULL_FACE),y(e.side===Sa),!0===e.transparent?v(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha):v(Ia),C.setFunc(e.depthFunc),C.setTest(e.depthTest),C.setMask(e.depthWrite),R.setMask(e.colorWrite),b(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)}function y(e){Y!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),Y=e)}function x(e){e!==va?(d(t.CULL_FACE),e!==Z&&(e===ga?t.cullFace(t.BACK):e===ya?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):f(t.CULL_FACE),Z=e}function _(e){e!==K&&(et&&t.lineWidth(e),K=e)}function b(e,r,n){e?(d(t.POLYGON_OFFSET_FILL),Q===r&&J===n||(t.polygonOffset(r,n),Q=r,J=n)):f(t.POLYGON_OFFSET_FILL)}function w(e){e?d(t.SCISSOR_TEST):f(t.SCISSOR_TEST)}function M(e){void 0===e&&(e=t.TEXTURE0+$-1),rt!==e&&(t.activeTexture(e),rt=e)}function E(e,r){null===rt&&M();var n=nt[rt];void 0===n&&(n={type:void 0,texture:void 0},nt[rt]=n),n.type===e&&n.texture===r||(t.bindTexture(e,r||ot[e]),n.type=e,n.texture=r)}function T(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function S(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}}function A(e){!1===it.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),it.copy(e))}function L(e){!1===at.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),at.copy(e))}function P(){for(var e=0;e<N.length;e++)1===N[e]&&(t.disableVertexAttribArray(e),N[e]=0);F={},B=null,rt=null,nt={},z=null,G=null,Y=null,Z=null,R.reset(),C.reset(),O.reset()}var R=new n,C=new i,O=new a,I=t.getParameter(t.MAX_VERTEX_ATTRIBS),D=new Uint8Array(I),N=new Uint8Array(I),U=new Uint8Array(I),F={},B=null,z=null,G=null,j=null,V=null,k=null,H=null,W=null,q=null,X=!1,Y=null,Z=null,K=null,Q=null,J=null,$=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),tt=parseFloat(/^WebGL\ ([0-9])/.exec(t.getParameter(t.VERSION))[1]),et=parseFloat(tt)>=1,rt=null,nt={},it=new o,at=new o,ot={};return ot[t.TEXTURE_2D]=s(t.TEXTURE_2D,t.TEXTURE_2D,1),ot[t.TEXTURE_CUBE_MAP]=s(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),R.setClear(0,0,0,1),C.setClear(1),O.setClear(0),d(t.DEPTH_TEST),C.setFunc(io),y(!1),x(ga),d(t.CULL_FACE),d(t.BLEND),v(Da),{buffers:{color:R,depth:C,stencil:O},initAttributes:u,enableAttribute:h,enableAttributeAndDivisor:c,disableUnusedAttributes:l,enable:d,disable:f,getCompressedTextureFormats:p,useProgram:m,setBlending:v,setMaterial:g,setFlipSided:y,setCullFace:x,setLineWidth:_,setPolygonOffset:b,setScissorTest:w,activeTexture:M,bindTexture:E,compressedTexImage2D:T,texImage2D:S,scissor:A,viewport:L,reset:P}}function ye(t,e,r){function n(){if(void 0!==a)return a;var r=e.get("EXT_texture_filter_anisotropic");return a=null!==r?t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}function i(e){if("highp"===e){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var a,o=void 0!==r.precision?r.precision:"highp",s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var u=!0===r.logarithmicDepthBuffer&&!!e.get("EXT_frag_depth"),h=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),c=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),l=t.getParameter(t.MAX_TEXTURE_SIZE),d=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),f=t.getParameter(t.MAX_VERTEX_ATTRIBS),p=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),m=t.getParameter(t.MAX_VARYING_VECTORS),v=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),g=c>0,y=!!e.get("OES_texture_float");return{getMaxAnisotropy:n,getMaxPrecision:i,precision:o,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:c,maxTextureSize:l,maxCubemapSize:d,maxAttributes:f,maxVertexUniforms:p,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y}}function xe(t){mt.call(this),this.cameras=t||[]}function _e(t){function e(){if(null!==n&&n.isPresenting){var e=n.getEyeParameters("left"),i=e.renderWidth,a=e.renderHeight;p=t.getPixelRatio(),f=t.getSize(),t.setDrawingBufferSize(2*i,a,1)}else r.enabled&&t.setDrawingBufferSize(f.width,f.height,p)}var r=this,n=null,i=null;"VRFrameData"in window&&(i=new window.VRFrameData);var a=new l,s=new l,u=new l,h=new mt;h.bounds=new o(0,0,.5,1),h.layers.enable(1);var c=new mt;c.bounds=new o(.5,0,.5,1),c.layers.enable(2);var d=new xe([h,c]);d.layers.enable(1),d.layers.enable(2);var f,p;window.addEventListener("vrdisplaypresentchange",e,!1),this.enabled=!1,this.standing=!1,this.getDevice=function(){return n},this.setDevice=function(t){void 0!==t&&(n=t)},this.getCamera=function(t){if(null===n)return t;n.depthNear=t.near,n.depthFar=t.far,n.getFrameData(i);var e=i.pose;null!==e.position?t.position.fromArray(e.position):t.position.set(0,0,0),null!==e.orientation&&t.quaternion.fromArray(e.orientation),t.updateMatrixWorld();var r=n.stageParameters;if(this.standing&&r&&(s.fromArray(r.sittingToStandingTransform),u.getInverse(s),t.matrixWorld.multiply(s),t.matrixWorldInverse.multiply(u)),!1===n.isPresenting)return t;h.near=t.near,c.near=t.near,h.far=t.far,c.far=t.far,d.matrixWorld.copy(t.matrixWorld),d.matrixWorldInverse.copy(t.matrixWorldInverse),h.matrixWorldInverse.fromArray(i.leftViewMatrix),c.matrixWorldInverse.fromArray(i.rightViewMatrix),this.standing&&r&&(h.matrixWorldInverse.multiply(u),c.matrixWorldInverse.multiply(u));var o=t.parent;null!==o&&(a.getInverse(o.matrixWorld),h.matrixWorldInverse.multiply(a),c.matrixWorldInverse.multiply(a)),h.matrixWorld.getInverse(h.matrixWorldInverse),c.matrixWorld.getInverse(c.matrixWorldInverse),h.projectionMatrix.fromArray(i.leftProjectionMatrix),c.projectionMatrix.fromArray(i.rightProjectionMatrix),d.projectionMatrix.copy(h.projectionMatrix);var l=n.getLayers();if(l.length){var f=l[0];null!==f.leftBounds&&4===f.leftBounds.length&&h.bounds.fromArray(f.leftBounds),null!==f.rightBounds&&4===f.rightBounds.length&&c.bounds.fromArray(f.rightBounds)}return d},this.getStandingMatrix=function(){return s},this.submitFrame=function(){n&&n.isPresenting&&n.submitFrame()},this.dispose=function(){window.removeEventListener("vrdisplaypresentchange",e)}}function be(t){var e={};return{get:function(r){if(void 0!==e[r])return e[r];var n;switch(r){case"WEBGL_depth_texture":n=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":n=t.getExtension("WEBGL_compressed_texture_etc1");break;default:n=t.getExtension(r)}return null===n&&console.warn("THREE.WebGLRenderer: "+r+" extension not supported."),e[r]=n,n}}}function we(){function t(){h.value!==n&&(h.value=n,h.needsUpdate=i>0),r.numPlanes=i,r.numIntersection=0}function e(t,e,n,i){var a=null!==t?t.length:0,o=null;if(0!==a){if(o=h.value,!0!==i||null===o){var c=n+4*a,l=e.matrixWorldInverse;u.getNormalMatrix(l),(null===o||o.length<c)&&(o=new Float32Array(c));for(var d=0,f=n;d!==a;++d,f+=4)s.copy(t[d]).applyMatrix4(l,u),s.normal.toArray(o,f),o[f+3]=s.constant}h.value=o,h.needsUpdate=!0}return r.numPlanes=a,o}var r=this,n=null,i=0,a=!1,o=!1,s=new ot,u=new at,h={value:null,needsUpdate:!1};this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(t,r,o){var s=0!==t.length||r||0!==i||a;return a=r,n=e(t,o,0),i=t.length,s},this.beginShadows=function(){o=!0,e(null)},this.endShadows=function(){o=!1,t()},this.setState=function(r,s,u,c,l,d){if(!a||null===r||0===r.length||o&&!u)o?e(null):t();else{var f=o?0:i,p=4*f,m=l.clippingState||null;h.value=m,m=e(r,c,p,d);for(var v=0;v!==p;++v)m[v]=n[v];l.clippingState=m,this.numIntersection=s?this.numPlanes:0,this.numPlanes+=f}}}function Me(t,e){function r(r){var n;if(r===So)return t.REPEAT;if(r===Ao)return t.CLAMP_TO_EDGE;if(r===Lo)return t.MIRRORED_REPEAT;if(r===Po)return t.NEAREST;if(r===Ro)return t.NEAREST_MIPMAP_NEAREST;if(r===Co)return t.NEAREST_MIPMAP_LINEAR;if(r===Oo)return t.LINEAR;if(r===Io)return t.LINEAR_MIPMAP_NEAREST;if(r===Do)return t.LINEAR_MIPMAP_LINEAR;if(r===No)return t.UNSIGNED_BYTE;if(r===ko)return t.UNSIGNED_SHORT_4_4_4_4;if(r===Ho)return t.UNSIGNED_SHORT_5_5_5_1;if(r===Wo)return t.UNSIGNED_SHORT_5_6_5;if(r===Uo)return t.BYTE;if(r===Fo)return t.SHORT;if(r===Bo)return t.UNSIGNED_SHORT;if(r===zo)return t.INT;if(r===Go)return t.UNSIGNED_INT;if(r===jo)return t.FLOAT;if(r===Vo&&null!==(n=e.get("OES_texture_half_float")))return n.HALF_FLOAT_OES;if(r===Xo)return t.ALPHA;if(r===Yo)return t.RGB;if(r===Zo)return t.RGBA;if(r===Ko)return t.LUMINANCE;if(r===Qo)return t.LUMINANCE_ALPHA;if(r===$o)return t.DEPTH_COMPONENT;if(r===ts)return t.DEPTH_STENCIL;if(r===za)return t.FUNC_ADD;if(r===Ga)return t.FUNC_SUBTRACT;if(r===ja)return t.FUNC_REVERSE_SUBTRACT;if(r===Ha)return t.ZERO;if(r===Wa)return t.ONE;if(r===qa)return t.SRC_COLOR;if(r===Xa)return t.ONE_MINUS_SRC_COLOR;if(r===Ya)return t.SRC_ALPHA;if(r===Za)return t.ONE_MINUS_SRC_ALPHA;if(r===Ka)return t.DST_ALPHA;if(r===Qa)return t.ONE_MINUS_DST_ALPHA;if(r===Ja)return t.DST_COLOR;if(r===$a)return t.ONE_MINUS_DST_COLOR;if(r===to)return t.SRC_ALPHA_SATURATE;if((r===es||r===rs||r===ns||r===is)&&null!==(n=e.get("WEBGL_compressed_texture_s3tc"))){if(r===es)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(r===rs)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(r===ns)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(r===is)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((r===as||r===os||r===ss||r===us)&&null!==(n=e.get("WEBGL_compressed_texture_pvrtc"))){if(r===as)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(r===os)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(r===ss)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(r===us)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(r===hs&&null!==(n=e.get("WEBGL_compressed_texture_etc1")))return n.COMPRESSED_RGB_ETC1_WEBGL;if((r===Va||r===ka)&&null!==(n=e.get("EXT_blend_minmax"))){if(r===Va)return n.MIN_EXT;if(r===ka)return n.MAX_EXT}return r===qo&&null!==(n=e.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:0}return{convert:r}}function Ee(t){function e(){return null===tt?mt:1}function r(){Pt=new be(At),Pt.get("WEBGL_depth_texture"),Pt.get("OES_texture_float"),Pt.get("OES_texture_float_linear"),Pt.get("OES_texture_half_float"),Pt.get("OES_texture_half_float_linear"),Pt.get("OES_standard_derivatives"),Pt.get("ANGLE_instanced_arrays"),Pt.get("OES_element_index_uint")&&(Ct.MaxIndex=4294967296),ee=new Me(At,Pt),Rt=new ye(At,Pt,t),Ot=new ge(At,Pt,ee),Ot.scissor(ct.copy(gt).multiplyScalar(mt)),Ot.viewport(ot.copy(vt).multiplyScalar(mt)),It=new ve,Dt=new me(At,Pt,Ot,It,Rt,ee,Tt),Nt=new ht(At),Ut=new Kt(At,Nt,Tt),Ft=new $t(Ut,St),kt=new Xt(At),zt=new pe(Q,Pt,Rt),Bt=new Jt,Gt=new Wt,Vt=new jt(Q,Ot,Ut,V),Ht=new Zt(At,Pt,St),qt=new Yt(At,Pt,St),Qt=new K(Q,At,Ot,Dt,Rt),te=new J(Q,At,Ot,Dt,Rt),Q.info.programs=zt.programs,Q.context=At,Q.capabilities=Rt,Q.extensions=Pt,Q.properties=It,Q.renderLists=Gt,Q.state=Ot}function n(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),$=!0}function i(t){console.log("THREE.WebGLRenderer: Context Restored."),$=!1,r()}function a(t){var e=t.target;e.removeEventListener("dispose",a),s(e)}function s(t){u(t),It.remove(t)}function u(t){var e=It.get(t).program;t.program=void 0,void 0!==e&&zt.releaseProgram(e)}function h(t,e,r){t.render(function(t){Q.renderBufferImmediate(t,e,r)})}function f(t,e,r,n){if(r&&r.isInstancedBufferGeometry&&null===Pt.get("ANGLE_instanced_arrays"))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");void 0===n&&(n=0),Ot.initAttributes();var i=r.attributes,a=e.getAttributes(),o=t.defaultAttributeValues;for(var s in a){var u=a[s];if(u>=0){var h=i[s];if(void 0!==h){var c=h.normalized,l=h.itemSize,d=Nt.get(h);if(void 0===d)continue;var f=d.buffer,p=d.type,m=d.bytesPerElement;if(h.isInterleavedBufferAttribute){var v=h.data,g=v.stride,y=h.offset;v&&v.isInstancedInterleavedBuffer?(Ot.enableAttributeAndDivisor(u,v.meshPerAttribute),void 0===r.maxInstancedCount&&(r.maxInstancedCount=v.meshPerAttribute*v.count)):Ot.enableAttribute(u),At.bindBuffer(At.ARRAY_BUFFER,f),At.vertexAttribPointer(u,l,p,c,g*m,(n*g+y)*m)}else h.isInstancedBufferAttribute?(Ot.enableAttributeAndDivisor(u,h.meshPerAttribute),void 0===r.maxInstancedCount&&(r.maxInstancedCount=h.meshPerAttribute*h.count)):Ot.enableAttribute(u),At.bindBuffer(At.ARRAY_BUFFER,f),At.vertexAttribPointer(u,l,p,c,0,n*l*m)}else if(void 0!==o){var x=o[s];if(void 0!==x)switch(x.length){case 2:At.vertexAttrib2fv(u,x);break;case 3:At.vertexAttrib3fv(u,x);break;case 4:At.vertexAttrib4fv(u,x);break;default:At.vertexAttrib1fv(u,x)}}}}Ot.disableUnusedAttributes()}function p(){ie||((re.getDevice()||window).requestAnimationFrame(m),ie=!0)}function m(t){null!==ae&&ae(t),(re.getDevice()||window).requestAnimationFrame(m)}function v(t,e,r){if(t.visible){if(t.layers.test(e.layers))if(t.isLight)H.push(t),t.castShadow&&W.push(t);else if(t.isSprite)t.frustumCulled&&!xt.intersectsSprite(t)||Y.push(t);else if(t.isLensFlare)Z.push(t);else if(t.isImmediateRenderObject)r&&Et.setFromMatrixPosition(t.matrixWorld).applyMatrix4(Mt),q.push(t,null,t.material,Et.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.update(),!t.frustumCulled||xt.intersectsObject(t))){r&&Et.setFromMatrixPosition(t.matrixWorld).applyMatrix4(Mt);var n=Ft.update(t),i=t.material;if(Array.isArray(i))for(var a=n.groups,o=0,s=a.length;o<s;o++){var u=a[o],h=i[u.materialIndex];h&&h.visible&&q.push(t,n,h,Et.z,u)}else i.visible&&q.push(t,n,i,Et.z,null)}for(var c=t.children,o=0,s=c.length;o<s;o++)v(c[o],e,r)}}function g(t,e,r,n){for(var i=0,a=t.length;i<a;i++){var o=t[i],s=o.object,u=o.geometry,h=void 0===n?o.material:n,c=o.group;if(r.isArrayCamera){at=r;for(var l=r.cameras,d=0,f=l.length;d<f;d++){var p=l[d];if(s.layers.test(p.layers)){var m=p.bounds,v=m.x*ft,g=m.y*pt,x=m.z*ft,_=m.w*pt;Ot.viewport(ot.set(v,g,x,_).multiplyScalar(mt)),y(s,e,p,u,h,c)}}}else at=null,y(s,e,r,u,h,c)}}function y(t,e,r,n,i,a){if(t.onBeforeRender(Q,e,r,n,i,a),t.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){Ot.setMaterial(i);var o=_(r,e.fog,i,t);nt="",h(t,o,i)}else Q.renderBufferDirect(r,e.fog,n,i,t,a);t.onAfterRender(Q,e,r,n,i,a)}function x(t,e,r){var n=It.get(t),i=zt.getParameters(t,Bt.state,W,e,_t.numPlanes,_t.numIntersection,r),o=zt.getProgramCode(t,i),s=n.program,h=!0;if(void 0===s)t.addEventListener("dispose",a);else if(s.code!==o)u(t);else{if(void 0!==i.shaderID)return;h=!1}if(h){if(i.shaderID){var c=Ws[i.shaderID];n.shader={name:t.type,uniforms:ks.clone(c.uniforms),vertexShader:c.vertexShader,fragmentShader:c.fragmentShader}}else n.shader={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};t.onBeforeCompile(n.shader),s=zt.acquireProgram(t,n.shader,i,o),n.program=s,t.program=s}var l=s.getAttributes();if(t.morphTargets){t.numSupportedMorphTargets=0;for(var d=0;d<Q.maxMorphTargets;d++)l["morphTarget"+d]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(var d=0;d<Q.maxMorphNormals;d++)l["morphNormal"+d]>=0&&t.numSupportedMorphNormals++}var f=n.shader.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(n.numClippingPlanes=_t.numPlanes,n.numIntersection=_t.numIntersection,f.clippingPlanes=_t.uniform),n.fog=e,n.lightsHash=Bt.state.hash,t.lights&&(f.ambientLightColor.value=Bt.state.ambient,f.directionalLights.value=Bt.state.directional,f.spotLights.value=Bt.state.spot,f.rectAreaLights.value=Bt.state.rectArea,f.pointLights.value=Bt.state.point,f.hemisphereLights.value=Bt.state.hemi,f.directionalShadowMap.value=Bt.state.directionalShadowMap,f.directionalShadowMatrix.value=Bt.state.directionalShadowMatrix,f.spotShadowMap.value=Bt.state.spotShadowMap,f.spotShadowMatrix.value=Bt.state.spotShadowMatrix,f.pointShadowMap.value=Bt.state.pointShadowMap,f.pointShadowMatrix.value=Bt.state.pointShadowMatrix);var p=n.program.getUniforms(),m=X.seqWithValue(p.seq,f);n.uniformsList=m}function _(t,e,r,n){dt=0;var i=It.get(r);if(bt&&(wt||t!==it)){var a=t===it&&r.id===rt;_t.setState(r.clippingPlanes,r.clipIntersection,r.clipShadows,t,i,a)}!1===r.needsUpdate&&(void 0===i.program?r.needsUpdate=!0:r.fog&&i.fog!==e?r.needsUpdate=!0:r.lights&&i.lightsHash!==Bt.state.hash?r.needsUpdate=!0:void 0===i.numClippingPlanes||i.numClippingPlanes===_t.numPlanes&&i.numIntersection===_t.numIntersection||(r.needsUpdate=!0)),r.needsUpdate&&(x(r,e,n),r.needsUpdate=!1);var o=!1,s=!1,u=!1,h=i.program,c=h.getUniforms(),l=i.shader.uniforms;if(Ot.useProgram(h.program)&&(o=!0,s=!0,u=!0),r.id!==rt&&(rt=r.id,s=!0),o||t!==it){if(c.setValue(At,"projectionMatrix",t.projectionMatrix),Rt.logarithmicDepthBuffer&&c.setValue(At,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),it!==(at||t)&&(it=at||t,s=!0,u=!0),r.isShaderMaterial||r.isMeshPhongMaterial||r.isMeshStandardMaterial||r.envMap){var f=c.map.cameraPosition;void 0!==f&&f.setValue(At,Et.setFromMatrixPosition(t.matrixWorld))}(r.isMeshPhongMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial||r.skinning)&&c.setValue(At,"viewMatrix",t.matrixWorldInverse)}if(r.skinning){c.setOptional(At,n,"bindMatrix"),c.setOptional(At,n,"bindMatrixInverse");var p=n.skeleton;if(p){var m=p.bones;if(Rt.floatVertexTextures){if(void 0===p.boneTexture){var v=Math.sqrt(4*m.length);v=Os.nextPowerOfTwo(Math.ceil(v)),v=Math.max(v,4);var g=new Float32Array(v*v*4);g.set(p.boneMatrices);var y=new d(g,v,v,Zo,jo);p.boneMatrices=g,p.boneTexture=y,p.boneTextureSize=v}c.setValue(At,"boneTexture",p.boneTexture),c.setValue(At,"boneTextureSize",p.boneTextureSize)}else c.setOptional(At,p,"boneMatrices")}}return s&&(c.setValue(At,"toneMappingExposure",Q.toneMappingExposure),c.setValue(At,"toneMappingWhitePoint",Q.toneMappingWhitePoint),r.lights&&D(l,u),e&&r.fog&&T(l,e),r.isMeshBasicMaterial?b(l,r):r.isMeshLambertMaterial?(b(l,r),S(l,r)):r.isMeshPhongMaterial?(b(l,r),r.isMeshToonMaterial?L(l,r):A(l,r)):r.isMeshStandardMaterial?(b(l,r),r.isMeshPhysicalMaterial?R(l,r):P(l,r)):r.isMeshDepthMaterial?(b(l,r),C(l,r)):r.isMeshDistanceMaterial?(b(l,r),O(l,r)):r.isMeshNormalMaterial?(b(l,r),I(l,r)):r.isLineBasicMaterial?(w(l,r),r.isLineDashedMaterial&&M(l,r)):r.isPointsMaterial?E(l,r):r.isShadowMaterial&&(l.color.value=r.color,l.opacity.value=r.opacity),void 0!==l.ltcMat&&(l.ltcMat.value=Vs.LTC_MAT_TEXTURE),void 0!==l.ltcMag&&(l.ltcMag.value=Vs.LTC_MAG_TEXTURE),X.upload(At,i.uniformsList,l,Q)),c.setValue(At,"modelViewMatrix",n.modelViewMatrix),c.setValue(At,"normalMatrix",n.normalMatrix),c.setValue(At,"modelMatrix",n.matrixWorld),h}function b(t,e){t.opacity.value=e.opacity,e.color&&(t.diffuse.value=e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap),e.envMap&&(t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap&&e.envMap.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity);var r;if(e.map?r=e.map:e.specularMap?r=e.specularMap:e.displacementMap?r=e.displacementMap:e.normalMap?r=e.normalMap:e.bumpMap?r=e.bumpMap:e.roughnessMap?r=e.roughnessMap:e.metalnessMap?r=e.metalnessMap:e.alphaMap?r=e.alphaMap:e.emissiveMap&&(r=e.emissiveMap),void 0!==r){r.isWebGLRenderTarget&&(r=r.texture);var n=r.offset,i=r.repeat;t.offsetRepeat.value.set(n.x,n.y,i.x,i.y)}}function w(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity}function M(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}function E(t,e){if(t.diffuse.value=e.color,t.opacity.value=e.opacity,t.size.value=e.size*mt,t.scale.value=.5*pt,t.map.value=e.map,null!==e.map){var r=e.map.offset,n=e.map.repeat;t.offsetRepeat.value.set(r.x,r.y,n.x,n.y)}}function T(t,e){t.fogColor.value=e.color,e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}function S(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}function A(t,e){t.specular.value=e.specular,t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function L(t,e){A(t,e),e.gradientMap&&(t.gradientMap.value=e.gradientMap)}function P(t,e){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}function R(t,e){t.clearCoat.value=e.clearCoat,t.clearCoatRoughness.value=e.clearCoatRoughness,P(t,e)}function C(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function O(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}function I(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function D(t,e){t.ambientLightColor.needsUpdate=e,t.directionalLights.needsUpdate=e,t.pointLights.needsUpdate=e,t.spotLights.needsUpdate=e,t.rectAreaLights.needsUpdate=e,t.hemisphereLights.needsUpdate=e}function N(){var t=dt;return t>=Rt.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+t+" texture units while this GPU supports only "+Rt.maxTextures),dt+=1,t}console.log("THREE.WebGLRenderer",pa),t=t||{};var U=void 0!==t.canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),F=void 0!==t.context?t.context:null,B=void 0!==t.alpha&&t.alpha,z=void 0===t.depth||t.depth,G=void 0===t.stencil||t.stencil,j=void 0!==t.antialias&&t.antialias,V=void 0===t.premultipliedAlpha||t.premultipliedAlpha,k=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,H=[],W=[],q=null,Y=[],Z=[];this.domElement=U,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=po,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var Q=this,$=!1,tt=null,et=null,rt=-1,nt="",it=null,at=null,ot=new o,ct=new o,lt=null,dt=0,ft=U.width,pt=U.height,mt=1,vt=new o(0,0,ft,pt),gt=new o(0,0,ft,pt),yt=!1,xt=new st,_t=new we,bt=!1,wt=!1,Mt=new l,Et=new c,Tt={geometries:0,textures:0},St={frame:0,calls:0,vertices:0,faces:0,points:0};this.info={render:St,memory:Tt,programs:null};var At;try{var Lt={alpha:B,depth:z,stencil:G,antialias:j,premultipliedAlpha:V,preserveDrawingBuffer:k};if(null===(At=F||U.getContext("webgl",Lt)||U.getContext("experimental-webgl",Lt)))throw null!==U.getContext("webgl")?"Error creating WebGL context with your selected attributes.":"Error creating WebGL context.";void 0===At.getShaderPrecisionFormat&&(At.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}}),U.addEventListener("webglcontextlost",n,!1),U.addEventListener("webglcontextrestored",i,!1)}catch(t){console.error("THREE.WebGLRenderer: "+t)}var Pt,Rt,Ot,It,Dt,Nt,Ut,Ft,Bt,zt,Gt,Vt,kt,Ht,qt,Qt,te,ee;r();var re=new _e(Q);this.vr=re;var ne=new ut(Q,Ft,Rt.maxTextureSize);this.shadowMap=ne,this.getContext=function(){return At},this.getContextAttributes=function(){return At.getContextAttributes()},this.forceContextLoss=function(){var t=Pt.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=Pt.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return mt},this.setPixelRatio=function(t){void 0!==t&&(mt=t,this.setSize(ft,pt,!1))},this.getSize=function(){return{width:ft,height:pt}},this.setSize=function(t,e,r){var n=re.getDevice();if(n&&n.isPresenting)return void console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");ft=t,pt=e,U.width=t*mt,U.height=e*mt,!1!==r&&(U.style.width=t+"px",U.style.height=e+"px"),this.setViewport(0,0,t,e)},this.getDrawingBufferSize=function(){return{width:ft*mt,height:pt*mt}},this.setDrawingBufferSize=function(t,e,r){ft=t,pt=e,mt=r,U.width=t*r,U.height=e*r,this.setViewport(0,0,t,e)},this.setViewport=function(t,e,r,n){vt.set(t,pt-e-n,r,n),Ot.viewport(ot.copy(vt).multiplyScalar(mt))},this.setScissor=function(t,e,r,n){gt.set(t,pt-e-n,r,n),Ot.scissor(ct.copy(gt).multiplyScalar(mt))},this.setScissorTest=function(t){Ot.setScissorTest(yt=t)},this.getClearColor=Vt.getClearColor,this.setClearColor=Vt.setClearColor,this.getClearAlpha=Vt.getClearAlpha,this.setClearAlpha=Vt.setClearAlpha,this.clear=function(t,e,r){var n=0;(void 0===t||t)&&(n|=At.COLOR_BUFFER_BIT),(void 0===e||e)&&(n|=At.DEPTH_BUFFER_BIT),(void 0===r||r)&&(n|=At.STENCIL_BUFFER_BIT),At.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.clearTarget=function(t,e,r,n){this.setRenderTarget(t),this.clear(e,r,n)},this.dispose=function(){U.removeEventListener("webglcontextlost",n,!1),U.removeEventListener("webglcontextrestored",i,!1),Gt.dispose(),re.dispose()},this.renderBufferImmediate=function(t,e,r){Ot.initAttributes();var n=It.get(t);t.hasPositions&&!n.position&&(n.position=At.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=At.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=At.createBuffer()),t.hasColors&&!n.color&&(n.color=At.createBuffer());var i=e.getAttributes();if(t.hasPositions&&(At.bindBuffer(At.ARRAY_BUFFER,n.position),At.bufferData(At.ARRAY_BUFFER,t.positionArray,At.DYNAMIC_DRAW),Ot.enableAttribute(i.position),At.vertexAttribPointer(i.position,3,At.FLOAT,!1,0,0)),t.hasNormals){if(At.bindBuffer(At.ARRAY_BUFFER,n.normal),!r.isMeshPhongMaterial&&!r.isMeshStandardMaterial&&!r.isMeshNormalMaterial&&!0===r.flatShading)for(var a=0,o=3*t.count;a<o;a+=9){var s=t.normalArray,u=(s[a+0]+s[a+3]+s[a+6])/3,h=(s[a+1]+s[a+4]+s[a+7])/3,c=(s[a+2]+s[a+5]+s[a+8])/3;s[a+0]=u,s[a+1]=h,s[a+2]=c,s[a+3]=u,s[a+4]=h,s[a+5]=c,s[a+6]=u,s[a+7]=h,s[a+8]=c}At.bufferData(At.ARRAY_BUFFER,t.normalArray,At.DYNAMIC_DRAW),Ot.enableAttribute(i.normal),At.vertexAttribPointer(i.normal,3,At.FLOAT,!1,0,0)}t.hasUvs&&r.map&&(At.bindBuffer(At.ARRAY_BUFFER,n.uv),At.bufferData(At.ARRAY_BUFFER,t.uvArray,At.DYNAMIC_DRAW),Ot.enableAttribute(i.uv),At.vertexAttribPointer(i.uv,2,At.FLOAT,!1,0,0)),t.hasColors&&r.vertexColors!==Ra&&(At.bindBuffer(At.ARRAY_BUFFER,n.color),At.bufferData(At.ARRAY_BUFFER,t.colorArray,At.DYNAMIC_DRAW),Ot.enableAttribute(i.color),At.vertexAttribPointer(i.color,3,At.FLOAT,!1,0,0)),Ot.disableUnusedAttributes(),At.drawArrays(At.TRIANGLES,0,t.count),t.count=0},this.renderBufferDirect=function(t,r,n,i,a,o){Ot.setMaterial(i);var s=_(t,r,i,a),u=n.id+"_"+s.id+"_"+(!0===i.wireframe),h=!1;u!==nt&&(nt=u,h=!0),a.morphTargetInfluences&&(kt.update(a,n,i,s),h=!0);var c=n.index,l=n.attributes.position,d=1;!0===i.wireframe&&(c=Ut.getWireframeAttribute(n),d=2);var p,m=Ht;null!==c&&(p=Nt.get(c),m=qt,m.setIndex(p)),h&&(f(i,s,n),null!==c&&At.bindBuffer(At.ELEMENT_ARRAY_BUFFER,p.buffer));var v=0;null!==c?v=c.count:void 0!==l&&(v=l.count);var g=n.drawRange.start*d,y=n.drawRange.count*d,x=null!==o?o.start*d:0,b=null!==o?o.count*d:1/0,w=Math.max(g,x),M=Math.min(v,g+y,x+b)-1,E=Math.max(0,M-w+1);if(0!==E){if(a.isMesh)if(!0===i.wireframe)Ot.setLineWidth(i.wireframeLinewidth*e()),m.setMode(At.LINES);else switch(a.drawMode){case xs:m.setMode(At.TRIANGLES);break;case _s:m.setMode(At.TRIANGLE_STRIP);break;case bs:m.setMode(At.TRIANGLE_FAN)}else if(a.isLine){var T=i.linewidth;void 0===T&&(T=1),Ot.setLineWidth(T*e()),a.isLineSegments?m.setMode(At.LINES):a.isLineLoop?m.setMode(At.LINE_LOOP):m.setMode(At.LINE_STRIP)}else a.isPoints&&m.setMode(At.POINTS);n&&n.isInstancedBufferGeometry?n.maxInstancedCount>0&&m.renderInstances(n,w,E):m.render(w,E)}},this.compile=function(t,e){H.length=0,W.length=0,t.traverse(function(t){t.isLight&&(H.push(t),t.castShadow&&W.push(t))}),Bt.setup(H,W,e),t.traverse(function(e){if(e.material)if(Array.isArray(e.material))for(var r=0;r<e.material.length;r++)x(e.material[r],t.fog,e);else x(e.material,t.fog,e)})};var ie=!1,ae=null;this.animate=function(t){ae=t,p()},this.render=function(t,e,r,n){if(!e||!e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!$){nt="",rt=-1,it=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),re.enabled&&(e=re.getCamera(e)),Mt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),xt.setFromMatrix(Mt),H.length=0,W.length=0,Y.length=0,Z.length=0,wt=this.localClippingEnabled,bt=_t.init(this.clippingPlanes,wt,e),q=Gt.get(t,e),q.init(),v(t,e,Q.sortObjects),!0===Q.sortObjects&&q.sort(),bt&&_t.beginShadows(),ne.render(W,t,e),Bt.setup(H,W,e),bt&&_t.endShadows(),St.frame++,St.calls=0,St.vertices=0,St.faces=0,St.points=0,void 0===r&&(r=null),this.setRenderTarget(r),Vt.render(q,t,e,n);var i=q.opaque,a=q.transparent;if(t.overrideMaterial){var o=t.overrideMaterial;i.length&&g(i,t,e,o),a.length&&g(a,t,e,o)}else i.length&&g(i,t,e),a.length&&g(a,t,e);te.render(Y,t,e),Qt.render(Z,t,e,ot),r&&Dt.updateRenderTargetMipmap(r),Ot.buffers.depth.setTest(!0),Ot.buffers.depth.setMask(!0),Ot.buffers.color.setMask(!0),Ot.setPolygonOffset(!1),re.enabled&&re.submitFrame()}},this.setFaceCulling=function(t,e){Ot.setCullFace(t),Ot.setFlipSided(e===_a)},this.allocTextureUnit=N,this.setTexture2D=function(){var t=!1;return function(e,r){e&&e.isWebGLRenderTarget&&(t||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),t=!0),e=e.texture),Dt.setTexture2D(e,r)}}(),this.setTexture=function(){var t=!1;return function(e,r){t||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),t=!0),Dt.setTexture2D(e,r)}}(),this.setTextureCube=function(){var t=!1;return function(e,r){e&&e.isWebGLRenderTargetCube&&(t||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),t=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?Dt.setTextureCube(e,r):Dt.setTextureCubeDynamic(e,r)}}(),this.getRenderTarget=function(){return tt},this.setRenderTarget=function(t){tt=t,t&&void 0===It.get(t).__webglFramebuffer&&Dt.setupRenderTarget(t);var e=null,r=!1;if(t){var n=It.get(t).__webglFramebuffer;t.isWebGLRenderTargetCube?(e=n[t.activeCubeFace],r=!0):e=n,ot.copy(t.viewport),ct.copy(t.scissor),lt=t.scissorTest}else ot.copy(vt).multiplyScalar(mt),ct.copy(gt).multiplyScalar(mt),lt=yt;if(et!==e&&(At.bindFramebuffer(At.FRAMEBUFFER,e),et=e),Ot.viewport(ot),Ot.scissor(ct),Ot.setScissorTest(lt),r){var i=It.get(t.texture);At.framebufferTexture2D(At.FRAMEBUFFER,At.COLOR_ATTACHMENT0,At.TEXTURE_CUBE_MAP_POSITIVE_X+t.activeCubeFace,i.__webglTexture,t.activeMipMapLevel)}},this.readRenderTargetPixels=function(t,e,r,n,i,a){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");var o=It.get(t).__webglFramebuffer;if(o){var s=!1;o!==et&&(At.bindFramebuffer(At.FRAMEBUFFER,o),s=!0);try{var u=t.texture,h=u.format,c=u.type;if(h!==Zo&&ee.convert(h)!==At.getParameter(At.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(c===No||ee.convert(c)===At.getParameter(At.IMPLEMENTATION_COLOR_READ_TYPE)||c===jo&&(Pt.get("OES_texture_float")||Pt.get("WEBGL_color_buffer_float"))||c===Vo&&Pt.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");At.checkFramebufferStatus(At.FRAMEBUFFER)===At.FRAMEBUFFER_COMPLETE?e>=0&&e<=t.width-n&&r>=0&&r<=t.height-i&&At.readPixels(e,r,n,i,ee.convert(h),ee.convert(c),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&At.bindFramebuffer(At.FRAMEBUFFER,et)}}}}function Te(t,e){this.name="",this.color=new Y(t),this.density=void 0!==e?e:25e-5}function Se(t,e,r){this.name="",this.color=new Y(t),this.near=void 0!==e?e:1,this.far=void 0!==r?r:1e3}function Ae(){dt.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function Le(t,e,r,n,i){dt.call(this),this.lensFlares=[],this.positionScreen=new c,this.customUpdateCallback=void 0,void 0!==t&&this.add(t,e,r,n,i)}function Pe(t){$.call(this),this.type="SpriteMaterial",this.color=new Y(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(t)}function Re(t){dt.call(this),this.type="Sprite",this.material=void 0!==t?t:new Pe}function Ce(){dt.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Oe(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var r=0,n=this.bones.length;r<n;r++)this.boneInverses.push(new l)}}function Ie(){dt.call(this),this.type="Bone"}function De(t,e){Gt.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new l,this.bindMatrixInverse=new l;var r=this.initBones(),n=new Oe(r);this.bind(n,this.matrixWorld),this.normalizeSkinWeights()}function Ne(t){$.call(this),this.type="LineBasicMaterial",this.color=new Y(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(t)}function Ue(t,e,r){if(1===r)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new Fe(t,e);dt.call(this),this.type="Line",this.geometry=void 0!==t?t:new Ct,this.material=void 0!==e?e:new Ne({color:16777215*Math.random()})}function Fe(t,e){Ue.call(this,t,e),this.type="LineSegments"}function Be(t,e){Ue.call(this,t,e),this.type="LineLoop"}function ze(t){$.call(this),this.type="PointsMaterial",this.color=new Y(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.lights=!1,this.setValues(t)}function Ge(t,e){dt.call(this),this.type="Points",this.geometry=void 0!==t?t:new Ct,this.material=void 0!==e?e:new ze({color:16777215*Math.random()})}function je(){dt.call(this),this.type="Group"}function Ve(t,e,r,n,i,o,s,u,h){function c(){requestAnimationFrame(c),t.readyState>=t.HAVE_CURRENT_DATA&&(l.needsUpdate=!0)}a.call(this,t,e,r,n,i,o,s,u,h),this.generateMipmaps=!1;var l=this;c()}function ke(t,e,r,n,i,o,s,u,h,c,l,d){a.call(this,null,o,s,u,h,c,n,i,l,d),this.image={width:e,height:r},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function He(t,e,r,n,i,o,s,u,h,c){if((c=void 0!==c?c:$o)!==$o&&c!==ts)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===r&&c===$o&&(r=Bo),void 0===r&&c===ts&&(r=qo),a.call(this,null,n,i,o,s,u,c,r,h),this.image={width:t,height:e},this.magFilter=void 0!==s?s:Po,this.minFilter=void 0!==u?u:Po,this.flipY=!1,this.generateMipmaps=!1}function We(t){Ct.call(this),this.type="WireframeGeometry";var e,r,n,i,a,o,s,u,h,l,d=[],f=[0,0],p={},m=["a","b","c"];if(t&&t.isGeometry){var v=t.faces;for(e=0,n=v.length;e<n;e++){var g=v[e];for(r=0;r<3;r++)s=g[m[r]],u=g[m[(r+1)%3]],f[0]=Math.min(s,u),f[1]=Math.max(s,u),h=f[0]+","+f[1],void 0===p[h]&&(p[h]={index1:f[0],index2:f[1]})}for(h in p)o=p[h],l=t.vertices[o.index1],d.push(l.x,l.y,l.z),l=t.vertices[o.index2],d.push(l.x,l.y,l.z)}else if(t&&t.isBufferGeometry){var y,x,_,b,w,M,E,T;if(l=new c,null!==t.index){for(y=t.attributes.position,x=t.index,_=t.groups,0===_.length&&(_=[{start:0,count:x.count,materialIndex:0}]),i=0,a=_.length;i<a;++i)for(b=_[i],w=b.start,M=b.count,e=w,n=w+M;e<n;e+=3)for(r=0;r<3;r++)s=x.getX(e+r),u=x.getX(e+(r+1)%3),f[0]=Math.min(s,u),f[1]=Math.max(s,u),h=f[0]+","+f[1],void 0===p[h]&&(p[h]={index1:f[0],index2:f[1]});for(h in p)o=p[h],l.fromBufferAttribute(y,o.index1),d.push(l.x,l.y,l.z),l.fromBufferAttribute(y,o.index2),d.push(l.x,l.y,l.z)}else for(y=t.attributes.position,e=0,n=y.count/3;e<n;e++)for(r=0;r<3;r++)E=3*e+r,l.fromBufferAttribute(y,E),d.push(l.x,l.y,l.z),T=3*e+(r+1)%3,l.fromBufferAttribute(y,T),d.push(l.x,l.y,l.z)}this.addAttribute("position",new At(d,3))}function qe(t,e,r){yt.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:r},this.fromBufferGeometry(new Xe(t,e,r)),this.mergeVertices()}function Xe(t,e,r){Ct.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:r};var n,i,a=[],o=[],s=[],u=[],h=new c,l=new c,d=new c,f=new c,p=new c,m=e+1;for(n=0;n<=r;n++){var v=n/r;for(i=0;i<=e;i++){var g=i/e;l=t(g,v,l),o.push(l.x,l.y,l.z),g-1e-5>=0?(d=t(g-1e-5,v,d),f.subVectors(l,d)):(d=t(g+1e-5,v,d),f.subVectors(d,l)),v-1e-5>=0?(d=t(g,v-1e-5,d),p.subVectors(l,d)):(d=t(g,v+1e-5,d),p.subVectors(d,l)),h.crossVectors(f,p).normalize(),s.push(h.x,h.y,h.z),u.push(g,v)}}for(n=0;n<r;n++)for(i=0;i<e;i++){var y=n*m+i,x=n*m+i+1,_=(n+1)*m+i+1,b=(n+1)*m+i;a.push(y,x,b),a.push(x,_,b)}this.setIndex(a),this.addAttribute("position",new At(o,3)),this.addAttribute("normal",new At(s,3)),this.addAttribute("uv",new At(u,2))}function Ye(t,e,r,n){yt.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:r,detail:n},this.fromBufferGeometry(new Ze(t,e,r,n)),this.mergeVertices()}function Ze(t,e,r,n){function a(t,e,r,n){var i,a,o=Math.pow(2,n),u=[];for(i=0;i<=o;i++){u[i]=[];var h=t.clone().lerp(r,i/o),c=e.clone().lerp(r,i/o),l=o-i;for(a=0;a<=l;a++)u[i][a]=0===a&&i===o?h:h.clone().lerp(c,a/l)}for(i=0;i<o;i++)for(a=0;a<2*(o-i)-1;a++){var d=Math.floor(a/2);a%2==0?(s(u[i][d+1]),s(u[i+1][d]),s(u[i][d])):(s(u[i][d+1]),s(u[i+1][d+1]),s(u[i+1][d]))}}function o(){for(var t=0;t<m.length;t+=6){var e=m[t+0],r=m[t+2],n=m[t+4],i=Math.max(e,r,n),a=Math.min(e,r,n);i>.9&&a<.1&&(e<.2&&(m[t+0]+=1),r<.2&&(m[t+2]+=1),n<.2&&(m[t+4]+=1))}}function s(t){p.push(t.x,t.y,t.z)}function u(e,r){var n=3*e;r.x=t[n+0],r.y=t[n+1],r.z=t[n+2]}function h(){for(var t=new c,e=new c,r=new c,n=new c,a=new i,o=new i,s=new i,u=0,h=0;u<p.length;u+=9,h+=6){t.set(p[u+0],p[u+1],p[u+2]),e.set(p[u+3],p[u+4],p[u+5]),r.set(p[u+6],p[u+7],p[u+8]),a.set(m[h+0],m[h+1]),o.set(m[h+2],m[h+3]),s.set(m[h+4],m[h+5]),n.copy(t).add(e).add(r).divideScalar(3);var f=d(n);l(a,h+0,t,f),l(o,h+2,e,f),l(s,h+4,r,f)}}function l(t,e,r,n){n<0&&1===t.x&&(m[e]=t.x-1),0===r.x&&0===r.z&&(m[e]=n/2/Math.PI+.5)}function d(t){return Math.atan2(t.z,-t.x)}function f(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}Ct.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:e,radius:r,detail:n},r=r||1,n=n||0;var p=[],m=[];!function(t){for(var r=new c,n=new c,i=new c,o=0;o<e.length;o+=3)u(e[o+0],r),u(e[o+1],n),u(e[o+2],i),a(r,n,i,t)}(n),function(t){for(var e=new c,r=0;r<p.length;r+=3)e.x=p[r+0],e.y=p[r+1],e.z=p[r+2],e.normalize().multiplyScalar(t),p[r+0]=e.x,p[r+1]=e.y,p[r+2]=e.z}(r),function(){for(var t=new c,e=0;e<p.length;e+=3){t.x=p[e+0],t.y=p[e+1],t.z=p[e+2];var r=d(t)/2/Math.PI+.5,n=f(t)/Math.PI+.5;m.push(r,1-n)}h(),o()}(),this.addAttribute("position",new At(p,3)),this.addAttribute("normal",new At(p.slice(),3)),this.addAttribute("uv",new At(m,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}function Ke(t,e){yt.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Qe(t,e)),this.mergeVertices()}function Qe(t,e){var r=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],n=[2,1,0,0,3,2,1,3,0,2,3,1];Ze.call(this,r,n,t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Je(t,e){yt.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new $e(t,e)),this.mergeVertices()}function $e(t,e){var r=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],n=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];Ze.call(this,r,n,t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function tr(t,e){yt.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new er(t,e)),this.mergeVertices()}function er(t,e){var r=(1+Math.sqrt(5))/2,n=[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1],i=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];Ze.call(this,n,i,t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function rr(t,e){yt.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new nr(t,e)),this.mergeVertices()}function nr(t,e){var r=(1+Math.sqrt(5))/2,n=1/r,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-r,0,-n,r,0,n,-r,0,n,r,-n,-r,0,-n,r,0,n,-r,0,n,r,0,-r,0,-n,r,0,-n,-r,0,n,r,0,n],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];Ze.call(this,i,a,t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function ir(t,e,r,n,i,a){yt.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:r,radialSegments:n,closed:i},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new ar(t,e,r,n,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function ar(t,e,r,n,a){function o(i){var a=t.getPointAt(i/e),o=h.normals[i],s=h.binormals[i];for(d=0;d<=n;d++){var u=d/n*Math.PI*2,c=Math.sin(u),l=-Math.cos(u);p.x=l*o.x+c*s.x,p.y=l*o.y+c*s.y,p.z=l*o.z+c*s.z,p.normalize(),g.push(p.x,p.y,p.z),f.x=a.x+r*p.x,f.y=a.y+r*p.y,f.z=a.z+r*p.z,v.push(f.x,f.y,f.z)}}function s(){for(d=1;d<=e;d++)for(l=1;l<=n;l++){var t=(n+1)*(d-1)+(l-1),r=(n+1)*d+(l-1),i=(n+1)*d+l,a=(n+1)*(d-1)+l;x.push(t,r,a),x.push(r,i,a)}}function u(){for(l=0;l<=e;l++)for(d=0;d<=n;d++)m.x=l/e,m.y=d/n,y.push(m.x,m.y)}Ct.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:r,radialSegments:n,closed:a},e=e||64,r=r||1,n=n||8,a=a||!1;var h=t.computeFrenetFrames(e,a);this.tangents=h.tangents,this.normals=h.normals,this.binormals=h.binormals;var l,d,f=new c,p=new c,m=new i,v=[],g=[],y=[],x=[];!function(){for(l=0;l<e;l++)o(l);o(!1===a?e:0),u(),s()}(),this.setIndex(x),this.addAttribute("position",new At(v,3)),this.addAttribute("normal",new At(g,3)),this.addAttribute("uv",new At(y,2))}function or(t,e,r,n,i,a,o){yt.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:r,radialSegments:n,p:i,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new sr(t,e,r,n,i,a)),this.mergeVertices()}function sr(t,e,r,n,i,a){function o(t,e,r,n,i){var a=Math.cos(t),o=Math.sin(t),s=r/e*t,u=Math.cos(s);i.x=n*(2+u)*.5*a,i.y=n*(2+u)*o*.5,i.z=n*Math.sin(s)*.5}Ct.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:r,radialSegments:n,p:i,q:a},t=t||100,e=e||40,r=Math.floor(r)||64,n=Math.floor(n)||8,i=i||2,a=a||3;var s,u,h=[],l=[],d=[],f=[],p=new c,m=new c,v=new c,g=new c,y=new c,x=new c,_=new c;for(s=0;s<=r;++s){var b=s/r*i*Math.PI*2;for(o(b,i,a,t,v),o(b+.01,i,a,t,g),x.subVectors(g,v),_.addVectors(g,v),y.crossVectors(x,_),_.crossVectors(y,x),y.normalize(),_.normalize(),u=0;u<=n;++u){var w=u/n*Math.PI*2,M=-e*Math.cos(w),E=e*Math.sin(w);p.x=v.x+(M*_.x+E*y.x),p.y=v.y+(M*_.y+E*y.y),p.z=v.z+(M*_.z+E*y.z),l.push(p.x,p.y,p.z),m.subVectors(p,v).normalize(),d.push(m.x,m.y,m.z),f.push(s/r),f.push(u/n)}}for(u=1;u<=r;u++)for(s=1;s<=n;s++){var T=(n+1)*(u-1)+(s-1),S=(n+1)*u+(s-1),A=(n+1)*u+s,L=(n+1)*(u-1)+s;h.push(T,S,L),h.push(S,A,L)}this.setIndex(h),this.addAttribute("position",new At(l,3)),this.addAttribute("normal",new At(d,3)),this.addAttribute("uv",new At(f,2))}function ur(t,e,r,n,i){yt.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:r,tubularSegments:n,arc:i},this.fromBufferGeometry(new hr(t,e,r,n,i)),this.mergeVertices()}function hr(t,e,r,n,i){Ct.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:r,tubularSegments:n,arc:i},t=t||100,e=e||40,r=Math.floor(r)||8,n=Math.floor(n)||6,i=i||2*Math.PI;var a,o,s=[],u=[],h=[],l=[],d=new c,f=new c,p=new c;for(a=0;a<=r;a++)for(o=0;o<=n;o++){var m=o/n*i,v=a/r*Math.PI*2;f.x=(t+e*Math.cos(v))*Math.cos(m),f.y=(t+e*Math.cos(v))*Math.sin(m),f.z=e*Math.sin(v),u.push(f.x,f.y,f.z),d.x=t*Math.cos(m),d.y=t*Math.sin(m),p.subVectors(f,d).normalize(),h.push(p.x,p.y,p.z),l.push(o/n),l.push(a/r)}for(a=1;a<=r;a++)for(o=1;o<=n;o++){var g=(n+1)*a+o-1,y=(n+1)*(a-1)+o-1,x=(n+1)*(a-1)+o,_=(n+1)*a+o;s.push(g,y,_),s.push(y,x,_)}this.setIndex(s),this.addAttribute("position",new At(u,3)),this.addAttribute("normal",new At(h,3)),this.addAttribute("uv",new At(l,2))}function cr(t,e){yt.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new lr(t,e)),this.mergeVertices()}function lr(t,e){void 0!==t&&(Ct.call(this),this.type="ExtrudeBufferGeometry",t=Array.isArray(t)?t:[t],this.addShapeList(t,e),this.computeVertexNormals())}function dr(t,e){yt.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new fr(t,e)),this.mergeVertices()}function fr(t,e){e=e||{};var r=e.font;if(!r||!r.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new yt;var n=r.generateShapes(t,e.size,e.curveSegments);e.amount=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),lr.call(this,n,e),this.type="TextBufferGeometry"}function pr(t,e,r,n,i,a,o){yt.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:r,phiStart:n,phiLength:i,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new mr(t,e,r,n,i,a,o)),this.mergeVertices()}function mr(t,e,r,n,i,a,o){Ct.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:r,phiStart:n,phiLength:i,thetaStart:a,thetaLength:o},t=t||50,e=Math.max(3,Math.floor(e)||8),r=Math.max(2,Math.floor(r)||6),n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI,a=void 0!==a?a:0,o=void 0!==o?o:Math.PI;var s,u,h=a+o,l=0,d=[],f=new c,p=new c,m=[],v=[],g=[],y=[];for(u=0;u<=r;u++){var x=[],_=u/r;for(s=0;s<=e;s++){var b=s/e;f.x=-t*Math.cos(n+b*i)*Math.sin(a+_*o),f.y=t*Math.cos(a+_*o),f.z=t*Math.sin(n+b*i)*Math.sin(a+_*o),v.push(f.x,f.y,f.z),p.set(f.x,f.y,f.z).normalize(),g.push(p.x,p.y,p.z),y.push(b,1-_),x.push(l++)}d.push(x)}for(u=0;u<r;u++)for(s=0;s<e;s++){var w=d[u][s+1],M=d[u][s],E=d[u+1][s],T=d[u+1][s+1];(0!==u||a>0)&&m.push(w,M,T),(u!==r-1||h<Math.PI)&&m.push(M,E,T)}this.setIndex(m),this.addAttribute("position",new At(v,3)),this.addAttribute("normal",new At(g,3)),this.addAttribute("uv",new At(y,2))}function vr(t,e,r,n,i,a){yt.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:r,phiSegments:n,thetaStart:i,thetaLength:a},this.fromBufferGeometry(new gr(t,e,r,n,i,a)),this.mergeVertices()}function gr(t,e,r,n,a,o){Ct.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:r,phiSegments:n,thetaStart:a,thetaLength:o},t=t||20,e=e||50,a=void 0!==a?a:0,o=void 0!==o?o:2*Math.PI,r=void 0!==r?Math.max(3,r):8,n=void 0!==n?Math.max(1,n):1;var s,u,h,l=[],d=[],f=[],p=[],m=t,v=(e-t)/n,g=new c,y=new i;for(u=0;u<=n;u++){for(h=0;h<=r;h++)s=a+h/r*o,g.x=m*Math.cos(s),g.y=m*Math.sin(s),d.push(g.x,g.y,g.z),f.push(0,0,1),y.x=(g.x/e+1)/2,y.y=(g.y/e+1)/2,p.push(y.x,y.y);m+=v}for(u=0;u<n;u++){var x=u*(r+1);for(h=0;h<r;h++){s=h+x;var _=s,b=s+r+1,w=s+r+2,M=s+1;l.push(_,b,M),l.push(b,w,M)}}this.setIndex(l),this.addAttribute("position",new At(d,3)),this.addAttribute("normal",new At(f,3)),this.addAttribute("uv",new At(p,2))}function yr(t,e,r,n){yt.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:r,phiLength:n},this.fromBufferGeometry(new xr(t,e,r,n)),this.mergeVertices()}function xr(t,e,r,n){Ct.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:r,phiLength:n},e=Math.floor(e)||12,r=r||0,n=n||2*Math.PI,n=Os.clamp(n,0,2*Math.PI);var a,o,s,u=[],h=[],l=[],d=1/e,f=new c,p=new i;for(o=0;o<=e;o++){var m=r+o*d*n,v=Math.sin(m),g=Math.cos(m);for(s=0;s<=t.length-1;s++)f.x=t[s].x*v,f.y=t[s].y,f.z=t[s].x*g,h.push(f.x,f.y,f.z),p.x=o/e,p.y=s/(t.length-1),l.push(p.x,p.y)}for(o=0;o<e;o++)for(s=0;s<t.length-1;s++){a=s+o*t.length;var y=a,x=a+t.length,_=a+t.length+1,b=a+1;u.push(y,x,b),u.push(x,_,b)}if(this.setIndex(u),this.addAttribute("position",new At(h,3)),this.addAttribute("uv",new At(l,2)),this.computeVertexNormals(),n===2*Math.PI){var w=this.attributes.normal.array,M=new c,E=new c,T=new c;for(a=e*t.length*3,o=0,s=0;o<t.length;o++,s+=3)M.x=w[s+0],M.y=w[s+1],M.z=w[s+2],E.x=w[a+s+0],E.y=w[a+s+1],E.z=w[a+s+2],T.addVectors(M,E).normalize(),w[s+0]=w[a+s+0]=T.x,w[s+1]=w[a+s+1]=T.y,w[s+2]=w[a+s+2]=T.z}}function _r(t,e){yt.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new br(t,e)),this.mergeVertices()}function br(t,e){function r(t){var r,s,h,c=i.length/3,l=t.extractPoints(e),d=l.shape,f=l.holes;if(!1===Ks.isClockWise(d))for(d=d.reverse(),r=0,s=f.length;r<s;r++)h=f[r],!0===Ks.isClockWise(h)&&(f[r]=h.reverse());var p=Ks.triangulateShape(d,f);for(r=0,s=f.length;r<s;r++)h=f[r],d=d.concat(h);for(r=0,s=d.length;r<s;r++){var m=d[r];i.push(m.x,m.y,0),a.push(0,0,1),o.push(m.x,m.y)}for(r=0,s=p.length;r<s;r++){var v=p[r],g=v[0]+c,y=v[1]+c,x=v[2]+c;n.push(g,y,x),u+=3}}Ct.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;var n=[],i=[],a=[],o=[],s=0,u=0;if(!1===Array.isArray(t))r(t);else for(var h=0;h<t.length;h++)r(t[h]),this.addGroup(s,u,h),s+=u,u=0;this.setIndex(n),this.addAttribute("position",new At(i,3)),this.addAttribute("normal",new At(a,3)),this.addAttribute("uv",new At(o,2))}function wr(t,e){Ct.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var r,n,i,a,o=[],s=Math.cos(Os.DEG2RAD*e),u=[0,0],h={},c=["a","b","c"];t.isBufferGeometry?(a=new yt,a.fromBufferGeometry(t)):a=t.clone(),a.mergeVertices(),a.computeFaceNormals();for(var l=a.vertices,d=a.faces,f=0,p=d.length;f<p;f++)for(var m=d[f],v=0;v<3;v++)r=m[c[v]],n=m[c[(v+1)%3]],u[0]=Math.min(r,n),u[1]=Math.max(r,n),i=u[0]+","+u[1],void 0===h[i]?h[i]={index1:u[0],index2:u[1],face1:f,face2:void 0}:h[i].face2=f;for(i in h){var g=h[i];if(void 0===g.face2||d[g.face1].normal.dot(d[g.face2].normal)<=s){var y=l[g.index1];o.push(y.x,y.y,y.z),y=l[g.index2],o.push(y.x,y.y,y.z)}}this.addAttribute("position",new At(o,3))}function Mr(t,e,r,n,i,a,o,s){yt.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:r,radialSegments:n,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new Er(t,e,r,n,i,a,o,s)),this.mergeVertices()}function Er(t,e,r,n,a,o,s,u){function h(r){var a,o,h,g=new i,_=new c,b=0,w=!0===r?t:e,M=!0===r?1:-1;for(o=v,a=1;a<=n;a++)f.push(0,y*M,0),p.push(0,M,0),m.push(.5,.5),v++;for(h=v,a=0;a<=n;a++){var E=a/n,T=E*u+s,S=Math.cos(T),A=Math.sin(T);_.x=w*A,_.y=y*M,_.z=w*S,f.push(_.x,_.y,_.z),p.push(0,M,0),g.x=.5*S+.5,g.y=.5*A*M+.5,m.push(g.x,g.y),v++}for(a=0;a<n;a++){var L=o+a,P=h+a;!0===r?d.push(P,P+1,L):d.push(P+1,P,L),b+=3}l.addGroup(x,b,!0===r?1:2),x+=b}Ct.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:r,radialSegments:n,heightSegments:a,openEnded:o,thetaStart:s,thetaLength:u};var l=this;t=void 0!==t?t:20,e=void 0!==e?e:20,r=void 0!==r?r:100,n=Math.floor(n)||8,a=Math.floor(a)||1,o=void 0!==o&&o,s=void 0!==s?s:0,u=void 0!==u?u:2*Math.PI;var d=[],f=[],p=[],m=[],v=0,g=[],y=r/2,x=0;!function(){var i,o,h=new c,_=new c,b=0,w=(e-t)/r;for(o=0;o<=a;o++){var M=[],E=o/a,T=E*(e-t)+t;for(i=0;i<=n;i++){var S=i/n,A=S*u+s,L=Math.sin(A),P=Math.cos(A);_.x=T*L,_.y=-E*r+y,_.z=T*P,f.push(_.x,_.y,_.z),h.set(L,w,P).normalize(),p.push(h.x,h.y,h.z),m.push(S,1-E),M.push(v++)}g.push(M)}for(i=0;i<n;i++)for(o=0;o<a;o++){var R=g[o][i],C=g[o+1][i],O=g[o+1][i+1],I=g[o][i+1];d.push(R,C,I),d.push(C,O,I),b+=6}l.addGroup(x,b,0),x+=b}(),!1===o&&(t>0&&h(!0),e>0&&h(!1)),this.setIndex(d),this.addAttribute("position",new At(f,3)),this.addAttribute("normal",new At(p,3)),this.addAttribute("uv",new At(m,2))}function Tr(t,e,r,n,i,a,o){Mr.call(this,0,t,e,r,n,i,a,o),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:a,thetaLength:o}}function Sr(t,e,r,n,i,a,o){Er.call(this,0,t,e,r,n,i,a,o),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:a,thetaLength:o}}function Ar(t,e,r,n){yt.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:r,thetaLength:n},this.fromBufferGeometry(new Lr(t,e,r,n)),this.mergeVertices()}function Lr(t,e,r,n){Ct.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:r,thetaLength:n},t=t||50,e=void 0!==e?Math.max(3,e):8,r=void 0!==r?r:0,n=void 0!==n?n:2*Math.PI;var a,o,s=[],u=[],h=[],l=[],d=new c,f=new i;for(u.push(0,0,0),h.push(0,0,1),l.push(.5,.5),o=0,a=3;o<=e;o++,a+=3){var p=r+o/e*n;d.x=t*Math.cos(p),d.y=t*Math.sin(p),u.push(d.x,d.y,d.z),h.push(0,0,1),f.x=(u[a]/t+1)/2,f.y=(u[a+1]/t+1)/2,l.push(f.x,f.y)}for(a=1;a<=e;a++)s.push(a,a+1,0);this.setIndex(s),this.addAttribute("position",new At(u,3)),this.addAttribute("normal",new At(h,3)),this.addAttribute("uv",new At(l,2))}function Pr(t){$.call(this),this.type="ShadowMaterial",this.color=new Y(0),this.opacity=1,this.lights=!0,this.transparent=!0,this.setValues(t)}function Rr(t){tt.call(this,t),this.type="RawShaderMaterial"}function Cr(t){$.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Y(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Y(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Or(t){Cr.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(t)}function Ir(t){$.call(this),this.type="MeshPhongMaterial",this.color=new Y(16777215),this.specular=new Y(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Y(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ho,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Dr(t){Ir.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(t)}function Nr(t){$.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Ur(t){$.call(this),this.type="MeshLambertMaterial",this.color=new Y(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Y(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ho,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Fr(t){Ne.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}function Br(t,e,r){var n=this,i=!1,a=0,o=0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=r,this.itemStart=function(t){o++,!1===i&&void 0!==n.onStart&&n.onStart(t,a,o),i=!0},this.itemEnd=function(t){a++,void 0!==n.onProgress&&n.onProgress(t,a,o),a===o&&(i=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(t){void 0!==n.onError&&n.onError(t)}}function zr(t){this.manager=void 0!==t?t:tu}function Gr(t){this.manager=void 0!==t?t:tu,this._parser=null}function jr(t){this.manager=void 0!==t?t:tu,this._parser=null}function Vr(t){this.manager=void 0!==t?t:tu}function kr(t){this.manager=void 0!==t?t:tu}function Hr(t){this.manager=void 0!==t?t:tu}function Wr(t,e){dt.call(this),this.type="Light",this.color=new Y(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function qr(t,e,r){Wr.call(this,t,r),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(dt.DefaultUp),this.updateMatrix(),this.groundColor=new Y(e)}function Xr(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new i(512,512),this.map=null,this.matrix=new l}function Yr(){Xr.call(this,new mt(50,1,.5,500))}function Zr(t,e,r,n,i,a){Wr.call(this,t,e),this.type="SpotLight",this.position.copy(dt.DefaultUp),this.updateMatrix(),this.target=new dt,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==r?r:0,this.angle=void 0!==n?n:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==a?a:1,this.shadow=new Yr}function Kr(t,e,r,n){Wr.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==r?r:0,this.decay=void 0!==n?n:1,this.shadow=new Xr(new mt(90,1,.5,500))}function Qr(){Xr.call(this,new pt(-5,5,5,-5,.5,500))}function Jr(t,e){Wr.call(this,t,e),this.type="DirectionalLight",this.position.copy(dt.DefaultUp),this.updateMatrix(),this.target=new dt,this.shadow=new Qr}function $r(t,e){Wr.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function tn(t,e,r,n){Wr.call(this,t,e),this.type="RectAreaLight",this.position.set(0,1,0),this.updateMatrix(),this.width=void 0!==r?r:10,this.height=void 0!==n?n:10}function en(t,e,r,n){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new e.constructor(r),this.sampleValues=e,this.valueSize=r}function rn(t,e,r,n){en.call(this,t,e,r,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function nn(t,e,r,n){en.call(this,t,e,r,n)}function an(t,e,r,n){en.call(this,t,e,r,n)}function on(t,e,r,n){if(void 0===t)throw new Error("track name is undefined");if(void 0===e||0===e.length)throw new Error("no keyframes in track named "+t);this.name=t,this.times=eu.convertArray(e,this.TimeBufferType),this.values=eu.convertArray(r,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation),this.validate(),this.optimize()}function sn(t,e,r,n){on.call(this,t,e,r,n)}function un(t,e,r,n){en.call(this,t,e,r,n)}function hn(t,e,r,n){on.call(this,t,e,r,n)}function cn(t,e,r,n){on.call(this,t,e,r,n)}function ln(t,e,r,n){on.call(this,t,e,r,n)}function dn(t,e,r){on.call(this,t,e,r)}function fn(t,e,r,n){on.call(this,t,e,r,n)}function pn(t,e,r,n){on.apply(this,arguments)}function mn(t,e,r){this.name=t,this.tracks=r,this.duration=void 0!==e?e:-1,this.uuid=Os.generateUUID(),this.duration<0&&this.resetDuration(),this.optimize()}function vn(t){this.manager=void 0!==t?t:tu,this.textures={}}function gn(t){this.manager=void 0!==t?t:tu}function yn(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}}function xn(t){"boolean"==typeof t&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0!==t?t:tu,this.withCredentials=!1}function _n(t){this.manager=void 0!==t?t:tu,this.texturePath=""}function bn(t,e,r,n,i){var a=.5*(n-e),o=.5*(i-r),s=t*t;return(2*r-2*n+a+o)*(t*s)+(-3*r+3*n-2*a-o)*s+a*t+r}function wn(t,e){var r=1-t;return r*r*e}function Mn(t,e){return 2*(1-t)*t*e}function En(t,e){return t*t*e}function Tn(t,e,r,n){return wn(t,e)+Mn(t,r)+En(t,n)}function Sn(t,e){var r=1-t;return r*r*r*e}function An(t,e){var r=1-t;return 3*r*r*t*e}function Ln(t,e){return 3*(1-t)*t*t*e}function Pn(t,e){return t*t*t*e}function Rn(t,e,r,n,i){return Sn(t,e)+An(t,r)+Ln(t,n)+Pn(t,i)}function Cn(){this.arcLengthDivisions=200}function On(t,e){Cn.call(this),this.v1=t,this.v2=e}function In(){Cn.call(this),this.curves=[],this.autoClose=!1}function Dn(t,e,r,n,i,a,o,s){Cn.call(this),this.aX=t,this.aY=e,this.xRadius=r,this.yRadius=n,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s||0}function Nn(t){Cn.call(this),this.points=void 0===t?[]:t}function Un(t,e,r,n){Cn.call(this),this.v0=t,this.v1=e,this.v2=r,this.v3=n}function Fn(t,e,r){Cn.call(this),this.v0=t,this.v1=e,this.v2=r}function Bn(t){In.call(this),this.currentPoint=new i,t&&this.fromPoints(t)}function zn(){Bn.apply(this,arguments),this.holes=[]}function Gn(){this.subPaths=[],this.currentPath=null}function jn(t){this.data=t}function Vn(t){this.manager=void 0!==t?t:tu}function kn(t){this.manager=void 0!==t?t:tu}function Hn(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new mt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new mt,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function Wn(t,e,r){dt.call(this),this.type="CubeCamera";var n=new mt(90,1,t,e);n.up.set(0,-1,0),n.lookAt(new c(1,0,0)),this.add(n);var i=new mt(90,1,t,e);i.up.set(0,-1,0),i.lookAt(new c(-1,0,0)),this.add(i);var a=new mt(90,1,t,e);a.up.set(0,0,1),a.lookAt(new c(0,1,0)),this.add(a);var o=new mt(90,1,t,e);o.up.set(0,0,-1),o.lookAt(new c(0,-1,0)),this.add(o);var s=new mt(90,1,t,e);s.up.set(0,-1,0),s.lookAt(new c(0,0,1)),this.add(s);var h=new mt(90,1,t,e);h.up.set(0,-1,0),h.lookAt(new c(0,0,-1)),this.add(h);var l={format:Yo,magFilter:Oo,minFilter:Oo};this.renderTarget=new u(r,r,l),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var r=this.renderTarget,u=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,r.activeCubeFace=0,t.render(e,n,r),r.activeCubeFace=1,t.render(e,i,r),r.activeCubeFace=2,t.render(e,a,r),r.activeCubeFace=3,t.render(e,o,r),r.activeCubeFace=4,t.render(e,s,r),r.texture.generateMipmaps=u,r.activeCubeFace=5,t.render(e,h,r),t.setRenderTarget(null)},this.clear=function(t,e,r,n){for(var i=this.renderTarget,a=0;a<6;a++)i.activeCubeFace=a,t.setRenderTarget(i),t.clear(e,r,n);t.setRenderTarget(null)}}function qn(){dt.call(this),this.type="AudioListener",this.context=hu.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function Xn(t){dt.call(this),this.type="Audio",this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.loop=!1,this.startTime=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function Yn(t){Xn.call(this,t),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function Zn(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function Kn(t,e,r){this.binding=t,this.valueSize=r;var n,i=Float64Array;switch(e){case"quaternion":n=this._slerp;break;case"string":case"bool":i=Array,n=this._select;break;default:n=this._lerp}this.buffer=new i(4*r),this._mixBufferRegion=n,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function Qn(t,e,r){var n=r||Jn.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}function Jn(t,e,r){this.path=e,this.parsedPath=r||Jn.parseTrackName(e),this.node=Jn.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function $n(t){this.uuid=Os.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var r=0,n=arguments.length;r!==n;++r)e[arguments[r].uuid]=r;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}function ti(t,e,r){this._mixer=t,this._clip=e,this._localRoot=r||null;for(var n=e.tracks,i=n.length,a=new Array(i),o={endingStart:vs,endingEnd:vs},s=0;s!==i;++s){var u=n[s].createInterpolant(null);a[s]=u,u.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=ls,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function ei(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function ri(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function ni(){Ct.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function ii(t,e,r,n){this.uuid=Os.generateUUID(),this.data=t,this.itemSize=e,this.offset=r,this.normalized=!0===n}function ai(t,e){this.uuid=Os.generateUUID(),this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function oi(t,e,r){ai.call(this,t,e),this.meshPerAttribute=r||1}function si(t,e,r){xt.call(this,t,e),this.meshPerAttribute=r||1}function ui(t,e,r,n){this.ray=new Ft(t,e),this.near=r||0,this.far=n||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function hi(t,e){return t.distance-e.distance}function ci(t,e,r,n){if(!1!==t.visible&&(t.raycast(e,r),!0===n))for(var i=t.children,a=0,o=i.length;a<o;a++)ci(i[a],e,r,!0)}function li(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function di(t,e,r){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==r?r:0,this}function fi(t,e,r){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==r?r:0,this}function pi(t){dt.call(this),this.material=t,this.render=function(t){}}function mi(t,e,r,n){this.object=t,this.size=void 0!==e?e:1;var i=void 0!==r?r:16711680,a=void 0!==n?n:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=3*s.faces.length:s&&s.isBufferGeometry&&(o=s.attributes.normal.count);var u=new Ct,h=new At(2*o*3,3);u.addAttribute("position",h),Fe.call(this,u,new Ne({color:i,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function vi(t,e){dt.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var r=new Ct,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,a=1;i<32;i++,a++){var o=i/32*Math.PI*2,s=a/32*Math.PI*2;n.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}r.addAttribute("position",new At(n,3));var u=new Ne({fog:!1});this.cone=new Fe(r,u),this.add(this.cone),this.update()}function gi(t){var e=[];t&&t.isBone&&e.push(t);for(var r=0;r<t.children.length;r++)e.push.apply(e,gi(t.children[r]));return e}function yi(t){for(var e=gi(t),r=new Ct,n=[],i=[],a=new Y(0,0,1),o=new Y(0,1,0),s=0;s<e.length;s++){var u=e[s];u.parent&&u.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}r.addAttribute("position",new At(n,3)),r.addAttribute("color",new At(i,3));var h=new Ne({vertexColors:Oa,depthTest:!1,depthWrite:!1,transparent:!0});Fe.call(this,r,h),this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.onBeforeRender()}function xi(t,e,r){this.light=t,this.light.updateMatrixWorld(),this.color=r;var n=new mr(e,4,2),i=new Ut({wireframe:!0,fog:!1});Gt.call(this,n,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function _i(t,e){dt.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;var r=new Ne({fog:!1}),n=new Ct;n.addAttribute("position",new xt(new Float32Array(15),3)),this.line=new Ue(n,r),this.add(this.line),this.update()}function bi(t,e,r){dt.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=r;var n=new $e(e);n.rotateY(.5*Math.PI),this.material=new Ut({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=Oa);var i=n.getAttribute("position"),a=new Float32Array(3*i.count);n.addAttribute("color",new xt(a,3)),this.add(new Gt(n,this.material)),this.update()}function wi(t,e,r,n){t=t||10,e=e||10,r=new Y(void 0!==r?r:4473924),n=new Y(void 0!==n?n:8947848);for(var i=e/2,a=t/e,o=t/2,s=[],u=[],h=0,c=0,l=-o;h<=e;h++,l+=a){s.push(-o,0,l,o,0,l),s.push(l,0,-o,l,0,o);var d=h===i?r:n;d.toArray(u,c),c+=3,d.toArray(u,c),c+=3,d.toArray(u,c),c+=3,d.toArray(u,c),c+=3}var f=new Ct;f.addAttribute("position",new At(s,3)),f.addAttribute("color",new At(u,3));var p=new Ne({vertexColors:Oa});Fe.call(this,f,p)}function Mi(t,e,r,n,i,a){t=t||10,e=e||16,r=r||8,n=n||64,i=new Y(void 0!==i?i:4473924),a=new Y(void 0!==a?a:8947848);var o,s,u,h,c,l,d,f=[],p=[];for(h=0;h<=e;h++)u=h/e*(2*Math.PI),o=Math.sin(u)*t,s=Math.cos(u)*t,f.push(0,0,0),f.push(o,0,s),d=1&h?i:a,p.push(d.r,d.g,d.b),p.push(d.r,d.g,d.b);for(h=0;h<=r;h++)for(d=1&h?i:a,l=t-t/r*h,c=0;c<n;c++)u=c/n*(2*Math.PI),o=Math.sin(u)*l,s=Math.cos(u)*l,f.push(o,0,s),p.push(d.r,d.g,d.b),u=(c+1)/n*(2*Math.PI),o=Math.sin(u)*l,s=Math.cos(u)*l,f.push(o,0,s),p.push(d.r,d.g,d.b);var m=new Ct;m.addAttribute("position",new At(f,3)),m.addAttribute("color",new At(p,3));var v=new Ne({vertexColors:Oa});Fe.call(this,m,v)}function Ei(t,e,r,n){this.object=t,this.size=void 0!==e?e:1;var i=void 0!==r?r:16776960,a=void 0!==n?n:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var u=new Ct,h=new At(2*o*3,3);u.addAttribute("position",h),Fe.call(this,u,new Ne({color:i,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}function Ti(t,e,r){dt.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,void 0===e&&(e=1);var n=new Ct;n.addAttribute("position",new At([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var i=new Ne({fog:!1});this.lightPlane=new Ue(n,i),this.add(this.lightPlane),n=new Ct,n.addAttribute("position",new At([0,0,0,0,0,1],3)),this.targetLine=new Ue(n,i),this.add(this.targetLine),this.update()}function Si(t){function e(t,e,n){r(t,n),r(e,n)}function r(t,e){a.push(0,0,0),o.push(e.r,e.g,e.b),void 0===s[t]&&(s[t]=[]),s[t].push(a.length/3-1)}var n=new Ct,i=new Ne({color:16777215,vertexColors:Ca}),a=[],o=[],s={},u=new Y(16755200),h=new Y(16711680),c=new Y(43775),l=new Y(16777215),d=new Y(3355443);e("n1","n2",u),e("n2","n4",u),e("n4","n3",u),e("n3","n1",u),e("f1","f2",u),e("f2","f4",u),e("f4","f3",u),e("f3","f1",u),e("n1","f1",u),e("n2","f2",u),e("n3","f3",u),e("n4","f4",u),e("p","n1",h),e("p","n2",h),e("p","n3",h),e("p","n4",h),e("u1","u2",c),e("u2","u3",c),e("u3","u1",c),e("c","t",l),e("p","c",d),e("cn1","cn2",d),e("cn3","cn4",d),e("cf1","cf2",d),e("cf3","cf4",d),n.addAttribute("position",new At(a,3)),n.addAttribute("color",new At(o,3)),Fe.call(this,n,i),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}function Ai(t,e){this.object=t,void 0===e&&(e=16776960);var r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),i=new Ct;i.setIndex(new xt(r,1)),i.addAttribute("position",new xt(n,3)),Fe.call(this,i,new Ne({color:e})),this.matrixAutoUpdate=!1,this.update()}function Li(t,e){this.type="Box3Helper",this.box=t;var r=void 0!==e?e:16776960,n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],a=new Ct;a.setIndex(new xt(n,1)),a.addAttribute("position",new At(i,3)),Fe.call(this,a,new Ne({color:r})),this.geometry.computeBoundingSphere(),this.onBeforeRender()}function Pi(t,e,r){this.type="PlaneHelper",this.plane=t,this.size=void 0===e?1:e;var n=void 0!==r?r:16776960,i=[1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],a=new Ct;a.addAttribute("position",new At(i,3)),a.computeBoundingSphere(),Ue.call(this,a,new Ne({color:n}));var o=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],s=new Ct;s.addAttribute("position",new At(o,3)),s.computeBoundingSphere(),this.add(new Gt(s,new Ut({color:n,opacity:.2,transparent:!0,depthWrite:!1}))),this.onBeforeRender()}function Ri(t,e,r,n,i,a){dt.call(this),void 0===n&&(n=16776960),void 0===r&&(r=1),void 0===i&&(i=.2*r),void 0===a&&(a=.2*i),void 0===cu&&(cu=new Ct,cu.addAttribute("position",new At([0,0,0,0,1,0],3)),lu=new Er(0,.5,1,5,1),lu.translate(0,-.5,0)),this.position.copy(e),this.line=new Ue(cu,new Ne({color:n})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Gt(lu,new Ut({color:n})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(r,i,a)}function Ci(t){t=t||1;var e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],n=new Ct;n.addAttribute("position",new At(e,3)),n.addAttribute("color",new At(r,3));var i=new Ne({vertexColors:Oa});Fe.call(this,n,i)}function Oi(){function t(t,a,o,s){e=t,r=o,n=-3*t+3*a-2*o-s,i=2*t-2*a+o+s}var e=0,r=0,n=0,i=0;return{initCatmullRom:function(e,r,n,i,a){t(r,n,a*(n-e),a*(i-r))},initNonuniformCatmullRom:function(e,r,n,i,a,o,s){var u=(r-e)/a-(n-e)/(a+o)+(n-r)/o,h=(n-r)/o-(i-r)/(o+s)+(i-n)/s;u*=o,h*=o,t(r,n,u,h)},calc:function(t){var a=t*t;return e+r*t+n*a+i*(a*t)}}}function Ii(t){Cn.call(this),t.length<2&&console.warn("THREE.CatmullRomCurve3: Points array needs at least two entries."),this.points=t||[],this.closed=!1}function Di(t,e,r,n){Cn.call(this),this.v0=t,this.v1=e,this.v2=r,this.v3=n}function Ni(t,e,r){Cn.call(this),this.v0=t,this.v1=e,this.v2=r}function Ui(t,e){Cn.call(this),this.v1=t,this.v2=e}function Fi(t,e,r,n,i,a){Dn.call(this,t,e,r,r,n,i,a)}function Bi(t,e,r,n,i,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new vt(t,e,r,i,a,o)}function zi(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t}function Gi(t){return void 0===t&&(t=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,t.materials=t,t.clone=function(){return t.slice()},t}function ji(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Ge(t,e)}function Vi(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Re(t)}function ki(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Ge(t,e)}function Hi(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new ze(t)}function Wi(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new ze(t)}function qi(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new ze(t)}function Xi(t,e,r){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new c(t,e,r)}function Yi(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new xt(t,e).setDynamic(!0)}function Zi(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new _t(t,e)}function Ki(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new bt(t,e)}function Qi(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new wt(t,e)}function Ji(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Mt(t,e)}function $i(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Et(t,e)}function ta(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Tt(t,e)}function ea(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new St(t,e)}function ra(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new At(t,e)}function na(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Lt(t,e)}function ia(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Ii.call(this,t),this.type="catmullrom",this.closed=!0}function aa(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Ii.call(this,t),this.type="catmullrom"}function oa(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Ii.call(this,t),this.type="catmullrom"}function sa(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Ai(t,e)}function ua(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Fe(new wr(t.geometry),new Ne({color:void 0!==e?e:16777215}))}function ha(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Fe(new We(t.geometry),new Ne({color:void 0!==e?e:16777215}))}function ca(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new zr(t)}function la(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new jr(t)}function da(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(t,e){console.warn("THREE.Projector: .projectVector() is now vector.project()."),t.project(e)},this.unprojectVector=function(t,e){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),t.unproject(e)},this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}}function fa(){console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}}Object.defineProperty(e,"__esModule",{value:!0}),r.d(e,"WebGLRenderTargetCube",function(){return u}),r.d(e,"WebGLRenderTarget",function(){return s}),r.d(e,"WebGLRenderer",function(){return Ee}),r.d(e,"ShaderLib",function(){return Ws}),r.d(e,"UniformsLib",function(){return Vs}),r.d(e,"UniformsUtils",function(){return ks}),r.d(e,"ShaderChunk",function(){return Hs}),r.d(e,"FogExp2",function(){return Te}),r.d(e,"Fog",function(){return Se}),r.d(e,"Scene",function(){return Ae}),r.d(e,"LensFlare",function(){return Le}),r.d(e,"Sprite",function(){return Re}),r.d(e,"LOD",function(){return Ce}),r.d(e,"SkinnedMesh",function(){return De}),r.d(e,"Skeleton",function(){return Oe}),r.d(e,"Bone",function(){return Ie}),r.d(e,"Mesh",function(){return Gt}),r.d(e,"LineSegments",function(){return Fe}),r.d(e,"LineLoop",function(){return Be}),r.d(e,"Line",function(){return Ue}),r.d(e,"Points",function(){return Ge}),r.d(e,"Group",function(){return je}),r.d(e,"VideoTexture",function(){return Ve}),r.d(e,"DataTexture",function(){return d}),r.d(e,"CompressedTexture",function(){return ke}),r.d(e,"CubeTexture",function(){return f}),r.d(e,"CanvasTexture",function(){return Q}),r.d(e,"DepthTexture",function(){return He}),r.d(e,"Texture",function(){return a}),r.d(e,"CompressedTextureLoader",function(){return Gr}),r.d(e,"DataTextureLoader",function(){return jr}),r.d(e,"CubeTextureLoader",function(){return kr}),r.d(e,"TextureLoader",function(){return Hr}),r.d(e,"ObjectLoader",function(){return _n}),r.d(e,"MaterialLoader",function(){return vn}),r.d(e,"BufferGeometryLoader",function(){return gn}),r.d(e,"DefaultLoadingManager",function(){return tu}),r.d(e,"LoadingManager",function(){return Br}),r.d(e,"JSONLoader",function(){return xn}),r.d(e,"ImageLoader",function(){return Vr}),r.d(e,"FontLoader",function(){return Vn}),r.d(e,"FileLoader",function(){return zr}),r.d(e,"Loader",function(){return yn}),r.d(e,"Cache",function(){return $s}),r.d(e,"AudioLoader",function(){return kn}),r.d(e,"SpotLightShadow",function(){return Yr}),r.d(e,"SpotLight",function(){return Zr}),r.d(e,"PointLight",function(){return Kr}),r.d(e,"RectAreaLight",function(){return tn}),r.d(e,"HemisphereLight",function(){return qr}),r.d(e,"DirectionalLightShadow",function(){return Qr}),r.d(e,"DirectionalLight",function(){return Jr}),r.d(e,"AmbientLight",function(){return $r}),r.d(e,"LightShadow",function(){return Xr}),r.d(e,"Light",function(){return Wr}),r.d(e,"StereoCamera",function(){return Hn}),r.d(e,"PerspectiveCamera",function(){return mt}),r.d(e,"OrthographicCamera",function(){return pt}),r.d(e,"CubeCamera",function(){return Wn}),r.d(e,"ArrayCamera",function(){return xe}),r.d(e,"Camera",function(){return ft}),r.d(e,"AudioListener",function(){return qn}),r.d(e,"PositionalAudio",function(){return Yn}),r.d(e,"AudioContext",function(){return hu}),r.d(e,"AudioAnalyser",function(){return Zn}),r.d(e,"Audio",function(){return Xn}),r.d(e,"VectorKeyframeTrack",function(){return sn}),r.d(e,"StringKeyframeTrack",function(){return ln}),r.d(e,"QuaternionKeyframeTrack",function(){return hn}),r.d(e,"NumberKeyframeTrack",function(){return cn}),r.d(e,"ColorKeyframeTrack",function(){return fn}),r.d(e,"BooleanKeyframeTrack",function(){return dn}),r.d(e,"PropertyMixer",function(){return Kn}),r.d(e,"PropertyBinding",function(){return Jn}),r.d(e,"KeyframeTrack",function(){return pn}),r.d(e,"AnimationUtils",function(){return eu}),r.d(e,"AnimationObjectGroup",function(){return $n}),r.d(e,"AnimationMixer",function(){return ei}),r.d(e,"AnimationClip",function(){return mn}),r.d(e,"Uniform",function(){return ri}),r.d(e,"InstancedBufferGeometry",function(){return ni}),r.d(e,"BufferGeometry",function(){return Ct}),r.d(e,"GeometryIdCount",function(){return gt}),r.d(e,"Geometry",function(){return yt}),r.d(e,"InterleavedBufferAttribute",function(){return ii}),r.d(e,"InstancedInterleavedBuffer",function(){return oi}),r.d(e,"InterleavedBuffer",function(){return ai}),r.d(e,"InstancedBufferAttribute",function(){return si}),r.d(e,"Face3",function(){return vt}),r.d(e,"Object3D",function(){return dt}),r.d(e,"Raycaster",function(){return ui}),r.d(e,"Layers",function(){return lt}),r.d(e,"EventDispatcher",function(){return n}),r.d(e,"Clock",function(){return li}),r.d(e,"QuaternionLinearInterpolant",function(){return un}),r.d(e,"LinearInterpolant",function(){return nn}),r.d(e,"DiscreteInterpolant",function(){return an}),r.d(e,"CubicInterpolant",function(){return rn}),r.d(e,"Interpolant",function(){return en}),r.d(e,"Triangle",function(){return zt}),r.d(e,"Math",function(){return Os}),r.d(e,"Spherical",function(){return di}),r.d(e,"Cylindrical",function(){return fi}),r.d(e,"Plane",function(){return ot}),r.d(e,"Frustum",function(){return st}),r.d(e,"Sphere",function(){return it}),r.d(e,"Ray",function(){return Ft}),r.d(e,"Matrix4",function(){return l}),r.d(e,"Matrix3",function(){return at}),r.d(e,"Box3",function(){return nt}),r.d(e,"Box2",function(){return Z}),r.d(e,"Line3",function(){return Bt}),r.d(e,"Euler",function(){return ct}),r.d(e,"Vector4",function(){return o}),r.d(e,"Vector3",function(){return c}),r.d(e,"Vector2",function(){return i}),r.d(e,"Quaternion",function(){return h}),r.d(e,"Color",function(){return Y}),r.d(e,"ImmediateRenderObject",function(){return pi}),r.d(e,"VertexNormalsHelper",function(){return mi}),r.d(e,"SpotLightHelper",function(){return vi}),r.d(e,"SkeletonHelper",function(){return yi}),r.d(e,"PointLightHelper",function(){return xi}),r.d(e,"RectAreaLightHelper",function(){return _i}),r.d(e,"HemisphereLightHelper",function(){return bi}),r.d(e,"GridHelper",function(){return wi}),r.d(e,"PolarGridHelper",function(){return Mi}),r.d(e,"FaceNormalsHelper",function(){return Ei}),r.d(e,"DirectionalLightHelper",function(){return Ti}),r.d(e,"CameraHelper",function(){return Si}),r.d(e,"BoxHelper",function(){return Ai}),r.d(e,"Box3Helper",function(){return Li}),r.d(e,"PlaneHelper",function(){return Pi}),r.d(e,"ArrowHelper",function(){return Ri}),r.d(e,"AxisHelper",function(){return Ci}),r.d(e,"CatmullRomCurve3",function(){return Ii}),r.d(e,"CubicBezierCurve3",function(){return Di}),r.d(e,"QuadraticBezierCurve3",function(){return Ni}),r.d(e,"LineCurve3",function(){return Ui}),r.d(e,"ArcCurve",function(){return Fi}),r.d(e,"EllipseCurve",function(){return Dn}),r.d(e,"SplineCurve",function(){return Nn}),r.d(e,"CubicBezierCurve",function(){return Un}),r.d(e,"QuadraticBezierCurve",function(){return Fn}),r.d(e,"LineCurve",function(){return On}),r.d(e,"Shape",function(){return zn}),r.d(e,"Path",function(){return Bn}),r.d(e,"ShapePath",function(){return Gn}),r.d(e,"Font",function(){return jn}),r.d(e,"CurvePath",function(){return In}),r.d(e,"Curve",function(){return Cn}),r.d(e,"ShapeUtils",function(){return Ks}),r.d(e,"SceneUtils",function(){return vu}),r.d(e,"WebGLUtils",function(){return Me}),r.d(e,"WireframeGeometry",function(){return We}),r.d(e,"ParametricGeometry",function(){return qe}),r.d(e,"ParametricBufferGeometry",function(){return Xe}),r.d(e,"TetrahedronGeometry",function(){return Ke}),r.d(e,"TetrahedronBufferGeometry",function(){return Qe}),r.d(e,"OctahedronGeometry",function(){return Je}),r.d(e,"OctahedronBufferGeometry",function(){return $e}),r.d(e,"IcosahedronGeometry",function(){return tr}),r.d(e,"IcosahedronBufferGeometry",function(){return er}),r.d(e,"DodecahedronGeometry",function(){return rr}),r.d(e,"DodecahedronBufferGeometry",function(){return nr}),r.d(e,"PolyhedronGeometry",function(){return Ye}),r.d(e,"PolyhedronBufferGeometry",function(){return Ze}),r.d(e,"TubeGeometry",function(){return ir}),r.d(e,"TubeBufferGeometry",function(){return ar}),r.d(e,"TorusKnotGeometry",function(){return or}),r.d(e,"TorusKnotBufferGeometry",function(){return sr}),r.d(e,"TorusGeometry",function(){return ur}),r.d(e,"TorusBufferGeometry",function(){return hr}),r.d(e,"TextGeometry",function(){return dr}),r.d(e,"TextBufferGeometry",function(){return fr}),r.d(e,"SphereGeometry",function(){return pr}),r.d(e,"SphereBufferGeometry",function(){return mr}),r.d(e,"RingGeometry",function(){return vr}),r.d(e,"RingBufferGeometry",function(){return gr}),r.d(e,"PlaneGeometry",function(){return Dt}),r.d(e,"PlaneBufferGeometry",function(){return Nt}),r.d(e,"LatheGeometry",function(){return yr}),r.d(e,"LatheBufferGeometry",function(){return xr}),r.d(e,"ShapeGeometry",function(){return _r}),r.d(e,"ShapeBufferGeometry",function(){return br}),r.d(e,"ExtrudeGeometry",function(){return cr}),r.d(e,"ExtrudeBufferGeometry",function(){return lr}),r.d(e,"EdgesGeometry",function(){return wr}),r.d(e,"ConeGeometry",function(){return Tr}),r.d(e,"ConeBufferGeometry",function(){return Sr}),r.d(e,"CylinderGeometry",function(){return Mr}),r.d(e,"CylinderBufferGeometry",function(){return Er}),r.d(e,"CircleGeometry",function(){return Ar}),r.d(e,"CircleBufferGeometry",function(){return Lr}),r.d(e,"BoxGeometry",function(){return Ot}),r.d(e,"BoxBufferGeometry",function(){return It}),r.d(e,"ShadowMaterial",function(){return Pr}),r.d(e,"SpriteMaterial",function(){return Pe}),r.d(e,"RawShaderMaterial",function(){return Rr});r.d(e,"ShaderMaterial",function(){return tt}),r.d(e,"PointsMaterial",function(){return ze}),r.d(e,"MeshPhysicalMaterial",function(){return Or}),r.d(e,"MeshStandardMaterial",function(){return Cr}),r.d(e,"MeshPhongMaterial",function(){return Ir}),r.d(e,"MeshToonMaterial",function(){return Dr}),r.d(e,"MeshNormalMaterial",function(){return Nr}),r.d(e,"MeshLambertMaterial",function(){return Ur}),r.d(e,"MeshDepthMaterial",function(){return et}),r.d(e,"MeshDistanceMaterial",function(){return rt}),r.d(e,"MeshBasicMaterial",function(){return Ut}),r.d(e,"LineDashedMaterial",function(){return Fr}),r.d(e,"LineBasicMaterial",function(){return Ne}),r.d(e,"Material",function(){return $}),r.d(e,"Float64BufferAttribute",function(){return Lt}),r.d(e,"Float32BufferAttribute",function(){return At}),r.d(e,"Uint32BufferAttribute",function(){return St}),r.d(e,"Int32BufferAttribute",function(){return Tt}),r.d(e,"Uint16BufferAttribute",function(){return Et}),r.d(e,"Int16BufferAttribute",function(){return Mt}),r.d(e,"Uint8ClampedBufferAttribute",function(){return wt}),r.d(e,"Uint8BufferAttribute",function(){return bt}),r.d(e,"Int8BufferAttribute",function(){return _t}),r.d(e,"BufferAttribute",function(){return xt}),r.d(e,"REVISION",function(){return pa}),r.d(e,"MOUSE",function(){return ma}),r.d(e,"CullFaceNone",function(){return va}),r.d(e,"CullFaceBack",function(){return ga}),r.d(e,"CullFaceFront",function(){return ya}),r.d(e,"CullFaceFrontBack",function(){return xa}),r.d(e,"FrontFaceDirectionCW",function(){return _a}),r.d(e,"FrontFaceDirectionCCW",function(){return ba}),r.d(e,"BasicShadowMap",function(){return wa}),r.d(e,"PCFShadowMap",function(){return Ma}),r.d(e,"PCFSoftShadowMap",function(){return Ea}),r.d(e,"FrontSide",function(){return Ta}),r.d(e,"BackSide",function(){return Sa}),r.d(e,"DoubleSide",function(){return Aa}),r.d(e,"FlatShading",function(){return La}),r.d(e,"SmoothShading",function(){return Pa}),r.d(e,"NoColors",function(){return Ra}),r.d(e,"FaceColors",function(){return Ca}),r.d(e,"VertexColors",function(){return Oa}),r.d(e,"NoBlending",function(){return Ia}),r.d(e,"NormalBlending",function(){return Da}),r.d(e,"AdditiveBlending",function(){return Na}),r.d(e,"SubtractiveBlending",function(){return Ua}),r.d(e,"MultiplyBlending",function(){return Fa}),r.d(e,"CustomBlending",function(){return Ba}),r.d(e,"AddEquation",function(){return za}),r.d(e,"SubtractEquation",function(){return Ga}),r.d(e,"ReverseSubtractEquation",function(){return ja}),r.d(e,"MinEquation",function(){return Va}),r.d(e,"MaxEquation",function(){return ka}),r.d(e,"ZeroFactor",function(){return Ha}),r.d(e,"OneFactor",function(){return Wa}),r.d(e,"SrcColorFactor",function(){return qa}),r.d(e,"OneMinusSrcColorFactor",function(){return Xa}),r.d(e,"SrcAlphaFactor",function(){return Ya}),r.d(e,"OneMinusSrcAlphaFactor",function(){return Za}),r.d(e,"DstAlphaFactor",function(){return Ka}),r.d(e,"OneMinusDstAlphaFactor",function(){return Qa}),r.d(e,"DstColorFactor",function(){return Ja}),r.d(e,"OneMinusDstColorFactor",function(){return $a}),r.d(e,"SrcAlphaSaturateFactor",function(){return to}),r.d(e,"NeverDepth",function(){return eo}),r.d(e,"AlwaysDepth",function(){return ro}),r.d(e,"LessDepth",function(){return no}),r.d(e,"LessEqualDepth",function(){return io}),r.d(e,"EqualDepth",function(){return ao}),r.d(e,"GreaterEqualDepth",function(){return oo}),r.d(e,"GreaterDepth",function(){return so}),r.d(e,"NotEqualDepth",function(){return uo}),r.d(e,"MultiplyOperation",function(){return ho}),r.d(e,"MixOperation",function(){return co}),r.d(e,"AddOperation",function(){return lo}),r.d(e,"NoToneMapping",function(){return fo}),r.d(e,"LinearToneMapping",function(){return po}),r.d(e,"ReinhardToneMapping",function(){return mo}),r.d(e,"Uncharted2ToneMapping",function(){return vo}),r.d(e,"CineonToneMapping",function(){return go}),r.d(e,"UVMapping",function(){return yo}),r.d(e,"CubeReflectionMapping",function(){return xo}),r.d(e,"CubeRefractionMapping",function(){return _o}),r.d(e,"EquirectangularReflectionMapping",function(){return bo}),r.d(e,"EquirectangularRefractionMapping",function(){return wo}),r.d(e,"SphericalReflectionMapping",function(){return Mo}),r.d(e,"CubeUVReflectionMapping",function(){return Eo}),r.d(e,"CubeUVRefractionMapping",function(){return To}),r.d(e,"RepeatWrapping",function(){return So}),r.d(e,"ClampToEdgeWrapping",function(){return Ao}),r.d(e,"MirroredRepeatWrapping",function(){return Lo}),r.d(e,"NearestFilter",function(){return Po}),r.d(e,"NearestMipMapNearestFilter",function(){return Ro}),r.d(e,"NearestMipMapLinearFilter",function(){return Co}),r.d(e,"LinearFilter",function(){return Oo}),r.d(e,"LinearMipMapNearestFilter",function(){return Io}),r.d(e,"LinearMipMapLinearFilter",function(){return Do}),r.d(e,"UnsignedByteType",function(){return No}),r.d(e,"ByteType",function(){return Uo}),r.d(e,"ShortType",function(){return Fo}),r.d(e,"UnsignedShortType",function(){return Bo}),r.d(e,"IntType",function(){return zo}),r.d(e,"UnsignedIntType",function(){return Go}),r.d(e,"FloatType",function(){return jo}),r.d(e,"HalfFloatType",function(){return Vo}),r.d(e,"UnsignedShort4444Type",function(){return ko}),r.d(e,"UnsignedShort5551Type",function(){return Ho}),r.d(e,"UnsignedShort565Type",function(){return Wo}),r.d(e,"UnsignedInt248Type",function(){return qo}),r.d(e,"AlphaFormat",function(){return Xo}),r.d(e,"RGBFormat",function(){return Yo}),r.d(e,"RGBAFormat",function(){return Zo}),r.d(e,"LuminanceFormat",function(){return Ko}),r.d(e,"LuminanceAlphaFormat",function(){return Qo}),r.d(e,"RGBEFormat",function(){return Jo}),r.d(e,"DepthFormat",function(){return $o}),r.d(e,"DepthStencilFormat",function(){return ts}),r.d(e,"RGB_S3TC_DXT1_Format",function(){return es}),r.d(e,"RGBA_S3TC_DXT1_Format",function(){return rs}),r.d(e,"RGBA_S3TC_DXT3_Format",function(){return ns}),r.d(e,"RGBA_S3TC_DXT5_Format",function(){return is}),r.d(e,"RGB_PVRTC_4BPPV1_Format",function(){return as}),r.d(e,"RGB_PVRTC_2BPPV1_Format",function(){return os}),r.d(e,"RGBA_PVRTC_4BPPV1_Format",function(){return ss}),r.d(e,"RGBA_PVRTC_2BPPV1_Format",function(){return us}),r.d(e,"RGB_ETC1_Format",function(){return hs}),r.d(e,"LoopOnce",function(){return cs}),r.d(e,"LoopRepeat",function(){return ls}),r.d(e,"LoopPingPong",function(){return ds}),r.d(e,"InterpolateDiscrete",function(){return fs}),r.d(e,"InterpolateLinear",function(){return ps}),r.d(e,"InterpolateSmooth",function(){return ms}),r.d(e,"ZeroCurvatureEnding",function(){return vs}),r.d(e,"ZeroSlopeEnding",function(){return gs}),r.d(e,"WrapAroundEnding",function(){return ys}),r.d(e,"TrianglesDrawMode",function(){return xs}),r.d(e,"TriangleStripDrawMode",function(){return _s}),r.d(e,"TriangleFanDrawMode",function(){return bs}),r.d(e,"LinearEncoding",function(){return ws}),r.d(e,"sRGBEncoding",function(){return Ms}),r.d(e,"GammaEncoding",function(){return Es}),r.d(e,"RGBEEncoding",function(){return Ts}),r.d(e,"LogLuvEncoding",function(){return Ss}),r.d(e,"RGBM7Encoding",function(){return As}),r.d(e,"RGBM16Encoding",function(){return Ls}),r.d(e,"RGBDEncoding",function(){return Ps}),r.d(e,"BasicDepthPacking",function(){return Rs}),r.d(e,"RGBADepthPacking",function(){return Cs}),r.d(e,"CubeGeometry",function(){return Ot}),r.d(e,"Face4",function(){return Bi}),r.d(e,"LineStrip",function(){return gu}),r.d(e,"LinePieces",function(){return yu}),r.d(e,"MeshFaceMaterial",function(){return zi}),r.d(e,"MultiMaterial",function(){return Gi}),r.d(e,"PointCloud",function(){return ji}),r.d(e,"Particle",function(){return Vi}),r.d(e,"ParticleSystem",function(){return ki}),r.d(e,"PointCloudMaterial",function(){return Hi}),r.d(e,"ParticleBasicMaterial",function(){return Wi}),r.d(e,"ParticleSystemMaterial",function(){return qi}),r.d(e,"Vertex",function(){return Xi}),r.d(e,"DynamicBufferAttribute",function(){return Yi}),r.d(e,"Int8Attribute",function(){return Zi}),r.d(e,"Uint8Attribute",function(){return Ki}),r.d(e,"Uint8ClampedAttribute",function(){return Qi}),r.d(e,"Int16Attribute",function(){return Ji}),r.d(e,"Uint16Attribute",function(){return $i}),r.d(e,"Int32Attribute",function(){return ta}),r.d(e,"Uint32Attribute",function(){return ea}),r.d(e,"Float32Attribute",function(){return ra}),r.d(e,"Float64Attribute",function(){return na}),r.d(e,"ClosedSplineCurve3",function(){return ia}),r.d(e,"SplineCurve3",function(){return aa}),r.d(e,"Spline",function(){return oa}),r.d(e,"BoundingBoxHelper",function(){return sa}),r.d(e,"EdgesHelper",function(){return ua}),r.d(e,"WireframeHelper",function(){return ha}),r.d(e,"XHRLoader",function(){return ca}),r.d(e,"BinaryTextureLoader",function(){return la}),r.d(e,"GeometryUtils",function(){return xu}),r.d(e,"ImageUtils",function(){return _u}),r.d(e,"Projector",function(){return da}),r.d(e,"CanvasRenderer",function(){return fa}),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),void 0===Function.prototype.name&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&function(){Object.assign=function(t){if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),r=1;r<arguments.length;r++){var n=arguments[r];if(void 0!==n&&null!==n)for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}}(),Object.assign(n.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var r=this._listeners;void 0===r[t]&&(r[t]=[]),-1===r[t].indexOf(e)&&r[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var r=this._listeners;return void 0!==r[t]&&-1!==r[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var r=this._listeners,n=r[t];if(void 0!==n){var i=n.indexOf(e);-1!==i&&n.splice(i,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners,r=e[t.type];if(void 0!==r){t.target=this;for(var n=r.slice(0),i=0,a=n.length;i<a;i++)n[i].call(this,t)}}}});var pa="87",ma={LEFT:0,MIDDLE:1,RIGHT:2},va=0,ga=1,ya=2,xa=3,_a=0,ba=1,wa=0,Ma=1,Ea=2,Ta=0,Sa=1,Aa=2,La=1,Pa=2,Ra=0,Ca=1,Oa=2,Ia=0,Da=1,Na=2,Ua=3,Fa=4,Ba=5,za=100,Ga=101,ja=102,Va=103,ka=104,Ha=200,Wa=201,qa=202,Xa=203,Ya=204,Za=205,Ka=206,Qa=207,Ja=208,$a=209,to=210,eo=0,ro=1,no=2,io=3,ao=4,oo=5,so=6,uo=7,ho=0,co=1,lo=2,fo=0,po=1,mo=2,vo=3,go=4,yo=300,xo=301,_o=302,bo=303,wo=304,Mo=305,Eo=306,To=307,So=1e3,Ao=1001,Lo=1002,Po=1003,Ro=1004,Co=1005,Oo=1006,Io=1007,Do=1008,No=1009,Uo=1010,Fo=1011,Bo=1012,zo=1013,Go=1014,jo=1015,Vo=1016,ko=1017,Ho=1018,Wo=1019,qo=1020,Xo=1021,Yo=1022,Zo=1023,Ko=1024,Qo=1025,Jo=Zo,$o=1026,ts=1027,es=2001,rs=2002,ns=2003,is=2004,as=2100,os=2101,ss=2102,us=2103,hs=2151,cs=2200,ls=2201,ds=2202,fs=2300,ps=2301,ms=2302,vs=2400,gs=2401,ys=2402,xs=0,_s=1,bs=2,ws=3e3,Ms=3001,Es=3007,Ts=3002,Ss=3003,As=3004,Ls=3005,Ps=3006,Rs=3200,Cs=3201,Os={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t,e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=new Array(36),n=0;return function(){for(var i=0;i<36;i++)8===i||13===i||18===i||23===i?r[i]="-":14===i?r[i]="4":(n<=2&&(n=33554432+16777216*Math.random()|0),t=15&n,n>>=4,r[i]=e[19===i?3&t|8:t]);return r.join("")}}(),clamp:function(t,e,r){return Math.max(e,Math.min(r,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,r,n,i){return n+(t-e)*(i-n)/(r-e)},lerp:function(t,e,r){return(1-r)*t+r*e},smoothstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*(3-2*t)},smootherstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*Os.DEG2RAD},radToDeg:function(t){return t*Os.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}};Object.defineProperties(i.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(i.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(){var t=new i,e=new i;return function(r,n){return t.set(r,r),e.set(n,n),this.clamp(t,e)}}(),clampLength:function(t,e){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(e,r)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,r=this.y-t.y;return e*e+r*r},distanceToManhattan:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,r){return this.subVectors(e,t).multiplyScalar(r).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,r){return void 0!==r&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var r=Math.cos(e),n=Math.sin(e),i=this.x-t.x,a=this.y-t.y;return this.x=i*r-a*n+t.x,this.y=i*n+a*r+t.y,this}});var Is=0;a.DEFAULT_IMAGE=void 0,a.DEFAULT_MAPPING=yo,Object.defineProperty(a.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(a.prototype,n.prototype,{constructor:a,isTexture:!0,clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){if(void 0!==t.textures[this.uuid])return t.textures[this.uuid];var e={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var r=this.image;void 0===r.uuid&&(r.uuid=Os.generateUUID()),void 0===t.images[r.uuid]&&(t.images[r.uuid]={uuid:r.uuid,url:function(t){var e;if(t instanceof HTMLCanvasElement)e=t;else{e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),e.width=t.width,e.height=t.height;var r=e.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height)}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}(r)}),e.image=r.uuid}return t.textures[this.uuid]=e,e},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping===yo){if(t.multiply(this.repeat),t.add(this.offset),t.x<0||t.x>1)switch(this.wrapS){case So:t.x=t.x-Math.floor(t.x);break;case Ao:t.x=t.x<0?0:1;break;case Lo:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case So:t.y=t.y-Math.floor(t.y);break;case Ao:t.y=t.y<0?0:1;break;case Lo:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}this.flipY&&(t.y=1-t.y)}}}),Object.assign(o.prototype,{isVector4:!0,set:function(t,e,r,n){return this.x=t,this.y=e,this.z=r,this.w=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,r=this.y,n=this.z,i=this.w,a=t.elements;return this.x=a[0]*e+a[4]*r+a[8]*n+a[12]*i,this.y=a[1]*e+a[5]*r+a[9]*n+a[13]*i,this.z=a[2]*e+a[6]*r+a[10]*n+a[14]*i,this.w=a[3]*e+a[7]*r+a[11]*n+a[15]*i,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,r,n,i,a=t.elements,o=a[0],s=a[4],u=a[8],h=a[1],c=a[5],l=a[9],d=a[2],f=a[6],p=a[10];if(Math.abs(s-h)<.01&&Math.abs(u-d)<.01&&Math.abs(l-f)<.01){if(Math.abs(s+h)<.1&&Math.abs(u+d)<.1&&Math.abs(l+f)<.1&&Math.abs(o+c+p-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(o+1)/2,v=(c+1)/2,g=(p+1)/2,y=(s+h)/4,x=(u+d)/4,_=(l+f)/4;return m>v&&m>g?m<.01?(r=0,n=.707106781,i=.707106781):(r=Math.sqrt(m),n=y/r,i=x/r):v>g?v<.01?(r=.707106781,n=0,i=.707106781):(n=Math.sqrt(v),r=y/n,i=_/n):g<.01?(r=.707106781,n=.707106781,i=0):(i=Math.sqrt(g),r=x/i,n=_/i),this.set(r,n,i,e),this}var b=Math.sqrt((f-l)*(f-l)+(u-d)*(u-d)+(h-s)*(h-s));return Math.abs(b)<.001&&(b=1),this.x=(f-l)/b,this.y=(u-d)/b,this.z=(h-s)/b,this.w=Math.acos((o+c+p-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(){var t,e;return function(r,n){return void 0===t&&(t=new o,e=new o),t.set(r,r,r,r),e.set(n,n,n,n),this.clamp(t,e)}}(),clampLength:function(t,e){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(e,r)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,r){return this.subVectors(e,t).multiplyScalar(r).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,r){return void 0!==r&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),Object.assign(s.prototype,n.prototype,{isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),u.prototype=Object.create(s.prototype),u.prototype.constructor=u,u.prototype.isWebGLRenderTargetCube=!0,Object.assign(h,{slerp:function(t,e,r,n){return r.copy(t).slerp(e,n)},slerpFlat:function(t,e,r,n,i,a,o){var s=r[n+0],u=r[n+1],h=r[n+2],c=r[n+3],l=i[a+0],d=i[a+1],f=i[a+2],p=i[a+3];if(c!==p||s!==l||u!==d||h!==f){var m=1-o,v=s*l+u*d+h*f+c*p,g=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var x=Math.sqrt(y),_=Math.atan2(x,v*g);m=Math.sin(m*_)/x,o=Math.sin(o*_)/x}var b=o*g;if(s=s*m+l*b,u=u*m+d*b,h=h*m+f*b,c=c*m+p*b,m===1-o){var w=1/Math.sqrt(s*s+u*u+h*h+c*c);s*=w,u*=w,h*=w,c*=w}}t[e]=s,t[e+1]=u,t[e+2]=h,t[e+3]=c}}),Object.defineProperties(h.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback()}}}),Object.assign(h.prototype,{set:function(t,e,r,n){return this._x=t,this._y=e,this._z=r,this._w=n,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var r=t._x,n=t._y,i=t._z,a=t.order,o=Math.cos,s=Math.sin,u=o(r/2),h=o(n/2),c=o(i/2),l=s(r/2),d=s(n/2),f=s(i/2);return"XYZ"===a?(this._x=l*h*c+u*d*f,this._y=u*d*c-l*h*f,this._z=u*h*f+l*d*c,this._w=u*h*c-l*d*f):"YXZ"===a?(this._x=l*h*c+u*d*f,this._y=u*d*c-l*h*f,this._z=u*h*f-l*d*c,this._w=u*h*c+l*d*f):"ZXY"===a?(this._x=l*h*c-u*d*f,this._y=u*d*c+l*h*f,this._z=u*h*f+l*d*c,this._w=u*h*c-l*d*f):"ZYX"===a?(this._x=l*h*c-u*d*f,this._y=u*d*c+l*h*f,this._z=u*h*f-l*d*c,this._w=u*h*c+l*d*f):"YZX"===a?(this._x=l*h*c+u*d*f,this._y=u*d*c+l*h*f,this._z=u*h*f-l*d*c,this._w=u*h*c-l*d*f):"XZY"===a&&(this._x=l*h*c-u*d*f,this._y=u*d*c-l*h*f,this._z=u*h*f+l*d*c,this._w=u*h*c+l*d*f),!1!==e&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var r=e/2,n=Math.sin(r);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(r),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e,r=t.elements,n=r[0],i=r[4],a=r[8],o=r[1],s=r[5],u=r[9],h=r[2],c=r[6],l=r[10],d=n+s+l;return d>0?(e=.5/Math.sqrt(d+1),this._w=.25/e,this._x=(c-u)*e,this._y=(a-h)*e,this._z=(o-i)*e):n>s&&n>l?(e=2*Math.sqrt(1+n-s-l),this._w=(c-u)/e,this._x=.25*e,this._y=(i+o)/e,this._z=(a+h)/e):s>l?(e=2*Math.sqrt(1+s-n-l),this._w=(a-h)/e,this._x=(i+o)/e,this._y=.25*e,this._z=(u+c)/e):(e=2*Math.sqrt(1+l-n-s),this._w=(o-i)/e,this._x=(a+h)/e,this._y=(u+c)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(){var t,e=new c;return function(r,n){return void 0===e&&(e=new c),t=r.dot(n)+1,t<1e-6?(t=0,Math.abs(r.x)>Math.abs(r.z)?e.set(-r.y,r.x,0):e.set(0,-r.z,r.y)):e.crossVectors(r,n),this._x=e.x,this._y=e.y,this._z=e.z,this._w=t,this.normalize()}}(),inverse:function(){return this.conjugate().normalize()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var r=t._x,n=t._y,i=t._z,a=t._w,o=e._x,s=e._y,u=e._z,h=e._w;return this._x=r*h+a*o+n*u-i*s,this._y=n*h+a*s+i*o-r*u,this._z=i*h+a*u+r*s-n*o,this._w=a*h-r*o-n*s-i*u,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var r=this._x,n=this._y,i=this._z,a=this._w,o=a*t._w+r*t._x+n*t._y+i*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=r,this._y=n,this._z=i,this;var s=Math.sqrt(1-o*o);if(Math.abs(s)<.001)return this._w=.5*(a+this._w),this._x=.5*(r+this._x),this._y=.5*(n+this._y),this._z=.5*(i+this._z),this;var u=Math.atan2(s,o),h=Math.sin((1-e)*u)/s,c=Math.sin(e*u)/s;return this._w=a*h+this._w*c,this._x=r*h+this._x*c,this._y=n*h+this._y*c,this._z=i*h+this._z*c,this.onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(c.prototype,{isVector3:!0,set:function(t,e,r){return this.x=t,this.y=e,this.z=r,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(){var t=new h;return function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(t.setFromEuler(e))}}(),applyAxisAngle:function(){var t=new h;return function(e,r){return this.applyQuaternion(t.setFromAxisAngle(e,r))}}(),applyMatrix3:function(t){var e=this.x,r=this.y,n=this.z,i=t.elements;return this.x=i[0]*e+i[3]*r+i[6]*n,this.y=i[1]*e+i[4]*r+i[7]*n,this.z=i[2]*e+i[5]*r+i[8]*n,this},applyMatrix4:function(t){var e=this.x,r=this.y,n=this.z,i=t.elements,a=1/(i[3]*e+i[7]*r+i[11]*n+i[15]);return this.x=(i[0]*e+i[4]*r+i[8]*n+i[12])*a,this.y=(i[1]*e+i[5]*r+i[9]*n+i[13])*a,this.z=(i[2]*e+i[6]*r+i[10]*n+i[14])*a,this},applyQuaternion:function(t){var e=this.x,r=this.y,n=this.z,i=t.x,a=t.y,o=t.z,s=t.w,u=s*e+a*n-o*r,h=s*r+o*e-i*n,c=s*n+i*r-a*e,l=-i*e-a*r-o*n;return this.x=u*s+l*-i+h*-o-c*-a,this.y=h*s+l*-a+c*-i-u*-o,this.z=c*s+l*-o+u*-a-h*-i,this},project:function(){var t=new l;return function(e){return t.multiplyMatrices(e.projectionMatrix,t.getInverse(e.matrixWorld)),this.applyMatrix4(t)}}(),unproject:function(){var t=new l;return function(e){return t.multiplyMatrices(e.matrixWorld,t.getInverse(e.projectionMatrix)),this.applyMatrix4(t)}}(),transformDirection:function(t){var e=this.x,r=this.y,n=this.z,i=t.elements;return this.x=i[0]*e+i[4]*r+i[8]*n,this.y=i[1]*e+i[5]*r+i[9]*n,this.z=i[2]*e+i[6]*r+i[10]*n,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(){var t=new c,e=new c;return function(r,n){return t.set(r,r,r),e.set(n,n,n),this.clamp(t,e)}}(),clampLength:function(t,e){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(e,r)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,r){return this.subVectors(e,t).multiplyScalar(r).add(t)},cross:function(t,e){if(void 0!==e)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e);var r=this.x,n=this.y,i=this.z;return this.x=n*t.z-i*t.y,this.y=i*t.x-r*t.z,this.z=r*t.y-n*t.x,this},crossVectors:function(t,e){var r=t.x,n=t.y,i=t.z,a=e.x,o=e.y,s=e.z;return this.x=n*s-i*o,this.y=i*a-r*s,this.z=r*o-n*a,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:function(){var t=new c;return function(e){return t.copy(this).projectOnVector(e),this.sub(t)}}(),reflect:function(){var t=new c;return function(e){return this.sub(t.copy(e).multiplyScalar(2*this.dot(e)))}}(),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(Os.clamp(e,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,r=this.y-t.y,n=this.z-t.z;return e*e+r*r+n*n},distanceToManhattan:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){var e=Math.sin(t.phi)*t.radius;return this.x=e*Math.sin(t.theta),this.y=Math.cos(t.phi)*t.radius,this.z=e*Math.cos(t.theta),this},setFromCylindrical:function(t){return this.x=t.radius*Math.sin(t.theta),this.y=t.y,this.z=t.radius*Math.cos(t.theta),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),r=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=r,this.z=n,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,r){return void 0!==r&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}}),Object.assign(l.prototype,{isMatrix4:!0,set:function(t,e,r,n,i,a,o,s,u,h,c,l,d,f,p,m){var v=this.elements;return v[0]=t,v[4]=e,v[8]=r,v[12]=n,v[1]=i,v[5]=a,v[9]=o,v[13]=s,v[2]=u,v[6]=h,v[10]=c,v[14]=l,v[3]=d,v[7]=f,v[11]=p,v[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new l).fromArray(this.elements)},copy:function(t){var e=this.elements,r=t.elements;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],this},copyPosition:function(t){var e=this.elements,r=t.elements;return e[12]=r[12],e[13]=r[13],e[14]=r[14],this},extractBasis:function(t,e,r){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,r){return this.set(t.x,e.x,r.x,0,t.y,e.y,r.y,0,t.z,e.z,r.z,0,0,0,0,1),this},extractRotation:function(){var t=new c;return function(e){var r=this.elements,n=e.elements,i=1/t.setFromMatrixColumn(e,0).length(),a=1/t.setFromMatrixColumn(e,1).length(),o=1/t.setFromMatrixColumn(e,2).length();return r[0]=n[0]*i,r[1]=n[1]*i,r[2]=n[2]*i,r[4]=n[4]*a,r[5]=n[5]*a,r[6]=n[6]*a,r[8]=n[8]*o,r[9]=n[9]*o,r[10]=n[10]*o,this}}(),makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,r=t.x,n=t.y,i=t.z,a=Math.cos(r),o=Math.sin(r),s=Math.cos(n),u=Math.sin(n),h=Math.cos(i),c=Math.sin(i);if("XYZ"===t.order){var l=a*h,d=a*c,f=o*h,p=o*c;e[0]=s*h,e[4]=-s*c,e[8]=u,e[1]=d+f*u,e[5]=l-p*u,e[9]=-o*s,e[2]=p-l*u,e[6]=f+d*u,e[10]=a*s}else if("YXZ"===t.order){var m=s*h,v=s*c,g=u*h,y=u*c;e[0]=m+y*o,e[4]=g*o-v,e[8]=a*u,e[1]=a*c,e[5]=a*h,e[9]=-o,e[2]=v*o-g,e[6]=y+m*o,e[10]=a*s}else if("ZXY"===t.order){var m=s*h,v=s*c,g=u*h,y=u*c;e[0]=m-y*o,e[4]=-a*c,e[8]=g+v*o,e[1]=v+g*o,e[5]=a*h,e[9]=y-m*o,e[2]=-a*u,e[6]=o,e[10]=a*s}else if("ZYX"===t.order){var l=a*h,d=a*c,f=o*h,p=o*c;e[0]=s*h,e[4]=f*u-d,e[8]=l*u+p,e[1]=s*c,e[5]=p*u+l,e[9]=d*u-f,e[2]=-u,e[6]=o*s,e[10]=a*s}else if("YZX"===t.order){var x=a*s,_=a*u,b=o*s,w=o*u;e[0]=s*h,e[4]=w-x*c,e[8]=b*c+_,e[1]=c,e[5]=a*h,e[9]=-o*h,e[2]=-u*h,e[6]=_*c+b,e[10]=x-w*c}else if("XZY"===t.order){var x=a*s,_=a*u,b=o*s,w=o*u;e[0]=s*h,e[4]=-c,e[8]=u*h,e[1]=x*c+w,e[5]=a*h,e[9]=_*c-b,e[2]=b*c-_,e[6]=o*h,e[10]=w*c+x}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){var e=this.elements,r=t._x,n=t._y,i=t._z,a=t._w,o=r+r,s=n+n,u=i+i,h=r*o,c=r*s,l=r*u,d=n*s,f=n*u,p=i*u,m=a*o,v=a*s,g=a*u;return e[0]=1-(d+p),e[4]=c-g,e[8]=l+v,e[1]=c+g,e[5]=1-(h+p),e[9]=f-m,e[2]=l-v,e[6]=f+m,e[10]=1-(h+d),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},lookAt:function(){var t=new c,e=new c,r=new c;return function(n,i,a){var o=this.elements;return r.subVectors(n,i),0===r.lengthSq()&&(r.z=1),r.normalize(),t.crossVectors(a,r),0===t.lengthSq()&&(1===Math.abs(a.z)?r.x+=1e-4:r.z+=1e-4,r.normalize(),t.crossVectors(a,r)),t.normalize(),e.crossVectors(r,t),o[0]=t.x,o[4]=e.x,o[8]=r.x,o[1]=t.y,o[5]=e.y,o[9]=r.y,o[2]=t.z,o[6]=e.z,o[10]=r.z,this}}(),multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var r=t.elements,n=e.elements,i=this.elements,a=r[0],o=r[4],s=r[8],u=r[12],h=r[1],c=r[5],l=r[9],d=r[13],f=r[2],p=r[6],m=r[10],v=r[14],g=r[3],y=r[7],x=r[11],_=r[15],b=n[0],w=n[4],M=n[8],E=n[12],T=n[1],S=n[5],A=n[9],L=n[13],P=n[2],R=n[6],C=n[10],O=n[14],I=n[3],D=n[7],N=n[11],U=n[15];return i[0]=a*b+o*T+s*P+u*I,i[4]=a*w+o*S+s*R+u*D,i[8]=a*M+o*A+s*C+u*N,i[12]=a*E+o*L+s*O+u*U,i[1]=h*b+c*T+l*P+d*I,i[5]=h*w+c*S+l*R+d*D,i[9]=h*M+c*A+l*C+d*N,i[13]=h*E+c*L+l*O+d*U,i[2]=f*b+p*T+m*P+v*I,i[6]=f*w+p*S+m*R+v*D,i[10]=f*M+p*A+m*C+v*N,i[14]=f*E+p*L+m*O+v*U,i[3]=g*b+y*T+x*P+_*I,i[7]=g*w+y*S+x*R+_*D,i[11]=g*M+y*A+x*C+_*N,i[15]=g*E+y*L+x*O+_*U,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToBufferAttribute:function(){var t=new c;return function(e){for(var r=0,n=e.count;r<n;r++)t.x=e.getX(r),t.y=e.getY(r),t.z=e.getZ(r),t.applyMatrix4(this),e.setXYZ(r,t.x,t.y,t.z);return e}}(),determinant:function(){var t=this.elements,e=t[0],r=t[4],n=t[8],i=t[12],a=t[1],o=t[5],s=t[9],u=t[13],h=t[2],c=t[6],l=t[10],d=t[14];return t[3]*(+i*s*c-n*u*c-i*o*l+r*u*l+n*o*d-r*s*d)+t[7]*(+e*s*d-e*u*l+i*a*l-n*a*d+n*u*h-i*s*h)+t[11]*(+e*u*c-e*o*d-i*a*c+r*a*d+i*o*h-r*u*h)+t[15]*(-n*o*h-e*s*c+e*o*l+n*a*c-r*a*l+r*s*h)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t){var e=this.elements;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this},getInverse:function(t,e){var r=this.elements,n=t.elements,i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],h=n[5],c=n[6],l=n[7],d=n[8],f=n[9],p=n[10],m=n[11],v=n[12],g=n[13],y=n[14],x=n[15],_=f*y*l-g*p*l+g*c*m-h*y*m-f*c*x+h*p*x,b=v*p*l-d*y*l-v*c*m+u*y*m+d*c*x-u*p*x,w=d*g*l-v*f*l+v*h*m-u*g*m-d*h*x+u*f*x,M=v*f*c-d*g*c-v*h*p+u*g*p+d*h*y-u*f*y,E=i*_+a*b+o*w+s*M;if(0===E){var T="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(T);return console.warn(T),this.identity()}var S=1/E;return r[0]=_*S,r[1]=(g*p*s-f*y*s-g*o*m+a*y*m+f*o*x-a*p*x)*S,r[2]=(h*y*s-g*c*s+g*o*l-a*y*l-h*o*x+a*c*x)*S,r[3]=(f*c*s-h*p*s-f*o*l+a*p*l+h*o*m-a*c*m)*S,r[4]=b*S,r[5]=(d*y*s-v*p*s+v*o*m-i*y*m-d*o*x+i*p*x)*S,r[6]=(v*c*s-u*y*s-v*o*l+i*y*l+u*o*x-i*c*x)*S,r[7]=(u*p*s-d*c*s+d*o*l-i*p*l-u*o*m+i*c*m)*S,r[8]=w*S,r[9]=(v*f*s-d*g*s-v*a*m+i*g*m+d*a*x-i*f*x)*S,r[10]=(u*g*s-v*h*s+v*a*l-i*g*l-u*a*x+i*h*x)*S,r[11]=(d*h*s-u*f*s-d*a*l+i*f*l+u*a*m-i*h*m)*S,r[12]=M*S,r[13]=(d*g*o-v*f*o+v*a*p-i*g*p-d*a*y+i*f*y)*S,r[14]=(v*h*o-u*g*o-v*a*c+i*g*c+u*a*y-i*h*y)*S,r[15]=(u*f*o-d*h*o+d*a*c-i*f*c-u*a*p+i*h*p)*S,this},scale:function(t){var e=this.elements,r=t.x,n=t.y,i=t.z;return e[0]*=r,e[4]*=n,e[8]*=i,e[1]*=r,e[5]*=n,e[9]*=i,e[2]*=r,e[6]*=n,e[10]*=i,e[3]*=r,e[7]*=n,e[11]*=i,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],r=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,r,n))},makeTranslation:function(t,e,r){return this.set(1,0,0,t,0,1,0,e,0,0,1,r,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),r=Math.sin(t);return this.set(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),r=Math.sin(t);return this.set(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),r=Math.sin(t);return this.set(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var r=Math.cos(e),n=Math.sin(e),i=1-r,a=t.x,o=t.y,s=t.z,u=i*a,h=i*o;return this.set(u*a+r,u*o-n*s,u*s+n*o,0,u*o+n*s,h*o+r,h*s-n*a,0,u*s-n*o,h*s+n*a,i*s*s+r,0,0,0,0,1),this},makeScale:function(t,e,r){return this.set(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1),this},makeShear:function(t,e,r){return this.set(1,e,r,0,t,1,r,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,r){return this.makeRotationFromQuaternion(e),this.scale(r),this.setPosition(t),this},decompose:function(){var t=new c,e=new l;return function(r,n,i){var a=this.elements,o=t.set(a[0],a[1],a[2]).length(),s=t.set(a[4],a[5],a[6]).length(),u=t.set(a[8],a[9],a[10]).length();this.determinant()<0&&(o=-o),r.x=a[12],r.y=a[13],r.z=a[14],e.copy(this);var h=1/o,c=1/s,l=1/u;return e.elements[0]*=h,e.elements[1]*=h,e.elements[2]*=h,e.elements[4]*=c,e.elements[5]*=c,e.elements[6]*=c,e.elements[8]*=l,e.elements[9]*=l,e.elements[10]*=l,n.setFromRotationMatrix(e),i.x=o,i.y=s,i.z=u,this}}(),makePerspective:function(t,e,r,n,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(e-t),u=2*i/(r-n),h=(e+t)/(e-t),c=(r+n)/(r-n),l=-(a+i)/(a-i),d=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=h,o[12]=0,o[1]=0,o[5]=u,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=l,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(t,e,r,n,i,a){var o=this.elements,s=1/(e-t),u=1/(r-n),h=1/(a-i),c=(e+t)*s,l=(r+n)*u,d=(a+i)*h;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*u,o[9]=0,o[13]=-l,o[2]=0,o[6]=0,o[10]=-2*h,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(t){for(var e=this.elements,r=t.elements,n=0;n<16;n++)if(e[n]!==r[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var r=0;r<16;r++)this.elements[r]=t[r+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t[e+9]=r[9],t[e+10]=r[10],t[e+11]=r[11],t[e+12]=r[12],t[e+13]=r[13],t[e+14]=r[14],t[e+15]=r[15],t}}),d.prototype=Object.create(a.prototype),d.prototype.constructor=d,d.prototype.isDataTexture=!0,f.prototype=Object.create(a.prototype),f.prototype.constructor=f,f.prototype.isCubeTexture=!0,Object.defineProperty(f.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}});var Ds=new a,Ns=new f,Us=[],Fs=[],Bs=new Float32Array(16),zs=new Float32Array(9);H.prototype.setValue=function(t,e){for(var r=this.seq,n=0,i=r.length;n!==i;++n){var a=r[n];a.setValue(t,e[a.id])}};var Gs=/([\w\d_]+)(\])?(\[|\.)?/g;X.prototype.setValue=function(t,e,r){var n=this.map[e];void 0!==n&&n.setValue(t,r,this.renderer)},X.prototype.setOptional=function(t,e,r){var n=e[r];void 0!==n&&this.setValue(t,r,n)},X.upload=function(t,e,r,n){for(var i=0,a=e.length;i!==a;++i){var o=e[i],s=r[o.id];!1!==s.needsUpdate&&o.setValue(t,s.value,n)}},X.seqWithValue=function(t,e){for(var r=[],n=0,i=t.length;n!==i;++n){var a=t[n];a.id in e&&r.push(a)}return r};var js={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Object.assign(Y.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,r){return this.r=t,this.g=e,this.b=r,this},setHSL:function(){function t(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+6*(e-t)*(2/3-r):t}return function(e,r,n){if(e=Os.euclideanModulo(e,1),r=Os.clamp(r,0,1),n=Os.clamp(n,0,1),0===r)this.r=this.g=this.b=n;else{var i=n<=.5?n*(1+r):n+r-n*r,a=2*n-i;this.r=t(a,i,e+1/3),this.g=t(a,i,e),this.b=t(a,i,e-1/3)}return this}}(),setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var r;if(r=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var n,i=r[1],a=r[2];switch(i){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,e(n[5]),this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,e(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(n[1])/360,s=parseInt(n[2],10)/100,u=parseInt(n[3],10)/100;return e(n[5]),this.setHSL(o,s,u)}}}else if(r=/^\#([A-Fa-f0-9]+)$/.exec(t)){var h=r[1],c=h.length;if(3===c)return this.r=parseInt(h.charAt(0)+h.charAt(0),16)/255,this.g=parseInt(h.charAt(1)+h.charAt(1),16)/255,this.b=parseInt(h.charAt(2)+h.charAt(2),16)/255,this;if(6===c)return this.r=parseInt(h.charAt(0)+h.charAt(1),16)/255,this.g=parseInt(h.charAt(2)+h.charAt(3),16)/255,this.b=parseInt(h.charAt(4)+h.charAt(5),16)/255,this}if(t&&t.length>0){var h=js[t];void 0!==h?this.setHex(h):console.warn("THREE.Color: Unknown color "+t)}return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var r=e>0?1/e:1;return this.r=Math.pow(t.r,r),this.g=Math.pow(t.g,r),this.b=Math.pow(t.b,r),this},convertGammaToLinear:function(){var t=this.r,e=this.g,r=this.b;return this.r=t*t,this.g=e*e,this.b=r*r,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){var e,r,n=t||{h:0,s:0,l:0},i=this.r,a=this.g,o=this.b,s=Math.max(i,a,o),u=Math.min(i,a,o),h=(u+s)/2;if(u===s)e=0,r=0;else{var c=s-u;switch(r=h<=.5?c/(s+u):c/(2-s-u),s){case i:e=(a-o)/c+(a<o?6:0);break;case a:e=(o-i)/c+2;break;case o:e=(i-a)/c+4}e/=6}return n.h=e,n.s=r,n.l=h,n},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,r){var n=this.getHSL();return n.h+=t,n.s+=e,n.l+=r,this.setHSL(n.h,n.s,n.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}});var Vs={common:{diffuse:{value:new Y(15658734)},opacity:{value:1},map:{value:null},offsetRepeat:{value:new o(0,0,1,1)},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new i(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Y(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new Y(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},offsetRepeat:{value:new o(0,0,1,1)}}},ks={merge:function(t){for(var e={},r=0;r<t.length;r++){var n=this.clone(t[r]);for(var i in n)e[i]=n[i]}return e},clone:function(t){var e={};for(var r in t){e[r]={};for(var n in t[r]){var i=t[r][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?e[r][n]=i.clone():Array.isArray(i)?e[r][n]=i.slice():e[r][n]=i}}return e}},Hs={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n",bsdfs:"float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t}\n\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat theta = acos( dot( N, V ) );\n\tvec2 uv = vec2(\n\t\tsqrt( saturate( roughness ) ),\n\t\tsaturate( theta / ( 0.5 * PI ) ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.86267 + (0.49788 + 0.01436 * y ) * y;\n\tfloat b = 3.45068 + (4.18814 + y) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = (x > 0.0) ? v : 0.5 * inversesqrt( 1.0 - x * x ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transpose( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tvec3 result = vec3( LTC_ClippedSphereFormFactor( vectorFormFactor ) );\n\treturn result;\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t\t\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\t\tvec4 plane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t\n\t#endif\n#endif\n",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transpose( const in mat3 v ) {\n\tmat3 tmp;\n\ttmp[0] = vec3(v[0].x, v[1].x, v[2].x);\n\ttmp[1] = vec3(v[0].y, v[1].y, v[2].y);\n\ttmp[2] = vec3(v[0].z, v[1].z, v[2].z);\n\treturn tmp;\n}\n",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract(Le);\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max(vRGB, 0.0), 1.0 );\n}\n",envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n",fog_vertex:"\n#ifdef USE_FOG\nfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n varying float fogDepth;\n#endif\n",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif\n",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",lights_pars:"uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltcMat;\tuniform sampler2D ltcMag;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tfloat norm = texture2D( ltcMag, uv ).a;\n\t\tvec4 t = texture2D( ltcMat, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( 1, 0, t.y ),\n\t\t\tvec3( 0, t.z, 0 ),\n\t\t\tvec3( t.w, 0, t.x )\n\t\t);\n\t\treflectedLight.directSpecular += lightColor * material.specularColor * norm * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",lights_template:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\t#ifndef STANDARD\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\n\t#else\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\n\t#endif\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n",logdepthbuf_fragment:"#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",map_particle_fragment:"#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif\n",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",normal_fragment:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 1.0 - 2.0 * rgb.xyz;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"#if defined( DITHERING )\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif\n",dithering_pars_fragment:"#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif\n",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif\n",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif\n",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",tonemapping_pars_fragment:"#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif\n",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n",cube_vert:"varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}\n",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}\n",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n",equirect_vert:"varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}\n",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}\n",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}\n",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <bsdfs>\n#include <lights_pars>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n}\n",shadow_vert:"#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n"},Ws={basic:{uniforms:ks.merge([Vs.common,Vs.specularmap,Vs.envmap,Vs.aomap,Vs.lightmap,Vs.fog]),vertexShader:Hs.meshbasic_vert,fragmentShader:Hs.meshbasic_frag},lambert:{uniforms:ks.merge([Vs.common,Vs.specularmap,Vs.envmap,Vs.aomap,Vs.lightmap,Vs.emissivemap,Vs.fog,Vs.lights,{emissive:{value:new Y(0)}}]),vertexShader:Hs.meshlambert_vert,fragmentShader:Hs.meshlambert_frag},phong:{uniforms:ks.merge([Vs.common,Vs.specularmap,Vs.envmap,Vs.aomap,Vs.lightmap,Vs.emissivemap,Vs.bumpmap,Vs.normalmap,Vs.displacementmap,Vs.gradientmap,Vs.fog,Vs.lights,{emissive:{value:new Y(0)},specular:{value:new Y(1118481)},shininess:{value:30}}]),vertexShader:Hs.meshphong_vert,fragmentShader:Hs.meshphong_frag},standard:{uniforms:ks.merge([Vs.common,Vs.envmap,Vs.aomap,Vs.lightmap,Vs.emissivemap,Vs.bumpmap,Vs.normalmap,Vs.displacementmap,Vs.roughnessmap,Vs.metalnessmap,Vs.fog,Vs.lights,{emissive:{value:new Y(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Hs.meshphysical_vert,fragmentShader:Hs.meshphysical_frag},points:{uniforms:ks.merge([Vs.points,Vs.fog]),vertexShader:Hs.points_vert,fragmentShader:Hs.points_frag},dashed:{uniforms:ks.merge([Vs.common,Vs.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Hs.linedashed_vert,fragmentShader:Hs.linedashed_frag},depth:{uniforms:ks.merge([Vs.common,Vs.displacementmap]),vertexShader:Hs.depth_vert,fragmentShader:Hs.depth_frag},normal:{uniforms:ks.merge([Vs.common,Vs.bumpmap,Vs.normalmap,Vs.displacementmap,{opacity:{value:1}}]),vertexShader:Hs.normal_vert,fragmentShader:Hs.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Hs.cube_vert,fragmentShader:Hs.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Hs.equirect_vert,fragmentShader:Hs.equirect_frag},distanceRGBA:{uniforms:ks.merge([Vs.common,Vs.displacementmap,{referencePosition:{value:new c},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Hs.distanceRGBA_vert,fragmentShader:Hs.distanceRGBA_frag},shadow:{uniforms:ks.merge([Vs.lights,{color:{value:new Y(0)},opacity:{value:1}}]),vertexShader:Hs.shadow_vert,fragmentShader:Hs.shadow_frag}};Ws.physical={uniforms:ks.merge([Ws.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:Hs.meshphysical_vert,fragmentShader:Hs.meshphysical_frag},Object.assign(Z.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,r=t.length;e<r;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new i;return function(e,r){var n=t.copy(r).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){var e=t||new i;return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){var e=t||new i;return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return(e||new i).set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return(e||new i).copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new i;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Q.prototype=Object.create(a.prototype),Q.prototype.constructor=Q;var qs=0;Object.assign($.prototype,n.prototype,{isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var r=t[e];if(void 0!==r)if("shading"!==e){var n=this[e];void 0!==n?n&&n.isColor?n.set(r):n&&n.isVector3&&r&&r.isVector3?n.copy(r):this[e]="overdraw"===e?Number(r):r:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=r===La;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){function e(t){var e=[];for(var r in t){var n=t[r];delete n.metadata,e.push(n)}return e}var r=void 0===t;r&&(t={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Da&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==Ta&&(n.side=this.side),this.vertexColors!==Ra&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),r){var i=e(t.textures),a=e(t.images);i.length>0&&(n.textures=i),a.length>0&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.lights=t.lights,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.overdraw=t.overdraw,this.visible=t.visible,this.userData=JSON.parse(JSON.stringify(t.userData)),this.clipShadows=t.clipShadows,this.clipIntersection=t.clipIntersection;var e=t.clippingPlanes,r=null;if(null!==e){var n=e.length;r=new Array(n);for(var i=0;i!==n;++i)r[i]=e[i].clone()}return this.clippingPlanes=r,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),tt.prototype=Object.create($.prototype),tt.prototype.constructor=tt,tt.prototype.isShaderMaterial=!0,tt.prototype.copy=function(t){return $.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=ks.clone(t.uniforms),this.defines=t.defines,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},tt.prototype.toJSON=function(t){var e=$.prototype.toJSON.call(this,t);return e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e},et.prototype=Object.create($.prototype),et.prototype.constructor=et,et.prototype.isMeshDepthMaterial=!0,et.prototype.copy=function(t){return $.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},rt.prototype=Object.create($.prototype),rt.prototype.constructor=rt,rt.prototype.isMeshDistanceMaterial=!0,rt.prototype.copy=function(t){return $.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this},Object.assign(nt.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,u=t.length;s<u;s+=3){var h=t[s],c=t[s+1],l=t[s+2];h<e&&(e=h),c<r&&(r=c),l<n&&(n=l),h>i&&(i=h),c>a&&(a=c),l>o&&(o=l)}return this.min.set(e,r,n),this.max.set(i,a,o),this},setFromBufferAttribute:function(t){for(var e=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,u=t.count;s<u;s++){var h=t.getX(s),c=t.getY(s),l=t.getZ(s);h<e&&(e=h),c<r&&(r=c),l<n&&(n=l),h>i&&(i=h),c>a&&(a=c),l>o&&(o=l)}return this.min.set(e,r,n),this.max.set(i,a,o),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,r=t.length;e<r;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new c;return function(e,r){var n=t.copy(r).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}}(),setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){var e=t||new c;return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){var e=t||new c;return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(){var t=new c;return function(e){var r=this;return e.updateMatrixWorld(!0),e.traverse(function(e){var n,i,a=e.geometry;if(void 0!==a)if(a.isGeometry){var o=a.vertices;for(n=0,i=o.length;n<i;n++)t.copy(o[n]),t.applyMatrix4(e.matrixWorld),r.expandByPoint(t)}else if(a.isBufferGeometry){var s=a.attributes.position;if(void 0!==s)for(n=0,i=s.count;n<i;n++)t.fromBufferAttribute(s,n).applyMatrix4(e.matrixWorld),r.expandByPoint(t)}}),this}}(),containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return(e||new c).set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(){var t=new c;return function(e){return this.clampPoint(e.center,t),t.distanceToSquared(e.center)<=e.radius*e.radius}}(),intersectsPlane:function(t){var e,r;return t.normal.x>0?(e=t.normal.x*this.min.x,r=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,r=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,r+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,r+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,r+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,r+=t.normal.z*this.min.z),e<=t.constant&&r>=t.constant},clampPoint:function(t,e){return(e||new c).copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new c;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),getBoundingSphere:function(){var t=new c;return function(e){var r=e||new it;return this.getCenter(r.center),r.radius=.5*this.getSize(t).length(),r}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(){var t=[new c,new c,new c,new c,new c,new c,new c,new c];return function(e){return this.isEmpty()?this:(t[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),t[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),t[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),t[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),t[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),t[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),t[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),t[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(t),this)}}(),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(it.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(){var t=new nt;return function(e,r){var n=this.center;void 0!==r?n.copy(r):t.setFromPoints(e).getCenter(n);for(var i=0,a=0,o=e.length;a<o;a++)i=Math.max(i,n.distanceToSquared(e[a]));return this.radius=Math.sqrt(i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var r=this.center.distanceToSquared(t),n=e||new c;return n.copy(t),r>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n},getBoundingBox:function(t){var e=t||new nt;return e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}}),Object.assign(at.prototype,{isMatrix3:!0,set:function(t,e,r,n,i,a,o,s,u){var h=this.elements;return h[0]=t,h[1]=n,h[2]=o,h[3]=e,h[4]=i,h[5]=s,h[6]=r,h[7]=a,h[8]=u,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,r=t.elements;return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToBufferAttribute:function(){var t=new c;return function(e){for(var r=0,n=e.count;r<n;r++)t.x=e.getX(r),t.y=e.getY(r),t.z=e.getZ(r),t.applyMatrix3(this),e.setXYZ(r,t.x,t.y,t.z);return e}}(),multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var r=t.elements,n=e.elements,i=this.elements,a=r[0],o=r[3],s=r[6],u=r[1],h=r[4],c=r[7],l=r[2],d=r[5],f=r[8],p=n[0],m=n[3],v=n[6],g=n[1],y=n[4],x=n[7],_=n[2],b=n[5],w=n[8];return i[0]=a*p+o*g+s*_,i[3]=a*m+o*y+s*b,i[6]=a*v+o*x+s*w,i[1]=u*p+h*g+c*_,i[4]=u*m+h*y+c*b,i[7]=u*v+h*x+c*w,i[2]=l*p+d*g+f*_,i[5]=l*m+d*y+f*b,i[8]=l*v+d*x+f*w,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],r=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],u=t[7],h=t[8];return e*a*h-e*o*u-r*i*h+r*o*s+n*i*u-n*a*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var r=t.elements,n=this.elements,i=r[0],a=r[1],o=r[2],s=r[3],u=r[4],h=r[5],c=r[6],l=r[7],d=r[8],f=d*u-h*l,p=h*c-d*s,m=l*s-u*c,v=i*f+a*p+o*m;if(0===v){var g="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(g);return console.warn(g),this.identity()}var y=1/v;return n[0]=f*y,n[1]=(o*l-d*a)*y,n[2]=(h*a-o*u)*y,n[3]=p*y,n[4]=(d*i-o*c)*y,n[5]=(o*s-h*i)*y,n[6]=m*y,n[7]=(a*c-l*i)*y,n[8]=(u*i-a*s)*y,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},equals:function(t){for(var e=this.elements,r=t.elements,n=0;n<9;n++)if(e[n]!==r[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var r=0;r<9;r++)this.elements[r]=t[r+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t}}),Object.assign(ot.prototype,{set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,r,n){return this.normal.set(t,e,r),this.constant=n,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new c,e=new c;return function(r,n,i){var a=t.subVectors(i,n).cross(e.subVectors(r,n)).normalize();return this.setFromNormalAndCoplanarPoint(a,r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return(e||new c).copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(){var t=new c;return function(e,r){var n=r||new c,i=e.delta(t),a=this.normal.dot(i);if(0!==a){var o=-(e.start.dot(this.normal)+this.constant)/a;if(!(o<0||o>1))return n.copy(i).multiplyScalar(o).add(e.start)}else if(0===this.distanceToPoint(e.start))return n.copy(e.start)}}(),intersectsLine:function(t){var e=this.distanceToPoint(t.start),r=this.distanceToPoint(t.end);return e<0&&r>0||r<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return(t||new c).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new c,e=new at;return function(r,n){var i=n||e.getNormalMatrix(r),a=this.coplanarPoint(t).applyMatrix4(r),o=this.normal.applyMatrix3(i).normalize();return this.constant=-a.dot(o),this}}(),translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}),Object.assign(st.prototype,{set:function(t,e,r,n,i,a){var o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(r),o[3].copy(n),o[4].copy(i),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,r=0;r<6;r++)e[r].copy(t.planes[r]);return this},setFromMatrix:function(t){var e=this.planes,r=t.elements,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],h=r[6],c=r[7],l=r[8],d=r[9],f=r[10],p=r[11],m=r[12],v=r[13],g=r[14],y=r[15];return e[0].setComponents(o-n,c-s,p-l,y-m).normalize(),e[1].setComponents(o+n,c+s,p+l,y+m).normalize(),e[2].setComponents(o+i,c+u,p+d,y+v).normalize(),e[3].setComponents(o-i,c-u,p-d,y-v).normalize(),e[4].setComponents(o-a,c-h,p-f,y-g).normalize(),e[5].setComponents(o+a,c+h,p+f,y+g).normalize(),this},intersectsObject:function(){var t=new it;return function(e){var r=e.geometry;return null===r.boundingSphere&&r.computeBoundingSphere(),t.copy(r.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSprite:function(){var t=new it;return function(e){return t.center.set(0,0,0),t.radius=.7071067811865476,t.applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSphere:function(t){for(var e=this.planes,r=t.center,n=-t.radius,i=0;i<6;i++){if(e[i].distanceToPoint(r)<n)return!1}return!0},intersectsBox:function(){var t=new c,e=new c;return function(r){for(var n=this.planes,i=0;i<6;i++){var a=n[i];t.x=a.normal.x>0?r.min.x:r.max.x,e.x=a.normal.x>0?r.max.x:r.min.x,t.y=a.normal.y>0?r.min.y:r.max.y,e.y=a.normal.y>0?r.max.y:r.min.y,t.z=a.normal.z>0?r.min.z:r.max.z,e.z=a.normal.z>0?r.max.z:r.min.z;var o=a.distanceToPoint(t),s=a.distanceToPoint(e);if(o<0&&s<0)return!1}return!0}}(),containsPoint:function(t){for(var e=this.planes,r=0;r<6;r++)if(e[r].distanceToPoint(t)<0)return!1;return!0}}),ct.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],ct.DefaultOrder="XYZ",Object.defineProperties(ct.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback()}}}),Object.assign(ct.prototype,{isEuler:!0,set:function(t,e,r,n){return this._x=t,this._y=e,this._z=r,this._order=n||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,r){var n=Os.clamp,i=t.elements,a=i[0],o=i[4],s=i[8],u=i[1],h=i[5],c=i[9],l=i[2],d=i[6],f=i[10];return e=e||this._order,"XYZ"===e?(this._y=Math.asin(n(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-c,f),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(d,h),this._z=0)):"YXZ"===e?(this._x=Math.asin(-n(c,-1,1)),Math.abs(c)<.99999?(this._y=Math.atan2(s,f),this._z=Math.atan2(u,h)):(this._y=Math.atan2(-l,a),this._z=0)):"ZXY"===e?(this._x=Math.asin(n(d,-1,1)),Math.abs(d)<.99999?(this._y=Math.atan2(-l,f),this._z=Math.atan2(-o,h)):(this._y=0,this._z=Math.atan2(u,a))):"ZYX"===e?(this._y=Math.asin(-n(l,-1,1)),Math.abs(l)<.99999?(this._x=Math.atan2(d,f),this._z=Math.atan2(u,a)):(this._x=0,this._z=Math.atan2(-o,h))):"YZX"===e?(this._z=Math.asin(n(u,-1,1)),Math.abs(u)<.99999?(this._x=Math.atan2(-c,h),this._y=Math.atan2(-l,a)):(this._x=0,this._y=Math.atan2(s,f))):"XZY"===e?(this._z=Math.asin(-n(o,-1,1)),Math.abs(o)<.99999?(this._x=Math.atan2(d,h),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-c,f),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==r&&this.onChangeCallback(),this},setFromQuaternion:function(){var t=new l;return function(e,r,n){return t.makeRotationFromQuaternion(e),this.setFromRotationMatrix(t,r,n)}}(),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(){var t=new h;return function(e){return t.setFromEuler(this),this.setFromQuaternion(t,e)}}(),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new c(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(lt.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},test:function(t){return 0!=(this.mask&t.mask)}});var Xs=0;dt.DefaultUp=new c(0,1,0),dt.DefaultMatrixAutoUpdate=!0,Object.assign(dt.prototype,n.prototype,{isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(t){this.matrix.multiplyMatrices(t,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(){var t=new h;return function(e,r){return t.setFromAxisAngle(e,r),this.quaternion.multiply(t),this}}(),rotateX:function(){var t=new c(1,0,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateY:function(){var t=new c(0,1,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateZ:function(){var t=new c(0,0,1);return function(e){return this.rotateOnAxis(t,e)}}(),translateOnAxis:function(){var t=new c;return function(e,r){return t.copy(e).applyQuaternion(this.quaternion),this.position.add(t.multiplyScalar(r)),this}}(),translateX:function(){var t=new c(1,0,0);return function(e){return this.translateOnAxis(t,e)}}(),translateY:function(){var t=new c(0,1,0);return function(e){return this.translateOnAxis(t,e)}}(),translateZ:function(){var t=new c(0,0,1);return function(e){return this.translateOnAxis(t,e)}}(),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var t=new l;return function(e){return e.applyMatrix4(t.getInverse(this.matrixWorld))}}(),lookAt:function(){var t=new l;return function(e){this.isCamera?t.lookAt(this.position,e,this.up):t.lookAt(e,this.position,this.up),this.quaternion.setFromRotationMatrix(t)}}(),add:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var r=this.children.indexOf(t);return-1!==r&&(t.parent=null,t.dispatchEvent({type:"removed"}),this.children.splice(r,1)),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var r=0,n=this.children.length;r<n;r++){var i=this.children[r],a=i.getObjectByProperty(t,e);if(void 0!==a)return a}},getWorldPosition:function(t){var e=t||new c;return this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var t=new c,e=new c;return function(r){var n=r||new h;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,n,e),n}}(),getWorldRotation:function(){var t=new h;return function(e){var r=e||new ct;return this.getWorldQuaternion(t),r.setFromQuaternion(t,this.rotation.order,!1)}}(),getWorldScale:function(){var t=new c,e=new h;return function(r){var n=r||new c;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,e,n),n}}(),getWorldDirection:function(){var t=new h;return function(e){var r=e||new c;return this.getWorldQuaternion(t),r.set(0,0,1).applyQuaternion(t)}}(),raycast:function(){},traverse:function(t){t(this);for(var e=this.children,r=0,n=e.length;r<n;r++)e[r].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,r=0,n=e.length;r<n;r++)e[r].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=this.children,r=0,n=e.length;r<n;r++)e[r].updateMatrixWorld(t)},toJSON:function(t){function e(e,r){return void 0===e[r.uuid]&&(e[r.uuid]=r.toJSON(t)),r.uuid}function r(t){var e=[];for(var r in t){var n=t[r];delete n.metadata,e.push(n)}return e}var n=void 0===t||""===t,i={};n&&(t={geometries:{},materials:{},textures:{},images:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var a={};if(a.uuid=this.uuid,a.type=this.type,""!==this.name&&(a.name=this.name),!0===this.castShadow&&(a.castShadow=!0),!0===this.receiveShadow&&(a.receiveShadow=!0),!1===this.visible&&(a.visible=!1),"{}"!==JSON.stringify(this.userData)&&(a.userData=this.userData),a.matrix=this.matrix.toArray(),void 0!==this.geometry&&(a.geometry=e(t.geometries,this.geometry)),void 0!==this.material)if(Array.isArray(this.material)){for(var o=[],s=0,u=this.material.length;s<u;s++)o.push(e(t.materials,this.material[s]));a.material=o}else a.material=e(t.materials,this.material);if(this.children.length>0){a.children=[];for(var s=0;s<this.children.length;s++)a.children.push(this.children[s].toJSON(t).object)}if(n){var h=r(t.geometries),c=r(t.materials),l=r(t.textures),d=r(t.images);h.length>0&&(i.geometries=h),c.length>0&&(i.materials=c),l.length>0&&(i.textures=l),d.length>0&&(i.images=d)}return i.object=a,i},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var r=0;r<t.children.length;r++){var n=t.children[r];this.add(n.clone())}return this}}),ft.prototype=Object.assign(Object.create(dt.prototype),{constructor:ft,isCamera:!0,copy:function(t,e){return dt.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this},getWorldDirection:function(){var t=new h;return function(e){var r=e||new c;return this.getWorldQuaternion(t),r.set(0,0,-1).applyQuaternion(t)}}(),updateMatrixWorld:function(t){dt.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),pt.prototype=Object.assign(Object.create(ft.prototype),{constructor:pt,isOrthographicCamera:!0,copy:function(t,e){return ft.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,r,n,i,a){this.view={fullWidth:t,fullHeight:e,offsetX:r,offsetY:n,width:i,height:a},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,n=(this.top+this.bottom)/2,i=r-t,a=r+t,o=n+e,s=n-e;if(null!==this.view){var u=this.zoom/(this.view.width/this.view.fullWidth),h=this.zoom/(this.view.height/this.view.fullHeight),c=(this.right-this.left)/this.view.width,l=(this.top-this.bottom)/this.view.height;i+=c*(this.view.offsetX/u),a=i+c*(this.view.width/u),o-=l*(this.view.offsetY/h),s=o-l*(this.view.height/h)}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far)},toJSON:function(t){var e=dt.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),mt.prototype=Object.assign(Object.create(ft.prototype),{constructor:mt,isPerspectiveCamera:!0,copy:function(t,e){return ft.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*Os.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*Os.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Os.RAD2DEG*Math.atan(Math.tan(.5*Os.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,r,n,i,a){this.aspect=t/e,this.view={fullWidth:t,fullHeight:e,offsetX:r,offsetY:n,width:i,height:a},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*Os.DEG2RAD*this.fov)/this.zoom,r=2*e,n=this.aspect*r,i=-.5*n,a=this.view;if(null!==a){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*n/o,e-=a.offsetY*r/s,n*=a.width/o,r*=a.height/s}var u=this.filmOffset;0!==u&&(i+=t*u/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+n,e,e-r,t,this.far)},toJSON:function(t){var e=dt.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),Object.assign(vt.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,r=t.vertexNormals.length;e<r;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(var e=0,r=t.vertexColors.length;e<r;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}});var Ys=0;Object.assign(yt.prototype,n.prototype,{isGeometry:!0,applyMatrix:function(t){for(var e=(new at).getNormalMatrix(t),r=0,n=this.vertices.length;r<n;r++){this.vertices[r].applyMatrix4(t)}for(var r=0,n=this.faces.length;r<n;r++){var i=this.faces[r];i.normal.applyMatrix3(e).normalize();for(var a=0,o=i.vertexNormals.length;a<o;a++)i.vertexNormals[a].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var t=new l;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new l;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new l;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new l;return function(e,r,n){return t.makeTranslation(e,r,n),this.applyMatrix(t),this}}(),scale:function(){var t=new l;return function(e,r,n){return t.makeScale(e,r,n),this.applyMatrix(t),this}}(),lookAt:function(){var t=new dt;return function(e){t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),fromBufferGeometry:function(t){function e(t,e,n,i){var a=void 0!==s?[d[t].clone(),d[e].clone(),d[n].clone()]:[],o=void 0!==u?[r.colors[t].clone(),r.colors[e].clone(),r.colors[n].clone()]:[],c=new vt(t,e,n,a,o,i);r.faces.push(c),void 0!==h&&r.faceVertexUvs[0].push([f[t].clone(),f[e].clone(),f[n].clone()]),void 0!==l&&r.faceVertexUvs[1].push([p[t].clone(),p[e].clone(),p[n].clone()])}var r=this,n=null!==t.index?t.index.array:void 0,a=t.attributes,o=a.position.array,s=void 0!==a.normal?a.normal.array:void 0,u=void 0!==a.color?a.color.array:void 0,h=void 0!==a.uv?a.uv.array:void 0,l=void 0!==a.uv2?a.uv2.array:void 0;void 0!==l&&(this.faceVertexUvs[1]=[]);for(var d=[],f=[],p=[],m=0,v=0;m<o.length;m+=3,v+=2)r.vertices.push(new c(o[m],o[m+1],o[m+2])),void 0!==s&&d.push(new c(s[m],s[m+1],s[m+2])),void 0!==u&&r.colors.push(new Y(u[m],u[m+1],u[m+2])),void 0!==h&&f.push(new i(h[v],h[v+1])),void 0!==l&&p.push(new i(l[v],l[v+1]));var g=t.groups;if(g.length>0)for(var m=0;m<g.length;m++)for(var y=g[m],x=y.start,_=y.count,v=x,b=x+_;v<b;v+=3)void 0!==n?e(n[v],n[v+1],n[v+2],y.materialIndex):e(v,v+1,v+2,y.materialIndex);else if(void 0!==n)for(var m=0;m<n.length;m+=3)e(n[m],n[m+1],n[m+2]);else for(var m=0;m<o.length/3;m+=3)e(m,m+1,m+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var t=this.boundingBox.getCenter().negate();return this.translate(t.x,t.y,t.z),t},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,r=0===e?1:1/e,n=new l;return n.set(r,0,0,-r*t.x,0,r,0,-r*t.y,0,0,r,-r*t.z,0,0,0,1),this.applyMatrix(n),this},computeFaceNormals:function(){for(var t=new c,e=new c,r=0,n=this.faces.length;r<n;r++){var i=this.faces[r],a=this.vertices[i.a],o=this.vertices[i.b],s=this.vertices[i.c];t.subVectors(s,o),e.subVectors(a,o),t.cross(e),t.normalize(),i.normal.copy(t)}},computeVertexNormals:function(t){void 0===t&&(t=!0);var e,r,n,i,a,o;for(o=new Array(this.vertices.length),e=0,r=this.vertices.length;e<r;e++)o[e]=new c;if(t){var s,u,h,l=new c,d=new c;for(n=0,i=this.faces.length;n<i;n++)a=this.faces[n],s=this.vertices[a.a],u=this.vertices[a.b],h=this.vertices[a.c],l.subVectors(h,u),d.subVectors(s,u),l.cross(d),o[a.a].add(l),o[a.b].add(l),o[a.c].add(l)}else for(this.computeFaceNormals(),n=0,i=this.faces.length;n<i;n++)a=this.faces[n],o[a.a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(e=0,r=this.vertices.length;e<r;e++)o[e].normalize();for(n=0,i=this.faces.length;n<i;n++){a=this.faces[n];var f=a.vertexNormals;3===f.length?(f[0].copy(o[a.a]),f[1].copy(o[a.b]),f[2].copy(o[a.c])):(f[0]=o[a.a].clone(),f[1]=o[a.b].clone(),f[2]=o[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,r;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){r=this.faces[t];var n=r.vertexNormals;3===n.length?(n[0].copy(r.normal),n[1].copy(r.normal),n[2].copy(r.normal)):(n[0]=r.normal.clone(),n[1]=r.normal.clone(),n[2]=r.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,r,n,i;for(r=0,n=this.faces.length;r<n;r++)for(i=this.faces[r],i.__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),t=0,e=i.vertexNormals.length;t<e;t++)i.__originalVertexNormals[t]?i.__originalVertexNormals[t].copy(i.vertexNormals[t]):i.__originalVertexNormals[t]=i.vertexNormals[t].clone();var a=new yt;for(a.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var o,s,u=this.morphNormals[t].faceNormals,h=this.morphNormals[t].vertexNormals;for(r=0,n=this.faces.length;r<n;r++)o=new c,s={a:new c,b:new c,c:new c},u.push(o),h.push(s)}var l=this.morphNormals[t];a.vertices=this.morphTargets[t].vertices,a.computeFaceNormals(),a.computeVertexNormals();var o,s;for(r=0,n=this.faces.length;r<n;r++)i=this.faces[r],o=l.faceNormals[r],s=l.vertexNormals[r],o.copy(i.normal),s.a.copy(i.vertexNormals[0]),s.b.copy(i.vertexNormals[1]),s.c.copy(i.vertexNormals[2])}for(r=0,n=this.faces.length;r<n;r++)i=this.faces[r],i.normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeLineDistances:function(){for(var t=0,e=this.vertices,r=0,n=e.length;r<n;r++)r>0&&(t+=e[r].distanceTo(e[r-1])),this.lineDistances[r]=t},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new nt),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new it),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,r){if(!t||!t.isGeometry)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t);var n,i=this.vertices.length,a=this.vertices,o=t.vertices,s=this.faces,u=t.faces,h=this.faceVertexUvs[0],c=t.faceVertexUvs[0],l=this.colors,d=t.colors;void 0===r&&(r=0),void 0!==e&&(n=(new at).getNormalMatrix(e));for(var f=0,p=o.length;f<p;f++){var m=o[f],v=m.clone();void 0!==e&&v.applyMatrix4(e),a.push(v)}for(var f=0,p=d.length;f<p;f++)l.push(d[f].clone());for(f=0,p=u.length;f<p;f++){var g,y,x,_=u[f],b=_.vertexNormals,w=_.vertexColors;g=new vt(_.a+i,_.b+i,_.c+i),g.normal.copy(_.normal),void 0!==n&&g.normal.applyMatrix3(n).normalize();for(var M=0,E=b.length;M<E;M++)y=b[M].clone(),void 0!==n&&y.applyMatrix3(n).normalize(),g.vertexNormals.push(y);g.color.copy(_.color);for(var M=0,E=w.length;M<E;M++)x=w[M],g.vertexColors.push(x.clone());g.materialIndex=_.materialIndex+r,s.push(g)}for(f=0,p=c.length;f<p;f++){var T=c[f],S=[];if(void 0!==T){for(var M=0,E=T.length;M<E;M++)S.push(T[M].clone());h.push(S)}}},mergeMesh:function(t){if(!t||!t.isMesh)return void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t);t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)},mergeVertices:function(){var t,e,r,n,i,a,o,s,u={},h=[],c=[],l=Math.pow(10,4);for(r=0,n=this.vertices.length;r<n;r++)t=this.vertices[r],e=Math.round(t.x*l)+"_"+Math.round(t.y*l)+"_"+Math.round(t.z*l),void 0===u[e]?(u[e]=r,h.push(this.vertices[r]),c[r]=h.length-1):c[r]=c[u[e]];var d=[];for(r=0,n=this.faces.length;r<n;r++){i=this.faces[r],i.a=c[i.a],i.b=c[i.b],i.c=c[i.c],a=[i.a,i.b,i.c];for(var f=0;f<3;f++)if(a[f]===a[(f+1)%3]){d.push(r);break}}for(r=d.length-1;r>=0;r--){var p=d[r];for(this.faces.splice(p,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(p,1)}var m=this.vertices.length-h.length;return this.vertices=h,m},sortFacesByMaterialIndex:function(){function t(t,e){return t.materialIndex-e.materialIndex}for(var e=this.faces,r=e.length,n=0;n<r;n++)e[n]._id=n;e.sort(t);var i,a,o=this.faceVertexUvs[0],s=this.faceVertexUvs[1];o&&o.length===r&&(i=[]),s&&s.length===r&&(a=[]);for(var n=0;n<r;n++){var u=e[n]._id;i&&i.push(o[u]),a&&a.push(s[u])}i&&(this.faceVertexUvs[0]=i),a&&(this.faceVertexUvs[1]=a)},toJSON:function(){function t(t,e,r){return r?t|1<<e:t&~(1<<e)}function e(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==d[e]?d[e]:(d[e]=l.length/3,l.push(t.x,t.y,t.z),d[e])}function r(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==p[e]?p[e]:(p[e]=f.length,f.push(t.getHex()),p[e])}function n(t){var e=t.x.toString()+t.y.toString();return void 0!==v[e]?v[e]:(v[e]=m.length/2,m.push(t.x,t.y),v[e])}var i={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),void 0!==this.parameters){var a=this.parameters;for(var o in a)void 0!==a[o]&&(i[o]=a[o]);return i}for(var s=[],u=0;u<this.vertices.length;u++){var h=this.vertices[u];s.push(h.x,h.y,h.z)}for(var c=[],l=[],d={},f=[],p={},m=[],v={},u=0;u<this.faces.length;u++){var g=this.faces[u],y=void 0!==this.faceVertexUvs[0][u],x=g.normal.length()>0,_=g.vertexNormals.length>0,b=1!==g.color.r||1!==g.color.g||1!==g.color.b,w=g.vertexColors.length>0,M=0;if(M=t(M,0,0),M=t(M,1,!0),M=t(M,2,!1),M=t(M,3,y),M=t(M,4,x),M=t(M,5,_),M=t(M,6,b),M=t(M,7,w),c.push(M),c.push(g.a,g.b,g.c),c.push(g.materialIndex),y){var E=this.faceVertexUvs[0][u];c.push(n(E[0]),n(E[1]),n(E[2]))}if(x&&c.push(e(g.normal)),_){var T=g.vertexNormals;c.push(e(T[0]),e(T[1]),e(T[2]))}if(b&&c.push(r(g.color)),w){var S=g.vertexColors;c.push(r(S[0]),r(S[1]),r(S[2]))}}return i.data={},i.data.vertices=s,i.data.normals=l,f.length>0&&(i.data.colors=f),m.length>0&&(i.data.uvs=[m]),i.data.faces=c,i},clone:function(){return(new yt).copy(this)},copy:function(t){var e,r,n,i,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,r=s.length;e<r;e++)this.vertices.push(s[e].clone());var u=t.colors;for(e=0,r=u.length;e<r;e++)this.colors.push(u[e].clone());var h=t.faces;for(e=0,r=h.length;e<r;e++)this.faces.push(h[e].clone());for(e=0,r=t.faceVertexUvs.length;e<r;e++){var c=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),n=0,i=c.length;n<i;n++){var l=c[n],d=[];for(a=0,o=l.length;a<o;a++){var f=l[a];d.push(f.clone())}this.faceVertexUvs[e].push(d)}}var p=t.morphTargets;for(e=0,r=p.length;e<r;e++){var m={};if(m.name=p[e].name,void 0!==p[e].vertices)for(m.vertices=[],n=0,i=p[e].vertices.length;n<i;n++)m.vertices.push(p[e].vertices[n].clone());if(void 0!==p[e].normals)for(m.normals=[],n=0,i=p[e].normals.length;n<i;n++)m.normals.push(p[e].normals[n].clone());this.morphTargets.push(m)}var v=t.morphNormals;for(e=0,r=v.length;e<r;e++){var g={};if(void 0!==v[e].vertexNormals)for(g.vertexNormals=[],n=0,i=v[e].vertexNormals.length;n<i;n++){var y=v[e].vertexNormals[n],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),g.vertexNormals.push(x)}if(void 0!==v[e].faceNormals)for(g.faceNormals=[],n=0,i=v[e].faceNormals.length;n<i;n++)g.faceNormals.push(v[e].faceNormals[n].clone());this.morphNormals.push(g)}var _=t.skinWeights;for(e=0,r=_.length;e<r;e++)this.skinWeights.push(_[e].clone());var b=t.skinIndices;for(e=0,r=b.length;e<r;e++)this.skinIndices.push(b[e].clone());var w=t.lineDistances;for(e=0,r=w.length;e<r;e++)this.lineDistances.push(w[e]);var M=t.boundingBox;null!==M&&(this.boundingBox=M.clone());var E=t.boundingSphere;return null!==E&&(this.boundingSphere=E.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(xt.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(xt.prototype,{isBufferAttribute:!0,setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==t?t.length/this.itemSize:0,this.array=t},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.dynamic=t.dynamic,this},copyAt:function(t,e,r){t*=this.itemSize,r*=e.itemSize;for(var n=0,i=this.itemSize;n<i;n++)this.array[t+n]=e.array[r+n];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,r=0,n=0,i=t.length;n<i;n++){var a=t[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",n),a=new Y),e[r++]=a.r,e[r++]=a.g,e[r++]=a.b}return this},copyIndicesArray:function(t){for(var e=this.array,r=0,n=0,i=t.length;n<i;n++){var a=t[n];e[r++]=a.a,e[r++]=a.b,e[r++]=a.c}return this},copyVector2sArray:function(t){for(var e=this.array,r=0,n=0,a=t.length;n<a;n++){var o=t[n];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",n),o=new i),e[r++]=o.x,e[r++]=o.y}return this},copyVector3sArray:function(t){for(var e=this.array,r=0,n=0,i=t.length;n<i;n++){var a=t[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",n),a=new c),e[r++]=a.x,e[r++]=a.y,e[r++]=a.z}return this},copyVector4sArray:function(t){for(var e=this.array,r=0,n=0,i=t.length;n<i;n++){var a=t[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",n),a=new o),e[r++]=a.x,e[r++]=a.y,e[r++]=a.z,e[r++]=a.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=r,this},setXYZ:function(t,e,r,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=r,this.array[t+2]=n,this},setXYZW:function(t,e,r,n,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=r,this.array[t+2]=n,this.array[t+3]=i,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),_t.prototype=Object.create(xt.prototype),_t.prototype.constructor=_t,bt.prototype=Object.create(xt.prototype),bt.prototype.constructor=bt,wt.prototype=Object.create(xt.prototype),wt.prototype.constructor=wt,Mt.prototype=Object.create(xt.prototype),Mt.prototype.constructor=Mt,Et.prototype=Object.create(xt.prototype),Et.prototype.constructor=Et,Tt.prototype=Object.create(xt.prototype),Tt.prototype.constructor=Tt,St.prototype=Object.create(xt.prototype),St.prototype.constructor=St,At.prototype=Object.create(xt.prototype),At.prototype.constructor=At,Lt.prototype=Object.create(xt.prototype),Lt.prototype.constructor=Lt,Object.assign(Pt.prototype,{computeGroups:function(t){for(var e,r=[],n=void 0,i=t.faces,a=0;a<i.length;a++){var o=i[a];o.materialIndex!==n&&(n=o.materialIndex,void 0!==e&&(e.count=3*a-e.start,r.push(e)),e={start:3*a,materialIndex:n})}void 0!==e&&(e.count=3*a-e.start,r.push(e)),this.groups=r},fromGeometry:function(t){var e,r=t.faces,n=t.vertices,a=t.faceVertexUvs,o=a[0]&&a[0].length>0,s=a[1]&&a[1].length>0,u=t.morphTargets,h=u.length;if(h>0){e=[];for(var c=0;c<h;c++)e[c]=[];this.morphTargets.position=e}var l,d=t.morphNormals,f=d.length;if(f>0){l=[];for(var c=0;c<f;c++)l[c]=[];this.morphTargets.normal=l}for(var p=t.skinIndices,m=t.skinWeights,v=p.length===n.length,g=m.length===n.length,c=0;c<r.length;c++){var y=r[c];this.vertices.push(n[y.a],n[y.b],n[y.c]);var x=y.vertexNormals;if(3===x.length)this.normals.push(x[0],x[1],x[2]);else{var _=y.normal;this.normals.push(_,_,_)}var b=y.vertexColors;if(3===b.length)this.colors.push(b[0],b[1],b[2]);else{var w=y.color;this.colors.push(w,w,w)}if(!0===o){var M=a[0][c];void 0!==M?this.uvs.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",c),this.uvs.push(new i,new i,new i))}if(!0===s){var M=a[1][c];void 0!==M?this.uvs2.push(M[0],M[1],M[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",c),this.uvs2.push(new i,new i,new i))}for(var E=0;E<h;E++){var T=u[E].vertices;e[E].push(T[y.a],T[y.b],T[y.c])}for(var E=0;E<f;E++){var S=d[E].vertexNormals[c];l[E].push(S.a,S.b,S.c)}v&&this.skinIndices.push(p[y.a],p[y.b],p[y.c]),g&&this.skinWeights.push(m[y.a],m[y.b],m[y.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this}}),Ct.MaxIndex=65535,Object.assign(Ct.prototype,n.prototype,{isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(Rt(t)>65535?St:Et)(t,1):this.index=t},addAttribute:function(t,e){return e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),void this.setIndex(e)):(this.attributes[t]=e,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void this.addAttribute(t,new xt(arguments[1],arguments[2])))},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,r){this.groups.push({start:t,count:e,materialIndex:void 0!==r?r:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToBufferAttribute(e),e.needsUpdate=!0);var r=this.attributes.normal;if(void 0!==r){(new at).getNormalMatrix(t).applyToBufferAttribute(r),r.needsUpdate=!0}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var t=new l;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new l;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new l;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new l;return function(e,r,n){return t.makeTranslation(e,r,n),this.applyMatrix(t),this}}(),scale:function(){var t=new l;return function(e,r,n){return t.makeScale(e,r,n),this.applyMatrix(t),this}}(),lookAt:function(){var t=new dt;return function(e){t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),center:function(){this.computeBoundingBox();var t=this.boundingBox.getCenter().negate();return this.translate(t.x,t.y,t.z),t},setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var r=new At(3*e.vertices.length,3),n=new At(3*e.colors.length,3);if(this.addAttribute("position",r.copyVector3sArray(e.vertices)),this.addAttribute("color",n.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var i=new At(e.lineDistances.length,1);this.addAttribute("lineDistance",i.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},updateFromObject:function(t){var e=t.geometry;if(t.isMesh){var r=e.__directGeometry;if(!0===e.elementsNeedUpdate&&(r=void 0,e.elementsNeedUpdate=!1),void 0===r)return this.fromGeometry(e);r.verticesNeedUpdate=e.verticesNeedUpdate,r.normalsNeedUpdate=e.normalsNeedUpdate,r.colorsNeedUpdate=e.colorsNeedUpdate,r.uvsNeedUpdate=e.uvsNeedUpdate,r.groupsNeedUpdate=e.groupsNeedUpdate,e.verticesNeedUpdate=!1,e.normalsNeedUpdate=!1,e.colorsNeedUpdate=!1,e.uvsNeedUpdate=!1,e.groupsNeedUpdate=!1,e=r}var n;return!0===e.verticesNeedUpdate&&(n=this.attributes.position,void 0!==n&&(n.copyVector3sArray(e.vertices),n.needsUpdate=!0),e.verticesNeedUpdate=!1),!0===e.normalsNeedUpdate&&(n=this.attributes.normal,void 0!==n&&(n.copyVector3sArray(e.normals),n.needsUpdate=!0),e.normalsNeedUpdate=!1),!0===e.colorsNeedUpdate&&(n=this.attributes.color,void 0!==n&&(n.copyColorsArray(e.colors),n.needsUpdate=!0),e.colorsNeedUpdate=!1),e.uvsNeedUpdate&&(n=this.attributes.uv,void 0!==n&&(n.copyVector2sArray(e.uvs),n.needsUpdate=!0),e.uvsNeedUpdate=!1),e.lineDistancesNeedUpdate&&(n=this.attributes.lineDistance,void 0!==n&&(n.copyArray(e.lineDistances),n.needsUpdate=!0),e.lineDistancesNeedUpdate=!1),e.groupsNeedUpdate&&(e.computeGroups(t.geometry),this.groups=e.groups,e.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new Pt).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.addAttribute("position",new xt(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){var r=new Float32Array(3*t.normals.length);this.addAttribute("normal",new xt(r,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var n=new Float32Array(3*t.colors.length);this.addAttribute("color",new xt(n,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var i=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new xt(i,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var a=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new xt(a,2).copyVector2sArray(t.uvs2))}if(t.indices.length>0){var o=Rt(t.indices)>65535?Uint32Array:Uint16Array,s=new o(3*t.indices.length);this.setIndex(new xt(s,1).copyIndicesArray(t.indices))}this.groups=t.groups;for(var u in t.morphTargets){for(var h=[],c=t.morphTargets[u],l=0,d=c.length;l<d;l++){var f=c[l],p=new At(3*f.length,3);h.push(p.copyVector3sArray(f))}this.morphAttributes[u]=h}if(t.skinIndices.length>0){var m=new At(4*t.skinIndices.length,4);this.addAttribute("skinIndex",m.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var v=new At(4*t.skinWeights.length,4);this.addAttribute("skinWeight",v.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new nt);var t=this.attributes.position;void 0!==t?this.boundingBox.setFromBufferAttribute(t):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var t=new nt,e=new c;return function(){null===this.boundingSphere&&(this.boundingSphere=new it);var r=this.attributes.position;if(r){var n=this.boundingSphere.center;t.setFromBufferAttribute(r),t.getCenter(n);for(var i=0,a=0,o=r.count;a<o;a++)e.x=r.getX(a),e.y=r.getY(a),e.z=r.getZ(a),i=Math.max(i,n.distanceToSquared(e));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes,r=this.groups;if(e.position){var n=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new xt(new Float32Array(n.length),3));else for(var i=e.normal.array,a=0,o=i.length;a<o;a++)i[a]=0;var s,u,h,l=e.normal.array,d=new c,f=new c,p=new c,m=new c,v=new c;if(t){var g=t.array;0===r.length&&this.addGroup(0,g.length);for(var y=0,x=r.length;y<x;++y)for(var _=r[y],b=_.start,w=_.count,a=b,o=b+w;a<o;a+=3)s=3*g[a+0],u=3*g[a+1],h=3*g[a+2],d.fromArray(n,s),f.fromArray(n,u),p.fromArray(n,h),m.subVectors(p,f),v.subVectors(d,f),m.cross(v),l[s]+=m.x,l[s+1]+=m.y,l[s+2]+=m.z,l[u]+=m.x,l[u+1]+=m.y,l[u+2]+=m.z,l[h]+=m.x,l[h+1]+=m.y,l[h+2]+=m.z}else for(var a=0,o=n.length;a<o;a+=9)d.fromArray(n,a),f.fromArray(n,a+3),p.fromArray(n,a+6),m.subVectors(p,f),v.subVectors(d,f),m.cross(v),l[a]=m.x,l[a+1]=m.y,l[a+2]=m.z,l[a+3]=m.x,l[a+4]=m.y,l[a+5]=m.z,l[a+6]=m.x,l[a+7]=m.y,l[a+8]=m.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(!t||!t.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);void 0===e&&(e=0);var r=this.attributes;for(var n in r)if(void 0!==t.attributes[n])for(var i=r[n],a=i.array,o=t.attributes[n],s=o.array,u=o.itemSize,h=0,c=u*e;h<s.length;h++,c++)a[c]=s[h];return this},normalizeNormals:function(){var t=new c;return function(){for(var e=this.attributes.normal,r=0,n=e.count;r<n;r++)t.x=e.getX(r),t.y=e.getY(r),t.z=e.getZ(r),t.normalize(),e.setXYZ(r,t.x,t.y,t.z)}}(),toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new Ct,e=this.index.array,r=this.attributes;for(var n in r){for(var i=r[n],a=i.array,o=i.itemSize,s=new a.constructor(e.length*o),u=0,h=0,c=0,l=e.length;c<l;c++){u=e[c]*o;for(var d=0;d<o;d++)s[h++]=a[u++]}t.addAttribute(n,new xt(s,o))}return t},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var r in e)void 0!==e[r]&&(t[r]=e[r]);return t}t.data={attributes:{}};var n=this.index;if(null!==n){var i=Array.prototype.slice.call(n.array);t.data.index={type:n.array.constructor.name,array:i}}var a=this.attributes;for(var r in a){var o=a[r],i=Array.prototype.slice.call(o.array);t.data.attributes[r]={itemSize:o.itemSize,type:o.array.constructor.name,array:i,normalized:o.normalized}}var s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));var u=this.boundingSphere;return null!==u&&(t.data.boundingSphere={center:u.center.toArray(),radius:u.radius}),t},clone:function(){return(new Ct).copy(this)},copy:function(t){var e,r,n;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var i=t.index;null!==i&&this.setIndex(i.clone());var a=t.attributes;for(e in a){var o=a[e];this.addAttribute(e,o.clone())}var s=t.morphAttributes;for(e in s){var u=[],h=s[e];for(r=0,n=h.length;r<n;r++)u.push(h[r].clone());this.morphAttributes[e]=u}var c=t.groups;for(r=0,n=c.length;r<n;r++){var l=c[r];this.addGroup(l.start,l.count,l.materialIndex)}var d=t.boundingBox;null!==d&&(this.boundingBox=d.clone());var f=t.boundingSphere;return null!==f&&(this.boundingSphere=f.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Ot.prototype=Object.create(yt.prototype),Ot.prototype.constructor=Ot,It.prototype=Object.create(Ct.prototype),It.prototype.constructor=It,Dt.prototype=Object.create(yt.prototype),Dt.prototype.constructor=Dt,Nt.prototype=Object.create(Ct.prototype),Nt.prototype.constructor=Nt,Ut.prototype=Object.create($.prototype),Ut.prototype.constructor=Ut,Ut.prototype.isMeshBasicMaterial=!0,Ut.prototype.copy=function(t){return $.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},Object.assign(Ft.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return(e||new c).copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(){var t=new c;return function(e){return this.origin.copy(this.at(e,t)),this}}(),closestPointToPoint:function(t,e){var r=e||new c;r.subVectors(t,this.origin);var n=r.dot(this.direction);return n<0?r.copy(this.origin):r.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(){var t=new c;return function(e){var r=t.subVectors(e,this.origin).dot(this.direction);return r<0?this.origin.distanceToSquared(e):(t.copy(this.direction).multiplyScalar(r).add(this.origin),t.distanceToSquared(e))}}(),distanceSqToSegment:function(){var t=new c,e=new c,r=new c;return function(n,i,a,o){t.copy(n).add(i).multiplyScalar(.5),e.copy(i).sub(n).normalize(),r.copy(this.origin).sub(t);var s,u,h,c,l=.5*n.distanceTo(i),d=-this.direction.dot(e),f=r.dot(this.direction),p=-r.dot(e),m=r.lengthSq(),v=Math.abs(1-d*d);if(v>0)if(s=d*p-f,u=d*f-p,c=l*v,s>=0)if(u>=-c)if(u<=c){var g=1/v;s*=g,u*=g,h=s*(s+d*u+2*f)+u*(d*s+u+2*p)+m}else u=l,s=Math.max(0,-(d*u+f)),h=-s*s+u*(u+2*p)+m;else u=-l,s=Math.max(0,-(d*u+f)),h=-s*s+u*(u+2*p)+m;else u<=-c?(s=Math.max(0,-(-d*l+f)),u=s>0?-l:Math.min(Math.max(-l,-p),l),h=-s*s+u*(u+2*p)+m):u<=c?(s=0,u=Math.min(Math.max(-l,-p),l),h=u*(u+2*p)+m):(s=Math.max(0,-(d*l+f)),u=s>0?l:Math.min(Math.max(-l,-p),l),h=-s*s+u*(u+2*p)+m);else u=d>0?-l:l,s=Math.max(0,-(d*u+f)),h=-s*s+u*(u+2*p)+m;return a&&a.copy(this.direction).multiplyScalar(s).add(this.origin),o&&o.copy(e).multiplyScalar(u).add(t),h}}(),intersectSphere:function(){var t=new c;return function(e,r){t.subVectors(e.center,this.origin);var n=t.dot(this.direction),i=t.dot(t)-n*n,a=e.radius*e.radius;if(i>a)return null;var o=Math.sqrt(a-i),s=n-o,u=n+o;return s<0&&u<0?null:s<0?this.at(u,r):this.at(s,r)}}(),intersectsSphere:function(t){return this.distanceToPoint(t.center)<=t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var r=-(this.origin.dot(t.normal)+t.constant)/e;return r>=0?r:null},intersectPlane:function(t,e){var r=this.distanceToPlane(t);return null===r?null:this.at(r,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var r,n,i,a,o,s,u=1/this.direction.x,h=1/this.direction.y,c=1/this.direction.z,l=this.origin;return u>=0?(r=(t.min.x-l.x)*u,n=(t.max.x-l.x)*u):(r=(t.max.x-l.x)*u,n=(t.min.x-l.x)*u),h>=0?(i=(t.min.y-l.y)*h,a=(t.max.y-l.y)*h):(i=(t.max.y-l.y)*h,a=(t.min.y-l.y)*h),r>a||i>n?null:((i>r||r!==r)&&(r=i),(a<n||n!==n)&&(n=a),c>=0?(o=(t.min.z-l.z)*c,s=(t.max.z-l.z)*c):(o=(t.max.z-l.z)*c,s=(t.min.z-l.z)*c),r>s||o>n?null:((o>r||r!==r)&&(r=o),(s<n||n!==n)&&(n=s),n<0?null:this.at(r>=0?r:n,e)))},intersectsBox:function(){var t=new c;return function(e){return null!==this.intersectBox(e,t)}}(),intersectTriangle:function(){var t=new c,e=new c,r=new c,n=new c;return function(i,a,o,s,u){e.subVectors(a,i),r.subVectors(o,i),n.crossVectors(e,r);var h,c=this.direction.dot(n);if(c>0){if(s)return null;h=1}else{if(!(c<0))return null;h=-1,c=-c}t.subVectors(this.origin,i);var l=h*this.direction.dot(r.crossVectors(t,r));if(l<0)return null;var d=h*this.direction.dot(e.cross(t));if(d<0)return null;if(l+d>c)return null;var f=-h*t.dot(n);return f<0?null:this.at(f/c,u)}}(),applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}),Object.assign(Bt.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return(t||new c).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return(t||new c).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){var r=e||new c;return this.delta(r).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(){var t=new c,e=new c;return function(r,n){t.subVectors(r,this.start),e.subVectors(this.end,this.start);var i=e.dot(e),a=e.dot(t),o=a/i;return n&&(o=Os.clamp(o,0,1)),o}}(),closestPointToPoint:function(t,e,r){var n=this.closestPointToPointParameter(t,e),i=r||new c;return this.delta(i).multiplyScalar(n).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),Object.assign(zt,{normal:function(){var t=new c;return function(e,r,n,i){var a=i||new c;a.subVectors(n,r),t.subVectors(e,r),a.cross(t);var o=a.lengthSq();return o>0?a.multiplyScalar(1/Math.sqrt(o)):a.set(0,0,0)}}(),barycoordFromPoint:function(){var t=new c,e=new c,r=new c;return function(n,i,a,o,s){t.subVectors(o,i),e.subVectors(a,i),r.subVectors(n,i);var u=t.dot(t),h=t.dot(e),l=t.dot(r),d=e.dot(e),f=e.dot(r),p=u*d-h*h,m=s||new c;if(0===p)return m.set(-2,-1,-1);var v=1/p,g=(d*l-h*f)*v,y=(u*f-h*l)*v;return m.set(1-g-y,y,g)}}(),containsPoint:function(){var t=new c;return function(e,r,n,i){var a=zt.barycoordFromPoint(e,r,n,i,t);return a.x>=0&&a.y>=0&&a.x+a.y<=1}}()}),Object.assign(zt.prototype,{set:function(t,e,r){return this.a.copy(t),this.b.copy(e),this.c.copy(r),this},setFromPointsAndIndices:function(t,e,r,n){return this.a.copy(t[e]),this.b.copy(t[r]),this.c.copy(t[n]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},area:function(){var t=new c,e=new c;return function(){return t.subVectors(this.c,this.b),e.subVectors(this.a,this.b),.5*t.cross(e).length()}}(),midpoint:function(t){return(t||new c).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(t){return zt.normal(this.a,this.b,this.c,t)},plane:function(t){return(t||new ot).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(t,e){return zt.barycoordFromPoint(t,this.a,this.b,this.c,e)},containsPoint:function(t){return zt.containsPoint(t,this.a,this.b,this.c)},closestPointToPoint:function(){var t=new ot,e=[new Bt,new Bt,new Bt],r=new c,n=new c;return function(i,a){var o=a||new c,s=1/0;if(t.setFromCoplanarPoints(this.a,this.b,this.c),t.projectPoint(i,r),!0===this.containsPoint(r))o.copy(r);else{e[0].set(this.a,this.b),e[1].set(this.b,this.c),e[2].set(this.c,this.a);for(var u=0;u<e.length;u++){e[u].closestPointToPoint(r,!0,n);var h=r.distanceToSquared(n);h<s&&(s=h,o.copy(n))}}return o}}(),equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),Gt.prototype=Object.assign(Object.create(dt.prototype),{constructor:Gt,isMesh:!0,setDrawMode:function(t){this.drawMode=t},copy:function(t){return dt.prototype.copy.call(this,t),this.drawMode=t.drawMode,this},updateMorphTargets:function(){var t,e,r,n=this.geometry;if(n.isBufferGeometry){var i=n.morphAttributes,a=Object.keys(i);if(a.length>0){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=o.length;t<e;t++)r=o[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[r]=t}}else{var s=n.morphTargets;if(void 0!==s&&s.length>0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=s.length;t<e;t++)r=s[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[r]=t}},raycast:function(){function t(t,e,r,n,i,a,o){return zt.barycoordFromPoint(t,e,r,n,y),i.multiplyScalar(y.x),a.multiplyScalar(y.y),o.multiplyScalar(y.z),i.add(a).add(o),i.clone()}function e(t,e,r,n,i,a,o,s){if(null===(e.side===Sa?n.intersectTriangle(o,a,i,!0,s):n.intersectTriangle(i,a,o,e.side!==Aa,s)))return null;_.copy(s),_.applyMatrix4(t.matrixWorld);var u=r.ray.origin.distanceTo(_);return u<r.near||u>r.far?null:{distance:u,point:_.clone(),object:t}}function r(r,n,i,a,o,c,l,d){s.fromBufferAttribute(a,c),u.fromBufferAttribute(a,l),h.fromBufferAttribute(a,d);var f=e(r,r.material,n,i,s,u,h,x);return f&&(o&&(m.fromBufferAttribute(o,c),v.fromBufferAttribute(o,l),g.fromBufferAttribute(o,d),f.uv=t(x,s,u,h,m,v,g)),f.face=new vt(c,l,d,zt.normal(s,u,h)),f.faceIndex=c),f}var n=new l,a=new Ft,o=new it,s=new c,u=new c,h=new c,d=new c,f=new c,p=new c,m=new i,v=new i,g=new i,y=new c,x=new c,_=new c;return function(i,c){var l=this.geometry,y=this.material,_=this.matrixWorld;if(void 0!==y&&(null===l.boundingSphere&&l.computeBoundingSphere(),o.copy(l.boundingSphere),o.applyMatrix4(_),!1!==i.ray.intersectsSphere(o)&&(n.getInverse(_),a.copy(i.ray).applyMatrix4(n),null===l.boundingBox||!1!==a.intersectsBox(l.boundingBox)))){var b;if(l.isBufferGeometry){var w,M,E,T,S,A=l.index,L=l.attributes.position,P=l.attributes.uv;if(null!==A)for(T=0,S=A.count;T<S;T+=3)w=A.getX(T),M=A.getX(T+1),E=A.getX(T+2),(b=r(this,i,a,L,P,w,M,E))&&(b.faceIndex=Math.floor(T/3),c.push(b));else for(T=0,S=L.count;T<S;T+=3)w=T,M=T+1,E=T+2,(b=r(this,i,a,L,P,w,M,E))&&(b.index=w,c.push(b))}else if(l.isGeometry){var R,C,O,I,D=Array.isArray(y),N=l.vertices,U=l.faces,F=l.faceVertexUvs[0];F.length>0&&(I=F);for(var B=0,z=U.length;B<z;B++){var G=U[B],j=D?y[G.materialIndex]:y;if(void 0!==j){if(R=N[G.a],C=N[G.b],O=N[G.c],!0===j.morphTargets){var V=l.morphTargets,k=this.morphTargetInfluences;s.set(0,0,0),u.set(0,0,0),h.set(0,0,0);for(var H=0,W=V.length;H<W;H++){var q=k[H];if(0!==q){var X=V[H].vertices;s.addScaledVector(d.subVectors(X[G.a],R),q),u.addScaledVector(f.subVectors(X[G.b],C),q),h.addScaledVector(p.subVectors(X[G.c],O),q)}}s.add(R),u.add(C),h.add(O),R=s,C=u,O=h}if(b=e(this,j,i,a,R,C,O,x)){if(I&&I[B]){var Y=I[B];m.copy(Y[0]),v.copy(Y[1]),g.copy(Y[2]),b.uv=t(x,R,C,O,m,v,g)}b.face=G,b.faceIndex=B,c.push(b)}}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Zs=0;xe.prototype=Object.assign(Object.create(mt.prototype),{constructor:xe,isArrayCamera:!0}),Te.prototype.isFogExp2=!0,Te.prototype.clone=function(){return new Te(this.color.getHex(),this.density)},Te.prototype.toJSON=function(t){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},Se.prototype.isFog=!0,Se.prototype.clone=function(){return new Se(this.color.getHex(),this.near,this.far)},Se.prototype.toJSON=function(t){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},Ae.prototype=Object.assign(Object.create(dt.prototype),{constructor:Ae,copy:function(t,e){return dt.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=dt.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}),Le.prototype=Object.assign(Object.create(dt.prototype),{constructor:Le,isLensFlare:!0,copy:function(t){dt.prototype.copy.call(this,t),this.positionScreen.copy(t.positionScreen),this.customUpdateCallback=t.customUpdateCallback;for(var e=0,r=t.lensFlares.length;e<r;e++)this.lensFlares.push(t.lensFlares[e]);return this},add:function(t,e,r,n,i,a){void 0===e&&(e=-1),void 0===r&&(r=0),void 0===a&&(a=1),void 0===i&&(i=new Y(16777215)),void 0===n&&(n=Da),r=Math.min(r,Math.max(0,r)),this.lensFlares.push({texture:t,size:e,distance:r,x:0,y:0,z:0,scale:1,rotation:0,opacity:a,color:i,blending:n})},updateLensFlares:function(){var t,e,r=this.lensFlares.length,n=2*-this.positionScreen.x,i=2*-this.positionScreen.y;for(t=0;t<r;t++)e=this.lensFlares[t],e.x=this.positionScreen.x+n*e.distance,e.y=this.positionScreen.y+i*e.distance,e.wantedRotation=e.x*Math.PI*.25,e.rotation+=.25*(e.wantedRotation-e.rotation)}}),Pe.prototype=Object.create($.prototype),Pe.prototype.constructor=Pe,Pe.prototype.isSpriteMaterial=!0,Pe.prototype.copy=function(t){return $.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this},Re.prototype=Object.assign(Object.create(dt.prototype),{constructor:Re,isSprite:!0,raycast:function(){var t=new c,e=new c,r=new c;return function(n,i){e.setFromMatrixPosition(this.matrixWorld),n.ray.closestPointToPoint(e,t),r.setFromMatrixScale(this.matrixWorld);var a=r.x*r.y/4;if(!(e.distanceToSquared(t)>a)){var o=n.ray.origin.distanceTo(t);o<n.near||o>n.far||i.push({distance:o,point:t.clone(),face:null,object:this})}}}(),clone:function(){return new this.constructor(this.material).copy(this)}}),Ce.prototype=Object.assign(Object.create(dt.prototype),{constructor:Ce,copy:function(t){dt.prototype.copy.call(this,t,!1);for(var e=t.levels,r=0,n=e.length;r<n;r++){var i=e[r];this.addLevel(i.object.clone(),i.distance)}return this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var r=this.levels,n=0;n<r.length&&!(e<r[n].distance);n++);r.splice(n,0,{distance:e,object:t}),this.add(t)},getObjectForDistance:function(t){for(var e=this.levels,r=1,n=e.length;r<n&&!(t<e[r].distance);r++);return e[r-1].object},raycast:function(){var t=new c;return function(e,r){t.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(t);this.getObjectForDistance(n).raycast(e,r)}}(),update:function(){var t=new c,e=new c;return function(r){var n=this.levels;if(n.length>1){t.setFromMatrixPosition(r.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var i=t.distanceTo(e);n[0].object.visible=!0;for(var a=1,o=n.length;a<o&&i>=n[a].distance;a++)n[a-1].object.visible=!1,n[a].object.visible=!0;for(;a<o;a++)n[a].object.visible=!1}}}(),toJSON:function(t){var e=dt.prototype.toJSON.call(this,t);e.object.levels=[];for(var r=this.levels,n=0,i=r.length;n<i;n++){var a=r[n];e.object.levels.push({object:a.object.uuid,distance:a.distance})}return e}}),Object.assign(Oe.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var r=new l;this.bones[t]&&r.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(r)}},pose:function(){var t,e,r;for(e=0,r=this.bones.length;e<r;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,r=this.bones.length;e<r;e++)(t=this.bones[e])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:function(){var t=new l,e=new l;return function(){for(var r=this.bones,n=this.boneInverses,i=this.boneMatrices,a=this.boneTexture,o=0,s=r.length;o<s;o++){var u=r[o]?r[o].matrixWorld:e;t.multiplyMatrices(u,n[o]),t.toArray(i,16*o)}void 0!==a&&(a.needsUpdate=!0)}}(),clone:function(){return new Oe(this.bones,this.boneInverses)}}),Ie.prototype=Object.assign(Object.create(dt.prototype),{constructor:Ie,isBone:!0}),De.prototype=Object.assign(Object.create(Gt.prototype),{constructor:De,isSkinnedMesh:!0,initBones:function(){var t,e,r,n,i=[];if(this.geometry&&void 0!==this.geometry.bones){for(r=0,n=this.geometry.bones.length;r<n;r++)e=this.geometry.bones[r],t=new Ie,i.push(t),t.name=e.name,t.position.fromArray(e.pos),t.quaternion.fromArray(e.rotq),void 0!==e.scl&&t.scale.fromArray(e.scl);for(r=0,n=this.geometry.bones.length;r<n;r++)e=this.geometry.bones[r],-1!==e.parent&&null!==e.parent&&void 0!==i[e.parent]?i[e.parent].add(i[r]):this.add(i[r])}return this.updateMatrixWorld(!0),i},bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){var t,e;if(this.geometry&&this.geometry.isGeometry)for(e=0;e<this.geometry.skinWeights.length;e++){var r=this.geometry.skinWeights[e];t=1/r.lengthManhattan(),t!==1/0?r.multiplyScalar(t):r.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry){var n=new o,i=this.geometry.attributes.skinWeight;for(e=0;e<i.count;e++)n.x=i.getX(e),n.y=i.getY(e),n.z=i.getZ(e),n.w=i.getW(e),t=1/n.lengthManhattan(),t!==1/0?n.multiplyScalar(t):n.set(1,0,0,0),i.setXYZW(e,n.x,n.y,n.z,n.w)}},updateMatrixWorld:function(t){Gt.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Ne.prototype=Object.create($.prototype),Ne.prototype.constructor=Ne,Ne.prototype.isLineBasicMaterial=!0,Ne.prototype.copy=function(t){return $.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},Ue.prototype=Object.assign(Object.create(dt.prototype),{constructor:Ue,isLine:!0,raycast:function(){var t=new l,e=new Ft,r=new it;return function(n,i){var a=n.linePrecision,o=a*a,s=this.geometry,u=this.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),r.copy(s.boundingSphere),r.applyMatrix4(u),!1!==n.ray.intersectsSphere(r)){t.getInverse(u),e.copy(n.ray).applyMatrix4(t);var h=new c,l=new c,d=new c,f=new c,p=this&&this.isLineSegments?2:1;if(s.isBufferGeometry){var m=s.index,v=s.attributes,g=v.position.array;if(null!==m)for(var y=m.array,x=0,_=y.length-1;x<_;x+=p){var b=y[x],w=y[x+1];h.fromArray(g,3*b),l.fromArray(g,3*w);var M=e.distanceSqToSegment(h,l,f,d);if(!(M>o)){f.applyMatrix4(this.matrixWorld);var E=n.ray.origin.distanceTo(f);E<n.near||E>n.far||i.push({distance:E,point:d.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else for(var x=0,_=g.length/3-1;x<_;x+=p){h.fromArray(g,3*x),l.fromArray(g,3*x+3);var M=e.distanceSqToSegment(h,l,f,d);if(!(M>o)){f.applyMatrix4(this.matrixWorld);var E=n.ray.origin.distanceTo(f);E<n.near||E>n.far||i.push({distance:E,point:d.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else if(s.isGeometry)for(var T=s.vertices,S=T.length,x=0;x<S-1;x+=p){var M=e.distanceSqToSegment(T[x],T[x+1],f,d);if(!(M>o)){f.applyMatrix4(this.matrixWorld);var E=n.ray.origin.distanceTo(f);E<n.near||E>n.far||i.push({distance:E,point:d.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Fe.prototype=Object.assign(Object.create(Ue.prototype),{constructor:Fe,isLineSegments:!0}),Be.prototype=Object.assign(Object.create(Ue.prototype),{constructor:Be,isLineLoop:!0}),ze.prototype=Object.create($.prototype),ze.prototype.constructor=ze,ze.prototype.isPointsMaterial=!0,ze.prototype.copy=function(t){return $.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this},Ge.prototype=Object.assign(Object.create(dt.prototype),{constructor:Ge,isPoints:!0,raycast:function(){var t=new l,e=new Ft,r=new it;return function(n,i){function a(t,r){var a=e.distanceSqToPoint(t);if(a<d){var s=e.closestPointToPoint(t);s.applyMatrix4(u);var h=n.ray.origin.distanceTo(s);if(h<n.near||h>n.far)return;i.push({distance:h,distanceToRay:Math.sqrt(a),point:s.clone(),index:r,face:null,object:o})}}var o=this,s=this.geometry,u=this.matrixWorld,h=n.params.Points.threshold;if(null===s.boundingSphere&&s.computeBoundingSphere(),r.copy(s.boundingSphere),r.applyMatrix4(u),r.radius+=h,!1!==n.ray.intersectsSphere(r)){t.getInverse(u),e.copy(n.ray).applyMatrix4(t);var l=h/((this.scale.x+this.scale.y+this.scale.z)/3),d=l*l,f=new c;if(s.isBufferGeometry){var p=s.index,m=s.attributes,v=m.position.array;if(null!==p)for(var g=p.array,y=0,x=g.length;y<x;y++){var _=g[y];f.fromArray(v,3*_),a(f,_)}else for(var y=0,b=v.length/3;y<b;y++)f.fromArray(v,3*y),a(f,y)}else for(var w=s.vertices,y=0,b=w.length;y<b;y++)a(w[y],y)}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),je.prototype=Object.assign(Object.create(dt.prototype),{constructor:je}),Ve.prototype=Object.create(a.prototype),Ve.prototype.constructor=Ve,ke.prototype=Object.create(a.prototype),ke.prototype.constructor=ke,ke.prototype.isCompressedTexture=!0,He.prototype=Object.create(a.prototype),He.prototype.constructor=He,He.prototype.isDepthTexture=!0,We.prototype=Object.create(Ct.prototype),We.prototype.constructor=We,qe.prototype=Object.create(yt.prototype),qe.prototype.constructor=qe,Xe.prototype=Object.create(Ct.prototype),Xe.prototype.constructor=Xe,Ye.prototype=Object.create(yt.prototype),Ye.prototype.constructor=Ye,Ze.prototype=Object.create(Ct.prototype),Ze.prototype.constructor=Ze,Ke.prototype=Object.create(yt.prototype),Ke.prototype.constructor=Ke,Qe.prototype=Object.create(Ze.prototype),Qe.prototype.constructor=Qe,Je.prototype=Object.create(yt.prototype),Je.prototype.constructor=Je,$e.prototype=Object.create(Ze.prototype),$e.prototype.constructor=$e,tr.prototype=Object.create(yt.prototype),tr.prototype.constructor=tr,er.prototype=Object.create(Ze.prototype),er.prototype.constructor=er,rr.prototype=Object.create(yt.prototype),rr.prototype.constructor=rr,nr.prototype=Object.create(Ze.prototype),nr.prototype.constructor=nr,ir.prototype=Object.create(yt.prototype),ir.prototype.constructor=ir,ar.prototype=Object.create(Ct.prototype),ar.prototype.constructor=ar,or.prototype=Object.create(yt.prototype),or.prototype.constructor=or,sr.prototype=Object.create(Ct.prototype),sr.prototype.constructor=sr,ur.prototype=Object.create(yt.prototype),ur.prototype.constructor=ur,hr.prototype=Object.create(Ct.prototype),hr.prototype.constructor=hr;var Ks={area:function(t){for(var e=t.length,r=0,n=e-1,i=0;i<e;n=i++)r+=t[n].x*t[i].y-t[i].x*t[n].y;return.5*r},triangulate:function(){function t(t,e,r,n,i,a){var o,s,u,h,c,l,d,f,p;if(s=t[a[e]].x,u=t[a[e]].y,h=t[a[r]].x,c=t[a[r]].y,l=t[a[n]].x,d=t[a[n]].y,(h-s)*(d-u)-(c-u)*(l-s)<=0)return!1;var m,v,g,y,x,_,b,w,M,E,T,S,A,L,P;for(m=l-h,v=d-c,g=s-l,y=u-d,x=h-s,_=c-u,o=0;o<i;o++)if(f=t[a[o]].x,p=t[a[o]].y,!(f===s&&p===u||f===h&&p===c||f===l&&p===d)&&(b=f-s,w=p-u,M=f-h,E=p-c,T=f-l,S=p-d,P=m*E-v*M,A=x*w-_*b,L=g*S-y*T,P>=-Number.EPSILON&&L>=-Number.EPSILON&&A>=-Number.EPSILON))return!1;return!0}return function(e,r){var n=e.length;if(n<3)return null;var i,a,o,s=[],u=[],h=[];if(Ks.area(e)>0)for(a=0;a<n;a++)u[a]=a;else for(a=0;a<n;a++)u[a]=n-1-a;var c=n,l=2*c;for(a=c-1;c>2;){if(l--<=0)return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),r?h:s;if(i=a,c<=i&&(i=0),a=i+1,c<=a&&(a=0),o=a+1,c<=o&&(o=0),t(e,i,a,o,c,u)){var d,f,p,m,v;for(d=u[i],f=u[a],p=u[o],s.push([e[d],e[f],e[p]]),h.push([u[i],u[a],u[o]]),m=a,v=a+1;v<c;m++,v++)u[m]=u[v];c--,l=2*c}}return r?h:s}}(),triangulateShape:function(t,e){function r(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function n(t,e,r){return t.x!==e.x?t.x<e.x?t.x<=r.x&&r.x<=e.x:e.x<=r.x&&r.x<=t.x:t.y<e.y?t.y<=r.y&&r.y<=e.y:e.y<=r.y&&r.y<=t.y}function i(t,e,r,i,a){var o=e.x-t.x,s=e.y-t.y,u=i.x-r.x,h=i.y-r.y,c=t.x-r.x,l=t.y-r.y,d=s*u-o*h,f=s*c-o*l;if(Math.abs(d)>Number.EPSILON){var p;if(d>0){if(f<0||f>d)return[];if((p=h*c-u*l)<0||p>d)return[]}else{if(f>0||f<d)return[];if((p=h*c-u*l)>0||p<d)return[]}if(0===p)return!a||0!==f&&f!==d?[t]:[];if(p===d)return!a||0!==f&&f!==d?[e]:[];if(0===f)return[r];if(f===d)return[i];var m=p/d;return[{x:t.x+m*o,y:t.y+m*s}]}if(0!==f||h*c!=u*l)return[];var v=0===o&&0===s,g=0===u&&0===h;if(v&&g)return t.x!==r.x||t.y!==r.y?[]:[t];if(v)return n(r,i,t)?[t]:[];if(g)return n(t,e,r)?[r]:[];var y,x,_,b,w,M,E,T;return 0!==o?(t.x<e.x?(y=t,_=t.x,x=e,b=e.x):(y=e,_=e.x,x=t,b=t.x),r.x<i.x?(w=r,E=r.x,M=i,T=i.x):(w=i,E=i.x,M=r,T=r.x)):(t.y<e.y?(y=t,_=t.y,x=e,b=e.y):(y=e,_=e.y,x=t,b=t.y),r.y<i.y?(w=r,E=r.y,M=i,T=i.y):(w=i,E=i.y,M=r,T=r.y)),_<=E?b<E?[]:b===E?a?[]:[w]:b<=T?[w,x]:[w,M]:_>T?[]:_===T?a?[]:[y]:b<=T?[y,x]:[y,M]}function a(t,e,r,n){var i=e.x-t.x,a=e.y-t.y,o=r.x-t.x,s=r.y-t.y,u=n.x-t.x,h=n.y-t.y,c=i*s-a*o,l=i*h-a*u;if(Math.abs(c)>Number.EPSILON){var d=u*s-h*o;return c>0?l>=0&&d>=0:l>=0||d>=0}return l>0}r(t),e.forEach(r);for(var o,s,u,h,c,l,d={},f=t.concat(),p=0,m=e.length;p<m;p++)Array.prototype.push.apply(f,e[p]);for(o=0,s=f.length;o<s;o++)c=f[o].x+":"+f[o].y,void 0!==d[c]&&console.warn("THREE.ShapeUtils: Duplicate point",c,o),d[c]=o;var v=function(t,e){for(var r,n,o,s,u,h,c,l,d,f,p,m=t.concat(),v=[],g=[],y=0,x=e.length;y<x;y++)v.push(y);for(var _=0,b=2*v.length;v.length>0;){if(--b<0){console.log('THREE.ShapeUtils: Infinite Loop! Holes left:" + indepHoles.length + ", Probably Hole outside Shape!');break}for(o=_;o<m.length;o++){s=m[o],n=-1;for(var y=0;y<v.length;y++)if(h=v[y],c=s.x+":"+s.y+":"+h,void 0===g[c]){r=e[h];for(var w=0;w<r.length;w++)if(u=r[w],function(t,e){var n=m.length-1,i=t-1;i<0&&(i=n);var o=t+1;o>n&&(o=0);var s=a(m[t],m[i],m[o],r[e]);if(!s)return!1;var u=r.length-1,h=e-1;h<0&&(h=u);var c=e+1;return c>u&&(c=0),!!(s=a(r[e],r[h],r[c],m[t]))}(o,w)&&!function(t,e){var r,n,a;for(r=0;r<m.length;r++)if(n=r+1,n%=m.length,a=i(t,e,m[r],m[n],!0),a.length>0)return!0;return!1}(s,u)&&!function(t,r){var n,a,o,s,u;for(n=0;n<v.length;n++)for(a=e[v[n]],o=0;o<a.length;o++)if(s=o+1,s%=a.length,u=i(t,r,a[o],a[s],!0),u.length>0)return!0;return!1}(s,u)){n=w,v.splice(y,1),l=m.slice(0,o+1),d=m.slice(o),f=r.slice(n),p=r.slice(0,n+1),m=l.concat(f).concat(p).concat(d),_=o;break}if(n>=0)break;g[c]=!0}if(n>=0)break}}return m}(t,e),g=Ks.triangulate(v,!1);for(o=0,s=g.length;o<s;o++)for(h=g[o],u=0;u<3;u++)c=h[u].x+":"+h[u].y,void 0!==(l=d[c])&&(h[u]=l);return g.concat()},isClockWise:function(t){return Ks.area(t)<0}};cr.prototype=Object.create(yt.prototype),cr.prototype.constructor=cr,lr.prototype=Object.create(Ct.prototype),lr.prototype.constructor=lr,lr.prototype.getArrays=function(){var t=this.getAttribute("position"),e=t?Array.prototype.slice.call(t.array):[],r=this.getAttribute("uv"),n=r?Array.prototype.slice.call(r.array):[],i=this.index;return{position:e,uv:n,index:i?Array.prototype.slice.call(i.array):[]}},lr.prototype.addShapeList=function(t,e){var r=t.length;e.arrays=this.getArrays();for(var n=0;n<r;n++){var i=t[n];this.addShape(i,e)}this.setIndex(e.arrays.index),this.addAttribute("position",new At(e.arrays.position,3)),this.addAttribute("uv",new At(e.arrays.uv,2))},lr.prototype.addShape=function(t,e){function r(t,e,r){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(r).add(t)}function n(t,e,r){var n,a,o,s=t.x-e.x,u=t.y-e.y,h=r.x-t.x,c=r.y-t.y,l=s*s+u*u,d=s*c-u*h;if(Math.abs(d)>Number.EPSILON){var f=Math.sqrt(l),p=Math.sqrt(h*h+c*c),m=e.x-u/f,v=e.y+s/f,g=r.x-c/p,y=r.y+h/p,x=((g-m)*c-(y-v)*h)/(s*c-u*h);n=m+s*x-t.x,a=v+u*x-t.y;var _=n*n+a*a;if(_<=2)return new i(n,a);o=Math.sqrt(_/2)}else{var b=!1;s>Number.EPSILON?h>Number.EPSILON&&(b=!0):s<-Number.EPSILON?h<-Number.EPSILON&&(b=!0):Math.sign(u)===Math.sign(c)&&(b=!0),b?(n=-u,a=s,o=Math.sqrt(l)):(n=s,a=u,o=Math.sqrt(l/2))}return new i(n/o,a/o)}function a(t,e){var r,n;for(K=t.length;--K>=0;){r=K,n=K-1,n<0&&(n=t.length-1);var i=0,a=L+2*T;for(i=0;i<a;i++){var o=X*i,s=X*(i+1);u(e+r+o,e+n+o,e+n+s,e+r+s,t,i,a,r,n)}}}function o(t,e,r){b.push(t),b.push(e),b.push(r)}function s(t,e,r){h(t),h(e),h(r);var n=y.length/3,i=C.generateTopUV(N,y,n-3,n-2,n-1);l(i[0]),l(i[1]),l(i[2])}function u(t,e,r,n,i,a,o,s,u){h(t),h(e),h(n),h(e),h(r),h(n);var c=y.length/3,d=C.generateSideWallUV(N,y,c-6,c-3,c-2,c-1);l(d[0]),l(d[1]),l(d[3]),l(d[1]),l(d[2]),l(d[3])}function h(t){x.push(y.length/3),y.push(b[3*t+0]),y.push(b[3*t+1]),y.push(b[3*t+2])}function l(t){_.push(t.x),_.push(t.y)}var d,f,p,m,v,g=e.arrays?e.arrays:this.getArrays(),y=g.position,x=g.index,_=g.uv,b=[],w=void 0!==e.amount?e.amount:100,M=void 0!==e.bevelThickness?e.bevelThickness:6,E=void 0!==e.bevelSize?e.bevelSize:M-2,T=void 0!==e.bevelSegments?e.bevelSegments:3,S=void 0===e.bevelEnabled||e.bevelEnabled,A=void 0!==e.curveSegments?e.curveSegments:12,L=void 0!==e.steps?e.steps:1,P=e.extrudePath,R=!1,C=void 0!==e.UVGenerator?e.UVGenerator:cr.WorldUVGenerator;P&&(d=P.getSpacedPoints(L),R=!0,S=!1,f=void 0!==e.frames?e.frames:P.computeFrenetFrames(L,!1),p=new c,m=new c,v=new c),S||(T=0,M=0,E=0);var O,I,D,N=this,U=t.extractPoints(A),F=U.shape,B=U.holes;if(!Ks.isClockWise(F))for(F=F.reverse(),I=0,D=B.length;I<D;I++)O=B[I],Ks.isClockWise(O)&&(B[I]=O.reverse());var z=Ks.triangulateShape(F,B),G=F;for(I=0,D=B.length;I<D;I++)O=B[I],F=F.concat(O);for(var j,V,k,H,W,q,X=F.length,Y=z.length,Z=[],K=0,Q=G.length,J=Q-1,$=K+1;K<Q;K++,J++,$++)J===Q&&(J=0),$===Q&&($=0),Z[K]=n(G[K],G[J],G[$]);var tt,et=[],rt=Z.concat();for(I=0,D=B.length;I<D;I++){for(O=B[I],tt=[],K=0,Q=O.length,J=Q-1,$=K+1;K<Q;K++,J++,$++)J===Q&&(J=0),$===Q&&($=0),tt[K]=n(O[K],O[J],O[$]);et.push(tt),rt=rt.concat(tt)}for(j=0;j<T;j++){for(k=j/T,H=M*Math.cos(k*Math.PI/2),V=E*Math.sin(k*Math.PI/2),K=0,Q=G.length;K<Q;K++)W=r(G[K],Z[K],V),o(W.x,W.y,-H);for(I=0,D=B.length;I<D;I++)for(O=B[I],tt=et[I],K=0,Q=O.length;K<Q;K++)W=r(O[K],tt[K],V),o(W.x,W.y,-H)}for(V=E,K=0;K<X;K++)W=S?r(F[K],rt[K],V):F[K],R?(m.copy(f.normals[0]).multiplyScalar(W.x),p.copy(f.binormals[0]).multiplyScalar(W.y),v.copy(d[0]).add(m).add(p),o(v.x,v.y,v.z)):o(W.x,W.y,0);var nt;for(nt=1;nt<=L;nt++)for(K=0;K<X;K++)W=S?r(F[K],rt[K],V):F[K],R?(m.copy(f.normals[nt]).multiplyScalar(W.x),p.copy(f.binormals[nt]).multiplyScalar(W.y),v.copy(d[nt]).add(m).add(p),o(v.x,v.y,v.z)):o(W.x,W.y,w/L*nt);for(j=T-1;j>=0;j--){for(k=j/T,H=M*Math.cos(k*Math.PI/2),V=E*Math.sin(k*Math.PI/2),K=0,Q=G.length;K<Q;K++)W=r(G[K],Z[K],V),o(W.x,W.y,w+H);for(I=0,D=B.length;I<D;I++)for(O=B[I],tt=et[I],K=0,Q=O.length;K<Q;K++)W=r(O[K],tt[K],V),R?o(W.x,W.y+d[L-1].y,d[L-1].x+H):o(W.x,W.y,w+H)}!function(){var t=y.length/3;if(S){var r=0,n=X*r;for(K=0;K<Y;K++)q=z[K],s(q[2]+n,q[1]+n,q[0]+n);for(r=L+2*T,n=X*r,K=0;K<Y;K++)q=z[K],s(q[0]+n,q[1]+n,q[2]+n)}else{for(K=0;K<Y;K++)q=z[K],s(q[2],q[1],q[0]);for(K=0;K<Y;K++)q=z[K],s(q[0]+X*L,q[1]+X*L,q[2]+X*L)}N.addGroup(t,y.length/3-t,void 0!==e.material?e.material:0)}(),function(){var t=y.length/3,r=0;for(a(G,r),r+=G.length,I=0,D=B.length;I<D;I++)O=B[I],a(O,r),r+=O.length;N.addGroup(t,y.length/3-t,void 0!==e.extrudeMaterial?e.extrudeMaterial:1)}(),e.arrays||(this.setIndex(x),this.addAttribute("position",new At(y,3)),this.addAttribute("uv",new At(e.arrays.uv,2)))},cr.WorldUVGenerator={generateTopUV:function(t,e,r,n,a){var o=e[3*r],s=e[3*r+1],u=e[3*n],h=e[3*n+1],c=e[3*a],l=e[3*a+1];return[new i(o,s),new i(u,h),new i(c,l)]},generateSideWallUV:function(t,e,r,n,a,o){var s=e[3*r],u=e[3*r+1],h=e[3*r+2],c=e[3*n],l=e[3*n+1],d=e[3*n+2],f=e[3*a],p=e[3*a+1],m=e[3*a+2],v=e[3*o],g=e[3*o+1],y=e[3*o+2];return Math.abs(u-l)<.01?[new i(s,1-h),new i(c,1-d),new i(f,1-m),new i(v,1-y)]:[new i(u,1-h),new i(l,1-d),new i(p,1-m),new i(g,1-y)]}},dr.prototype=Object.create(yt.prototype),dr.prototype.constructor=dr,fr.prototype=Object.create(lr.prototype),fr.prototype.constructor=fr,pr.prototype=Object.create(yt.prototype),pr.prototype.constructor=pr,mr.prototype=Object.create(Ct.prototype),mr.prototype.constructor=mr,vr.prototype=Object.create(yt.prototype),vr.prototype.constructor=vr,gr.prototype=Object.create(Ct.prototype),gr.prototype.constructor=gr,yr.prototype=Object.create(yt.prototype),yr.prototype.constructor=yr,xr.prototype=Object.create(Ct.prototype),xr.prototype.constructor=xr,_r.prototype=Object.create(yt.prototype),_r.prototype.constructor=_r,br.prototype=Object.create(Ct.prototype),br.prototype.constructor=br,wr.prototype=Object.create(Ct.prototype),wr.prototype.constructor=wr,Mr.prototype=Object.create(yt.prototype),Mr.prototype.constructor=Mr,Er.prototype=Object.create(Ct.prototype),Er.prototype.constructor=Er,Tr.prototype=Object.create(Mr.prototype),Tr.prototype.constructor=Tr,Sr.prototype=Object.create(Er.prototype),Sr.prototype.constructor=Sr,Ar.prototype=Object.create(yt.prototype),Ar.prototype.constructor=Ar,Lr.prototype=Object.create(Ct.prototype),Lr.prototype.constructor=Lr;var Qs=Object.freeze({WireframeGeometry:We,ParametricGeometry:qe,ParametricBufferGeometry:Xe,TetrahedronGeometry:Ke,TetrahedronBufferGeometry:Qe,OctahedronGeometry:Je,OctahedronBufferGeometry:$e,IcosahedronGeometry:tr,IcosahedronBufferGeometry:er,DodecahedronGeometry:rr,DodecahedronBufferGeometry:nr,PolyhedronGeometry:Ye,PolyhedronBufferGeometry:Ze,TubeGeometry:ir,TubeBufferGeometry:ar,TorusKnotGeometry:or,TorusKnotBufferGeometry:sr,TorusGeometry:ur,TorusBufferGeometry:hr,TextGeometry:dr,TextBufferGeometry:fr,SphereGeometry:pr,SphereBufferGeometry:mr,RingGeometry:vr,RingBufferGeometry:gr,PlaneGeometry:Dt,PlaneBufferGeometry:Nt,LatheGeometry:yr,LatheBufferGeometry:xr,ShapeGeometry:_r,ShapeBufferGeometry:br,ExtrudeGeometry:cr,ExtrudeBufferGeometry:lr,EdgesGeometry:wr,ConeGeometry:Tr,ConeBufferGeometry:Sr,CylinderGeometry:Mr,CylinderBufferGeometry:Er,CircleGeometry:Ar,CircleBufferGeometry:Lr,BoxGeometry:Ot,BoxBufferGeometry:It});Pr.prototype=Object.create($.prototype),Pr.prototype.constructor=Pr,Pr.prototype.isShadowMaterial=!0,Rr.prototype=Object.create(tt.prototype),Rr.prototype.constructor=Rr,Rr.prototype.isRawShaderMaterial=!0,Cr.prototype=Object.create($.prototype),Cr.prototype.constructor=Cr,Cr.prototype.isMeshStandardMaterial=!0,Cr.prototype.copy=function(t){return $.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Or.prototype=Object.create(Cr.prototype),Or.prototype.constructor=Or,Or.prototype.isMeshPhysicalMaterial=!0,Or.prototype.copy=function(t){return Cr.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearCoat=t.clearCoat,this.clearCoatRoughness=t.clearCoatRoughness,this},Ir.prototype=Object.create($.prototype),Ir.prototype.constructor=Ir,Ir.prototype.isMeshPhongMaterial=!0,Ir.prototype.copy=function(t){return $.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Dr.prototype=Object.create(Ir.prototype),Dr.prototype.constructor=Dr,Dr.prototype.isMeshToonMaterial=!0,Dr.prototype.copy=function(t){return Ir.prototype.copy.call(this,t),this.gradientMap=t.gradientMap,this},Nr.prototype=Object.create($.prototype),Nr.prototype.constructor=Nr,Nr.prototype.isMeshNormalMaterial=!0,Nr.prototype.copy=function(t){return $.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Ur.prototype=Object.create($.prototype),Ur.prototype.constructor=Ur,Ur.prototype.isMeshLambertMaterial=!0,Ur.prototype.copy=function(t){return $.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Fr.prototype=Object.create(Ne.prototype),Fr.prototype.constructor=Fr,Fr.prototype.isLineDashedMaterial=!0,Fr.prototype.copy=function(t){return Ne.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var Js=Object.freeze({ShadowMaterial:Pr,SpriteMaterial:Pe,RawShaderMaterial:Rr,ShaderMaterial:tt,PointsMaterial:ze,MeshPhysicalMaterial:Or,MeshStandardMaterial:Cr,MeshPhongMaterial:Ir,MeshToonMaterial:Dr,MeshNormalMaterial:Nr,MeshLambertMaterial:Ur,MeshDepthMaterial:et,MeshDistanceMaterial:rt,MeshBasicMaterial:Ut,LineDashedMaterial:Fr,LineBasicMaterial:Ne,Material:$}),$s={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}},tu=new Br;Object.assign(zr.prototype,{load:function(t,e,r,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t);var i=this,a=$s.get(t);if(void 0!==a)return i.manager.itemStart(t),setTimeout(function(){e&&e(a),i.manager.itemEnd(t)},0),a;var o=/^data:(.*?)(;base64)?,(.*)$/,s=t.match(o);if(s){var u=s[1],h=!!s[2],c=s[3];c=window.decodeURIComponent(c),h&&(c=window.atob(c));try{var l,d=(this.responseType||"").toLowerCase();switch(d){case"arraybuffer":case"blob":l=new ArrayBuffer(c.length);for(var f=new Uint8Array(l),p=0;p<c.length;p++)f[p]=c.charCodeAt(p);"blob"===d&&(l=new Blob([l],{type:u}));break;case"document":var m=new DOMParser;l=m.parseFromString(c,u);break;case"json":l=JSON.parse(c);break;default:l=c}window.setTimeout(function(){e&&e(l),i.manager.itemEnd(t)},0)}catch(e){window.setTimeout(function(){n&&n(e),i.manager.itemEnd(t),i.manager.itemError(t)},0)}}else{var v=new XMLHttpRequest;v.open("GET",t,!0),v.addEventListener("load",function(r){var a=r.target.response;$s.add(t,a),200===this.status?(e&&e(a),i.manager.itemEnd(t)):0===this.status?(console.warn("THREE.FileLoader: HTTP Status 0 received."),e&&e(a),i.manager.itemEnd(t)):(n&&n(r),i.manager.itemEnd(t),i.manager.itemError(t))},!1),void 0!==r&&v.addEventListener("progress",function(t){r(t)},!1),v.addEventListener("error",function(e){n&&n(e),i.manager.itemEnd(t),i.manager.itemError(t)},!1),void 0!==this.responseType&&(v.responseType=this.responseType),void 0!==this.withCredentials&&(v.withCredentials=this.withCredentials),v.overrideMimeType&&v.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain");for(var g in this.requestHeader)v.setRequestHeader(g,this.requestHeader[g]);v.send(null)}return i.manager.itemStart(t),v},setPath:function(t){return this.path=t,this},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}}),Object.assign(Gr.prototype,{load:function(t,e,r,n){var i=this,a=[],o=new ke;o.image=a;var s=new zr(this.manager);if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(t))for(var u=0,h=0,c=t.length;h<c;++h)!function(h){s.load(t[h],function(t){var r=i._parser(t,!0);a[h]={width:r.width,height:r.height,format:r.format,mipmaps:r.mipmaps},6===(u+=1)&&(1===r.mipmapCount&&(o.minFilter=Oo),o.format=r.format,o.needsUpdate=!0,e&&e(o))},r,n)}(h);else s.load(t,function(t){var r=i._parser(t,!0);if(r.isCubemap)for(var n=r.mipmaps.length/r.mipmapCount,s=0;s<n;s++){a[s]={mipmaps:[]};for(var u=0;u<r.mipmapCount;u++)a[s].mipmaps.push(r.mipmaps[s*r.mipmapCount+u]),a[s].format=r.format,a[s].width=r.width,a[s].height=r.height}else o.image.width=r.width,o.image.height=r.height,o.mipmaps=r.mipmaps;1===r.mipmapCount&&(o.minFilter=Oo),o.format=r.format,o.needsUpdate=!0,e&&e(o)},r,n);return o},setPath:function(t){return this.path=t,this}}),Object.assign(jr.prototype,{load:function(t,e,r,n){var i=this,a=new d,o=new zr(this.manager);return o.setResponseType("arraybuffer"),o.load(t,function(t){var r=i._parser(t);r&&(void 0!==r.image?a.image=r.image:void 0!==r.data&&(a.image.width=r.width,a.image.height=r.height,a.image.data=r.data),a.wrapS=void 0!==r.wrapS?r.wrapS:Ao,a.wrapT=void 0!==r.wrapT?r.wrapT:Ao,a.magFilter=void 0!==r.magFilter?r.magFilter:Oo,a.minFilter=void 0!==r.minFilter?r.minFilter:Do,a.anisotropy=void 0!==r.anisotropy?r.anisotropy:1,void 0!==r.format&&(a.format=r.format),void 0!==r.type&&(a.type=r.type),void 0!==r.mipmaps&&(a.mipmaps=r.mipmaps),1===r.mipmapCount&&(a.minFilter=Oo),a.needsUpdate=!0,e&&e(a,r))},r,n),a}}),Object.assign(Vr.prototype,{crossOrigin:"Anonymous",load:function(t,e,r,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t);var i=this,a=$s.get(t);if(void 0!==a)return i.manager.itemStart(t),setTimeout(function(){e&&e(a),i.manager.itemEnd(t)},0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");return o.addEventListener("load",function(){$s.add(t,this),e&&e(this),i.manager.itemEnd(t)},!1),o.addEventListener("error",function(e){n&&n(e),i.manager.itemEnd(t),i.manager.itemError(t)},!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(t),o.src=t,o},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(kr.prototype,{crossOrigin:"Anonymous",load:function(t,e,r,n){var i=new f,a=new Vr(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);for(var o=0,s=0;s<t.length;++s)!function(r){a.load(t[r],function(t){i.images[r]=t,6==++o&&(i.needsUpdate=!0,e&&e(i))},void 0,n)}(s);return i},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Hr.prototype,{crossOrigin:"Anonymous",load:function(t,e,r,n){var i=new Vr(this.manager);i.setCrossOrigin(this.crossOrigin),i.setPath(this.path);var o=new a;return o.image=i.load(t,function(){var r=t.search(/\.(jpg|jpeg)$/)>0||0===t.search(/^data\:image\/jpeg/);o.format=r?Yo:Zo,o.needsUpdate=!0,void 0!==e&&e(o)},r,n),o},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Wr.prototype=Object.assign(Object.create(dt.prototype),{constructor:Wr,isLight:!0,copy:function(t){return dt.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=dt.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),qr.prototype=Object.assign(Object.create(Wr.prototype),{constructor:qr,isHemisphereLight:!0,copy:function(t){return Wr.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(Xr.prototype,{copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),Yr.prototype=Object.assign(Object.create(Xr.prototype),{constructor:Yr,isSpotLightShadow:!0,update:function(t){var e=this.camera,r=2*Os.RAD2DEG*t.angle,n=this.mapSize.width/this.mapSize.height,i=t.distance||e.far;r===e.fov&&n===e.aspect&&i===e.far||(e.fov=r,e.aspect=n,e.far=i,e.updateProjectionMatrix())}}),Zr.prototype=Object.assign(Object.create(Wr.prototype),{constructor:Zr,isSpotLight:!0,copy:function(t){return Wr.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Kr.prototype=Object.assign(Object.create(Wr.prototype),{constructor:Kr,isPointLight:!0,copy:function(t){return Wr.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Qr.prototype=Object.assign(Object.create(Xr.prototype),{constructor:Qr}),Jr.prototype=Object.assign(Object.create(Wr.prototype),{constructor:Jr,isDirectionalLight:!0,copy:function(t){return Wr.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),$r.prototype=Object.assign(Object.create(Wr.prototype),{constructor:$r,isAmbientLight:!0}),tn.prototype=Object.assign(Object.create(Wr.prototype),{constructor:tn,isRectAreaLight:!0,copy:function(t){return Wr.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=Wr.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}});var eu={arraySlice:function(t,e,r){return eu.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==r?r:t.length)):t.slice(e,r)},convertArray:function(t,e,r){return!t||!r&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){function e(e,r){return t[e]-t[r]}for(var r=t.length,n=new Array(r),i=0;i!==r;++i)n[i]=i;return n.sort(e),n},sortedArray:function(t,e,r){for(var n=t.length,i=new t.constructor(n),a=0,o=0;o!==n;++a)for(var s=r[a]*e,u=0;u!==e;++u)i[o++]=t[s+u];return i},flattenJSON:function(t,e,r,n){for(var i=1,a=t[0];void 0!==a&&void 0===a[n];)a=t[i++];if(void 0!==a){var o=a[n];if(void 0!==o)if(Array.isArray(o))do{o=a[n],void 0!==o&&(e.push(a.time),r.push.apply(r,o)),a=t[i++]}while(void 0!==a);else if(void 0!==o.toArray)do{o=a[n],void 0!==o&&(e.push(a.time),o.toArray(r,r.length)),a=t[i++]}while(void 0!==a);else do{o=a[n],void 0!==o&&(e.push(a.time),r.push(o)),a=t[i++]}while(void 0!==a)}}};Object.assign(en.prototype,{evaluate:function(t){var e=this.parameterPositions,r=this._cachedIndex,n=e[r],i=e[r-1];t:{e:{var a;r:{n:if(!(t<n)){for(var o=r+2;;){if(void 0===n){if(t<i)break n;return r=e.length,this._cachedIndex=r,this.afterEnd_(r-1,t,i)}if(r===o)break;if(i=n,n=e[++r],t<n)break e}a=e.length;break r}{if(t>=i)break t;var s=e[1];t<s&&(r=2,i=s);for(var o=r-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(r===o)break;if(n=i,i=e[--r-1],t>=i)break e}a=r,r=0}}for(;r<a;){var u=r+a>>>1;t<e[u]?a=u:r=u+1}if(n=e[r],void 0===(i=e[r-1]))return this._cachedIndex=0,this.beforeStart_(0,t,n);if(void 0===n)return r=e.length,this._cachedIndex=r,this.afterEnd_(r-1,i,t)}this._cachedIndex=r,this.intervalChanged_(r,i,n)}return this.interpolate_(r,i,t,n)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,r=this.sampleValues,n=this.valueSize,i=t*n,a=0;a!==n;++a)e[a]=r[i+a];return e},interpolate_:function(t,e,r,n){throw new Error("call to abstract method")},intervalChanged_:function(t,e,r){}}),
//!\ DECLARE ALIAS AFTER assign prototype !
Object.assign(en.prototype,{beforeStart_:en.prototype.copySampleValue_,afterEnd_:en.prototype.copySampleValue_}),rn.prototype=Object.assign(Object.create(en.prototype),{constructor:rn,DefaultSettings_:{endingStart:vs,endingEnd:vs},intervalChanged_:function(t,e,r){var n=this.parameterPositions,i=t-2,a=t+1,o=n[i],s=n[a];if(void 0===o)switch(this.getSettings_().endingStart){case gs:i=t,o=2*e-r;break;case ys:i=n.length-2,o=e+n[i]-n[i+1];break;default:i=t,o=r}if(void 0===s)switch(this.getSettings_().endingEnd){case gs:a=t,s=2*r-e;break;case ys:a=1,s=r+n[1]-n[0];break;default:a=t-1,s=e}var u=.5*(r-e),h=this.valueSize;this._weightPrev=u/(e-o),this._weightNext=u/(s-r),this._offsetPrev=i*h,this._offsetNext=a*h},interpolate_:function(t,e,r,n){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,u=s-o,h=this._offsetPrev,c=this._offsetNext,l=this._weightPrev,d=this._weightNext,f=(r-e)/(n-e),p=f*f,m=p*f,v=-l*m+2*l*p-l*f,g=(1+l)*m+(-1.5-2*l)*p+(-.5+l)*f+1,y=(-1-d)*m+(1.5+d)*p+.5*f,x=d*m-d*p,_=0;_!==o;++_)i[_]=v*a[h+_]+g*a[u+_]+y*a[s+_]+x*a[c+_];return i}}),nn.prototype=Object.assign(Object.create(en.prototype),{constructor:nn,interpolate_:function(t,e,r,n){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,u=s-o,h=(r-e)/(n-e),c=1-h,l=0;l!==o;++l)i[l]=a[u+l]*c+a[s+l]*h;return i}}),an.prototype=Object.assign(Object.create(en.prototype),{constructor:an,interpolate_:function(t,e,r,n){return this.copySampleValue_(t-1)}});var ru;ru={TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:ps,InterpolantFactoryMethodDiscrete:function(t){return new an(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new nn(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new rn(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case fs:e=this.InterpolantFactoryMethodDiscrete;break;case ps:e=this.InterpolantFactoryMethodLinear;break;case ms:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){var r="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(r);this.setInterpolation(this.DefaultInterpolation)}return void console.warn("THREE.KeyframeTrackPrototype:",r)}this.createInterpolant=e},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return fs;case this.InterpolantFactoryMethodLinear:return ps;case this.InterpolantFactoryMethodSmooth:return ms}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,r=0,n=e.length;r!==n;++r)e[r]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,r=0,n=e.length;r!==n;++r)e[r]*=t;return this},trim:function(t,e){for(var r=this.times,n=r.length,i=0,a=n-1;i!==n&&r[i]<t;)++i;for(;-1!==a&&r[a]>e;)--a;if(++a,0!==i||a!==n){i>=a&&(a=Math.max(a,1),i=a-1);var o=this.getValueSize();this.times=eu.arraySlice(r,i,a),this.values=eu.arraySlice(this.values,i*o,a*o)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrackPrototype: Invalid value size in track.",this),t=!1);var r=this.times,n=this.values,i=r.length;0===i&&(console.error("THREE.KeyframeTrackPrototype: Track is empty.",this),t=!1);for(var a=null,o=0;o!==i;o++){var s=r[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrackPrototype: Time is not a valid number.",this,o,s),t=!1;break}if(null!==a&&a>s){console.error("THREE.KeyframeTrackPrototype: Out of order keys.",this,o,s,a),t=!1;break}a=s}if(void 0!==n&&eu.isTypedArray(n))for(var o=0,u=n.length;o!==u;++o){var h=n[o];if(isNaN(h)){console.error("THREE.KeyframeTrackPrototype: Value is not a valid number.",this,o,h),t=!1;break}}return t},optimize:function(){for(var t=this.times,e=this.values,r=this.getValueSize(),n=this.getInterpolation()===ms,i=1,a=t.length-1,o=1;o<a;++o){var s=!1,u=t[o];if(u!==t[o+1]&&(1!==o||u!==u[0]))if(n)s=!0;else for(var h=o*r,c=h-r,l=h+r,d=0;d!==r;++d){var f=e[h+d];if(f!==e[c+d]||f!==e[l+d]){s=!0;break}}if(s){if(o!==i){t[i]=t[o];for(var p=o*r,m=i*r,d=0;d!==r;++d)e[m+d]=e[p+d]}++i}}if(a>0){t[i]=t[a];for(var p=a*r,m=i*r,d=0;d!==r;++d)e[m+d]=e[p+d];++i}return i!==t.length&&(this.times=eu.arraySlice(t,0,i),this.values=eu.arraySlice(e,0,i*r)),this}},sn.prototype=Object.assign(Object.create(ru),{constructor:sn,ValueTypeName:"vector"}),un.prototype=Object.assign(Object.create(en.prototype),{constructor:un,interpolate_:function(t,e,r,n){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,u=(r-e)/(n-e),c=s+o;s!==c;s+=4)h.slerpFlat(i,0,a,s-o,a,s,u);return i}}),hn.prototype=Object.assign(Object.create(ru),{constructor:hn,ValueTypeName:"quaternion",DefaultInterpolation:ps,InterpolantFactoryMethodLinear:function(t){return new un(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),cn.prototype=Object.assign(Object.create(ru),{constructor:cn,ValueTypeName:"number"}),ln.prototype=Object.assign(Object.create(ru),{constructor:ln,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:fs,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),dn.prototype=Object.assign(Object.create(ru),{constructor:dn,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:fs,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),fn.prototype=Object.assign(Object.create(ru),{constructor:fn,ValueTypeName:"color"}),pn.prototype=ru,ru.constructor=pn,Object.assign(pn,{parse:function(t){if(void 0===t.type)throw new Error("track type undefined, can not parse");var e=pn._getTrackTypeForValueTypeName(t.type);if(void 0===t.times){var r=[],n=[];eu.flattenJSON(t.keys,r,n,"value"),t.times=r,t.values=n}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)},toJSON:function(t){var e,r=t.constructor;if(void 0!==r.toJSON)e=r.toJSON(t);else{e={name:t.name,times:eu.convertArray(t.times,Array),values:eu.convertArray(t.values,Array)};var n=t.getInterpolation();n!==t.DefaultInterpolation&&(e.interpolation=n)}return e.type=t.ValueTypeName,e},_getTrackTypeForValueTypeName:function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return cn;case"vector":case"vector2":case"vector3":case"vector4":return sn;case"color":return fn;case"quaternion":return hn;case"bool":case"boolean":return dn;case"string":return ln}throw new Error("Unsupported typeName: "+t)}}),Object.assign(mn,{parse:function(t){for(var e=[],r=t.tracks,n=1/(t.fps||1),i=0,a=r.length;i!==a;++i)e.push(pn.parse(r[i]).scale(n));return new mn(t.name,t.duration,e)},toJSON:function(t){for(var e=[],r=t.tracks,n={name:t.name,duration:t.duration,tracks:e},i=0,a=r.length;i!==a;++i)e.push(pn.toJSON(r[i]));return n},CreateFromMorphTargetSequence:function(t,e,r,n){for(var i=e.length,a=[],o=0;o<i;o++){var s=[],u=[];s.push((o+i-1)%i,o,(o+1)%i),u.push(0,1,0);var h=eu.getKeyframeOrder(s);s=eu.sortedArray(s,1,h),u=eu.sortedArray(u,1,h),n||0!==s[0]||(s.push(i),u.push(u[0])),a.push(new cn(".morphTargetInfluences["+e[o].name+"]",s,u).scale(1/r))}return new mn(t,-1,a)},findByName:function(t,e){var r=t;if(!Array.isArray(t)){var n=t;r=n.geometry&&n.geometry.animations||n.animations}for(var i=0;i<r.length;i++)if(r[i].name===e)return r[i];return null},CreateClipsFromMorphTargetSequences:function(t,e,r){for(var n={},i=/^([\w-]*?)([\d]+)$/,a=0,o=t.length;a<o;a++){var s=t[a],u=s.name.match(i);if(u&&u.length>1){var h=u[1],c=n[h];c||(n[h]=c=[]),c.push(s)}}var l=[];for(var h in n)l.push(mn.CreateFromMorphTargetSequence(h,n[h],e,r));return l},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var r=function(t,e,r,n,i){if(0!==r.length){var a=[],o=[];eu.flattenJSON(r,a,o,n),0!==a.length&&i.push(new t(e,a,o))}},n=[],i=t.name||"default",a=t.length||-1,o=t.fps||30,s=t.hierarchy||[],u=0;u<s.length;u++){var h=s[u].keys;if(h&&0!==h.length)if(h[0].morphTargets){for(var c={},l=0;l<h.length;l++)if(h[l].morphTargets)for(var d=0;d<h[l].morphTargets.length;d++)c[h[l].morphTargets[d]]=-1;for(var f in c){for(var p=[],m=[],d=0;d!==h[l].morphTargets.length;++d){var v=h[l];p.push(v.time),m.push(v.morphTarget===f?1:0)}n.push(new cn(".morphTargetInfluence["+f+"]",p,m))}a=c.length*(o||1)}else{var g=".bones["+e[u].name+"]";r(sn,g+".position",h,"pos",n),r(hn,g+".quaternion",h,"rot",n),r(sn,g+".scale",h,"scl",n)}}return 0===n.length?null:new mn(i,a,n)}}),Object.assign(mn.prototype,{resetDuration:function(){for(var t=this.tracks,e=0,r=0,n=t.length;r!==n;++r){var i=this.tracks[r];e=Math.max(e,i.times[i.times.length-1])}this.duration=e},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}}),Object.assign(vn.prototype,{load:function(t,e,r,n){var i=this;new zr(i.manager).load(t,function(t){e(i.parse(JSON.parse(t)))},r,n)},setTextures:function(t){this.textures=t},parse:function(t){function e(t){return void 0===r[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),r[t]}var r=this.textures,n=new Js[t.type];if(void 0!==t.uuid&&(n.uuid=t.uuid),void 0!==t.name&&(n.name=t.name),void 0!==t.color&&n.color.setHex(t.color),void 0!==t.roughness&&(n.roughness=t.roughness),void 0!==t.metalness&&(n.metalness=t.metalness),void 0!==t.emissive&&n.emissive.setHex(t.emissive),void 0!==t.specular&&n.specular.setHex(t.specular),void 0!==t.shininess&&(n.shininess=t.shininess),void 0!==t.clearCoat&&(n.clearCoat=t.clearCoat),void 0!==t.clearCoatRoughness&&(n.clearCoatRoughness=t.clearCoatRoughness),void 0!==t.uniforms&&(n.uniforms=t.uniforms),void 0!==t.vertexShader&&(n.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(n.fragmentShader=t.fragmentShader),void 0!==t.vertexColors&&(n.vertexColors=t.vertexColors),void 0!==t.fog&&(n.fog=t.fog),void 0!==t.flatShading&&(n.flatShading=t.flatShading),void 0!==t.blending&&(n.blending=t.blending),void 0!==t.side&&(n.side=t.side),void 0!==t.opacity&&(n.opacity=t.opacity),void 0!==t.transparent&&(n.transparent=t.transparent),void 0!==t.alphaTest&&(n.alphaTest=t.alphaTest),void 0!==t.depthTest&&(n.depthTest=t.depthTest),void 0!==t.depthWrite&&(n.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(n.colorWrite=t.colorWrite),void 0!==t.wireframe&&(n.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(n.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(n.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(n.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.skinning&&(n.skinning=t.skinning),void 0!==t.morphTargets&&(n.morphTargets=t.morphTargets),void 0!==t.dithering&&(n.dithering=t.dithering),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.shading&&(n.flatShading=1===t.shading),void 0!==t.size&&(n.size=t.size),void 0!==t.sizeAttenuation&&(n.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(n.map=e(t.map)),void 0!==t.alphaMap&&(n.alphaMap=e(t.alphaMap),n.transparent=!0),void 0!==t.bumpMap&&(n.bumpMap=e(t.bumpMap)),void 0!==t.bumpScale&&(n.bumpScale=t.bumpScale),void 0!==t.normalMap&&(n.normalMap=e(t.normalMap)),void 0!==t.normalScale){var a=t.normalScale;!1===Array.isArray(a)&&(a=[a,a]),n.normalScale=(new i).fromArray(a)}return void 0!==t.displacementMap&&(n.displacementMap=e(t.displacementMap)),void 0!==t.displacementScale&&(n.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(n.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(n.roughnessMap=e(t.roughnessMap)),void 0!==t.metalnessMap&&(n.metalnessMap=e(t.metalnessMap)),void 0!==t.emissiveMap&&(n.emissiveMap=e(t.emissiveMap)),void 0!==t.emissiveIntensity&&(n.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(n.specularMap=e(t.specularMap)),void 0!==t.envMap&&(n.envMap=e(t.envMap)),void 0!==t.reflectivity&&(n.reflectivity=t.reflectivity),void 0!==t.lightMap&&(n.lightMap=e(t.lightMap)),void 0!==t.lightMapIntensity&&(n.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(n.aoMap=e(t.aoMap)),void 0!==t.aoMapIntensity&&(n.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(n.gradientMap=e(t.gradientMap)),n}}),Object.assign(gn.prototype,{load:function(t,e,r,n){var i=this;new zr(i.manager).load(t,function(t){e(i.parse(JSON.parse(t)))},r,n)},parse:function(t){var e=new Ct,r=t.data.index;if(void 0!==r){var n=new nu[r.type](r.array);e.setIndex(new xt(n,1))}var i=t.data.attributes;for(var a in i){var o=i[a],n=new nu[o.type](o.array);e.addAttribute(a,new xt(n,o.itemSize,o.normalized))}var s=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==s)for(var u=0,h=s.length;u!==h;++u){var l=s[u];e.addGroup(l.start,l.count,l.materialIndex)}var d=t.data.boundingSphere;if(void 0!==d){var f=new c;void 0!==d.center&&f.fromArray(d.center),e.boundingSphere=new it(f,d.radius)}return e}});var nu={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};yn.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=this.handlers,r=0,n=e.length;r<n;r+=2){var i=e[r],a=e[r+1];if(i.test(t))return a}return null}},Object.assign(yn.prototype,{crossOrigin:void 0,extractUrlBase:function(t){var e=t.split("/");return 1===e.length?"./":(e.pop(),e.join("/")+"/")},initMaterials:function(t,e,r){for(var n=[],i=0;i<t.length;++i)n[i]=this.createMaterial(t[i],e,r);return n},createMaterial:function(){var t={NoBlending:Ia,NormalBlending:Da,AdditiveBlending:Na,SubtractiveBlending:Ua,MultiplyBlending:Fa,CustomBlending:Ba},e=new Y,r=new Hr,n=new vn;return function(i,a,o){function s(t,e,n,i,s){var h,c=a+t,l=yn.Handlers.get(c);null!==l?h=l.load(c):(r.setCrossOrigin(o),h=r.load(c)),void 0!==e&&(h.repeat.fromArray(e),1!==e[0]&&(h.wrapS=So),1!==e[1]&&(h.wrapT=So)),void 0!==n&&h.offset.fromArray(n),void 0!==i&&("repeat"===i[0]&&(h.wrapS=So),"mirror"===i[0]&&(h.wrapS=Lo),"repeat"===i[1]&&(h.wrapT=So),"mirror"===i[1]&&(h.wrapT=Lo)),void 0!==s&&(h.anisotropy=s);var d=Os.generateUUID();return u[d]=h,d}var u={},h={uuid:Os.generateUUID(),type:"MeshLambertMaterial"};for(var c in i){var l=i[c];switch(c){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":h.name=l;break;case"blending":h.blending=t[l];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",c,"is no longer supported.");break;case"colorDiffuse":h.color=e.fromArray(l).getHex();break;case"colorSpecular":h.specular=e.fromArray(l).getHex();break;case"colorEmissive":h.emissive=e.fromArray(l).getHex();break;case"specularCoef":h.shininess=l;break;case"shading":"basic"===l.toLowerCase()&&(h.type="MeshBasicMaterial"),"phong"===l.toLowerCase()&&(h.type="MeshPhongMaterial"),"standard"===l.toLowerCase()&&(h.type="MeshStandardMaterial");break;case"mapDiffuse":h.map=s(l,i.mapDiffuseRepeat,i.mapDiffuseOffset,i.mapDiffuseWrap,i.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":h.emissiveMap=s(l,i.mapEmissiveRepeat,i.mapEmissiveOffset,i.mapEmissiveWrap,i.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":h.lightMap=s(l,i.mapLightRepeat,i.mapLightOffset,i.mapLightWrap,i.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":h.aoMap=s(l,i.mapAORepeat,i.mapAOOffset,i.mapAOWrap,i.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":h.bumpMap=s(l,i.mapBumpRepeat,i.mapBumpOffset,i.mapBumpWrap,i.mapBumpAnisotropy);break;case"mapBumpScale":h.bumpScale=l;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":h.normalMap=s(l,i.mapNormalRepeat,i.mapNormalOffset,i.mapNormalWrap,i.mapNormalAnisotropy);break;case"mapNormalFactor":h.normalScale=[l,l];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":h.specularMap=s(l,i.mapSpecularRepeat,i.mapSpecularOffset,i.mapSpecularWrap,i.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":h.metalnessMap=s(l,i.mapMetalnessRepeat,i.mapMetalnessOffset,i.mapMetalnessWrap,i.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":h.roughnessMap=s(l,i.mapRoughnessRepeat,i.mapRoughnessOffset,i.mapRoughnessWrap,i.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":h.alphaMap=s(l,i.mapAlphaRepeat,i.mapAlphaOffset,i.mapAlphaWrap,i.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":h.side=Sa;break;case"doubleSided":h.side=Aa;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),h.opacity=l;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":h[c]=l;break;case"vertexColors":!0===l&&(h.vertexColors=Oa),"face"===l&&(h.vertexColors=Ca);break;default:console.error("THREE.Loader.createMaterial: Unsupported",c,l)}}return"MeshBasicMaterial"===h.type&&delete h.emissive,"MeshPhongMaterial"!==h.type&&delete h.specular,h.opacity<1&&(h.transparent=!0),n.setTextures(u),n.parse(h)}}()}),Object.assign(xn.prototype,{load:function(t,e,r,n){var i=this,a=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:yn.prototype.extractUrlBase(t),o=new zr(this.manager);o.setWithCredentials(this.withCredentials),o.load(t,function(r){var n=JSON.parse(r),o=n.metadata;if(void 0!==o){var s=o.type;if(void 0!==s){if("object"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.ObjectLoader instead.");if("scene"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.SceneLoader instead.")}}var u=i.parse(n,a);e(u.geometry,u.materials)},r,n)},setTexturePath:function(t){this.texturePath=t},parse:function(){function t(t,e){function r(t,e){return t&1<<e}var n,a,o,s,u,h,l,d,f,p,m,v,g,y,x,_,b,w,M,E,T,S,A,L,P,R,C,O=t.faces,I=t.vertices,D=t.normals,N=t.colors,U=t.scale,F=0;if(void 0!==t.uvs){for(n=0;n<t.uvs.length;n++)t.uvs[n].length&&F++;for(n=0;n<F;n++)e.faceVertexUvs[n]=[]}for(s=0,u=I.length;s<u;)w=new c,w.x=I[s++]*U,w.y=I[s++]*U,w.z=I[s++]*U,e.vertices.push(w);for(s=0,u=O.length;s<u;)if(p=O[s++],m=r(p,0),v=r(p,1),g=r(p,3),y=r(p,4),x=r(p,5),_=r(p,6),b=r(p,7),m){if(E=new vt,E.a=O[s],E.b=O[s+1],E.c=O[s+3],T=new vt,T.a=O[s+1],T.b=O[s+2],T.c=O[s+3],s+=4,v&&(f=O[s++],E.materialIndex=f,T.materialIndex=f),o=e.faces.length,g)for(n=0;n<F;n++)for(L=t.uvs[n],e.faceVertexUvs[n][o]=[],e.faceVertexUvs[n][o+1]=[],a=0;a<4;a++)d=O[s++],R=L[2*d],C=L[2*d+1],P=new i(R,C),2!==a&&e.faceVertexUvs[n][o].push(P),0!==a&&e.faceVertexUvs[n][o+1].push(P);if(y&&(l=3*O[s++],E.normal.set(D[l++],D[l++],D[l]),T.normal.copy(E.normal)),x)for(n=0;n<4;n++)l=3*O[s++],A=new c(D[l++],D[l++],D[l]),2!==n&&E.vertexNormals.push(A),0!==n&&T.vertexNormals.push(A);if(_&&(h=O[s++],S=N[h],E.color.setHex(S),T.color.setHex(S)),b)for(n=0;n<4;n++)h=O[s++],S=N[h],2!==n&&E.vertexColors.push(new Y(S)),0!==n&&T.vertexColors.push(new Y(S));e.faces.push(E),e.faces.push(T)}else{if(M=new vt,M.a=O[s++],M.b=O[s++],M.c=O[s++],v&&(f=O[s++],M.materialIndex=f),o=e.faces.length,g)for(n=0;n<F;n++)for(L=t.uvs[n],e.faceVertexUvs[n][o]=[],a=0;a<3;a++)d=O[s++],R=L[2*d],C=L[2*d+1],P=new i(R,C),e.faceVertexUvs[n][o].push(P);if(y&&(l=3*O[s++],M.normal.set(D[l++],D[l++],D[l])),x)for(n=0;n<3;n++)l=3*O[s++],A=new c(D[l++],D[l++],D[l]),M.vertexNormals.push(A);if(_&&(h=O[s++],M.color.setHex(N[h])),b)for(n=0;n<3;n++)h=O[s++],M.vertexColors.push(new Y(N[h]));e.faces.push(M)}}function e(t,e){var r=void 0!==t.influencesPerVertex?t.influencesPerVertex:2;if(t.skinWeights)for(var n=0,i=t.skinWeights.length;n<i;n+=r){var a=t.skinWeights[n],s=r>1?t.skinWeights[n+1]:0,u=r>2?t.skinWeights[n+2]:0,h=r>3?t.skinWeights[n+3]:0;e.skinWeights.push(new o(a,s,u,h))}if(t.skinIndices)for(var n=0,i=t.skinIndices.length;n<i;n+=r){var c=t.skinIndices[n],l=r>1?t.skinIndices[n+1]:0,d=r>2?t.skinIndices[n+2]:0,f=r>3?t.skinIndices[n+3]:0;e.skinIndices.push(new o(c,l,d,f))}e.bones=t.bones,e.bones&&e.bones.length>0&&(e.skinWeights.length!==e.skinIndices.length||e.skinIndices.length!==e.vertices.length)&&console.warn("When skinning, number of vertices ("+e.vertices.length+"), skinIndices ("+e.skinIndices.length+"), and skinWeights ("+e.skinWeights.length+") should match.")}function r(t,e){var r=t.scale;if(void 0!==t.morphTargets)for(var n=0,i=t.morphTargets.length;n<i;n++){e.morphTargets[n]={},e.morphTargets[n].name=t.morphTargets[n].name,e.morphTargets[n].vertices=[];for(var a=e.morphTargets[n].vertices,o=t.morphTargets[n].vertices,s=0,u=o.length;s<u;s+=3){var h=new c;h.x=o[s]*r,h.y=o[s+1]*r,h.z=o[s+2]*r,a.push(h)}}if(void 0!==t.morphColors&&t.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var l=e.faces,d=t.morphColors[0].colors,n=0,i=l.length;n<i;n++)l[n].color.fromArray(d,3*n)}}function n(t,e){var r=[],n=[];void 0!==t.animation&&n.push(t.animation),void 0!==t.animations&&(t.animations.length?n=n.concat(t.animations):n.push(t.animations));for(var i=0;i<n.length;i++){var a=mn.parseAnimation(n[i],e.bones);a&&r.push(a)}if(e.morphTargets){var o=mn.CreateClipsFromMorphTargetSequences(e.morphTargets,10);r=r.concat(o)}r.length>0&&(e.animations=r)}return function(i,a){void 0!==i.data&&(i=i.data),void 0!==i.scale?i.scale=1/i.scale:i.scale=1;var o=new yt;return t(i,o),e(i,o),r(i,o),n(i,o),o.computeFaceNormals(),o.computeBoundingSphere(),void 0===i.materials||0===i.materials.length?{geometry:o}:{geometry:o,materials:yn.prototype.initMaterials(i.materials,a,this.crossOrigin)}}}()}),Object.assign(_n.prototype,{load:function(t,e,r,n){""===this.texturePath&&(this.texturePath=t.substring(0,t.lastIndexOf("/")+1));var i=this;new zr(i.manager).load(t,function(r){var a=null;try{a=JSON.parse(r)}catch(e){return void 0!==n&&n(e),void console.error("THREE:ObjectLoader: Can't parse "+t+".",e.message)}var o=a.metadata;if(void 0===o||void 0===o.type||"geometry"===o.type.toLowerCase())return void console.error("THREE.ObjectLoader: Can't load "+t+". Use THREE.JSONLoader instead.");i.parse(a,e)},r,n)},setTexturePath:function(t){this.texturePath=t},setCrossOrigin:function(t){this.crossOrigin=t},parse:function(t,e){var r=this.parseGeometries(t.geometries),n=this.parseImages(t.images,function(){void 0!==e&&e(o)}),i=this.parseTextures(t.textures,n),a=this.parseMaterials(t.materials,i),o=this.parseObject(t.object,r,a);return t.animations&&(o.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(o),o},parseGeometries:function(t){var e={};if(void 0!==t)for(var r=new xn,n=new gn,i=0,a=t.length;i<a;i++){var o,s=t[i];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new Qs[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new Qs[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new Qs[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new Qs[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new Qs[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new Qs[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"IcosahedronGeometry":case"OctahedronGeometry":case"TetrahedronGeometry":o=new Qs[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new Qs[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new Qs[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new Qs[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"LatheGeometry":case"LatheBufferGeometry":o=new Qs[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"BufferGeometry":o=n.parse(s);break;case"Geometry":o=r.parse(s,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),e[s.uuid]=o}return e},parseMaterials:function(t,e){var r={};if(void 0!==t){var n=new vn;n.setTextures(e);for(var i=0,a=t.length;i<a;i++){var o=t[i];if("MultiMaterial"===o.type){for(var s=[],u=0;u<o.materials.length;u++)s.push(n.parse(o.materials[u]));r[o.uuid]=s}else r[o.uuid]=n.parse(o)}}return r},parseAnimations:function(t){for(var e=[],r=0;r<t.length;r++){var n=mn.parse(t[r]);e.push(n)}return e},parseImages:function(t,e){var r=this,n={};if(void 0!==t&&t.length>0){var i=new Br(e),a=new Vr(i);a.setCrossOrigin(this.crossOrigin);for(var o=0,s=t.length;o<s;o++){var u=t[o],h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(u.url)?u.url:r.texturePath+u.url;n[u.uuid]=function(t){return r.manager.itemStart(t),a.load(t,function(){r.manager.itemEnd(t)},void 0,function(){r.manager.itemEnd(t),r.manager.itemError(t)})}(h)}}return n},parseTextures:function(t,e){function r(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var n={};if(void 0!==t)for(var i=0,o=t.length;i<o;i++){var s=t[i];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===e[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);var u=new a(e[s.image]);u.needsUpdate=!0,u.uuid=s.uuid,void 0!==s.name&&(u.name=s.name),void 0!==s.mapping&&(u.mapping=r(s.mapping,iu)),void 0!==s.offset&&u.offset.fromArray(s.offset),void 0!==s.repeat&&u.repeat.fromArray(s.repeat),void 0!==s.wrap&&(u.wrapS=r(s.wrap[0],au),u.wrapT=r(s.wrap[1],au)),void 0!==s.minFilter&&(u.minFilter=r(s.minFilter,ou)),void 0!==s.magFilter&&(u.magFilter=r(s.magFilter,ou)),void 0!==s.anisotropy&&(u.anisotropy=s.anisotropy),void 0!==s.flipY&&(u.flipY=s.flipY),n[s.uuid]=u}return n},parseObject:function(){var t=new l;return function(e,r,n){function i(t){return void 0===r[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),r[t]}function a(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],r=0,i=t.length;r<i;r++){var a=t[r];void 0===n[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),e.push(n[a])}return e}return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),n[t]}}var o;switch(e.type){case"Scene":o=new Ae,void 0!==e.background&&Number.isInteger(e.background)&&(o.background=new Y(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?o.fog=new Se(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(o.fog=new Te(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":o=new mt(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(o.focus=e.focus),void 0!==e.zoom&&(o.zoom=e.zoom),void 0!==e.filmGauge&&(o.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(o.filmOffset=e.filmOffset),void 0!==e.view&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new pt(e.left,e.right,e.top,e.bottom,e.near,e.far);break;case"AmbientLight":o=new $r(e.color,e.intensity);break;case"DirectionalLight":o=new Jr(e.color,e.intensity);break;case"PointLight":o=new Kr(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":o=new tn(e.color,e.intensity,e.width,e.height);break;case"SpotLight":o=new Zr(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new qr(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var s=i(e.geometry),u=a(e.material);o=s.bones&&s.bones.length>0?new De(s,u):new Gt(s,u);break;case"LOD":o=new Ce;break;case"Line":o=new Ue(i(e.geometry),a(e.material),e.mode);break;case"LineLoop":o=new Be(i(e.geometry),a(e.material));break;case"LineSegments":o=new Fe(i(e.geometry),a(e.material));break;case"PointCloud":case"Points":o=new Ge(i(e.geometry),a(e.material));break;case"Sprite":o=new Re(a(e.material));break;case"Group":o=new je;break;default:o=new dt}if(o.uuid=e.uuid,void 0!==e.name&&(o.name=e.name),void 0!==e.matrix?(t.fromArray(e.matrix),t.decompose(o.position,o.quaternion,o.scale)):(void 0!==e.position&&o.position.fromArray(e.position),void 0!==e.rotation&&o.rotation.fromArray(e.rotation),void 0!==e.quaternion&&o.quaternion.fromArray(e.quaternion),void 0!==e.scale&&o.scale.fromArray(e.scale)),void 0!==e.castShadow&&(o.castShadow=e.castShadow),void 0!==e.receiveShadow&&(o.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(o.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(o.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&o.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(o.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(o.visible=e.visible),void 0!==e.userData&&(o.userData=e.userData),void 0!==e.children)for(var h=e.children,c=0;c<h.length;c++)o.add(this.parseObject(h[c],r,n));if("LOD"===e.type)for(var l=e.levels,d=0;d<l.length;d++){var f=l[d],p=o.getObjectByProperty("uuid",f.object);void 0!==p&&o.addLevel(p,f.distance)}return o}}()});var iu={UVMapping:yo,CubeReflectionMapping:xo,CubeRefractionMapping:_o,EquirectangularReflectionMapping:bo,EquirectangularRefractionMapping:wo,SphericalReflectionMapping:Mo,CubeUVReflectionMapping:Eo,CubeUVRefractionMapping:To},au={RepeatWrapping:So,ClampToEdgeWrapping:Ao,MirroredRepeatWrapping:Lo},ou={NearestFilter:Po,NearestMipMapNearestFilter:Ro,NearestMipMapLinearFilter:Co,LinearFilter:Oo,LinearMipMapNearestFilter:Io,LinearMipMapLinearFilter:Do};Object.assign(Cn.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t){var e=this.getUtoTmapping(t);return this.getPoint(e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],r=0;r<=t;r++)e.push(this.getPoint(r/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],r=0;r<=t;r++)e.push(this.getPointAt(r/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,r,n=[],i=this.getPoint(0),a=0;for(n.push(0),r=1;r<=t;r++)e=this.getPoint(r/t),a+=e.distanceTo(i),n.push(a),i=e;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var r,n=this.getLengths(),i=0,a=n.length;r=e||t*n[a-1];for(var o,s=0,u=a-1;s<=u;)if(i=Math.floor(s+(u-s)/2),(o=n[i]-r)<0)s=i+1;else{if(!(o>0)){u=i;break}u=i-1}if(i=u,n[i]===r)return i/(a-1);var h=n[i];return(i+(r-h)/(n[i+1]-h))/(a-1)},getTangent:function(t){var e=t-1e-4,r=t+1e-4;e<0&&(e=0),r>1&&(r=1);var n=this.getPoint(e);return this.getPoint(r).clone().sub(n).normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var r,n,i,a=new c,o=[],s=[],u=[],h=new c,d=new l;for(r=0;r<=t;r++)n=r/t,o[r]=this.getTangentAt(n),o[r].normalize();s[0]=new c,u[0]=new c;var f=Number.MAX_VALUE,p=Math.abs(o[0].x),m=Math.abs(o[0].y),v=Math.abs(o[0].z);for(p<=f&&(f=p,a.set(1,0,0)),m<=f&&(f=m,a.set(0,1,0)),v<=f&&a.set(0,0,1),h.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],h),u[0].crossVectors(o[0],s[0]),r=1;r<=t;r++)s[r]=s[r-1].clone(),u[r]=u[r-1].clone(),h.crossVectors(o[r-1],o[r]),h.length()>Number.EPSILON&&(h.normalize(),i=Math.acos(Os.clamp(o[r-1].dot(o[r]),-1,1)),s[r].applyMatrix4(d.makeRotationAxis(h,i))),u[r].crossVectors(o[r],s[r]);if(!0===e)for(i=Math.acos(Os.clamp(s[0].dot(s[t]),-1,1)),i/=t,o[0].dot(h.crossVectors(s[0],s[t]))>0&&(i=-i),r=1;r<=t;r++)s[r].applyMatrix4(d.makeRotationAxis(o[r],i*r)),u[r].crossVectors(o[r],s[r]);return{tangents:o,normals:s,binormals:u}}}),On.prototype=Object.create(Cn.prototype),On.prototype.constructor=On,On.prototype.isLineCurve=!0,On.prototype.getPoint=function(t){if(1===t)return this.v2.clone();var e=this.v2.clone().sub(this.v1);return e.multiplyScalar(t).add(this.v1),e},On.prototype.getPointAt=function(t){return this.getPoint(t)},On.prototype.getTangent=function(t){return this.v2.clone().sub(this.v1).normalize()},In.prototype=Object.assign(Object.create(Cn.prototype),{constructor:In,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new On(e,t))},getPoint:function(t){for(var e=t*this.getLength(),r=this.getCurveLengths(),n=0;n<r.length;){if(r[n]>=e){var i=r[n]-e,a=this.curves[n],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}n++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,r=0,n=this.curves.length;r<n;r++)e+=this.curves[r].getLength(),t.push(e);return this.cacheLengths=t,t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],r=0;r<=t;r++)e.push(this.getPoint(r/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,r=[],n=0,i=this.curves;n<i.length;n++)for(var a=i[n],o=a&&a.isEllipseCurve?2*t:a&&a.isLineCurve?1:a&&a.isSplineCurve?t*a.points.length:t,s=a.getPoints(o),u=0;u<s.length;u++){var h=s[u];e&&e.equals(h)||(r.push(h),e=h)}return this.autoClose&&r.length>1&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r},createPointsGeometry:function(t){var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){for(var e=new yt,r=0,n=t.length;r<n;r++){var i=t[r];e.vertices.push(new c(i.x,i.y,i.z||0))}return e}}),Dn.prototype=Object.create(Cn.prototype),Dn.prototype.constructor=Dn,Dn.prototype.isEllipseCurve=!0,Dn.prototype.getPoint=function(t){for(var e=2*Math.PI,r=this.aEndAngle-this.aStartAngle,n=Math.abs(r)<Number.EPSILON;r<0;)r+=e;for(;r>e;)r-=e;r<Number.EPSILON&&(r=n?0:e),!0!==this.aClockwise||n||(r===e?r=-e:r-=e);var a=this.aStartAngle+t*r,o=this.aX+this.xRadius*Math.cos(a),s=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var u=Math.cos(this.aRotation),h=Math.sin(this.aRotation),c=o-this.aX,l=s-this.aY;o=c*u-l*h+this.aX,s=c*h+l*u+this.aY}return new i(o,s)},Nn.prototype=Object.create(Cn.prototype),Nn.prototype.constructor=Nn,Nn.prototype.isSplineCurve=!0,Nn.prototype.getPoint=function(t){var e=this.points,r=(e.length-1)*t,n=Math.floor(r),a=r-n,o=e[0===n?n:n-1],s=e[n],u=e[n>e.length-2?e.length-1:n+1],h=e[n>e.length-3?e.length-1:n+2];return new i(bn(a,o.x,s.x,u.x,h.x),bn(a,o.y,s.y,u.y,h.y))},Un.prototype=Object.create(Cn.prototype),Un.prototype.constructor=Un,Un.prototype.getPoint=function(t){var e=this.v0,r=this.v1,n=this.v2,a=this.v3;return new i(Rn(t,e.x,r.x,n.x,a.x),Rn(t,e.y,r.y,n.y,a.y))},Fn.prototype=Object.create(Cn.prototype),Fn.prototype.constructor=Fn,Fn.prototype.getPoint=function(t){var e=this.v0,r=this.v1,n=this.v2;return new i(Tn(t,e.x,r.x,n.x),Tn(t,e.y,r.y,n.y))};var su=Object.assign(Object.create(In.prototype),{fromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,r=t.length;e<r;e++)this.lineTo(t[e].x,t[e].y)},moveTo:function(t,e){this.currentPoint.set(t,e)},lineTo:function(t,e){var r=new On(this.currentPoint.clone(),new i(t,e));this.curves.push(r),this.currentPoint.set(t,e)},quadraticCurveTo:function(t,e,r,n){var a=new Fn(this.currentPoint.clone(),new i(t,e),new i(r,n));this.curves.push(a),this.currentPoint.set(r,n)},bezierCurveTo:function(t,e,r,n,a,o){var s=new Un(this.currentPoint.clone(),new i(t,e),new i(r,n),new i(a,o));this.curves.push(s),this.currentPoint.set(a,o)},splineThru:function(t){var e=[this.currentPoint.clone()].concat(t),r=new Nn(e);this.curves.push(r),this.currentPoint.copy(t[t.length-1])},arc:function(t,e,r,n,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;this.absarc(t+o,e+s,r,n,i,a)},absarc:function(t,e,r,n,i,a){this.absellipse(t,e,r,r,n,i,a)},ellipse:function(t,e,r,n,i,a,o,s){var u=this.currentPoint.x,h=this.currentPoint.y;this.absellipse(t+u,e+h,r,n,i,a,o,s)},absellipse:function(t,e,r,n,i,a,o,s){var u=new Dn(t,e,r,n,i,a,o,s);if(this.curves.length>0){var h=u.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(u);var c=u.getPoint(1);this.currentPoint.copy(c)}});Bn.prototype=su,su.constructor=Bn,zn.prototype=Object.assign(Object.create(su),{constructor:zn,getPointsHoles:function(t){for(var e=[],r=0,n=this.holes.length;r<n;r++)e[r]=this.holes[r].getPoints(t);return e},extractAllPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},extractPoints:function(t){return this.extractAllPoints(t)}}),Object.assign(Gn.prototype,{moveTo:function(t,e){this.currentPath=new Bn,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e)},lineTo:function(t,e){this.currentPath.lineTo(t,e)},quadraticCurveTo:function(t,e,r,n){this.currentPath.quadraticCurveTo(t,e,r,n)},bezierCurveTo:function(t,e,r,n,i,a){this.currentPath.bezierCurveTo(t,e,r,n,i,a)},splineThru:function(t){this.currentPath.splineThru(t)},toShapes:function(t,e){function r(t){for(var e=[],r=0,n=t.length;r<n;r++){var i=t[r],a=new zn;a.curves=i.curves,e.push(a)}return e}var n=Ks.isClockWise,i=this.subPaths;if(0===i.length)return[];if(!0===e)return r(i);var a,o,s,u=[];if(1===i.length)return o=i[0],s=new zn,s.curves=o.curves,u.push(s),u;var h=!n(i[0].getPoints());h=t?!h:h;var c,l=[],d=[],f=[],p=0;d[p]=void 0,f[p]=[];for(var m=0,v=i.length;m<v;m++)o=i[m],c=o.getPoints(),a=n(c),a=t?!a:a,a?(!h&&d[p]&&p++,d[p]={s:new zn,p:c},d[p].s.curves=o.curves,h&&p++,f[p]=[]):f[p].push({h:o,p:c[0]});if(!d[0])return r(i);if(d.length>1){for(var g=!1,y=[],x=0,_=d.length;x<_;x++)l[x]=[];for(var x=0,_=d.length;x<_;x++)for(var b=f[x],w=0;w<b.length;w++){for(var M=b[w],E=!0,T=0;T<d.length;T++)(function(t,e){for(var r=e.length,n=!1,i=r-1,a=0;a<r;i=a++){var o=e[i],s=e[a],u=s.x-o.x,h=s.y-o.y;if(Math.abs(h)>Number.EPSILON){if(h<0&&(o=e[a],u=-u,s=e[i],h=-h),t.y<o.y||t.y>s.y)continue;if(t.y===o.y){if(t.x===o.x)return!0}else{var c=h*(t.x-o.x)-u*(t.y-o.y);if(0===c)return!0;if(c<0)continue;n=!n}}else{if(t.y!==o.y)continue;if(s.x<=t.x&&t.x<=o.x||o.x<=t.x&&t.x<=s.x)return!0}}return n})(M.p,d[T].p)&&(x!==T&&y.push({froms:x,tos:T,hole:w}),E?(E=!1,l[T].push(M)):g=!0);E&&l[x].push(M)}y.length>0&&(g||(f=l))}for(var S,m=0,A=d.length;m<A;m++){s=d[m].s,u.push(s),S=f[m];for(var L=0,P=S.length;L<P;L++)s.holes.push(S[L].h)}return u}}),Object.assign(jn.prototype,{isFont:!0,generateShapes:function(t,e,r){function n(t,e,n,a){var o=i.glyphs[t]||i.glyphs["?"];if(o){var s,u,h,c,l,d,f,p,m,v,g,y=new Gn,x=[];if(o.o)for(var _=o._cachedOutline||(o._cachedOutline=o.o.split(" ")),b=0,w=_.length;b<w;){var M=_[b++];switch(M){case"m":s=_[b++]*e+n,u=_[b++]*e+a,y.moveTo(s,u);break;case"l":s=_[b++]*e+n,u=_[b++]*e+a,y.lineTo(s,u);break;case"q":if(h=_[b++]*e+n,c=_[b++]*e+a,f=_[b++]*e+n,p=_[b++]*e+a,y.quadraticCurveTo(f,p,h,c),g=x[x.length-1]){l=g.x,d=g.y;for(var E=1;E<=r;E++){var T=E/r;Tn(T,l,f,h),Tn(T,d,p,c)}}break;case"b":if(h=_[b++]*e+n,c=_[b++]*e+a,f=_[b++]*e+n,p=_[b++]*e+a,m=_[b++]*e+n,v=_[b++]*e+a,y.bezierCurveTo(f,p,m,v,h,c),g=x[x.length-1]){l=g.x,d=g.y;for(var E=1;E<=r;E++){var T=E/r;Rn(T,l,f,m,h),Rn(T,d,p,v,c)}}}}return{offsetX:o.ha*e,path:y}}}void 0===e&&(e=100),void 0===r&&(r=4);for(var i=this.data,a=function(t){for(var r=String(t).split(""),a=e/i.resolution,o=(i.boundingBox.yMax-i.boundingBox.yMin+i.underlineThickness)*a,s=0,u=0,h=[],c=0;c<r.length;c++){var l=r[c];if("\n"===l)s=0,u-=o;else{var d=n(l,a,s,u);s+=d.offsetX,h.push(d.path)}}return h}(t),o=[],s=0,u=a.length;s<u;s++)Array.prototype.push.apply(o,a[s].toShapes());return o}}),Object.assign(Vn.prototype,{load:function(t,e,r,n){var i=this;new zr(this.manager).load(t,function(t){var r;try{r=JSON.parse(t)}catch(e){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),r=JSON.parse(t.substring(65,t.length-2))}var n=i.parse(r);e&&e(n)},r,n)},parse:function(t){return new jn(t)}});var uu,hu={getContext:function(){return void 0===uu&&(uu=new(window.AudioContext||window.webkitAudioContext)),uu},setContext:function(t){uu=t}};Object.assign(kn.prototype,{load:function(t,e,r,n){var i=new zr(this.manager);i.setResponseType("arraybuffer"),i.load(t,function(t){hu.getContext().decodeAudioData(t,function(t){e(t)})},r,n)}}),Object.assign(Hn.prototype,{update:function(){var t,e,r,n,i,a,o,s,u=new l,h=new l;return function(c){if(t!==this||e!==c.focus||r!==c.fov||n!==c.aspect*this.aspect||i!==c.near||a!==c.far||o!==c.zoom||s!==this.eyeSep){t=this,e=c.focus,r=c.fov,n=c.aspect*this.aspect,i=c.near,a=c.far,o=c.zoom;var l=c.projectionMatrix.clone();s=this.eyeSep/2;var d,f,p=s*i/e,m=i*Math.tan(Os.DEG2RAD*r*.5)/o;h.elements[12]=-s,u.elements[12]=s,d=-m*n+p,f=m*n+p,l.elements[0]=2*i/(f-d),l.elements[8]=(f+d)/(f-d),this.cameraL.projectionMatrix.copy(l),d=-m*n-p,f=m*n-p,l.elements[0]=2*i/(f-d),l.elements[8]=(f+d)/(f-d),this.cameraR.projectionMatrix.copy(l)}this.cameraL.matrixWorld.copy(c.matrixWorld).multiply(h),this.cameraR.matrixWorld.copy(c.matrixWorld).multiply(u)}}()}),Wn.prototype=Object.create(dt.prototype),Wn.prototype.constructor=Wn,qn.prototype=Object.assign(Object.create(dt.prototype),{constructor:qn,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},getFilter:function(){return this.filter},setFilter:function(t){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){this.gain.gain.value=t},updateMatrixWorld:function(){var t=new c,e=new h,r=new c,n=new c;return function(i){dt.prototype.updateMatrixWorld.call(this,i);var a=this.context.listener,o=this.up;this.matrixWorld.decompose(t,e,r),n.set(0,0,-1).applyQuaternion(e),a.positionX?(a.positionX.setValueAtTime(t.x,this.context.currentTime),a.positionY.setValueAtTime(t.y,this.context.currentTime),a.positionZ.setValueAtTime(t.z,this.context.currentTime),a.forwardX.setValueAtTime(n.x,this.context.currentTime),a.forwardY.setValueAtTime(n.y,this.context.currentTime),a.forwardZ.setValueAtTime(n.z,this.context.currentTime),a.upX.setValueAtTime(o.x,this.context.currentTime),a.upY.setValueAtTime(o.y,this.context.currentTime),a.upZ.setValueAtTime(o.z,this.context.currentTime)):(a.setPosition(t.x,t.y,t.z),a.setOrientation(n.x,n.y,n.z,o.x,o.y,o.z))}}()}),Xn.prototype=Object.assign(Object.create(dt.prototype),{constructor:Xn,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.onended=this.onEnded.bind(this),t.playbackRate.setValueAtTime(this.playbackRate,this.startTime),t.start(0,this.startTime),this.isPlaying=!0,this.source=t,this.connect()},pause:function(){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),this.startTime=this.context.currentTime,this.isPlaying=!1,this)},stop:function(){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),this.startTime=0,this.isPlaying=!1,this)},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t||(t=[]),!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this)},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(t){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this)},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.value=t,this}}),Yn.prototype=Object.assign(Object.create(Xn.prototype),{constructor:Yn,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){this.panner.refDistance=t},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){this.panner.rolloffFactor=t},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){this.panner.distanceModel=t},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){this.panner.maxDistance=t},updateMatrixWorld:function(){var t=new c;return function(e){dt.prototype.updateMatrixWorld.call(this,e),t.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(t.x,t.y,t.z)}}()}),Object.assign(Zn.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),r=0;r<e.length;r++)t+=e[r];return t/e.length}}),Object.assign(Kn.prototype,{accumulate:function(t,e){var r=this.buffer,n=this.valueSize,i=t*n+n,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==n;++o)r[i+o]=r[o];a=e}else{a+=e;var s=e/a;this._mixBufferRegion(r,i,0,s,n)}this.cumulativeWeight=a},apply:function(t){var e=this.valueSize,r=this.buffer,n=t*e+e,i=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,i<1){var o=3*e;this._mixBufferRegion(r,n,o,1-i,e)}for(var s=e,u=e+e;s!==u;++s)if(r[s]!==r[s+e]){a.setValue(r,n);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,r=this.valueSize,n=3*r;t.getValue(e,n);for(var i=r,a=n;i!==a;++i)e[i]=e[n+i%r];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,r,n,i){if(n>=.5)for(var a=0;a!==i;++a)t[e+a]=t[r+a]},_slerp:function(t,e,r,n){h.slerpFlat(t,e,t,e,t,r,n)},_lerp:function(t,e,r,n,i){for(var a=1-n,o=0;o!==i;++o){var s=e+o;t[s]=t[s]*a+t[r+o]*n}}}),Object.assign(Qn.prototype,{getValue:function(t,e){this.bind();var r=this._targetGroup.nCachedObjects_,n=this._bindings[r];void 0!==n&&n.getValue(t,e)},setValue:function(t,e){for(var r=this._bindings,n=this._targetGroup.nCachedObjects_,i=r.length;n!==i;++n)r[n].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,r=t.length;e!==r;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,r=t.length;e!==r;++e)t[e].unbind()}}),Object.assign(Jn,{Composite:Qn,create:function(t,e,r){return t&&t.isAnimationObjectGroup?new Jn.Composite(t,e,r):new Jn(t,e,r)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(/[^\w-]/g,"")},parseTrackName:function(){var t=/((?:[\w-]+[\/:])*)/,e=/([\w-\.]+)?/,r=/(?:\.([\w-]+)(?:\[(.+)\])?)?/,n=/\.([\w-]+)(?:\[(.+)\])?/,i=new RegExp("^"+t.source+e.source+r.source+n.source+"$"),a=["material","materials","bones"];return function(t){var e=i.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var r={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},n=r.nodeName&&r.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){var o=r.nodeName.substring(n+1);-1!==a.indexOf(o)&&(r.nodeName=r.nodeName.substring(0,n),r.objectName=o)}if(null===r.propertyName||0===r.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return r}}(),findNode:function(t,e){if(!e||""===e||"root"===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var r=function(t){for(var r=0;r<t.bones.length;r++){var n=t.bones[r];if(n.name===e)return n}return null}(t.skeleton);if(r)return r}if(t.children){var n=function(t){for(var r=0;r<t.length;r++){var i=t[r];if(i.name===e||i.uuid===e)return i;var a=n(i.children);if(a)return a}return null},i=n(t.children);if(i)return i}return null}}),Object.assign(Jn.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)t[e++]=r[n]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.node[this.propertyName]=t[e]},function(t,e){this.node[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.node[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)r[n]=t[e++]},function(t,e){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)r[n]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var r=this.resolvedProperty,n=0,i=r.length;n!==i;++n)r[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,r=e.objectName,n=e.propertyName,i=e.propertyIndex;if(t||(t=Jn.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(r){var a=e.objectIndex;switch(r){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var o=0;o<t.length;o++)if(t[o].name===a){a=o;break}break;default:if(void 0===t[r])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[r]}if(void 0!==a){if(void 0===t[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[a]}}var s=t[n];if(void 0===s){var u=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+n+" but it wasn't found.",t)}var h=this.Versioning.None;void 0!==t.needsUpdate?(h=this.Versioning.NeedsUpdate,this.targetObject=t):void 0!==t.matrixWorldNeedsUpdate&&(h=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=t);var c=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===n){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(t.geometry.isBufferGeometry){if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(var o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(t.geometry.morphAttributes.position[o].name===i){i=o;break}}else{if(!t.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(var o=0;o<this.node.geometry.morphTargets.length;o++)if(t.geometry.morphTargets[o].name===i){i=o;break}}}c=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(c=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=n;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][h]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),
//!\ DECLARE ALIAS AFTER assign prototype !
Object.assign(Jn.prototype,{_getValue_unbound:Jn.prototype.getValue,_setValue_unbound:Jn.prototype.setValue}),Object.assign($n.prototype,{isAnimationObjectGroup:!0,add:function(t){for(var e=this._objects,r=e.length,n=this.nCachedObjects_,i=this._indicesByUUID,a=this._paths,o=this._parsedPaths,s=this._bindings,u=s.length,h=0,c=arguments.length;h!==c;++h){var l=arguments[h],d=l.uuid,f=i[d],p=void 0;if(void 0===f){f=r++,i[d]=f,e.push(l);for(var m=0,v=u;m!==v;++m)s[m].push(new Jn(l,a[m],o[m]))}else if(f<n){p=e[f];var g=--n,y=e[g];i[y.uuid]=f,e[f]=y,i[d]=g,e[g]=l;for(var m=0,v=u;m!==v;++m){var x=s[m],_=x[g],b=x[f];x[f]=_,void 0===b&&(b=new Jn(l,a[m],o[m])),x[g]=b}}else e[f]!==p&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(t){for(var e=this._objects,r=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,a=i.length,o=0,s=arguments.length;o!==s;++o){var u=arguments[o],h=u.uuid,c=n[h];if(void 0!==c&&c>=r){var l=r++,d=e[l];n[d.uuid]=c,e[c]=d,n[h]=l,e[l]=u;for(var f=0,p=a;f!==p;++f){var m=i[f],v=m[l],g=m[c];m[c]=v,m[l]=g}}}this.nCachedObjects_=r},uncache:function(t){for(var e=this._objects,r=e.length,n=this.nCachedObjects_,i=this._indicesByUUID,a=this._bindings,o=a.length,s=0,u=arguments.length;s!==u;++s){var h=arguments[s],c=h.uuid,l=i[c];if(void 0!==l)if(delete i[c],l<n){var d=--n,f=e[d],p=--r,m=e[p];i[f.uuid]=l,e[l]=f,i[m.uuid]=d,e[d]=m,e.pop();for(var v=0,g=o;v!==g;++v){var y=a[v],x=y[d],_=y[p];y[l]=x,y[d]=_,y.pop()}}else{var p=--r,m=e[p];i[m.uuid]=l,e[l]=m,e.pop();for(var v=0,g=o;v!==g;++v){var y=a[v];y[l]=y[p],y.pop()}}}this.nCachedObjects_=n},subscribe_:function(t,e){var r=this._bindingsIndicesByPath,n=r[t],i=this._bindings;if(void 0!==n)return i[n];var a=this._paths,o=this._parsedPaths,s=this._objects,u=s.length,h=this.nCachedObjects_,c=new Array(u);n=i.length,r[t]=n,a.push(t),o.push(e),i.push(c);for(var l=h,d=s.length;l!==d;++l){var f=s[l];c[l]=new Jn(f,t,e)}return c},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,r=e[t];if(void 0!==r){var n=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];e[t[o]]=r,a[r]=s,a.pop(),i[r]=i[o],i.pop(),n[r]=n[o],n.pop()}}}),Object.assign(ti.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,r){if(t.fadeOut(e),this.fadeIn(e),r){var n=this._clip.duration,i=t._clip.duration,a=i/n,o=n/i;t.warp(1,a,e),this.warp(o,1,e)}return this},crossFadeTo:function(t,e,r){return t.crossFadeFrom(this,e,r)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,r){var n=this._mixer,i=n.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=n._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,u=a.sampleValues;return s[0]=i,s[1]=i+r,u[0]=t/o,u[1]=e/o,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,r,n){if(!this.enabled)return void this._updateWeight(t);var i=this._startTime;if(null!==i){var a=(t-i)*r;if(a<0||0===r)return;this._startTime=null,e=r*a}e*=this._updateTimeScale(t);var o=this._updateTime(e),s=this._updateWeight(t);if(s>0)for(var u=this._interpolants,h=this._propertyBindings,c=0,l=u.length;c!==l;++c)u[c].evaluate(o),h[c].accumulate(n,s)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var r=this._weightInterpolant;if(null!==r){var n=r.evaluate(t)[0];e*=n,t>r.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var r=this._timeScaleInterpolant;if(null!==r){e*=r.evaluate(t)[0],t>r.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t;if(0===t)return e;var r=this._clip.duration,n=this.loop,i=this._loopCount;if(n===cs){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=r)e=r;else{if(!(e<0))break t;e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{var a=n===ds;if(-1===i&&(t>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),e>=r||e<0){var o=Math.floor(e/r);e-=r*o,i+=Math.abs(o);var s=this.repetitions-i;if(s<0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?r:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(0===s){var u=t<0;this._setEndings(u,!u,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}if(a&&1==(1&i))return this.time=e,r-e}return this.time=e,e},_setEndings:function(t,e,r){var n=this._interpolantSettings;r?(n.endingStart=gs,n.endingEnd=gs):(n.endingStart=t?this.zeroSlopeAtStart?gs:vs:ys,n.endingEnd=e?this.zeroSlopeAtEnd?gs:vs:ys)},_scheduleFading:function(t,e,r){var n=this._mixer,i=n.time,a=this._weightInterpolant;null===a&&(a=n._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=e,o[1]=i+t,s[1]=r,this}}),Object.assign(ei.prototype,n.prototype,{_bindAction:function(t,e){var r=t._localRoot||this._root,n=t._clip.tracks,i=n.length,a=t._propertyBindings,o=t._interpolants,s=r.uuid,u=this._bindingsByRootAndName,h=u[s];void 0===h&&(h={},u[s]=h);for(var c=0;c!==i;++c){var l=n[c],d=l.name,f=h[d];if(void 0!==f)a[c]=f;else{if(void 0!==(f=a[c])){null===f._cacheIndex&&(++f.referenceCount,this._addInactiveBinding(f,s,d));continue}var p=e&&e._propertyBindings[c].binding.parsedPath;f=new Kn(Jn.create(r,d,p),l.ValueTypeName,l.getValueSize()),++f.referenceCount,this._addInactiveBinding(f,s,d),a[c]=f}o[c].resultBuffer=f.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,r=t._clip.uuid,n=this._actionsByClip[r];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,r,e)}for(var i=t._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,r=0,n=e.length;r!==n;++r){var i=e[r];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,r){var n=this._actions,i=this._actionsByClip,a=i[e];if(void 0===a)a={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,i[e]=a;else{var o=a.knownActions;t._byClipCacheIndex=o.length,o.push(t)}t._cacheIndex=n.length,n.push(t),a.actionByRoot[r]=t},_removeInactiveAction:function(t){var e=this._actions,r=e[e.length-1],n=t._cacheIndex;r._cacheIndex=n,e[n]=r,e.pop(),t._cacheIndex=null;var i=t._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,u=s[s.length-1],h=t._byClipCacheIndex;u._byClipCacheIndex=h,s[h]=u,s.pop(),t._byClipCacheIndex=null,delete o.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,r=0,n=e.length;r!==n;++r){var i=e[r];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(t){var e=this._actions,r=t._cacheIndex,n=this._nActiveActions++,i=e[n];t._cacheIndex=n,e[n]=t,i._cacheIndex=r,e[r]=i},_takeBackAction:function(t){var e=this._actions,r=t._cacheIndex,n=--this._nActiveActions,i=e[n];t._cacheIndex=n,e[n]=t,i._cacheIndex=r,e[r]=i},_addInactiveBinding:function(t,e,r){var n=this._bindingsByRootAndName,i=n[e],a=this._bindings;void 0===i&&(i={},n[e]=i),i[r]=t,t._cacheIndex=a.length,a.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,r=t.binding,n=r.rootNode.uuid,i=r.path,a=this._bindingsByRootAndName,o=a[n],s=e[e.length-1],u=t._cacheIndex;s._cacheIndex=u,e[u]=s,e.pop(),delete o[i];t:{for(var h in o)break t;delete a[n]}},_lendBinding:function(t){var e=this._bindings,r=t._cacheIndex,n=this._nActiveBindings++,i=e[n];t._cacheIndex=n,e[n]=t,i._cacheIndex=r,e[r]=i},_takeBackBinding:function(t){var e=this._bindings,r=t._cacheIndex,n=--this._nActiveBindings,i=e[n];t._cacheIndex=n,e[n]=t,i._cacheIndex=r,e[r]=i},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,r=t[e];return void 0===r&&(r=new nn(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),r.__cacheIndex=e,t[e]=r),r},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,r=t.__cacheIndex,n=--this._nActiveControlInterpolants,i=e[n];t.__cacheIndex=n,e[n]=t,i.__cacheIndex=r,e[r]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e){var r=e||this._root,n=r.uuid,i="string"==typeof t?mn.findByName(r,t):t,a=null!==i?i.uuid:t,o=this._actionsByClip[a],s=null;if(void 0!==o){var u=o.actionByRoot[n];if(void 0!==u)return u;s=o.knownActions[0],null===i&&(i=s._clip)}if(null===i)return null;var h=new ti(this,i,e);return this._bindAction(h,s),this._addInactiveAction(h,a,n),h},existingAction:function(t,e){var r=e||this._root,n=r.uuid,i="string"==typeof t?mn.findByName(r,t):t,a=i?i.uuid:t,o=this._actionsByClip[a];return void 0!==o?o.actionByRoot[n]||null:null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,r=this._bindings,n=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var i=0;i!==e;++i)t[i].reset();for(var i=0;i!==n;++i)r[i].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,r=this._nActiveActions,n=this.time+=t,i=Math.sign(t),a=this._accuIndex^=1,o=0;o!==r;++o){e[o]._update(n,t,i,a)}for(var s=this._bindings,u=this._nActiveBindings,o=0;o!==u;++o)s[o].apply(a);return this},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,r=t.uuid,n=this._actionsByClip,i=n[r];if(void 0!==i){for(var a=i.knownActions,o=0,s=a.length;o!==s;++o){var u=a[o];this._deactivateAction(u);var h=u._cacheIndex,c=e[e.length-1];u._cacheIndex=null,u._byClipCacheIndex=null,c._cacheIndex=h,e[h]=c,e.pop(),this._removeInactiveBindingsForAction(u)}delete n[r]}},uncacheRoot:function(t){var e=t.uuid,r=this._actionsByClip;for(var n in r){var i=r[n].actionByRoot,a=i[e];void 0!==a&&(this._deactivateAction(a),this._removeInactiveAction(a))}var o=this._bindingsByRootAndName,s=o[e];if(void 0!==s)for(var u in s){var h=s[u];h.restoreOriginalState(),this._removeInactiveBinding(h)}},uncacheAction:function(t,e){var r=this.existingAction(t,e);null!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}}),ri.prototype.clone=function(){return new ri(void 0===this.value.clone?this.value:this.value.clone())},ni.prototype=Object.assign(Object.create(Ct.prototype),{constructor:ni,isInstancedBufferGeometry:!0,addGroup:function(t,e,r){this.groups.push({start:t,count:e,materialIndex:r})},copy:function(t){var e=t.index;null!==e&&this.setIndex(e.clone());var r=t.attributes;for(var n in r){var i=r[n];this.addAttribute(n,i.clone())}for(var a=t.groups,o=0,s=a.length;o<s;o++){var u=a[o];this.addGroup(u.start,u.count,u.materialIndex)}return this}}),Object.defineProperties(ii.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(ii.prototype,{isInterleavedBufferAttribute:!0,setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=r,this},setXYZ:function(t,e,r,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=r,this.data.array[t+2]=n,this},setXYZW:function(t,e,r,n,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=r,this.data.array[t+2]=n,this.data.array[t+3]=i,this}}),Object.defineProperty(ai.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(ai.prototype,{isInterleavedBuffer:!0,setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==t?t.length/this.stride:0,this.array=t},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.dynamic=t.dynamic,this},copyAt:function(t,e,r){t*=this.stride,r*=e.stride;for(var n=0,i=this.stride;n<i;n++)this.array[t+n]=e.array[r+n];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}}),oi.prototype=Object.assign(Object.create(ai.prototype),{constructor:oi,isInstancedInterleavedBuffer:!0,copy:function(t){return ai.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),si.prototype=Object.assign(Object.create(xt.prototype),{constructor:si,isInstancedBufferAttribute:!0,copy:function(t){return xt.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(ui.prototype,{linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize()):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e){var r=[];return ci(t,this,r,e),r.sort(hi),r},intersectObjects:function(t,e){var r=[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var n=0,i=t.length;n<i;n++)ci(t[n],this,r,e);return r.sort(hi),r}}),Object.assign(li.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}),Object.assign(di.prototype,{set:function(t,e,r){return this.radius=t,this.phi=e,this.theta=r,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.radius=t.length(),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t.x,t.z),this.phi=Math.acos(Os.clamp(t.y/this.radius,-1,1))),this}}),Object.assign(fi.prototype,{set:function(t,e,r){return this.radius=t,this.theta=e,this.y=r,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.radius=Math.sqrt(t.x*t.x+t.z*t.z),this.theta=Math.atan2(t.x,t.z),this.y=t.y,this}}),pi.prototype=Object.create(dt.prototype),pi.prototype.constructor=pi,pi.prototype.isImmediateRenderObject=!0,mi.prototype=Object.create(Fe.prototype),mi.prototype.constructor=mi,mi.prototype.update=function(){var t=new c,e=new c,r=new at;return function(){var n=["a","b","c"];this.object.updateMatrixWorld(!0),r.getNormalMatrix(this.object.matrixWorld);var i=this.object.matrixWorld,a=this.geometry.attributes.position,o=this.object.geometry;if(o&&o.isGeometry)for(var s=o.vertices,u=o.faces,h=0,c=0,l=u.length;c<l;c++)for(var d=u[c],f=0,p=d.vertexNormals.length;f<p;f++){var m=s[d[n[f]]],v=d.vertexNormals[f];t.copy(m).applyMatrix4(i),e.copy(v).applyMatrix3(r).normalize().multiplyScalar(this.size).add(t),a.setXYZ(h,t.x,t.y,t.z),h+=1,a.setXYZ(h,e.x,e.y,e.z),h+=1}else if(o&&o.isBufferGeometry)for(var g=o.attributes.position,y=o.attributes.normal,h=0,f=0,p=g.count;f<p;f++)t.set(g.getX(f),g.getY(f),g.getZ(f)).applyMatrix4(i),e.set(y.getX(f),y.getY(f),y.getZ(f)),e.applyMatrix3(r).normalize().multiplyScalar(this.size).add(t),a.setXYZ(h,t.x,t.y,t.z),h+=1,a.setXYZ(h,e.x,e.y,e.z),h+=1;a.needsUpdate=!0}}(),vi.prototype=Object.create(dt.prototype),vi.prototype.constructor=vi,vi.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},vi.prototype.update=function(){var t=new c,e=new c;return function(){this.light.updateMatrixWorld();var r=this.light.distance?this.light.distance:1e3,n=r*Math.tan(this.light.angle);this.cone.scale.set(n,n,r),t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(e.sub(t)),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}(),yi.prototype=Object.create(Fe.prototype),yi.prototype.constructor=yi,yi.prototype.onBeforeRender=function(){var t=new c,e=new l,r=new l;return function(){var n=this.bones,i=this.geometry,a=i.getAttribute("position");r.getInverse(this.root.matrixWorld);for(var o=0,s=0;o<n.length;o++){var u=n[o];u.parent&&u.parent.isBone&&(e.multiplyMatrices(r,u.matrixWorld),t.setFromMatrixPosition(e),a.setXYZ(s,t.x,t.y,t.z),e.multiplyMatrices(r,u.parent.matrixWorld),t.setFromMatrixPosition(e),a.setXYZ(s+1,t.x,t.y,t.z),s+=2)}i.getAttribute("position").needsUpdate=!0}}(),xi.prototype=Object.create(Gt.prototype),xi.prototype.constructor=xi,xi.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},xi.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},_i.prototype=Object.create(dt.prototype),_i.prototype.constructor=_i,_i.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},_i.prototype.update=function(){var t=.5*this.light.width,e=.5*this.light.height,r=this.line.geometry.attributes.position,n=r.array;n[0]=t,n[1]=-e,n[2]=0,n[3]=t,n[4]=e,n[5]=0,n[6]=-t,n[7]=e,n[8]=0,n[9]=-t,n[10]=-e,n[11]=0,n[12]=t,n[13]=-e,n[14]=0,r.needsUpdate=!0,void 0!==this.color?this.line.material.color.set(this.color):this.line.material.color.copy(this.light.color)},bi.prototype=Object.create(dt.prototype),bi.prototype.constructor=bi,bi.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},bi.prototype.update=function(){var t=new c,e=new Y,r=new Y;return function(){var n=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var i=n.geometry.getAttribute("color");e.copy(this.light.color),r.copy(this.light.groundColor);for(var a=0,o=i.count;a<o;a++){var s=a<o/2?e:r;i.setXYZ(a,s.r,s.g,s.b)}i.needsUpdate=!0}n.lookAt(t.setFromMatrixPosition(this.light.matrixWorld).negate())}}(),wi.prototype=Object.create(Fe.prototype),wi.prototype.constructor=wi,Mi.prototype=Object.create(Fe.prototype),Mi.prototype.constructor=Mi,Ei.prototype=Object.create(Fe.prototype),Ei.prototype.constructor=Ei,Ei.prototype.update=function(){var t=new c,e=new c,r=new at;return function(){this.object.updateMatrixWorld(!0),r.getNormalMatrix(this.object.matrixWorld);for(var n=this.object.matrixWorld,i=this.geometry.attributes.position,a=this.object.geometry,o=a.vertices,s=a.faces,u=0,h=0,c=s.length;h<c;h++){var l=s[h],d=l.normal;t.copy(o[l.a]).add(o[l.b]).add(o[l.c]).divideScalar(3).applyMatrix4(n),e.copy(d).applyMatrix3(r).normalize().multiplyScalar(this.size).add(t),i.setXYZ(u,t.x,t.y,t.z),u+=1,i.setXYZ(u,e.x,e.y,e.z),u+=1}i.needsUpdate=!0}}(),Ti.prototype=Object.create(dt.prototype),Ti.prototype.constructor=Ti,Ti.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Ti.prototype.update=function(){var t=new c,e=new c,r=new c;return function(){t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),r.subVectors(e,t),this.lightPlane.lookAt(r),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(r),this.targetLine.scale.z=r.length()}}(),Si.prototype=Object.create(Fe.prototype),Si.prototype.constructor=Si,Si.prototype.update=function(){function t(t,a,o,s){n.set(a,o,s).unproject(i);var u=r[t];if(void 0!==u)for(var h=e.getAttribute("position"),c=0,l=u.length;c<l;c++)h.setXYZ(u[c],n.x,n.y,n.z)}var e,r,n=new c,i=new ft;return function(){e=this.geometry,r=this.pointMap;i.projectionMatrix.copy(this.camera.projectionMatrix),t("c",0,0,-1),t("t",0,0,1),t("n1",-1,-1,-1),t("n2",1,-1,-1),t("n3",-1,1,-1),t("n4",1,1,-1),t("f1",-1,-1,1),t("f2",1,-1,1),t("f3",-1,1,1),t("f4",1,1,1),t("u1",.7,1.1,-1),t("u2",-.7,1.1,-1),t("u3",0,2,-1),t("cf1",-1,0,1),t("cf2",1,0,1),t("cf3",0,-1,1),t("cf4",0,1,1),t("cn1",-1,0,-1),t("cn2",1,0,-1),t("cn3",0,-1,-1),t("cn4",0,1,-1),e.getAttribute("position").needsUpdate=!0}}(),Ai.prototype=Object.create(Fe.prototype),Ai.prototype.constructor=Ai,Ai.prototype.update=function(){var t=new nt;return function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&t.setFromObject(this.object),!t.isEmpty()){var r=t.min,n=t.max,i=this.geometry.attributes.position,a=i.array;a[0]=n.x,a[1]=n.y,a[2]=n.z,a[3]=r.x,a[4]=n.y,a[5]=n.z,a[6]=r.x,a[7]=r.y,a[8]=n.z,a[9]=n.x,a[10]=r.y,a[11]=n.z,a[12]=n.x,a[13]=n.y,a[14]=r.z,a[15]=r.x,a[16]=n.y,a[17]=r.z,a[18]=r.x,a[19]=r.y,a[20]=r.z,a[21]=n.x,a[22]=r.y,a[23]=r.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),Ai.prototype.setFromObject=function(t){return this.object=t,this.update(),this},Li.prototype=Object.create(Fe.prototype),Li.prototype.constructor=Li,Li.prototype.onBeforeRender=function(){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5))},Pi.prototype=Object.create(Ue.prototype),Pi.prototype.constructor=Pi,Pi.prototype.onBeforeRender=function(){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.lookAt(this.plane.normal),this.updateMatrixWorld()};var cu,lu;Ri.prototype=Object.create(dt.prototype),Ri.prototype.constructor=Ri,Ri.prototype.setDirection=function(){var t,e=new c;return function(r){r.y>.99999?this.quaternion.set(0,0,0,1):r.y<-.99999?this.quaternion.set(1,0,0,0):(e.set(r.z,0,-r.x).normalize(),t=Math.acos(r.y),this.quaternion.setFromAxisAngle(e,t))}}(),Ri.prototype.setLength=function(t,e,r){void 0===e&&(e=.2*t),void 0===r&&(r=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(r,e,r),this.cone.position.y=t,this.cone.updateMatrix()},Ri.prototype.setColor=function(t){this.line.material.color.copy(t),this.cone.material.color.copy(t)},Ci.prototype=Object.create(Fe.prototype),Ci.prototype.constructor=Ci;var du=new c,fu=new Oi,pu=new Oi,mu=new Oi;Ii.prototype=Object.create(Cn.prototype),Ii.prototype.constructor=Ii,Ii.prototype.getPoint=function(t){var e=this.points,r=e.length,n=(r-(this.closed?0:1))*t,i=Math.floor(n),a=n-i;this.closed?i+=i>0?0:(Math.floor(Math.abs(i)/e.length)+1)*e.length:0===a&&i===r-1&&(i=r-2,a=1);var o,s,u,h;if(this.closed||i>0?o=e[(i-1)%r]:(du.subVectors(e[0],e[1]).add(e[0]),o=du),s=e[i%r],u=e[(i+1)%r],this.closed||i+2<r?h=e[(i+2)%r]:(du.subVectors(e[r-1],e[r-2]).add(e[r-1]),h=du),void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var l="chordal"===this.type?.5:.25,d=Math.pow(o.distanceToSquared(s),l),f=Math.pow(s.distanceToSquared(u),l),p=Math.pow(u.distanceToSquared(h),l);f<1e-4&&(f=1),d<1e-4&&(d=f),p<1e-4&&(p=f),fu.initNonuniformCatmullRom(o.x,s.x,u.x,h.x,d,f,p),pu.initNonuniformCatmullRom(o.y,s.y,u.y,h.y,d,f,p),mu.initNonuniformCatmullRom(o.z,s.z,u.z,h.z,d,f,p)}else if("catmullrom"===this.type){var m=void 0!==this.tension?this.tension:.5;fu.initCatmullRom(o.x,s.x,u.x,h.x,m),pu.initCatmullRom(o.y,s.y,u.y,h.y,m),mu.initCatmullRom(o.z,s.z,u.z,h.z,m)}return new c(fu.calc(a),pu.calc(a),mu.calc(a))},Di.prototype=Object.create(Cn.prototype),Di.prototype.constructor=Di,Di.prototype.getPoint=function(t){var e=this.v0,r=this.v1,n=this.v2,i=this.v3;return new c(Rn(t,e.x,r.x,n.x,i.x),Rn(t,e.y,r.y,n.y,i.y),Rn(t,e.z,r.z,n.z,i.z))},Ni.prototype=Object.create(Cn.prototype),Ni.prototype.constructor=Ni,Ni.prototype.getPoint=function(t){var e=this.v0,r=this.v1,n=this.v2;return new c(Tn(t,e.x,r.x,n.x),Tn(t,e.y,r.y,n.y),Tn(t,e.z,r.z,n.z))},Ui.prototype=Object.create(Cn.prototype),Ui.prototype.constructor=Ui,Ui.prototype.getPoint=function(t){if(1===t)return this.v2.clone();var e=new c;return e.subVectors(this.v2,this.v1),e.multiplyScalar(t),e.add(this.v1),e},Fi.prototype=Object.create(Dn.prototype),Fi.prototype.constructor=Fi;var vu={createMultiMaterialObject:function(t,e){for(var r=new je,n=0,i=e.length;n<i;n++)r.add(new Gt(t,e[n]));return r},detach:function(t,e,r){t.applyMatrix(e.matrixWorld),e.remove(t),r.add(t)},attach:function(t,e,r){t.applyMatrix((new l).getInverse(r.matrixWorld)),e.remove(t),r.add(t)}},gu=0,yu=1;Cn.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Cn.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},ia.prototype=Object.create(Ii.prototype),aa.prototype=Object.create(Ii.prototype),oa.prototype=Object.create(Ii.prototype),Object.assign(oa.prototype,{initFromArray:function(t){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(t){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(t){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),wi.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},yi.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(Z.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(nt.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Bt.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Os.random16=function(){return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),Math.random()},Object.assign(at.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(t){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(t,e,r){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(t,e,r){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(l.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){var t;return function(){return void 0===t&&(t=new c),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),t.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(t){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(t,e,r){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(t,e,r){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,r,n,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,n,r,i,a)}}),ot.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},h.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(Ft.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(zn.prototype,{extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new cr(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new _r(this,t)}}),Object.assign(i.prototype,{fromAttribute:function(t,e,r){return console.error("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,r)}}),Object.assign(c.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,r){return console.error("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,r)}}),Object.assign(o.prototype,{fromAttribute:function(t,e,r){return console.error("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,r)}}),yt.prototype.computeTangents=function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},Object.assign(dt.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)}}),Object.defineProperties(dt.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(Ce.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Oe.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Object.defineProperty(Cn.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),mt.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Wr.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(xt.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}}}),Object.assign(Ct.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addDrawCall:function(t,e,r){void 0!==r&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}),Object.defineProperties(Ct.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(ri.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties($.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Y}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=t===La}}}),Object.defineProperties(Ir.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(tt.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(Ee.prototype,{getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}}),Object.defineProperties(Ee.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){return this.shadowMap.cullFace},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),this.shadowMap.cullFace=t}}}),Object.defineProperties(ut.prototype,{cullFace:{get:function(){return this.renderReverseSided?ya:ga},set:function(t){var e=t!==ga;console.warn("WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to "+e+"."),this.renderReverseSided=e}}}),Object.defineProperties(s.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Xn.prototype.load=function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new kn).load(t,function(t){e.setBuffer(t)}),this},Zn.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Wn.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)};var xu={merge:function(t,e,r){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var n;e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),n=e.matrix,e=e.geometry),t.merge(e,n,r)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}},_u={crossOrigin:void 0,loadTexture:function(t,e,r,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new Hr;i.setCrossOrigin(this.crossOrigin);var a=i.load(t,r,void 0,n);return e&&(a.mapping=e),a},loadTextureCube:function(t,e,r,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new kr;i.setCrossOrigin(this.crossOrigin);var a=i.load(t,r,void 0,n);return e&&(a.mapping=e),a},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")}}},function(t,e,r){t.exports={default:r(369),__esModule:!0}},function(t,e,r){"use strict";r.d(e,"h",function(){return n}),r.d(e,"i",function(){return i}),r.d(e,"l",function(){return a}),r.d(e,"k",function(){return o}),r.d(e,"e",function(){return s}),r.d(e,"b",function(){return u}),r.d(e,"m",function(){return h}),r.d(e,"n",function(){return c}),r.d(e,"o",function(){return l}),r.d(e,"a",function(){return d}),r.d(e,"g",function(){return f}),r.d(e,"j",function(){return p}),r.d(e,"f",function(){return m}),r.d(e,"d",function(){return v}),r.d(e,"c",function(){return g});var n=1,i=2,a=4,o=5,s=484813681109536e-20,u=Math.PI/2,h=.16666666666666666,c=.04722222222222222,l=.022156084656084655,d=void 0===Number.EPSILON?1e-10:Number.EPSILON,f=.017453292519943295,p=57.29577951308232,m=Math.PI/4,v=2*Math.PI,g=3.14159265359},function(t,e,r){"use strict";var n=r(3),i=r(42);e.a=function(t){return Math.abs(t)<=n.c?t:t-r.i(i.a)(t)*n.d}},function(t,e){var r=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=r)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(){return{x:6378137,y:6378137,z:6356752.314245179}}function a(t){return"degrees"===t?R.DEGREE:"m"===t?R.METER:"radians"===t?R.RADIAN:void 0}function o(t){switch(t){case"EPSG:4326":return R.DEGREE;case"EPSG:4978":return R.METER;default:var e=M.default.defs(t);if(!e)return;return a(e.units)}}function s(t){switch(t){case R.RADIAN:return 1e-5;case R.DEGREE:return.01;case R.METER:return.001;default:return 0}}function u(t){var e=o(t);if(void 0===t||void 0===e)throw new Error("Invalid crs paramater value '"+t+"'");return e}function h(t){u(t)}function c(t){return u(t)!=R.METER}function l(t){return u(t)==R.METER}function d(t){if(!c(t))throw new Error("Can't query crs "+t+" long/lat")}function f(t){if(!l(t))throw new Error("Can't query crs "+t+" x/y/z")}function p(t,e){if(L[t]){var r=L[t];if(r[e])return r[e]}else L[t]={};var n=(0,M.default)(t,e);return L[t][e]=n,n}function m(t,e,r){if(r=r||new g(e,0,0),e!==t.crs){if("EPSG:4326"===t.crs&&"EPSG:4978"===e){var n=P.cartographicToCartesian(t);return r.set(e,n)}if("EPSG:4978"===t.crs&&"EPSG:4326"===e){var i=P.cartesianToCartographic({x:t._values[0],y:t._values[1],z:t._values[2]});return r.set(e,i.longitude,i.latitude,i.h)}if(t.crs in M.default.defs&&e in M.default.defs){var a=p(t.crs,e).forward([t._values[0],t._values[1]]);return r.set(e,a[0],a[1],t._values[2])}throw new Error("Cannot convert from crs "+t.crs+" (unit="+t._internalStorageUnit+") to "+e)}var s=o(e);return t._internalStorageUnit==s?r.copy(t):t._internalStorageUnit==R.DEGREE&&s==R.RADIAN?r.set(e,T.default.degToRad(t._values[0]),T.default.degToRad(t._values[1]),t._values[2]):t._internalStorageUnit==R.RADIAN&&s==R.DEGREE?r.set(e,T.default.radToDeg(t._values[0]),T.default.radToDeg(t._values[1]),t._values[2]):void 0}function v(t,e,r){if(void 0==e||t==e)return r;if(t==R.DEGREE&&e==R.RADIAN)return T.default.degToRad(r);if(t==R.RADIAN&&e==R.DEGREE)return T.default.radToDeg(r);throw new Error("Cannot convert from unit "+t+" to "+e)}function g(t){this._values=new Float64Array(3);for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];this.set.apply(this,[t].concat(r))}Object.defineProperty(e,"__esModule",{value:!0}),e.C=e.UNIT=void 0;var y=r(28),x=n(y);e.ellipsoidSizes=i,e.crsToUnit=o,e.reasonnableEpsilonForUnit=s,e.assertCrsIsValid=h,e.crsIsGeographic=c,e.crsIsGeocentric=l,e.convertValueToUnit=v;var _=r(1),b=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(_),w=r(259),M=n(w),E=r(43),T=n(E),S=r(274),A=n(S),L={},P=new A.default(i()),R=e.UNIT={RADIAN:0,DEGREE:1,METER:2};g.prototype.set=function(t){u(t),this.crs=t;for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(1==r.length&&r[0]instanceof b.Vector3)this._values[0]=r[0].x,this._values[1]=r[0].y,this._values[2]=r[0].z;else{for(var i=0;i<r.length&&i<3;i++)this._values[i]=r[i];for(var a=r.length;a<3;a++)this._values[a]=0}return this._internalStorageUnit=o(t),this},g.prototype.clone=function(t){var e=void 0;return t?(g.call.apply(g,[t,this.crs].concat((0,x.default)(this._values))),e=t):e=new(Function.prototype.bind.apply(g,[null].concat([this.crs],(0,x.default)(this._values)))),e._internalStorageUnit=this._internalStorageUnit,e},g.prototype.copy=function(t){return this.set.apply(this,[t.crs].concat((0,x.default)(t._values))),this._internalStorageUnit=t._internalStorageUnit,this},g.prototype.longitude=function(t){return d(this.crs),v(this._internalStorageUnit,t,this._values[0])},g.prototype.latitude=function(t){return d(this.crs),v(this._internalStorageUnit,t,this._values[1])},g.prototype.altitude=function(){return d(this.crs),this._values[2]},g.prototype.setAltitude=function(t){d(this.crs),this._values[2]=t},g.prototype.x=function(){return f(this.crs),this._values[0]},g.prototype.y=function(){return f(this.crs),this._values[1]},g.prototype.z=function(){return f(this.crs),this._values[2]},g.prototype.xyz=function(t){f(this.crs);var e=t||new b.Vector3;return e.fromArray(this._values),e},g.prototype.as=function(t,e){if(void 0===t||!o(t))throw new Error("Invalid crs paramater value '"+t+"'");return m(this,t,e)},g.prototype.offsetInExtent=function(t,e){if(this.crs!=t.crs())throw new Error("unsupported mix");var r={x:Math.abs(t.east()-t.west()),y:Math.abs(t.north()-t.south())},n=t._internalStorageUnit==R.METER?this.x():this.longitude(t._internalStorageUnit),i=t._internalStorageUnit==R.METER?this.y():this.latitude(t._internalStorageUnit),a=(n-t.west())/r.x,o=(t.north()-i)/r.y;return e=e||new b.Vector2,e.set(a,o),e};e.C={EPSG_4326:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return new(Function.prototype.bind.apply(g,[null].concat(["EPSG:4326"],e)))},EPSG_4326_Radians:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=new(Function.prototype.bind.apply(g,[null].concat(["EPSG:4326"],e)));return n._internalStorageUnit=R.RADIAN,n}};e.default=g},function(t,e,r){t.exports={default:r(381),__esModule:!0}},function(t,e,r){t.exports={default:r(375),__esModule:!0}},function(t,e,r){var n=r(92)("wks"),i=r(59),a=r(11).Symbol,o="function"==typeof a;(t.exports=function(t){return n[t]||(n[t]=o&&a[t]||(o?a:i)("Symbol."+t))}).store=n},function(t,e,r){var n=r(11),i=r(5),a=r(17),o=r(18),s=function(t,e,r){var u,h,c,l=t&s.F,d=t&s.G,f=t&s.S,p=t&s.P,m=t&s.B,v=t&s.W,g=d?i:i[e]||(i[e]={}),y=g.prototype,x=d?n:f?n[e]:(n[e]||{}).prototype;d&&(r=e);for(u in r)(h=!l&&x&&void 0!==x[u])&&u in g||(c=h?x[u]:r[u],g[u]=d&&"function"!=typeof x[u]?r[u]:m&&h?a(c,n):v&&x[u]==c?function(t){var e=function(e,r,n){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,r)}return new t(e,r,n)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(c):p&&"function"==typeof c?a(Function.call,c):c,p&&((g.virtual||(g.virtual={}))[u]=c,t&s.R&&y&&!y[u]&&o(y,u,c)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,e){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t){return 0==t.indexOf("WMTS:")||"TMS"==t}function a(t){for(var e=this,r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];if(this._crs=t,i(t)){if(3!=n.length)throw new Error("Unsupported constructor args '"+n+"'");if(this._zoom=n[0],this._row=n[1],this._col=n[2],this._zoom<0)throw new Error("invlid WTMS values "+n);(0,l.default)(this,"zoom",{get:function(){return e._zoom}},{set:function(t){e._zoom=t}}),(0,l.default)(this,"row",{get:function(){return e._row}},{set:function(t){e._row=t}}),(0,l.default)(this,"col",{get:function(){return e._col}},{set:function(t){e._col=t}})}else if(this._internalStorageUnit=(0,p.crsToUnit)(t),2===n.length&&n[0]instanceof m.default&&n[1]instanceof m.default){this._values=new Float64Array(4);for(var o=0;o<n.length;o++)for(var s=0;s<2;s++)this._values[2*o+s]=n[o]._values[s]}else if(1==n.length&&void 0!=n[0].west)this._values=new Float64Array(4),this._values[v.WEST]=n[0].west,this._values[v.EAST]=n[0].east,this._values[v.SOUTH]=n[0].south,this._values[v.NORTH]=n[0].north;else{if(4!=n.length)throw new Error("Unsupported constructor args '"+n+"'");this._values=new Float64Array(4),(0,h.default)(v).forEach(function(t){var r=v[t];e._values[r]=n[r]})}}Object.defineProperty(e,"__esModule",{value:!0});var o=r(28),s=n(o),u=r(46),h=n(u),c=r(78),l=n(c),d=r(1),f=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(d),p=r(6),m=n(p),v={WEST:0,EAST:1,SOUTH:2,NORTH:3};a.prototype.clone=function(){if(i(this._crs))return new a(this._crs,this.zoom,this.row,this.col);var t=new(Function.prototype.bind.apply(a,[null].concat([this._crs],(0,s.default)(this._values))));return t._internalStorageUnit=this._internalStorageUnit,t},a.prototype.as=function(t){if((0,p.assertCrsIsValid)(t),i(this._crs))throw new Error("Unsupported yet");if(this._crs!=t){var e=[],r=this.center();e.push(new m.default(this._crs,this.west(),this.north())),e.push(new m.default(this._crs,r._values[0],this.north())),e.push(new m.default(this._crs,this.east(),this.north())),e.push(new m.default(this._crs,this.east(),r._values[1])),e.push(new m.default(this._crs,this.east(),this.south())),e.push(new m.default(this._crs,r._values[0],this.south())),e.push(new m.default(this._crs,this.west(),this.south())),e.push(new m.default(this._crs,this.west(),r._values[1]));for(var n=-1/0,o=1/0,s=-1/0,u=1/0,h=0;h<e.length;h++)e[h]=e[h].as(t),n=Math.max(n,e[h]._values[1]),o=Math.min(o,e[h]._values[1]),s=Math.max(s,e[h]._values[0]),u=Math.min(u,e[h]._values[0]);return new a(t,{north:n,south:o,east:s,west:u})}return new a(t,{west:this.west((0,p.crsToUnit)(t)),east:this.east((0,p.crsToUnit)(t)),north:this.north((0,p.crsToUnit)(t)),south:this.south((0,p.crsToUnit)(t))})},a.prototype.offsetToParent=function(t){if(this.crs()!=t.crs())throw new Error("unsupported mix");if(i(this.crs())){var e=this._zoom-t.zoom,r=Math.pow(2,e),n=1/r,a=(this._row-this._row%r)*n,o=(this._col-this._col%r)*n;return new f.Vector3(this._col*n-o,this._row*n-a,n)}var s={x:Math.abs(t.east()-t.west()),y:Math.abs(t.north()-t.south())},u=(this.west(t._internalStorageUnit)-t.west())/s.x,h=(t.north()-this.north(t._internalStorageUnit))/s.y,c=Math.abs(this.east(t._internalStorageUnit)-this.west(t._internalStorageUnit))/s.x;return new f.Vector3(u,h,c)},a.prototype.west=function(t){return(0,p.crsIsGeographic)(this.crs())?(0,p.convertValueToUnit)(this._internalStorageUnit,t,this._values[0]):this._values[v.WEST]},a.prototype.east=function(t){return(0,p.crsIsGeographic)(this.crs())?(0,p.convertValueToUnit)(this._internalStorageUnit,t,this._values[1]):this._values[v.EAST]},a.prototype.north=function(t){return(0,p.crsIsGeographic)(this.crs())?(0,p.convertValueToUnit)(this._internalStorageUnit,t,this._values[3]):this._values[v.NORTH]},a.prototype.south=function(t){return(0,p.crsIsGeographic)(this.crs())?(0,p.convertValueToUnit)(this._internalStorageUnit,t,this._values[2]):this._values[v.SOUTH]},a.prototype.crs=function(){return this._crs},a.prototype.center=function(t){if(i(this._crs))throw new Error("Invalid operation for WMTS bbox");var e=void 0;t?(m.default.call(t,this._crs,this._values[0],this._values[2]),e=t):e=new m.default(this._crs,this._values[0],this._values[2]),e._internalStorageUnit=this._internalStorageUnit;var r=this.dimensions();return e._values[0]+=.5*r.x,e._values[1]+=.5*r.y,e},a.prototype.dimensions=function(t){return{x:Math.abs(this.east(t)-this.west(t)),y:Math.abs(this.north(t)-this.south(t))}},a.prototype.isPointInside=function(t){var e=this.crs()==t.crs?t:t.as(this.crs());return(0,p.crsIsGeographic)(this.crs())?e.longitude(this._internalStorageUnit)<=this.east()&&e.longitude(this._internalStorageUnit)>=this.west()&&e.latitude(this._internalStorageUnit)<=this.north()&&e.latitude(this._internalStorageUnit)>=this.south():e.x()<=this.east()&&e.x()>=this.west()&&e.y()<=this.north()&&e.y()>=this.south()},a.prototype.isInside=function(t,e){if(i(this.crs())){if(this._zoom==t._zoom)return this._row==t._row&&this._col==t._col;if(this._zoom<t._zoom)return!1;var r=this._zoom-t._zoom,n=Math.pow(2,r),a=1/n,o=(this._row-this._row%n)*a,s=(this._col-this._col%n)*a;return o==t._row&&s==t._col}var u=t.as(this._crs);return e=void 0==e?(0,p.reasonnableEpsilonForUnit)(u._internalStorageUnit):e,this.east(u._internalStorageUnit)-u.east()<=e&&u.west()-this.west(u._internalStorageUnit)<=e&&this.north(u._internalStorageUnit)-u.north()<=e&&u.south()-this.south(u._internalStorageUnit)<=e},a.prototype.offsetScale=function(t){if(t.crs()!=this.crs())throw new Error("unsupported offscale between 2 diff crs");var e={x:Math.abs(this.east()-this.west()),y:Math.abs(this.north()-this.south())},r=(t.west(this._internalStorageUnit)-this.west())/e.x,n=(t.north(this._internalStorageUnit)-this.north())/e.y,i=Math.abs(t.east(this._internalStorageUnit)-t.west(this._internalStorageUnit))/e.x;return new f.Vector3(r,n,i)},a.prototype.intersect=function(t){var e=t.as(this.crs());return!(this.west()>=e.east(this._internalStorageUnit)||this.east()<=e.west(this._internalStorageUnit)||this.south()>=e.north(this._internalStorageUnit)||this.north()<=e.south(this._internalStorageUnit))},a.prototype.set=function(t,e,r,n){this._values[v.WEST]=t,this._values[v.EAST]=e,this._values[v.SOUTH]=r,this._values[v.NORTH]=n},a.prototype.union=function(t){if(t.crs()!=this.crs())throw new Error("unsupported union between 2 diff crs");var e=t.west(this._internalStorageUnit);e<this.west()&&(this._values[v.WEST]=e);var r=t.east(this._internalStorageUnit);r>this.east()&&(this._values[v.EAST]=r);var n=t.south(this._internalStorageUnit);n<this.south()&&(this._values[v.SOUTH]=n);var i=t.north(this._internalStorageUnit);i>this.north()&&(this._values[v.NORTH]=i)},a.prototype.expandByPoint=function(t){var e=t.as(this.crs()),r=e._internalStorageUnit,n=(0,p.convertValueToUnit)(r,this._internalStorageUnit,e._values[0]);n<this.west()&&(this._values[v.WEST]=n),n>this.east()&&(this._values[v.EAST]=n);var i=(0,p.convertValueToUnit)(r,this._internalStorageUnit,e._values[1]);i<this.south()&&(this._values[v.SOUTH]=i),i>this.north()&&(this._values[v.NORTH]=i)},e.default=a},function(t,e,r){var n=r(15),i=r(124),a=r(94),o=Object.defineProperty;e.f=r(14)?Object.defineProperty:function(t,e,r){if(n(t),e=a(e,!0),n(r),i)try{return o(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[e]=r.value),t}},function(t,e,r){t.exports=!r(22)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,r){var n=r(19);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,e,r){"use strict";function n(t){if(!t.ok){var e=new Error("Error loading "+t.url+": status "+t.status);throw e.status=t.status,e}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(7),a=function(t){return t&&t.__esModule?t:{default:t}}(i),o=r(1),s=new o.TextureLoader;e.default={json:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return fetch(t,e).then(function(t){return n(t),t.json()})},xml:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return fetch(t,e).then(function(t){return n(t),t.text()}).then(function(t){return(new window.DOMParser).parseFromString(t,"text/xml")})},texture:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=void 0,n=void 0;s.crossOrigin=e.crossOrigin;var i=new a.default(function(t,e){r=t,n=e});return{texture:s.load(t,r,function(){},n),promise:i}},arrayBuffer:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return fetch(t,e).then(function(t){return n(t),t.arrayBuffer()})}}},function(t,e,r){var n=r(80);t.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)}}return function(){return t.apply(e,arguments)}}},function(t,e,r){var n=r(13),i=r(39);t.exports=r(14)?function(t,e,r){return n.f(t,e,i(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,r){var n=r(84),i=r(53);t.exports=function(t){return n(i(t))}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){var r=new l.Vector4(P/16777216,P/65536,P/256,P);return e?r.dot(t)*e:r.dot(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.l_COLOR=e.l_ELEVATION=e.EMPTY_TEXTURE_ZOOM=void 0;var a=r(28),o=n(a),s=r(8),u=n(s),h=r(2);n(h);e.unpack1K=i;var c=r(1),l=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(c),d=r(491),f=n(d),p=r(490),m=n(p),v=r(487),g=n(v),y=r(263),x=n(y),_=r(35),b=n(_),w=e.EMPTY_TEXTURE_ZOOM=-1,M=new l.Texture;M.coords={zoom:w};var E,T=new l.Vector3(0,0,0),S=new l.Vector4(0,0,0,0),A=e.l_ELEVATION=0,L=e.l_COLOR=1,P=255/256,R=function(t){if(!E){E="vec4 colorAtIdUv(sampler2D dTextures[TEX_UNITS],vec3 offsetScale[TEX_UNITS],int id, vec2 uv){\n",E+=" if (id == 0) return texture2D(dTextures[0], pitUV(uv,offsetScale[0]));\n";for(var e=1;e<t;e++){var r=e.toString();E+=" else if (id == "+r+") return texture2D(dTextures["+r+"], pitUV(uv,offsetScale["+r+"]));\n"}E+="else return vec4(0.0,0.0,0.0,0.0);}\n"}return E},C=function(t,e){for(var r=0;r<t.length;r++)t[r]=e},O=function(t,e,r){t.splice(r,0,t.splice(e,1)[0])},I=function(t){l.RawShaderMaterial.call(this);var e=b.default.getMaxTextureUnitsCount(),r=Math.min(e-1,15);this.vertexShader=f.default,this.fragmentShaderHeader=x.default+"\nconst int TEX_UNITS = "+r.toString()+";\n",this.fragmentShaderHeader+=g.default,t=t||{};var n="";if(t.useRgbaTextureElevation)throw new Error("Restore this feature");t.useColorTextureElevation?(n="\n#define COLOR_TEXTURE_ELEVATION\n",n+="\nconst float _minElevation = "+t.colorTextureElevationMinZ.toFixed(1)+";\n",n+="\nconst float _maxElevation = "+t.colorTextureElevationMaxZ.toFixed(1)+";\n"):n="\n#define DATA_TEXTURE_ELEVATION\n",this.fragmentShaderHeader+=R(r),this.fragmentShader=this.fragmentShaderHeader+m.default,this.vertexShader=x.default+n+f.default,this.textures=[],this.offsetScale=[],this.loadedTexturesCount=[0,0],this.offsetScale[L]=Array(r),this.offsetScale[A]=[T],C(this.offsetScale[L],T),this.textures[A]=[M],this.textures[L]=Array(r);var i=Array(8);this.layerTexturesCount=Array(8),C(this.textures[L],M),C(i,S),C(this.layerTexturesCount,0),this.uniforms.dTextures_00=new l.Uniform(this.textures[A]),this.uniforms.dTextures_01=new l.Uniform(this.textures[L]),this.uniforms.visibility=new l.Uniform([!0,!0,!0,!0,!0,!0,!0,!0]),this.uniforms.loadedTexturesCount=new l.Uniform(this.loadedTexturesCount),this.uniforms.colorLayersCount=new l.Uniform(1),this.uniforms.paramLayers=new l.Uniform(i),this.uniforms.offsetScale_L00=new l.Uniform(this.offsetScale[A]),this.uniforms.offsetScale_L01=new l.Uniform(this.offsetScale[L]),this.uniforms.lightPosition=new l.Uniform(new l.Vector3(-.5,0,1)),this.uniforms.distanceFog=new l.Uniform(1e9),this.uniforms.uuid=new l.Uniform(0),this.uniforms.selected=new l.Uniform(!1),this.uniforms.lightingEnabled=new l.Uniform(!1),this.uniforms.noTextureColor=new l.Uniform(new l.Color(.04,.23,.35)),this.colorLayersId=[],this.elevationLayersId=[],b.default.isLogDepthBufferSupported()?this.defines={USE_LOGDEPTHBUF:1,USE_LOGDEPTHBUF_EXT:1}:this.defines={}};I.prototype=(0,u.default)(l.RawShaderMaterial.prototype),I.prototype.constructor=I,I.prototype.dispose=function(){this.dispatchEvent({type:"dispose"});for(var t=0;t<2;t++)for(var e=0,r=this.textures[t].length;e<r;e++)this.textures[t][e]instanceof l.Texture&&this.textures[t][e].dispose()},I.prototype.setSequence=function(t){for(var e=0,r=0,n=new(Function.prototype.bind.apply(Array,[null].concat((0,o.default)(this.uniforms.offsetScale_L01.value)))),i=new(Function.prototype.bind.apply(Array,[null].concat((0,o.default)(this.uniforms.dTextures_01.value)))),a=0;a<t.length;a++){var s=t[a],u=this.indexOfColorLayer(s);if(u>-1){var h=a-e,c=this.layerTexturesCount[u];h!==u&&(O(this.colorLayersId,u,h),O(this.layerTexturesCount,u,h),O(this.uniforms.paramLayers.value,u,h),O(this.uniforms.visibility.value,u,h));for(var l=this.getTextureOffsetByLayerIndex(h),d=0;d<c;d++)this.uniforms.offsetScale_L01.value[r+d]=n[l+d],this.uniforms.dTextures_01.value[r+d]=i[l+d];this.setTextureOffsetByLayerIndex(h,r),r+=c}else e++}this.uniforms.colorLayersCount.value=this.getColorLayersCount()},I.prototype.removeColorLayer=function(t){var e=this.indexOfColorLayer(t);if(-1!==e){var r=this.getTextureOffsetByLayerIndex(e),n=this.getTextureCountByLayerIndex(e);this.colorLayersId.splice(e,1),this.uniforms.colorLayersCount.value=this.getColorLayersCount(),this.layerTexturesCount.splice(e,1),this.layerTexturesCount.push(0),this.uniforms.paramLayers.value.splice(e,1),this.uniforms.paramLayers.value.push(S),this.uniforms.visibility.value.splice(e,1),this.uniforms.visibility.value.push(!0);for(var i=r,a=r+n;i<a;i++)this.textures[L][i]instanceof l.Texture&&this.textures[L][i].dispose();var o=this.textures[L].splice(r,n);this.offsetScale[L].splice(r,n);for(var s=o.reduce(function(t,e){return t+(e.coords.zoom>w)},0),u=0,h=n;u<h;u++)this.textures[L].push(M),this.offsetScale[L].push(T);for(var c=e,d=this.getColorLayersCount();c<d;c++)this.uniforms.paramLayers.value[c].x-=n;this.loadedTexturesCount[L]-=s,this.uniforms.offsetScale_L01.value=this.offsetScale[L],this.uniforms.dTextures_01.value=this.textures[L]}},I.prototype.setTexturesLayer=function(t,e,r){for(var n=this.indexOfColorLayer(r),i=this.getTextureOffsetByLayerIndex(n),a=0,o=t.length;a<o;a++)if(t[a]){if(null===t[a].texture){this.setLayerVisibility(n,!1);break}this.setTexture(t[a].texture,e,a+(i||0),t[a].pitch)}},I.prototype.setTexture=function(t,e,r,n){void 0!==this.textures[e][r]&&void 0!==this.textures[e][r].image||(this.loadedTexturesCount[e]+=1),this.textures[e][r]=t||M,this.offsetScale[e][r]=n||new l.Vector3(0,0,1)},I.prototype.setColorLayerParameters=function(t){if(0===this.getColorLayersCount())for(var e=0;e<t.length;e++)this.pushLayer(t[e])},I.prototype.pushLayer=function(t){var e=this.getColorLayersCount(),r=0===e?0:this.getTextureOffsetByLayerIndex(e-1)+this.getTextureCountByLayerIndex(e-1);this.uniforms.paramLayers.value[e]=new l.Vector4,this.setTextureOffsetByLayerIndex(e,r),this.setLayerUV(e,"PM"===t.tileMT?1:0),this.setLayerFx(e,t.fx),this.setLayerOpacity(e,t.opacity),this.setLayerVisibility(e,t.visible),this.setLayerTexturesCount(e,t.texturesCount),this.colorLayersId.push(t.idLayer),this.uniforms.colorLayersCount.value=this.getColorLayersCount()},I.prototype.indexOfColorLayer=function(t){return this.colorLayersId.indexOf(t)},I.prototype.getColorLayersCount=function(){return this.colorLayersId.length},I.prototype.getTextureOffsetByLayerIndex=function(t){return this.uniforms.paramLayers.value[t].x},I.prototype.getTextureCountByLayerIndex=function(t){return this.layerTexturesCount[t]},I.prototype.getLayerTextureOffset=function(t){var e=this.indexOfColorLayer(t);return e>-1?this.getTextureOffsetByLayerIndex(e):-1},I.prototype.setLightingOn=function(t){this.uniforms.lightingEnabled.value=t},I.prototype.setLayerFx=function(t,e){this.uniforms.paramLayers.value[t].z=e},I.prototype.setTextureOffsetByLayerIndex=function(t,e){this.uniforms.paramLayers.value[t].x=e},I.prototype.setLayerUV=function(t,e){this.uniforms.paramLayers.value[t].y=e},I.prototype.getLayerUV=function(t){return this.uniforms.paramLayers.value[t].y},I.prototype.setLayerOpacity=function(t,e){this.uniforms.paramLayers.value[t]&&(this.uniforms.paramLayers.value[t].w=e)},I.prototype.setLayerVisibility=function(t,e){this.uniforms.visibility.value[t]=e},I.prototype.setLayerTexturesCount=function(t,e){this.layerTexturesCount[t]=e},I.prototype.getLoadedTexturesCount=function(){return this.loadedTexturesCount[A]+this.loadedTexturesCount[L]},I.prototype.isColorLayerDownscaled=function(t,e){return this.textures[L][this.getLayerTextureOffset(t)]&&this.textures[L][this.getLayerTextureOffset(t)].coords.zoom<e},I.prototype.getColorLayerLevelById=function(t){var e=this.indexOfColorLayer(t);if(-1===e)return w;var r=this.getTextureOffsetByLayerIndex(e),n=this.textures[L][r];return n?n.coords.zoom:w},I.prototype.getElevationLayerLevel=function(){return this.textures[A][0].coords.zoom},I.prototype.getLayerTextures=function(t,e){if(t===A)return this.textures[A];var r=this.indexOfColorLayer(e);if(-1!==r){var n=this.getTextureCountByLayerIndex(r),i=this.getTextureOffsetByLayerIndex(r);return this.textures[L].slice(i,i+n)}throw new Error('Invalid layer id "'+e+'"')},I.prototype.setUuid=function(t){this.uniforms.uuid.value=t},I.prototype.setFogDistance=function(t){this.uniforms.distanceFog.value=t},I.prototype.setSelected=function(t){this.uniforms.selected.value=t},e.default=I},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e,r){"use strict";var n=r(402)(!0);r(85)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,r=this._i;return r>=e.length?{value:void 0,done:!0}:(t=n(e,r),this._i+=t.length,{value:t,done:!1})})},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!t)throw new Error("Missing id parameter (GeometryLayer must have a unique id defined)");if(!e||!e.isObject3D)throw new Error("Missing/Invalid object3d parameter (must be a three.js Object3D instance)");this._attachedLayers=[],Object.defineProperty(this,"object3d",{value:e,writable:!1}),Object.defineProperty(this,"id",{value:t,writable:!1}),this.postUpdate=function(){}}function a(t){Object.defineProperty(this,"id",{value:t,writable:!1})}Object.defineProperty(e,"__esModule",{value:!0}),e.ImageryLayers=e.Layer=e.GeometryLayer=e.defineLayerProperty=void 0;var o=r(115),s=n(o),u=r(2),h=n(u),c=r(8),l=n(c),d=r(78),f=n(d),p=r(317),m=n(p),v=r(1);e.defineLayerProperty=function(t,e,r,n){var i=(0,m.default)(t,e);if(!i||!i.set){var a=void 0==t[e]?r:t[e];(0,f.default)(t,e,{get:function(){return a},set:function(r){if(a!==r){var i={type:e+"-property-changed",previous:{},new:{}};i.previous[e]=a,i.new[e]=r,a=r,n&&n(t,e),t.dispatchEvent(i)}}})}};i.prototype=(0,l.default)(v.EventDispatcher.prototype),i.prototype.constructor=i,i.prototype.attach=function(t){if(!t.update)throw new Error("Missing 'update' function -> can't attach layer "+t.id);this._attachedLayers.push(t)},i.prototype.detach=function(t){var e=this._attachedLayers.length;return this._attachedLayers=this._attachedLayers.filter(function(e){return e.id!=t.id}),this._attachedLayers.length<e},a.prototype=(0,l.default)(v.EventDispatcher.prototype),a.prototype.constructor=a;var g={moveLayerToIndex:function(t,e,r){e=Math.min(e,r.length-1),e=Math.max(e,0);var n=t.sequence,i=!0,a=!1,o=void 0;try{for(var s,u=(0,h.default)(r);!(i=(s=u.next()).done);i=!0){var c=s.value;c.id===t.id?c.sequence=e:c.sequence>n&&c.sequence<=e?c.sequence--:c.sequence>=e&&c.sequence<n&&c.sequence++}}catch(t){a=!0,o=t}finally{try{!i&&u.return&&u.return()}finally{if(a)throw o}}},moveLayerDown:function(t,e){t.sequence>0&&this.moveLayerToIndex(t,t.sequence-1,e)},moveLayerUp:function(t,e){var r=e.length-1;t.sequence<r&&this.moveLayerToIndex(t,t.sequence+1,e)},getColorLayersIdOrderedBySequence:function(t){var e=(0,s.default)(t);return e.sort(function(t,e){return t.sequence-e.sequence}),e.map(function(t){return t.id})}};e.GeometryLayer=i,e.Layer=a,e.ImageryLayers=g},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.SIZE_TEXTURE_TILE=void 0;var i=r(116),a=n(i),o=r(7),s=n(o),u=r(77),h=n(u),c=r(1),l=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(c),d=r(16),f=n(d),p=r(69),m=n(p),v=r(283),g=n(v),y=r(104),x=n(y),_=r(12),b=n(_),w=e.SIZE_TEXTURE_TILE=256,M=(0,m.default)(),E=new h.default,T=new g.default,S=new x.default,A=function(t){var e=new l.DataTexture(t,w,w,l.AlphaFormat,l.FloatType);return e.needsUpdate=!0,e};e.default={ioDXBIL:T,getColorTextureByUrl:function(t,e){var r=M.getRessource(t);if(r)return s.default.resolve(r);var n=E.has(t)?E.get(t):f.default.texture(t,e),i=n.texture,a=n.promise;return i.generateMipmaps=!1,i.magFilter=l.LinearFilter,i.minFilter=l.LinearFilter,i.anisotropy=16,E.set(t,{texture:i,promise:a}),a.then(function(){return M.getRessource(t)||M.addRessource(t,i),E.delete(t),i})},getXBilTextureByUrl:function(t,e){var r=M.getRessource(t);if(void 0!==r)return s.default.resolve(r);var n=E.get(t);if(n)return n;var i=T.read(t,e).then(function(e){var r=M.getRessource(t);if(r)return E.delete(t),r;var n=A(e.floatArray);return n.generateMipmaps=!1,n.magFilter=l.LinearFilter,n.minFilter=l.LinearFilter,M.addRessource(t,n),E.delete(t),n});return E.set(t,i),i},computeTileMatrixSetCoordinates:function(t,e){if(t.wmtsCoords||(t.wmtsCoords={}),!((e=e||"WGS84G")in t.wmtsCoords)){var r=S.WGS84toWMTS(t.extent);t.wmtsCoords[e]=S.getCoordWMTS_WGS84(r,t.extent,e)}},computeTMSCoordinates:function(t,e){if(t.extent.crs()!=e.crs())throw new Error("Unsupported configuration. TMS is only supported when geometry has the same crs than TMS layer");var r=t.extent.center(),n=e.dimensions(),i=Math.round(n.x/t.extent.dimensions().x),o=Math.floor((0,a.default)(i)),s=(r.x()-e.west())/n.x,u=(e.north()-r.y())/n.y;return[new b.default("TMS",o,Math.floor(u*i),Math.floor(s*i))]},WMTS_WGS84Parent:function(t,e,r){var n=t.zoom-e,i=Math.pow(2,n),a=1/i,o=(t.row-t.row%i)*a,s=(t.col-t.col%i)*a;return r&&(r.x=t.col*a-s,r.y=t.row*a-o,r.z=a),new b.default(t.crs(),e,o,s)}}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(){return{storage:new p.default({comparator:function(t,e){var r=e.priority-t.priority;return 0===r?e.timestamp-t.timestamp:r}}),counters:{executing:0,executed:0,failed:0,cancelled:0},execute:function(t,e,r){var n=this;return r||this.counters.executing++,(e.executeCommand(t)||d.default.resolve()).then(function(e){n.counters.executing--,t.resolve(e),n.counters.executed++},function(e){n.counters.executing--,t.reject(e),n.counters.failed++})}}}function a(){if(null!==C)throw new Error("Cannot instantiate more than one Scheduler");this.defaultQueue=i(),this.hostQueues=new c.default,this.providers={},this.maxConcurrentCommands=16,this.maxCommandsPerHost=6,this.initDefaultProviders()}function o(t){this.command=t}Object.defineProperty(e,"__esModule",{value:!0}),e.CancelledCommandException=void 0;var s=r(2),u=n(s),h=r(77),c=n(h),l=r(7),d=n(l),f=r(425),p=n(f),m=r(292),v=n(m),g=r(291),y=n(g),x=r(289),_=n(x),b=r(106),w=n(b),M=r(288),E=n(M),T=r(284),S=n(T),A=r(290),L=n(A),P=r(287),R=n(P),C=null;a.prototype.constructor=a,a.prototype.initDefaultProviders=function(){var t=new v.default;this.addProtocolProvider("wmts",t),this.addProtocolProvider("wmtsc",t),this.addProtocolProvider("tile",new _.default),this.addProtocolProvider("wms",new y.default),this.addProtocolProvider("3d-tiles",new w.default),this.addProtocolProvider("tms",new E.default),this.addProtocolProvider("potreeconverter",S.default),this.addProtocolProvider("wfs",new L.default),this.addProtocolProvider("rasterizer",R.default)},a.prototype.runCommand=function(t,e,r){var n=this,i=this.providers[t.layer.protocol];if(!i)throw new Error("No known provider for layer",t.layer.id);e.execute(t,i,r).then(function(){if(t.view.notifyChange(!("redraw"in t)||t.redraw,t.requester),e.counters.executing<n.maxCommandsPerHost){var r=n.deQueue(e);if(r)return n.runCommand(r,e)}})},a.prototype.execute=function(t){var e=t.layer,r=e.url?new URL(e.url,document.location).host:void 0;t.promise=new d.default(function(e,r){t.resolve=e,t.reject=r}),r&&!this.hostQueues.has(r)&&this.hostQueues.set(r,i());var n=r?this.hostQueues.get(r):this.defaultQueue;if(n.counters.executing<this.maxCommandsPerHost){n.counters.executing++;var a=function(){this.runCommand(t,n,!0)}.bind(this);window.setTimeout(a,0)}else t.timestamp=Date.now(),n.storage.queue(t);return t.promise},a.prototype.addProtocolProvider=function(t,e){this.providers[t]=e},a.prototype.getProtocolProvider=function(t){return this.providers[t]},a.prototype.commandsWaitingExecutionCount=function(){var t=this.defaultQueue.storage.length+this.defaultQueue.counters.executing,e=!0,r=!1,n=void 0;try{for(var i,a=(0,u.default)(this.hostQueues);!(e=(i=a.next()).done);e=!0){var o=i.value;t+=o[1].storage.length+o[1].counters.executing}}catch(t){r=!0,n=t}finally{try{!e&&a.return&&a.return()}finally{if(r)throw n}}return t},a.prototype.commandsRunningCount=function(){var t=this.defaultQueue.counters.executing,e=!0,r=!1,n=void 0;try{for(var i,a=(0,u.default)(this.hostQueues);!(e=(i=a.next()).done);e=!0){t+=i.value[1].counters.executing}}catch(t){r=!0,n=t}finally{try{!e&&a.return&&a.return()}finally{if(r)throw n}}return t},a.prototype.resetCommandsCount=function(t){var e=this.defaultQueue.counters[t];this.defaultQueue.counters[t]=0;var r=!0,n=!1,i=void 0;try{for(var a,o=(0,u.default)(this.hostQueues);!(r=(a=o.next()).done);r=!0){var s=a.value;e+=s[1].counters[t],s[1].counters[t]=0}}catch(t){n=!0,i=t}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}return e},a.prototype.getProviders=function(){return this.providers.slice()},o.prototype.toString=function(){return"Cancelled command "+this.command.requester.id+"/"+this.command.layer.id},a.prototype.deQueue=function(t){for(var e=t.storage;e.length>0;){var r=e.dequeue();if(!r.earlyDropFunction||!r.earlyDropFunction(r))return r;t.counters.cancelled++,r.reject(new o(r))}},e.CancelledCommandException=o,e.default=a},function(t,e,r){"use strict";e.__esModule=!0;var n=r(115),i=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return(0,i.default)(t)}},function(t,e){t.exports={}},function(t,e,r){var n=r(132),i=r(83);t.exports=Object.keys||function(t){return n(t,i)}},function(t,e,r){var n=r(53);t.exports=function(t){return Object(n(t))}},function(t,e,r){r(407);for(var n=r(11),i=r(18),a=r(29),o=r(9)("toStringTag"),s=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],u=0;u<5;u++){var h=s[u],c=n[h],l=c&&c.prototype;l&&!l[o]&&i(l,o,h),a[h]=a.Array}},function(t,e,r){"use strict";e.a=function(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}},function(t,e,r){"use strict";e.a=function(t,e,r){var n=t*e;return r/Math.sqrt(1-n*n)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=!1,i=8,a=!!document.documentMode;e.default={isLogDepthBufferSupported:function(){return n},isInternetExplorer:function(){return a},getMaxTextureUnitsCount:function(){return i},updateCapabilities:function(t){var e=t.context;i=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS);var r=e.getExtension("WEBGL_debug_renderer_info");if(null!==r){var a=e.getParameter(r.UNMASKED_VENDOR_WEBGL);(a.indexOf("mesa")>-1||a.indexOf("Mesa")>-1)&&(i=Math.min(16,i))}else i=Math.min(16,i);n=t.capabilities.logarithmicDepthBuffer}}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)throw new Error("Invalid viewerDiv parameter (must non be null/undefined)");this.referenceCrs=t;var i=void 0;i=n.renderer&&n.renderer.domElement?new w.default(n.renderer):new w.default(e,n.renderer),this.mainLoop=n.mainLoop||new _.default(new S.default,i),this.scene=n.scene3D||new v.Scene,n.scene3D||(this.scene.autoUpdate=!1),this.camera=new y.default(this.referenceCrs,this.mainLoop.gfxEngine.getWindowSize().x,this.mainLoop.gfxEngine.getWindowSize().y,n),this._frameRequesters=[],this._layers=[],window.addEventListener("resize",function(){var t=new v.Vector2(e.clientWidth,e.clientHeight);r.mainLoop.gfxEngine.onWindowResize(t.x,t.y),r.notifyChange(!0)},!1),this.onAfterRender=function(){},this._changeSources=new m.default}function a(t,e,r){if(!(e instanceof E.Layer||e instanceof E.GeometryLayer)){var n=new E.Layer(e.id),i=e;delete i.id,e=(0,l.default)(n,e),i.id=e.id}if(e.updateStrategy||(e.updateStrategy={type:M.STRATEGY_MIN_NETWORK_TRAFFIC}),r&&(r.tileInsideLimit&&(e.tileInsideLimit=r.tileInsideLimit.bind(r)),r.tileTextureCount&&(e.tileTextureCount=r.tileTextureCount.bind(r))),!e.whenReady){var a=h.default.resolve();r&&r.preprocessDataLayer&&((a=r.preprocessDataLayer(e,t,t.mainLoop.scheduler))&&a.then||(a=h.default.resolve())),e.whenReady=a.then(function(){return e.ready=!0,e})}return"color"==e.type?((0,E.defineLayerProperty)(e,"frozen",!1),(0,E.defineLayerProperty)(e,"visible",!0),(0,E.defineLayerProperty)(e,"opacity",1),(0,E.defineLayerProperty)(e,"sequence",0)):"elevation"==e.type?(0,E.defineLayerProperty)(e,"frozen",!1):"geometry"!=e.type&&"debug"!=e.type||(e.threejsLayer=t.mainLoop.gfxEngine.getUniqueThreejsLayer(),(0,E.defineLayerProperty)(e,"visible",!0,function(){return A(e,t)}),A(e,t)),e}Object.defineProperty(e,"__esModule",{value:!0});var o=r(2),s=n(o),u=r(7),h=n(u),c=r(117),l=n(c),d=r(8),f=n(d),p=r(47),m=n(p),v=r(1),g=r(297),y=n(g),x=r(273),_=n(x),b=r(306),w=n(b),M=r(68),E=r(25),T=r(27),S=n(T);i.prototype=(0,f.default)(v.EventDispatcher.prototype),i.prototype.constructor=i;var A=function(t,e){t.visible?e.camera.camera3D.layers.enable(t.threejsLayer):e.camera.camera3D.layers.disable(t.threejsLayer)};i.prototype.addLayer=function(t,e){if(this.getLayers(function(e){return e.id==t.id}).length>0)throw new Error("Invalid id '"+t.id+"': id already used");e&&!t.extent&&(t.extent=e.extent);var r=this.mainLoop.scheduler.getProtocolProvider(t.protocol);if(t.protocol&&!r)throw new Error(t.protocol+" is not a recognized protocol name.");if(t=a(this,t,r),e)e.attach(t);else{if("function"!=typeof t.update)throw new Error("Cant add GeometryLayer: missing a update function");if("function"!=typeof t.preUpdate)throw new Error("Cant add GeometryLayer: missing a preUpdate function");this._layers.push(t)}return this.notifyChange(!0),t.whenReady},i.prototype.notifyChange=function(t,e){this._changeSources.add(e),this.mainLoop.scheduleViewUpdate(this,t)},i.prototype.getLayers=function(t){var e=[],r=!0,n=!1,i=void 0;try{for(var a,o=(0,s.default)(this._layers);!(r=(a=o.next()).done);r=!0){var u=a.value;t&&!t(u)||e.push(u);var h=!0,c=!1,l=void 0;try{for(var d,f=(0,s.default)(u._attachedLayers);!(h=(d=f.next()).done);h=!0){var p=d.value;t&&!t(p,u)||e.push(p)}}catch(t){c=!0,l=t}finally{try{!h&&f.return&&f.return()}finally{if(c)throw l}}}}catch(t){n=!0,i=t}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}return e},i.prototype.addFrameRequester=function(t){this._frameRequesters.push(t)},i.prototype.removeFrameRequester=function(t){this._frameRequesters.splice(this._frameRequesters.indexOf(t),1)},e.default=i},function(t,e,r){t.exports={default:r(378),__esModule:!0}},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,r){var n=r(13).f,i=r(23),a=r(9)("toStringTag");t.exports=function(t,e,r){t&&!i(t=r?t:t.prototype,a)&&n(t,a,{configurable:!0,value:e})}},function(t,e,r){"use strict";var n=r(3),i=r(42);e.a=function(t){return Math.abs(t)<n.b?t:t-r.i(i.a)(t)*Math.PI}},function(t,e,r){"use strict";e.a=function(t){return t<0?-1:1}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n={};n.PI=Math.PI,n.PI_OV_TWO=.5*Math.PI,n.PI_OV_FOUR=.25*Math.PI,n.TWO_PI=2*Math.PI,n.INV_TWO_PI=1/n.TWO_PI,n.LOG_TWO=Math.log(2),n.RADTODEG=180/n.PI,n.DEGTORAD=n.PI/180,n.radToDeg=function(t){return t*n.RADTODEG},n.degToRad=function(t){return t*n.DEGTORAD},n.arrayDegToRad=function(t){if(t)for(var e=0;e<t.length;e++)t[e]=n.degToRad(t[e])},n.arrayRadToDeg=function(t){if(t)for(var e=0;e<t.length;e++)t[e]=n.radToDeg(t[e])},n.step=function(t,e){return t<e?0:1},n.exp2=function(t){return Math.pow(2,t)},e.default=n},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t){var e=t.center(),r=new f.default(t.crs(),t.west(),e._values[0],e._values[1],t.north()),n=new f.default(t.crs(),e._values[0],t.east(),e._values[1],t.north()),i=new f.default(t.crs(),t.west(),e._values[0],t.south(),e._values[1]),a=new f.default(t.crs(),e._values[0],t.east(),t.south(),e._values[1]),o=[r,n,i,a],s=!0,u=!1,h=void 0;try{for(var c,d=(0,l.default)(o);!(s=(c=d.next()).done);s=!0){c.value._internalStorageUnit=t._internalStorageUnit}}catch(t){u=!0,h=t}finally{try{!s&&d.return&&d.return()}finally{if(u)throw h}}return o}function a(t,e,r,n,i,a){var o={view:t,requester:i,layer:r,priority:1e4,extent:n,level:a,redraw:!1,threejsLayer:r.threejsLayer};return e.execute(o).then(function(t){return t.add(t.OBB()),r.onTileCreated(r,i,t),t})}function o(t,e,r){r.pendingSubdivision||r.children.some(function(t){return t.layer==e.id})||function(){var n=i(r.extent);r.pendingSubdivision=!0;var o=[],s=[],u=!0,c=!1,d=void 0;try{for(var f,m=(0,l.default)(n);!(u=(f=m.next()).done);u=!0){var v=f.value;o.push(a(t.view,t.scheduler,e,v,r).then(function(t){return s.push(t),r}))}}catch(t){c=!0,d=t}finally{try{!u&&m.return&&m.return()}finally{if(c)throw d}}h.default.all(o).then(function(){var e=!0,n=!1,i=void 0;try{for(var a,o=(0,l.default)(s);!(e=(a=o.next()).done);e=!0){var u=a.value;r.add(u),u.updateMatrixWorld(!0),u.OBB().update(),u.material.uniforms.lightPosition.value=r.material.uniforms.lightPosition.value,u.material.uniforms.lightingEnabled.value=r.material.uniforms.lightingEnabled.value}}catch(t){n=!0,i=t}finally{try{!e&&o.return&&o.return()}finally{if(n)throw i}}r.pendingSubdivision=!1,t.view.notifyChange(!1,r)},function(t){if(r.pendingSubdivision=!1,!(t instanceof p.CancelledCommandException))throw new Error(t)})}()}function s(t,e){return function(r,n,i){if(!i.parent)return v.default.removeChildrenAndCleanup(n.id,i);if(i.parent.pendingSubdivision)return i.visible=!1,void i.setDisplayed(!1);var a=!t||!t(i,r.camera);if(i.visible=a,a){var s=!1;return i.pendingSubdivision||e(r,n,i)?(o(r,n,i),i.setDisplayed(i.pendingSubdivision),s=!0):i.setDisplayed(!0),i.material.visible&&(i.setFog(1e9),!s)?v.default.removeChildren(n.id,i):s?i.children.filter(function(t){return t.layer==n.id}):void 0}return i.setDisplayed(!1),v.default.removeChildren(n.id,i)}}Object.defineProperty(e,"__esModule",{value:!0});var u=r(7),h=n(u),c=r(2),l=n(c);e.requestNewTile=a,e.processTiledGeometryNode=s;var d=r(12),f=n(d),p=r(27),m=r(72),v=n(m)},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.TextEncoder=e.TextDecoder=void 0;var n=r(497);e.TextDecoder="function"==typeof t.TextDecoder?t.TextDecoder:n.TextDecoder,e.TextEncoder="function"==typeof t.TextEncoder?t.TextEncoder:n.TextEncoder}).call(e,r(265))},function(t,e,r){t.exports={default:r(379),__esModule:!0}},function(t,e,r){t.exports={default:r(382),__esModule:!0}},function(t,e,r){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,r){"use strict";e.__esModule=!0;var n=r(78),i=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),(0,i.default)(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}()},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=r(318),a=n(i),o=r(8),s=n(o),u=r(118),h=n(u);e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":(0,h.default)(e)));t.prototype=(0,s.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(a.default?(0,a.default)(t,e):t.__proto__=e)}},function(t,e,r){"use strict";e.__esModule=!0;var n=r(118),i=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":(0,i.default)(e))&&"function"!=typeof e?t:e}},function(t,e,r){var n=r(38),i=r(9)("toStringTag"),a="Arguments"==n(function(){return arguments}()),o=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,r,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=o(e=Object(t),i))?r:a?n(e):"Object"==(s=n(e))&&"function"==typeof e.callee?"Arguments":s}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,r){var n=r(17),i=r(127),a=r(125),o=r(15),s=r(58),u=r(97),h={},c={},e=t.exports=function(t,e,r,l,d){var f,p,m,v,g=d?function(){return t}:u(t),y=n(r,l,e?2:1),x=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(a(g)){for(f=s(t.length);f>x;x++)if((v=e?y(o(p=t[x])[0],p[1]):y(t[x]))===h||v===c)return v}else for(m=g.call(t);!(p=m.next()).done;)if((v=i(m,y,p.value,e))===h||v===c)return v};e.BREAK=h,e.RETURN=c},function(t,e){t.exports=!0},function(t,e,r){var n=r(15),i=r(398),a=r(83),o=r(91)("IE_PROTO"),s=function(){},u=function(){var t,e=r(82)("iframe"),n=a.length;for(e.style.display="none",r(123).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;n--;)delete u.prototype[a[n]];return u()};t.exports=Object.create||function(t,e){var r;return null!==t?(s.prototype=n(t),r=new s,s.prototype=null,r[o]=t):r=u(),void 0===e?r:i(r,e)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,r){var n=r(93),i=Math.min;t.exports=function(t){return t>0?i(n(t),9007199254740991):0}},function(t,e){var r=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+n).toString(36))}},function(t,e){},function(t,e,r){"use strict";e.a=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))}},function(t,e,r){"use strict";e.a=function(t){return.375*t*(1+.25*t*(1+.46875*t))}},function(t,e,r){"use strict";e.a=function(t){return.05859375*t*t*(1+.75*t)}},function(t,e,r){"use strict";e.a=function(t){return t*t*t*(35/3072)}},function(t,e,r){"use strict";e.a=function(t,e,r,n,i){return t*i-e*Math.sin(2*i)+r*Math.sin(4*i)-n*Math.sin(6*i)}},function(t,e,r){"use strict";var n=r(3);e.a=function(t,e){for(var r,i,a=.5*t,o=n.b-2*Math.atan(e),s=0;s<=15;s++)if(r=t*Math.sin(o),i=n.b-2*Math.atan(e*Math.pow((1-r)/(1+r),a))-o,o+=i,Math.abs(i)<=1e-10)return o;return-9999}},function(t,e,r){"use strict";var n=r(3);e.a=function(t,e,r){var i=t*r,a=.5*t;return i=Math.pow((1-i)/(1+i),a),Math.tan(.5*(n.b-e))/i}},function(t,e,r){"use strict";function n(t,e,r){return t.pendingSubdivision?r:e}function i(t,e,r){var n=r.groups.filter(function(e){return e<=t});return n.length?n[n.length-1]:r.groups[0]}function a(t,e,r){return Math.min(t,e+(r.increment||1))}function o(t,e,r){return e==u.EMPTY_TEXTURE_ZOOM?r.zoom.min:Math.min(t,Math.ceil((e+t)/2))}function s(t,e,r,s,u){switch(t){case c:return i(r,s,u.updateStrategy.options);case l:return a(r,s,u.updateStrategy.options);case d:return o(r,s,u.options);case h:default:return n(e,r,s)}}Object.defineProperty(e,"__esModule",{value:!0}),e.STRATEGY_DICHOTOMY=e.STRATEGY_PROGRESSIVE=e.STRATEGY_GROUP=e.STRATEGY_MIN_NETWORK_TRAFFIC=void 0,e.chooseNextLevelToFetch=s;var u=r(21),h=e.STRATEGY_MIN_NETWORK_TRAFFIC=0,c=e.STRATEGY_GROUP=1,l=e.STRATEGY_PROGRESSIVE=2,d=e.STRATEGY_DICHOTOMY=3},function(t,e,r){"use strict";function n(){this.cacheObjects=[],this._maximumSize=null}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){return i=i||new n};var i=null;n.prototype.getRessource=function(t){return this.cacheObjects[t]},n.prototype.addRessource=function(t,e){this.cacheObjects[t]=e},n.prototype.getRessourceByID=function(){}},function(t,e,r){"use strict";function n(t){this.type=null,this._IoDriver=t}Object.defineProperty(e,"__esModule",{value:!0}),n.prototype.constructor=n,n.prototype.preprocessLayer=function(){},e.default=n},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e,r){if(e.material&&e.material.getColorLayerLevelById(r.id)>g.EMPTY_TEXTURE_ZOOM){var n=t.getCoordsForLayer(r),i=t.material.getLayerTextureOffset(r.id),a=i,o=!0,s=!1,u=void 0;try{for(var h,c=(0,v.default)(n);!(o=(h=c.next()).done);o=!0){var l=h.value,d=!0,f=!1,p=void 0;try{for(var m,y=(0,v.default)(e.material.getLayerTextures(g.l_COLOR,r.id));!(d=(m=y.next()).done);d=!0){var x=m.value;if(l.isInside(x.coords)){var _=l.offsetToParent(x.coords);t.material.textures[g.l_COLOR][a]=x,t.material.offsetScale[g.l_COLOR][a]=_,a++;break}}}catch(t){f=!0,p=t}finally{try{!d&&y.return&&y.return()}finally{if(f)throw p}}}}catch(t){s=!0,u=t}finally{try{!o&&c.return&&c.return()}finally{if(s)throw u}}var b=t.material.indexOfColorLayer(r.id);t.material.layerTexturesCount[b]=n.length,t.material.loadedTexturesCount[g.l_COLOR]+=n.length}}function a(t,e,r){if(e.material&&e.material.getElevationLayerLevel()>g.EMPTY_TEXTURE_ZOOM){var n=t.getCoordsForLayer(r),i=e.material.textures[g.l_ELEVATION][0],a=n[0].offsetToParent(e.material.textures[g.l_ELEVATION][0].coords),o={texture:i,pitch:a};if(!(t.level-i.coords.zoom>6)){var s=E.default.ioDXBIL.computeMinMaxElevation(i.image.data,M.SIZE_TEXTURE_TILE,M.SIZE_TEXTURE_TILE,a),u=s.min,h=s.max;o.min=u,o.max=h}t.setTextureElevation(o),t.material.elevationLayersId=e.material.elevationLayersId}}function o(t,e,r){var n=t%r/r,i=Math.floor(t/r)/r,a=e.x+n*e.z,o=e.y+i*e.z;return Math.floor(o*r)*r+Math.floor(a*r)}function s(t,e,r,n){if(r.material&&r.material.getElevationLayerLevel()>g.EMPTY_TEXTURE_ZOOM)for(var i=e.getCoordsForLayer(n),a=r.material.textures[g.l_ELEVATION][0],s=i[0].offsetToParent(r.material.textures[g.l_ELEVATION][0].coords),u=t.image.data,h=u.length,c=0;c<h;++c)u[c]===n.noDataValue&&(u[c]=a.image.data[o(c,s,256)])}function u(t){return t.isDisplayed()?100:10}function h(t){return!t.requester.parent||!t.requester.material||!t.force&&!t.requester.isDisplayed()}function c(t,e){var r=t.image.data,n=r.length;return r[0]>e&&r[n-1]>e&&r[Math.sqrt(n)-1]>e&&r[n-Math.sqrt(n)]>e}function l(t,e,r){if(r.parent){if(!(e.tileInsideLimit(r,e)||!e.noTextureParentOutsideLimit&&r.parent&&r.parent.material&&r.parent.getIndexLayerColor&&r.parent.getIndexLayerColor(e.id)>=0))return p.default.resolve();var n=r.material;if(-1===n.indexOfColorLayer(e.id)){var a=e.tileTextureCount?e.tileTextureCount(r,e):1,o={tileMT:e.options.tileMatrixSet,texturesCount:a,visible:e.visible,opacity:e.opacity,fx:e.fx,idLayer:e.id};n.pushLayer(o);var s=t.view.getLayers(function(t){return"color"===t.type}),c=b.ImageryLayers.getColorLayersIdOrderedBySequence(s);n.setSequence(c),i(r,r.parent,e)}if(!r.isDisplayed()||!e.tileInsideLimit(r,e))return p.default.resolve();var l=n.indexOfColorLayer(e.id);n.setLayerVisibility(l,e.visible),n.setLayerOpacity(l,e.opacity);var d=Date.now();if(void 0===r.layerUpdateState[e.id]&&(r.layerUpdateState[e.id]=new _.default),!r.layerUpdateState[e.id].canTryUpdate(d))return p.default.resolve();if(!r.isColorLayerDownscaled(e))return p.default.resolve();if(!e.visible||e.frozen)return p.default.resolve();var f=r.material.getColorLayerLevelById(e.id),m=r.getCoordsForLayer(e)[0].zoom||r.level,v=(0,y.chooseNextLevelToFetch)(e.updateStrategy.type,r,m,f,e);if(v<=f)return p.default.resolve();r.layerUpdateState[e.id].newTry();var x={view:t.view,layer:e,requester:r,priority:u(r),earlyDropFunction:h,targetLevel:v};return t.scheduler.execute(x).then(function(t){if(null!==r.material)return Array.isArray(t)?r.setTexturesLayer(t,g.l_COLOR,e.id):t.texture&&r.setTexturesLayer([t],g.l_COLOR,e.id),r.layerUpdateState[e.id].success(),t},function(n){if(n instanceof w.CancelledCommandException)r.layerUpdateState[e.id].success();else{var i=r.layerUpdateState[e.id].errorCount>T;r.layerUpdateState[e.id].failure(Date.now(),i),i||window.setTimeout(function(){t.view.notifyChange(!1,r)},1e3*r.layerUpdateState[e.id].secondsUntilNextTry())}})}}function d(t,e,r,n){if(r.parent){var i=Date.now(),o=r.material,l=o.getElevationLayerLevel();if(l==g.EMPTY_TEXTURE_ZOOM&&r.material.loadedTexturesCount[g.l_ELEVATION]>0)return p.default.resolve();if(e.frozen&&!n)return p.default.resolve();if(void 0===r.layerUpdateState[e.id]&&(r.layerUpdateState[e.id]=new _.default,a(r,r.parent,e),l=o.getElevationLayerLevel()),!r.isDisplayed())return p.default.resolve();if(!r.layerUpdateState[e.id].canTryUpdate(i))return p.default.resolve();var d=r.getCoordsForLayer(e)[0],f=d.zoom||r.level,m=(0,y.chooseNextLevelToFetch)(e.updateStrategy.type,r,f,l,e);if(m<=l||!e.tileInsideLimit(r,e,m))return p.default.resolve();0===o.elevationLayersId.length&&o.elevationLayersId.push(e.id),r.layerUpdateState[e.id].newTry();var v={view:t.view,layer:e,requester:r,targetLevel:m,priority:u(r),earlyDropFunction:h,force:n};return t.scheduler.execute(v).then(function(t){null!==r.material&&(r.layerUpdateState[e.id].success(),t.texture&&t.texture.flipY&&(t.texture.flipY=!1,t.texture.needsUpdate=!0),t.texture&&t.texture.image.data&&!c(t.texture,e.noDataValue)&&s(t.texture,r,r.parent,e),r.setTextureElevation(t))},function(n){if(n instanceof w.CancelledCommandException)r.layerUpdateState[e.id].success();else{var i=r.layerUpdateState[e.id].errorCount>T;r.layerUpdateState[e.id].failure(Date.now(),i),i||window.setTimeout(function(){t.view.notifyChange(!1,r)},1e3*r.layerUpdateState[e.id].secondsUntilNextTry())}})}}Object.defineProperty(e,"__esModule",{value:!0});var f=r(7),p=n(f),m=r(2),v=n(m);e.updateLayeredMaterialNodeImagery=l,e.updateLayeredMaterialNodeElevation=d;var g=r(21),y=r(68),x=r(105),_=n(x),b=r(25),w=r(27),M=r(26),E=n(M),T=4},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(2),a=n(i),o=r(28),s=n(o);e.default={cleanup:function(t){"function"==typeof t.dispose?t.dispose():(t.geometry&&(t.geometry.dispose(),t.geometry=null),t.material&&(t.material.dispose(),t.material=null))},removeChildren:function(t,e){var r=e.children.filter(function(e){return e.layer===t});return e.remove.apply(e,(0,s.default)(r)),r},removeChildrenAndCleanup:function(t,e){var r=e.children.filter(function(e){return e.layer===t});return e.layer===t&&this.cleanup(e),e.remove.apply(e,(0,s.default)(r)),r},removeChildrenAndCleanupRecursively:function(t,e){var r=e.children.filter(function(e){return e.layer===t}),n=!0,i=!1,o=void 0;try{for(var u,h=(0,a.default)(r);!(n=(u=h.next()).done);n=!0){var c=u.value;this.removeChildrenAndCleanupRecursively(t,c)}}catch(t){i=!0,o=t}finally{try{!n&&h.return&&h.return()}finally{if(i)throw o}}return e.layer===t&&this.cleanup(e),e.remove.apply(e,(0,s.default)(r)),r}}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(37),a=n(i),o=r(48),s=n(o),u=r(49),h=n(u),c=r(51),l=n(c),d=r(50),f=n(d),p=r(1),m=r(489),v=n(m),g=r(488),y=n(g),x=r(35),_=n(x),b=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;(0,s.default)(this,e);var r=(0,l.default)(this,(e.__proto__||(0,a.default)(e)).call(this));return r.vertexShader=v.default,r.fragmentShader=y.default,r.uniforms.size=new p.Uniform(t),r.uniforms.resolution=new p.Uniform(new p.Vector2(window.innerWidth,window.innerHeight)),r.uniforms.pickingMode=new p.Uniform(!1),r.uniforms.density=new p.Uniform(.01),_.default.isLogDepthBufferSupported()&&(r.defines={USE_LOGDEPTHBUF:1,USE_LOGDEPTHBUF_EXT:1}),r}return(0,f.default)(e,t),(0,h.default)(e,[{key:"enablePicking",value:function(t){this.blending=t?p.NoBlending:p.NormalBlending,this.uniforms.pickingMode.value=t}}]),e}(p.RawShaderMaterial);e.default=b},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={FINAL:0,DEPTH:1,ID:2}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t){if(t.crs){if("epsg"==t.crs.type.toLowerCase())return"EPSG:"+t.crs.properties.code;if("name"==t.crs.type.toLowerCase()){var e=t.crs.properties.name.toLowerCase().indexOf("epsg:");if(e>=0){var r=t.crs.properties.name.indexOf(":",e+5);if(r>0)return"EPSG:"+t.crs.properties.name.substr(r+1)}}throw new Error("Unsupported CRS type '"+t.crs+"'")}return"EPSG:4326"}function a(t,e,r,n){var i=[],a=!0,o=!1,s=void 0;try{for(var u,h=(0,m.default)(r);!(a=(u=h.next()).done);a=!0){var c=u.value,l=new g.default(t,c[0],c[1],1);t===e?i.push(l):i.push(l.as(e)),n&&n.expandByPoint(i[i.length-1])}}catch(t){o=!0,s=t}finally{try{!a&&h.return&&h.return()}finally{if(o)throw s}}return i}function o(t,e,r,n,i){switch(r.type.toLowerCase()){case"point":return _.point(t,e,[r.coordinates],n,i);case"multipoint":return _.point(t,e,r.coordinates,n,i);case"linestring":return _.lineString(t,e,r.coordinates,n,i);case"multilinestring":return _.multiLineString(t,e,r.coordinates,n,i);case"polygon":return _.polygon(t,e,r.coordinates[0],n,i);case"multipolygon":return _.multiPolygon(t,e,r.coordinates,n,i);case"geometrycollection":default:throw new Error("Unhandled geometry type "+r.type)}}function s(t,e,r,n,i){var a={};if(a.geometry=o(t,e,r.geometry,n,i),a.geometry){a.properties={};var s=!0,u=!1,h=void 0;try{for(var c,l=(0,m.default)((0,f.default)(r));!(s=(c=l.next()).done);s=!0){var d=c.value;["type","geometry"].indexOf(d.toLowerCase())<0&&(a.properties[d]=r[d])}}catch(t){u=!0,h=t}finally{try{!s&&l.return&&l.return()}finally{if(u)throw h}}return a}}function u(t,e){var r=t.geometries.length;e.forEach(function(t,e){t.properties._idx=e,t.properties._meshIdx=r});var n=e.map(function(t){return t.geometry}),i=_.merge.apply(_,(0,l.default)(n));t.geometries.push(i),i.extent&&(t.extent?t.extent.union(i.extent):t.extent=i.extent.clone())}function h(t,e,r,n,i){var a=[],o=0,h=!0,c=!1,l=void 0;try{for(var d,f=(0,m.default)(r.features);!(h=(d=f.next()).done);h=!0){var p=d.value,v=s(t,e,p,n,i);v&&(v.geometry.featureIndex=o,a.push(v),o++)}}catch(t){c=!0,l=t}finally{try{!h&&f.return&&f.return()}finally{if(c)throw l}}if(a.length){var g={points:a.filter(function(t){return"point"===t.geometry.type}),lines:a.filter(function(t){return"linestring"===t.geometry.type}),polygons:a.filter(function(t){return"polygon"===t.geometry.type})},y={geometries:[]};if(g.points.length&&u(y,g.points),g.lines.length&&u(y,g.lines),g.polygons.length&&u(y,g.polygons),y.features=a.map(function(t){return{properties:t.properties}}),y.geometries.length)return y}}Object.defineProperty(e,"__esModule",{value:!0});var c=r(28),l=n(c),d=r(46),f=n(d),p=r(2),m=n(p),v=r(6),g=n(v),y=r(12),x=n(y),_={point:function(t,e,r,n,i){var o=i.buildExtent?new x.default(e,1/0,-1/0,1/0,-1/0):void 0,s=a(t,e,r,o);return n&&(s=s.filter(function(t){return n.isPointInside(t)})),{type:"point",coordinates:s,extent:o}},polygon:function(t,e,r,n,i){var o=i.buildExtent?new x.default(e,1/0,-1/0,1/0,-1/0):void 0,s=a(t,e,r,o);if(!n||n.isPointInside(s[0]))return{type:"polygon",coordinates:s,extent:o}},lineString:function(t,e,r,n,i){var o=i.buildExtent?new x.default(e,1/0,-1/0,1/0,-1/0):void 0,s=a(t,e,r,o);if(!n||n.isPointInside(s[0]))return{type:"linestring",coordinates:s,extent:o}},merge:function(){for(var t=void 0,e=0,r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];var a=!0,o=!1,s=void 0;try{for(var u,h=(0,m.default)(n);!(a=(u=h.next()).done);a=!0){var c=u.value;c&&(t?(t.coordinates=t.coordinates.concat(c.coordinates),c.extent&&t.extent.union(c.extent)):(t=c,c.extent&&(t.extent=c.extent.clone()),t.featureVertices={}),t.featureVertices[c.featureIndex||0]={offset:e,count:c.coordinates.length,extent:c.extent},e=t.coordinates.length)}}catch(t){o=!0,s=t}finally{try{!a&&h.return&&h.return()}finally{if(o)throw s}}return t},multiLineString:function(t,e,r,n,i){var a=void 0,o=!0,s=!1,u=void 0;try{for(var h,c=(0,m.default)(r);!(o=(h=c.next()).done);o=!0){var l=h.value,d=this.lineString(t,e,l,i);if(!d)return;void 0,a=this.merge(a,d)}}catch(t){s=!0,u=t}finally{try{!o&&c.return&&c.return()}finally{if(s)throw u}}return a},multiPolygon:function(t,e,r,n,i){var a=void 0,o=!0,s=!1,u=void 0;try{for(var h,c=(0,m.default)(r);!(o=(h=c.next()).done);o=!0){var l=h.value,d=this.polygon(t,e,l[0],n,i);if(!d)return;n=void 0,a=this.merge(a,d)}}catch(t){s=!0,u=t}finally{try{!o&&c.return&&c.return()}finally{if(s)throw u}}return a}};e.default={parse:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};switch(n.crsIn=n.crsIn||i(e),e.type.toLowerCase()){case"featurecollection":return h(n.crsIn,t,e,r,n);case"feature":return s(n.crsIn,t,e,r,n);default:throw new Error("Unsupported GeoJSON type: '"+e.type)}}}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e,r,n){u.Object3D.call(this),this.box3D=new u.Box3(t,e),this.natBox=this.box3D.clone(),r&&this.lookAt(r),n&&(this.translateX(n.x),this.translateY(n.y),this.translateZ(n.z)),this.oPosition=new u.Vector3,this.update(),this.oPosition=this.position.clone(),this.z={min:0,max:0}}Object.defineProperty(e,"__esModule",{value:!0});var a=r(8),o=n(a),s=r(1),u=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(s),h=r(6),c=n(h);i.prototype=(0,o.default)(u.Object3D.prototype),i.prototype.constructor=i,i.prototype.update=function(){this.updateMatrixWorld(!0),this.pointsWorld=this._cPointsWorld(this._points())},i.prototype.updateZ=function(t,e){return this.z={min:t,max:e},this.addHeight(t,e)},i.prototype.addHeight=function(t,e){var r=Math.abs(this.natBox.min.z-this.natBox.max.z);this.box3D.min.z=this.natBox.min.z+t,this.box3D.max.z=this.natBox.max.z+e;var n=.5*Math.abs(this.box3D.min.z-this.box3D.max.z),i=this.box3D.min.z+n;return this.box3D.min.z=-n,this.box3D.max.z=n,this.position.copy(this.oPosition),this.translateZ(i),this.update(),new u.Vector2(n-.5*r,i)},i.prototype._points=function(){var t=[new u.Vector3,new u.Vector3,new u.Vector3,new u.Vector3,new u.Vector3,new u.Vector3,new u.Vector3,new u.Vector3];return t[0].set(this.box3D.max.x,this.box3D.max.y,this.box3D.max.z),t[1].set(this.box3D.min.x,this.box3D.max.y,this.box3D.max.z),t[2].set(this.box3D.min.x,this.box3D.min.y,this.box3D.max.z),t[3].set(this.box3D.max.x,this.box3D.min.y,this.box3D.max.z),t[4].set(this.box3D.max.x,this.box3D.max.y,this.box3D.min.z),t[5].set(this.box3D.min.x,this.box3D.max.y,this.box3D.min.z),t[6].set(this.box3D.min.x,this.box3D.min.y,this.box3D.min.z),t[7].set(this.box3D.max.x,this.box3D.min.y,this.box3D.min.z),t},i.prototype._cPointsWorld=function(t){for(var e=this.matrixWorld,r=0,n=t.length;r<n;r++)t[r].applyMatrix4(e);return t};for(var l={epsg4978:new c.default("EPSG:4978",0,0),cardinals:[],normal:new u.Vector3,maxV:new u.Vector3,minV:new u.Vector3,translate:new u.Vector3,cardinal3D:new u.Vector3,planeZ:new u.Quaternion,qRotY:new u.Quaternion,tangentPlaneAtOrigin:new u.Plane,zUp:new u.Vector3(0,0,1)},d=0;d<9;d++)l.cardinals.push(h.C.EPSG_4326_Radians(0,0));i.extentToOBB=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if("EPSG:4326"!=t._crs)throw new Error("The extent crs is not a Geographic Coordinates (EPSG:4326)");t.center(l.cardinals[8]);var n=l.cardinals[8].as("EPSG:4978",l.epsg4978).xyz();l.normal.copy(n).normalize();var a=t.dimensions(h.UNIT.RADIAN),o=t.west(h.UNIT.RADIAN),s=a.x,c=t.south(h.UNIT.RADIAN),d=a.y;l.cardinals[0]._values[0]=o,l.cardinals[0]._values[1]=c,l.cardinals[1]._values[0]=o+.5*a.x,l.cardinals[1]._values[1]=c,l.cardinals[2]._values[0]=o+s,l.cardinals[2]._values[1]=c,l.cardinals[3]._values[0]=o+s,l.cardinals[3]._values[1]=c+.5*a.y,l.cardinals[4]._values[0]=o+s,l.cardinals[4]._values[1]=c+d,l.cardinals[5]._values[0]=o+.5*a.x,l.cardinals[5]._values[1]=c+d,l.cardinals[6]._values[0]=o,l.cardinals[6]._values[1]=c+d,l.cardinals[7]._values[0]=o,l.cardinals[7]._values[1]=c+.5*a.y;var f=[];l.maxV.set(-1e3,-1e3,-1e3),l.minV.set(1e3,1e3,1e3);var p=0;l.tangentPlaneAtOrigin.set(l.normal,0),l.planeZ.setFromUnitVectors(l.normal,l.zUp),l.qRotY.setFromAxisAngle(new u.Vector3(0,0,1),-l.cardinals[8].longitude(h.UNIT.RADIAN)),l.qRotY.multiply(l.planeZ);for(var m=0;m<l.cardinals.length;m++){l.cardinals[m].as("EPSG:4978",l.epsg4978).xyz(l.cardinal3D),f.push(l.tangentPlaneAtOrigin.projectPoint(l.cardinal3D));var v=f[m].distanceTo(l.cardinal3D.sub(n));p=Math.max(p,.5*v),f[m].applyQuaternion(l.qRotY),l.maxV.max(f[m]),l.minV.min(f[m])}var g=.5*Math.abs(l.maxV.y-l.minV.y),y=.5*Math.abs(l.maxV.x-l.minV.x),x=new u.Vector3(g,y,p),_=new u.Vector3(-g,-y,-p),b=y-Math.abs(f[5].x);l.translate.set(0,b,-p);var w=new i(_,x,l.normal,l.translate);return 0===e&&0===r||w.addHeight(e,r),w},e.default=i},function(t,e,r){t.exports={default:r(372),__esModule:!0}},function(t,e,r){t.exports={default:r(376),__esModule:!0}},,function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){t.exports=function(t,e,r,n){if(!(t instanceof e)||void 0!==n&&n in t)throw TypeError(r+": incorrect invocation!");return t}},function(t,e,r){var n=r(19),i=r(11).document,a=n(i)&&n(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,r){var n=r(38);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},function(t,e,r){"use strict";var n=r(55),i=r(10),a=r(133),o=r(18),s=r(23),u=r(29),h=r(394),c=r(40),l=r(131),d=r(9)("iterator"),f=!([].keys&&"next"in[].keys()),p=function(){return this};t.exports=function(t,e,r,m,v,g,y){h(r,e,m);var x,_,b,w=function(t){if(!f&&t in S)return S[t];switch(t){case"keys":case"values":return function(){return new r(this,t)}}return function(){return new r(this,t)}},M=e+" Iterator",E="values"==v,T=!1,S=t.prototype,A=S[d]||S["@@iterator"]||v&&S[v],L=A||w(v),P=v?E?w("entries"):L:void 0,R="Array"==e?S.entries||A:A;if(R&&(b=l(R.call(new t)))!==Object.prototype&&(c(b,M,!0),n||s(b,d)||o(b,d,p)),E&&A&&"values"!==A.name&&(T=!0,L=function(){return A.call(this)}),n&&!y||!f&&!T&&S[d]||o(S,d,L),u[e]=L,u[M]=p,v)if(x={values:E?L:w("values"),keys:g?L:w("keys"),entries:P},y)for(_ in x)_ in S||a(S,_,x[_]);else i(i.P+i.F*(f||T),e,x);return x}},function(t,e,r){var n=r(59)("meta"),i=r(19),a=r(23),o=r(13).f,s=0,u=Object.isExtensible||function(){return!0},h=!r(22)(function(){return u(Object.preventExtensions({}))}),c=function(t){o(t,n,{value:{i:"O"+ ++s,w:{}}})},l=function(t,e){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!a(t,n)){if(!u(t))return"F";if(!e)return"E";c(t)}return t[n].i},d=function(t,e){if(!a(t,n)){if(!u(t))return!0;if(!e)return!1;c(t)}return t[n].w},f=function(t){return h&&p.NEED&&u(t)&&!a(t,n)&&c(t),t},p=t.exports={KEY:n,NEED:!1,fastKey:l,getWeak:d,onFreeze:f}},function(t,e,r){var n=r(57),i=r(39),a=r(20),o=r(94),s=r(23),u=r(124),h=Object.getOwnPropertyDescriptor;e.f=r(14)?h:function(t,e){if(t=a(t),e=o(e,!0),u)try{return h(t,e)}catch(t){}if(s(t,e))return i(!n.f.call(t,e),t[e])}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,r){var n=r(10),i=r(5),a=r(22);t.exports=function(t,e){var r=(i.Object||{})[t]||Object[t],o={};o[t]=e(r),n(n.S+n.F*a(function(){r(1)}),"Object",o)}},function(t,e,r){var n=r(18);t.exports=function(t,e,r){for(var i in e)r&&t[i]?t[i]=e[i]:n(t,i,e[i]);return t}},function(t,e,r){var n=r(92)("keys"),i=r(59);t.exports=function(t){return n[t]||(n[t]=i(t))}},function(t,e,r){var n=r(11),i=n["__core-js_shared__"]||(n["__core-js_shared__"]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e){var r=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:r)(t)}},function(t,e,r){var n=r(19);t.exports=function(t,e){if(!n(t))return t;var r,i;if(e&&"function"==typeof(r=t.toString)&&!n(i=r.call(t)))return i;if("function"==typeof(r=t.valueOf)&&!n(i=r.call(t)))return i;if(!e&&"function"==typeof(r=t.toString)&&!n(i=r.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,r){var n=r(11),i=r(5),a=r(55),o=r(96),s=r(13).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=a?{}:n.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:o.f(t)})}},function(t,e,r){e.f=r(9)},function(t,e,r){var n=r(52),i=r(9)("iterator"),a=r(29);t.exports=r(5).getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||a[n(t)]}},function(t,e,r){"use strict";function n(t,e){if(!(this instanceof n))return new n(t);e=e||function(t){if(t)throw t};var o=r.i(i.a)(t);if("object"!=typeof o)return void e(t);var l=n.projections.get(o.projName);if(!l)return void e(t);if(o.datumCode&&"none"!==o.datumCode){var d=r.i(c.a)(u.a,o.datumCode);d&&(o.datum_params=d.towgs84?d.towgs84.split(","):null,o.ellps=d.ellipse,o.datumName=d.datumName?d.datumName:o.datumCode)}o.k0=o.k0||1,o.axis=o.axis||"enu",o.ellps=o.ellps||"wgs84";var f=r.i(s.a)(o.a,o.b,o.rf,o.ellps,o.sphere),p=r.i(s.b)(f.a,f.b,f.rf,o.R_A),m=o.datum||r.i(h.a)(o.datumCode,o.datum_params,f.a,f.b,p.es,p.ep2);r.i(a.a)(this,o),r.i(a.a)(this,l),this.a=f.a,this.b=f.b,this.rf=f.rf,this.sphere=f.sphere,this.es=p.es,this.e=p.e,this.ep2=p.ep2,this.datum=m,this.init(),e(null,this)}var i=r(450),a=r(448),o=r(451),s=r(447),u=r(439),h=r(444),c=r(103);n.projections=o.a,n.projections.start(),e.a=n},function(t,e,r){"use strict";e.a=function(t,e,r){var n=e*r;return t/Math.sqrt(1-n*n)}},function(t,e,r){"use strict";e.a=function(t,e,r,n,i){var a,o;a=t/e;for(var s=0;s<15;s++)if(o=(t-(e*a-r*Math.sin(2*a)+n*Math.sin(4*a)-i*Math.sin(6*a)))/(e-2*r*Math.cos(2*a)+4*n*Math.cos(4*a)-6*i*Math.cos(6*a)),a+=o,Math.abs(o)<=1e-10)return a;return NaN}},function(t,e,r){"use strict";e.a=function(t,e,r,n){return r*=e,e*=e,n[0]*t-r*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))}},function(t,e,r){"use strict";e.a=function(t,e){var r;return t>1e-7?(r=t*e,(1-t*t)*(e/(1-r*r)-.5/t*Math.log((1-r)/(1+r)))):2*e}},function(t,e,r){"use strict";function n(t,e){if(t[e])return t[e];for(var r,n=Object.keys(t),a=e.toLowerCase().replace(i,""),o=-1;++o<n.length;)if(r=n[o],r.toLowerCase().replace(i,"")===a)return t[r]}e.a=n;var i=/[\s_\-\/\(\)]/g},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(){}Object.defineProperty(e,"__esModule",{value:!0});var a=r(43),o=n(a),s=r(6),u=r(12),h=n(u);i.prototype.WGS84ToY=function(t){return.5-Math.log(Math.tan(o.default.PI_OV_FOUR+.5*t))*o.default.INV_TWO_PI},i.prototype.YToWGS84=function(t){return 2*(Math.atan(Math.exp(-(t-.5)/o.default.INV_TWO_PI))-o.default.PI_OV_FOUR)},i.prototype.WGS84ToOneSubY=function(t){return.5+Math.log(Math.tan(o.default.PI_OV_FOUR+.5*t))*o.default.INV_TWO_PI},i.prototype.WGS84LatitudeClamp=function(t){var e=-86/180*Math.PI,r=84/180*Math.PI;return t=Math.max(e,t),t=Math.min(r,t)},i.prototype.getCoordWMTS_WGS84=function(t,e,r){if("PM"===r)return this.WMTS_WGS84ToWMTS_PM(t,e);if("WGS84G"===r)return[t];throw new Error("Unsupported TileMatrixSet '"+r+"'")},i.prototype.getAllCoordsWMTS=function(t,e,r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=this.getCoordsWMTS(t,e,i));return n},i.prototype.getCoordsWMTS=function(t,e,r){for(var n=this.getCoordWMTS_WGS84(t,e,r),i=[],a=n[0].row;a<n[1].row+1;a++)i.push(new h.default("WMTS:"+r,n[0].zoom,a,n[0].col));return i},i.prototype.WMTS_WGS84ToWMTS_PM=function(t,e){var r=[],n=t.zoom+1,i=Math.pow(2,n),a=1/i,o=this.WGS84ToY(this.WGS84LatitudeClamp(e.north(s.UNIT.RADIAN))),u=this.WGS84ToY(this.WGS84LatitudeClamp(e.south(s.UNIT.RADIAN))),c=void 0,l=o/a,d=u/a,f=Math.floor(l);c=Math.ceil(d)-1,c=Math.min(c,i-1);for(var p=t.col,m=p,v=c;v>=f;v--)for(var g=p;g<=m;g++)r.push(new h.default("WMTS:PM",n,v,g));return r},i.prototype.WGS84toWMTS=function(t){var e=t.dimensions(s.UNIT.RADIAN),r=Math.floor(Math.log(o.default.PI/e.y)/o.default.LOG_TWO+.5),n=Math.pow(2,r),i=2*n,a=o.default.TWO_PI/i,u=o.default.PI/n,c=t.center(),l=Math.floor((o.default.PI+c.longitude(s.UNIT.RADIAN))/a),d=Math.floor(n-(o.default.PI_OV_TWO+c.latitude(s.UNIT.RADIAN))/u);return new h.default("WMTS:WGS84G",r,d,l)},i.prototype.UnitaryToLongitudeWGS84=function(t,e){var r=e.dimensions(s.UNIT.RADIAN);return e.west(s.UNIT.RADIAN)+t*r.x},i.prototype.UnitaryToLatitudeWGS84=function(t,e){var r=e.dimensions(s.UNIT.RADIAN);return e.south(s.UNIT.RADIAN)+t*r.y},i.prototype.wgs84_to_lambert93=function(t,e){var r=6378137,n=.08181919106,i=void 0,a=r/Math.sqrt(1-n*n*Math.sin(i)*Math.sin(i)),o=r/Math.sqrt(1-n*n*Math.sin(void 0)*Math.sin(void 0)),s=Math.log(Math.tan(Math.PI/4+NaN)*Math.pow((1-n*Math.sin(i))/(1+n*Math.sin(i)),n/2)),u=Math.log(Math.tan(Math.PI/4+NaN)*Math.pow((1-n*Math.sin(void 0))/(1+n*Math.sin(void 0)),n/2)),h=Math.log(Math.tan(Math.PI/4+NaN)*Math.pow((1-n*Math.sin(void 0))/(1+n*Math.sin(void 0)),n/2)),c=Math.log(Math.tan(Math.PI/4+NaN)*Math.pow((1-n*Math.sin(void 0))/(1+n*Math.sin(void 0)),n/2)),l=Math.log(o*Math.cos(void 0)/(a*Math.cos(i)))/(s-u),d=a*Math.cos(i)/l*Math.exp(l*s),f=66e5+d*Math.exp(-1*l*h);return{x:7e5+d*Math.exp(-1*l*c)*Math.sin(NaN*l),y:f-d*Math.exp(-1*l*c)*Math.cos(NaN*l)}},e.default=i},function(t,e,r){"use strict";function n(){this.state=i.IDLE,this.lastErrorTimestamp=0,this.errorCount=0}Object.defineProperty(e,"__esModule",{value:!0});var i={IDLE:0,PENDING:1,ERROR:2,DEFINITIVE_ERROR:3},a=[1,3,7,60];n.prototype.canTryUpdate=function(t){switch(this.state){case i.IDLE:return!0;case i.DEFINITIVE_ERROR:case i.PENDING:return!1;case i.ERROR:default:return 1e3*this.secondsUntilNextTry()<=t-this.lastErrorTimestamp}},n.prototype.secondsUntilNextTry=function(){if(this.state!==i.ERROR)return 0;var t=Math.max(0,Math.min(this.errorCount,a.length)-1);return a[t]},n.prototype.newTry=function(){this.state=i.PENDING},n.prototype.success=function(){this.lastErrorTimestamp=0,this.state=i.IDLE},n.prototype.failure=function(t,e){this.lastErrorTimestamp=t,this.state=e?i.DEFINITIVE_ERROR:i.ERROR,this.errorCount++},n.prototype.inError=function(){return this.state==i.DEFINITIVE_ERROR||this.state==i.ERROR},e.default=n},function(t,e,r){"use strict";(function(t){function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){var r=0;this.index={};var n=function(t,e){if(this.index[r]=t,t.tileId=r,t.baseURL=e,r++,t.children){var i=!0,a=!1,o=void 0;try{for(var s,u=(0,p.default)(t.children);!(i=(s=u.next()).done);i=!0){var h=s.value;n(h,e)}}catch(t){a=!0,o=t}finally{try{!i&&u.return&&u.return()}finally{if(a)throw o}}}}.bind(this);n(t.root,e),this.extendTileset=function(t,e,r){n(t.root,r),this.index[e].children=[t.root]}}function a(){y.default.call(this),this.b3dmLoader=new _.default}function o(t,e){if(t.region){var r=t.region,n=new L.default("EPSG:4326",R.default.radToDeg(r[0]),R.default.radToDeg(r[2]),R.default.radToDeg(r[1]),R.default.radToDeg(r[3])),i=S.default.extentToOBB(n,r[4],r[5]);return i.position.add(n.center().as("EPSG:4978").xyz()),i.updateMatrix(),i.matrix.premultiply(e),i.matrix.decompose(i.position,i.quaternion,i.scale),{region:i}}if(t.box){var a=t.box,o=new v.Vector3(a[0],a[1],a[2]),s=o.x-a[3],u=o.x+a[3],h=o.y-a[7],c=o.y+a[7],l=o.z-a[11],d=o.z+a[11];return{box:new v.Box3(new v.Vector3(s,h,l),new v.Vector3(u,c,d))}}if(t.sphere){return{sphere:new v.Sphere(new v.Vector3(t.sphere[0],t.sphere[1],t.sphere[2]),t.sphere[3])}}}function s(t){if(-1===t.vertexShader.indexOf("USE_LOGDEPTHBUF")&&-1===t.vertexShader.indexOf("logdepthbuf_pars_vertex")){t.vertexShader="#include <logdepthbuf_pars_vertex>\n#define EPSILON 1e-6\n"+t.vertexShader;var e=U.exec(t.vertexShader),r=e[0].length+e.index;t.vertexShader=t.vertexShader.slice(0,r)+"\n#include <logdepthbuf_vertex>\n"+t.vertexShader.slice(r),t.fragmentShader=D.default+"\n#include <logdepthbuf_pars_fragment>\n"+t.fragmentShader,e=F.exec(t.fragmentShader),r=e[0].length+e.index,t.fragmentShader=t.fragmentShader.slice(0,r)+"\n#include <logdepthbuf_fragment>\n"+t.fragmentShader.slice(r),t.defines={USE_LOGDEPTHBUF:1,USE_LOGDEPTHBUF_EXT:1}}}function u(t,e,r,n){t.frustumCulled=!1,t.loaded=!0,t.layer=e.id,t.transform=r.transform?(new v.Matrix4).fromArray(r.transform):new v.Matrix4,t.applyMatrix(t.transform),t.geometricError=r.geometricError,t.tileId=r.tileId,t.additiveRefinement="add"===r.refine,t.parentFromLocalTransform=t.transform,t.worldFromLocalTransform=(new v.Matrix4).multiplyMatrices(n?n.worldFromLocalTransform:new v.Matrix4,t.parentFromLocalTransform);var i=new v.Matrix4;i.getInverse(t.worldFromLocalTransform),t.viewerRequestVolume=r.viewerRequestVolume?o(r.viewerRequestVolume,i):void 0,t.boundingVolume=o(r.boundingVolume,i),t.boundingVolume.region&&t.add(t.boundingVolume.region),t.updateMatrixWorld()}Object.defineProperty(e,"__esModule",{value:!0});var h=r(7),c=n(h),l=r(8),d=n(l),f=r(2),p=n(f);e.patchMaterialForLogDepthSupport=s;var m=r(1),v=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(m),g=r(70),y=n(g),x=r(298),_=n(x),b=r(305),w=n(b),M=r(16),E=n(M),T=r(76),S=n(T),A=r(12),L=n(A),P=r(43),R=n(P),C=r(35),O=n(C),I=r(263),D=n(I),N=r(107);a.prototype=(0,d.default)(y.default.prototype),a.prototype.constructor=a,a.prototype.removeLayer=function(){},a.prototype.preprocessDataLayer=function(t,e,r){return t.sseThreshold=t.sseThreshold||16,E.default.json(t.url,t.networkOptions).then(function(n){t.tileset=n;var a=t.url.slice(0,t.url.lastIndexOf("/")+1);return t.tileIndex=new i(n,a),t.asset=n.asset,(0,N.init3dTilesLayer)(e,r,t,n.root)})};var U=new RegExp("gl_Position.*(?![^]*gl_Position)"),F=new RegExp("[^\\w]*main[^\\w]*(void)?[^\\w]*{");a.prototype.b3dmToMesh=function(t,e){return this.b3dmLoader.parse(t,e.asset.gltfUpAxis).then(function(t){var r=function(t){t.frustumCulled=!1,t.material&&(e.overrideMaterials?t.material=new v.MeshLambertMaterial(16777215):O.default.isLogDepthBufferSupported()&&t.material.isRawShaderMaterial&&!e.doNotPatchMaterial&&(s(t.material),console.warn("b3dm shader has been patched to add log depth buffer support")))};return t.gltf.scene.traverse(r),{batchTable:t.batchTable,object3d:t.gltf.scene}})},a.prototype.pntsParse=function(t){return new c.default(function(e){e({object3d:w.default.parse(t).point})})};var B=new t("utf-8");a.prototype.executeCommand=function(t){var e=t.layer,r=t.metadata,n=new v.Object3D;u(n,e,r,t.requester);var i=r.content?r.content.url:void 0,a=function(t){t.layers.set(e.threejsLayer)};if(i){var o=i.startsWith("http")?i:r.baseURL+i,s={b3dm:this.b3dmToMesh.bind(this),pnts:this.pntsParse.bind(this)};return E.default.arrayBuffer(o,e.networkOptions).then(function(t){if(void 0!==t){var i=void 0,u=B.decode(new Uint8Array(t,0,4));if("{"===u[0]){t=JSON.parse(B.decode(new Uint8Array(t)));var h=o.slice(0,o.lastIndexOf("/")+1);e.tileIndex.extendTileset(t,r.tileId,h)}else"b3dm"==u?i=s.b3dm:"pnts"==u?i=s.pnts:c.default.reject("Unsupported magic code "+u);if(i)return i(t,e).then(function(t){return n.content=t.object3d,t.batchTable&&(n.batchTable=t.batchTable),n.add(t.object3d),n.traverse(a),n})}return n.traverse(a),n})}return new c.default(function(t){n.traverse(a),t(n)})},e.default=a}).call(e,r(45).TextDecoder)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e,r,n,i){var a={view:t,requester:i,layer:r,priority:1e4,metadata:n,redraw:!1};return e.execute(a)}function a(t,e,r){if(!r.pendingSubdivision&&0==r.children.filter(function(t){return t.layer==e.id}).length){r.pendingSubdivision=!0;var n=e.tileIndex.index[r.tileId].children;if(void 0===n)return;for(var a=[],o=0;o<n.length;o++)a.push(i(t.view,t.scheduler,e,n[o],r).then(function(e){r.add(e),e.updateMatrixWorld(),r.additiveRefinement&&t.view.notifyChange(!0)}));v.default.all(a).then(function(){r.pendingSubdivision=!1,t.view.notifyChange(!0)})}}function o(t,e){if(t.viewerRequestVolume){var r=t.viewerRequestVolume;if(r.region)return!0;if(r.box)return!0;if(r.sphere){var n=r.sphere.center.clone();if(n.applyMatrix4(t.matrixWorld),!(e.camera3D.position.distanceTo(n)<=r.sphere.radius))return!0}}if(t.boundingVolume){var i=t.boundingVolume;if(i.region)return!e.isBox3Visible(i.region.box3D,i.region.matrixWorld);if(i.box)return!e.isBox3Visible(i.box,t.matrixWorld);if(i.sphere)return!e.isSphereVisible(i.sphere,t.matrixWorld)}return!1}function s(t,e){var r=Math.sqrt(t.camera.width*t.camera.width+t.camera.height*t.camera.height),n=t.camera.camera3D.fov*Math.PI/180,i=2*Math.atan(Math.tan(.5*n)*r/t.camera.width);return t.camera.preSSE=r*(2*Math.tan(.5*i)),[e.root]}function u(t,e){if(e.boundingVolume.region){var r=t.camera3D.position.clone();r.x-=e.boundingVolume.region.matrixWorld.elements[12],r.y-=e.boundingVolume.region.matrixWorld.elements[13],r.z-=e.boundingVolume.region.matrixWorld.elements[14];var n=e.boundingVolume.region.box3D.distanceToPoint(r);return t.preSSE*(e.geometricError/n)}if(e.boundingVolume.box){var i=t.camera3D.position.clone();i.x-=e.matrixWorld.elements[12],i.y-=e.matrixWorld.elements[13],i.z-=e.matrixWorld.elements[14];var a=e.boundingVolume.box.distanceToPoint(i);return t.preSSE*(e.geometricError/a)}if(e.boundingVolume.sphere){var o=t.camera3D.position.clone();o.x-=e.matrixWorld.elements[12],o.y-=e.matrixWorld.elements[13],o.z-=e.matrixWorld.elements[14];var s=e.boundingVolume.sphere.distanceToPoint(o);return t.preSSE*(e.geometricError/s)}return 1/0}function h(t,e,r){return i(t,e,r,r.tileset.root).then(function(t){r.object3d.add(t),t.updateMatrixWorld(),r.root=t})}function c(t,e){t.content&&(t.content.visible=e)}function l(t,e){return function(r,n,i){if(i.parent.pendingSubdivision&&!i.parent.additiveRefinement)return void(i.visible=!1);var o=!t||!t(i,r.camera);i.visible=o;var s=void 0;if(o){if(i.pendingSubdivision||e(r,n,i)?(a(r,n,i),c(i,i.pendingSubdivision||i.additiveRefinement),s=i.children.filter(function(t){return t.layer==n.id})):c(i,!0),void 0===i.material||i.material.visible){var u=!0,h=!1,l=void 0;try{for(var d,f=(0,p.default)(i.children.filter(function(t){return t.layer==n.id}));!(u=(d=f.next()).done);u=!0){d.value.visible=!1}}catch(t){h=!0,l=t}finally{try{!u&&f.return&&f.return()}finally{if(h)throw l}}}return s}}}function d(t,e,r){return u(t.camera,r)>e.sseThreshold}Object.defineProperty(e,"__esModule",{value:!0});var f=r(2),p=n(f),m=r(7),v=n(m);e.$3dTilesCulling=o,e.pre3dTilesUpdate=s,e.init3dTilesLayer=h,e.process3dTilesNode=l,e.$3dTilesSubdivisionControl=d},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t){var e=t.mainLoop.gfxEngine.getWindowSize(),r=e.length(),n=t.camera.camera3D.fov*Math.PI/180,i=2*Math.atan(Math.tan(.5*n)*r/e.x);return r*(2*Math.tan(.5*i))}function a(t,e){L.getInverse(e.object3d.matrixWorld),L.premultiply((new y.Matrix4).makeScale(1/(0,b.ellipsoidSizes)().x,1/(0,b.ellipsoidSizes)().y,1/(0,b.ellipsoidSizes)().z)),T.copy(t.camera.camera3D.position).applyMatrix4(L),S=T.lengthSq()-1,t.camera.preSSE=i(t.view)}function o(t){var e=t.applyMatrix4(L).sub(T),r=e.lengthSq(),n=-e.dot(T);return S<n&&S<n*n/r}function s(t){var e=t.OBB().pointsWorld,r=!0,n=!1,i=void 0;try{for(var a,s=(0,v.default)(e);!(r=(a=s.next()).done);r=!0){if(!o(a.value.clone()))return!0}}catch(t){n=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(n)throw i}}return!1}function u(t,e){return e.isBox3Visible(t.OBB().box3D,t.OBB().matrixWorld)}function h(t){return function(e,r){return!(u(e,r)&&(e.level<t||s(e)))}}function c(t,e){var r=new y.Vector3;r.setFromMatrixScale(e.matrixWorld);var n=(new y.Vector3).addVectors(e.geometry.boundingSphere.center,e.boundingSphereOffset).applyMatrix4(e.matrixWorld),i=Math.max(0,t.camera3D.position.distanceTo(n)-e.geometry.boundingSphere.radius*r.x);return t.preSSE*(e.geometricError*r.x)/i}function l(t,e,r){return A=r,function(r,n,i){if(i.level<t)return!0;if(e<=i.level)return!1;var a=c(r.camera,i);return A<a}}function d(t){var e=[];0===t?(e.push(new E.default("EPSG:4326",0,_.default.PI,-_.default.PI_OV_TWO,_.default.PI_OV_TWO)),e.push(new E.default("EPSG:4326",_.default.PI,_.default.TWO_PI,-_.default.PI_OV_TWO,_.default.PI_OV_TWO))):1==t&&(e.push(new E.default("EPSG:4326",-_.default.PI,0,-_.default.PI_OV_TWO,_.default.PI_OV_TWO)),e.push(new E.default("EPSG:4326",0,_.default.PI,-_.default.PI_OV_TWO,_.default.PI_OV_TWO)));var r=!0,n=!1,i=void 0;try{for(var a,o=(0,v.default)(e);!(r=(a=o.next()).done);r=!0){a.value._internalStorageUnit=b.UNIT.RADIAN}}catch(t){n=!0,i=t}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}return e}function f(t,e){var r=(0,b.ellipsoidSizes)().x,n=w.SIZE_TEXTURE_TILE*(.5*A)/e.camera.preSSE/r,i=t*n,a=Math.log(Math.PI/(2*Math.asin(i)))/Math.log(2),o=Math.PI/Math.pow(2,a);return i=(t-2*r*Math.sin(.5*o)*.5)*n,a=Math.log(Math.PI/(2*Math.asin(i)))/Math.log(2),isNaN(a)?0:Math.round(a)}function p(t,e){var r=Math.PI/Math.pow(2,t),n=2*(0,b.ellipsoidSizes)().x*Math.sin(.5*r),i=.5*n,a=i/w.SIZE_TEXTURE_TILE;return e.camera.preSSE*a/(.5*A)+i}Object.defineProperty(e,"__esModule",{value:!0}),e.globeSchemeTile1=e.globeSchemeTile0=void 0;var m=r(2),v=n(m);e.preGlobeUpdate=a,e.globeCulling=h,e.globeSubdivisionControl=l,e.globeSchemeTileWMTS=d,e.computeTileZoomFromDistanceCamera=f,e.computeDistanceCameraFromTileZoom=p;var g=r(1),y=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(g),x=r(43),_=n(x),b=r(6),w=r(26),M=r(12),E=n(M),T=new y.Vector3,S=void 0,A=void 0,L=new y.Matrix4;e.globeSchemeTile0=0,e.globeSchemeTile1=1},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e,r){if(e.isEmpty())return 0;p.box3.copy(e),r?p.matrix4.multiplyMatrices(t._viewMatrix,r):p.matrix4.copy(t._viewMatrix),p.points[0].set(p.box3.min.x,p.box3.min.y,p.box3.min.z).applyMatrix4(p.matrix4),p.points[1].set(p.box3.min.x,p.box3.min.y,p.box3.max.z).applyMatrix4(p.matrix4),p.points[2].set(p.box3.min.x,p.box3.max.y,p.box3.min.z).applyMatrix4(p.matrix4),p.points[3].set(p.box3.min.x,p.box3.max.y,p.box3.max.z).applyMatrix4(p.matrix4),p.points[4].set(p.box3.max.x,p.box3.min.y,p.box3.min.z).applyMatrix4(p.matrix4),p.points[5].set(p.box3.max.x,p.box3.min.y,p.box3.max.z).applyMatrix4(p.matrix4),p.points[6].set(p.box3.max.x,p.box3.max.y,p.box3.min.z).applyMatrix4(p.matrix4),p.points[7].set(p.box3.max.x,p.box3.max.y,p.box3.max.z).applyMatrix4(p.matrix4);var n=!0,i=!1,a=void 0;try{for(var o,s=(0,u.default)(p.points);!(n=(o=s.next()).done);n=!0){var h=o.value;h.x=t.width*(h.x+1)*.5,h.y=t.height*(1-h.y)*.5,h.z=0}}catch(t){i=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}var l=(0,d.default)(p.points.map(function(t){return[t.x,t.y]})),f=l.map(function(t){return p.points[t]}),m=c.ShapeUtils.area(f);return Math.abs(m)}function a(t,e,r){var n=0;if(e.octreeDepthLimit>=0&&e.octreeDepthLimit<r.name.length)return{shouldBeLoaded:n,surfaceOnScreen:0};var a=r.numPoints,o=r.tightbbox?r.tightbbox:r.bbox;if(t.camera.isBox3Visible(o))if(o.containsPoint(t.camera.camera3D.position))n=1;else{var s=i(t.camera,o);if(0==a)n=1;else{var u=e.overdraw*(s/Math.pow(e.pointSize,2));n=Math.min(u/a,1)}r.surfaceOnScreen=s}else n=-1;return{shouldBeLoaded:n,surfaceOnScreen:0}}function o(t){t.obj&&(t.obj.material.visible=!1),t.notVisibleSince||(t.notVisibleSince=Date.now(),t.shouldBeLoaded=-1);var e=!0,r=!1,n=void 0;try{for(var i,a=(0,u.default)(t.children);!(e=(i=a.next()).done);e=!0){o(i.value)}}catch(t){r=!0,n=t}finally{try{!e&&a.return&&a.return()}finally{if(r)throw n}}}Object.defineProperty(e,"__esModule",{value:!0});var s=r(2),u=n(s),h=r(1),c=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(h),l=r(427),d=n(l),f=r(27),p={points:[new c.Vector3,new c.Vector3,new c.Vector3,new c.Vector3,new c.Vector3,new c.Vector3,new c.Vector3,new c.Vector3],box3:new c.Box3,matrix4:new c.Matrix4};e.default={preUpdate:function(t,e){return e.counters={pointCount:0,displayedCount:0},e.root?(e.group||(e.group=new c.Group,t.view.scene.add(e.group)),e.bboxes||(e.bboxes=new c.Group,e.bboxes.layers.set(t.view.mainLoop.gfxEngine.getUniqueThreejsLayer()),t.view.scene.add(e.bboxes)),[e.root]):[]},update:function(t,e,r){var n=a(t,e,r),i=n.shouldBeLoaded;if(r.shouldBeLoaded=i,i>0){if(r.notVisibleSince=void 0,r.numPoints>0)if(r.obj){r.obj.material.visible=!0;r.obj.geometry.setDrawRange(0,Math.floor(i*r.obj.geometry.attributes.position.count)),e.counters.pointCount+=r.obj.realPointCount,e.counters.displayedCount+=Math.floor(i*r.obj.geometry.attributes.position.count),r.obj.material.uniforms.size.value=e.pointSize}else r.promise||(r.promise=t.scheduler.execute({layer:e,requester:r,view:t.view,priority:1/r.name.length,redraw:!0,isLeaf:0==r.childrenBitField,earlyDropFunction:function(t){return t.requester.shouldBeLoaded<=0}}).then(function(t){r.obj=t,r.tightbbox=t.tightbbox,t.geometry.setDrawRange(0,i*t.geometry.attributes.position.count),e.group.add(r.obj),r.obj.owner=r,r.promise=null},function(t){t instanceof f.CancelledCommandException&&(r.promise=null)}))}else o(r);if(i>=.9&&r.children&&r.children.length)return r.children},postUpdate:function(t,e){if(e.group){if(e.counters.displayedCount>e.pointBudget){var r=e.pointBudget/e.counters.displayedCount,n=!0,i=!1,a=void 0;try{for(var o,s=(0,u.default)(e.group.children);!(n=(o=s.next()).done);n=!0){var h=o.value;h.material.visible&&h.geometry.setDrawRange(0,h.geometry.drawRange.count*r)}}catch(t){i=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}e.counters.displayedCount*=r}for(var c=Date.now(),l=e.group.children.length-1;l>=0;l--){var d=e.group.children[l];!d.material.visible&&c-d.owner.notVisibleSince>1e4&&(e.group.children.splice(l,1),d.material.dispose(),d.geometry.dispose(),d.material=null,d.geometry=null,d.owner.obj=null)}}},selectAt:function(t,e,r){if(e.root){t.scene.traverse(function(t){t.isPoints&&t.baseId&&t.material.enablePicking(!0)});var n=t.mainLoop.gfxEngine.renderViewTobuffer(t,t.mainLoop.gfxEngine.fullSizeRenderTarget,r.x,r.y,1,1),i=n[0]<<8|n[1],a=n[2]<<8|n[3],o=void 0;return t.scene.traverse(function(t){t.isPoints&&t.baseId&&(t.material.enablePicking(!1),o||t.baseId!==i||(o={points:t,index:a}))}),o}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2),i=function(t){return t&&t.__esModule?t:{default:t}}(n);e.default={preUpdate:function(t,e){t.colorLayers=t.view.getLayers(function(t,r){return r&&r.id==e.id&&"color"==t.type}),t.elevationLayers=t.view.getLayers(function(t,r){return r&&r.id==e.id&&"elevation"==t.type})},hasEnoughTexturesToSubdivide:function(t,e,r){var n=!0,a=!1,o=void 0;try{for(var s,u=(0,i.default)(t.elevationLayers);!(n=(s=u.next()).done);n=!0){var h=s.value;if(!h.frozen&&h.tileInsideLimit(r,h)&&!r.isElevationLayerLoaded()){if(r.layerUpdateState[h.id]&&r.layerUpdateState[h.id].inError())continue;return!1}}}catch(t){a=!0,o=t}finally{try{!n&&u.return&&u.return()}finally{if(a)throw o}}var c=!0,l=!1,d=void 0;try{for(var f,p=(0,i.default)(t.colorLayers);!(c=(f=p.next()).done);c=!0){var m=f.value;if(!m.frozen&&m.visible&&((!r.layerUpdateState[m.id]||!r.layerUpdateState[m.id].inError())&&m.tileInsideLimit(r,m)&&!r.isColorLayerLoaded(m.id)))return!1}}catch(t){l=!0,d=t}finally{try{!c&&p.return&&p.return()}finally{if(l)throw d}}return!0}}},function(t,e,r){"use strict";function n(t,e){var r=o.ImageryLayers.getColorLayersIdOrderedBySequence(e),n=function(t){t.changeSequenceLayers&&t.changeSequenceLayers(r)},i=!0,s=!1,u=void 0;try{for(var h,c=(0,a.default)(t.level0Nodes);!(i=(h=c.next()).done);i=!0){h.value.traverse(n)}}catch(t){s=!0,u=t}finally{try{!i&&c.return&&c.return()}finally{if(s)throw u}}}Object.defineProperty(e,"__esModule",{value:!0}),e.ColorLayersOrdering=e.COLOR_LAYERS_ORDER_CHANGED=void 0;var i=r(2),a=function(t){return t&&t.__esModule?t:{default:t}}(i),o=r(25),s=e.COLOR_LAYERS_ORDER_CHANGED="layers-order-changed";e.ColorLayersOrdering={moveLayerUp:function(t,e){var r=t.getLayers(function(t){return"color"===t.type}),i=t.getLayers(function(t){return t.id===e})[0];if(!i)throw new Error(e+" isn't color layer");var a=o.ImageryLayers.getColorLayersIdOrderedBySequence(r);o.ImageryLayers.moveLayerUp(i,r),n(t.wgs84TileLayer,r),t.dispatchEvent({type:s,previous:{sequence:a},new:{sequence:o.ImageryLayers.getColorLayersIdOrderedBySequence(r)}}),t.notifyChange(!0)},moveLayerDown:function(t,e){var r=t.getLayers(function(t){return"color"===t.type}),i=t.getLayers(function(t){return t.id===e})[0];if(!i)throw new Error(e+" isn't color layer");var a=o.ImageryLayers.getColorLayersIdOrderedBySequence(r);o.ImageryLayers.moveLayerDown(i,r),n(t.wgs84TileLayer,r),t.dispatchEvent({type:s,previous:{sequence:a},new:{sequence:o.ImageryLayers.getColorLayersIdOrderedBySequence(r)}}),t.notifyChange(!0)},moveLayerToIndex:function(t,e,r){var i=t.getLayers(function(t){return"color"===t.type}),a=t.getLayers(function(t){return t.id===e})[0];if(!a)throw new Error(e+" isn't color layer");var u=o.ImageryLayers.getColorLayersIdOrderedBySequence(i);o.ImageryLayers.moveLayerToIndex(a,r,i),n(t.wgs84TileLayer,i),t.dispatchEvent({type:s,previous:{sequence:u},new:{sequence:o.ImageryLayers.getColorLayersIdOrderedBySequence(i)}}),t.notifyChange(!0)}}},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var r=new t("utf-8");e.default={parse:function(t){var e=r.decode(new Uint8Array(t));return JSON.parse(e)}}}).call(e,r(45).TextDecoder)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t){t.updateMatrixWorld(),this.matrixWorld=new f.Matrix4,this.projectionMatrix=new f.Matrix4,this.invProjectionMatrix=new f.Matrix4,this.position=new f.Vector3,this.init=function(t){this.matrixWorld.copy(t.matrixWorld),this.projectionMatrix.copy(t.projectionMatrix),this.position.copy(t.position),this.invProjectionMatrix.getInverse(this.projectionMatrix)},this.init(t),this.shot=function(t){t.updateMatrixWorld(),this.matrixWorld.copy(t.matrixWorld),this.position.copy(t.position)};var e=new f.Matrix4;this.updateRay=function(t,r){t.origin.copy(this.position),t.direction.set(r.x,r.y,.5),e.multiplyMatrices(this.matrixWorld,this.invProjectionMatrix),t.direction.applyMatrix4(e),t.direction.sub(t.origin).normalize()}}function a(){var t={};return t.promise=new l.default(function(e,r){t.resolve=e,t.reject=r}),t}function o(t,e,r){function n(t){return t&&!("damping-move"===t.name||"damping-orbit"===t.name)}var o=this,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Y=new g.default,this._view=t,this.camera=t.camera.camera3D,this.domElement=t.mainLoop.gfxEngine.renderer.domElement,Mt=new i(this.camera),this.waitSceneLoaded=function(){var t=a();return this._view.mainLoop.addEventListener("command-queue-empty",function(){t.resolve()}),t.promise},this.enabled=!0,this.enableZoom=!0,this.zoomSpeed=s.zoomSpeed||2,this.minDistance=s.minDistance||30,this.maxDistance=s.maxDistance||8*r,this.minZoom=0,this.maxZoom=1/0,this.enableRotate=!0,this.rotateSpeed=s.rotateSpeed||.25,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.minPolarAngle=.01,this.maxPolarAngle=.5*Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableKeys=!0,this.enableDamping=!0,gt&&(this.pickingHelper=new f.AxisHelper(5e5)),this.mouseButtons={PANORAMIC:f.MOUSE.LEFT,ZOOM:f.MOUSE.MIDDLE,PAN:f.MOUSE.RIGHT},ft.setRadius(r),P.radius=ft.radius,dt.copy(t.mainLoop.gfxEngine.getWindowSize()),dt.FOV=this.camera.fov,this.startEvent={type:"start"},this.endEvent={type:"end"},this.updateCamera=function(){Mt.init(this.camera),dt.width=this.domElement.clientWidth,dt.height=this.domElement.clientHeight,dt.FOV=this.camera.fov},window.addEventListener("resize",this.updateCamera.bind(this),!1),this.getAutoRotationAngle=function(){return 2*Math.PI/60/60*this.autoRotateSpeed},this.getDollyScale=function(){return Math.pow(.95,this.zoomSpeed)},this.rotateLeft=function(t){void 0===t&&(t=this.getAutoRotationAngle()),C.theta-=t},this.rotateUp=function(t){void 0===t&&(t=this.getAutoRotationAngle()),C.phi-=t},this.panLeft=function(t){var e=this.camera.matrix.elements;F.set(e[0],e[1],e[2]),F.multiplyScalar(-t),st.add(F)},this.panUp=function(t){var e=this.camera.matrix.elements;F.set(e[4],e[5],e[6]),F.multiplyScalar(t),st.add(F)},this.mouseToPan=function(t,e){var r=this.domElement===document?this.domElement.body:this.domElement;if(this.camera instanceof f.PerspectiveCamera){var n=this.camera.position,i=n.clone().sub(this.getCameraTargetPosition()),a=i.length();a*=Math.tan(this.camera.fov/2*Math.PI/180),this.panLeft(2*t*a*this.camera.aspect/r.clientWidth),this.panUp(2*e*a/r.clientHeight)}else this.camera instanceof f.OrthographicCamera&&(this.panLeft(t*(this.camera.right-this.camera.left)/r.clientWidth),this.panUp(e*(this.camera.top-this.camera.bottom)/r.clientHeight))},this.dollyIn=function(t){void 0===t&&(t=this.getDollyScale()),this.camera instanceof f.PerspectiveCamera?I.scale/=t:this.camera instanceof f.OrthographicCamera&&(this.camera.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.camera.zoom*t)),this.camera.updateProjectionMatrix(),this._view.notifyChange(!0,this.camera))},this.dollyOut=function(t){void 0===t&&(t=this.getDollyScale()),this.camera instanceof f.PerspectiveCamera?I.scale*=t:this.camera instanceof f.OrthographicCamera&&(this.camera.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.camera.zoom/t)),this.camera.updateProjectionMatrix(),this._view.notifyChange(!0,this.camera))};var u=new f.Quaternion,h=new f.Quaternion,c=new f.Vector3(1,0,0),l=function(){if(ct===b.MOVE_GLOBE)H.copy(this.getCameraTargetPosition()).applyQuaternion(V),this.camera.position.copy(Mt.position).applyQuaternion(V),q.progress>0&&this.camera.position.lerp(H,q.progress*W),this.camera.up.copy(H.clone().normalize());else if(ct===b.PAN)this.camera.position.add(st),H.add(st),this.camera.up.copy(H.clone().normalize());else if(ct===b.PANORAMIC){this.camera.worldToLocal(H);var t=this.camera.position.clone().normalize().applyQuaternion(this.camera.quaternion.clone().inverse());u.setFromAxisAngle(t,C.theta).multiply(h.setFromAxisAngle(c,C.phi)),H.applyQuaternion(u),this.camera.localToWorld(H),this.camera.up.copy(H.clone().normalize())}else B.copy(this.camera.position).applyMatrix4(k.matrixWorldInverse),(C.theta||C.phi)&&P.setFromVector3(B),this.autoRotate&&ct===b.NONE&&this.rotateLeft(this.getAutoRotationAngle()),P.theta+=C.theta,P.phi+=C.phi,P.theta=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,P.theta)),P.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,P.phi)),P.radius=B.length()*I.scale,P.makeSafe(),P.radius=Math.max(this.minDistance,Math.min(this.maxDistance,P.radius)),B.setFromSpherical(P),this.camera.position.copy(k.localToWorld(B));this.camera.lookAt(H),this.enableDamping?(C.theta*=1-q.dampingFactor,C.phi*=1-q.dampingFactor):(C.theta=0,C.phi=0),I.scale=1,st.set(0,0,0),(ut.distanceToSquared(this.camera.position)>T||8*(1-ht.dot(this.camera.quaternion))>T)&&(this._view.notifyChange(!0,this.camera),ut.copy(this.camera.position),ht.copy(this.camera.quaternion)),this.enableDamping&&ct===b.ORBIT&&Y.isStopped()&&(C.theta>T||C.phi>T)&&Y.playLater(nt,2)}.bind(this);this.getSpace=function(){return E},this.getSphericalDelta=function(){return C};var d=function(){var t=(new f.Quaternion).setFromAxisAngle(new f.Vector3(1,0,0),Math.PI/2);return function(e,r){r.position.copy(e),r.lookAt(e.clone().multiplyScalar(1.1)),r.quaternion.multiply(t),r.updateMatrixWorld()}}(),p=function(t){d(t,k),k.matrixWorldInverse.getInverse(k.matrixWorld)},m=new f.Vector3,v=function(){var e=k.position.clone(),r=t.getPickingPositionFromDepth();if(r){var n=r.distanceTo(this.camera.position);if(m.subVectors(H,this.camera.position),m.setLength(n),H.addVectors(this.camera.position,m),p(H),B.copy(this.camera.position),B.applyMatrix4(k.matrixWorldInverse),P.setFromVector3(B),bt){ct===b.ORBIT&&(Math.abs(R.phi-P.phi)>.001||Math.abs(R.theta-P.theta)>.001)?this.dispatchEvent({type:wt.ORIENTATION_CHANGED,previous:{tilt:180*R.phi/Math.PI,heading:180*R.theta/Math.PI},new:{tilt:180*P.phi/Math.PI,heading:180*P.theta/Math.PI}}):ct===b.PAN&&this.dispatchEvent({type:wt.PAN_CHANGED});var i=R.radius,a=this.getRange();Math.abs(a-i)/i>.001&&this.dispatchEvent({type:wt.RANGE_CHANGED,previous:{range:i},new:{range:a}}),k.position.distanceTo(e)/P.radius>.001&&this.dispatchEvent({type:wt.CAMERA_TARGET_CHANGED,previous:{cameraTarget:new x.default(this._view.referenceCrs,e)},new:{cameraTarget:new x.default(this._view.referenceCrs,k.position)}}),R.copy(P)}ct=b.NONE,Z=[],gt&&this._view.notifyChange(!0,k)}},y=gt?function(t,e){d(t,e),this._view.notifyChange(!0,k)}:function(){};this.getPickingPositionOnSphere=function(){return ft.picking.position};var _=function(){var t=new f.Vector2,e=new f.Ray;return function(r,n){ft.setRadius(r.length()),t.x=n.x/dt.width*2-1,t.y=-n.y/dt.height*2+1,Mt.updateRay(e,t);var i=ft.intersectWithRay(e);void 0!=i&&(ft.picking.position.copy(i),ft.picking.normal=ft.picking.position.clone().normalize(),Z.push(ft.picking.normal),y.bind(this)(ft.picking.position,yt))}}(),M=function(){var t=new f.Ray,e=new f.Vector2;return function(r){if(Y.isPlaying()&&Y.stop(),!1!==this.enabled){if(r.preventDefault(),ct===b.ORBIT||ct===b.PANORAMIC){if(!1===this.enableRotate)return;A.set(r.clientX-r.target.offsetLeft,r.clientY-r.target.offsetTop),L.subVectors(A,S),E?(this.rotateLeft(L.x),this.rotateUp(L.y)):(this.rotateLeft(2*Math.PI*L.x/dt.width*this.rotateSpeed),this.rotateUp(2*Math.PI*L.y/dt.height*this.rotateSpeed)),S.copy(A)}else if(ct===b.DOLLY){if(!1===this.enableZoom)return;G.set(r.clientX-r.target.offsetLeft,r.clientY-r.target.offsetTop),j.subVectors(G,z),j.y>0?this.dollyIn():j.y<0&&this.dollyOut(),z.copy(G)}else if(ct===b.PAN){if(!1===this.enablePan)return;N.set(r.clientX-r.target.offsetLeft,r.clientY-r.target.offsetTop),U.subVectors(N,D),this.mouseToPan(U.x,U.y),D.copy(N)}else if(ct===b.MOVE_GLOBE){e.x=(r.clientX-r.target.offsetLeft)/dt.width*2-1,e.y=-(r.clientY-r.target.offsetTop)/dt.height*2+1,Mt.updateRay(t,e);var n=ft.intersectWithRay(t);if(n){var i=n.normalize();V.setFromUnitVectors(i,ft.picking.normal),Z.push(i.clone()),K=Date.now(),Z.length>2&&Z.splice(0,1)}else Q.bind(this)()}ct!==b.NONE&&l()}}}(),O=function(e){var r=this;Y.stop().then(function(){if(!1!==r.enabled){if(e.preventDefault(),e.button===r.mouseButtons.PANORAMIC){if(!1===r.enableRotate)return;if(pt)ct=b.ORBIT;else if(mt)ct=b.PANORAMIC;else if(vt)r._view.selectNodeAt(new f.Vector2(e.clientX-e.target.offsetLeft,e.clientY-e.target.offsetTop));else{Mt.shot(r.camera),lt.x=e.clientX-e.target.offsetLeft,lt.y=e.clientY-e.target.offsetTop;var n=t.getPickingPositionFromDepth(lt);Z=[],n&&(q.range=r.getRange(),_.bind(r)(n,lt),ct=b.MOVE_GLOBE)}S.set(e.clientX-e.target.offsetLeft,e.clientY-e.target.offsetTop)}else if(e.button===r.mouseButtons.ZOOM){if(!1===r.enableZoom)return;ct=b.DOLLY,z.set(e.clientX-e.target.offsetLeft,e.clientY-e.target.offsetTop)}else if(e.button===r.mouseButtons.PAN){if(!1===r.enablePan)return;ct=b.PAN,D.set(e.clientX-e.target.offsetLeft,e.clientY-e.target.offsetTop)}ct!==b.NONE&&(r.domElement.addEventListener("mousemove",xt,!1),r.domElement.addEventListener("mouseup",_t,!1),r.domElement.addEventListener("mouseleave",_t,!1),r.dispatchEvent(r.startEvent))}})},X=function(e){if(!1!==this.enabled&&!pt&&!mt){lt.x=e.clientX-e.target.offsetLeft,lt.y=e.clientY-e.target.offsetTop;var r=t.getPickingPositionFromDepth(lt);r&&(W=.6,this.setCameraTargetPosition(r,this.isAnimationEnabled()))}},Q=function(){var t=this;!1!==this.enabled&&(this.domElement.removeEventListener("mousemove",xt,!1),this.domElement.removeEventListener("mouseup",_t,!1),this.domElement.removeEventListener("mouseleave",_t,!1),this.dispatchEvent(this.endEvent),Y.stop(),this.enableDamping?ct===b.ORBIT&&(C.theta>T||C.phi>T)?Y.play(nt).then(function(){return t.resetControls()}):ct===b.MOVE_GLOBE&&2===Z.length&&Date.now()-K<50&&!Z[1].equals(Z[0])?(q.qDelta.setFromUnitVectors(Z[1],Z[0]),Y.play(tt).then(function(){return t.resetControls()})):v.bind(this)():v.bind(this)())},J=function(t){var e=this;Y.stop().then(function(){if(!1!==e.enabled&&!1!==e.enableZoom){t.preventDefault(),t.stopPropagation();var r=0;void 0!==t.wheelDelta?r=t.wheelDelta:void 0!==t.detail&&(r=-t.detail),r>0?e.dollyOut():r<0&&e.dollyIn();var n=e.getRange();l();var i=e.getRange();Math.abs(i-n)/n>.001&&bt&&e.dispatchEvent({type:wt.RANGE_CHANGED,previous:{range:n},new:{range:i}}),R.copy(P),e.dispatchEvent(e.startEvent),e.dispatchEvent(e.endEvent)}})},$=function(){!1!==this.enabled&&!1!==this.enableKeys&&!1!==this.enablePan&&(ct===b.PAN&&v.bind(this)(),pt=!1,mt=!1,vt=!1)},et=function(t){var e=this;Y.stop().then(function(){if(!1!==e.enabled&&!1!==e.enableKeys&&!1!==e.enablePan)switch(pt=!1,mt=!1,t.keyCode){case w.UP:e.mouseToPan(0,e.keyPanSpeed),ct=b.PAN,l();break;case w.BOTTOM:e.mouseToPan(0,-e.keyPanSpeed),ct=b.PAN,l();break;case w.LEFT:e.mouseToPan(e.keyPanSpeed,0),ct=b.PAN,l();break;case w.RIGHT:e.mouseToPan(-e.keyPanSpeed,0),ct=b.PAN,l();break;case w.SPACE:E=!E,l();break;case w.CTRL:pt=!0;break;case w.SHIFT:mt=!0;break;case w.S:vt=!0}})},rt=function(t){if(!1!==this.enabled){switch(t.touches.length){case 1:if(!1===this.enableRotate)return;ct=b.TOUCH_ROTATE,S.set(t.touches[0].pageX,t.touches[0].pageY);break;case 2:if(!1===this.enableZoom)return;ct=b.TOUCH_DOLLY;var e=t.touches[0].pageX-t.touches[1].pageX,r=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(e*e+r*r);z.set(0,n);break;case 3:if(!1===this.enablePan)return;ct=b.TOUCH_PAN,D.set(t.touches[0].pageX,t.touches[0].pageY);break;default:ct=b.NONE}ct!==b.NONE&&this.dispatchEvent(this.startEvent)}},Et=function(t){if(!1!==this.enabled){t.preventDefault(),t.stopPropagation();var e=this.domElement===document?this.domElement.body:this.domElement;switch(t.touches.length){case 1:if(!1===this.enableRotate)return;if(ct!==b.TOUCH_ROTATE)return;A.set(t.touches[0].pageX,t.touches[0].pageY),L.subVectors(A,S),this.rotateLeft(2*Math.PI*L.x/e.clientWidth*this.rotateSpeed),this.rotateUp(2*Math.PI*L.y/e.clientHeight*this.rotateSpeed),S.copy(A),l();break;case 2:if(!1===this.enableZoom)return;if(ct!==b.TOUCH_DOLLY)return;var r=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,i=Math.sqrt(r*r+n*n);G.set(0,i),j.subVectors(G,z),j.y>0?this.dollyOut():j.y<0&&this.dollyIn(),z.copy(G),l();break;case 3:if(!1===this.enablePan)return;if(ct!==b.TOUCH_PAN)return;N.set(t.touches[0].pageX,t.touches[0].pageY),U.subVectors(N,D),this.mouseToPan(U.x,U.y),D.copy(N),l();break;default:ct=b.NONE}}},Tt=function(){!1!==this.enabled&&(this.dispatchEvent(this.endEvent),ct=b.NONE,pt=!1,mt=!1,vt=!1)};this.resetControls=function(){Z.splice(0),q.progress=0,v.bind(this)()},this.updateCameraTransformation=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.enableDamping;this.enableDamping=!1,ct=t||b.ORBIT,l(),e&&v.bind(this)(),this.enableDamping=r},this.dispose=function(){this.domElement.removeEventListener("mousedown",O,!1),this.domElement.removeEventListener("mousewheel",J,!1),this.domElement.removeEventListener("DOMMouseScroll",J,!1),this.domElement.removeEventListener("touchstart",rt,!1),this.domElement.removeEventListener("touchend",Tt,!1),this.domElement.removeEventListener("touchmove",Et,!1),this.domElement.removeEventListener("mousemove",M,!1),this.domElement.removeEventListener("mouseup",Q,!1),window.removeEventListener("keydown",et,!1)},this.domElement.addEventListener("contextmenu",function(t){t.preventDefault()},!1),this.domElement.addEventListener("mousedown",O.bind(this),!1),this.domElement.addEventListener("mousewheel",J.bind(this),!1),this.domElement.addEventListener("dblclick",X.bind(this),!1),this.domElement.addEventListener("DOMMouseScroll",J.bind(this),!1),this.domElement.addEventListener("touchstart",rt.bind(this),!1),this.domElement.addEventListener("touchend",Tt.bind(this),!1),this.domElement.addEventListener("touchmove",Et.bind(this),!1),Y.addEventListener("animation-frame",l.bind(this)),Y.addEventListener("animation-started",function(t){n(t.animation)&&o.dispatchEvent({type:"animation-started"})}),Y.addEventListener("animation-ended",function(t){n(t.animation)&&o.dispatchEvent({type:"animation-ended"})}),window.addEventListener("keydown",et.bind(this),!1),window.addEventListener("keyup",$.bind(this),!1),p(e),H.copy(e),this.camera.up.copy(e.clone().normalize()),this._view.scene.add(k),P.radius=this.camera.position.length(),l(),gt&&(k.add(new f.AxisHelper(5e5)),this._view.scene.add(yt)),it=k.clone(),at=this.camera.position.clone(),ot=this.camera.zoom,R.copy(P),xt=M.bind(this),_t=Q.bind(this),this.waitSceneLoaded().then(function(){o.updateCameraTransformation(),o._view.notifyChange(!0,o.camera)})}function s(t,e){e=(e||.28)/1e3;var r=dt.FOV/180*Math.PI*.5;return e*dt.height/(2*t*Math.tan(r))}Object.defineProperty(e,"__esModule",{value:!0}),e.CONTROL_EVENTS=void 0;var u=r(8),h=n(u),c=r(7),l=n(c),d=r(1),f=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(d),p=r(275),m=n(p),v=r(271),g=n(v),y=r(6),x=n(y),_=r(108),b={NONE:-1,ORBIT:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5,MOVE_GLOBE:6,PANORAMIC:7},w={LEFT:37,UP:38,RIGHT:39,BOTTOM:40,SPACE:32,SHIFT:16,CTRL:17,S:83},M=function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var r=this._x,n=this._y,i=this._z,a=this._w,o=a*t._w+r*t._x+n*t._y+i*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=r,this._y=n,this._z=i,this;var s=Math.sqrt(1-o*o),u=Math.atan2(s,o),h=Math.sin((1-e)*u)/s,c=Math.sin(e*u)/s;return this._w=a*h+this._w*c,this._x=r*h+this._x*c,this._y=n*h+this._y*c,this._z=i*h+this._z*c,this.onChangeCallback(),this},E=!1,T=1e-6,S=new f.Vector2,A=new f.Vector2,L=new f.Vector2,P=new f.Spherical(1,.01,.5*Math.PI),R=new f.Spherical(1,.01,.5*Math.PI),C=new f.Spherical(1,0,0),O=new f.Spherical,I={spherical:P,sphericalDelta:C,sphericalTo:O,scale:1},D=new f.Vector2,N=new f.Vector2,U=new f.Vector2,F=new f.Vector3,B=new f.Vector3,z=new f.Vector2,G=new f.Vector2,j=new f.Vector2,V=new f.Quaternion,k=new f.Object3D,H=new f.Vector3,W=0,q={progress:0,quatGlobe:V,qDelta:new f.Quaternion,dampingFactor:.25};q.qDelta.presiceSlerp=M,V.presiceSlerp=M;var X=!0,Y=null,Z=[],K=0,Q=function(){var t=new f.Quaternion(0,0,0,1);return function(e){e.qDelta.presiceSlerp(t,.2*e.dampingFactor),e.quatGlobe.multiply(e.qDelta)}}(),J=function(t,e){t.quatGlobe.set(0,0,0,1),t.progress=1-Math.pow(1-(.5*Math.sin((e-.5)*Math.PI)+.5),2),t.quatGlobe.presiceSlerp(t.qDelta,t.progress)},$=function(t,e){t.scale=1-(1-t.sphericalTo.radius/t.spherical.radius)*e,t.sphericalDelta.theta=t.sphericalTo.theta,t.sphericalDelta.phi=t.sphericalTo.phi},tt=new v.AnimatedExpression({duration:120,root:q,expression:Q,name:"damping-move"}),et=new v.AnimatedExpression({duration:45,root:q,expression:J,name:"Zoom Center"}),rt=new v.AnimatedExpression({duration:30,root:I,expression:$,name:"set Orbit"}),nt=new v.Animation({duration:60,name:"damping-orbit"});k.matrixWorldInverse=new f.Matrix4;var it,at,ot,st=new f.Vector3,ut=new f.Vector3,ht=new f.Quaternion,ct=b.NONE,lt=new f.Vector2,dt=new f.Vector2,ft=new m.default;ft.picking={position:new f.Vector3,normal:new f.Vector3};var pt=!1,mt=!1,vt=!1,gt=!1,yt=void 0;gt&&(yt=new f.AxisHelper(5e5));var xt,_t,bt=!0,wt=e.CONTROL_EVENTS={PAN_CHANGED:"pan-changed",ORIENTATION_CHANGED:"orientation-changed",RANGE_CHANGED:"range-changed",CAMERA_TARGET_CHANGED:"camera-target-changed"},Mt=null;o.prototype=(0,h.default)(f.EventDispatcher.prototype),o.prototype.constructor=o,o.prototype.setTilt=function(t,e){return this.setOrbitalPosition({tilt:t},e)},o.prototype.setHeading=function(t,e){return this.setOrbitalPosition({heading:t},e)},o.prototype.setRange=function(t,e){return this.setOrbitalPosition({range:t},e)},o.prototype.setOrbitalPosition=function(t,e){var r=this;e=void 0===e?this.isAnimationEnabled():e;var n=void 0===t.tilt?0:t.tilt*Math.PI/180-this.getTiltRad(),i=void 0===t.heading?0:t.heading*Math.PI/180-this.getHeadingRad(),a=void 0===t.range?0:t.range-this.getRange();return this.moveOrbitalPosition(a,i,n,e).then(function(){return r._view.notifyChange(!0),r.waitSceneLoaded().then(function(){r.updateCameraTransformation()})})};var Et=new f.Spherical;o.prototype.moveOrbitalPosition=function(t,e,r,n){var i=this;n=void 0===n?this.isAnimationEnabled():n;var a=t+this.getRange();return n?(Et.theta=e+P.theta,Et.phi=r+P.phi,O.radius=a,O.theta=e/(rt.duration-1),O.phi=r/(rt.duration-1),ct=b.ORBIT,Y.play(rt).then(function(){Y.isEnded()&&i.moveOrbitalPosition(0,Et.theta-P.theta,Et.phi-P.phi,!1),i.resetControls()})):(C.theta=e,C.phi=r,I.scale=a/this.getRange(),this.updateCameraTransformation(b.ORBIT,!1),l.default.resolve())},o.prototype.getCameraTargetPosition=function(){return k.position},o.prototype.setCameraTargetPosition=function(t,e){var r=this;e=void 0===e?this.isAnimationEnabled():e;var n=this.getCameraTargetPosition();if(t.range){var i=new x.default(this._view.referenceCrs,n).as("EPSG:4326"),a=new y.C.EPSG_4326(i.longitude(),i.latitude(),0).as(this._view.referenceCrs).xyz(),o=t.length()-a.length();o>0&&(t.range+=o)}Mt.shot(this.camera),lt.x=this.domElement.width/2,lt.y=this.domElement.height/2;var s=n.clone().normalize(),u=t.normalize(),h=void 0;return e?(q.qDelta.setFromUnitVectors(s,u),t.range&&(W=1-t.range/this.getRange()),ct=b.MOVE_GLOBE,h=Y.play(et).then(function(){W=0,r.resetControls()})):(V.setFromUnitVectors(s,u),this.updateCameraTransformation(b.MOVE_GLOBE),W>0&&W<1&&this.setRange(this.getRange()*W),h=l.default.resolve()),h.then(function(){return r._view.notifyChange(!0),r.waitSceneLoaded().then(function(){r.updateCameraTransformation()})})},o.prototype.getRange=function(){return this.getCameraTargetPosition().distanceTo(this.camera.position)},o.prototype.getTilt=function(){return 180*P.phi/Math.PI},o.prototype.getHeading=function(){return 180*P.theta/Math.PI},o.prototype.getTiltRad=function(){return P.phi},o.prototype.getHeadingRad=function(){return P.theta},o.prototype.getPolarAngle=function(){return P.phi},o.prototype.getAzimuthalAngle=function(){return P.theta},o.prototype.moveTarget=function(){return H},o.prototype.pan=function(t){var e=this;return this.mouseToPan(t.x,t.y),this.updateCameraTransformation(b.PAN),this._view.notifyChange(!0),this.waitSceneLoaded().then(function(){e.updateCameraTransformation()})},o.prototype.getCameraOrientation=function(){return[this.getTilt(),this.getHeading()]},o.prototype.getCameraLocation=function(){return new x.default("EPSG:4978",this.camera.position).as("EPSG:4326")},o.prototype.getCameraTargetGeoPosition=function(){return new x.default(this._view.referenceCrs,this.getCameraTargetPosition()).as("EPSG:4326")},o.prototype.setAnimationEnabled=function(t){X=t},o.prototype.isAnimationEnabled=function(){return X},o.prototype.getZoom=function(){return(0,_.computeTileZoomFromDistanceCamera)(this.getRange(),this._view)},o.prototype.setZoom=function(t,e){e=void 0===e?this.isAnimationEnabled():e;var r=(0,_.computeDistanceCameraFromTileZoom)(t,this._view);return this.setRange(r,e)},o.prototype.getScale=function(t){t=(t||.28)/1e3;var e=dt.FOV/180*Math.PI*.5;return t*(dt.height/(2*this.getRange()*Math.tan(e)))},o.prototype.pixelsToMeters=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;return t*e/this.getScale(e)/1e3},o.prototype.metersToPixels=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28,r=this.getScale(e);return e/=1e3,t*r/e},o.prototype.setScale=function(t,e,r){r=void 0===r?this.isAnimationEnabled():r;var n=s(t);return this.setRange(n,r)},o.prototype.setCameraTargetGeoPosition=function(t,e){e=void 0===e?this.isAnimationEnabled():e;var r=new y.C.EPSG_4326(t.longitude,t.latitude,0).as("EPSG:4978").xyz();return r.range=t.range,this.setCameraTargetPosition(r,e)},o.prototype.setCameraTargetGeoPositionAdvanced=function(t,e){var r=this;return e=void 0===e?this.isAnimationEnabled():e,t.zoom?t.range=(0,_.computeDistanceCameraFromTileZoom)(t.zoom,this._view):t.scale&&(t.range=s(t.scale)),bt=!1,this.setCameraTargetGeoPosition(t,e).then(function(){return bt=!0,r.setOrbitalPosition(t,e)})},o.prototype.pickGeoPosition=function(t,e){var r={x:t.clientX||t,y:t.clientY||e},n=this._view.getPickingPositionFromDepth(r);if(n)return new x.default("EPSG:4978",n).as("EPSG:4326")},o.prototype.reset=function(){ct=b.NONE,this.target.copy(it),this.camera.position.copy(at),this.camera.zoom=ot,this.camera.updateProjectionMatrix(),this._view.notifyChange(!0),this.updateCameraTransformation()},e.default=o},,function(t,e,r){t.exports={default:r(368),__esModule:!0}},function(t,e,r){t.exports={default:r(373),__esModule:!0}},function(t,e,r){t.exports={default:r(374),__esModule:!0}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=r(320),a=n(i),o=r(319),s=n(o),u="function"==typeof s.default&&"symbol"==typeof a.default?function(t){return typeof t}:function(t){return t&&"function"==typeof s.default&&t.constructor===s.default&&t!==s.default.prototype?"symbol":typeof t};e.default="function"==typeof s.default&&"symbol"===u(a.default)?function(t){return void 0===t?"undefined":u(t)}:function(t){return t&&"function"==typeof s.default&&t.constructor===s.default&&t!==s.default.prototype?"symbol":void 0===t?"undefined":u(t)}},,function(t,e,r){"use strict";var n=r(13).f,i=r(56),a=r(90),o=r(17),s=r(81),u=r(53),h=r(54),c=r(85),l=r(129),d=r(134),f=r(14),p=r(86).fastKey,m=f?"_s":"size",v=function(t,e){var r,n=p(e);if("F"!==n)return t._i[n];for(r=t._f;r;r=r.n)if(r.k==e)return r};t.exports={getConstructor:function(t,e,r,c){var l=t(function(t,n){s(t,l,e,"_i"),t._i=i(null),t._f=void 0,t._l=void 0,t[m]=0,void 0!=n&&h(n,r,t[c],t)});return a(l.prototype,{clear:function(){for(var t=this,e=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete e[r.i];t._f=t._l=void 0,t[m]=0},delete:function(t){var e=this,r=v(e,t);if(r){var n=r.n,i=r.p;delete e._i[r.i],r.r=!0,i&&(i.n=n),n&&(n.p=i),e._f==r&&(e._f=n),e._l==r&&(e._l=i),e[m]--}return!!r},forEach:function(t){s(this,l,"forEach");for(var e,r=o(t,arguments.length>1?arguments[1]:void 0,3);e=e?e.n:this._f;)for(r(e.v,e.k,this);e&&e.r;)e=e.p},has:function(t){return!!v(this,t)}}),f&&n(l.prototype,"size",{get:function(){return u(this[m])}}),l},def:function(t,e,r){var n,i,a=v(t,e);return a?a.v=r:(t._l=a={i:i=p(e,!0),k:e,v:r,p:n=t._l,n:void 0,r:!1},t._f||(t._f=a),n&&(n.n=a),t[m]++,"F"!==i&&(t._i[i]=a)),t},getEntry:v,setStrong:function(t,e,r){c(t,e,function(t,e){this._t=t,this._k=e,this._l=void 0},function(){for(var t=this,e=t._k,r=t._l;r&&r.r;)r=r.p;return t._t&&(t._l=r=r?r.n:t._t._f)?"keys"==e?l(0,r.k):"values"==e?l(0,r.v):l(0,[r.k,r.v]):(t._t=void 0,l(1))},r?"entries":"values",!r,!0),d(e)}}},function(t,e,r){var n=r(52),i=r(386);t.exports=function(t){return function(){if(n(this)!=t)throw TypeError(t+"#toJSON isn't generic");return i(this)}}},function(t,e,r){"use strict";var n=r(11),i=r(10),a=r(86),o=r(22),s=r(18),u=r(90),h=r(54),c=r(81),l=r(19),d=r(40),f=r(13).f,p=r(388)(0),m=r(14);t.exports=function(t,e,r,v,g,y){var x=n[t],_=x,b=g?"set":"add",w=_&&_.prototype,M={};return m&&"function"==typeof _&&(y||w.forEach&&!o(function(){(new _).entries().next()}))?(_=e(function(e,r){c(e,_,t,"_c"),e._c=new x,void 0!=r&&h(r,g,e[b],e)}),p("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(t){var e="add"==t||"set"==t;t in w&&(!y||"clear"!=t)&&s(_.prototype,t,function(r,n){if(c(this,_,t),!e&&y&&!l(r))return"get"==t&&void 0;var i=this._c[t](0===r?0:r,n);return e?this:i})}),"size"in w&&f(_.prototype,"size",{get:function(){return this._c.size}})):(_=v.getConstructor(e,t,g,b),u(_.prototype,r),a.NEED=!0),d(_,t),M[t]=_,i(i.G+i.W+i.F,M),y||v.setStrong(_,t,g),_}},function(t,e,r){t.exports=r(11).document&&document.documentElement},function(t,e,r){t.exports=!r(14)&&!r(22)(function(){return 7!=Object.defineProperty(r(82)("div"),"a",{get:function(){return 7}}).a})},function(t,e,r){var n=r(29),i=r(9)("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||a[i]===t)}},function(t,e,r){var n=r(38);t.exports=Array.isArray||function(t){return"Array"==n(t)}},function(t,e,r){var n=r(15);t.exports=function(t,e,r,i){try{return i?e(n(r)[0],r[1]):e(r)}catch(e){var a=t.return;throw void 0!==a&&n(a.call(t)),e}}},function(t,e,r){var n=r(9)("iterator"),i=!1;try{var a=[7][n]();a.return=function(){i=!0},Array.from(a,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var r=!1;try{var a=[7],o=a[n]();o.next=function(){return{done:r=!0}},a[n]=function(){return o},t(a)}catch(t){}return r}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,r){var n=r(132),i=r(83).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,i)}},function(t,e,r){var n=r(23),i=r(31),a=r(91)("IE_PROTO"),o=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),n(t,a)?t[a]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?o:null}},function(t,e,r){var n=r(23),i=r(20),a=r(387)(!1),o=r(91)("IE_PROTO");t.exports=function(t,e){var r,s=i(t),u=0,h=[];for(r in s)r!=o&&n(s,r)&&h.push(r);for(;e.length>u;)n(s,r=e[u++])&&(~a(h,r)||h.push(r));return h}},function(t,e,r){t.exports=r(18)},function(t,e,r){"use strict";var n=r(11),i=r(5),a=r(13),o=r(14),s=r(9)("species");t.exports=function(t){var e="function"==typeof i[t]?i[t]:n[t];o&&e&&!e[s]&&a.f(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,r){var n,i,a,o=r(17),s=r(393),u=r(123),h=r(82),c=r(11),l=c.process,d=c.setImmediate,f=c.clearImmediate,p=c.MessageChannel,m=0,v={},g=function(){var t=+this;if(v.hasOwnProperty(t)){var e=v[t];delete v[t],e()}},y=function(t){g.call(t.data)};d&&f||(d=function(t){for(var e=[],r=1;arguments.length>r;)e.push(arguments[r++]);return v[++m]=function(){s("function"==typeof t?t:Function(t),e)},n(m),m},f=function(t){delete v[t]},"process"==r(38)(l)?n=function(t){l.nextTick(o(g,t,1))}:p?(i=new p,a=i.port2,i.port1.onmessage=y,n=o(a.postMessage,a,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(n=function(t){c.postMessage(t+"","*")},c.addEventListener("message",y,!1)):n="onreadystatechange"in h("script")?function(t){u.appendChild(h("script")).onreadystatechange=function(){u.removeChild(this),g.call(t)}}:function(t){setTimeout(o(g,t,1),0)}),t.exports={set:d,clear:f}},function(t,e,r){"use strict";function n(t,e){return e=e||5,l(u({lat:t[1],lon:t[0]}),e)}function i(t){var e=h(m(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function a(t){var e=h(m(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function o(t){return t*(Math.PI/180)}function s(t){return t/Math.PI*180}function u(t){var e,r,n,i,a,s,u,h,l,d=t.lat,f=t.lon,p=6378137,m=o(d),v=o(f);l=Math.floor((f+180)/6)+1,180===f&&(l=60),d>=56&&d<64&&f>=3&&f<12&&(l=32),d>=72&&d<84&&(f>=0&&f<9?l=31:f>=9&&f<21?l=33:f>=21&&f<33?l=35:f>=33&&f<42&&(l=37)),e=6*(l-1)-180+3,h=o(e),r=.006739496752268451,n=p/Math.sqrt(1-.00669438*Math.sin(m)*Math.sin(m)),i=Math.tan(m)*Math.tan(m),a=r*Math.cos(m)*Math.cos(m),s=Math.cos(m)*(v-h),u=p*(.9983242984503243*m-.002514607064228144*Math.sin(2*m)+2639046602129982e-21*Math.sin(4*m)-3.418046101696858e-9*Math.sin(6*m));var g=.9996*n*(s+(1-i+a)*s*s*s/6+(5-18*i+i*i+72*a-58*r)*s*s*s*s*s/120)+5e5,y=.9996*(u+n*Math.tan(m)*(s*s/2+(5-i+9*a+4*a*a)*s*s*s*s/24+(61-58*i+i*i+600*a-330*r)*s*s*s*s*s*s/720));return d<0&&(y+=1e7),{northing:Math.round(y),easting:Math.round(g),zoneNumber:l,zoneLetter:c(d)}}function h(t){var e=t.northing,r=t.easting,n=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var a,o,u,c,l,d,f,p,m,v,g=6378137,y=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),x=r-5e5,_=e;n<"N"&&(_-=1e7),p=6*(i-1)-180+3,a=.006739496752268451,f=_/.9996,m=f/6367449.145945056,v=m+(3*y/2-27*y*y*y/32)*Math.sin(2*m)+(21*y*y/16-55*y*y*y*y/32)*Math.sin(4*m)+151*y*y*y/96*Math.sin(6*m),o=g/Math.sqrt(1-.00669438*Math.sin(v)*Math.sin(v)),u=Math.tan(v)*Math.tan(v),c=a*Math.cos(v)*Math.cos(v),l=.99330562*g/Math.pow(1-.00669438*Math.sin(v)*Math.sin(v),1.5),d=x/(.9996*o);var b=v-o*Math.tan(v)/l*(d*d/2-(5+3*u+10*c-4*c*c-9*a)*d*d*d*d/24+(61+90*u+298*c+45*u*u-252*a-3*c*c)*d*d*d*d*d*d/720);b=s(b);var w=(d-(1+2*u+c)*d*d*d/6+(5-2*c+28*u-3*c*c+8*a+24*u*u)*d*d*d*d*d/120)/Math.cos(v);w=p+s(w);var M;if(t.accuracy){var E=h({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});M={top:E.lat,right:E.lon,bottom:b,left:w}}else M={lat:b,lon:w};return M}function c(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function l(t,e){var r="00000"+t.easting,n="00000"+t.northing;return t.zoneNumber+t.zoneLetter+d(t.easting,t.northing,t.zoneNumber)+r.substr(r.length-5,e)+n.substr(n.length-5,e)}function d(t,e,r){var n=f(r);return p(Math.floor(t/1e5),Math.floor(e/1e5)%20,n)}function f(t){var e=t%x;return 0===e&&(e=x),e}function p(t,e,r){var n=r-1,i=_.charCodeAt(n),a=b.charCodeAt(n),o=i+t-1,s=a+e,u=!1;return o>S&&(o=o-S+w-1,u=!0),(o===M||i<M&&o>M||(o>M||i<M)&&u)&&o++,(o===E||i<E&&o>E||(o>E||i<E)&&u)&&++o===M&&o++,o>S&&(o=o-S+w-1),s>T?(s=s-T+w-1,u=!0):u=!1,(s===M||a<M&&s>M||(s>M||a<M)&&u)&&s++,(s===E||a<E&&s>E||(s>E||a<E)&&u)&&++s===M&&s++,s>T&&(s=s-T+w-1),String.fromCharCode(o)+String.fromCharCode(s)}function m(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,r=t.length,n=null,i="",a=0;!/[A-Z]/.test(e=t.charAt(a));){if(a>=2)throw"MGRSPoint bad conversion from: "+t;i+=e,a++}var o=parseInt(i,10);if(0===a||a+3>r)throw"MGRSPoint bad conversion from: "+t;var s=t.charAt(a++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+t;n=t.substring(a,a+=2);for(var u=f(o),h=v(n.charAt(0),u),c=g(n.charAt(1),u);c<y(s);)c+=2e6;var l=r-a;if(l%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var d,p,m,x,_,b=l/2,w=0,M=0;return b>0&&(d=1e5/Math.pow(10,b),p=t.substring(a,a+b),w=parseFloat(p)*d,m=t.substring(a+b),M=parseFloat(m)*d),x=w+h,_=M+c,{easting:x,northing:_,zoneLetter:s,zoneNumber:o,accuracy:d}}function v(t,e){for(var r=_.charCodeAt(e-1),n=1e5,i=!1;r!==t.charCodeAt(0);){if(r++,r===M&&r++,r===E&&r++,r>S){if(i)throw"Bad character: "+t;r=w,i=!0}n+=1e5}return n}function g(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var r=b.charCodeAt(e-1),n=0,i=!1;r!==t.charCodeAt(0);){if(r++,r===M&&r++,r===E&&r++,r>T){if(i)throw"Bad character: "+t;r=w,i=!0}n+=1e5}return n}function y(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}e.c=n,e.b=a;var x=6,_="AJSAJS",b="AFAFAF",w=65,M=73,E=79,T=86,S=90;e.a={forward:n,inverse:i,toPoint:a}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function i(t){if(c===setTimeout)return setTimeout(t,0);if((c===r||!c)&&setTimeout)return c=setTimeout,setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function a(t){if(l===clearTimeout)return clearTimeout(t);if((l===n||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function o(){m&&f&&(m=!1,f.length?p=f.concat(p):v=-1,p.length&&s())}function s(){if(!m){var t=i(o);m=!0;for(var e=p.length;e;){for(f=p,p=[];++v<e;)f&&f[v].run();v=-1,e=p.length}f=null,m=!1,a(t)}}function u(t,e){this.fun=t,this.array=e}function h(){}var c,l,d=t.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:r}catch(t){c=r}try{l="function"==typeof clearTimeout?clearTimeout:n}catch(t){l=n}}();var f,p=[],m=!1,v=-1;d.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];p.push(new u(t,e)),1!==p.length||m||i(s)},u.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=h,d.addListener=h,d.once=h,d.off=h,d.removeListener=h,d.removeAllListeners=h,d.emit=h,d.prependListener=h,d.prependOnceListener=h,d.listeners=function(t){return[]},d.binding=function(t){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(t){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(t,e,r){"use strict";e.a=function(t,e){t=Math.abs(t),e=Math.abs(e);var r=Math.max(t,e),n=Math.min(t,e)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}},function(t,e,r){"use strict";var n=.01068115234375;e.a=function(t){var e=[];e[0]=1-t*(.25+t*(.046875+t*(.01953125+t*n))),e[1]=t*(.75-t*(.046875+t*(.01953125+t*n)));var r=t*t;return e[2]=r*(.46875-t*(.013020833333333334+.007120768229166667*t)),r*=t,e[3]=r*(.3645833333333333-.005696614583333333*t),e[4]=r*t*.3076171875,e}},function(t,e,r){"use strict";var n=r(101),i=r(3);e.a=function(t,e,a){for(var o=1/(1-e),s=t,u=20;u;--u){var h=Math.sin(s),c=1-e*h*h;if(c=(r.i(n.a)(s,h,Math.cos(s),a)-t)*(c*Math.sqrt(c))*o,s-=c,Math.abs(c)<i.a)return s}return s}},function(t,e,r){"use strict";e.a=function(t){var e=Math.exp(t);return e=(e-1/e)/2}},function(t,e,r){"use strict";e.a=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}},function(t,e,r){"use strict";function n(t){var e=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?n[t]=r.i(a.a)(arguments[1]):n[t]=r.i(o.a)(arguments[1]):n[t]=i}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?n.apply(e,t):n(t)});if("string"==typeof t){if(t in n)return n[t]}else"EPSG"in t?n["EPSG:"+t.EPSG]=t:"ESRI"in t?n["ESRI:"+t.ESRI]=t:"IAU2000"in t?n["IAU2000:"+t.IAU2000]=t:console.log(t);return}}var i=r(449),a=r(260),o=r(266);r.i(i.a)(n),e.a=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(443),i=r(98),a=r(428),o=r(257),s=r(258),u=r(262),h=r(136),c=r(478),l=r(480);n.a.defaultDatum="WGS84",n.a.Proj=i.a,n.a.WGS84=new n.a.Proj("WGS84"),n.a.Point=a.a,n.a.toPoint=o.a,n.a.defs=s.a,n.a.transform=u.a,n.a.mgrs=h.a,n.a.version=c.a,r.i(l.a)(n.a),e.default=n.a},function(t,e,r){"use strict";var n=r(3),i=r(441),a=r(442),o=r(103);e.a=function(t){var e,s,u,h={},c=t.split("+").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,e){var r=e.split("=");return r.push(!0),t[r[0].toLowerCase()]=r[1],t},{}),l={proj:"projName",datum:"datumCode",rf:function(t){h.rf=parseFloat(t)},lat_0:function(t){h.lat0=t*n.g},lat_1:function(t){h.lat1=t*n.g},lat_2:function(t){h.lat2=t*n.g},lat_ts:function(t){h.lat_ts=t*n.g},lon_0:function(t){h.long0=t*n.g},lon_1:function(t){h.long1=t*n.g},lon_2:function(t){h.long2=t*n.g},alpha:function(t){h.alpha=parseFloat(t)*n.g},lonc:function(t){h.longc=t*n.g},x_0:function(t){h.x0=parseFloat(t)},y_0:function(t){h.y0=parseFloat(t)},k_0:function(t){h.k0=parseFloat(t)},k:function(t){h.k0=parseFloat(t)},a:function(t){h.a=parseFloat(t)},b:function(t){h.b=parseFloat(t)},r_a:function(){h.R_A=!0},zone:function(t){h.zone=parseInt(t,10)},south:function(){h.utmSouth=!0},towgs84:function(t){h.datum_params=t.split(",").map(function(t){return parseFloat(t)})},to_meter:function(t){h.to_meter=parseFloat(t)},units:function(t){h.units=t;var e=r.i(o.a)(a.a,t);e&&(h.to_meter=e.to_meter)},from_greenwich:function(t){h.from_greenwich=t*n.g},pm:function(t){var e=r.i(o.a)(i.a,t);h.from_greenwich=(e||parseFloat(t))*n.g},nadgrids:function(t){"@null"===t?h.datumCode="none":h.nadgrids=t},axis:function(t){var e="ewnsud";3===t.length&&-1!==e.indexOf(t.substr(0,1))&&-1!==e.indexOf(t.substr(1,1))&&-1!==e.indexOf(t.substr(2,1))&&(h.axis=t)}};for(e in c)s=c[e],e in l?(u=l[e],"function"==typeof u?u(s):h[u]=s):h[e]=s;return"string"==typeof h.datumCode&&"WGS84"!==h.datumCode&&(h.datumCode=h.datumCode.toLowerCase()),h}},function(t,e,r){"use strict";function n(){if(void 0===this.es||this.es<=0)throw new Error("incorrect elliptical usage");this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),n=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),n*=e,this.cgb[1]=n*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=n*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),n*=e,this.cgb[2]=n*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=n*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),n*=e,this.cgb[3]=n*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=n*(1237/630+e*(e*(-24832/14175)-2.4)),n*=e,this.cgb[4]=n*(4174/315+e*(-144838/6237)),this.cbg[4]=n*(-734/315+e*(109598/31185)),n*=e,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+n*(.25+n*(1/64+n/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=n*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=n*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),n*=e,this.utg[2]=n*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=n*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),n*=e,this.utg[3]=n*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=n*(49561/161280+e*(-179/168+e*(6601661/7257600))),n*=e,this.utg[4]=n*(-4583/161280+e*(108847/3991680)),this.gtu[4]=n*(34729/80640+e*(-3418889/1995840)),n*=e,this.utg[5]=-.03233083094085698*n,this.gtu[5]=.6650675310896665*n;var i=r.i(h.a)(this.cbg,this.lat0);this.Zb=-this.Qn*(i+r.i(c.a)(this.gtu,2*i))}function i(t){var e=r.i(d.a)(t.x-this.long0),n=t.y;n=r.i(h.a)(this.cbg,n);var i=Math.sin(n),a=Math.cos(n),o=Math.sin(e),c=Math.cos(e);n=Math.atan2(i,c*a),e=Math.atan2(o*a,r.i(s.a)(i,a*c)),e=r.i(u.a)(Math.tan(e));var f=r.i(l.a)(this.gtu,2*n,2*e);n+=f[0],e+=f[1];var p,m;return Math.abs(e)<=2.623395162778?(p=this.a*(this.Qn*e)+this.x0,m=this.a*(this.Qn*n+this.Zb)+this.y0):(p=1/0,m=1/0),t.x=p,t.y=m,t}function a(t){var e=(t.x-this.x0)*(1/this.a),n=(t.y-this.y0)*(1/this.a);n=(n-this.Zb)/this.Qn,e/=this.Qn;var i,a;if(Math.abs(e)<=2.623395162778){var u=r.i(l.a)(this.utg,2*n,2*e);n+=u[0],e+=u[1],e=Math.atan(r.i(o.a)(e));var c=Math.sin(n),f=Math.cos(n),p=Math.sin(e),m=Math.cos(e);n=Math.atan2(c*m,r.i(s.a)(p,m*f)),e=Math.atan2(p,m*f),i=r.i(d.a)(e+this.long0),a=r.i(h.a)(this.cgb,n)}else i=1/0,a=1/0;return t.x=i,t.y=a,t}var o=r(256),s=r(253),u=r(431),h=r(435),c=r(432),l=r(433),d=r(4),f=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc"];e.a={init:n,forward:i,inverse:a,names:f}},function(t,e,r){"use strict";function n(t,e){return(t.datum.datum_type===a.h||t.datum.datum_type===a.i)&&"WGS84"!==e.datumCode||(e.datum.datum_type===a.h||e.datum.datum_type===a.i)&&"WGS84"!==t.datumCode}function i(t,e,c){var l;return Array.isArray(c)&&(c=r.i(h.a)(c)),t.datum&&e.datum&&n(t,e)&&(l=new u.a("WGS84"),c=i(t,l,c),t=l),"enu"!==t.axis&&(c=r.i(s.a)(t,!1,c)),"longlat"===t.projName?c={x:c.x*a.g,y:c.y*a.g}:(t.to_meter&&(c={x:c.x*t.to_meter,y:c.y*t.to_meter}),c=t.inverse(c)),t.from_greenwich&&(c.x+=t.from_greenwich),c=r.i(o.a)(t.datum,e.datum,c),e.from_greenwich&&(c={x:c.x-e.from_greenwich,y:c.y}),"longlat"===e.projName?c={x:c.x*a.j,y:c.y*a.j}:(c=e.forward(c),e.to_meter&&(c={x:c.x/e.to_meter,y:c.y/e.to_meter})),"enu"!==e.axis?r.i(s.a)(e,!0,c):c}e.a=i;var a=r(3),o=r(446),s=r(429),u=r(98),h=r(257)},function(t,e){t.exports="precision highp float;\nprecision highp int;\n"},function(t,e,r){"use strict";function n(t,e,r){var n=t*e,a=i*t,o=a-t,s=a-o,u=t-s,h=i*e,c=h-e,l=h-c,d=e-l,f=n-s*l,p=f-u*l,m=p-s*d,v=u*d-m;return r?(r[0]=v,r[1]=n,r):[v,n]}t.exports=n;var i=+(Math.pow(2,27)+1)},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";function n(t,e){var r=e[0],n=e[1];!(r in t)&&n in t&&(t[r]=t[n],3===e.length&&(t[r]=e[2](t[r])))}function i(t){return t*u}function a(t){function e(e){return e*(t.to_meter||1)}"GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var r=t.GEOGCS;"GEOGCS"===t.type&&(r=t),r&&(r.DATUM?t.datumCode=r.DATUM.name.toLowerCase():t.datumCode=r.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"===t.datumCode&&("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),r.DATUM&&r.DATUM.SPHEROID&&(t.ellps=r.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=r.DATUM.SPHEROID.a,t.rf=parseFloat(r.DATUM.SPHEROID.rf,10)),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65")),t.b&&!isFinite(t.b)&&(t.b=t.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_2","Standard_Parallel_2"],["false_easting","False_Easting"],["false_northing","False_Northing"],["central_meridian","Central_Meridian"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",i],["longitude_of_center","Longitude_Of_Center"],["longc","longitude_of_center",i],["x0","false_easting",e],["y0","false_northing",e],["long0","central_meridian",i],["lat0","latitude_of_origin",i],["lat0","standard_parallel_1",i],["lat1","standard_parallel_1",i],["lat2","standard_parallel_2",i],["alpha","azimuth",i],["srsCode","name"]].forEach(function(e){return n(t,e)}),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName||(t.lat0=i(t.lat1>0?90:-90),t.lat_ts=t.lat1)}var o=r(502),s=r(503),u=.017453292519943295;e.a=function(t){var e=r.i(o.a)(t),n=e.shift(),i=e.shift();e.unshift(["name",i]),e.unshift(["type",n]);var u={};return r.i(s.a)(e,u),a(u),u}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.DEMUtils=e.CONTROL_EVENTS=e.GeoJSON2Feature=e.PlanarControls=e.FirstPersonControls=e.FlyControls=e.PointCloudProcessing=e.PointsMaterial=e.ColorLayersOrdering=e.initTiledGeometryLayer=e.processTiledGeometryNode=e.updateLayeredMaterialNodeElevation=e.updateLayeredMaterialNodeImagery=e.FeatureProcessing=e.pre3dTilesUpdate=e.$3dTilesSubdivisionControl=e.$3dTilesCulling=e.init3dTilesLayer=e.process3dTilesNode=e.View=e.Fetcher=e.createPlanarLayer=e.PlanarView=e.GpxUtils=e.createGlobeLayer=e.GLOBE_VIEW_EVENTS=e.GlobeView=e.STRATEGY_DICHOTOMY=e.STRATEGY_PROGRESSIVE=e.STRATEGY_GROUP=e.STRATEGY_MIN_NETWORK_TRAFFIC=e.ImageryLayers=e.GeometryLayer=e.Extent=e.UNIT=e.Coordinates=e.proj4=e.THREE=void 0;var i=r(259);Object.defineProperty(e,"proj4",{enumerable:!0,get:function(){return n(i).default}});var a=r(6);Object.defineProperty(e,"Coordinates",{enumerable:!0,get:function(){return n(a).default}}),Object.defineProperty(e,"UNIT",{enumerable:!0,get:function(){return a.UNIT}});var o=r(12);Object.defineProperty(e,"Extent",{enumerable:!0,get:function(){return n(o).default}});var s=r(25);Object.defineProperty(e,"GeometryLayer",{enumerable:!0,get:function(){return s.GeometryLayer}}),Object.defineProperty(e,"ImageryLayers",{enumerable:!0,get:function(){return s.ImageryLayers}});var u=r(68);Object.defineProperty(e,"STRATEGY_MIN_NETWORK_TRAFFIC",{enumerable:!0,get:function(){return u.STRATEGY_MIN_NETWORK_TRAFFIC}}),Object.defineProperty(e,"STRATEGY_GROUP",{enumerable:!0,get:function(){return u.STRATEGY_GROUP}}),Object.defineProperty(e,"STRATEGY_PROGRESSIVE",{enumerable:!0,get:function(){return u.STRATEGY_PROGRESSIVE}}),Object.defineProperty(e,"STRATEGY_DICHOTOMY",{enumerable:!0,get:function(){return u.STRATEGY_DICHOTOMY}});var h=r(279);Object.defineProperty(e,"GlobeView",{enumerable:!0,get:function(){return n(h).default}}),Object.defineProperty(e,"GLOBE_VIEW_EVENTS",{enumerable:!0,get:function(){return h.GLOBE_VIEW_EVENTS}}),Object.defineProperty(e,"createGlobeLayer",{enumerable:!0,get:function(){return h.createGlobeLayer}});var c=r(282);Object.defineProperty(e,"GpxUtils",{enumerable:!0,get:function(){return n(c).default}});var l=r(281);Object.defineProperty(e,"PlanarView",{enumerable:!0,get:function(){return n(l).default}}),Object.defineProperty(e,"createPlanarLayer",{enumerable:!0,get:function(){return l.createPlanarLayer}});var d=r(16);Object.defineProperty(e,"Fetcher",{enumerable:!0,get:function(){return n(d).default}});var f=r(36);Object.defineProperty(e,"View",{enumerable:!0,get:function(){return n(f).default}});var p=r(107);Object.defineProperty(e,"process3dTilesNode",{enumerable:!0,get:function(){return p.process3dTilesNode}}),Object.defineProperty(e,"init3dTilesLayer",{enumerable:!0,get:function(){return p.init3dTilesLayer}}),Object.defineProperty(e,"$3dTilesCulling",{enumerable:!0,get:function(){return p.$3dTilesCulling}}),Object.defineProperty(e,"$3dTilesSubdivisionControl",{enumerable:!0,get:function(){return p.$3dTilesSubdivisionControl}}),Object.defineProperty(e,"pre3dTilesUpdate",{enumerable:!0,get:function(){return p.pre3dTilesUpdate}});var m=r(295);Object.defineProperty(e,"FeatureProcessing",{enumerable:!0,get:function(){return n(m).default}});var v=r(71);Object.defineProperty(e,"updateLayeredMaterialNodeImagery",{enumerable:!0,get:function(){return v.updateLayeredMaterialNodeImagery}}),Object.defineProperty(e,"updateLayeredMaterialNodeElevation",{enumerable:!0,get:function(){return v.updateLayeredMaterialNodeElevation}});var g=r(44);Object.defineProperty(e,"processTiledGeometryNode",{enumerable:!0,get:function(){return g.processTiledGeometryNode}}),Object.defineProperty(e,"initTiledGeometryLayer",{enumerable:!0,get:function(){return g.initTiledGeometryLayer}});var y=r(111);Object.defineProperty(e,"ColorLayersOrdering",{enumerable:!0,get:function(){return y.ColorLayersOrdering}});var x=r(73);Object.defineProperty(e,"PointsMaterial",{enumerable:!0,get:function(){return n(x).default}});var _=r(109);Object.defineProperty(e,"PointCloudProcessing",{enumerable:!0,get:function(){return n(_).default}});var b=r(302);Object.defineProperty(e,"FlyControls",{enumerable:!0,get:function(){return n(b).default}});var w=r(301);Object.defineProperty(e,"FirstPersonControls",{enumerable:!0,get:function(){return n(w).default}});var M=r(304);Object.defineProperty(e,"PlanarControls",{enumerable:!0,get:function(){return n(M).default}});var E=r(75);Object.defineProperty(e,"GeoJSON2Feature",{enumerable:!0,get:function(){return n(E).default}});var T=r(113);Object.defineProperty(e,"CONTROL_EVENTS",{enumerable:!0,get:function(){return T.CONTROL_EVENTS}});var S=r(307);Object.defineProperty(e,"DEMUtils",{enumerable:!0,get:function(){return n(S).default}});var A=r(1),L=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(A);e.THREE=L},,function(t,e,r){(function(e,n){/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
* @version 4.1.1
*/
!function(e,r){t.exports=r()}(0,function(){"use strict";function t(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function i(t){return"function"==typeof t}function a(t){W=t}function o(t){q=t}function s(){return void 0!==H?function(){H(h)}:u()}function u(){var t=setTimeout;return function(){return t(h,1)}}function h(){for(var t=0;t<k;t+=2){(0,J[t])(J[t+1]),J[t]=void 0,J[t+1]=void 0}k=0}function c(t,e){var r=arguments,n=this,i=new this.constructor(d);void 0===i[tt]&&C(i);var a=n._state;return a?function(){var t=r[a-1];q(function(){return L(a,i,t,n._result)})}():E(n,i,t,e),i}function l(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var r=new e(d);return _(r,t),r}function d(){}function f(){return new TypeError("You cannot resolve a promise with itself")}function p(){return new TypeError("A promises callback cannot return that same promise.")}function m(t){try{return t.then}catch(t){return it.error=t,it}}function v(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}function g(t,e,r){q(function(t){var n=!1,i=v(r,e,function(r){n||(n=!0,e!==r?_(t,r):w(t,r))},function(e){n||(n=!0,M(t,e))},"Settle: "+(t._label||" unknown promise"));!n&&i&&(n=!0,M(t,i))},t)}function y(t,e){e._state===rt?w(t,e._result):e._state===nt?M(t,e._result):E(e,void 0,function(e){return _(t,e)},function(e){return M(t,e)})}function x(t,e,r){e.constructor===t.constructor&&r===c&&e.constructor.resolve===l?y(t,e):r===it?(M(t,it.error),it.error=null):void 0===r?w(t,e):i(r)?g(t,e,r):w(t,e)}function _(e,r){e===r?M(e,f()):t(r)?x(e,r,m(r)):w(e,r)}function b(t){t._onerror&&t._onerror(t._result),T(t)}function w(t,e){t._state===et&&(t._result=e,t._state=rt,0!==t._subscribers.length&&q(T,t))}function M(t,e){t._state===et&&(t._state=nt,t._result=e,q(b,t))}function E(t,e,r,n){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+rt]=r,i[a+nt]=n,0===a&&t._state&&q(T,t)}function T(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,i=void 0,a=t._result,o=0;o<e.length;o+=3)n=e[o],i=e[o+r],n?L(r,n,i,a):i(a);t._subscribers.length=0}}function S(){this.error=null}function A(t,e){try{return t(e)}catch(t){return at.error=t,at}}function L(t,e,r,n){var a=i(r),o=void 0,s=void 0,u=void 0,h=void 0;if(a){if(o=A(r,n),o===at?(h=!0,s=o.error,o.error=null):u=!0,e===o)return void M(e,p())}else o=n,u=!0;e._state!==et||(a&&u?_(e,o):h?M(e,s):t===rt?w(e,o):t===nt&&M(e,o))}function P(t,e){try{e(function(e){_(t,e)},function(e){M(t,e)})}catch(e){M(t,e)}}function R(){return ot++}function C(t){t[tt]=ot++,t._state=void 0,t._result=void 0,t._subscribers=[]}function O(t,e){this._instanceConstructor=t,this.promise=new t(d),this.promise[tt]||C(this.promise),V(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?w(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&w(this.promise,this._result))):M(this.promise,I())}function I(){return new Error("Array Methods must be provided an Array")}function D(t){return new O(this,t).promise}function N(t){var e=this;return new e(V(t)?function(r,n){for(var i=t.length,a=0;a<i;a++)e.resolve(t[a]).then(r,n)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function U(t){var e=this,r=new e(d);return M(r,t),r}function F(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function B(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function z(t){this[tt]=R(),this._result=this._state=void 0,this._subscribers=[],d!==t&&("function"!=typeof t&&F(),this instanceof z?P(this,t):B())}function G(){var t=void 0;if(void 0!==n)t=n;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=z}var j=void 0;j=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var V=j,k=0,H=void 0,W=void 0,q=function(t,e){J[k]=t,J[k+1]=e,2===(k+=2)&&(W?W(h):$())},X="undefined"!=typeof window?window:void 0,Y=X||{},Z=Y.MutationObserver||Y.WebKitMutationObserver,K="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),Q="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,J=new Array(1e3),$=void 0;$=K?function(){return function(){return e.nextTick(h)}}():Z?function(){var t=0,e=new Z(h),r=document.createTextNode("");return e.observe(r,{characterData:!0}),function(){r.data=t=++t%2}}():Q?function(){var t=new MessageChannel;return t.port1.onmessage=h,function(){return t.port2.postMessage(0)}}():void 0===X?function(){try{var t=r(504);return H=t.runOnLoop||t.runOnContext,s()}catch(t){return u()}}():u();var tt=Math.random().toString(36).substring(16),et=void 0,rt=1,nt=2,it=new S,at=new S,ot=0;return O.prototype._enumerate=function(t){for(var e=0;this._state===et&&e<t.length;e++)this._eachEntry(t[e],e)},O.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===l){var i=m(t);if(i===c&&t._state!==et)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(r===z){var a=new r(d);x(a,t,i),this._willSettleAt(a,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},O.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===et&&(this._remaining--,t===nt?M(n,r):this._result[e]=r),0===this._remaining&&w(n,this._result)},O.prototype._willSettleAt=function(t,e){var r=this;E(t,void 0,function(t){return r._settledAt(rt,e,t)},function(t){return r._settledAt(nt,e,t)})},z.all=D,z.race=N,z.resolve=l,z.reject=U,z._setScheduler=a,z._setAsap=o,z._asap=q,z.prototype={constructor:z,then:c,catch:function(t){return this.then(null,t)}},z.polyfill=G,z.Promise=z,z})}).call(e,r(252),r(265))},function(t,e){!function(t){"use strict";function e(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function r(t){return"string"!=typeof t&&(t=String(t)),t}function n(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return g.iterable&&(e[Symbol.iterator]=function(){return e}),e}function i(t){this.map={},t instanceof i?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function a(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function o(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function s(t){var e=new FileReader,r=o(e);return e.readAsArrayBuffer(t),r}function u(t){var e=new FileReader,r=o(e);return e.readAsText(t),r}function h(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}function c(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function l(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,t)if("string"==typeof t)this._bodyText=t;else if(g.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(g.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(g.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=t.toString();else if(g.arrayBuffer&&g.blob&&x(t))this._bodyArrayBuffer=c(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!g.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t)&&!_(t))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=c(t)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):g.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},g.blob&&(this.blob=function(){var t=a(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?a(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var t=a(this);if(t)return t;if(this._bodyBlob)return u(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(h(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},g.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function d(t){var e=t.toUpperCase();return b.indexOf(e)>-1?e:t}function f(t,e){e=e||{};var r=e.body;if(t instanceof f){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new i(t.headers)),this.method=t.method,this.mode=t.mode,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new i(e.headers)),this.method=d(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function p(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}}),e}function m(t){var e=new i;return t.split(/\r?\n/).forEach(function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}}),e}function v(t,e){e||(e={}),this.type="default",this.status="status"in e?e.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new i(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){var g={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(g.arrayBuffer)var y=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],x=function(t){return t&&DataView.prototype.isPrototypeOf(t)},_=ArrayBuffer.isView||function(t){return t&&y.indexOf(Object.prototype.toString.call(t))>-1};i.prototype.append=function(t,n){t=e(t),n=r(n);var i=this.map[t];this.map[t]=i?i+","+n:n},i.prototype.delete=function(t){delete this.map[e(t)]},i.prototype.get=function(t){return t=e(t),this.has(t)?this.map[t]:null},i.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},i.prototype.set=function(t,n){this.map[e(t)]=r(n)},i.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},i.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),n(t)},i.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),n(t)},i.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),n(t)},g.iterable&&(i.prototype[Symbol.iterator]=i.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];f.prototype.clone=function(){return new f(this,{body:this._bodyInit})},l.call(f.prototype),l.call(v.prototype),v.prototype.clone=function(){return new v(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new i(this.headers),url:this.url})},v.error=function(){var t=new v(null,{status:0,statusText:""});return t.type="error",t};var w=[301,302,303,307,308];v.redirect=function(t,e){if(-1===w.indexOf(e))throw new RangeError("Invalid status code");return new v(null,{status:e,headers:{location:t}})},t.Headers=i,t.Request=f,t.Response=v,t.fetch=function(t,e){return new Promise(function(r,n){var i=new f(t,e),a=new XMLHttpRequest;a.onload=function(){var t={status:a.status,statusText:a.statusText,headers:m(a.getAllResponseHeaders()||"")};t.url="responseURL"in a?a.responseURL:t.headers.get("X-Request-URL");var e="response"in a?a.response:a.responseText;r(new v(e,t))},a.onerror=function(){n(new TypeError("Network request failed"))},a.ontimeout=function(){n(new TypeError("Network request failed"))},a.open(i.method,i.url,!0),"include"===i.credentials&&(a.withCredentials=!0),"responseType"in a&&g.blob&&(a.responseType="blob"),i.headers.forEach(function(t,e){a.setRequestHeader(e,t)}),a.send(void 0===i._bodyInit?null:i._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.AnimatedExpression=e.Animation=void 0;var i=r(7),a=n(i),o=r(37),s=n(o),u=r(48),h=n(u),c=r(49),l=n(c),d=r(51),f=n(d),p=r(50),m=n(p),v=r(1),g=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(v),y={STOP:0,PLAY:1,END:2,PAUSE:3},x=["Stop","Play","End","Pause"],_=null;_=function(){};var b=function(t){t.id&&(clearInterval(t.id),t.id=void 0),t.waitTimer&&(clearInterval(t.waitTimer),t.waitTimer=void 0),t.keyframe=0},w=function(t){b(t),t.isEnded()&&t.dispatchEvent({type:"animation-ended",animation:t.animation}),t.dispatchEvent({type:"animation-stopped",animation:t.animation}),t.animation=null,t.resolve&&(t.resolve(),t.resolve=null,t.promise=null)},M=function(t,e){t.state=e,_(x[e],t.animation)},E=function(t){function e(){(0,h.default)(this,e);var t=(0,f.default)(this,(e.__proto__||(0,s.default)(e)).call(this));return t.id=null,t.keyframe=0,t.animation=null,t.resolve=null,t.promise=null,t.state=y.STOP,t.waitTimer=null,t}return(0,m.default)(e,t),(0,l.default)(e,[{key:"isPlaying",value:function(){return this.state===y.PLAY}},{key:"isStopped",value:function(){return this.state===y.STOP}},{key:"isEnded",value:function(){return this.state===y.END}},{key:"play",value:function(t){var e=this;return this.animation=t,this.dispatchEvent({type:"animation-started",animation:t}),M(this,y.PLAY),b(this),this.id=setInterval(this.frame.bind(this),1e3/60),this.promise=new a.default(function(t){e.resolve=t}),this.promise}},{key:"playLater",value:function(t,e){var r=this;this.resolveWait=null;var n=new a.default(function(t){r.resolveWait=t}),i=Math.floor(1e3/60*e);return window.clearInterval(this.waitTimer),this.waitTimer=window.setTimeout(function(){r.play(t).then(function(){return r.resolveWait()})},i),n}},{key:"stop",value:function(){return M(this,y.STOP),w(this),a.default.resolve()}},{key:"frame",value:function(){this.keyframe<this.animation.duration?(this.animation.animate&&this.animation.animate(this.keyframe),this.keyframe++,this.dispatchEvent({type:"animation-frame"})):(M(this,y.END),w(this))}}]),e}(g.EventDispatcher),T=function t(e){(0,h.default)(this,t),this.duration=e.duration||60,this.name=e.name},S=function(t){function e(t){(0,h.default)(this,e);var r=(0,f.default)(this,(e.__proto__||(0,s.default)(e)).call(this,t));return r.root=t.root,r.expression=t.expression,r}return(0,m.default)(e,t),(0,l.default)(e,[{key:"animate",value:function(t){this.expression(this.root,t/this.duration)}}]),e}(T);e.Animation=T,e.AnimatedExpression=S,e.default=E},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(6),i=function(t){return t&&t.__esModule?t:{default:t}}(n),a={getSunPosition:function(){function t(t){return t.valueOf()/y-.5+x}function e(e){return t(e)-_}function r(t,e){return v(d(t)*f(b)-p(e)*d(b),f(t))}function n(t,e){return m(d(e)*f(b)+f(e)*d(b)*d(t))}function i(t,e,r){return v(d(t),f(t)*d(e)-p(r)*f(e))}function a(t,e,r){return m(d(e)*d(r)+f(e)*f(r)*f(t))}function o(t,e){return g*(280.16+360.9856235*t)-e}function s(t){return g*(357.5291+.98560028*t)}function u(t){return g*(1.9148*d(t)+.02*d(2*t)+3e-4*d(3*t))}function h(t,e){return t+e+102.9372*g+l}var c=Math,l=c.PI,d=c.sin,f=c.cos,p=c.tan,m=c.asin,v=c.atan2,g=l/180,y=864e5,x=2440588,_=2451545,b=23.4397*g;return function(t,c,d){var f=g*-d,p=g*c,m=e(t),v=s(m),y=u(v),x=h(v,y),_=n(x,0),b=r(x,0),w=o(m,f),M=w-b;return{EclipticLongitude:x,declinaison:_,ascension:b,H:M,SiderealTime:w,altitude:a(M,p,_),azimuth:i(M,p,_)+l/2}}},getSunPositionInScene:function(t,e,r){var n=a.getSunPosition()(t,e,r),o=n.ascension+t%864e5/864e5*-360+180;return new i.default("EPSG:4326",o,e,5e7).as("EPSG:4978").xyz()}};e.default=a},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){this.renderingState=f,this.needsRedraw=!1,this.scheduler=t,this.gfxEngine=e,this._updateLoopRestarted=!0}function a(t,e,r){if(r){var n=!0,i=!1,o=void 0;try{for(var s,u=(0,h.default)(r);!(n=(s=u.next()).done);n=!0){var c=s.value,l=e.update(t,e,c),d=!0,f=!1,p=void 0;try{for(var m,v=(0,h.default)(e._attachedLayers);!(d=(m=v.next()).done);d=!0){var g=m.value;g.update(t,g,c)}}catch(t){f=!0,p=t}finally{try{!d&&v.return&&v.return()}finally{if(f)throw p}}a(t,e,l)}}catch(t){i=!0,o=t}finally{try{!n&&u.return&&u.return()}finally{if(i)throw o}}}}Object.defineProperty(e,"__esModule",{value:!0});var o=r(47),s=n(o),u=r(2),h=n(u),c=r(8),l=n(c),d=r(1),f=0;i.prototype=(0,l.default)(d.EventDispatcher.prototype),i.prototype.constructor=i,i.prototype.scheduleViewUpdate=function(t,e){var r=this;this.needsRedraw|=e,1!==this.renderingState&&(this.renderingState=1,requestAnimationFrame(function(e){r._step(t,e)}))},i.prototype._update=function(t,e,r){var n={camera:t.camera,engine:this.gfxEngine,scheduler:this.scheduler,view:t};if(t._frameRequesters.length>0){var i=!0,o=!1,s=void 0;try{for(var u,c=(0,h.default)(t._frameRequesters);!(i=(u=c.next()).done);i=!0){var l=u.value;l.update&&l.update(r,this._updateLoopRestarted)}}catch(t){o=!0,s=t}finally{try{!i&&c.return&&c.return()}finally{if(o)throw s}}}var d=!0,f=!1,p=void 0;try{for(var m,v=(0,h.default)(t.getLayers(function(t,e){return!e}));!(d=(m=v.next()).done);d=!0){var g=m.value;if(n.geometryLayer=g,g.ready){a(n,g,g.preUpdate(n,g,e)),g.postUpdate(n,g,e)}}}catch(t){f=!0,p=t}finally{try{!d&&v.return&&v.return()}finally{if(f)throw p}}},i.prototype._step=function(t,e){var r=this.needsRedraw,n=e-this._lastTimestamp;this._lastTimestamp=e,this.needsRedraw=!1,this.renderingState=f;var i=new s.default(t._changeSources);t._changeSources.clear();var a=this.gfxEngine.getWindowSize();t.camera.update(a.x,a.y),this._update(t,i,n),0==this.scheduler.commandsWaitingExecutionCount()&&this.dispatchEvent({type:"command-queue-empty"}),r&&this._renderView(t),this._updateLoopRestarted=this.renderingState===f},i.prototype._renderView=function(t){t.preRender&&t.preRender(),t.render?t.render():this.gfxEngine.renderView(t),t.onAfterRender()},e.default=i},function(t,e,r){"use strict";function n(t){this.rayon_1=t.x,this.rayon_2=t.y,this.rayon_3=t.z,this.size=new a.Vector3(t.x,t.y,t.z),this._radiiSquared=new a.Vector3(t.x*t.x,t.y*t.y,t.z*t.z)}Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(i),o=r(6);n.prototype.geodeticSurfaceNormalCartographic=function(t){var e=t.longitude(o.UNIT.RADIAN),r=t.latitude(o.UNIT.RADIAN),n=Math.cos(r),i=n*Math.cos(e),s=n*Math.sin(e),u=Math.sin(r);return new a.Vector3(i,s,u).normalize()},n.prototype.setSize=function(t){this.rayon_1=t.x,this.rayon_2=t.y,this.rayon_3=t.z,this._radiiSquared=new a.Vector3(t.x*t.x,t.y*t.y,t.z*t.z)},n.prototype.cartographicToCartesian=function(t){var e=new a.Vector3,r=this.geodeticSurfaceNormalCartographic(t);e.multiplyVectors(this._radiiSquared,r);var n=Math.sqrt(r.dot(e));return e.divideScalar(n),r.multiplyScalar(t.altitude()),e.add(r)},n.prototype.cartesianToCartographic=function(t){var e=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z),r=this.rayon_1,n=this.rayon_3,i=Math.abs((r*r-n*n)/(r*r)),a=1-Math.sqrt(1-i),o=Math.sqrt(t.x*t.x+t.y*t.y),s=Math.atan2(t.y,t.x),u=Math.atan(t.z/o*(1-a+i*r/e)),h=Math.sin(u),c=Math.cos(u),l=Math.atan((t.z*(1-a)+i*r*h*h*h)/((1-a)*(o-i*r*c*c*c))),d=o*Math.cos(l)+t.z*Math.sin(l)-r*Math.sqrt(1-i*Math.sin(l)*Math.sin(l));return{longitude:180*s/Math.PI,latitude:180*l/Math.PI,h:d}},n.prototype.cartographicToCartesianArray=function(t){for(var e=[],r=0;r<t.length;r++)e.push(this.cartographicToCartesian(t[r]));return e},n.prototype.intersection=function(t){var e=t.origin,r=t.direction,n=r.x*r.x/(this.size.x*this.size.x)+r.y*r.y/(this.size.y*this.size.y)+r.z*r.z/(this.size.z*this.size.z),i=2*e.x*r.x/(this.size.x*this.size.x)+2*e.y*r.y/(this.size.y*this.size.y)+2*e.z*r.z/(this.size.z*this.size.z),o=e.x*e.x/(this.size.x*this.size.x)+e.y*e.y/(this.size.y*this.size.y)+e.z*e.z/(this.size.z*this.size.z)-1,s=i*i-4*n*o;if(s<0||0===n||0===i||0===o)return!1;s=Math.sqrt(s);var u=(-i+s)/(2*n),h=(-i-s)/(2*n);if(u<=1e-4&&h<=1e-4)return!1;var c=0;if((c=u<=1e-4?h:h<=1e-4?u:u<h?u:h)<1e-4)return!1;var l=new a.Vector3;return l.addVectors(t.origin,r.clone().setLength(c)),l},n.prototype.computeDistance=function(t,e){var r=t.longitude()*Math.PI/180,n=t.latitude()*Math.PI/180,i=e.longitude()*Math.PI/180,a=e.latitude()*Math.PI/180,o=Math.acos(Math.sin(n)*Math.sin(a)+Math.cos(n)*Math.cos(a)*Math.cos(i-r)),s=this.rayon_1,u=this.rayon_3,h=Math.sqrt((s*s-u*u)/(s*s)),c=(n+a)/2,l=s*(1-h*h)/Math.sqrt(1-h*h*Math.sin(c)*Math.sin(c)),d=s/Math.sqrt(1-h*h*Math.sin(c)*Math.sin(c));return o*Math.sqrt(l*d)},e.default=n},function(t,e,r){"use strict";function n(t,e){this.center=t||new a.Vector3,this.radius=e||1}Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(i);n.prototype.constructor=n,n.prototype.setCenter=function(t){this.center.copy(t)},n.prototype.setRadius=function(t){this.radius=t};var o=new a.Vector3;n.prototype.intersectWithRayNoMiss=function(t){var e=t.closestPointToPoint(this.center),r=e.length(),n=void 0,i=void 0;if(r>this.radius){var a=e.clone().setLength(2*this.radius-r);return n=t.direction.subVectors(a,t.origin).normalize(),e=t.closestPointToPoint(this.center),r=e.length(),i=Math.sqrt(this.radius*this.radius-r*r),n.setLength(i),o.addVectors(e,n)}return n=t.direction.clone(),i=Math.sqrt(this.radius*this.radius-r*r),n.setLength(i),o.subVectors(e,n)},n.prototype.intersectWithRay=function(t){var e=t.closestPointToPoint(this.center),r=e.length();if(!(r>this.radius)){var n=t.direction.clone(),i=Math.sqrt(this.radius*this.radius-r*r);return n.setLength(i),o.subVectors(e,n)}},e.default=n},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(){this.realistic=!1,this.uniformsOut={atmoIN:{type:"i",value:0},screenSize:{type:"v2",value:new u.Vector2(window.innerWidth,window.innerHeight)}};var t=new u.ShaderMaterial({uniforms:this.uniformsOut,vertexShader:w.default,fragmentShader:_.default,side:u.BackSide,blending:u.AdditiveBlending,transparent:!0,wireframe:!1}),e=(0,M.ellipsoidSizes)(),r=new u.SphereGeometry(1.14,64,64).scale(e.x,e.y,e.z);u.Mesh.call(this,r,t),this.uniformsIn={atmoIN:{type:"i",value:1},screenSize:{type:"v2",value:new u.Vector2(window.innerWidth,window.innerHeight)}};var n=new u.ShaderMaterial({uniforms:this.uniformsIn,vertexShader:w.default,fragmentShader:_.default,side:u.FrontSide,blending:u.AdditiveBlending,transparent:!0});this.atmosphereIN=new u.Mesh(new u.SphereGeometry(1.002,64,64).scale(e.x,e.y,e.z),n),this.add(this.atmosphereIN)}Object.defineProperty(e,"__esModule",{value:!0}),e.LIGHTING_POSITION=void 0;var a=r(8),o=n(a),s=r(1),u=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(s),h=r(278),c=n(h),l=r(485),d=n(l),f=r(486),p=n(f),m=r(483),v=n(m),g=r(484),y=n(g),x=r(481),_=n(x),b=r(482),w=n(b),M=r(6),E=e.LIGHTING_POSITION=new u.Vector3(1,0,0);i.prototype=(0,o.default)(u.Mesh.prototype),i.prototype.constructor=i,i.prototype._initRealisticLighning=function(){var t={Kr:.0025,Km:.001,ESun:20,g:-.95,innerRadius:64e5,outerRadius:67e5,wavelength:[.65,.57,.475],scaleDepth:.25,mieScaleDepth:.1},e={v3LightPosition:{value:E.clone().normalize()},v3InvWavelength:{value:new u.Vector3(1/Math.pow(t.wavelength[0],4),1/Math.pow(t.wavelength[1],4),1/Math.pow(t.wavelength[2],4))},fCameraHeight:{value:0},fCameraHeight2:{value:0},fInnerRadius:{value:t.innerRadius},fInnerRadius2:{value:t.innerRadius*t.innerRadius},fOuterRadius:{value:t.outerRadius},fOuterRadius2:{value:t.outerRadius*t.outerRadius},fKrESun:{value:t.Kr*t.ESun},fKmESun:{value:t.Km*t.ESun},fKr4PI:{value:4*t.Kr*Math.PI},fKm4PI:{value:4*t.Km*Math.PI},fScale:{value:1/(t.outerRadius-t.innerRadius)},fScaleDepth:{value:t.scaleDepth},fScaleOverScaleDepth:{value:1/(t.outerRadius-t.innerRadius)/t.scaleDepth},g:{value:t.g},g2:{value:t.g*t.g},nSamples:{value:3},fSamples:{value:3},tDisplacement:{value:new u.Texture},tSkyboxDiffuse:{value:new u.Texture},fNightScale:{value:1}};this.ground={geometry:new u.SphereGeometry(t.innerRadius,50,50),material:new u.ShaderMaterial({uniforms:e,vertexShader:y.default,fragmentShader:v.default,blending:u.AdditiveBlending,transparent:!0,depthTest:!1,depthWrite:!1})},this.ground.mesh=new u.Mesh(this.ground.geometry,this.ground.material),this.sky={geometry:new u.SphereGeometry(t.outerRadius,196,196),material:new u.ShaderMaterial({uniforms:e,vertexShader:p.default,fragmentShader:d.default})},this.sky.mesh=new u.Mesh(this.sky.geometry,this.sky.material),this.sky.material.side=u.BackSide,this.sky.material.transparent=!0,this.ground.mesh.visible=!1,this.sky.mesh.visible=!1,this.skyDome=new c.default,this.skyDome.mesh.frustumCulled=!1,this.skyDome.mesh.material.transparent=!0,this.skyDome.mesh.visible=!1,this.skyDome.mesh.material.depthWrite=!1,this.ground.mesh.layers.mask=this.layers.mask,this.sky.mesh.layers.mask=this.layers.mask,this.skyDome.mesh.layers.mask=this.layers.mask,this.add(this.ground.mesh),this.add(this.sky.mesh),this.add(this.skyDome.mesh);var r={turbidity:10,reileigh:2,mieCoefficient:.005,mieDirectionalG:.8,luminance:1,inclination:.49,azimuth:.25,sun:!1},n=this.skyDome.uniforms;n.turbidity.value=r.turbidity,n.reileigh.value=r.reileigh,n.luminance.value=r.luminance,n.mieCoefficient.value=r.mieCoefficient,n.mieDirectionalG.value=r.mieDirectionalG,n.up.value=new u.Vector3},i.prototype.setRealisticOn=function(t){t&&!this.sky&&this._initRealisticLighning(),this.realistic=t,this.material.visible=!this.realistic,this.atmosphereIN.visible=!this.realistic,this.ground.mesh.visible=this.realistic,this.sky.mesh.visible=this.realistic,this.skyDome.mesh.visible=this.realistic},i.prototype.updateLightingPos=function(t){this.realistic&&(this.ground.material.uniforms.v3LightPosition.value=t.clone().normalize(),this.sky.material.uniforms.v3LightPosition.value=t.clone().normalize(),this.skyDome.uniforms.sunPosition.value.copy(t))},e.default=i},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(){this.projector=new h.default,this.tmp={coords:[s.C.EPSG_4326_Radians(0,0),s.C.EPSG_4326_Radians(0,0)],position:new o.Vector3,normal:new o.Vector3}}Object.defineProperty(e,"__esModule",{value:!0});var a=r(1),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(a),s=r(6),u=r(104),h=n(u),c=r(76),l=n(c);i.prototype.constructor=i,i.prototype.Prepare=function(t){t.nbRow=Math.pow(2,t.level+1);var e=this.projector.WGS84ToOneSubY(t.extent.south());isFinite(e)||(e=0);var r=1/t.nbRow,n=e%r;t.deltaUV1=(e-n)*t.nbRow,t.projected={longitudeRad:0,latitudeRad:0}},i.prototype.Center=function(t){return t.center=t.extent.center(this.tmp.coords[0]).as("EPSG:4978",this.tmp.coords[1]).xyz(),t.center},i.prototype.VertexPosition=function(t){return this.tmp.coords[0]._values[0]=t.projected.longitudeRad,this.tmp.coords[0]._values[1]=t.projected.latitudeRad,this.tmp.coords[0].as("EPSG:4978",this.tmp.coords[1]).xyz(this.tmp.position),this.tmp.normal.copy(this.tmp.position).normalize(),this.tmp.position},i.prototype.VertexNormal=function(){return this.tmp.normal},i.prototype.uProjecte=function(t,e){e.projected.longitudeRad=this.projector.UnitaryToLongitudeWGS84(t,e.extent)},i.prototype.vProjecte=function(t,e){e.projected.latitudeRad=this.projector.UnitaryToLatitudeWGS84(t,e.extent)},i.prototype.getUV_PM=function(t){var e=this.projector.WGS84ToOneSubY(t.projected.latitudeRad)*t.nbRow;return isFinite(e)||(e=0),e-t.deltaUV1},i.prototype.OBB=function(t){return l.default.extentToOBB(t.extent)},e.default=i},function(t,e,r){"use strict";function n(){var t=a.UniformsUtils.clone(o.uniforms),e=new a.ShaderMaterial({fragmentShader:o.fragmentShader,vertexShader:o.vertexShader,uniforms:t,side:a.BackSide}),r=new a.SphereBufferGeometry(4e4,32,15),n=new a.Mesh(r,e);this.mesh=n,this.uniforms=t}Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(i),o={uniforms:{luminance:{type:"f",value:1},turbidity:{type:"f",value:2},reileigh:{type:"f",value:1},mieCoefficient:{type:"f",value:.005},mieDirectionalG:{type:"f",value:.8},sunPosition:{type:"v3",value:new a.Vector3},up:{type:"v3",value:new a.Vector3(0,1,0)}},vertexShader:["varying vec3 vWorldPosition;","void main() {","vec4 worldPosition = modelMatrix * vec4( cameraPosition + position, 1.0 );","vWorldPosition = worldPosition.xyz;","gl_Position = projectionMatrix * modelViewMatrix * vec4( cameraPosition + position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D skySampler;","uniform vec3 sunPosition;","uniform vec3 up;","varying vec3 vWorldPosition;","// uniform sampler2D sDiffuse;","// const float turbidity = 10.0; //","// const float reileigh = 2.; //","// const float luminance = 1.0; //","// const float mieCoefficient = 0.005;","// const float mieDirectionalG = 0.8;","uniform float luminance;","uniform float turbidity;","uniform float reileigh;","uniform float mieCoefficient;","uniform float mieDirectionalG;","// constants for atmospheric scattering","const float e = 2.71828182845904523536028747135266249775724709369995957;","const float pi = 3.141592653589793238462643383279502884197169;","const float n = 1.0003; // refractive index of air","const float N = 2.545E25; // number of molecules per unit volume for air at","// 288.15K and 1013mb (sea level -45 celsius)","const float pn = 0.035; // depolatization factor for standard air","// wavelength of used primaries, according to preetham","const vec3 lambda = vec3(680E-9, 550E-9, 450E-9);","// mie stuff","// K coefficient for the primaries","const vec3 K = vec3(0.686, 0.678, 0.666);","const float v = 4.0;","// optical length at zenith for molecules","const float rayleighZenithLength = 8.4E3;","const float mieZenithLength = 1.25E3;","const float EE = 1000.0;","const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;","// 66 arc seconds -> degrees, and the cosine of that","// earth shadow hack","const float cutoffAngle = pi/1.95;","const float steepness = 1.5;","vec3 totalRayleigh(vec3 lambda)","{","return (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn));","}","// A simplied version of the total Reayleigh scattering to works on browsers that use ANGLE","vec3 simplifiedRayleigh()","{","return 0.0005 / vec3(94, 40, 18);","}","float rayleighPhase(float cosTheta)","{ ","return (3.0 / (16.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (1.0 / (3.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (3.0 / 4.0) * (1.0 + pow(cosTheta, 2.0));","}","vec3 totalMie(vec3 lambda, vec3 K, float T)","{","float c = (0.2 * T ) * 10E-18;","return 0.434 * c * pi * pow((2.0 * pi) / lambda, vec3(v - 2.0)) * K;","}","float hgPhase(float cosTheta, float g)","{","return (1.0 / (4.0*pi)) * ((1.0 - pow(g, 2.0)) / pow(1.0 - 2.0*g*cosTheta + pow(g, 2.0), 1.5));","}","float sunIntensity(float zenithAngleCos)","{","return EE * max(0.0, 1.0 - exp(-((cutoffAngle - acos(zenithAngleCos))/steepness)));","}","// float logLuminance(vec3 c)","// {","// return log(c.r * 0.2126 + c.g * 0.7152 + c.b * 0.0722);","// }","// Filmic ToneMapping http://filmicgames.com/archives/75","float A = 0.15;","float B = 0.50;","float C = 0.10;","float D = 0.20;","float E = 0.02;","float F = 0.30;","float W = 1000.0;","vec3 Uncharted2Tonemap(vec3 x)","{","return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;","}","void main() ","{","vec3 up2 = normalize(cameraPosition.xyz);","float sunfade = 1.0-clamp(1.0-exp((sunPosition.y/450000.0)),0.0,1.0);","float reileighCoefficient = reileigh - (1.0* (1.0-sunfade));","vec3 sunDirection = normalize(sunPosition);","float sunE = sunIntensity(dot(sunDirection, up2));","// extinction (absorbtion + out scattering) ","// rayleigh coefficients","vec3 betaR = simplifiedRayleigh() * reileighCoefficient;","// mie coefficients","vec3 betaM = totalMie(lambda, K, turbidity) * mieCoefficient;","// optical length","// cutoff angle at 90 to avoid singularity in next formula.","float zenithAngle = acos(max(0.0, dot(up2, normalize(vWorldPosition - cameraPosition))));","float sR = rayleighZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","float sM = mieZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","// combined extinction factor","vec3 Fex = exp(-(betaR * sR + betaM * sM));","// in scattering","float cosTheta = dot(normalize(vWorldPosition - cameraPosition), sunDirection);","float rPhase = rayleighPhase(cosTheta*0.5+0.5);","vec3 betaRTheta = betaR * rPhase;","float mPhase = hgPhase(cosTheta, mieDirectionalG);","vec3 betaMTheta = betaM * mPhase;","vec3 Lin = pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * (1.0 - Fex),vec3(1.5));","Lin *= mix(vec3(1.0),pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up2, sunDirection),5.0),0.0,1.0));","//nightsky","vec3 direction = normalize(vWorldPosition - cameraPosition);","float theta = acos(direction.y); // elevation --\x3e y-axis, [-pi/2, pi/2]","float phi = atan(direction.z, direction.x); // azimuth --\x3e x-axis [-pi/2, pi/2]","vec2 uv = vec2(phi, theta) / vec2(2.0*pi, pi) + vec2(0.5, 0.0);","// vec3 L0 = texture2D(skySampler, uv).rgb+0.1 * Fex;","vec3 L0 = vec3(0.1) * Fex;","// composition + solar disc","//if (cosTheta > sunAngularDiameterCos)","float sundisk = smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);","// if (normalize(vWorldPosition - cameraPosition).y>0.0)","L0 += (sunE * 19000.0 * Fex)*sundisk;","vec3 whiteScale = 1.0/Uncharted2Tonemap(vec3(W));","vec3 texColor = (Lin+L0); ","texColor *= 0.04 ;","texColor += vec3(0.0,0.001,0.0025)*0.3;","float g_fMaxLuminance = 1.0;","float fLumScaled = 0.1 / luminance; ","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (g_fMaxLuminance * g_fMaxLuminance)))) / (1.0 + fLumScaled); ","float ExposureBias = fLumCompressed;","vec3 curr = Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);","vec3 color = curr*whiteScale;","vec3 retColor = pow(color,vec3(1.0/(1.2+(1.2*sunfade))));","gl_FragColor.rgb = retColor;","gl_FragColor.a = 1. - ( (length(cameraPosition) - 6400000.) / 1000.);","}"].join("\n")};n.prototype.constructor=n,e.default=n},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){function r(t,e){if(t&&e)return t.level==e.level?t.id==e.id?t:0!=t.level?r(t.parent,e.parent):void 0:t.level<e.level?r(t,e.parent):r(t.parent,e)}function n(t,r,n){return!!O.default.hasEnoughTexturesToSubdivide(t,r,n)&&(0,L.globeSubdivisionControl)(2,e.maxSubdivisionLevel||17,e.sseSubdivisionThreshold||1)(t,r,n)}var i=function(t,e,r){r.material.setLightingOn(t.lighting.enable),r.material.uniforms.lightPosition.value=t.lighting.position,t.noTextureColor&&r.material.uniforms.noTextureColor.value.copy(t.noTextureColor)},a=new _.GeometryLayer(t,e.object3d);a.schemeTile=(0,L.globeSchemeTileWMTS)(L.globeSchemeTile1),a.extent=a.schemeTile[0].clone();for(var o=1;o<a.schemeTile.length;o++)a.extent.union(a.schemeTile[o]);return a.preUpdate=function(t,e,n){if(O.default.preUpdate(t,e),(0,L.preGlobeUpdate)(t,e),n.has(void 0)||0==n.size)return e.level0Nodes;var i=void 0,a=!0,o=!1,s=void 0;try{for(var u,c=(0,h.default)(n.values());!(a=(u=c.next()).done);a=!0){var l=u.value;if(l.isCamera)return e.level0Nodes;if(l.layer===e.id){if(i){if(!(i=r(i,l)))return e.level0Nodes}else i=l;null==i.material&&(i=void 0)}}}catch(t){o=!0,s=t}finally{try{!a&&c.return&&c.return()}finally{if(o)throw s}}return i?[i]:e.level0Nodes},a.update=(0,S.processTiledGeometryNode)((0,L.globeCulling)(2),n),a.builder=new R.default,a.onTileCreated=i,a.type="geometry",a.protocol="tile",a.visible=!0,a.lighting={enable:!1,position:{x:-.5,y:0,z:1}},a}function a(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};l.Object3D.DefaultUp.set(0,0,1);var a=(0,T.ellipsoidSizes)().x;f.default.call(this,"EPSG:4978",t,n),n.object3d=n.object3d||this.scene;var o=new T.C.EPSG_4326(e.longitude,e.latitude,e.altitude);this.camera.setPosition(o),this.camera.camera3D.lookAt({x:0,y:0,z:0}),this.camera.camera3D.near=Math.max(15,2352e-9*a),this.camera.camera3D.far=10*a,this.camera.camera3D.updateProjectionMatrix(),this.camera.camera3D.updateMatrixWorld(!0);var s=i("globe",n),u=new l.DirectionalLight;u.position.set(-.5,0,1),u.updateMatrixWorld(!0),s.object3d.add(u),this.addLayer(s),this.atmosphere=new w.default;var h=this.mainLoop.gfxEngine.getUniqueThreejsLayer();this.atmosphere.traverse(function(t){t.layers.set(h)}),this.camera.camera3D.layers.enable(h),s.object3d.add(this.atmosphere),this.atmosphere.updateMatrixWorld(!0);var c=o.clone();c.setAltitude(0),n.noControls?this.camera.camera3D.lookAt(c.as("EPSG:4978").xyz()):this.controls=new y.default(this,c.as("EPSG:4978").xyz(),a),this._renderState=v.default.FINAL;var d=this.mainLoop.gfxEngine.renderer;this.preRender=function(){var t=new l.Vector3;t.setFromMatrixPosition(s.object3d.matrixWorld);var e=t.distanceTo(r.camera.camera3D.position);t.setFromMatrixScale(s.object3d.matrixWorld);var n=t.x*a*1.1;if(e<n){var i=Math.pow(Math.cos((n-e)/(n-t.x*a*.9981)*Math.PI*.5),1.5),o=new l.Color(9688568);d.setClearColor(o.multiplyScalar(1-i),d.getClearAlpha())}else e>=n&&d.setClearColor(197896,d.getClearAlpha())},this.wgs84TileLayer=s;var p=function t(){r.mainLoop.removeEventListener("command-queue-empty",t),r.dispatchEvent({type:I.GLOBE_INITIALIZED})};this.mainLoop.addEventListener("command-queue-empty",p),this.notifyChange(!0)}Object.defineProperty(e,"__esModule",{value:!0}),e.GLOBE_VIEW_EVENTS=void 0;var o=r(8),s=n(o),u=r(2),h=n(u);e.createGlobeLayer=i;var c=r(1),l=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(c),d=r(36),f=n(d),p=r(111),m=r(74),v=n(m),g=r(113),y=n(g),x=r(21),_=r(25),b=r(276),w=n(b),M=r(272),E=n(M),T=r(6),S=r(44),A=r(71),L=r(108),P=r(277),R=n(P),C=r(110),O=n(C),I=e.GLOBE_VIEW_EVENTS={GLOBE_INITIALIZED:"initialized",LAYER_ADDED:"layer-added",LAYER_REMOVED:"layer-removed",COLOR_LAYERS_ORDER_CHANGED:p.COLOR_LAYERS_ORDER_CHANGED};a.prototype=(0,s.default)(f.default.prototype),a.prototype.constructor=a,a.prototype.addLayer=function(t){if("color"==t.type){var e=this.getLayers(function(t){return"color"===t.type}).length;t.sequence=e,t.update=A.updateLayeredMaterialNodeImagery,"rasterizer"===t.protocol&&(t.reprojection="EPSG:4326")}else if("elevation"==t.type){if("wmts"===t.protocol&&"WGS84G"!==t.options.tileMatrixSet)throw new Error("Only WGS84G tileMatrixSet is currently supported for WMTS elevation layers");t.update=A.updateLayeredMaterialNodeElevation}var r=t.id,n=f.default.prototype.addLayer.call(this,t,this.wgs84TileLayer);return this.dispatchEvent({type:I.LAYER_ADDED,layerId:r}),n},a.prototype.removeLayer=function(t){var e=this.getLayers(function(e){return e.id===t})[0];if(e&&"color"===e.type&&this.wgs84TileLayer.detach(e)){var r=function(e){e.removeColorLayer&&e.removeColorLayer(t)},n=!0,i=!1,a=void 0;try{for(var o,s=(0,h.default)(this.wgs84TileLayer.level0Nodes);!(n=(o=s.next()).done);n=!0){o.value.traverse(r)}}catch(t){i=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}var u=this.getLayers(function(t){return"color"===t.type}),c=!0,l=!1,d=void 0;try{for(var f,p=(0,h.default)(u);!(c=(f=p.next()).done);c=!0){var m=f.value;m.sequence>e.sequence&&m.sequence--}}catch(t){l=!0,d=t}finally{try{!c&&p.return&&p.return()}finally{if(l)throw d}}return this.notifyChange(!0),this.dispatchEvent({type:I.LAYER_REMOVED,layerId:t}),!0}throw new Error(t+" isn't color layer")},a.prototype.selectNodeAt=function(t){var e=this.screenCoordsToNodeId(t),r=!0,n=!1,i=void 0;try{for(var a,o=(0,h.default)(this.wgs84TileLayer.level0Nodes);!(r=(a=o.next()).done);r=!0){a.value.traverse(function(t){t.setSelected&&(t.setSelected(t.id===e),t.id===e&&console.info(t))})}}catch(t){n=!0,i=t}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}this.notifyChange(!0)},a.prototype.screenCoordsToNodeId=function(t){var e=this.mainLoop.gfxEngine.getWindowSize();t=t||new l.Vector2(Math.floor(e.x/2),Math.floor(e.y/2));var r=this._renderState;this.changeRenderState(v.default.ID);var n=this.camera.camera3D.layers.mask;this.camera.camera3D.layers.mask=1<<this.wgs84TileLayer.threejsLayer;var i=this.mainLoop.gfxEngine.renderViewTobuffer(this,this.mainLoop.gfxEngine.fullSizeRenderTarget,t.x,e.y-t.y,1,1);this.changeRenderState(r),this.camera.camera3D.layers.mask=n;var a=(new l.Vector4).fromArray(i).divideScalar(255),o=(0,x.unpack1K)(a,Math.pow(256,3));return Math.round(o)};var D=new l.Matrix4,N=new l.Vector2,U=new l.Vector3,F=new l.Ray,B=new l.Vector3;a.prototype.getPickingPositionFromDepth=function(t){var e=this.mainLoop.gfxEngine.getWindowSize();t=t||e.clone().multiplyScalar(.5);var r=this.camera.camera3D,n=this.camera.camera3D.layers.mask;this.camera.camera3D.layers.mask=1<<this.wgs84TileLayer.threejsLayer;var i=this._renderState;this.changeRenderState(v.default.DEPTH);var a=this.mainLoop.gfxEngine.renderViewTobuffer(this,this.mainLoop.gfxEngine.fullSizeRenderTarget,t.x,e.y-t.y,1,1);N.x=t.x/e.x*2-1,N.y=-t.y/e.y*2+1,F.origin.copy(r.position),F.direction.set(N.x,N.y,.5),D.multiplyMatrices(r.matrixWorld,D.getInverse(r.projectionMatrix)),F.direction.applyMatrix4(D),F.direction.sub(F.origin),B.set(0,0,1),B.applyMatrix4(D),B.sub(F.origin);var o=B.angleTo(F.direction),s=this.mainLoop.gfxEngine.depthBufferRGBAValueToOrthoZ(a,r),u=s/Math.cos(o);if(U.addVectors(r.position,F.direction.setLength(u)),this.changeRenderState(i),r.layers.mask=n,!(U.length()>1e7))return U},a.prototype.changeRenderState=function(t){if(this._renderState!=t&&this.wgs84TileLayer.level0Nodes){var e=function(){return function(e){e.changeState&&e.changeState(t)}}(),r=!0,n=!1,i=void 0;try{for(var a,o=(0,h.default)(this.wgs84TileLayer.level0Nodes);!(r=(a=o.next()).done);r=!0){a.value.traverseVisible(e)}}catch(t){n=!0,i=t}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}this._renderState=t}},a.prototype.setRealisticLightingOn=function(t){var e=E.default.getSunPositionInScene((new Date).getTime(),48.85,2.35).normalize();this.lightingPos=e.normalize();var r=this.wgs84TileLayer.lighting;r.enable=t,r.position=e,this.atmosphere.setRealisticOn(t),this.atmosphere.updateLightingPos(e),this.updateMaterialUniform("lightingEnabled",t),this.updateMaterialUniform("lightPosition",e),this.notifyChange(!0)},a.prototype.setLightingPos=function(t){var e=t||E.default.getSunPositionInScene(this.ellipsoid,(new Date).getTime(),48.85,2.35);this.updateMaterialUniform("lightPosition",e.clone().normalize()),this.notifyChange(!0)},a.prototype.updateMaterialUniform=function(t,e){var r=!0,n=!1,i=void 0;try{for(var a,o=(0,h.default)(this.wgs84TileLayer.level0Nodes);!(r=(a=o.next()).done);r=!0){a.value.traverse(function(r){r.material&&r.material.uniforms&&t in r.material.uniforms&&(r.material.uniforms[t].value=e)})}}catch(t){n=!0,i=t}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}},e.default=a},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(){this.tmp={coords:new c.default("EPSG:4326",0,0),position:new o.Vector3,normal:new o.Vector3(0,0,1)}}Object.defineProperty(e,"__esModule",{value:!0});var a=r(1),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(a),s=r(76),u=n(s),h=r(6),c=n(h);i.prototype.constructor=i,i.prototype.Prepare=function(t){t.nbRow=Math.pow(2,t.zoom+1),t.projected=new o.Vector3},i.prototype.Center=function(t){return t.extent.center(this.tmp.coords),t.center=new o.Vector3(this.tmp.coords.x(),this.tmp.coords.y(),0),t.center},i.prototype.VertexPosition=function(t){return this.tmp.position.set(t.projected.x,t.projected.y,0),this.tmp.position},i.prototype.VertexNormal=function(){return this.tmp.normal},i.prototype.uProjecte=function(t,e){e.projected.x=e.extent.west()+t*(e.extent.east()-e.extent.west())},i.prototype.vProjecte=function(t,e){e.projected.y=e.extent.south()+t*(e.extent.north()-e.extent.south())},i.prototype.OBB=function(t){var e=t.center,r=new o.Vector3(t.extent.east(),t.extent.north(),0).sub(e),n=new o.Vector3(t.extent.west(),t.extent.south(),0).sub(e),i=new o.Vector3(0,0,0);return new u.default(n,r,void 0,i)},e.default=i},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e,r){function n(t,e){if(t&&e)return t.level==e.level?t.id==e.id?t:0!=t.level?n(t.parent,e.parent):void 0:t.level<e.level?n(t,e.parent):n(t.parent,e)}function i(t,e,n){return!!E.default.hasEnoughTexturesToSubdivide(t,e,n)&&(0,_.planarSubdivisionControl)(r.maxSubdivisionLevel||5)(t,e,n)}var a=new g.GeometryLayer(t,r.object3d);a.extent=e,a.schemeTile=[e];var o=function(t,e,r){r.material.setLightingOn(t.lighting.enable),r.material.uniforms.lightPosition.value=t.lighting.position,t.noTextureColor&&r.material.uniforms.noTextureColor.value.copy(t.noTextureColor)};return a.preUpdate=function(t,e,r){if(E.default.preUpdate(t,e),r.has(void 0)||0==r.size)return e.level0Nodes;var i=void 0,a=!0,o=!1,s=void 0;try{for(var u,c=(0,h.default)(r.values());!(a=(u=c.next()).done);a=!0){var l=u.value;if(l.isCamera)return e.level0Nodes;if(l.layer===e.id){if(i){if(!(i=n(i,l)))return e.level0Nodes}else i=l;null==i.material&&(i=void 0)}}}catch(t){o=!0,s=t}finally{try{!a&&c.return&&c.return()}finally{if(o)throw s}}return i?[i]:e.level0Nodes},a.update=(0,y.processTiledGeometryNode)(_.planarCulling,i),a.builder=new w.default,a.onTileCreated=o,a.type="geometry",a.protocol="tile",a.visible=!0,a.lighting={enable:!1,position:{x:-.5,y:0,z:1}},a}function a(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};l.Object3D.DefaultUp.set(0,0,1),f.default.call(this,e.crs(),t,r),r.object3d=r.object3d||this.scene;var n=e.dimensions(),a=e.center().clone();a._values[2]=Math.max(n.x,n.y);var o=a.xyz();o.z=0,this.camera.setPosition(a),this.camera.camera3D.lookAt(o),this.camera.camera3D.near=.1,this.camera.camera3D.far=2*Math.max(n.x,n.y),this.camera.camera3D.updateProjectionMatrix(),this.camera.camera3D.updateMatrixWorld(!0);var s=i("planar",e,r);this.addLayer(s),this._renderState=m.default.FINAL,this.tileLayer=s}Object.defineProperty(e,"__esModule",{value:!0});var o=r(8),s=n(o),u=r(2),h=n(u);e.createPlanarLayer=i;var c=r(1),l=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(c),d=r(36),f=n(d),p=r(74),m=n(p),v=r(21),g=r(25),y=r(44),x=r(71),_=r(296),b=r(280),w=n(b),M=r(110),E=n(M);a.prototype=(0,s.default)(f.default.prototype),a.prototype.constructor=a,a.prototype.addLayer=function(t){return"color"==t.type?(t.update=x.updateLayeredMaterialNodeImagery,"rasterizer"===t.protocol&&(t.reprojection=this.referenceCrs)):"elevation"==t.type&&(t.update=x.updateLayeredMaterialNodeElevation),f.default.prototype.addLayer.call(this,t,this.tileLayer)},a.prototype.selectNodeAt=function(t){var e=this.screenCoordsToNodeId(t),r=!0,n=!1,i=void 0;try{for(var a,o=(0,h.default)(this.tileLayer.level0Nodes);!(r=(a=o.next()).done);r=!0){a.value.traverse(function(t){t.setSelected&&(t.setSelected(t.id===e),t.id===e&&console.info(t))})}}catch(t){n=!0,i=t}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}this.notifyChange()},a.prototype.screenCoordsToNodeId=function(t){var e=this.mainLoop.gfxEngine.getWindowSize(),r=this._renderState;this.changeRenderState(m.default.ID);var n=this.mainLoop.gfxEngine.renderViewTobuffer(this,this.mainLoop.gfxEngine.fullSizeRenderTarget,t.x,e.y-t.y,1,1);this.changeRenderState(r);var i=(new l.Vector4).fromArray(n).divideScalar(255),a=(0,v.unpack1K)(i,Math.pow(256,3));return Math.round(a)};var T=new l.Matrix4,S=new l.Vector2,A=new l.Vector3,L=new l.Ray,P=new l.Vector3;a.prototype.getPickingPositionFromDepth=function(t){var e=this.mainLoop.gfxEngine.getWindowSize();t=t||e.clone().multiplyScalar(.5);var r=this.camera.camera3D,n=this.camera.camera3D.layers.mask;this.camera.camera3D.layers.mask=1<<this.tileLayer.threejsLayer;var i=this._renderState;this.changeRenderState(m.default.DEPTH);var a=this.mainLoop.gfxEngine.renderViewTobuffer(this,this.mainLoop.gfxEngine.fullSizeRenderTarget,t.x,e.y-t.y,1,1);S.x=t.x/e.x*2-1,S.y=-t.y/e.y*2+1,L.origin.copy(r.position),L.direction.set(S.x,S.y,.5),T.multiplyMatrices(r.matrixWorld,T.getInverse(r.projectionMatrix)),L.direction.applyMatrix4(T),L.direction.sub(L.origin),P.set(0,0,1),P.applyMatrix4(T),P.sub(L.origin);var o=P.angleTo(L.direction),s=this.mainLoop.gfxEngine.depthBufferRGBAValueToOrthoZ(a,r),u=s/Math.cos(o);if(A.addVectors(r.position,L.direction.setLength(u)),this.changeRenderState(i),r.layers.mask=n,!(A.length()>1e7))return A},a.prototype.changeRenderState=function(t){if(this._renderState!=t&&this.tileLayer.level0Nodes){var e=function(){return function(e){e.changeState&&e.changeState(t)}}(),r=!0,n=!1,i=void 0;try{for(var a,o=(0,h.default)(this.tileLayer.level0Nodes);!(r=(a=o.next()).done);r=!0){a.value.traverseVisible(e)}}catch(t){n=!0,i=t}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}this._renderState=t}},e.default=a},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t){return t.getElementsByTagName("wpt")}function a(t){return t.getElementsByTagName("trkpt")}function o(t,e){var r=Number(t.attributes.lon.nodeValue),n=Number(t.attributes.lat.nodeValue),i=t.getElementsByTagName("ele")[0],a=i?Number(i.childNodes[0].nodeValue):0;return new w.default("EPSG:4326",r,n,a).as(e).xyz()}function s(t,e){var r=t.geometry.boundingSphere.center.clone().applyMatrix4(t.matrixWorld);return L.setFromMatrixPosition(e.matrixWorld),L.distanceTo(r)}function u(t,e,r){var n=s(this,r),i=Math.max(2,Math.min(100,n/t.getSize().height));this.scale.set(i,i,i),this.updateMatrixWorld()}function h(t,e){var r=i(t);if(r.length){var n=new v.Group;t.center=t.center||o(r[0],e);var a=t.center.clone().negate(),s=!0,h=!1,c=void 0;try{for(var l,d=(0,p.default)(r);!(s=(l=d.next()).done);s=!0){var f=l.value,m=o(f,e).sub(t.center),g=new v.Mesh(S,A);g.position.copy(m),g.lookAt(a),g.onBeforeRender=u,n.add(g)}}catch(t){h=!0,c=t}finally{try{!s&&d.return&&d.return()}finally{if(h)throw c}}return n}return null}function c(t,e,r){var n=s(this,r);this.material.depthTest=n<2*this.geometry.boundingSphere.radius;var i=t.getSize();this.material.uniforms.resolution.value.set(i.width,i.height)}function l(t,e){var r=a(t);if(r.length){t.center=t.center||o(r[0],e.crs);var n=new v.Geometry,i=!0,s=!1,u=void 0;try{for(var h,l=(0,p.default)(r);!(i=(h=l.next()).done);i=!0){var d=h.value,f=o(d,e.crs).sub(t.center);n.vertices.push(f)}}catch(t){s=!0,u=t}finally{try{!i&&l.return&&l.return()}finally{if(s)throw u}}var m=new y.default.MeshLine;m.setGeometry(n);var g=new y.default.MeshLineMaterial({lineWidth:e.lineWidth||12,sizeAttenuation:0,color:new v.Color(16711680)});E.default.isLogDepthBufferSupported()&&(g.fragmentShader=g.fragmentShader.replace(/.*/,"").substr(1),(0,T.patchMaterialForLogDepthSupport)(g),console.warn("MeshLineMaterial shader has been patched to add log depth buffer support"));var x=new v.Mesh(m.geometry,g);return x.onBeforeRender=c,x}return null}function d(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t){void 0==e.enablePin&&(e.enablePin=!0);var r=new v.Object3D,n=l(t,e);if(n&&r.add(n),e.enablePin){var i=h(t,e.crs);i&&r.add(i)}return r.position.copy(t.center),r.updateMatrixWorld(),r.matrixAutoUpdate=!1,r}}Object.defineProperty(e,"__esModule",{value:!0});var f=r(2),p=n(f),m=r(1),v=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(m),g=r(498),y=n(g),x=r(16),_=n(x),b=r(6),w=n(b),M=r(35),E=n(M),T=r(106),S=new v.BoxGeometry(1,1,80),A=new v.MeshBasicMaterial({color:16777215}),L=new v.Vector3;e.default={load:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.crs=e,_.default.xml(t,r.networkOptions).then(function(t){return d(t,r)})}}},function(t,e,r){"use strict";function n(){}Object.defineProperty(e,"__esModule",{value:!0});var i=r(16),a=function(t){return t&&t.__esModule?t:{default:t}}(i),o=function(t){this.floatArray=new Float32Array(t),this.max=void 0,this.min=void 0,this.texture=null};n.prototype.computeMinMaxElevation=function(t,e,r,n){var i=1e6,a=-1e6;if(!t)return{min:void 0,max:void 0};for(var o=n?Math.floor(n.z*e):t.length,s=n?Math.floor(n.z*r):1,u=n?Math.floor(n.x*e):0,h=n?Math.floor(n.y*r):0,c=n?Math.max(Math.floor(o/8),2):16,l=h;l<h+s;l+=c)for(var d=l*(e||0),f=u;f<u+o;f+=c){var p=t[d+f];p>-10&&void 0!==p&&(a=Math.max(a,p),i=Math.min(i,p))}return-1e6===a||1e6===i?{min:void 0,max:void 0}:{min:i,max:a}},n.prototype.parseXBil=function(t,e){if(!t)throw new Error("Error processing XBIL");var r=new o(t),n=this.computeMinMaxElevation(r.floatArray);return r.min=n.min,r.max=n.max,r.url=e,r},n.prototype.read=function(t,e){var r=this;return a.default.arrayBuffer(t,e).then(function(e){return r.parseXBil(e,t)})},e.default=n},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){var r=t.min,n=t.max,i=(new l.Vector3).copy(n).sub(r).multiplyScalar(.5),a=new l.Vector3(i.x,0,0),o=new l.Vector3(0,i.y,0),s=new l.Vector3(0,0,i.z),u=r,h=(new l.Vector3).add(r).add(i);return 1===e?(r=(new l.Vector3).copy(u).add(s),n=(new l.Vector3).copy(h).add(s)):3===e?(r=(new l.Vector3).copy(u).add(s).add(o),n=(new l.Vector3).copy(h).add(s).add(o)):0===e?(r=u,n=h):2===e?(r=(new l.Vector3).copy(u).add(o),n=(new l.Vector3).copy(h).add(o)):5===e?(r=(new l.Vector3).copy(u).add(s).add(a),n=(new l.Vector3).copy(h).add(s).add(a)):7===e?(r=(new l.Vector3).copy(u).add(i),n=(new l.Vector3).copy(h).add(i)):4===e?(r=(new l.Vector3).copy(u).add(a),n=(new l.Vector3).copy(h).add(a)):6===e&&(r=(new l.Vector3).copy(u).add(a).add(o),n=(new l.Vector3).copy(h).add(a).add(o)),new l.Box3(r,n)}function a(t,e,r){return f.default.arrayBuffer(r.baseurl+"/r"+r.name+".hrc",t.fetchOptions).then(function(t){var n=new DataView(t),a=[],o=0;for(r.childrenBitField=n.getUint8(0),o+=1,r.numPoints=n.getUint32(1,!0),o+=4,r.children=[],a.push(r);a.length&&o<t.byteLength;)for(var s=a.shift(),u=0;u<8;u++)if(s.childrenBitField&1<<u&&o+5<=t.byteLength){var h=n.getUint8(o);o+=1;var c=n.getUint32(o,!0);o+=4,0==c&&(c=r.numPoints);var l=s.name+u,d=i(s.bbox,u),f=r.baseurl;if(l.length%e==0){var p=l.substr(r.name.length);f=r.baseurl+"/"+p}var m={numPoints:c,childrenBitField:h,children:[],name:l,baseurl:f,bbox:d};s.children.push(m),a.push(m)}return r})}function o(t){var e=t.geometry.attributes.position.count,r=new Uint8Array(4*e),n=_++;if(e>65535||n>65535)return console.warn("Currently picking is limited to Points with less than 65535 elements and less than 65535 Points instances"),t;for(var i=0;i<e;i++){var a=n<<16|i;r[4*i+0]=(4278190080&a)>>24,r[4*i+1]=(16711680&a)>>16,r[4*i+2]=(65280&a)>>8,r[4*i+3]=(255&a)>>0}return t.baseId=n,t.geometry.addAttribute("unique_id",new l.BufferAttribute(r,4,!0)),t}function s(t,e){return fetch(e,t.fetchOptions).then(function(t){return t.arrayBuffer()}).then(function(e){return o(t.metadata.customBinFormat?x.default.parse(e):g.default.parse(e))})}Object.defineProperty(e,"__esModule",{value:!0});var u=r(2),h=n(u),c=r(1),l=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(c),d=r(16),f=n(d),p=r(109),m=n(p),v=r(285),g=n(v),y=r(286),x=n(y),_=1;e.default={preprocessDataLayer:function(t){return t.file||(t.file="cloud.js"),t.fetchOptions=t.fetchOptions||{},t.octreeDepthLimit=t.octreeDepthLimit||-1,t.pointBudget=t.pointBudget||15e6,t.pointSize=t.pointSize||4,t.overdraw=t.overdraw||2,t.type="geometry",t.preUpdate=m.default.preUpdate,t.update=m.default.update,t.postUpdate=m.default.postUpdate,f.default.json(t.url+"/"+t.file,t.fetchOptions).then(function(e){t.metadata=e;var r=void 0;if(void 0!=t.metadata.scale)t.metadata.customBinFormat="CIN"===t.metadata.pointAttributes,r=new l.Box3(new l.Vector3(e.boundingBox.lx,e.boundingBox.ly,e.boundingBox.lz),new l.Vector3(e.boundingBox.ux,e.boundingBox.uy,e.boundingBox.uz));else{t.metadata.scale=1,t.metadata.octreeDir="itowns/"+t.table+".points",t.metadata.hierarchyStepSize=1e6,t.metadata.customBinFormat=!0;var n=0,i=!0,o=!1,s=void 0;try{for(var u,c=(0,h.default)(e);!(i=(u=c.next()).done);i=!0){if(u.value.table==t.table)break;n++}}catch(t){o=!0,s=t}finally{try{!i&&c.return&&c.return()}finally{if(o)throw s}}r=new l.Box3(new l.Vector3(e[n].bbox.xmin,e[n].bbox.ymin,e[n].bbox.zmin),new l.Vector3(e[n].bbox.xmax,e[n].bbox.ymax,e[n].bbox.zmax))}return a(t,t.metadata.hierarchyStepSize,{baseurl:t.url+"/"+e.octreeDir+"/r",name:"",bbox:r})}).then(function(e){return console.log("LAYER metadata:",e),t.root=e,t})},executeCommand:function(t){var e=t.layer,r=t.requester;r.childrenBitField&&0===r.children.length&&a(e,e.metadata.hierarchyStepSize,r).then(function(){return t.view.notifyChange(!1)});var n=e.metadata.customBinFormat?"cin":"bin",i=r.baseurl+"/r"+r.name+"."+n+"?isleaf="+(t.isLeaf?1:0);return s(e,i).then(function(t){return t.position.copy(r.bbox.min),t.scale.set(e.metadata.scale,e.metadata.scale,e.metadata.scale),t.tightbbox.min.x*=e.metadata.scale,t.tightbbox.min.y*=e.metadata.scale,t.tightbbox.min.z*=e.metadata.scale,t.tightbbox.max.x*=e.metadata.scale,t.tightbbox.max.y*=e.metadata.scale,t.tightbbox.max.z*=e.metadata.scale,t.tightbbox.translate(r.bbox.min),t.updateMatrix(),t.updateMatrixWorld(!0),t.layers.set(e.threejsLayer),t})}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(n),a=r(73),o=function(t){return t&&t.__esModule?t:{default:t}}(a);e.default={parse:function(t){if(!t)throw new Error("No array buffer provided.");var e=new DataView(t),r=Math.floor(t.byteLength/16),n=new Float32Array(3*r),a=new Uint8Array(4*r),s=new i.Box3;s.min.set(1/0,1/0,1/0),s.max.set(-1/0,-1/0,-1/0);for(var u=new i.Vector3,h=0,c=0;c<r;c++)n[3*c]=e.getUint32(h+0,!0),n[3*c+1]=e.getUint32(h+4,!0),n[3*c+2]=e.getUint32(h+8,!0),u.fromArray(n,3*c),s.min.min(u),s.max.max(u),a[4*c]=e.getUint8(h+12),a[4*c+1]=e.getUint8(h+13),a[4*c+2]=e.getUint8(h+14),a[4*c+3]=255,h+=16;var l=new i.BufferGeometry;l.addAttribute("position",new i.BufferAttribute(n,3)),l.addAttribute("color",new i.BufferAttribute(a,4,!0));var d=new o.default,f=new i.Points(l,d);return f.frustumCulled=!1,f.matrixAutoUpdate=!1,f.realPointCount=r,f.tightbbox=s,f}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(n),a=r(73),o=function(t){return t&&t.__esModule?t:{default:t}}(a);e.default={parse:function(t){if(!t)throw new Error("No array buffer provided.");var e=new DataView(t,0,24),r=new i.Vector3(e.getFloat32(0,!0),e.getFloat32(4,!0),e.getFloat32(8,!0)),n=new i.Vector3(e.getFloat32(12,!0),e.getFloat32(16,!0),e.getFloat32(20,!0)),a=new i.Box3(r,n),s=Math.floor((t.byteLength-24)/16),u=new Float32Array(t,24,3*s),h=new Uint8Array(t,24+12*s,4*s),c=new i.BufferGeometry;c.addAttribute("position",new i.BufferAttribute(u,3)),c.addAttribute("color",new i.BufferAttribute(h,4,!0));var l=new o.default,d=new i.Points(c,l);return d.frustumCulled=!1,d.matrixAutoUpdate=!1,d.realPointCount=s,d.tightbbox=a,d}}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t){t=String(t);var e=t.split(/[\\\/]/).pop(),r=e.lastIndexOf(".");return""===e||r<1?"":e.slice(r+1)}function a(t){var e=t.getElementsByTagName("bounds")[0];if(e){var r=e.getAttribute("minlon"),n=e.getAttribute("maxlon"),i=e.getAttribute("minlat"),a=e.getAttribute("maxlat");return new p.default("EPSG:4326",r,n,i,a)}return new p.default("EPSG:4326",-180,180,-90,90)}function o(t,e){if(!t.material)return u.default.resolve();if("color"==e.type){var r=t.extent.as(e.projection),n={pitch:new c.Vector3(0,0,1)};return n.texture=v.default.createTextureFromGeoson(e.geojson,t.extent,256,e.style),n.texture.extent=t.extent,n.texture.coords=r,n.texture.coords.zoom=t.level,u.default.resolve(n)}return u.default.resolve()}Object.defineProperty(e,"__esModule",{value:!0});var s=r(7),u=n(s),h=r(1),c=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(h),l=r(499),d=n(l),f=r(12),p=n(f),m=r(300),v=n(m),g=r(75),y=n(g),x=r(16),_=n(x),b=["vector/kml","vector/gpx","vector/geojson"],w={"vector/kml":_.default.xml,"vector/gpx":_.default.xml,"vector/geojson":_.default.json};e.default={preprocessDataLayer:function(t){if(!t.url)throw new Error("layer.url is required");var e=i(t.url).toLowerCase(),r="vector/"+e;return t.options=t.options||{},b.includes(r)||t.options.mimetype?w[r](t.url).then(function(e){if(e.getElementsByTagName)if(e.getElementsByTagName("kml")[0])t.options.mimetype="vector/kml",t.projection=t.projection||"EPSG:4326";else{if(!e.getElementsByTagName("gpx")[0])throw new Error("Unsupported xml file data vector");t.options.mimetype="vector/gpx",t.projection=t.projection||"EPSG:4326"}else{if("Feature"!=e.type&&"FeatureCollection"!=e.type)throw new Error("Unsupported json file data vector");t.options.mimetype="vector/geojson"}t.extent instanceof p.default||(t.extent=new p.default(t.projection,t.extent)),t.options.zoom||(t.options.zoom={min:5,max:21}),t.format=t.options.mimetype,t.style=t.style||{},t.noTextureParentOutsideLimit=!0;var r={buildExtent:!0,crsIn:t.projection};if("vector/geojson"===t.options.mimetype)t.geojson=y.default.parse(t.reprojection,e,t.extent,r),t.extent=t.geojson.extent||t.geojson.geometry.extent;else if("vector/kml"===t.options.mimetype){var n=d.default.kml(e);t.geojson=y.default.parse(t.reprojection,n,t.extent,r),t.extent=t.geojson.extent}else if("vector/gpx"===t.options.mimetype){var i=d.default.gpx(e);t.style.stroke=t.style.stroke||"red",t.extent=a(e),t.geojson=y.default.parse(t.reprojection,i,t.extent,r),t.extent=t.geojson.extent}t.originalprojection=t.projection,t.projection=t.reprojection}):u.default.reject(new Error("layer.options.mimetype is required"))},tileInsideLimit:function(t,e){return e.ready&&t.level>=e.options.zoom.min&&t.level<=e.options.zoom.max&&e.extent.intersect(t.extent)},executeCommand:function(t){var e=t.layer;return b.includes(e.format)?o(t.requester,e):u.default.reject(new Error("Unsupported mimetype "+e.format))}}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(){}Object.defineProperty(e,"__esModule",{value:!0});var a=r(28),o=n(a),s=r(1),u=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(s),h=r(26),c=n(h),l=r(12),d=n(l);i.prototype.preprocessDataLayer=function(t){if(!t.extent)throw new Error("Missing extent property for layer '"+t.id+"'");if(!t.projection)throw new Error("Missing projection property for layer '"+t.id+"'");t.extent=new(Function.prototype.bind.apply(d.default,[null].concat([t.projection],(0,o.default)(t.extent)))),t.options.zoom||(t.options.zoom={min:0,max:18})},i.prototype.url=function(t,e){return e.url.replace("${z}",t.zoom).replace("${y}",t.row).replace("${x}",t.col)},i.prototype.executeCommand=function(t){var e=t.layer,r=t.requester,n=r.getCoordsForLayer(e)[0],i=t.targetLevel<n.zoom?c.default.WMTS_WGS84Parent(n,t.targetLevel):void 0,a=this.url(i||n,e);return c.default.getColorTextureByUrl(a,e.networkOptions).then(function(t){var e={};return e.texture=t,e.texture.coords=i||n,e.pitch=i?n.offsetToParent(i):new u.Vector3(0,0,1),e})},i.prototype.tileTextureCount=function(t,e){return this.tileInsideLimit(t,e)?1:0},i.prototype.tileInsideLimit=function(t,e,r){var n=t.getCoordsForLayer(e)[0];return r<n.zoom&&(n=c.default.WMTS_WGS84Parent(n,r)),e.options.zoom.min<=n.zoom&&n.zoom<=e.options.zoom.max},e.default=i},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(){d.default.call(this,null)}Object.defineProperty(e,"__esModule",{value:!0});var a=r(2),o=n(a),s=r(7),u=n(s),h=r(8),c=n(h),l=r(70),d=n(l),f=r(293),p=n(f),m=r(294),v=n(m),g=r(27),y=r(44);i.prototype=(0,c.default)(d.default.prototype),i.prototype.constructor=i,i.prototype.preprocessDataLayer=function(t,e,r){if(!t.schemeTile)throw new Error("Cannot init tiled layer without schemeTile for layer "+t.id);t.level0Nodes=[],t.onTileCreated=t.onTileCreated||function(){};var n=[],i=!0,a=!1,s=void 0;try{for(var h,c=(0,o.default)(t.schemeTile);!(i=(h=c.next()).done);i=!0){var l=h.value;n.push((0,y.requestNewTile)(e,r,t,l,void 0,0))}}catch(t){a=!0,s=t}finally{try{!i&&c.return&&c.return()}finally{if(a)throw s}}return u.default.all(n).then(function(e){t.level0Nodes=e;var r=!0,n=!1,i=void 0;try{for(var a,s=(0,o.default)(e);!(r=(a=s.next()).done);r=!0){var u=a.value;t.object3d.add(u),u.updateMatrixWorld()}}catch(t){n=!0,i=t}finally{try{!r&&s.return&&s.return()}finally{if(n)throw i}}})},i.prototype.executeCommand=function(t){var e=t.extent;if(t.requester&&!t.requester.material)return u.default.reject(new g.CancelledCommandException(t));var r=t.requester,n={extent:e,level:void 0===t.level?r.level+1:t.level,segment:16,materialOptions:t.layer.materialOptions,disableSkirt:t.layer.disableSkirt},i=new p.default(n,t.layer.builder),a=new v.default(i,n);return a.layer=t.layer.id,a.layers.set(t.threejsLayer),r&&n.center.sub(r.geometry.center),a.position.copy(n.center),a.setVisibility(!1),a.updateMatrix(),r?a.setBBoxZ(r.OBB().z.min,r.OBB().z.max):t.layer.materialOptions&&t.layer.materialOptions.useColorTextureElevation&&a.setBBoxZ(t.layer.materialOptions.colorTextureElevationMinZ,t.layer.materialOptions.colorTextureElevationMaxZ),u.default.resolve(a)},e.default=i},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(){this.cache=(0,b.default)(),this.pointOrder=new f.default}function a(t,e){if(t){t.layer=e.id,t.layers.set(e.threejsLayer);var r=!0,n=!1,i=void 0;try{for(var o,u=(0,s.default)(t.children);!(r=(o=u.next()).done);r=!0){a(o.value,e)}}catch(t){n=!0,i=t}finally{try{!r&&u.return&&u.return()}finally{if(n)throw i}}return t}}Object.defineProperty(e,"__esModule",{value:!0});var o=r(2),s=n(o),u=r(7),h=n(u),c=r(8),l=n(c),d=r(77),f=n(d),p=r(12),m=n(p),v=r(70),g=n(v),y=r(16),x=n(y),_=r(69),b=n(_),w=r(75),M=n(w),E=r(299),T=n(E);i.prototype=(0,l.default)(g.default.prototype),i.prototype.constructor=i,i.prototype.url=function(t,e){var r=t.as(e.projection),n=r.west(),i=r.south(),a=r.east(),o=r.north(),s=n+","+i+","+a+","+o;return e.customUrl.replace("%bbox",s)},i.prototype.preprocessDataLayer=function(t){if(!t.typeName)throw new Error("layer.typeName is required.");t.format=t.options.mimetype||"json",t.crs=t.projection||"EPSG:4326",t.version=t.version||"2.0.2",t.extent instanceof m.default||(t.extent=new m.default(t.projection,t.extent)),t.customUrl=t.url+"SERVICE=WFS&REQUEST=GetFeature&typeName="+t.typeName+"&VERSION="+t.version+"&SRSNAME="+t.crs+"&outputFormat="+t.format+"&BBOX=%bbox,"+t.crs},i.prototype.tileInsideLimit=function(t,e){return(void 0===e.level||t.level===e.level)&&e.extent.intersect(t.extent)},i.prototype.executeCommand=function(t){var e=t.layer,r=t.requester,n=t.view.referenceCrs,i={json:this.getFeatures.bind(this),geojson:this.getFeatures.bind(this)},a=i[e.format];return a?a(n,r,e,t).then(function(e){return t.resolve(e)}):h.default.reject(new Error("Unsupported mimetype "+e.format))},i.prototype.getFeatures=function(t,e,r){if(!r.tileInsideLimit(e,r)||null===e.material)return h.default.resolve();var n=this.url(e.extent.as(r.crs),r),i={};return i.feature=this.cache.getRessource(n),void 0!==i.feature?h.default.resolve(i):x.default.json(n,r.networkOptions).then(function(n){return a(T.default.convert(M.default.parse(t,n,e.extent)),r)})},i.prototype.getPointOrder=function(t){if(this.pointOrder[t])return this.pointOrder[t];var e={lat:0,long:1};if("EPSG"==t.type&&"4326"==t.properties.code)return e.long=0,e.lat=1,e;if("name"==t.type&&t.properties.name){if(new RegExp(/^urn:[x-]?ogc:def:crs:EPSG:(\d*.?\d*)?:\d{4}/).test(t.properties.name))return e;if(new RegExp(/^urn:[x-]?ogc:def:crs:OGC:(\d*.?\d*)?:(CRS)?(WSG)?\d{0,2}/).test(t.properties.name))return e.long=0,e.lat=1,e}},e.default=i},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(){}Object.defineProperty(e,"__esModule",{value:!0});var a=r(7),o=n(a),s=r(1),u=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(s),h=r(12),c=n(h),l=r(26),d=n(l);i.prototype.url=function(t,e){var r=t.as(e.projection),n=r.west(),i=r.south(),a=r.east(),o=r.north(),s="swne"===e.axisOrder?i+","+n+","+o+","+a:n+","+i+","+a+","+o;return e.customUrl.replace("%bbox",s)},i.prototype.preprocessDataLayer=function(t){if(!t.name)throw new Error("layer.name is required.");if(!t.extent)throw new Error("layer.extent is required");if(!t.projection)throw new Error("layer.projection is required");t.extent instanceof c.default||(t.extent=new c.default(t.projection,t.extent)),t.options.zoom||(t.options.zoom={min:0,max:21}),t.axisOrder=t.axisOrder||"swne",t.format=t.options.mimetype||"image/png",t.width=t.heightMapWidth||256,t.version=t.version||"1.3.0",t.style=t.style||"",t.transparent=t.transparent||!1,t.customUrl=t.url+"?SERVICE=WMS&REQUEST=GetMap&LAYERS="+t.name+"&VERSION="+t.version+"&STYLES="+t.style+"&FORMAT="+t.format+"&TRANSPARENT="+t.transparent+"&BBOX=%bbox&CRS="+t.projection+"&WIDTH="+t.width+"&HEIGHT="+t.width},i.prototype.tileInsideLimit=function(t,e){return t.level>=e.options.zoom.min&&t.level<=e.options.zoom.max&&e.extent.intersect(t.extent)},i.prototype.getColorTexture=function(t,e){if(!this.tileInsideLimit(t,e))return o.default.reject("Tile '"+t+"' is outside layer bbox "+e.extent);if(null===t.material)return o.default.resolve();var r=t.extent.as(e.projection),n=this.url(r,e),i=new u.Vector3(0,0,1),a={pitch:i};return d.default.getColorTextureByUrl(n,e.networkOptions).then(function(e){return a.texture=e,a.texture.extent=t.extent,a.texture.coords=r,a.texture.coords.zoom=t.level,a})},i.prototype.executeCommand=function(t){var e=t.requester,r=t.layer,n={"image/png":this.getColorTexture.bind(this),"image/jpg":this.getColorTexture.bind(this),"image/jpeg":this.getColorTexture.bind(this)},i=n[r.format];return i?i(e,r):o.default.reject(new Error("Unsupported mimetype "+r.format))},e.default=i},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(){}Object.defineProperty(e,"__esModule",{value:!0});var a=r(2),o=n(a),s=r(7),u=n(s),h=r(46),c=n(h),l=r(1),d=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(l),f=r(26),p=n(f);i.prototype.customUrl=function(t,e,r,n,i){var a=e.replace("%TILEMATRIX",r.toString());return a=a.replace("%ROW",n.toString()),a=a.replace("%COL",i.toString())},i.prototype.preprocessDataLayer=function(t){if(t.fx=t.fx||0,t.options=t.options||{},"wmts"===t.protocol){var e=t.options;e.version=e.version||"1.0.0",e.tileMatrixSet=e.tileMatrixSet||"WGS84",e.mimetype=e.mimetype||"image/png",e.style=e.style||"normal",e.projection=e.projection||"EPSG:3857";var r=t.url+"?LAYER="+e.name+"&FORMAT="+e.mimetype+"&SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&STYLE=normal&TILEMATRIXSET="+e.tileMatrixSet;if(r+="&TILEMATRIX=%TILEMATRIX&TILEROW=%ROW&TILECOL=%COL",!t.options.zoom){var n=(0,c.default)(e.tileMatrixSetLimits),i=n.length,a=Number(n[i-1]),o=a-i+1;t.options.zoom={min:o,max:a}}t.customUrl=r}t.options.zoom=t.options.zoom||{min:2,max:20}},i.prototype.url=function(t,e){return this.customUrl(e,e.customUrl,t.zoom,t.row,t.col)},i.prototype.getXbilTexture=function(t,e,r){var n=new d.Vector3(0,0,1),i=t.getCoordsForLayer(e)[0];r&&r!==i.zoom&&(i=p.default.WMTS_WGS84Parent(i,r,n));var a=this.url(i,e);return p.default.getXBilTextureByUrl(a,e.networkOptions).then(function(t){var e=p.default.ioDXBIL.computeMinMaxElevation(t.image.data,f.SIZE_TEXTURE_TILE,f.SIZE_TEXTURE_TILE,n),r=e.min,a=e.max;return t.coords=i,{texture:t,pitch:n,min:void 0===r?0:r,max:void 0===a?0:a}})},i.prototype.getColorTexture=function(t,e){var r=this.url(t,e);return p.default.getColorTextureByUrl(r,e.networkOptions).then(function(e){var r={};return r.texture=e,r.texture.coords=t,r.pitch=new d.Vector3(0,0,1),r})},i.prototype.executeCommand=function(t){var e=t.layer,r=t.requester,n={"image/png":this.getColorTextures.bind(this),"image/jpg":this.getColorTextures.bind(this),"image/jpeg":this.getColorTextures.bind(this),"image/x-bil;bits=32":this.getXbilTexture.bind(this)},i=n[e.options.mimetype];return i?i(r,e,t.targetLevel):u.default.reject(new Error("Unsupported mimetype "+e.options.mimetype))},i.prototype.tileTextureCount=function(t,e){var r=e.options.tileMatrixSet;return p.default.computeTileMatrixSetCoordinates(t,r),t.getCoordsForLayer(e).length},i.prototype.tileInsideLimit=function(t,e,r){var n=!0,i=!1,a=void 0;try{for(var s,u=(0,o.default)(t.getCoordsForLayer(e));!(n=(s=u.next()).done);n=!0){var h=s.value,c=h;if(r<c.zoom&&(c=p.default.WMTS_WGS84Parent(h,r)),c.zoom<e.options.zoom.min||c.zoom>e.options.zoom.max)return!1;if(e.options.tileMatrixSetLimits&&(c.row<e.options.tileMatrixSetLimits[c.zoom].minTileRow||c.row>e.options.tileMatrixSetLimits[c.zoom].maxTileRow||c.col<e.options.tileMatrixSetLimits[c.zoom].minTileCol||c.col>e.options.tileMatrixSetLimits[c.zoom].maxTileCol))return!1}}catch(t){i=!0,a=t}finally{try{!n&&u.return&&u.return()}finally{if(i)throw a}}return!0},i.prototype.getColorTextures=function(t,e){if(null===t.material)return u.default.resolve();var r=[],n=t.getCoordsForLayer(e),i=!0,a=!1,s=void 0;try{for(var h,c=(0,o.default)(n);!(i=(h=c.next()).done);i=!0){var l=h.value;r.push(this.getColorTexture(l,e))}}catch(t){a=!0,s=t}finally{try{!i&&c.return&&c.return()}finally{if(a)throw s}}return u.default.all(r)},e.default=i},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(){this.index=null,this.position=null,this.normal=null,this.uv={wgs84:null,pm:null}}function a(t,e){h.BufferGeometry.call(this),this.center=e.Center(t).clone(),this.OBB=e.OBB(t);var r=this.computeBuffers(t,e);this.setIndex(r.index),this.addAttribute("position",r.position),this.addAttribute("normal",r.normal),this.addAttribute("uv_wgs84",r.uv.wgs84),this.addAttribute("uv_pm",r.uv.pm),r.position=null,r.normal=null,r.uv.pm=null,d.getRessource(t.segment)||d.addRessource(t.segment,r),this.computeBoundingSphere()}Object.defineProperty(e,"__esModule",{value:!0});var o=r(8),s=n(o),u=r(1),h=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(u),c=r(69),l=n(c),d=(0,l.default)();a.prototype=(0,s.default)(h.BufferGeometry.prototype),a.prototype.constructor=a,a.prototype.computeBuffers=function(t,e){function r(t,e,r,n){return a.index[n+0]=t,a.index[n+1]=e,a.index[n+2]=r,n+3}var n=new i,a=new i,o=t.segment||32,s=(o+1)*(o+1)+8*(o-1),u=o*o+16*(o-1);a.position=new Float32Array(3*s),a.normal=new Float32Array(3*s),a.uv.pm=new Float32Array(s);var c=d.getRessource(t.segment);c?(n.index=c.index,n.uv.wgs84=c.uv.wgs84):(a.index=new Uint32Array(3*u*2),a.uv.wgs84=new Float32Array(2*s));var l=Math.max(2,Math.floor(o)||2),f=Math.max(2,Math.floor(o)||2),p=0,m=void 0,v=void 0,g=[],y=[],x=[],_=void 0,b=void 0;e.Prepare(t);var w=function(){},M=function(){};null===n.uv.wgs84&&(w=function(t,e,r,n){t.uv.wgs84[2*e+0]=r,t.uv.wgs84[2*e+1]=n}),null===n.uv.pm&&e.getUV_PM&&(M=function(t,e,r){t.uv.pm[e]=r});var E=void 0,T=void 0,S=void 0,A=void 0,L=void 0;for(v=0;v<=f;v++){var P=[];b=v/f,e.vProjecte(b,t);var R=e.getUV_PM?e.getUV_PM(t):void 0;for(m=0;m<=l;m++){_=m/l,e.uProjecte(_,t);var C=e.VertexPosition(t,t.projected);E=3*p,a.position[E+0]=C.x-this.center.x,a.position[E+1]=C.y-this.center.y,a.position[E+2]=C.z-this.center.z;var O=e.VertexNormal(t);a.normal[E+0]=O.x,a.normal[E+1]=O.y,a.normal[E+2]=O.z,w(a,p,_,b),M(a,p,R),t.disableSkirt||0!==v&&v!==f&&(m===l?y.push(p):0===m&&x.push(p)),P.push(p),p++}g.push(P),0===v?y=y.concat(P):v===f&&(y=y.concat(P.slice().reverse()))}var I=(new h.Vector3).fromArray(a.position).distanceTo((new h.Vector3).fromArray(a.position,3));t.disableSkirt||(y=y.concat(x.reverse()));var D=0;if(null===n.index)for(v=0;v<f;v++)for(m=0;m<l;m++)T=g[v][m+1],S=g[v][m],A=g[v+1][m],L=g[v+1][m+1],D=r(L,S,T,D),D=r(L,A,S,D);var N=p;if(!t.disableSkirt){var U=I,F=function(){},B=function(){};null===n.index&&(F=function(t,e,n,i,a){return t=r(e,n,i,t),t=r(e,i,a,t)},B=function(t){a.uv.wgs84[2*p+0]=a.uv.wgs84[2*t+0],a.uv.wgs84[2*p+1]=a.uv.wgs84[2*t+1]});for(var z=0;z<y.length;z++){var G=y[z];E=3*p;var j=3*G;a.position[E+0]=a.position[j+0]-a.normal[j+0]*U,a.position[E+1]=a.position[j+1]-a.normal[j+1]*U,a.position[E+2]=a.position[j+2]-a.normal[j+2]*U,a.normal[E+0]=a.normal[j+0],a.normal[E+1]=a.normal[j+1],a.normal[E+2]=a.normal[j+2],B(G),a.uv.pm[p]=a.uv.pm[G];var V=(z+1)%y.length;T=G,S=p,A=p+1,L=y[V],0===V&&(A=N),D=F(D,T,S,A,L),p++}}return null===n.index&&(n.index=new h.BufferAttribute(a.index,1)),n.position=new h.BufferAttribute(a.position,3),n.normal=new h.BufferAttribute(a.normal,3),null===n.uv.wgs84&&(n.uv.wgs84=new h.BufferAttribute(a.uv.wgs84,2)),n.uv.pm=new h.BufferAttribute(a.uv.pm,1),a.position=null,a.bufferIndex=null,a.normal=null,a.uv.wgs84=null,a.uv.pm=null,n},e.default=a},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(u.Mesh.call(this),this.matrixAutoUpdate=!1,this.rotationAutoUpdate=!1,!e.extent)throw new Error("params.extent is mandatory to build a TileMesh");this.level=e.level,this.extent=e.extent,this.geometry=t,this.normal=e.center.clone().normalize(),this.boundingSphereOffset=new u.Vector3,this.oSphere=new u.Sphere(this.geometry.boundingSphere.center.clone(),this.geometry.boundingSphere.radius),this.material=new c.default(e.materialOptions),this.frustumCulled=!1,this.updateGeometricError(),this.setDisplayed(!1),this.layerUpdateState={},this.material.setUuid(this.id)}Object.defineProperty(e,"__esModule",{value:!0});var a=r(8),o=n(a),s=r(1),u=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(s),h=r(21),c=n(h),l=r(74),d=n(l),f=r(26),p=n(f);i.prototype=(0,o.default)(u.Mesh.prototype),i.prototype.constructor=i,i.prototype.updateMatrixWorld=function(t){u.Mesh.prototype.updateMatrixWorld.call(this,t),this.geometry.OBB.update()},i.prototype.isVisible=function(){return this.visible},i.prototype.setDisplayed=function(t){this.material.visible=t},i.prototype.setVisibility=function(t){this.visible=t},i.prototype.isDisplayed=function(){return this.material.visible},i.prototype.changeState=function(t){t==d.default.DEPTH?(this.material.defines.DEPTH_MODE=1,delete this.material.defines.MATTE_ID_MODE):t==d.default.ID?(this.material.defines.MATTE_ID_MODE=1,delete this.material.defines.DEPTH_MODE):(delete this.material.defines.MATTE_ID_MODE,delete this.material.defines.DEPTH_MODE),this.material.needsUpdate=!0},i.prototype.setFog=function(t){this.material.setFogDistance(t)},i.prototype.setSelected=function(t){this.material.setSelected(t)},i.prototype.setTextureElevation=function(t){if(null!==this.material){var e=t.pitch||new u.Vector3(0,0,1);this.setBBoxZ(t.min,t.max),this.material.setTexture(t.texture,h.l_ELEVATION,0,e)}},i.prototype.setBBoxZ=function(t,e){if(!(void 0==t&&void 0==e||Math.floor(t)===Math.floor(this.geometry.OBB.z.min)&&Math.floor(e)===Math.floor(this.geometry.OBB.z.max))){var r=this.geometry.OBB.updateZ(t,e),n=this.normal.clone().setLength(r.y);this.geometry.boundingSphere.radius=Math.sqrt(r.x*r.x+this.oSphere.radius*this.oSphere.radius),this.updateGeometricError(),this.boundingSphereOffset=n}},i.prototype.updateGeometricError=function(){this.geometricError=this.geometry.boundingSphere.radius/f.SIZE_TEXTURE_TILE},i.prototype.setTexturesLayer=function(t,e,r){null!==this.material&&t&&this.material.setTexturesLayer(t,e,r)},i.prototype.getLayerTextures=function(t,e){return this.material.getLayerTextures(t,e)},i.prototype.isColorLayerLoaded=function(t){return this.material.getColorLayerLevelById(t)>-1},i.prototype.isElevationLayerLoaded=function(){return this.material.loadedTexturesCount[h.l_ELEVATION]>0},i.prototype.isColorLayerDownscaled=function(t){return this.material.isColorLayerDownscaled(t.id,this.getZoomForLayer(t))},i.prototype.normals=function(){return this.geometry.normals},i.prototype.fourCorners=function(){return this.geometry.fourCorners},i.prototype.normal=function(){return this.geometry.normal},i.prototype.center=function(){return this.geometry.center},i.prototype.OBB=function(){return this.geometry.OBB},i.prototype.getIndexLayerColor=function(t){return this.material.indexOfColorLayer(t)},i.prototype.removeColorLayer=function(t){this.material.removeColorLayer(t)},i.prototype.changeSequenceLayers=function(t){this.material.getColorLayersCount()<2||this.material.setSequence(t)},i.prototype.getCoordsForLayer=function(t){return 0==t.protocol.indexOf("wmts")?(p.default.computeTileMatrixSetCoordinates(this,t.options.tileMatrixSet),this.wmtsCoords[t.options.tileMatrixSet]):"tms"==t.protocol?p.default.computeTMSCoordinates(this,t.extent):[this.extent]},i.prototype.getZoomForLayer=function(t){return 0==t.protocol.indexOf("wmts")?(p.default.computeTileMatrixSetCoordinates(this,t.options.tileMatrixSet),this.wmtsCoords[t.options.tileMatrixSet][0].zoom):this.level},e.default=i},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(t.geometry)if(t.geometry instanceof u.BufferGeometry){for(var r=0;r<t.geometry.attributes.position.count;r++)t.geometry.attributes.position.array[3*r]+=e.x,t.geometry.attributes.position.array[3*r+1]+=e.y,t.geometry.attributes.position.array[3*r+2]+=e.z;t.geometry.attributes.position.needsUpdate=!0}else{var n=!0,a=!1,s=void 0;try{for(var h,c=(0,o.default)(t.geometry.vertices);!(n=(h=c.next()).done);n=!0){var l=h.value;l.add(e)}}catch(t){a=!0,s=t}finally{try{!n&&c.return&&c.return()}finally{if(a)throw s}}t.geometry.verticesNeedUpdate=!0}t.children.forEach(function(t){return i(t,e)})}Object.defineProperty(e,"__esModule",{value:!0});var a=r(2),o=n(a),s=r(1),u=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(s),h=r(105),c=n(h),l=r(27),d=r(72),f=n(d);e.default={update:function(t){return function(e,r,n){if(!n.parent&&n.children.length)return void f.default.removeChildrenAndCleanupRecursively(r.id,n);if(n.visible){var a=n.children.filter(function(t){return t.layer==r.id});if(a.length>0)return a;if(r.tileInsideLimit(n,r)){void 0===n.layerUpdateState[r.id]&&(n.layerUpdateState[r.id]=new c.default);var o=Date.now();if(n.layerUpdateState[r.id].canTryUpdate(o)){n.layerUpdateState[r.id].newTry();var s={layer:r,view:e.view,threejsLayer:r.threejsLayer,requester:n};e.scheduler.execute(s).then(function(e){if(e){if(n.layerUpdateState[r.id].success(),!n.parent)return void f.default.removeChildrenAndCleanupRecursively(r.id,e);i(e,n.extent.center().xyz().negate()),t&&t(r,n,e),e.layer=r.id,n.add(e),n.updateMatrixWorld()}else n.layerUpdateState[r.id].failure(1,!0)},function(t){t instanceof l.CancelledCommandException?n.layerUpdateState[r.id].success():t instanceof SyntaxError?n.layerUpdateState[r.id].failure(0,!0):(n.layerUpdateState[r.id].failure(Date.now()),setTimeout(1e3*n.layerUpdateState[r.id].secondsUntilNextTry(),function(){e.view.notifyChange(!1)}))})}}}}},assignColorsToFeatureCollection:function(t,e,r){for(var n=new Uint8Array(3*e.geometry.attributes.position.count),i=0;i<t.features.length;i++){var a=t.features[i].properties,o=e.featureVertices[a._idx];if(o)for(var s=0;s<o.count;s++){var h=3*(o.offset+s);n[h+0]=255*r[i].r,n[h+1]=255*r[i].g,n[h+2]=255*r[i].b}}e.geometry.addAttribute("color",new u.BufferAttribute(n,3,!0)),e.material.vertexColors=u.VertexColors,e.material.color=new u.Color(16777215)}}},function(t,e,r){"use strict";function n(t,e){return e.isBox3Visible(t.OBB().box3D,t.OBB().matrixWorld)}function i(t,e){return!n(t,e)}function a(t,e){var r=t.box3SizeOnScreen(e.geometry.OBB.box3D,e.matrixWorld),n={x:.5*(r.max.x-r.min.x),y:.5*(r.max.y-r.min.y)};return n.x>=.3&&n.y>=.3}function o(t){return function(e,r,n){return!(t<=n.level)&&a(e.camera,n)}}Object.defineProperty(e,"__esModule",{value:!0}),e.planarCulling=i,e.planarSubdivisionControl=o},function(t,e,r){"use strict";function n(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Object.defineProperty(this,"crs",{get:function(){return t}}),this.camera3D=n.camera?n.camera:new o.PerspectiveCamera(30,e/r),this._viewMatrix=new o.Matrix4,this.width=e,this.height=r}function i(t,e,r){t.width=e,t.height=r;var n=e/r;if(t.camera3D.aspect!==n&&(t.camera3D.aspect=n,t.camera3D.isOrthographicCamera)){var i=.5*(t.camera3D.right-t.camera3D.left)/n;t.camera3D.top=i,t.camera3D.bottom=-i}t.camera3D.updateProjectionMatrix&&t.camera3D.updateProjectionMatrix()}Object.defineProperty(e,"__esModule",{value:!0});var a=r(1),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(a),s=r(6),u=function(t){return t&&t.__esModule?t:{default:t}}(s);n.prototype.update=function(t,e){i(this,t,e),this.camera3D.updateMatrixWorld(),this._viewMatrix.multiplyMatrices(this.camera3D.projectionMatrix,this.camera3D.matrixWorldInverse)},n.prototype.position=function(t){return new u.default(this.crs,this.camera3D.position).as(t||this.crs)},n.prototype.setPosition=function(t){this.camera3D.position.copy(t.as(this.crs).xyz())};var h={frustum:new o.Frustum,matrix:new o.Matrix4,box3:new o.Box3};n.prototype.isBox3Visible=function(t,e){return e?(h.matrix.multiplyMatrices(this._viewMatrix,e),h.frustum.setFromMatrix(h.matrix)):h.frustum.setFromMatrix(this._viewMatrix),h.frustum.intersectsBox(t)},n.prototype.isSphereVisible=function(t,e){return e?(h.matrix.multiplyMatrices(this._viewMatrix,e),h.frustum.setFromMatrix(h.matrix)):h.frustum.setFromMatrix(this._viewMatrix),h.frustum.intersectsSphere(t)},n.prototype.box3SizeOnScreen=function(t,e){return h.box3.copy(t),e?(h.matrix.multiplyMatrices(this._viewMatrix,e),h.box3.applyMatrix4(h.matrix)):h.box3.applyMatrix4(this._viewMatrix),h.box3},e.default=n},function(t,e,r){"use strict";(function(t){function n(t){return t&&t.__esModule?t:{default:t}}function i(){this.glTFLoader=new d.GLTFLoader}function a(t){var e=["MODELVIEW","MODELVIEWINVERSETRANSPOSE","PROJECTION","JOINTMATRIX"];if(t.gltfShader){var r=[];for(var n in t.gltfShader.boundUniforms)r.push(n);var i=!0,a=!1,o=void 0;try{for(var s,u=(0,c.default)(r);!(i=(s=u.next()).done);i=!0){var h=s.value,l=t.gltfShader.boundUniforms[h].semantic;e.indexOf(l)<0&&delete t.gltfShader.boundUniforms[h]}}catch(t){a=!0,o=t}finally{try{!i&&u.return&&u.return()}finally{if(a)throw o}}}}function o(t,e){var r=new DataView(t,0,20),n=new Uint8Array(t,20,r.getUint32(12,!0)),i=g.decode(new Uint8Array(n)),a=JSON.parse(i);a.extensions&&a.extensions.CESIUM_RTC&&(e.position.fromArray(a.extensions.CESIUM_RTC.center),e.updateMatrixWorld(!0))}Object.defineProperty(e,"__esModule",{value:!0});var s=r(7),u=n(s),h=r(2),c=n(h),l=r(1),d=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(l);r(303);var f=r(112),p=n(f),m=(new d.Matrix4).makeRotationX(Math.PI/2),v=(new d.Matrix4).makeRotationZ(-Math.PI/2),g=new t("utf-8");i.prototype.parse=function(t,e){var r=this;if(!t)throw new Error("No array buffer provided.");var n=new DataView(t,4),i=0,s={},h={};if(s.magic=g.decode(new Uint8Array(t,0,4)),s.magic){if(s.version=n.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,s.byteLength=n.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,s.FTJSONLength=n.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,s.FTBinaryLength=n.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,s.BTJSONLength=n.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,s.BTBinaryLength=n.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,s.BTJSONLength>0){var l=28+s.FTJSONLength+s.FTBinaryLength;h=p.default.parse(t.slice(l,s.BTJSONLength+l))}return new u.default(function(n){var i=function(r){var i=!0,u=!1,l=void 0;try{for(var d,f=(0,c.default)(r.scenes);!(i=(d=f.next()).done);i=!0){d.value.traverse(a)}}catch(t){u=!0,l=t}finally{try{!i&&f.return&&f.return()}finally{if(u)throw l}}void 0===e||"Y"===e?r.scene.applyMatrix(m):"X"===e&&r.scene.applyMatrix(v),o(t.slice(28+s.FTJSONLength+s.FTBinaryLength+s.BTJSONLength+s.BTBinaryLength),r.scene),n({gltf:r,batchTable:h})};r.glTFLoader.parse(t.slice(28+s.FTJSONLength+s.FTBinaryLength+s.BTJSONLength+s.BTBinaryLength),i)})}throw new Error("Invalid b3dm file.")},e.default=i}).call(e,r(45).TextDecoder)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t){if(t){var e=new c.BufferGeometry,r=new Float32Array(3*t.coordinates.length),n=0,i=!0,a=!1,o=void 0;try{for(var s,h=(0,u.default)(t.coordinates);!(i=(s=h.next()).done);i=!0){var l=s.value;r[n]=l._values[0],r[n+1]=l._values[1],r[n+2]=l._values[2],n+=3}}catch(t){a=!0,o=t}finally{try{!i&&h.return&&h.return()}finally{if(a)throw o}}e.addAttribute("position",new c.BufferAttribute(r,3));var f=void 0;switch(t.type){case"point":f=new c.Points(e);break;case"linestring":var p=[];for(var m in t.featureVertices)for(var v=t.featureVertices[m],g=v.offset;g<v.offset+v.count-1;++g)p.push(g),p.push(g+1);e.setIndex(new c.BufferAttribute(new Uint16Array(p),1)),f=new c.LineSegments(e);break;case"polygon":var y=[];for(var x in t.featureVertices){var _=t.featureVertices[x],b=r.slice(3*_.offset,3*(_.offset+_.count)),w=(0,d.default)(b,null,3),M=!0,E=!1,T=void 0;try{for(var S,A=(0,u.default)(w);!(M=(S=A.next()).done);M=!0){var L=S.value;y.push(_.offset+L)}}catch(t){E=!0,T=t}finally{try{!M&&A.return&&A.return()}finally{if(E)throw T}}}e.setIndex(new c.BufferAttribute(new Uint16Array(y),1)),f=new c.Mesh(e)}return f.featureVertices=t.featureVertices,f}}function a(t){var e=i(t.geometry);return e.properties=t.properties,e}function o(t){var e=new c.Group,r=!0,n=!1,a=void 0;try{for(var o,s=(0,u.default)(t.geometries);!(r=(o=s.next()).done);r=!0){var h=o.value;e.add(i(h))}}catch(t){n=!0,a=t}finally{try{!r&&s.return&&s.return()}finally{if(n)throw a}}return e.features=t.features,e}Object.defineProperty(e,"__esModule",{value:!0});var s=r(2),u=n(s),h=r(1),c=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(h),l=r(424),d=n(l);e.default={convert:function(t){return t.geometries?o(t):a(t)}}},function(t,e,r){"use strict";function n(t,e,r,n,i){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};if(0!==e.length){var o=new c.Vector2(t.canvas.width/n.x,t.canvas.width/n.y);t.beginPath(),d.x=e[0]._values[0]-r.x,d.y=e[0]._values[1]-r.y,d.multiply(o),t.moveTo(d.x,d.y),e.shift();var s=!0,h=!1,l=void 0;try{for(var f,p=(0,u.default)(e);!(s=(f=p.next()).done);s=!0){var m=f.value;d.x=m._values[0]-r.x,d.y=m._values[1]-r.y,d.multiply(o),t.lineTo(d.x,d.y)}}catch(t){h=!0,l=t}finally{try{!s&&p.return&&p.return()}finally{if(h)throw l}}(a.stroke||i.stroke)&&(t.strokeStyle=a.stroke||i.stroke,t.lineWidth=a.strokeWidth||i["stroke-width"]||2,t.globalAlpha=a.strokeOpacity||i["stroke-opacity"]||1,t.stroke()),(a.fill||i.fill)&&(t.closePath(),t.fillStyle=a.fill||i.fill,t.globalAlpha=a.fillOpacity||i["fill-opacity"]||1,t.fill())}}function i(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=new c.Vector2(t.canvas.width/n.x,t.canvas.width/n.y);d.x=e._values[0]-r.x,d.y=e._values[1]-r.y,d.multiply(a),t.beginPath(),t.arc(d.x,d.y,i.radius||3,0,2*Math.PI,!1),t.fillStyle=i.fill||"white",t.fill(),t.lineWidth=i.lineWidth||1,t.strokeStyle=i.stroke||"red",t.stroke()}function a(t,e,r,a,o){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},u=e.properties.properties,h=e.geometry.coordinates.slice();"point"===e.geometry.type?i(t,h[0],r,a,s):e.geometry.extent.intersect(o)&&(t.globalCompositeOperation="destination-over",n(t,h,r,a,u,s))}function o(t,e,r,a,o){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},h=!0,c=!1,l=void 0;try{for(var d,f=(0,u.default)(e.geometries);!(h=(d=f.next()).done);h=!0){var p=d.value;if(p.extent.intersect(o))for(var m in p.featureVertices){var v=p.featureVertices[m],g=e.features[m].properties.properties,y=p.coordinates.slice(v.offset,v.offset+v.count);"point"===p.type?i(t,y[0],r,a,s):v.extent.intersect(o)&&(t.globalCompositeOperation="destination-over",n(t,y,r,a,g,s))}}}catch(t){c=!0,l=t}finally{try{!h&&f.return&&f.return()}finally{if(c)throw l}}}Object.defineProperty(e,"__esModule",{value:!0});var s=r(2),u=function(t){return t&&t.__esModule?t:{default:t}}(s),h=r(1),c=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(h),l=r(6),d=new c.Vector2;e.default={createTextureFromGeoson:function(t,e,r,n){var i=new c.Vector2(e.west(l.UNIT.DEGREE),e.south(l.UNIT.DEGREE)),s=e.dimensions(l.UNIT.DEGREE),u=document.createElement("canvas");u.width=r,u.height=r;var h=u.getContext("2d");t.geometries?o(h,t,i,s,e,n):a(h,t,i,s,e,n);var d=new c.Texture(u);return d.flipY=!1,d.generateMipmaps=!1,d.magFilter=c.LinearFilter,d.minFilter=c.LinearFilter,d.needsUpdate=!0,d}}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t){t.preventDefault(),this._isUserInteracting=!0,this._onMouseDownMouseX=t.clientX,this._onMouseDownMouseY=t.clientY,this._onMouseDownPhi=this._phi,this._onMouseDownTheta=this._theta}function a(t){if(!0===this._isUserInteracting){var e=this.camera.fov/T;this._phi=.13*(this._onMouseDownMouseX-t.clientX)*e+this._onMouseDownPhi,this._theta=.13*(t.clientY-this._onMouseDownMouseY)*e+this._onMouseDownTheta,this.view.notifyChange(!1)}}function o(){this._isUserInteracting=!1}function s(t){var e=S[t.keyCode];e&&(this.moves.delete(e),this.view.notifyChange(!0),t.preventDefault())}function u(t){var e=S[t.keyCode];e&&(this.moves.add(e),this.view.notifyChange(!1),t.preventDefault())}Object.defineProperty(e,"__esModule",{value:!0});var h=r(2),c=n(h),l=r(47),d=n(l),f=r(37),p=n(f),m=r(48),v=n(m),g=r(49),y=n(g),x=r(51),_=n(x),b=r(50),w=n(b),M=r(1),E=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(M),T=90,S={38:{method:"translateZ",sign:-1},40:{method:"translateZ",sign:1},37:{method:"translateX",sign:-1},39:{method:"translateX",sign:1},33:{method:"translateY",sign:1},34:{method:"translateY",sign:-1}},A=function(t){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,v.default)(this,e);var n=(0,_.default)(this,(e.__proto__||(0,p.default)(e)).call(this));n.camera=t.camera.camera3D,n.view=t,n.moves=new d.default,n.moveSpeed=r.moveSpeed||10,n._isUserInteracting=!1,n._onMouseDownMouseX=0,n._onMouseDownMouseY=0,n._onMouseDownPhi=0,n._onMouseDownTheta=0,n.camera.rotation.reorder("ZYX"),n._theta=E.Math.radToDeg(n.camera.rotation.x),n._phi=E.Math.radToDeg(n.camera.rotation.z),n.updateAngles();var h=t.mainLoop.gfxEngine.renderer.domElement;return h.addEventListener("mousedown",i.bind(n),!1),h.addEventListener("mousemove",a.bind(n),!1),h.addEventListener("mouseup",o.bind(n),!1),h.addEventListener("keyup",s.bind(n),!0),h.addEventListener("keydown",u.bind(n),!0),n.view.addFrameRequester(n),r.focusOnMouseOver&&h.addEventListener("mouseover",function(){return h.focus()}),r.focusOnClick&&h.addEventListener("click",function(){return h.focus()}),n}return(0,w.default)(e,t),(0,y.default)(e,[{key:"isUserInteracting",value:function(){return 0!==this.moves.size}},{key:"updateAngles",value:function(){this.camera.rotation.order="ZYX",this.camera.rotation.x=E.Math.degToRad(this._theta),this.camera.rotation.z=E.Math.degToRad(this._phi),this.view.notifyChange(!0)}},{key:"update",value:function(t,e){e&&(t=16);var r=!0,n=!1,i=void 0;try{for(var a,o=(0,c.default)(this.moves);!(r=(a=o.next()).done);r=!0){var s=a.value;"translateY"===s.method?this.camera.position.z+=s.sign*this.moveSpeed*t/1e3:this.camera[s.method](s.sign*this.moveSpeed*t/1e3)}}catch(t){n=!0,i=t}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}(this.moves.size||this._isUserInteracting)&&this.updateAngles()}}]),e}(E.EventDispatcher);e.default=A},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t){t.preventDefault(),this._isMouseDown=!0,this._onMouseDownMouseX=t.clientX,this._onMouseDownMouseY=t.clientY}function a(t){t.preventDefault(),this._isMouseDown=!0,this._onMouseDownMouseX=t.touches[0].pageX,this._onMouseDownMouseY=t.touches[0].pageY}function o(t,e){if(!0===this._isMouseDown){var r=this._camera3D.fov/A;this._camera3D.rotateY((t-this._onMouseDownMouseX)*L*r),this._camera3D.rotateX((e-this._onMouseDownMouseY)*L*r),this._onMouseDownMouseX=t,this._onMouseDownMouseY=e,this.view.notifyChange(!1,this._camera3D)}}function s(){this._isMouseDown=!1}function u(t){var e=P[t.keyCode];e&&(this.moves.delete(e),t.preventDefault())}function h(t){var e=P[t.keyCode];e&&(this.moves.add(e),this.view.notifyChange(!1,this),t.preventDefault())}function c(t){var e=0;void 0!==t.wheelDelta?e=t.wheelDelta:void 0!==t.detail&&(e=-t.detail),e<0?this.moves.add(P.wheelup):this.moves.add(P.wheeldown),this.view.notifyChange(!1,this)}Object.defineProperty(e,"__esModule",{value:!0});var l=r(2),d=n(l),f=r(47),p=n(f),m=r(37),v=n(m),g=r(48),y=n(g),x=r(49),_=n(x),b=r(51),w=n(b),M=r(50),E=n(M),T=r(1),S=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(T),A=90,L=.0022,P={38:{method:"translateZ",sign:-1},40:{method:"translateZ",sign:1},37:{method:"translateX",sign:-1},39:{method:"translateX",sign:1},33:{method:"rotateZ",sign:1,noSpeed:!0},34:{method:"rotateZ",sign:-1,noSpeed:!0},wheelup:{method:"translateZ",sign:1,oneshot:!0},wheeldown:{method:"translateZ",sign:-1,oneshot:!0}},R=function(t){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,y.default)(this,e);var n=(0,w.default)(this,(e.__proto__||(0,v.default)(e)).call(this)),l=t.mainLoop.gfxEngine.renderer.domElement;n.view=t,n.options=r,n._camera3D=t.camera.camera3D,n.moves=new p.default,n.moveSpeed=10,n._onMouseDownMouseX=0,n._onMouseDownMouseY=0,n._isMouseDown=!1,l.addEventListener("mousedown",i.bind(n),!1),l.addEventListener("touchstart",a.bind(n),!1);var d=o.bind(n);return l.addEventListener("mousemove",function(t){return d(t.clientX,t.clientY)},!1),l.addEventListener("touchmove",function(t){return d(t.touches[0].pageX,t.touches[0].pageY)},!1),l.addEventListener("mouseup",s.bind(n),!1),l.addEventListener("touchend",s.bind(n),!1),l.addEventListener("mousewheel",c.bind(n),!1),l.addEventListener("DOMMouseScroll",c.bind(n),!1),l.addEventListener("keyup",u.bind(n),!0),l.addEventListener("keydown",h.bind(n),!0),n.view.addFrameRequester(n),r.focusOnMouseOver&&l.addEventListener("mouseover",function(){return l.focus()}),r.focusOnClick&&l.addEventListener("click",function(){return l.focus()}),n}return(0,E.default)(e,t),(0,_.default)(e,[{key:"isUserInteracting",value:function(){return 0!==this.moves.size||this._isMouseDown}},{key:"update",value:function(t,e){e&&(t=16);var r=!0,n=!1,i=void 0;try{for(var a,o=(0,d.default)(this.moves);!(r=(a=o.next()).done);r=!0){var s=a.value;this._camera3D[s.method](s.sign*(s.noSpeed?1:this.moveSpeed)*t/1e3)}}catch(t){n=!0,i=t}finally{try{!r&&o.return&&o.return()}finally{if(n)throw i}}if(this.moves.size>0||this._isMouseDown){this.view.notifyChange(!0,this._camera3D);var u=!0,h=!1,c=void 0;try{for(var l,f=(0,d.default)(this.moves);!(u=(l=f.next()).done);u=!0){var p=l.value;p.oneshot&&this.moves.delete(p)}}catch(t){h=!0,c=t}finally{try{!u&&f.return&&f.return()}finally{if(h)throw c}}}}}]),e}(S.EventDispatcher);e.default=R},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}var i=r(46),a=n(i),o=r(117),s=n(o),u=r(7),h=n(u),c=r(1),l=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(c);l.GLTFLoader=function(){function t(t){this.manager=void 0!==t?t:l.DefaultLoadingManager}function e(){var t={};return{get:function(e){return t[e]},add:function(e,r){t[e]=r},remove:function(e){delete t[e]},removeAll:function(){t={}},update:function(e,r){for(var n in t){var i=t[n];i.update&&i.update(e,r)}}}}function r(t,e){var r={},n=t.material.uniforms;for(var i in n){var a=n[i];if(a.semantic){var o=a.node,s=t;o&&(s=e[o]),r[i]={semantic:a.semantic,sourceNode:s,targetNode:t,uniform:a}}}this.boundUniforms=r,this._m4=new l.Matrix4}function n(t){this.name=v.KHR_MATERIALS_COMMON,this.lights={};var e=t.extensions&&t.extensions[v.KHR_MATERIALS_COMMON]||{},r=e.lights||{};for(var n in r){var i,a=r[n],o=a[a.type],s=(new l.Color).fromArray(o.color);switch(a.type){case"directional":i=new l.DirectionalLight(s),i.position.set(0,0,1);break;case"point":i=new l.PointLight(s);break;case"spot":i=new l.SpotLight(s),i.position.set(0,0,1);break;case"ambient":i=new l.AmbientLight(s)}i&&(this.lights[n]=i)}}function i(t){this.name=v.KHR_BINARY_GLTF;var e=new DataView(t,0,y),r={magic:c(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0),contentLength:e.getUint32(12,!0),contentFormat:e.getUint32(16,!0)};for(var n in g){var i=g[n];if(r[n]!==i)throw new Error('Unsupported glTF-Binary header: Expected "%s" to be "%s".',n,i)}var a=new Uint8Array(t,y,r.contentLength);this.header=r,this.content=c(a),this.body=t.slice(y+r.contentLength,r.length)}function o(t,e,r){if(!t)return h.default.resolve();var n,i=[];if("[object Array]"===Object.prototype.toString.call(t)){n=[];for(var a=t.length,o=0;o<a;o++){var s=e.call(r||this,t[o],o);s&&(i.push(s),s instanceof h.default?s.then(function(t,e){n[t]=e}.bind(this,o)):n[o]=s)}}else{n={};for(var u in t)if(t.hasOwnProperty(u)){var s=e.call(r||this,t[u],u);s&&(i.push(s),s instanceof h.default?s.then(function(t,e){n[t]=e}.bind(this,u)):n[u]=s)}}return h.default.all(i).then(function(){return n})}function u(t,e){return"string"!=typeof t||""===t?"":/^(https?:)?\/\//i.test(t)?t:/^data:.*,.*$/i.test(t)?t:(e||"")+t}function c(t){window.TextDecoder;for(var e="",r=0,n=t.length;r<n;r++)e+=String.fromCharCode(t[r]);return e}function d(t,e){var r={};for(var n in e.attributes){var i=e.attributes[n],a=e.parameters[i],o=a.type,s=a.semantic;r[n]={type:o,semantic:s}}var u=e.parameters,h=e.attributes,c={};for(var n in r){var i=h[n],l=u[i],s=l.semantic;s&&(c[n]=l)}for(var i in c){var a=c[i],s=a.semantic,d=new RegExp("\\b"+i+"\\b","g");switch(s){case"POSITION":t=t.replace(d,"position");break;case"NORMAL":t=t.replace(d,"normal");break;case"TEXCOORD_0":case"TEXCOORD0":case"TEXCOORD":t=t.replace(d,"uv");break;case"TEXCOORD_1":t=t.replace(d,"uv2");break;case"COLOR_0":case"COLOR0":case"COLOR":t=t.replace(d,"color");break;case"WEIGHT":t=t.replace(d,"skinWeight");break;case"JOINT":t=t.replace(d,"skinIndex")}}return t}function f(){return new l.MeshPhongMaterial({color:0,emissive:8947848,specular:0,shininess:0,transparent:!1,depthTest:!0,side:l.FrontSide})}function p(t){this.isDeferredShaderMaterial=!0,this.params=t}function m(t,r,n){this.json=t||{},this.extensions=r||{},this.options=n||{},this.cache=new e}t.prototype={constructor:t,load:function(t,e,r,n){var i=this,a=this.path&&"string"==typeof this.path?this.path:l.Loader.prototype.extractUrlBase(t),o=new l.FileLoader(i.manager);o.setResponseType("arraybuffer"),o.load(t,function(t){i.parse(t,e,a)},r,n)},setCrossOrigin:function(t){this.crossOrigin=t},setPath:function(t){this.path=t},parse:function(t,e,r){var a,o={};c(new Uint8Array(t,0,4))===g.magic?(o[v.KHR_BINARY_GLTF]=new i(t),a=o[v.KHR_BINARY_GLTF].content):a=c(new Uint8Array(t));var s=JSON.parse(a);s.extensionsUsed&&s.extensionsUsed.indexOf(v.KHR_MATERIALS_COMMON)>=0&&(o[v.KHR_MATERIALS_COMMON]=new n(s)),console.time("GLTFLoader"),new m(s,o,{path:r||this.path,crossOrigin:this.crossOrigin}).parse(function(t,r,n,i){console.timeEnd("GLTFLoader"),e({scene:t,scenes:r,cameras:n,animations:i})})}},t.Shaders={update:function(){console.warn("THREE.GLTFLoader.Shaders has been deprecated, and now updates automatically.")}},r.prototype.update=function(t,e){var r=this.boundUniforms;for(var n in r){var i=r[n];switch(i.semantic){case"MODELVIEW":var a=i.uniform.value;a.multiplyMatrices(e.matrixWorldInverse,i.sourceNode.matrixWorld);break;case"MODELVIEWINVERSETRANSPOSE":var o=i.uniform.value;this._m4.multiplyMatrices(e.matrixWorldInverse,i.sourceNode.matrixWorld),o.getNormalMatrix(this._m4);break;case"PROJECTION":var a=i.uniform.value;a.copy(e.projectionMatrix);break;case"JOINTMATRIX":for(var s=i.uniform.value,u=0;u<s.length;u++)s[u].getInverse(i.sourceNode.matrixWorld).multiply(i.targetNode.skeleton.bones[u].matrixWorld).multiply(i.targetNode.skeleton.boneInverses[u]).multiply(i.targetNode.bindMatrix);break;default:console.warn("Unhandled shader semantic: "+i.semantic)}}},t.Animations={update:function(){console.warn("THREE.GLTFLoader.Animation has been deprecated. Use THREE.AnimationMixer instead.")}};var v={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_MATERIALS_COMMON:"KHR_materials_common"},g={magic:"glTF",version:1,contentFormat:0},y=20;i.prototype.loadShader=function(t,e){var r=e[t.extensions[v.KHR_BINARY_GLTF].bufferView];return c(new Uint8Array(r))},i.prototype.loadTextureSourceUri=function(t,e){var r=t.extensions[v.KHR_BINARY_GLTF],n=e[r.bufferView],i=c(new Uint8Array(n));return"data:"+r.mimeType+";base64,"+btoa(i)};var x={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,TRIANGLES:4,LINES:1,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,VERTEX_SHADER:35633,FRAGMENT_SHADER:35632},_={5126:Number,35675:l.Matrix3,35676:l.Matrix4,35664:l.Vector2,35665:l.Vector3,35666:l.Vector4,35678:l.Texture},b={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},w={9728:l.NearestFilter,9729:l.LinearFilter,9984:l.NearestMipMapNearestFilter,9985:l.LinearMipMapNearestFilter,9986:l.NearestMipMapLinearFilter,9987:l.LinearMipMapLinearFilter},M={33071:l.ClampToEdgeWrapping,33648:l.MirroredRepeatWrapping,10497:l.RepeatWrapping},E={6406:l.AlphaFormat,6407:l.RGBFormat,6408:l.RGBAFormat,6409:l.LuminanceFormat,6410:l.LuminanceAlphaFormat},T={5121:l.UnsignedByteType,32819:l.UnsignedShort4444Type,32820:l.UnsignedShort5551Type,33635:l.UnsignedShort565Type},S={1028:l.BackSide,1029:l.FrontSide},A={512:l.NeverDepth,513:l.LessDepth,514:l.EqualDepth,515:l.LessEqualDepth,516:l.GreaterEqualDepth,517:l.NotEqualDepth,518:l.GreaterEqualDepth,519:l.AlwaysDepth},L={32774:l.AddEquation,32778:l.SubtractEquation,32779:l.ReverseSubtractEquation},P={0:l.ZeroFactor,1:l.OneFactor,768:l.SrcColorFactor,769:l.OneMinusSrcColorFactor,770:l.SrcAlphaFactor,771:l.OneMinusSrcAlphaFactor,772:l.DstAlphaFactor,773:l.OneMinusDstAlphaFactor,774:l.DstColorFactor,775:l.OneMinusDstColorFactor,776:l.SrcAlphaSaturateFactor},R={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},C={scale:"scale",translation:"position",rotation:"quaternion"},O={LINEAR:l.InterpolateLinear,STEP:l.InterpolateDiscrete},I={2884:"CULL_FACE",2929:"DEPTH_TEST",3042:"BLEND",3089:"SCISSOR_TEST",32823:"POLYGON_OFFSET_FILL",32926:"SAMPLE_ALPHA_TO_COVERAGE"};return p.prototype.create=function(){var t=l.UniformsUtils.clone(this.params.uniforms);for(var e in this.params.uniforms){var r=this.params.uniforms[e];r.value instanceof l.Texture&&(t[e].value=r.value,t[e].value.needsUpdate=!0),t[e].semantic=r.semantic,t[e].node=r.node}return this.params.uniforms=t,new l.RawShaderMaterial(this.params)},m.prototype._withDependencies=function(t){for(var e={},r=0;r<t.length;r++){var n=t[r],i="load"+n.charAt(0).toUpperCase()+n.slice(1),a=this.cache.get(n);if(void 0!==a)e[n]=a;else if(this[i]){var s=this[i]();this.cache.add(n,s),e[n]=s}}return o(e,function(t){return t})},m.prototype.parse=function(t){var e=this.json;this.cache.removeAll(),this._withDependencies(["scenes","cameras","animations"]).then(function(r){var n=[];for(var i in r.scenes)n.push(r.scenes[i]);var a=void 0!==e.scene?r.scenes[e.scene]:n[0],o=[];for(var i in r.cameras){var s=r.cameras[i];o.push(s)}var u=[];for(var i in r.animations)u.push(r.animations[i]);t(a,n,o,u)})},m.prototype.loadShaders=function(){var t=this.json,e=this.extensions,r=this.options;return this._withDependencies(["bufferViews"]).then(function(n){return o(t.shaders,function(t){return t.extensions&&t.extensions[v.KHR_BINARY_GLTF]?e[v.KHR_BINARY_GLTF].loadShader(t,n.bufferViews):new h.default(function(e){var n=new l.FileLoader;n.setResponseType("text"),n.load(u(t.uri,r.path),function(t){e(t)})})})})},m.prototype.loadBuffers=function(){var t=this.json,e=this.extensions,r=this.options;return o(t.buffers,function(t,n){return"binary_glTF"===n?e[v.KHR_BINARY_GLTF].body:"arraybuffer"===t.type||void 0===t.type?new h.default(function(e){var n=new l.FileLoader;n.setResponseType("arraybuffer"),n.load(u(t.uri,r.path),function(t){e(t)})}):void console.warn("THREE.GLTFLoader: "+t.type+" buffer type is not supported")})},m.prototype.loadBufferViews=function(){var t=this.json;return this._withDependencies(["buffers"]).then(function(e){return o(t.bufferViews,function(t){var r=e.buffers[t.buffer],n=void 0!==t.byteLength?t.byteLength:0;return r.slice(t.byteOffset,t.byteOffset+n)})})},m.prototype.loadAccessors=function(){var t=this.json;return this._withDependencies(["bufferViews"]).then(function(e){return o(t.accessors,function(t){var r=e.bufferViews[t.bufferView],n=R[t.type],i=b[t.componentType],a=i.BYTES_PER_ELEMENT,o=a*n;if(t.byteStride&&t.byteStride!==o){var s=new i(r),u=new l.InterleavedBuffer(s,t.byteStride/a);return new l.InterleavedBufferAttribute(u,n,t.byteOffset/a)}return s=new i(r,t.byteOffset,t.count*n),new l.BufferAttribute(s,n)})})},m.prototype.loadTextures=function(){var t=this.json,e=this.extensions,r=this.options;return this._withDependencies(["bufferViews"]).then(function(n){return o(t.textures,function(i){if(i.source)return new h.default(function(a){var o=t.images[i.source],s=o.uri;o.extensions&&o.extensions[v.KHR_BINARY_GLTF]&&(s=e[v.KHR_BINARY_GLTF].loadTextureSourceUri(o,n.bufferViews));var h=l.Loader.Handlers.get(s);null===h&&(h=new l.TextureLoader),h.setCrossOrigin(r.crossOrigin),h.load(u(s,r.path),function(e){if(e.flipY=!1,void 0!==i.name&&(e.name=i.name),e.format=void 0!==i.format?E[i.format]:l.RGBAFormat,void 0!==i.internalFormat&&e.format!==E[i.internalFormat]&&console.warn("THREE.GLTFLoader: Three.js doesn't support texture internalFormat which is different from texture format. internalFormat will be forced to be the same value as format."),e.type=void 0!==i.type?T[i.type]:l.UnsignedByteType,i.sampler){var r=t.samplers[i.sampler];e.magFilter=w[r.magFilter]||l.LinearFilter,e.minFilter=w[r.minFilter]||l.NearestMipMapLinearFilter,e.wrapS=M[r.wrapS]||l.RepeatWrapping,e.wrapT=M[r.wrapT]||l.RepeatWrapping}a(e)},void 0,function(){a()})})})})},m.prototype.loadMaterials=function(){var t=this.json;return this._withDependencies(["shaders","textures"]).then(function(e){return o(t.materials,function(r){var n,i,a={},o={};if(r.extensions&&r.extensions[v.KHR_MATERIALS_COMMON]&&(i=r.extensions[v.KHR_MATERIALS_COMMON]),i){var u=["ambient","emission","transparent","transparency","doubleSided"];switch(i.technique){case"BLINN":case"PHONG":n=l.MeshPhongMaterial,u.push("diffuse","specular","shininess");break;case"LAMBERT":n=l.MeshLambertMaterial,u.push("diffuse");break;case"CONSTANT":default:n=l.MeshBasicMaterial}u.forEach(function(t){void 0!==i.values[t]&&(a[t]=i.values[t])}),(i.doubleSided||a.doubleSided)&&(o.side=l.DoubleSide),(i.transparent||a.transparent)&&(o.transparent=!0,o.opacity=void 0!==a.transparency?a.transparency:1)}else if(void 0===r.technique)n=l.MeshPhongMaterial,(0,s.default)(a,r.values);else{n=p;var h=t.techniques[r.technique];o.uniforms={};var c=t.programs[h.program];if(c){o.fragmentShader=e.shaders[c.fragmentShader],o.fragmentShader||(console.warn("ERROR: Missing fragment shader definition:",c.fragmentShader),n=l.MeshPhongMaterial);var f=e.shaders[c.vertexShader];f||(console.warn("ERROR: Missing vertex shader definition:",c.vertexShader),n=l.MeshPhongMaterial),o.vertexShader=d(f,h);var m=h.uniforms;for(var g in m){var y=m[g],b=h.parameters[y],w=b.type;if(!_[w])throw new Error("Unknown shader uniform param type: "+w);var M,E=b.count;void 0!==r.values&&(M=r.values[y]);var T=new _[w],R=b.semantic,C=b.node;switch(w){case x.FLOAT:T=b.value,"transparency"==y&&(o.transparent=!0),void 0!==M&&(T=M);break;case x.FLOAT_VEC2:case x.FLOAT_VEC3:case x.FLOAT_VEC4:case x.FLOAT_MAT3:b&&b.value&&T.fromArray(b.value),M&&T.fromArray(M);break;case x.FLOAT_MAT2:console.warn("FLOAT_MAT2 is not a supported uniform type");break;case x.FLOAT_MAT4:if(E){T=new Array(E);for(var O=0;O<E;O++)T[O]=new _[w];if(b&&b.value){var D=b.value;T.fromArray(D)}M&&T.fromArray(M)}else{if(b&&b.value){var N=b.value;T.fromArray(N)}M&&T.fromArray(M)}break;case x.SAMPLER_2D:T=void 0!==M?e.textures[M]:void 0!==b.value?e.textures[b.value]:null}o.uniforms[g]={value:T,semantic:R,node:C}}for(var U=h.states||{},F=U.enable||[],B=U.functions||{},z=!1,G=!1,j=!1,V=0,k=F.length;V<k;V++){var H=F[V];switch(I[H]){case"CULL_FACE":z=!0;break;case"DEPTH_TEST":G=!0;break;case"BLEND":j=!0;break;case"SCISSOR_TEST":case"POLYGON_OFFSET_FILL":case"SAMPLE_ALPHA_TO_COVERAGE":break;default:throw new Error("Unknown technique.states.enable: "+H)}}o.side=z?void 0!==B.cullFace?S[B.cullFace]:l.FrontSide:l.DoubleSide,o.depthTest=G,o.depthFunc=void 0!==B.depthFunc?A[B.depthFunc]:l.LessDepth,o.depthWrite=void 0===B.depthMask||B.depthMask[0],o.blending=j?l.CustomBlending:l.NoBlending,o.transparent=j;var W=B.blendEquationSeparate;void 0!==W?(o.blendEquation=L[W[0]],o.blendEquationAlpha=L[W[1]]):(o.blendEquation=l.AddEquation,o.blendEquationAlpha=l.AddEquation);var q=B.blendFuncSeparate;void 0!==q?(o.blendSrc=P[q[0]],o.blendDst=P[q[1]],o.blendSrcAlpha=P[q[2]],o.blendDstAlpha=P[q[3]]):(o.blendSrc=l.OneFactor,o.blendDst=l.ZeroFactor,o.blendSrcAlpha=l.OneFactor,o.blendDstAlpha=l.ZeroFactor)}}Array.isArray(a.diffuse)?o.color=(new l.Color).fromArray(a.diffuse):"string"==typeof a.diffuse&&(o.map=e.textures[a.diffuse]),delete o.diffuse,"string"==typeof a.reflective&&(o.envMap=e.textures[a.reflective]),"string"==typeof a.bump&&(o.bumpMap=e.textures[a.bump]),Array.isArray(a.emission)?n===l.MeshBasicMaterial?o.color=(new l.Color).fromArray(a.emission):o.emissive=(new l.Color).fromArray(a.emission):"string"==typeof a.emission&&(n===l.MeshBasicMaterial?o.map=e.textures[a.emission]:o.emissiveMap=e.textures[a.emission]),Array.isArray(a.specular)?o.specular=(new l.Color).fromArray(a.specular):"string"==typeof a.specular&&(o.specularMap=e.textures[a.specular]),void 0!==a.shininess&&(o.shininess=a.shininess);var X=new n(o);return void 0!==r.name&&(X.name=r.name),X})})},m.prototype.loadMeshes=function(){var t=this.json;return this._withDependencies(["accessors","materials"]).then(function(e){return o(t.meshes,function(t){var r=new l.Group;void 0!==t.name&&(r.name=t.name),t.extras&&(r.userData=t.extras);var n=t.primitives||[];for(var i in n){var a=n[i];if(a.mode===x.TRIANGLES||void 0===a.mode){var o=new l.BufferGeometry,s=a.attributes;for(var u in s){var h=s[u];if(!h)return;var c=e.accessors[h];switch(u){case"POSITION":o.addAttribute("position",c);break;case"NORMAL":o.addAttribute("normal",c);break;case"TEXCOORD_0":case"TEXCOORD0":case"TEXCOORD":o.addAttribute("uv",c);break;case"TEXCOORD_1":o.addAttribute("uv2",c);break;case"COLOR_0":case"COLOR0":case"COLOR":o.addAttribute("color",c);break;case"WEIGHT":o.addAttribute("skinWeight",c);break;case"JOINT":o.addAttribute("skinIndex",c);break;case"_BATCHID":o.addAttribute("_BATCHID",c)}}a.indices&&o.setIndex(e.accessors[a.indices]);var d=void 0!==e.materials?e.materials[a.material]:f(),p=new l.Mesh(o,d);p.castShadow=!0,p.name="0"===i?r.name:r.name+i,a.extras&&(p.userData=a.extras),r.add(p)}else if(a.mode===x.LINES){var o=new l.BufferGeometry,s=a.attributes;for(var u in s){var h=s[u];if(!h)return;var c=e.accessors[h];switch(u){case"POSITION":o.addAttribute("position",c);break;case"COLOR_0":case"COLOR0":case"COLOR":o.addAttribute("color",c)}}var p,d=e.materials[a.material];a.indices?(o.setIndex(e.accessors[a.indices]),p=new l.LineSegments(o,d)):p=new l.Line(o,d),p.name="0"===i?r.name:r.name+i,a.extras&&(p.userData=a.extras),r.add(p)}else console.warn("Only triangular and line primitives are supported")}return r})})},m.prototype.loadCameras=function(){return o(this.json.cameras,function(t){if("perspective"==t.type&&t.perspective){var e=t.perspective.yfov,r=void 0!==t.perspective.aspectRatio?t.perspective.aspectRatio:1,n=e*r,i=new l.PerspectiveCamera(l.Math.radToDeg(n),r,t.perspective.znear||1,t.perspective.zfar||2e6);return void 0!==t.name&&(i.name=t.name),t.extras&&(i.userData=t.extras),i}if("orthographic"==t.type&&t.orthographic){var i=new l.OrthographicCamera(window.innerWidth/-2,window.innerWidth/2,window.innerHeight/2,window.innerHeight/-2,t.orthographic.znear,t.orthographic.zfar);return void 0!==t.name&&(i.name=t.name),t.extras&&(i.userData=t.extras),i}})},m.prototype.loadSkins=function(){var t=this.json;return this._withDependencies(["accessors"]).then(function(e){return o(t.skins,function(t){var r=new l.Matrix4;return void 0!==t.bindShapeMatrix&&r.fromArray(t.bindShapeMatrix),{bindShapeMatrix:r,jointNames:t.jointNames,inverseBindMatrices:e.accessors[t.inverseBindMatrices]}})})},m.prototype.loadAnimations=function(){var t=this.json;return this._withDependencies(["accessors","nodes"]).then(function(e){return o(t.animations,function(t,r){var n=[];for(var i in t.channels){var a=t.channels[i],o=t.samplers[a.sampler];if(o){var s=a.target,u=s.id,h=void 0!==t.parameters?t.parameters[o.input]:o.input,c=void 0!==t.parameters?t.parameters[o.output]:o.output,d=e.accessors[h],f=e.accessors[c],p=e.nodes[u];if(p){p.updateMatrix(),p.matrixAutoUpdate=!0;var m=C[s.path]===C.rotation?l.QuaternionKeyframeTrack:l.VectorKeyframeTrack,v=p.name?p.name:p.uuid,g=void 0!==o.interpolation?O[o.interpolation]:l.InterpolateLinear;n.push(new m(v+"."+C[s.path],l.AnimationUtils.arraySlice(d.array,0),l.AnimationUtils.arraySlice(f.array,0),g))}}}var u=void 0!==t.name?t.name:"animation_"+r;return new l.AnimationClip(u,void 0,n)})})},m.prototype.loadNodes=function(){var t=this.json,e=this.extensions,r=this;return o(t.nodes,function(t){var e,r=new l.Matrix4;return t.jointName?(e=new l.Bone,e.name=void 0!==t.name?t.name:t.jointName,e.jointName=t.jointName):(e=new l.Object3D,void 0!==t.name&&(e.name=t.name)),t.extras&&(e.userData=t.extras),void 0!==t.matrix?(r.fromArray(t.matrix),e.applyMatrix(r)):(void 0!==t.translation&&e.position.fromArray(t.translation),void 0!==t.rotation&&e.quaternion.fromArray(t.rotation),void 0!==t.scale&&e.scale.fromArray(t.scale)),e}).then(function(n){return r._withDependencies(["meshes","skins","cameras"]).then(function(r){return o(n,function(i,o){var s=t.nodes[o];if(void 0!==s.meshes)for(var u in s.meshes){var h=s.meshes[u],c=r.meshes[h];if(void 0!==c)for(var d in c.children){var f,p=c.children[d],m=p.material,g=p.geometry,y=p.userData,x=p.name;switch(m.isDeferredShaderMaterial?m=f=m.create():f=m,p.type){case"LineSegments":p=new l.LineSegments(g,f);break;case"LineLoop":p=new l.LineLoop(g,f);break;case"Line":p=new l.Line(g,f);break;default:p=new l.Mesh(g,f)}p.castShadow=!0,p.userData=y,p.name=x;var _;if(s.skin&&(_=r.skins[s.skin]),_){var b=g,f=m;f.skinning=!0,p=new l.SkinnedMesh(b,f,!1),p.castShadow=!0,p.userData=y,p.name=x;for(var w=[],M=[],E=0,T=_.jointNames.length;E<T;E++){var S=_.jointNames[E],A=function(t){for(var e=(0,a.default)(n),r=0,i=e.length;r<i;r++){var o=n[e[r]];if(o.jointName===t)return o}return null}(S);if(A){w.push(A);var L=_.inverseBindMatrices.array,P=(new l.Matrix4).fromArray(L,16*E);M.push(P)}else console.warn("WARNING: joint: '"+S+"' could not be found")}p.bind(new l.Skeleton(w,M,!1),_.bindShapeMatrix);!function e(r,i,a){var o=r[a];if(void 0!==o)for(var s=0,u=o.length;s<u;s++){var h=o[s],c=n[h],l=t.nodes[h];void 0!==c&&!0===c.isBone&&void 0!==l&&(i.add(c),e(l,c,"children"))}}(s,p,"skeletons")}i.add(p)}else console.warn("GLTFLoader: Couldn't find node \""+h+'".')}if(void 0!==s.camera){var R=r.cameras[s.camera];i.add(R)}if(s.extensions&&s.extensions[v.KHR_MATERIALS_COMMON]&&s.extensions[v.KHR_MATERIALS_COMMON].light){var C=e[v.KHR_MATERIALS_COMMON].lights,O=C[s.extensions[v.KHR_MATERIALS_COMMON].light];i.add(O)}return i})})})},m.prototype.loadScenes=function(){function t(r,n,i){var a=i[r];n.add(a);var o=e.nodes[r];if(o.children)for(var s=o.children,u=0,h=s.length;u<h;u++){var c=s[u];t(c,a,i)}}var e=this.json;return this._withDependencies(["nodes"]).then(function(n){return o(e.scenes,function(e){var i=new l.Scene;void 0!==e.name&&(i.name=e.name),e.extras&&(i.userData=e.extras);for(var a=e.nodes||[],o=0,s=a.length;o<s;o++){t(a[o],i,n.nodes)}return i.traverse(function(t){t.material&&t.material.isRawShaderMaterial&&(t.gltfShader=new r(t,n.nodes),t.onBeforeRender=function(t,e,r){this.gltfShader.update(e,r)})}),i})})},t}()},function(t,e,r){"use strict";function n(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.view=t,this.camera=t.camera.camera3D,this.domElement=t.mainLoop.gfxEngine.renderer.domElement,this.rotateSpeed=r.rotateSpeed||2,this.maxPanSpeed=r.maxPanSpeed||15,this.minPanSpeed=r.minPanSpeed||.05,this.zoomTravelTime=r.zoomTravelTime||.2,this.zoomInFactor=r.zoomInFactor||.25,this.zoomOutFactor=r.zoomOutFactor||.4,this.maxAltitude=r.maxAltitude||12e3,this.groundLevel=r.groundLevel||200,this.autoTravelTimeMin=r.autoTravelTimeMin||1.5,this.autoTravelTimeMax=r.autoTravelTimeMax||4,this.autoTravelTimeDist=r.autoTravelTimeDist||2e4,this.smartZoomHeightMin=r.smartZoomHeightMin||75,this.smartZoomHeightMax=r.smartZoomHeightMax||500,this.instantTravel=r.instantTravel||!1,this.minZenithAngle=r.minZenithAngle||0*Math.PI/180,this.maxZenithAngle=(r.maxZenithAngle||82.5)*Math.PI/180,this.focusOnMouseOver=r.focusOnMouseOver||!0,this.focusOnMouseClick=r.focusOnMouseClick||!0;var n=this.camera.position.clone(),i=this.camera.quaternion.clone();this.state=u.NONE;var o=new a.Vector2,s=new a.Vector2,v=new a.Vector2(0,0),g=new a.Vector3,y=new a.Vector3,x=new a.Vector3,_=new a.Vector3(0,0,0),b=0,w=new a.Vector3,M=new a.Vector3,E=new a.Quaternion,T=new a.Quaternion,S=0,A=0,L=!1,P=!1,R=d.bind(this),C=h.bind(this),O=c.bind(this),I=l.bind(this),D=f.bind(this);this.focusOnMouseOver&&this.domElement.addEventListener("mouseover",function(){return e.domElement.focus()}),this.focusOnClick&&this.domElement.addEventListener("click",function(){return e.domElement.focus()}),this.domElement.addEventListener("contextmenu",p.bind(this),!1),this.view.addFrameRequester(this),this.update=function(t,e){e&&(t=16),this.state===u.TRAVEL&&(this.handleTravel(t),this.view.notifyChange(!0)),this.state===u.DRAG&&this.handleDragMovement(),this.state===u.ROTATE&&this.handleRotation(),this.state===u.PAN&&this.handlePanMovement(),v.set(0,0)},this.initiateDrag=function(){this.state=u.DRAG,g.copy(this.getWorldPointAtScreenXY(o)),x.set(0,0,0)},this.handleDragMovement=function(){y.copy(this.getWorldPointFromMathPlaneAtScreenXY(o,g.z)),x.subVectors(g,y),this.camera.position.add(x),x.set(0,0,0)},this.initiatePan=function(){this.state=u.PAN},this.handlePanMovement=function(){var t=new a.Vector3;return function(){var r=a.Math.clamp((e.camera.position.z-e.groundLevel)/e.maxAltitude,0,1),n=a.Math.lerp(e.minPanSpeed,e.maxPanSpeed,r);t.set(-1*n*v.x,0,0),e.camera.position.copy(e.camera.localToWorld(t));var i=e.camera.position.z+n*v.y;i<e.maxAltitude&&i>e.groundLevel&&(e.camera.position.z=i)}}(),this.initiateRotation=function(){this.state=u.ROTATE,_.copy(this.getWorldPointAtScreenXY({x:.5*this.domElement.clientWidth,y:.5*this.domElement.clientHeight}));var t=this.camera.position.distanceTo(_);b=Math.acos((this.camera.position.z-_.z)/t)},this.handleRotation=function(){var t=new a.Vector3,r=new a.Quaternion;return function(){var n=-e.rotateSpeed*v.x/e.domElement.clientWidth,i=-e.rotateSpeed*v.y/e.domElement.clientHeight,a=e.camera.position.clone().sub(_);0===n&&0===i||(b+i>=e.minZenithAngle&&b+i<=e.maxZenithAngle&&0!==i&&(b+=i,t.set(0,0,1),r.setFromUnitVectors(e.camera.up,t),a.applyQuaternion(r),t.setFromMatrixColumn(e.camera.matrix,0),r.setFromAxisAngle(t,i),a.applyQuaternion(r),t.set(0,0,1),r.setFromUnitVectors(e.camera.up,t).inverse(),a.applyQuaternion(r)),0!==n&&(t.set(0,0,1),r.setFromAxisAngle(t,n),a.applyQuaternion(r))),e.camera.position.copy(a).add(_),e.camera.lookAt(_)}}(),this.initiateZoom=function(t){var e=void 0;void 0!==t.wheelDelta?e=t.wheelDelta:void 0!==t.detail&&(e=-t.detail);var r=this.getWorldPointAtScreenXY(o),n=new a.Vector3;e>0?(n.lerpVectors(this.camera.position,r,this.zoomInFactor),this.initiateTravel(n,this.zoomTravelTime,null,!1)):e<0&&this.camera.position.z<this.maxAltitude&&(n.lerpVectors(this.camera.position,r,-1*this.zoomOutFactor),this.initiateTravel(n,this.zoomTravelTime,null,!1))},this.initiateSmartZoom=function(){var t=new a.Vector3;if(void 0!==this.view.getPickingPositionFromDepth(o)){t.copy(this.view.getPickingPositionFromDepth(o));var e=new a.Vector3;e.copy(t).sub(this.camera.position),e.z=0,e.normalize();var r=this.camera.position.distanceTo(t),n=a.Math.lerp(this.smartZoomHeightMin,this.smartZoomHeightMax,Math.min(r/5e3,1)),i=new a.Vector3;i.copy(t).add(e.multiplyScalar(2*-n)),i.z=t.z+n,this.initiateTravel(i,"auto",t,!0)}},this.initiateTravel=function(t,e,r,n){if(this.state=u.TRAVEL,this.view.notifyChange(!0),S=0,this.updateMouseCursorType(),L=r instanceof a.Quaternion||r instanceof a.Vector3,P=n,M.copy(this.camera.position),E.copy(this.camera.quaternion),r instanceof a.Quaternion?T.copy(r):r instanceof a.Vector3&&(t===r?(this.camera.lookAt(r),T.copy(this.camera.quaternion),this.camera.quaternion.copy(E)):(this.camera.position.copy(t),this.camera.lookAt(r),T.copy(this.camera.quaternion),this.camera.quaternion.copy(E),this.camera.position.copy(M))),w.copy(t),this.instantTravel)A=0;else if("auto"===e){var i=Math.min(1,t.distanceTo(this.camera.position)/this.autoTravelTimeDist);if(A=a.Math.lerp(this.autoTravelTimeMin,this.autoTravelTimeMax,i),L){var o=.5-.5*T.normalize().dot(this.camera.quaternion.normalize());A*=1+2*o,A=Math.min(A,this.autoTravelTimeMax)}}else A=e},this.endTravel=function(){this.camera.position.copy(w),L&&this.camera.quaternion.copy(T),this.state=u.NONE,this.updateMouseCursorType()},this.handleTravel=function(t){S+=t/1e3/A;var e=P?m(S):S;this.camera.position.lerpVectors(M,w,e),!0===L&&a.Quaternion.slerp(E,T,this.camera.quaternion,e),S>1&&this.endTravel()},this.goToTopView=function(){var t=new a.Vector3,e=new a.Quaternion;t.copy(this.getWorldPointAtScreenXY({x:.5*this.domElement.clientWidth,y:.5*this.domElement.clientHeight})),t.z+=Math.min(this.maxAltitude,this.camera.position.distanceTo(t)),e.setFromAxisAngle(new a.Vector3(1,0,0),0),this.initiateTravel(t,"auto",e,!0)},this.goToStartView=function(){this.initiateTravel(n,"auto",i,!0)},this.getWorldPointFromMathPlaneAtScreenXY=function(){var t=new a.Vector3;return function(r,n){t.set(r.x/e.domElement.clientWidth*2-1,-r.y/e.domElement.clientHeight*2+1,.5),t.unproject(e.camera);var i=t.sub(e.camera.position).normalize(),a=(n-e.camera.position.z)/i.z;return e.camera.position.clone().add(i.multiplyScalar(a))}}(),this.getWorldPointAtScreenXY=function(t){var e=this.view.getPickingPositionFromDepth(t);return e||this.getWorldPointFromMathPlaneAtScreenXY(t,this.groundLevel)},this.updateMousePositionAndDelta=function(t){o.set(t.clientX,t.clientY),v.copy(o).sub(s),s.copy(o)},this.addInputListeners=function(){this.domElement.addEventListener("keydown",R,!0),this.domElement.addEventListener("mousedown",C,!1),this.domElement.addEventListener("mouseup",O,!1),this.domElement.addEventListener("mousemove",I,!1),this.domElement.addEventListener("mousewheel",D,!1),this.domElement.addEventListener("MozMousePixelScroll",D,!1)},this.removeInputListeners=function(){this.domElement.removeEventListener("keydown",R,!0),this.domElement.removeEventListener("mousedown",C,!1),this.domElement.removeEventListener("mouseup",O,!1),this.domElement.removeEventListener("mousemove",I,!1),this.domElement.removeEventListener("mousewheel",D,!1),this.domElement.removeEventListener("MozMousePixelScroll",D,!1)},this.updateMouseCursorType=function(){switch(this.state){case u.NONE:this.domElement.style.cursor="auto";break;case u.DRAG:this.domElement.style.cursor="move";break;case u.PAN:this.domElement.style.cursor="cell";break;case u.TRAVEL:this.domElement.style.cursor="wait";break;case u.ROTATE:this.domElement.style.cursor="move"}},this.addInputListeners()}Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(i),o={CTRL:17,SPACE:32,T:84,Y:89},s={LEFTCLICK:a.MOUSE.LEFT,MIDDLECLICK:a.MOUSE.MIDDLE,RIGHTCLICK:a.MOUSE.RIGHT},u={NONE:-1,DRAG:0,PAN:1,ROTATE:2,TRAVEL:3},h=function(t){t.preventDefault(),this.state!==u.TRAVEL&&(this.updateMousePositionAndDelta(t),t.button===s.LEFTCLICK?t.ctrlKey?this.initiateRotation():this.initiateDrag():t.button===s.MIDDLECLICK?this.initiateSmartZoom(t):t.button===s.RIGHTCLICK&&this.initiatePan(),this.updateMouseCursorType())},c=function(t){t.preventDefault(),this.state!==u.TRAVEL&&(this.state=u.NONE),this.updateMouseCursorType()},l=function(t){t.preventDefault(),this.updateMousePositionAndDelta(t),this.state!==u.NONE&&this.view.notifyChange(!0)},d=function(t){this.state!==u.TRAVEL&&(t.keyCode===o.T&&this.goToTopView(),t.keyCode===o.Y&&this.goToStartView(),t.keyCode===o.SPACE&&this.initiateSmartZoom(t))},f=function(t){t.preventDefault(),t.stopPropagation(),this.state===u.NONE&&this.initiateZoom(t)},p=function(t){t.preventDefault()},m=function(t){return Math.pow(t*t*(3-2*t),1.2)};e.default=n},function(t,e,r){"use strict";(function(t){function n(t,e,r){var n=new a.BufferGeometry,i=new a.PointsMaterial({size:.05,vertexColors:a.VertexColors,sizeAttenuation:!0}),o=u.decode(new Uint8Array(t,e,r)),s=JSON.parse(o),h=void 0;if(s.POINTS_LENGTH&&(h=s.POINTS_LENGTH),s.POSITION){var c=s.POSITION.byteOffset+o.length+e,l=new Float32Array(t,c,3*h);n.addAttribute("position",new a.BufferAttribute(l,3))}if(s.RGB){var d=s.RGB.byteOffset+o.length+e,f=new Uint8Array(t,d,3*h);n.addAttribute("color",new a.BufferAttribute(f,3,!0))}if(s.POSITION_QUANTIZED)throw new Error("For pnts loader, POSITION_QUANTIZED: not yet managed");if(s.RGBA)throw new Error("For pnts loader, RGBA: not yet managed");if(s.RGB565)throw new Error("For pnts loader, RGB565: not yet managed");if(s.NORMAL)throw new Error("For pnts loader, NORMAL: not yet managed");if(s.NORMAL_OCT16P)throw new Error("For pnts loader, NORMAL_OCT16P: not yet managed");if(s.BATCH_ID)throw new Error("For pnts loader, BATCH_ID: not yet managed");var p=new a.Points(n,i);return p.realPointCount=h,s.RTC_CENTER&&p.position.fromArray(s.RTC_CENTER),p}Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(i),o=r(112),s=function(t){return t&&t.__esModule?t:{default:t}}(o),u=new t("utf-8");e.default={parse:function(t){if(!t)throw new Error("No array buffer provided.");var e=new DataView(t),r=0,i={},a={},o={};if(i.magic=u.decode(new Uint8Array(t,r,4)),r+=4,i.magic){if(i.version=e.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT,i.byteLength=e.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT,i.FTJSONLength=e.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT,i.FTBinaryLength=e.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT,i.BTJSONLength=e.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT,i.BTBinaryLength=e.getUint32(r,!0),r+=Uint32Array.BYTES_PER_ELEMENT,i.FTBinaryLength>0&&(o=n(t,r,i.FTJSONLength)),i.BTJSONLength>0){var h=28+i.FTJSONLength+i.FTBinaryLength;a=s.default.parseBatchTableJSON(t.slice(h,i.BTJSONLength+h))}return{point:o,batchTable:a}}throw new Error("Invalid pnts file.")}}}).call(e,r(45).TextDecoder)},function(t,e,r){"use strict";function n(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!s.default.isInternetExplorer();void 0===e.antialias&&(e.antialias=!0),void 0===e.alpha&&(e.alpha=!0),void 0===e.logarithmicDepthBuffer&&(e.logarithmicDepthBuffer=this.gLDebug||r);var n=t.domElement?t:void 0,i=n?void 0:t;this.width=(n?n.domElement:i).clientWidth,this.height=(n?n.domElement:i).clientHeight,this.positionBuffer=null,this._nextThreejsLayer=0,this.fullSizeRenderTarget=new a.WebGLRenderTarget(this.width,this.height),this.fullSizeRenderTarget.texture.minFilter=a.LinearFilter,this.fullSizeRenderTarget.texture.generateMipmaps=!1,this.renderView=function(t){this.renderer.setViewport(0,0,this.width,this.height),this.renderer.clear(),this.renderer.render(t.scene,t.camera.camera3D)}.bind(this),this.onWindowResize=function(t,e){this.width=t,this.height=e,this.fullSizeRenderTarget.setSize(this.width,this.height),this.renderer.setSize(this.width,this.height)}.bind(this);try{this.renderer=n||new a.WebGLRenderer({canvas:document.createElement("canvas"),antialias:e.antialias,alpha:e.alpha,logarithmicDepthBuffer:e.logarithmicDepthBuffer})}catch(t){console.error("Failed to create WebGLRenderer",t),this.renderer=null}if(!this.renderer){var o=document.createElement("div");throw o.id="webgl-error-message",o.style.fontFamily="monospace",o.style.fontSize="13px",o.style.fontWeight="normal",o.style.textAlign="center",o.style.background="#fff",o.style.color="#000",o.style.padding="1.5em",o.style.width="400px",o.style.margin="5em auto 0",o.innerHTML=window.WebGLRenderingContext?['Your graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">WebGL</a>.<br />','Find out how to get it <a href="http://get.webgl.org/" style="color:#000">here</a>.<br>','See also <a href="https://www.khronos.org/webgl/wiki/BlacklistsAndWhitelists">graphics card blacklisting</a>'].join("\n"):['Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">WebGL</a>.<br/>','Find out how to get it <a href="http://get.webgl.org/" style="color:#000">here</a>.<br>',"You can also try another browser like Firefox or Chrome."].join("\n"),i.appendChild(o),new Error("WebGL unsupported")}-1===this.renderer.domElement.tabIndex&&(this.renderer.domElement.tabIndex=-1),s.default.updateCapabilities(this.renderer),this.renderer.setClearColor(197896),this.renderer.autoClear=!1,this.renderer.sortObjects=!1,n||(this.renderer.setPixelRatio(i.devicePixelRatio),this.renderer.setSize(i.clientWidth,i.clientHeight),i.appendChild(this.renderer.domElement))}Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(i),o=r(35),s=function(t){return t&&t.__esModule?t:{default:t}}(o),u=r(21);n.prototype.getWindowSize=function(){return new a.Vector2(this.width,this.height)},n.prototype.getRenderer=function(){return this.renderer},n.prototype.renderViewTobuffer=function(t,e,r,n,i,a){var o=this.renderer.getRenderTarget();this.renderer.setRenderTarget(e),this.renderer.setViewport(0,0,e.width,e.height),this.renderer.setScissor(r,n,i,a),this.renderer.setScissorTest(!0),this.renderer.clearTarget(e,!0,!0,!1),this.renderer.render(t.scene,t.camera.camera3D,e),this.renderer.setScissorTest(!1);var s=new Uint8Array(4*i*a);return this.renderer.readRenderTargetPixels(e,r,n,i,a,s),this.renderer.setRenderTarget(o),s},n.prototype.bufferToImage=function(t,e,r){var n=document.createElement("canvas"),i=n.getContext("2d");n.width=e,n.height=r;var a=i.getImageData(0,0,e,r);a.data.set(t),i.putImageData(a,0,0);var o=new Image;return o.src=n.toDataURL(),o},n.prototype.getUniqueThreejsLayer=function(){return this._nextThreejsLayer>31&&(console.warn("Too much three.js layers. Starting from now all of them will use layerMask = 31"),this._nextThreejsLayer=31),this._nextThreejsLayer++};var h=new a.Vector4;n.prototype.depthBufferRGBAValueToOrthoZ=function(t,e){if(h.fromArray(t).divideScalar(255),s.default.isLogDepthBufferSupported()){var r=(0,u.unpack1K)(h),n=2/(Math.log(e.far+1)/Math.LN2);return Math.pow(2,2*r/n)}var i=(0,u.unpack1K)(h);return i=2*i-1,2*e.near*e.far/(e.far+e.near-i*(e.far-e.near))},e.default=n},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(e.extent){if(!e.extent.isPointInside(t))return;for(var r=0;r<e.children.length;r++){var n=i(t,e.children[r]);if(n)return n}if(e.getLayerTextures(b.l_ELEVATION)[0].coords.zoom>-1)return e}else;}function a(t,e){for(var r=arguments.length,n=Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];for(var a=0;a<n.length;a+=2)n[a]=y.Math.clamp(n[a],0,e.image.width-1),n[a+1]=y.Math.clamp(n[a+1],0,e.image.height-1);if(e.image.data){if(2===n.length)return e.image.data[n[1]*e.image.width+n[0]];for(var o=[],s=0;s<n.length;s+=2)o.push(e.image.data[n[s+1]*e.image.width+n[s]]);return o}M||(M=document.createElement("canvas"),M.width=2,M.height=2);for(var u=1/0,h=1/0,c=-1/0,l=-1/0,d=0;d<n.length;d+=2)u=Math.min(n[d],u),h=Math.min(n[d+1],h),c=Math.max(n[d],c),l=Math.max(n[d+1],l);var f=c-u+1,p=l-h+1;M.width=Math.max(M.width,f),M.height=Math.max(M.height,p);var m=M.getContext("2d");m.drawImage(e.image,u,h,f,p,0,0,f,p);for(var v=m.getImageData(0,0,f,p),g=[],x=0;x<n.length;x+=2){var _=n[x]-u,b=n[x+1]-h;g.push(y.Math.lerp(t.materialOptions.colorTextureElevationMinZ,t.materialOptions.colorTextureElevationMaxZ,v.data[4*b*f+4*_]/255))}return 2===n.length?g[0]:g}function o(t,e,r){var n=t.image.width,i=t.image.height,a=Math.max(0,e*n-.5),o=Math.max(0,r*i-.5),s=Math.floor(a),u=Math.ceil(a),h=Math.floor(o);return{u1:s,u2:u,v1:h,v2:Math.ceil(o),wu:a-s,wv:o-h}}function s(t,e,r,n){var i=o(e,r,n);return a(t,e,i.wu<=0?i.u1:i.u2,i.wv<=0?i.v1:i.v2)}function u(t,e,r,n){var i=o(e,r,n),s=a(t,e,i.u1,i.v1,i.u2,i.v1,i.u1,i.v2,i.u2,i.v2),u=(0,v.default)(s,4),h=u[0],c=u[1],l=u[2],d=u[3],f=y.Math.lerp(h,c,i.wu),p=y.Math.lerp(l,d,i.wu);return y.Math.lerp(f,p,i.wv)}function h(t,e,r){return s(t,e,r.x,r.y)}function c(t,e,r,n,i){var a=n.x/i.x/16,o=Math.floor(r.x/a)*a,s=Math.floor(r.y/a)*a;1==o&&(o-=a),1==s&&(s-=a);var h=o,c=o+a,l=s,d=s+a,f=(r.x-o)/a,p=(r.y-s)/a,m=1==p||f/(1-p)>=1,v=new y.Triangle(new y.Vector3(h,d),new y.Vector3(c,l),m?new y.Vector3(c,d):new y.Vector3(h,l)),g=v.barycoordFromPoint(new y.Vector3(r.x,r.y)),x=u(t,e,v.a.x,v.a.y),_=u(t,e,v.b.x,v.b.y),b=u(t,e,v.c.x,v.c.y);return x*g.x+_*g.y+b*g.z}function l(t,e,r,n,a){var o=r.as(t.extent.crs(),E.coord1),s=null;a&&a.tile&&a.tile.material&&(s=i(o,a.tile));for(var u=0;!s&&u<n.length;u++)s=i(o,n[u]);if(s){var l=s,d=s.getLayerTextures(b.l_ELEVATION)[0];if(a&&a.id===d.id&&a.version===d.version)return{coord:o,texture:d,tile:l};for(var f=Math.round((0,p.default)(1/s.material.offsetScale[b.l_ELEVATION][0].z)),m=0;m<f;m++)s=s.parent;var v=o.offsetInExtent(s.extent,E.offset);return o._values[2]=e==w?c(t,d,v,l.extent.dimensions(),s.extent.dimensions()):h(t,d,v),{coord:o,texture:d,tile:l}}}function d(t,e,r,n,i,a){var o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},s=arguments[7],u=arguments[8],h=s||new _.default(n);o.worldFromLocal?h.set(n,E.v.copy(i).applyMatrix4(o.worldFromLocal)):h.set(n,i);var c=l(t,e,h,r,u);if(c)return c.coord._values[2]+=a,c.coord.as(n,E.coord2).xyz(i),o.localFromWorld&&i.applyMatrix4(o.localFromWorld),{id:c.texture.id,version:c.texture.version,tile:c.tile}}Object.defineProperty(e,"__esModule",{value:!0});var f=r(116),p=n(f),m=r(321),v=n(m),g=r(1),y=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(g),x=r(6),_=n(x),b=r(21),w=1;e.default={getElevationValueAt:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments[3],i=l(t,r,e,n||t.level0Nodes);if(i)return{z:i.coord._values[2],texture:i.texture,tile:i.tile}},placeObjectOnGround:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments[4],a=void 0;if(a=i?i.concat(t.level0Nodes):t.level0Nodes,n.modifyGeometry){var o={worldFromLocal:r.matrixWorld,localFromWorld:(new y.Matrix4).getInverse(r.matrixWorld)},s=r.geometry;if(s.vertices){n.cache&&(n.cache.length=s.vertices.length);for(var u=!0,h=new _.default(e),c=0;c<s.vertices.length;c++){var l=n.cache?n.cache[c]:void 0,f=d(t,n.method||0,a,e,s.vertices[c],n.offset||0,o,h,l);n.cache&&(n.cache[c]=f),f||(u=!1)}return s.verticesNeedUpdate=!0,u}if(s instanceof y.BufferGeometry){n.cache&&(n.cache.length=s.attributes.position.count);for(var p=!0,m=new y.Vector3,v=new _.default(e),g=0;g<s.attributes.position.count;g++){var x=n.cache?n.cache[g]:void 0;m.fromBufferAttribute(s.attributes.position,g);var b=m.z,w=d(t,n.method||0,a,e,m,n.offset||0,o,v,x);n.cache&&(n.cache[g]=w),w||(p=!1),b!=m.z&&(s.attributes.position.needsUpdate=!0),s.attributes.position.setXYZ(g,m.x,m.y,m.z)}return p}}else{n.cache&&(n.cache.length=1);var M={worldFromLocal:r.parent?r.parent.matrixWorld:void 0,localFromWorld:r.parent?(new y.Matrix4).getInverse(r.parent.matrixWorld):void 0},E=d(t,n.method||0,a,e,r.position,n.offset||0,M,void 0,n.cache?n.cache[0]:void 0);if(E)return n.cache&&(n.cache[0]=E),r.updateMatrix(),r.updateMatrixWorld(),!0}},FAST_READ_Z:0,PRECISE_READ_Z:w};var M=void 0,E={v:new y.Vector3,coord1:new _.default("EPSG:4978"),coord2:new _.default("EPSG:4978"),offset:new y.Vector2}},,,,,,,,function(t,e,r){t.exports={default:r(370),__esModule:!0}},,function(t,e,r){t.exports={default:r(377),__esModule:!0}},function(t,e,r){t.exports={default:r(380),__esModule:!0}},function(t,e,r){t.exports={default:r(383),__esModule:!0}},function(t,e,r){t.exports={default:r(384),__esModule:!0}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var i=r(315),a=n(i),o=r(2),s=n(o);e.default=function(){function t(t,e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,u=(0,s.default)(t);!(n=(o=u.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){i=!0,a=t}finally{try{!n&&u.return&&u.return()}finally{if(i)throw a}}return r}return function(e,r){if(Array.isArray(e))return e;if((0,a.default)(Object(e)))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){r(24),r(406),t.exports=r(5).Array.from},function(t,e,r){r(32),r(24),t.exports=r(404)},function(t,e,r){r(32),r(24),t.exports=r(405)},,function(t,e,r){r(60),r(24),r(32),r(408),r(420),t.exports=r(5).Map},function(t,e,r){r(409),t.exports=r(5).Math.log2},function(t,e,r){r(410),t.exports=r(5).Object.assign},function(t,e,r){r(411);var n=r(5).Object;t.exports=function(t,e){return n.create(t,e)}},function(t,e,r){r(412);var n=r(5).Object;t.exports=function(t,e,r){return n.defineProperty(t,e,r)}},function(t,e,r){r(413);var n=r(5).Object;t.exports=function(t,e){return n.getOwnPropertyDescriptor(t,e)}},function(t,e,r){r(414),t.exports=r(5).Object.getPrototypeOf},function(t,e,r){r(415),t.exports=r(5).Object.keys},function(t,e,r){r(416),t.exports=r(5).Object.setPrototypeOf},function(t,e,r){r(60),r(24),r(32),r(417),t.exports=r(5).Promise},function(t,e,r){r(60),r(24),r(32),r(418),r(421),t.exports=r(5).Set},function(t,e,r){r(419),r(60),r(422),r(423),t.exports=r(5).Symbol},function(t,e,r){r(24),r(32),t.exports=r(96).f("iterator")},function(t,e){t.exports=function(){}},function(t,e,r){var n=r(54);t.exports=function(t,e){var r=[];return n(t,!1,r.push,r,e),r}},function(t,e,r){var n=r(20),i=r(58),a=r(403);t.exports=function(t){return function(e,r,o){var s,u=n(e),h=i(u.length),c=a(o,h);if(t&&r!=r){for(;h>c;)if((s=u[c++])!=s)return!0}else for(;h>c;c++)if((t||c in u)&&u[c]===r)return t||c||0;return!t&&-1}}},function(t,e,r){var n=r(17),i=r(84),a=r(31),o=r(58),s=r(390);t.exports=function(t,e){var r=1==t,u=2==t,h=3==t,c=4==t,l=6==t,d=5==t||l,f=e||s;return function(e,s,p){for(var m,v,g=a(e),y=i(g),x=n(s,p,3),_=o(y.length),b=0,w=r?f(e,_):u?f(e,0):void 0;_>b;b++)if((d||b in y)&&(m=y[b],v=x(m,b,g),t))if(r)w[b]=v;else if(v)switch(t){case 3:return!0;case 5:return m;case 6:return b;case 2:w.push(m)}else if(c)return!1;return l?-1:h||c?c:w}}},function(t,e,r){var n=r(19),i=r(126),a=r(9)("species");t.exports=function(t){var e;return i(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!i(e.prototype)||(e=void 0),n(e)&&null===(e=e[a])&&(e=void 0)),void 0===e?Array:e}},function(t,e,r){var n=r(389);t.exports=function(t,e){return new(n(t))(e)}},function(t,e,r){"use strict";var n=r(13),i=r(39);t.exports=function(t,e,r){e in t?n.f(t,e,i(0,r)):t[e]=r}},function(t,e,r){var n=r(30),i=r(88),a=r(57);t.exports=function(t){var e=n(t),r=i.f;if(r)for(var o,s=r(t),u=a.f,h=0;s.length>h;)u.call(t,o=s[h++])&&e.push(o);return e}},function(t,e){t.exports=function(t,e,r){var n=void 0===r;switch(e.length){case 0:return n?t():t.call(r);case 1:return n?t(e[0]):t.call(r,e[0]);case 2:return n?t(e[0],e[1]):t.call(r,e[0],e[1]);case 3:return n?t(e[0],e[1],e[2]):t.call(r,e[0],e[1],e[2]);case 4:return n?t(e[0],e[1],e[2],e[3]):t.call(r,e[0],e[1],e[2],e[3])}return t.apply(r,e)}},function(t,e,r){"use strict";var n=r(56),i=r(39),a=r(40),o={};r(18)(o,r(9)("iterator"),function(){return this}),t.exports=function(t,e,r){t.prototype=n(o,{next:i(1,r)}),a(t,e+" Iterator")}},function(t,e,r){var n=r(30),i=r(20);t.exports=function(t,e){for(var r,a=i(t),o=n(a),s=o.length,u=0;s>u;)if(a[r=o[u++]]===e)return r}},function(t,e,r){var n=r(11),i=r(135).set,a=n.MutationObserver||n.WebKitMutationObserver,o=n.process,s=n.Promise,u="process"==r(38)(o);t.exports=function(){var t,e,r,h=function(){var n,i;for(u&&(n=o.domain)&&n.exit();t;){i=t.fn,t=t.next;try{i()}catch(n){throw t?r():e=void 0,n}}e=void 0,n&&n.enter()};if(u)r=function(){o.nextTick(h)};else if(a){var c=!0,l=document.createTextNode("");new a(h).observe(l,{characterData:!0}),r=function(){l.data=c=!c}}else if(s&&s.resolve){var d=s.resolve();r=function(){d.then(h)}}else r=function(){i.call(n,h)};return function(n){var i={fn:n,next:void 0};e&&(e.next=i),t||(t=i,r()),e=i}}},function(t,e,r){"use strict";var n=r(30),i=r(88),a=r(57),o=r(31),s=r(84),u=Object.assign;t.exports=!u||r(22)(function(){var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach(function(t){e[t]=t}),7!=u({},t)[r]||Object.keys(u({},e)).join("")!=n})?function(t,e){for(var r=o(t),u=arguments.length,h=1,c=i.f,l=a.f;u>h;)for(var d,f=s(arguments[h++]),p=c?n(f).concat(c(f)):n(f),m=p.length,v=0;m>v;)l.call(f,d=p[v++])&&(r[d]=f[d]);return r}:u},function(t,e,r){var n=r(13),i=r(15),a=r(30);t.exports=r(14)?Object.defineProperties:function(t,e){i(t);for(var r,o=a(e),s=o.length,u=0;s>u;)n.f(t,r=o[u++],e[r]);return t}},function(t,e,r){var n=r(20),i=r(130).f,a={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return i(t)}catch(t){return o.slice()}};t.exports.f=function(t){return o&&"[object Window]"==a.call(t)?s(t):i(n(t))}},function(t,e,r){var n=r(19),i=r(15),a=function(t,e){if(i(t),!n(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,n){try{n=r(17)(Function.call,r(87).f(Object.prototype,"__proto__").set,2),n(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,r){return a(t,r),e?t.__proto__=r:n(t,r),t}}({},!1):void 0),check:a}},function(t,e,r){var n=r(15),i=r(80),a=r(9)("species");t.exports=function(t,e){var r,o=n(t).constructor;return void 0===o||void 0==(r=n(o)[a])?e:i(r)}},function(t,e,r){var n=r(93),i=r(53);t.exports=function(t){return function(e,r){var a,o,s=String(i(e)),u=n(r),h=s.length;return u<0||u>=h?t?"":void 0:(a=s.charCodeAt(u),a<55296||a>56319||u+1===h||(o=s.charCodeAt(u+1))<56320||o>57343?t?s.charAt(u):a:t?s.slice(u,u+2):o-56320+(a-55296<<10)+65536)}}},function(t,e,r){var n=r(93),i=Math.max,a=Math.min;t.exports=function(t,e){return t=n(t),t<0?i(t+e,0):a(t,e)}},function(t,e,r){var n=r(15),i=r(97);t.exports=r(5).getIterator=function(t){var e=i(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return n(e.call(t))}},function(t,e,r){var n=r(52),i=r(9)("iterator"),a=r(29);t.exports=r(5).isIterable=function(t){var e=Object(t);return void 0!==e[i]||"@@iterator"in e||a.hasOwnProperty(n(e))}},function(t,e,r){"use strict";var n=r(17),i=r(10),a=r(31),o=r(127),s=r(125),u=r(58),h=r(391),c=r(97);i(i.S+i.F*!r(128)(function(t){Array.from(t)}),"Array",{from:function(t){var e,r,i,l,d=a(t),f="function"==typeof this?this:Array,p=arguments.length,m=p>1?arguments[1]:void 0,v=void 0!==m,g=0,y=c(d);if(v&&(m=n(m,p>2?arguments[2]:void 0,2)),void 0==y||f==Array&&s(y))for(e=u(d.length),r=new f(e);e>g;g++)h(r,g,v?m(d[g],g):d[g]);else for(l=y.call(d),r=new f;!(i=l.next()).done;g++)h(r,g,v?o(l,m,[i.value,g],!0):i.value);return r.length=g,r}})},function(t,e,r){"use strict";var n=r(385),i=r(129),a=r(29),o=r(20);t.exports=r(85)(Array,"Array",function(t,e){this._t=o(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,i(1)):"keys"==e?i(0,r):"values"==e?i(0,t[r]):i(0,[r,t[r]])},"values"),a.Arguments=a.Array,n("keys"),n("values"),n("entries")},function(t,e,r){"use strict";var n=r(120);t.exports=r(122)("Map",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){var e=n.getEntry(this,t);return e&&e.v},set:function(t,e){return n.def(this,0===t?0:t,e)}},n,!0)},function(t,e,r){var n=r(10);n(n.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},function(t,e,r){var n=r(10);n(n.S+n.F,"Object",{assign:r(397)})},function(t,e,r){var n=r(10);n(n.S,"Object",{create:r(56)})},function(t,e,r){var n=r(10);n(n.S+n.F*!r(14),"Object",{defineProperty:r(13).f})},function(t,e,r){var n=r(20),i=r(87).f;r(89)("getOwnPropertyDescriptor",function(){return function(t,e){return i(n(t),e)}})},function(t,e,r){var n=r(31),i=r(131);r(89)("getPrototypeOf",function(){return function(t){return i(n(t))}})},function(t,e,r){var n=r(31),i=r(30);r(89)("keys",function(){return function(t){return i(n(t))}})},function(t,e,r){var n=r(10);n(n.S,"Object",{setPrototypeOf:r(400).set})},function(t,e,r){"use strict";var n,i,a,o=r(55),s=r(11),u=r(17),h=r(52),c=r(10),l=r(19),d=r(80),f=r(81),p=r(54),m=r(401),v=r(135).set,g=r(396)(),y=s.TypeError,x=s.process,_=s.Promise,x=s.process,b="process"==h(x),w=function(){},M=!!function(){try{var t=_.resolve(1),e=(t.constructor={})[r(9)("species")]=function(t){t(w,w)};return(b||"function"==typeof PromiseRejectionEvent)&&t.then(w)instanceof e}catch(t){}}(),E=function(t,e){return t===e||t===_&&e===a},T=function(t){var e;return!(!l(t)||"function"!=typeof(e=t.then))&&e},S=function(t){return E(_,t)?new A(t):new i(t)},A=i=function(t){var e,r;this.promise=new t(function(t,n){if(void 0!==e||void 0!==r)throw y("Bad Promise constructor");e=t,r=n}),this.resolve=d(e),this.reject=d(r)},L=function(t){try{t()}catch(t){return{error:t}}},P=function(t,e){if(!t._n){t._n=!0;var r=t._c;g(function(){for(var n=t._v,i=1==t._s,a=0;r.length>a;)!function(e){var r,a,o=i?e.ok:e.fail,s=e.resolve,u=e.reject,h=e.domain;try{o?(i||(2==t._h&&O(t),t._h=1),!0===o?r=n:(h&&h.enter(),r=o(n),h&&h.exit()),r===e.promise?u(y("Promise-chain cycle")):(a=T(r))?a.call(r,s,u):s(r)):u(n)}catch(t){u(t)}}(r[a++]);t._c=[],t._n=!1,e&&!t._h&&R(t)})}},R=function(t){v.call(s,function(){var e,r,n,i=t._v;if(C(t)&&(e=L(function(){b?x.emit("unhandledRejection",i,t):(r=s.onunhandledrejection)?r({promise:t,reason:i}):(n=s.console)&&n.error&&n.error("Unhandled promise rejection",i)}),t._h=b||C(t)?2:1),t._a=void 0,e)throw e.error})},C=function(t){if(1==t._h)return!1;for(var e,r=t._a||t._c,n=0;r.length>n;)if(e=r[n++],e.fail||!C(e.promise))return!1;return!0},O=function(t){v.call(s,function(){var e;b?x.emit("rejectionHandled",t):(e=s.onrejectionhandled)&&e({promise:t,reason:t._v})})},I=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),P(e,!0))},D=function(t){var e,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===t)throw y("Promise can't be resolved itself");(e=T(t))?g(function(){var n={_w:r,_d:!1};try{e.call(t,u(D,n,1),u(I,n,1))}catch(t){I.call(n,t)}}):(r._v=t,r._s=1,P(r,!1))}catch(t){I.call({_w:r,_d:!1},t)}}};M||(_=function(t){f(this,_,"Promise","_h"),d(t),n.call(this);try{t(u(D,this,1),u(I,this,1))}catch(t){I.call(this,t)}},n=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},n.prototype=r(90)(_.prototype,{then:function(t,e){var r=S(m(this,_));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=b?x.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&P(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),A=function(){var t=new n;this.promise=t,this.resolve=u(D,t,1),this.reject=u(I,t,1)}),c(c.G+c.W+c.F*!M,{Promise:_}),r(40)(_,"Promise"),r(134)("Promise"),a=r(5).Promise,c(c.S+c.F*!M,"Promise",{reject:function(t){var e=S(this);return(0,e.reject)(t),e.promise}}),c(c.S+c.F*(o||!M),"Promise",{resolve:function(t){if(t instanceof _&&E(t.constructor,this))return t;var e=S(this);return(0,e.resolve)(t),e.promise}}),c(c.S+c.F*!(M&&r(128)(function(t){_.all(t).catch(w)})),"Promise",{all:function(t){var e=this,r=S(e),n=r.resolve,i=r.reject,a=L(function(){var r=[],a=0,o=1;p(t,!1,function(t){var s=a++,u=!1;r.push(void 0),o++,e.resolve(t).then(function(t){u||(u=!0,r[s]=t,--o||n(r))},i)}),--o||n(r)});return a&&i(a.error),r.promise},race:function(t){var e=this,r=S(e),n=r.reject,i=L(function(){p(t,!1,function(t){e.resolve(t).then(r.resolve,n)})});return i&&n(i.error),r.promise}})},function(t,e,r){"use strict";var n=r(120);t.exports=r(122)("Set",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return n.def(this,t=0===t?0:t,t)}},n)},function(t,e,r){"use strict";var n=r(11),i=r(23),a=r(14),o=r(10),s=r(133),u=r(86).KEY,h=r(22),c=r(92),l=r(40),d=r(59),f=r(9),p=r(96),m=r(95),v=r(395),g=r(392),y=r(126),x=r(15),_=r(20),b=r(94),w=r(39),M=r(56),E=r(399),T=r(87),S=r(13),A=r(30),L=T.f,P=S.f,R=E.f,C=n.Symbol,O=n.JSON,I=O&&O.stringify,D=f("_hidden"),N=f("toPrimitive"),U={}.propertyIsEnumerable,F=c("symbol-registry"),B=c("symbols"),z=c("op-symbols"),G=Object.prototype,j="function"==typeof C,V=n.QObject,k=!V||!V.prototype||!V.prototype.findChild,H=a&&h(function(){return 7!=M(P({},"a",{get:function(){return P(this,"a",{value:7}).a}})).a})?function(t,e,r){var n=L(G,e);n&&delete G[e],P(t,e,r),n&&t!==G&&P(G,e,n)}:P,W=function(t){var e=B[t]=M(C.prototype);return e._k=t,e},q=j&&"symbol"==typeof C.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof C},X=function(t,e,r){return t===G&&X(z,e,r),x(t),e=b(e,!0),x(r),i(B,e)?(r.enumerable?(i(t,D)&&t[D][e]&&(t[D][e]=!1),r=M(r,{enumerable:w(0,!1)})):(i(t,D)||P(t,D,w(1,{})),t[D][e]=!0),H(t,e,r)):P(t,e,r)},Y=function(t,e){x(t);for(var r,n=g(e=_(e)),i=0,a=n.length;a>i;)X(t,r=n[i++],e[r]);return t},Z=function(t,e){return void 0===e?M(t):Y(M(t),e)},K=function(t){var e=U.call(this,t=b(t,!0));return!(this===G&&i(B,t)&&!i(z,t))&&(!(e||!i(this,t)||!i(B,t)||i(this,D)&&this[D][t])||e)},Q=function(t,e){if(t=_(t),e=b(e,!0),t!==G||!i(B,e)||i(z,e)){var r=L(t,e);return!r||!i(B,e)||i(t,D)&&t[D][e]||(r.enumerable=!0),r}},J=function(t){for(var e,r=R(_(t)),n=[],a=0;r.length>a;)i(B,e=r[a++])||e==D||e==u||n.push(e);return n},$=function(t){for(var e,r=t===G,n=R(r?z:_(t)),a=[],o=0;n.length>o;)!i(B,e=n[o++])||r&&!i(G,e)||a.push(B[e]);return a};j||(C=function(){if(this instanceof C)throw TypeError("Symbol is not a constructor!");var t=d(arguments.length>0?arguments[0]:void 0),e=function(r){this===G&&e.call(z,r),i(this,D)&&i(this[D],t)&&(this[D][t]=!1),H(this,t,w(1,r))};return a&&k&&H(G,t,{configurable:!0,set:e}),W(t)},s(C.prototype,"toString",function(){return this._k}),T.f=Q,S.f=X,r(130).f=E.f=J,r(57).f=K,r(88).f=$,a&&!r(55)&&s(G,"propertyIsEnumerable",K,!0),p.f=function(t){return W(f(t))}),o(o.G+o.W+o.F*!j,{Symbol:C});for(var tt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),et=0;tt.length>et;)f(tt[et++]);for(var tt=A(f.store),et=0;tt.length>et;)m(tt[et++]);o(o.S+o.F*!j,"Symbol",{for:function(t){return i(F,t+="")?F[t]:F[t]=C(t)},keyFor:function(t){if(q(t))return v(F,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){k=!0},useSimple:function(){k=!1}}),o(o.S+o.F*!j,"Object",{create:Z,defineProperty:X,defineProperties:Y,getOwnPropertyDescriptor:Q,getOwnPropertyNames:J,getOwnPropertySymbols:$}),O&&o(o.S+o.F*(!j||h(function(){var t=C();return"[null]"!=I([t])||"{}"!=I({a:t})||"{}"!=I(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!q(t)){for(var e,r,n=[t],i=1;arguments.length>i;)n.push(arguments[i++]);return e=n[1],"function"==typeof e&&(r=e),!r&&y(e)||(e=function(t,e){if(r&&(e=r.call(this,t,e)),!q(e))return e}),n[1]=e,I.apply(O,n)}}}),C.prototype[N]||r(18)(C.prototype,N,C.prototype.valueOf),l(C,"Symbol"),l(Math,"Math",!0),l(n.JSON,"JSON",!0)},function(t,e,r){var n=r(10);n(n.P+n.R,"Map",{toJSON:r(121)("Map")})},function(t,e,r){var n=r(10);n(n.P+n.R,"Set",{toJSON:r(121)("Set")})},function(t,e,r){r(95)("asyncIterator")},function(t,e,r){r(95)("observable")},function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n=e&&e.length,a=n?e[0]*r:t.length,s=i(t,0,a,r,!0),u=[];if(!s)return u;var h,c,d,f,p,m,v;if(n&&(s=l(t,e,s,r)),t.length>80*r){h=d=t[0],c=f=t[1];for(var g=r;g<a;g+=r)p=t[g],m=t[g+1],p<h&&(h=p),m<c&&(c=m),p>d&&(d=p),m>f&&(f=m);v=Math.max(d-h,f-c)}return o(s,u,r,h,c,v),u}function i(t,e,r,n,i){var a,o;if(i===C(t,e,r,n)>0)for(a=e;a<r;a+=n)o=L(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=L(a,t[a],t[a+1],o);return o&&w(o,o.next)&&(P(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!w(n,n.next)&&0!==b(n.prev,n,n.next))n=n.next;else{if(P(n),(n=e=n.prev)===n.next)return null;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,l,d){if(t){!d&&l&&m(t,n,i,l);for(var f,p,v=t;t.prev!==t.next;)if(f=t.prev,p=t.next,l?u(t,n,i,l):s(t))e.push(f.i/r),e.push(t.i/r),e.push(p.i/r),P(t),t=p.next,v=p.next;else if((t=p)===v){d?1===d?(t=h(t,e,r),o(t,e,r,n,i,l,2)):2===d&&c(t,e,r,n,i,l):o(a(t),e,r,n,i,l,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(b(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(x(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&b(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function u(t,e,r,n){var i=t.prev,a=t,o=t.next;if(b(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,u=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,h=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,l=g(s,u,e,r,n),d=g(h,c,e,r,n),f=t.nextZ;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&x(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=l;){if(f!==t.prev&&f!==t.next&&x(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&b(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function h(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!w(i,a)&&M(i,n,n.next,a)&&T(i,a)&&T(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),P(n),P(n.next),n=t=a),n=n.next}while(n!==t);return n}function c(t,e,r,n,i,s){var u=t;do{for(var h=u.next.next;h!==u.prev;){if(u.i!==h.i&&_(u,h)){var c=A(u,h);return u=a(u,u.next),c=a(c,c.next),o(u,e,r,n,i,s),void o(c,e,r,n,i,s)}h=h.next}u=u.next}while(u!==t)}function l(t,e,r,n){var o,s,u,h,c,l=[];for(o=0,s=e.length;o<s;o++)u=e[o]*n,h=o<s-1?e[o+1]*n:t.length,c=i(t,u,h,n,!1),c===c.next&&(c.steiner=!0),l.push(y(c));for(l.sort(d),o=0;o<l.length;o++)f(l[o],r),r=a(r,r.next);return r}function d(t,e){return t.x-e.x}function f(t,e){if(e=p(t,e)){var r=A(e,t);a(r,r.next)}}function p(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!r)return null;if(i===o)return r.prev;var u,h=r,c=r.x,l=r.y,d=1/0;for(n=r.next;n!==h;)i>=n.x&&n.x>=c&&x(a<l?i:o,a,c,l,a<l?o:i,a,n.x,n.y)&&((u=Math.abs(a-n.y)/(i-n.x))<d||u===d&&n.x>r.x)&&T(n,t)&&(r=n,d=u),n=n.next;return r}function m(t,e,r,n){var i=t;do{null===i.z&&(i.z=g(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,v(i)}function v(t){var e,r,n,i,a,o,s,u,h=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<h&&(s++,n=n.nextZ);e++);for(u=h;s>0||u>0&&n;)0===s?(i=n,n=n.nextZ,u--):0!==u&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--):(i=r,r=r.nextZ,s--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,h*=2}while(o>1);return t}function g(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function y(t){var e=t,r=t;do{e.x<r.x&&(r=e),e=e.next}while(e!==t);return r}function x(t,e,r,n,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function _(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!E(t,e)&&T(t,e)&&T(e,t)&&S(t,e)}function b(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function M(t,e,r,n){return!!(w(t,e)&&w(r,n)||w(t,n)&&w(r,e))||b(t,e,r)>0!=b(t,e,n)>0&&b(r,n,t)>0!=b(r,n,e)>0}function E(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&M(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function T(t,e){return b(t.prev,t,t.next)<0?b(t,e,t.next)>=0&&b(t,t.prev,e)>=0:b(t,e,t.prev)<0||b(t,t.next,e)<0}function S(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}function A(t,e){var r=new R(t.i,t.x,t.y),n=new R(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function L(t,e,r,n){var i=new R(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function P(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function R(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function C(t,e,r,n){for(var i=0,a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}t.exports=n,n.deviation=function(t,e,r,n){var i=e&&e.length,a=i?e[0]*r:t.length,o=Math.abs(C(t,0,a,r));if(i)for(var s=0,u=e.length;s<u;s++){var h=e[s]*r,c=s<u-1?e[s+1]*r:t.length;o-=Math.abs(C(t,h,c,r))}var l=0;for(s=0;s<n.length;s+=3){var d=n[s]*r,f=n[s+1]*r,p=n[s+2]*r;l+=Math.abs((t[d]-t[p])*(t[f+1]-t[d+1])-(t[d]-t[f])*(t[p+1]-t[d+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},n.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)r.vertices.push(t[i][a][o]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r}},function(t,e,r){var n,n;!function(e){t.exports=e()}(function(){return function t(e,r,i){function a(s,u){if(!r[s]){if(!e[s]){var h="function"==typeof n&&n;if(!u&&h)return n(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return a(r||t)},l,l.exports,t,e,r,i)}return r[s].exports}for(var o="function"==typeof n&&n,s=0;s<i.length;s++)a(i[s]);return a}({1:[function(t,e,r){var n,i,a,o,s,u=function(t,e){function r(){this.constructor=t}for(var n in e)h.call(e,n)&&(t[n]=e[n]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},h={}.hasOwnProperty;n=t("./PriorityQueue/AbstractPriorityQueue"),i=t("./PriorityQueue/ArrayStrategy"),o=t("./PriorityQueue/BinaryHeapStrategy"),a=t("./PriorityQueue/BHeapStrategy"),s=function(t){function e(t){t||(t={}),t.strategy||(t.strategy=o),t.comparator||(t.comparator=function(t,e){return(t||0)-(e||0)}),e.__super__.constructor.call(this,t)}return u(e,t),e}(n),s.ArrayStrategy=i,s.BinaryHeapStrategy=o,s.BHeapStrategy=a,e.exports=s},{"./PriorityQueue/AbstractPriorityQueue":2,"./PriorityQueue/ArrayStrategy":3,"./PriorityQueue/BHeapStrategy":4,"./PriorityQueue/BinaryHeapStrategy":5}],2:[function(t,e,r){e.exports=function(){function t(t){var e;if(null==(null!=t?t.strategy:void 0))throw"Must pass options.strategy, a strategy";if(null==(null!=t?t.comparator:void 0))throw"Must pass options.comparator, a comparator";this.priv=new t.strategy(t),this.length=(null!=t&&null!=(e=t.initialValues)?e.length:void 0)||0}return t.prototype.queue=function(t){this.length++,this.priv.queue(t)},t.prototype.dequeue=function(t){if(!this.length)throw"Empty queue";return this.length--,this.priv.dequeue()},t.prototype.peek=function(t){if(!this.length)throw"Empty queue";return this.priv.peek()},t.prototype.clear=function(){return this.length=0,this.priv.clear()},t}()},{}],3:[function(t,e,r){var n;n=function(t,e,r){var n,i,a;for(i=0,n=t.length;i<n;)a=i+n>>>1,r(t[a],e)>=0?i=a+1:n=a;return i},e.exports=function(){function t(t){var e;this.options=t,this.comparator=this.options.comparator,this.data=(null!=(e=this.options.initialValues)?e.slice(0):void 0)||[],this.data.sort(this.comparator).reverse()}return t.prototype.queue=function(t){var e;e=n(this.data,t,this.comparator),this.data.splice(e,0,t)},t.prototype.dequeue=function(){return this.data.pop()},t.prototype.peek=function(){return this.data[this.data.length-1]},t.prototype.clear=function(){this.data.length=0},t}()},{}],4:[function(t,e,r){e.exports=function(){function t(t){var e,r,n,i,a,o,s,u;for(this.comparator=(null!=t?t.comparator:void 0)||function(t,e){return t-e},this.pageSize=(null!=t?t.pageSize:void 0)||512,this.length=0,s=0;1<<s<this.pageSize;)s+=1;if(1<<s!==this.pageSize)throw"pageSize must be a power of two";for(this._shift=s,this._emptyMemoryPageTemplate=e=[],r=0,a=this.pageSize;0<=a?r<a:r>a;0<=a?++r:--r)e.push(null);if(this._memory=[],this._mask=this.pageSize-1,t.initialValues)for(o=t.initialValues,n=0,i=o.length;n<i;n++)u=o[n],this.queue(u)}return t.prototype.queue=function(t){this.length+=1,this._write(this.length,t),this._bubbleUp(this.length,t)},t.prototype.dequeue=function(){var t,e;return t=this._read(1),e=this._read(this.length),this.length-=1,this.length>0&&(this._write(1,e),this._bubbleDown(1,e)),t},t.prototype.peek=function(){return this._read(1)},t.prototype.clear=function(){this.length=0,this._memory.length=0},t.prototype._write=function(t,e){var r;for(r=t>>this._shift;r>=this._memory.length;)this._memory.push(this._emptyMemoryPageTemplate.slice(0));return this._memory[r][t&this._mask]=e},t.prototype._read=function(t){return this._memory[t>>this._shift][t&this._mask]},t.prototype._bubbleUp=function(t,e){var r,n,i,a;for(r=this.comparator;t>1&&(n=t&this._mask,t<this.pageSize||n>3?i=t&~this._mask|n>>1:n<2?(i=t-this.pageSize>>this._shift,i+=i&~(this._mask>>1),i|=this.pageSize>>1):i=t-2,a=this._read(i),!(r(a,e)<0));)this._write(i,e),this._write(t,a),t=i},t.prototype._bubbleDown=function(t,e){var r,n,i,a,o;for(o=this.comparator;t<this.length;)if(t>this._mask&&!(t&this._mask-1)?r=n=t+2:t&this.pageSize>>1?(r=(t&~this._mask)>>1,r|=t&this._mask>>1,r=r+1<<this._shift,n=r+1):(r=t+(t&this._mask),n=r+1),r!==n&&n<=this.length)if(i=this._read(r),a=this._read(n),o(i,e)<0&&o(i,a)<=0)this._write(r,e),this._write(t,i),t=r;else{if(!(o(a,e)<0))break;this._write(n,e),this._write(t,a),t=n}else{if(!(r<=this.length))break;if(i=this._read(r),!(o(i,e)<0))break;this._write(r,e),this._write(t,i),t=r}},t}()},{}],5:[function(t,e,r){e.exports=function(){function t(t){var e;this.comparator=(null!=t?t.comparator:void 0)||function(t,e){return t-e},this.length=0,this.data=(null!=(e=t.initialValues)?e.slice(0):void 0)||[],this._heapify()}return t.prototype._heapify=function(){var t,e,r;if(this.data.length>0)for(t=e=1,r=this.data.length;1<=r?e<r:e>r;t=1<=r?++e:--e)this._bubbleUp(t)},t.prototype.queue=function(t){this.data.push(t),this._bubbleUp(this.data.length-1)},t.prototype.dequeue=function(){var t,e;return e=this.data[0],t=this.data.pop(),this.data.length>0&&(this.data[0]=t,this._bubbleDown(0)),e},t.prototype.peek=function(){return this.data[0]},t.prototype.clear=function(){this.length=0,this.data.length=0},t.prototype._bubbleUp=function(t){for(var e,r;t>0&&(e=t-1>>>1,this.comparator(this.data[t],this.data[e])<0);)r=this.data[e],this.data[e]=this.data[t],this.data[t]=r,t=e},t.prototype._bubbleDown=function(t){var e,r,n,i,a;for(e=this.data.length-1;;){if(r=1+(t<<1),i=r+1,n=t,r<=e&&this.comparator(this.data[r],this.data[n])<0&&(n=r),i<=e&&this.comparator(this.data[i],this.data[n])<0&&(n=i),n===t)break;a=this.data[n],this.data[n]=this.data[t],this.data[t]=a,t=n}},t}()},{}]},{},[1])(1)})},,function(t,e,r){"use strict";function n(t){var e=t.length;if(e<3){for(var r=new Array(e),n=0;n<e;++n)r[n]=n;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:r}for(var a=new Array(e),n=0;n<e;++n)a[n]=n;a.sort(function(e,r){var n=t[e][0]-t[r][0];return n||t[e][1]-t[r][1]});for(var o=[a[0],a[1]],s=[a[0],a[1]],n=2;n<e;++n){for(var u=a[n],h=t[u],c=o.length;c>1&&i(t[o[c-2]],t[o[c-1]],h)<=0;)c-=1,o.pop();for(o.push(u),c=s.length;c>1&&i(t[s[c-2]],t[s[c-1]],h)>=0;)c-=1,s.pop();s.push(u)}for(var r=new Array(s.length+o.length-2),l=0,n=0,d=o.length;n<d;++n)r[l++]=o[n];for(var f=s.length-2;f>0;--f)r[l++]=s[f];return r}t.exports=n;var i=r(493)[3]},function(t,e,r){"use strict";function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var i=t.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0}else this.x=t,this.y=e,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}var i=r(136);n.fromMGRS=function(t){return new n(r.i(i.b)(t))},n.prototype.toMGRS=function(t){return r.i(i.c)([this.x,this.y],t)},e.a=n},function(t,e,r){"use strict";e.a=function(t,e,r){var n,i,a,o=r.x,s=r.y,u=r.z||0,h={};for(a=0;a<3;a++)if(!e||2!==a||void 0!==r.z)switch(0===a?(n=o,i="x"):1===a?(n=s,i="y"):(n=u,i="z"),t.axis[a]){case"e":h[i]=n;break;case"w":h[i]=-n;break;case"n":h[i]=n;break;case"s":h[i]=-n;break;case"u":void 0!==r[i]&&(h.z=n);break;case"d":void 0!==r[i]&&(h.z=-n);break;default:return null}return h}},function(t,e,r){"use strict";var n=r(4);e.a=function(t,e){if(void 0===t){if((t=Math.floor(30*(r.i(n.a)(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}},function(t,e,r){"use strict";var n=r(253),i=r(437);e.a=function(t){var e=Math.abs(t);return e=r.i(i.a)(e*(1+e/(r.i(n.a)(1,e)+1))),t<0?-e:e}},function(t,e,r){"use strict";e.a=function(t,e){for(var r,n=2*Math.cos(e),i=t.length-1,a=t[i],o=0;--i>=0;)r=n*a-o+t[i],o=a,a=r;return Math.sin(e)*r}},function(t,e,r){"use strict";var n=r(256),i=r(434);e.a=function(t,e,a){for(var o,s,u=Math.sin(e),h=Math.cos(e),c=r.i(n.a)(a),l=r.i(i.a)(a),d=2*h*l,f=-2*u*c,p=t.length-1,m=t[p],v=0,g=0,y=0;--p>=0;)o=g,s=v,g=m,v=y,m=d*g-o-f*v+t[p],y=f*g-s+d*v;return d=u*l,f=h*c,[d*m-f*y,d*y+f*m]}},function(t,e,r){"use strict";e.a=function(t){var e=Math.exp(t);return e=(e+1/e)/2}},function(t,e,r){"use strict";e.a=function(t,e){for(var r,n=2*Math.cos(2*e),i=t.length-1,a=t[i],o=0;--i>=0;)r=n*a-o+t[i],o=a,a=r;return e+r*Math.sin(2*e)}},function(t,e,r){"use strict";var n=r(3);e.a=function(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-r)<1e-6)return e<0?-1*n.b:n.b;for(var i,a,o,s,u=Math.asin(.5*e),h=0;h<30;h++)if(a=Math.sin(u),o=Math.cos(u),s=t*a,i=Math.pow(1-s*s,2)/(2*o)*(e/(1-t*t)-a/(1-s*s)+.5/t*Math.log((1-s)/(1+s))),u+=i,Math.abs(i)<=1e-10)return u;return NaN}},function(t,e,r){"use strict";e.a=function(t){var e=1+t,r=e-1;return 0===r?t:t*Math.log(e)/r}},function(t,e,r){"use strict";e.a=function(t,e){return Math.pow((1-t)/(1+t),e)}},function(t,e,r){"use strict";r.d(e,"a",function(){return n});var n={};n.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},n.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},n.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},n.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},n.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},n.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},n.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},n.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},n.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},n.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},n.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},n.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},n.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},n.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},n.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},n.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},function(t,e,r){"use strict";r.d(e,"a",function(){return n}),r.d(e,"b",function(){return i});var n={};n.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},n.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},n.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},n.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},n.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},n.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},n.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},n.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},n.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},n.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},n.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},n.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},n.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},n.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},n.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},n.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},n.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},n.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},n.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},n.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},n.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},n.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},n.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},n.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},n.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},n.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},n.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},n.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},n.hough={a:6378270,rf:297,ellipseName:"Hough"},n.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},n.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},n.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},n.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},n.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},n.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},n.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},n.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},n.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"},n.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},n.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},n.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var i=n.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};n.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},function(t,e,r){"use strict";r.d(e,"a",function(){return n});var n={};n.greenwich=0,n.lisbon=-9.131906111111,n.paris=2.337229166667,n.bogota=-74.080916666667,n.madrid=-3.687938888889,n.rome=12.452333333333,n.bern=7.439583333333,n.jakarta=106.807719444444,n.ferro=-17.666666666667,n.brussels=4.367975,n.stockholm=18.058277777778,n.athens=23.7163375,n.oslo=10.722916666667},function(t,e,r){"use strict";e.a={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}}},function(t,e,r){"use strict";function n(t,e,n){var i;return Array.isArray(n)?(i=r.i(s.a)(t,e,n),3===n.length?[i.x,i.y,i.z]:[i.x,i.y]):r.i(s.a)(t,e,n)}function i(t){return t instanceof o.a?t:t.oProj?t.oProj:r.i(o.a)(t)}function a(t,e,r){t=i(t);var a,o=!1;return void 0===e?(e=t,t=u,o=!0):(void 0!==e.x||Array.isArray(e))&&(r=e,e=t,t=u,o=!0),e=i(e),r?n(t,e,r):(a={forward:function(r){return n(t,e,r)},inverse:function(r){return n(e,t,r)}},o&&(a.oProj=e),a)}var o=r(98),s=r(262),u=r.i(o.a)("WGS84");e.a=a},function(t,e,r){"use strict";function n(t,e,r,n,a,o){var s={};return s.datum_type=void 0===t||"none"===t?i.k:i.l,e&&(s.datum_params=e.map(parseFloat),0===s.datum_params[0]&&0===s.datum_params[1]&&0===s.datum_params[2]||(s.datum_type=i.h),s.datum_params.length>3&&(0===s.datum_params[3]&&0===s.datum_params[4]&&0===s.datum_params[5]&&0===s.datum_params[6]||(s.datum_type=i.i,s.datum_params[3]*=i.e,s.datum_params[4]*=i.e,s.datum_params[5]*=i.e,s.datum_params[6]=s.datum_params[6]/1e6+1))),s.a=r,s.b=n,s.es=a,s.ep2=o,s}var i=r(3);e.a=n},function(t,e,r){"use strict";function n(t,e){return t.datum_type===e.datum_type&&(!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(t.datum_type===u.h?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type!==u.i||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]))}function i(t,e,r){var n,i,a,o,s=t.x,h=t.y,c=t.z?t.z:0;if(h<-u.b&&h>-1.001*u.b)h=-u.b;else if(h>u.b&&h<1.001*u.b)h=u.b;else if(h<-u.b||h>u.b)return null;return s>Math.PI&&(s-=2*Math.PI),i=Math.sin(h),o=Math.cos(h),a=i*i,n=r/Math.sqrt(1-e*a),{x:(n+c)*o*Math.cos(s),y:(n+c)*o*Math.sin(s),z:(n*(1-e)+c)*i}}function a(t,e,r,n){var i,a,o,s,h,c,l,d,f,p,m,v,g,y,x,_,b=t.x,w=t.y,M=t.z?t.z:0;if(i=Math.sqrt(b*b+w*w),a=Math.sqrt(b*b+w*w+M*M),i/r<1e-12){if(y=0,a/r<1e-12)return x=u.b,_=-n,{x:t.x,y:t.y,z:t.z}}else y=Math.atan2(w,b);o=M/a,s=i/a,h=1/Math.sqrt(1-e*(2-e)*s*s),d=s*(1-e)*h,f=o*h,g=0;do{g++,l=r/Math.sqrt(1-e*f*f),_=i*d+M*f-l*(1-e*f*f),c=e*l/(l+_),h=1/Math.sqrt(1-c*(2-c)*s*s),p=s*(1-c)*h,m=o*h,v=m*d-p*f,d=p,f=m}while(v*v>1e-24&&g<30);return x=Math.atan(m/Math.abs(p)),{x:y,y:x,z:_}}function o(t,e,r){if(e===u.h)return{x:t.x+r[0],y:t.y+r[1],z:t.z+r[2]};if(e===u.i){var n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],h=r[5],c=r[6];return{x:c*(t.x-h*t.y+s*t.z)+n,y:c*(h*t.x+t.y-o*t.z)+i,z:c*(-s*t.x+o*t.y+t.z)+a}}}function s(t,e,r){if(e===u.h)return{x:t.x-r[0],y:t.y-r[1],z:t.z-r[2]};if(e===u.i){var n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],h=r[5],c=r[6],l=(t.x-n)/c,d=(t.y-i)/c,f=(t.z-a)/c;return{x:l+h*d-s*f,y:-h*l+d+o*f,z:s*l-o*d+f}}}e.a=n,e.b=i,e.e=a,e.c=o,e.d=s;var u=r(3)},function(t,e,r){"use strict";function n(t){return t===i.h||t===i.i}var i=r(3),a=r(445);e.a=function(t,e,o){return r.i(a.a)(t,e)?o:t.datum_type===i.k||e.datum_type===i.k?o:t.es!==e.es||t.a!==e.a||n(t.datum_type)||n(e.datum_type)?(o=r.i(a.b)(o,t.es,t.a),n(t.datum_type)&&(o=r.i(a.c)(o,t.datum_type,t.datum_params)),n(e.datum_type)&&(o=r.i(a.d)(o,e.datum_type,e.datum_params)),r.i(a.e)(o,e.es,e.a,e.b)):o}},function(t,e,r){"use strict";function n(t,e,r,n){var i=t*t,o=e*e,s=(i-o)/i,u=0;return n?(t*=1-s*(a.m+s*(a.n+s*a.o)),i=t*t,s=0):u=Math.sqrt(s),{es:s,e:u,ep2:(i-o)/o}}function i(t,e,n,i,u){if(!t){var h=r.i(s.a)(o.a,i);h||(h=o.b),t=h.a,e=h.b,n=h.rf}return n&&!e&&(e=(1-1/n)*t),(0===n||Math.abs(t-e)<a.a)&&(u=!0,e=t),{a:t,b:e,rf:n,sphere:u}}e.b=n,e.a=i;var a=r(3),o=r(440),s=r(103)},function(t,e,r){"use strict";e.a=function(t,e){t=t||{};var r,n;if(!e)return t;for(n in e)void 0!==(r=e[n])&&(t[n]=r);return t}},function(t,e,r){"use strict";e.a=function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}},function(t,e,r){"use strict";function n(t){return"string"==typeof t}function i(t){return t in u.a}function a(t){return l.some(function(e){return t.indexOf(e)>-1})}function o(t){return"+"===t[0]}function s(t){return n(t)?i(t)?u.a[t]:a(t)?r.i(h.a)(t):o(t)?r.i(c.a)(t):void 0:t}var u=r(258),h=r(266),c=r(260),l=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];e.a=s},function(t,e,r){"use strict";function n(t,e){var r=c.length;return t.names?(c[r]=t,t.names.forEach(function(t){h[t.toLowerCase()]=r}),this):(console.log(e),!0)}function i(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==h[e]&&c[h[e]]?c[h[e]]:void 0}function a(){u.forEach(n)}var o=r(464),s=r(463),u=[o.a,s.a],h={},c=[];e.a={start:a,add:n,get:i}},function(t,e,r){"use strict";function n(){Math.abs(this.lat1+this.lat2)<l.a||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=r.i(s.a)(this.e3,this.sin_po,this.cos_po),this.qs1=r.i(u.a)(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=r.i(s.a)(this.e3,this.sin_po,this.cos_po),this.qs2=r.i(u.a)(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=r.i(u.a)(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>l.a?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function i(t){var e=t.x,n=t.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var i=r.i(u.a)(this.e3,this.sin_phi,this.cos_phi),a=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,o=this.ns0*r.i(h.a)(e-this.long0),s=a*Math.sin(o)+this.x0,c=this.rh-a*Math.cos(o)+this.y0;return t.x=s,t.y=c,t}function a(t){var e,n,i,a,o,s;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1),a=0,0!==e&&(a=Math.atan2(i*t.x,i*t.y)),i=e*this.ns0/this.a,this.sphere?s=Math.asin((this.c-i*i)/(2*this.ns0)):(n=(this.c-i*i)/this.ns0,s=this.phi1z(this.e3,n)),o=r.i(h.a)(a/this.ns0+this.long0),t.x=o,t.y=s,t}function o(t,e){var n,i,a,o,s,u=r.i(c.a)(.5*e);if(t<l.a)return u;for(var h=t*t,d=1;d<=25;d++)if(n=Math.sin(u),i=Math.cos(u),a=t*n,o=1-a*a,s=.5*o*o/i*(e/(1-h)-n/o+.5/t*Math.log((1-a)/(1+a))),u+=s,Math.abs(s)<=1e-7)return u;return null}var s=r(34),u=r(102),h=r(4),c=r(33),l=r(3),d=["Albers_Conic_Equal_Area","Albers","aea"];e.a={init:n,forward:i,inverse:a,names:d,phi1z:o}},function(t,e,r){"use strict";function n(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function i(t){var e,n,i,a,p,m,v,g,y,x,_,b,w,M,E,T,S,A,L,P,R,C,O,I=t.x,D=t.y,N=Math.sin(t.y),U=Math.cos(t.y),F=r.i(o.a)(I-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=s.a?(t.x=this.x0+this.a*(s.b-D)*Math.sin(F),t.y=this.y0-this.a*(s.b-D)*Math.cos(F),t):Math.abs(this.sin_p12+1)<=s.a?(t.x=this.x0+this.a*(s.b+D)*Math.sin(F),t.y=this.y0+this.a*(s.b+D)*Math.cos(F),t):(A=this.sin_p12*N+this.cos_p12*U*Math.cos(F),T=Math.acos(A),S=T/Math.sin(T),t.x=this.x0+this.a*S*U*Math.sin(F),t.y=this.y0+this.a*S*(this.cos_p12*N-this.sin_p12*U*Math.cos(F)),t):(e=r.i(h.a)(this.es),n=r.i(c.a)(this.es),i=r.i(l.a)(this.es),a=r.i(d.a)(this.es),Math.abs(this.sin_p12-1)<=s.a?(p=this.a*r.i(u.a)(e,n,i,a,s.b),m=this.a*r.i(u.a)(e,n,i,a,D),t.x=this.x0+(p-m)*Math.sin(F),t.y=this.y0-(p-m)*Math.cos(F),t):Math.abs(this.sin_p12+1)<=s.a?(p=this.a*r.i(u.a)(e,n,i,a,s.b),m=this.a*r.i(u.a)(e,n,i,a,D),t.x=this.x0+(p+m)*Math.sin(F),t.y=this.y0+(p+m)*Math.cos(F),t):(v=N/U,g=r.i(f.a)(this.a,this.e,this.sin_p12),y=r.i(f.a)(this.a,this.e,N),x=Math.atan((1-this.es)*v+this.es*g*this.sin_p12/(y*U)),_=Math.atan2(Math.sin(F),this.cos_p12*Math.tan(x)-this.sin_p12*Math.cos(F)),L=0===_?Math.asin(this.cos_p12*Math.sin(x)-this.sin_p12*Math.cos(x)):Math.abs(Math.abs(_)-Math.PI)<=s.a?-Math.asin(this.cos_p12*Math.sin(x)-this.sin_p12*Math.cos(x)):Math.asin(Math.sin(F)*Math.cos(x)/Math.sin(_)),b=this.e*this.sin_p12/Math.sqrt(1-this.es),w=this.e*this.cos_p12*Math.cos(_)/Math.sqrt(1-this.es),M=b*w,E=w*w,P=L*L,R=P*L,C=R*L,O=C*L,T=g*L*(1-P*E*(1-E)/6+R/8*M*(1-2*E)+C/120*(E*(4-7*E)-3*b*b*(1-7*E))-O/48*M),t.x=this.x0+T*Math.sin(_),t.y=this.y0+T*Math.cos(_),t))}function a(t){t.x-=this.x0,t.y-=this.y0;var e,n,i,a,v,g,y,x,_,b,w,M,E,T,S,A,L,P,R,C,O,I,D;if(this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*s.b*this.a)return;return n=e/this.a,i=Math.sin(n),a=Math.cos(n),v=this.long0,Math.abs(e)<=s.a?g=this.lat0:(g=r.i(p.a)(a*this.sin_p12+t.y*i*this.cos_p12/e),y=Math.abs(this.lat0)-s.b,v=Math.abs(y)<=s.a?this.lat0>=0?r.i(o.a)(this.long0+Math.atan2(t.x,-t.y)):r.i(o.a)(this.long0-Math.atan2(-t.x,t.y)):r.i(o.a)(this.long0+Math.atan2(t.x*i,e*this.cos_p12*a-t.y*this.sin_p12*i))),t.x=v,t.y=g,t}return x=r.i(h.a)(this.es),_=r.i(c.a)(this.es),b=r.i(l.a)(this.es),w=r.i(d.a)(this.es),Math.abs(this.sin_p12-1)<=s.a?(M=this.a*r.i(u.a)(x,_,b,w,s.b),e=Math.sqrt(t.x*t.x+t.y*t.y),E=M-e,g=r.i(m.a)(E/this.a,x,_,b,w),v=r.i(o.a)(this.long0+Math.atan2(t.x,-1*t.y)),t.x=v,t.y=g,t):Math.abs(this.sin_p12+1)<=s.a?(M=this.a*r.i(u.a)(x,_,b,w,s.b),e=Math.sqrt(t.x*t.x+t.y*t.y),E=e-M,g=r.i(m.a)(E/this.a,x,_,b,w),v=r.i(o.a)(this.long0+Math.atan2(t.x,t.y)),t.x=v,t.y=g,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),A=Math.atan2(t.x,t.y),T=r.i(f.a)(this.a,this.e,this.sin_p12),L=Math.cos(A),P=this.e*this.cos_p12*L,R=-P*P/(1-this.es),C=3*this.es*(1-R)*this.sin_p12*this.cos_p12*L/(1-this.es),O=e/T,I=O-R*(1+R)*Math.pow(O,3)/6-C*(1+3*R)*Math.pow(O,4)/24,D=1-R*I*I/2-O*I*I*I/6,S=Math.asin(this.sin_p12*Math.cos(I)+this.cos_p12*Math.sin(I)*L),v=r.i(o.a)(this.long0+Math.asin(Math.sin(A)*Math.sin(I)/Math.cos(S))),g=Math.atan((1-this.es*D*this.sin_p12/Math.sin(S))*Math.tan(S)/(1-this.es)),t.x=v,t.y=g,t)}var o=r(4),s=r(3),u=r(65),h=r(61),c=r(62),l=r(63),d=r(64),f=r(99),p=r(33),m=r(100),v=["Azimuthal_Equidistant","aeqd"];e.a={init:n,forward:i,inverse:a,names:v}},function(t,e,r){"use strict";function n(){this.sphere||(this.e0=r.i(s.a)(this.es),this.e1=r.i(u.a)(this.es),this.e2=r.i(h.a)(this.es),this.e3=r.i(c.a)(this.es),this.ml0=this.a*r.i(o.a)(this.e0,this.e1,this.e2,this.e3,this.lat0))}function i(t){var e,n,i=t.x,a=t.y;if(i=r.i(d.a)(i-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(a)*Math.sin(i)),n=this.a*(Math.atan2(Math.tan(a),Math.cos(i))-this.lat0);else{var s=Math.sin(a),u=Math.cos(a),h=r.i(l.a)(this.a,this.e,s),c=Math.tan(a)*Math.tan(a),f=i*Math.cos(a),p=f*f,m=this.es*u*u/(1-this.es),v=this.a*r.i(o.a)(this.e0,this.e1,this.e2,this.e3,a);e=h*f*(1-p*c*(1/6-(8-c+8*m)*p/120)),n=v-this.ml0+h*s/u*p*(.5+(5-c+6*m)*p/24)}return t.x=e+this.x0,t.y=n+this.y0,t}function a(t){t.x-=this.x0,t.y-=this.y0;var e,n,i=t.x/this.a,a=t.y/this.a;if(this.sphere){var o=a+this.lat0;e=Math.asin(Math.sin(o)*Math.cos(i)),n=Math.atan2(Math.tan(i),Math.cos(o))}else{var s=this.ml0/this.a+a,u=r.i(p.a)(s,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(u)-m.b)<=m.a)return t.x=this.long0,t.y=m.b,a<0&&(t.y*=-1),t;var h=r.i(l.a)(this.a,this.e,Math.sin(u)),c=h*h*h/this.a/this.a*(1-this.es),v=Math.pow(Math.tan(u),2),g=i*this.a/h,y=g*g;e=u-h*Math.tan(u)/c*g*g*(.5-(1+3*v)*g*g/24),n=g*(1-y*(v/3+(1+3*v)*v*y/15))/Math.cos(u)}return t.x=r.i(d.a)(n+this.long0),t.y=r.i(f.a)(e),t}var o=r(65),s=r(61),u=r(62),h=r(63),c=r(64),l=r(99),d=r(4),f=r(41),p=r(100),m=r(3),v=["Cassini","Cassini_Soldner","cass"];e.a={init:n,forward:i,inverse:a,names:v}},function(t,e,r){"use strict";function n(){this.sphere||(this.k0=r.i(u.a)(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function i(t){var e,n,i=t.x,a=t.y,u=r.i(o.a)(i-this.long0);if(this.sphere)e=this.x0+this.a*u*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(a)/Math.cos(this.lat_ts);else{var h=r.i(s.a)(this.e,Math.sin(a));e=this.x0+this.a*this.k0*u,n=this.y0+this.a*h*.5/this.k0}return t.x=e,t.y=n,t}function a(t){t.x-=this.x0,t.y-=this.y0;var e,n;return this.sphere?(e=r.i(o.a)(this.long0+t.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(n=r.i(h.a)(this.e,2*t.y*this.k0/this.a),e=r.i(o.a)(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=n,t}var o=r(4),s=r(102),u=r(34),h=r(436),c=["cea"];e.a={init:n,forward:i,inverse:a,names:c}},function(t,e,r){"use strict";function n(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function i(t){var e=t.x,n=t.y,i=r.i(o.a)(e-this.long0),a=r.i(s.a)(n-this.lat0);return t.x=this.x0+this.a*i*this.rc,t.y=this.y0+this.a*a,t}function a(t){var e=t.x,n=t.y;return t.x=r.i(o.a)(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=r.i(s.a)(this.lat0+(n-this.y0)/this.a),t}var o=r(4),s=r(41),u=["Equirectangular","Equidistant_Cylindrical","eqc"];e.a={init:n,forward:i,inverse:a,names:u}},function(t,e,r){"use strict";function n(){Math.abs(this.lat1+this.lat2)<m.a||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=r.i(o.a)(this.es),this.e1=r.i(s.a)(this.es),this.e2=r.i(u.a)(this.es),this.e3=r.i(h.a)(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=r.i(c.a)(this.e,this.sinphi,this.cosphi),this.ml1=r.i(l.a)(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<m.a?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=r.i(c.a)(this.e,this.sinphi,this.cosphi),this.ml2=r.i(l.a)(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=r.i(l.a)(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function i(t){var e,n=t.x,i=t.y;if(this.sphere)e=this.a*(this.g-i);else{var a=r.i(l.a)(this.e0,this.e1,this.e2,this.e3,i);e=this.a*(this.g-a)}var o=this.ns*r.i(d.a)(n-this.long0),s=this.x0+e*Math.sin(o),u=this.y0+this.rh-e*Math.cos(o);return t.x=s,t.y=u,t}function a(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var e,n,i,a;this.ns>=0?(n=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(n=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var o=0;if(0!==n&&(o=Math.atan2(e*t.x,e*t.y)),this.sphere)return a=r.i(d.a)(this.long0+o/this.ns),i=r.i(f.a)(this.g-n/this.a),t.x=a,t.y=i,t;var s=this.g-n/this.a;return i=r.i(p.a)(s,this.e0,this.e1,this.e2,this.e3),a=r.i(d.a)(this.long0+o/this.ns),t.x=a,t.y=i,t}var o=r(61),s=r(62),u=r(63),h=r(64),c=r(34),l=r(65),d=r(4),f=r(41),p=r(100),m=r(3),v=["Equidistant_Conic","eqdc"];e.a={init:n,forward:i,inverse:a,names:v}},function(t,e,r){"use strict";function n(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+s.f)/(Math.pow(Math.tan(.5*this.lat0+s.f),this.C)*r.i(o.a)(this.e*t,this.ratexp))}function i(t){var e=t.x,n=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+s.f),this.C)*r.i(o.a)(this.e*Math.sin(n),this.ratexp))-s.b,t.x=this.C*e,t}function a(t){for(var e=t.x/this.C,n=t.y,i=Math.pow(Math.tan(.5*n+s.f)/this.K,1/this.C),a=u;a>0&&(n=2*Math.atan(i*r.i(o.a)(this.e*Math.sin(t.y),-.5*this.e))-s.b,!(Math.abs(n-t.y)<1e-14));--a)t.y=n;return a?(t.x=e,t.y=n,t):null}var o=r(438),s=r(3),u=20,h=["gauss"];e.a={init:n,forward:i,inverse:a,names:h}},function(t,e,r){"use strict";function n(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function i(t){var e,n,i,a,s,h,c,l,d=t.x,f=t.y;return i=r.i(o.a)(d-this.long0),e=Math.sin(f),n=Math.cos(f),a=Math.cos(i),h=this.sin_p14*e+this.cos_p14*n*a,s=1,h>0||Math.abs(h)<=u.a?(c=this.x0+this.a*s*n*Math.sin(i)/h,l=this.y0+this.a*s*(this.cos_p14*e-this.sin_p14*n*a)/h):(c=this.x0+this.infinity_dist*n*Math.sin(i),l=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*n*a)),t.x=c,t.y=l,t}function a(t){var e,n,i,a,u,h;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(a=Math.atan2(e,this.rc),n=Math.sin(a),i=Math.cos(a),h=r.i(s.a)(i*this.sin_p14+t.y*n*this.cos_p14/e),u=Math.atan2(t.x*n,e*this.cos_p14*i-t.y*this.sin_p14*n),u=r.i(o.a)(this.long0+u)):(h=this.phic0,u=0),t.x=u,t.y=h,t}var o=r(4),s=r(33),u=r(3),h=["gnom"];e.a={init:n,forward:i,inverse:a,names:h}},function(t,e,r){"use strict";function n(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function i(t){var e,n,i,a,s,u,h,c=t.x,l=t.y,d=r.i(o.a)(c-this.long0);return e=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/e)-this.s45),i=-d*this.alfa,a=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),s=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(a)),u=this.n*s,h=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(a/2+this.s45),this.n),t.y=h*Math.cos(u)/1,t.x=h*Math.sin(u)/1,this.czech||(t.y*=-1,t.x*=-1),t}function a(t){var e,r,n,i,a,o,s,u,h=t.x;t.x=t.y,t.y=h,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),a=Math.atan2(t.y,t.x),i=a/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),r=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(e)),t.x=this.long0-r/this.alfa,s=e,u=0;var c=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(s))/(1-this.e*Math.sin(s)),this.e/2))-this.s45),Math.abs(s-t.y)<1e-10&&(u=1),s=t.y,c+=1}while(0===u&&c<15);return c>=15?null:t}var o=r(4),s=["Krovak","krovak"];e.a={init:n,forward:i,inverse:a,names:s}},function(t,e,r){"use strict";function n(){var t=Math.abs(this.lat0);if(Math.abs(t-u.b)<u.a?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<u.a?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var e;switch(this.qp=r.i(h.a)(this.e,1),this.mmf=.5/(1-this.es),this.apa=o(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=r.i(h.a)(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function i(t){var e,n,i,a,o,s,l,d,f,p,m=t.x,v=t.y;if(m=r.i(c.a)(m-this.long0),this.sphere){if(o=Math.sin(v),p=Math.cos(v),i=Math.cos(m),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((n=this.mode===this.EQUIT?1+p*i:1+this.sinph0*o+this.cosph0*p*i)<=u.a)return null;n=Math.sqrt(2/n),e=n*p*Math.sin(m),n*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*p*i}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(v+this.phi0)<u.a)return null;n=u.f-.5*v,n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)),e=n*Math.sin(m),n*=i}}else{switch(l=0,d=0,f=0,i=Math.cos(m),a=Math.sin(m),o=Math.sin(v),s=r.i(h.a)(this.e,o),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(l=s/this.qp,d=Math.sqrt(1-l*l)),this.mode){case this.OBLIQ:f=1+this.sinb1*l+this.cosb1*d*i;break;case this.EQUIT:f=1+d*i;break;case this.N_POLE:f=u.b+v,s=this.qp-s;break;case this.S_POLE:f=v-u.b,s=this.qp+s}if(Math.abs(f)<u.a)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:f=Math.sqrt(2/f),n=this.mode===this.OBLIQ?this.ymf*f*(this.cosb1*l-this.sinb1*d*i):(f=Math.sqrt(2/(1+d*i)))*l*this.ymf,e=this.xmf*f*d*a;break;case this.N_POLE:case this.S_POLE:s>=0?(e=(f=Math.sqrt(s))*a,n=i*(this.mode===this.S_POLE?f:-f)):e=n=0}}return t.x=this.a*e+this.x0,t.y=this.a*n+this.y0,t}function a(t){t.x-=this.x0,t.y-=this.y0;var e,n,i,a,o,h,l,d=t.x/this.a,f=t.y/this.a;if(this.sphere){var p,m=0,v=0;if(p=Math.sqrt(d*d+f*f),(n=.5*p)>1)return null;switch(n=2*Math.asin(n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(v=Math.sin(n),m=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(p)<=u.a?0:Math.asin(f*v/p),d*=v,f=m*p;break;case this.OBLIQ:n=Math.abs(p)<=u.a?this.phi0:Math.asin(m*this.sinph0+f*v*this.cosph0/p),d*=v*this.cosph0,f=(m-Math.sin(n)*this.sinph0)*p;break;case this.N_POLE:f=-f,n=u.b-n;break;case this.S_POLE:n-=u.b}e=0!==f||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(d,f):0}else{if(l=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(d/=this.dd,f*=this.dd,(h=Math.sqrt(d*d+f*f))<u.a)return t.x=0,t.y=this.phi0,t;a=2*Math.asin(.5*h/this.rq),i=Math.cos(a),d*=a=Math.sin(a),this.mode===this.OBLIQ?(l=i*this.sinb1+f*a*this.cosb1/h,o=this.qp*l,f=h*this.cosb1*i-f*this.sinb1*a):(l=f*a/h,o=this.qp*l,f=h*i)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(f=-f),!(o=d*d+f*f))return t.x=0,t.y=this.phi0,t;l=1-o/this.qp,this.mode===this.S_POLE&&(l=-l)}e=Math.atan2(d,f),n=s(Math.asin(l),this.apa)}return t.x=r.i(c.a)(this.long0+e),t.y=n,t}function o(t){var e,r=[];return r[0]=t*l,e=t*t,r[0]+=e*d,r[1]=e*p,e*=t,r[0]+=e*f,r[1]+=e*m,r[2]=e*v,r}function s(t,e){var r=t+t;return t+e[0]*Math.sin(r)+e[1]*Math.sin(r+r)+e[2]*Math.sin(r+r+r)}var u=r(3),h=r(102),c=r(4),l=.3333333333333333,d=.17222222222222222,f=.10257936507936508,p=.06388888888888888,m=.0664021164021164,v=.016415012942191543,g=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];e.a={init:n,forward:i,inverse:a,names:g,S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4}},function(t,e,r){"use strict";function n(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<l.a)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),n=Math.cos(this.lat1),i=r.i(o.a)(this.e,e,n),a=r.i(s.a)(this.e,this.lat1,e),u=Math.sin(this.lat2),h=Math.cos(this.lat2),c=r.i(o.a)(this.e,u,h),d=r.i(s.a)(this.e,this.lat2,u),f=r.i(s.a)(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>l.a?this.ns=Math.log(i/c)/Math.log(a/d):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=i/(this.ns*Math.pow(a,this.ns)),this.rh=this.a*this.f0*Math.pow(f,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function i(t){var e=t.x,n=t.y;Math.abs(2*Math.abs(n)-Math.PI)<=l.a&&(n=r.i(u.a)(n)*(l.b-2*l.a));var i,a,o=Math.abs(Math.abs(n)-l.b);if(o>l.a)i=r.i(s.a)(this.e,n,Math.sin(n)),a=this.a*this.f0*Math.pow(i,this.ns);else{if((o=n*this.ns)<=0)return null;a=0}var c=this.ns*r.i(h.a)(e-this.long0);return t.x=this.k0*(a*Math.sin(c))+this.x0,t.y=this.k0*(this.rh-a*Math.cos(c))+this.y0,t}function a(t){var e,n,i,a,o,s=(t.x-this.x0)/this.k0,u=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(s*s+u*u),n=1):(e=-Math.sqrt(s*s+u*u),n=-1);var d=0;if(0!==e&&(d=Math.atan2(n*s,n*u)),0!==e||this.ns>0){if(n=1/this.ns,i=Math.pow(e/(this.a*this.f0),n),-9999===(a=r.i(c.a)(this.e,i)))return null}else a=-l.b;return o=r.i(h.a)(d/this.ns+this.long0),t.x=o,t.y=a,t}var o=r(34),s=r(67),u=r(42),h=r(4),c=r(66),l=r(3),d=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"];e.a={init:n,forward:i,inverse:a,names:d}},function(t,e,r){"use strict";function n(){}function i(t){return t}var a=["longlat","identity"];e.a={init:n,forward:i,inverse:i,names:a}},function(t,e,r){"use strict";function n(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=r.i(o.a)(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function i(t){var e=t.x,n=t.y;if(n*c.j>90&&n*c.j<-90&&e*c.j>180&&e*c.j<-180)return null;var i,a;if(Math.abs(Math.abs(n)-c.b)<=c.a)return null;if(this.sphere)i=this.x0+this.a*this.k0*r.i(s.a)(e-this.long0),a=this.y0+this.a*this.k0*Math.log(Math.tan(c.f+.5*n));else{var o=Math.sin(n),h=r.i(u.a)(this.e,n,o);i=this.x0+this.a*this.k0*r.i(s.a)(e-this.long0),a=this.y0-this.a*this.k0*Math.log(h)}return t.x=i,t.y=a,t}function a(t){var e,n,i=t.x-this.x0,a=t.y-this.y0;if(this.sphere)n=c.b-2*Math.atan(Math.exp(-a/(this.a*this.k0)));else{var o=Math.exp(-a/(this.a*this.k0));if(-9999===(n=r.i(h.a)(this.e,o)))return null}return e=r.i(s.a)(this.long0+i/(this.a*this.k0)),t.x=e,t.y=n,t}var o=r(34),s=r(4),u=r(67),h=r(66),c=r(3),l=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];e.a={init:n,forward:i,inverse:a,names:l}},function(t,e,r){"use strict";function n(){}function i(t){var e=t.x,n=t.y,i=r.i(o.a)(e-this.long0),a=this.x0+this.a*i,s=this.y0+this.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return t.x=a,t.y=s,t}function a(t){t.x-=this.x0,t.y-=this.y0;var e=r.i(o.a)(this.long0+t.x/this.a),n=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=n,t}var o=r(4),s=["Miller_Cylindrical","mill"];e.a={init:n,forward:i,inverse:a,names:s}},function(t,e,r){"use strict";function n(){}function i(t){for(var e=t.x,n=t.y,i=r.i(o.a)(e-this.long0),a=n,u=Math.PI*Math.sin(n),h=0;!0;h++){var c=-(a+Math.sin(a)-u)/(1+Math.cos(a));if(a+=c,Math.abs(c)<s.a)break}a/=2,Math.PI/2-Math.abs(n)<s.a&&(i=0);var l=.900316316158*this.a*i*Math.cos(a)+this.x0,d=1.4142135623731*this.a*Math.sin(a)+this.y0;return t.x=l,t.y=d,t}function a(t){var e,n;t.x-=this.x0,t.y-=this.y0,n=t.y/(1.4142135623731*this.a),Math.abs(n)>.999999999999&&(n=.999999999999),e=Math.asin(n);var i=r.i(o.a)(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),n=(2*e+Math.sin(2*e))/Math.PI,Math.abs(n)>1&&(n=1);var a=Math.asin(n);return t.x=i,t.y=a,t}var o=r(4),s=r(3),u=["Mollweide","moll"];e.a={init:n,forward:i,inverse:a,names:u}},function(t,e,r){"use strict";function n(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function i(t){var e,r=t.x,n=t.y,i=n-this.lat0,a=r-this.long0,s=i/o.e*1e-5,u=a,h=1,c=0;for(e=1;e<=10;e++)h*=s,c+=this.A[e]*h;var l,d,f=c,p=u,m=1,v=0,g=0,y=0;for(e=1;e<=6;e++)l=m*f-v*p,d=v*f+m*p,m=l,v=d,g=g+this.B_re[e]*m-this.B_im[e]*v,y=y+this.B_im[e]*m+this.B_re[e]*v;return t.x=y*this.a+this.x0,t.y=g*this.a+this.y0,t}function a(t){var e,r,n,i=t.x,a=t.y,s=i-this.x0,u=a-this.y0,h=u/this.a,c=s/this.a,l=1,d=0,f=0,p=0;for(e=1;e<=6;e++)r=l*h-d*c,n=d*h+l*c,l=r,d=n,f=f+this.C_re[e]*l-this.C_im[e]*d,p=p+this.C_im[e]*l+this.C_re[e]*d;for(var m=0;m<this.iterations;m++){var v,g,y=f,x=p,_=h,b=c;for(e=2;e<=6;e++)v=y*f-x*p,g=x*f+y*p,y=v,x=g,_+=(e-1)*(this.B_re[e]*y-this.B_im[e]*x),b+=(e-1)*(this.B_im[e]*y+this.B_re[e]*x);y=1,x=0;var w=this.B_re[1],M=this.B_im[1];for(e=2;e<=6;e++)v=y*f-x*p,g=x*f+y*p,y=v,x=g,w+=e*(this.B_re[e]*y-this.B_im[e]*x),M+=e*(this.B_im[e]*y+this.B_re[e]*x);var E=w*w+M*M;f=(_*w+b*M)/E,p=(b*w-_*M)/E}var T=f,S=p,A=1,L=0;for(e=1;e<=9;e++)A*=T,L+=this.D[e]*A;var P=this.lat0+L*o.e*1e5,R=this.long0+S;return t.x=R,t.y=P,t}var o=r(3),s=["New_Zealand_Map_Grid","nzmg"];e.a={init:n,forward:i,inverse:a,names:s}},function(t,e,r){"use strict";function n(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var t=Math.sin(this.lat0),e=Math.cos(this.lat0),n=this.e*t;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(e,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-n*n);var i=r.i(o.a)(this.e,this.lat0,t),a=this.bl/e*Math.sqrt((1-this.es)/(1-n*n));a*a<1&&(a=1);var u,h;if(isNaN(this.longc)){var c=r.i(o.a)(this.e,this.lat1,Math.sin(this.lat1)),l=r.i(o.a)(this.e,this.lat2,Math.sin(this.lat2));this.lat0>=0?this.el=(a+Math.sqrt(a*a-1))*Math.pow(i,this.bl):this.el=(a-Math.sqrt(a*a-1))*Math.pow(i,this.bl);var d=Math.pow(c,this.bl),f=Math.pow(l,this.bl);u=this.el/d,h=.5*(u-1/u);var p=(this.el*this.el-f*d)/(this.el*this.el+f*d),m=(f-d)/(f+d),v=r.i(s.a)(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(p*Math.tan(.5*this.bl*v)/m)/this.bl,this.long0=r.i(s.a)(this.long0);var g=r.i(s.a)(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*g)/h),this.alpha=Math.asin(a*Math.sin(this.gamma0))}else u=this.lat0>=0?a+Math.sqrt(a*a-1):a-Math.sqrt(a*a-1),this.el=u*Math.pow(i,this.bl),h=.5*(u-1/u),this.gamma0=Math.asin(Math.sin(this.alpha)/a),this.long0=this.longc-Math.asin(h*Math.tan(this.gamma0))/this.bl;this.no_off?this.uc=0:this.lat0>=0?this.uc=this.al/this.bl*Math.atan2(Math.sqrt(a*a-1),Math.cos(this.alpha)):this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(a*a-1),Math.cos(this.alpha))}function i(t){var e,n,i,a=t.x,u=t.y,c=r.i(s.a)(a-this.long0);if(Math.abs(Math.abs(u)-h.b)<=h.a)i=u>0?-1:1,n=this.al/this.bl*Math.log(Math.tan(h.f+i*this.gamma0*.5)),e=-1*i*h.b*this.al/this.bl;else{var l=r.i(o.a)(this.e,u,Math.sin(u)),d=this.el/Math.pow(l,this.bl),f=.5*(d-1/d),p=.5*(d+1/d),m=Math.sin(this.bl*c),v=(f*Math.sin(this.gamma0)-m*Math.cos(this.gamma0))/p;n=Math.abs(Math.abs(v)-1)<=h.a?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-v)/(1+v))/this.bl,e=Math.abs(Math.cos(this.bl*c))<=h.a?this.al*this.bl*c:this.al*Math.atan2(f*Math.cos(this.gamma0)+m*Math.sin(this.gamma0),Math.cos(this.bl*c))/this.bl}return this.no_rot?(t.x=this.x0+e,t.y=this.y0+n):(e-=this.uc,t.x=this.x0+n*Math.cos(this.alpha)+e*Math.sin(this.alpha),t.y=this.y0+e*Math.cos(this.alpha)-n*Math.sin(this.alpha)),t}function a(t){var e,n;this.no_rot?(n=t.y-this.y0,e=t.x-this.x0):(n=(t.x-this.x0)*Math.cos(this.alpha)-(t.y-this.y0)*Math.sin(this.alpha),e=(t.y-this.y0)*Math.cos(this.alpha)+(t.x-this.x0)*Math.sin(this.alpha),e+=this.uc);var i=Math.exp(-1*this.bl*n/this.al),a=.5*(i-1/i),o=.5*(i+1/i),c=Math.sin(this.bl*e/this.al),l=(c*Math.cos(this.gamma0)+a*Math.sin(this.gamma0))/o,d=Math.pow(this.el/Math.sqrt((1+l)/(1-l)),1/this.bl);return Math.abs(l-1)<h.a?(t.x=this.long0,t.y=h.b):Math.abs(l+1)<h.a?(t.x=this.long0,t.y=-1*h.b):(t.y=r.i(u.a)(this.e,d),t.x=r.i(s.a)(this.long0-Math.atan2(a*Math.cos(this.gamma0)-c*Math.sin(this.gamma0),Math.cos(this.bl*e/this.al))/this.bl)),t}var o=r(67),s=r(4),u=r(66),h=r(3),c=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"];e.a={init:n,forward:i,inverse:a,names:c}},function(t,e,r){"use strict";function n(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function i(t){var e,n,i,a,s,h,c,l,d=t.x,f=t.y;return i=r.i(o.a)(d-this.long0),e=Math.sin(f),n=Math.cos(f),a=Math.cos(i),h=this.sin_p14*e+this.cos_p14*n*a,s=1,(h>0||Math.abs(h)<=u.a)&&(c=this.a*s*n*Math.sin(i),l=this.y0+this.a*s*(this.cos_p14*e-this.sin_p14*n*a)),t.x=c,t.y=l,t}function a(t){var e,n,i,a,h,c,l;return t.x-=this.x0,t.y-=this.y0,e=Math.sqrt(t.x*t.x+t.y*t.y),n=r.i(s.a)(e/this.a),i=Math.sin(n),a=Math.cos(n),c=this.long0,Math.abs(e)<=u.a?(l=this.lat0,t.x=c,t.y=l,t):(l=r.i(s.a)(a*this.sin_p14+t.y*i*this.cos_p14/e),h=Math.abs(this.lat0)-u.b,Math.abs(h)<=u.a?(c=this.lat0>=0?r.i(o.a)(this.long0+Math.atan2(t.x,-t.y)):r.i(o.a)(this.long0-Math.atan2(-t.x,t.y)),t.x=c,t.y=l,t):(c=r.i(o.a)(this.long0+Math.atan2(t.x*i,e*this.cos_p14*a-t.y*this.sin_p14*i)),t.x=c,t.y=l,t))}var o=r(4),s=r(33),u=r(3),h=["ortho"];e.a={init:n,forward:i,inverse:a,names:h}},function(t,e,r){"use strict";function n(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=r.i(o.a)(this.es),this.e1=r.i(s.a)(this.es),this.e2=r.i(u.a)(this.es),this.e3=r.i(h.a)(this.es),this.ml0=this.a*r.i(d.a)(this.e0,this.e1,this.e2,this.e3,this.lat0)}function i(t){var e,n,i,a=t.x,o=t.y,s=r.i(c.a)(a-this.long0);if(i=s*Math.sin(o),this.sphere)Math.abs(o)<=f.a?(e=this.a*s,n=-1*this.a*this.lat0):(e=this.a*Math.sin(i)/Math.tan(o),n=this.a*(r.i(l.a)(o-this.lat0)+(1-Math.cos(i))/Math.tan(o)));else if(Math.abs(o)<=f.a)e=this.a*s,n=-1*this.ml0;else{var u=r.i(p.a)(this.a,this.e,Math.sin(o))/Math.tan(o);e=u*Math.sin(i),n=this.a*r.i(d.a)(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+u*(1-Math.cos(i))}return t.x=e+this.x0,t.y=n+this.y0,t}function a(t){var e,n,i,a,o,s,u,h,l;if(i=t.x-this.x0,a=t.y-this.y0,this.sphere)if(Math.abs(a+this.a*this.lat0)<=f.a)e=r.i(c.a)(i/this.a+this.long0),n=0;else{s=this.lat0+a/this.a,u=i*i/this.a/this.a+s*s,h=s;var p;for(o=m;o;--o)if(p=Math.tan(h),l=-1*(s*(h*p+1)-h-.5*(h*h+u)*p)/((h-s)/p-1),h+=l,Math.abs(l)<=f.a){n=h;break}e=r.i(c.a)(this.long0+Math.asin(i*Math.tan(h)/this.a)/Math.sin(n))}else if(Math.abs(a+this.ml0)<=f.a)n=0,e=r.i(c.a)(this.long0+i/this.a);else{s=(this.ml0+a)/this.a,u=i*i/this.a/this.a+s*s,h=s;var v,g,y,x,_;for(o=m;o;--o)if(_=this.e*Math.sin(h),v=Math.sqrt(1-_*_)*Math.tan(h),g=this.a*r.i(d.a)(this.e0,this.e1,this.e2,this.e3,h),y=this.e0-2*this.e1*Math.cos(2*h)+4*this.e2*Math.cos(4*h)-6*this.e3*Math.cos(6*h),x=g/this.a,l=(s*(v*x+1)-x-.5*v*(x*x+u))/(this.es*Math.sin(2*h)*(x*x+u-2*s*x)/(4*v)+(s-x)*(v*y-2/Math.sin(2*h))-y),h-=l,Math.abs(l)<=f.a){n=h;break}v=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),e=r.i(c.a)(this.long0+Math.asin(i*v/this.a)/Math.sin(n))}return t.x=e,t.y=n,t}var o=r(61),s=r(62),u=r(63),h=r(64),c=r(4),l=r(41),d=r(65),f=r(3),p=r(99),m=20,v=["Polyconic","poly"];e.a={init:n,forward:i,inverse:a,names:v}},function(t,e,r){"use strict";function n(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=r.i(u.a)(this.es)}function i(t){var e,n,i=t.x,a=t.y;if(i=r.i(o.a)(i-this.long0),this.sphere){if(this.m)for(var s=this.n*Math.sin(a),u=f;u;--u){var c=(this.m*a+Math.sin(a)-s)/(this.m+Math.cos(a));if(a-=c,Math.abs(c)<l.a)break}else a=1!==this.n?Math.asin(this.n*Math.sin(a)):a;e=this.a*this.C_x*i*(this.m+Math.cos(a)),n=this.a*this.C_y*a}else{var d=Math.sin(a),p=Math.cos(a);n=this.a*r.i(h.a)(a,d,p,this.en),e=this.a*i*p/Math.sqrt(1-this.es*d*d)}return t.x=e,t.y=n,t}function a(t){var e,n,i,a;return t.x-=this.x0,i=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,i/=this.C_x*(this.m+Math.cos(e)),this.m?e=r.i(d.a)((this.m*e+Math.sin(e))/this.n):1!==this.n&&(e=r.i(d.a)(Math.sin(e)/this.n)),i=r.i(o.a)(i+this.long0),e=r.i(s.a)(e)):(e=r.i(c.a)(t.y/this.a,this.es,this.en),a=Math.abs(e),a<l.b?(a=Math.sin(e),n=this.long0+t.x*Math.sqrt(1-this.es*a*a)/(this.a*Math.cos(e)),i=r.i(o.a)(n)):a-l.a<l.b&&(i=this.long0)),t.x=i,t.y=e,t}var o=r(4),s=r(41),u=r(254),h=r(101),c=r(255),l=r(3),d=r(33),f=20,p=["Sinusoidal","sinu"];e.a={init:n,forward:i,inverse:a,names:p}},function(t,e,r){"use strict";function n(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),r=this.a,n=this.rf,i=1/n,a=2*i-Math.pow(i,2),o=this.e=Math.sqrt(a);this.R=this.k0*r*Math.sqrt(1-a)/(1-a*Math.pow(e,2)),this.alpha=Math.sqrt(1+a/(1-a)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var s=Math.log(Math.tan(Math.PI/4+this.b0/2)),u=Math.log(Math.tan(Math.PI/4+t/2)),h=Math.log((1+o*e)/(1-o*e));this.K=s-this.alpha*u+this.alpha*o/2*h}function i(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),n=-this.alpha*(e+r)+this.K,i=2*(Math.atan(Math.exp(n))-Math.PI/4),a=this.alpha*(t.x-this.lambda0),o=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(a))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(a));return t.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,t.x=this.R*o+this.x0,t}function a(t){for(var e=t.x-this.x0,r=t.y-this.y0,n=e/this.R,i=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(n)),o=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+o/this.alpha,u=0,h=a,c=-1e3,l=0;Math.abs(h-c)>1e-7;){if(++l>20)return;u=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(h))/2)),c=h,h=2*Math.atan(Math.exp(u))-Math.PI/2}return t.x=s,t.y=h,t}var o=["somerc"];e.a={init:n,forward:i,inverse:a,names:o}},function(t,e,r){"use strict";function n(t,e,r){return e*=r,Math.tan(.5*(s.b+t))*Math.pow((1-e)/(1+e),.5*r)}function i(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=s.a&&(this.k0=.5*(1+r.i(u.a)(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=s.a&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=s.a&&(this.k0=.5*this.cons*r.i(h.a)(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/r.i(c.a)(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=r.i(h.a)(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-s.b,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function a(t){var e,n,i,a,o,u,h=t.x,l=t.y,f=Math.sin(l),p=Math.cos(l),m=r.i(d.a)(h-this.long0);return Math.abs(Math.abs(h-this.long0)-Math.PI)<=s.a&&Math.abs(l+this.lat0)<=s.a?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*f+this.coslat0*p*Math.cos(m)),t.x=this.a*e*p*Math.sin(m)+this.x0,t.y=this.a*e*(this.coslat0*f-this.sinlat0*p*Math.cos(m))+this.y0,t):(n=2*Math.atan(this.ssfn_(l,f,this.e))-s.b,a=Math.cos(n),i=Math.sin(n),Math.abs(this.coslat0)<=s.a?(o=r.i(c.a)(this.e,l*this.con,this.con*f),u=2*this.a*this.k0*o/this.cons,t.x=this.x0+u*Math.sin(h-this.long0),t.y=this.y0-this.con*u*Math.cos(h-this.long0),t):(Math.abs(this.sinlat0)<s.a?(e=2*this.a*this.k0/(1+a*Math.cos(m)),t.y=e*i):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*i+this.cosX0*a*Math.cos(m))),t.y=e*(this.cosX0*i-this.sinX0*a*Math.cos(m))+this.y0),t.x=e*a*Math.sin(m)+this.x0,t))}function o(t){t.x-=this.x0,t.y-=this.y0;var e,n,i,a,o,u=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var h=2*Math.atan(u/(.5*this.a*this.k0));return e=this.long0,(n=this.lat0,u<=s.a)?(t.x=e,t.y=n,t):(n=Math.asin(Math.cos(h)*this.sinlat0+t.y*Math.sin(h)*this.coslat0/u),e=Math.abs(this.coslat0)<s.a?this.lat0>0?r.i(d.a)(this.long0+Math.atan2(t.x,-1*t.y)):r.i(d.a)(this.long0+Math.atan2(t.x,t.y)):r.i(d.a)(this.long0+Math.atan2(t.x*Math.sin(h),u*this.coslat0*Math.cos(h)-t.y*this.sinlat0*Math.sin(h))),t.x=e,t.y=n,t)}if(Math.abs(this.coslat0)<=s.a){if(u<=s.a)return n=this.lat0,e=this.long0,t.x=e,t.y=n,t;t.x*=this.con,t.y*=this.con,i=u*this.cons/(2*this.a*this.k0),n=this.con*r.i(l.a)(this.e,i),e=this.con*r.i(d.a)(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else a=2*Math.atan(u*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,u<=s.a?o=this.X0:(o=Math.asin(Math.cos(a)*this.sinX0+t.y*Math.sin(a)*this.cosX0/u),e=r.i(d.a)(this.long0+Math.atan2(t.x*Math.sin(a),u*this.cosX0*Math.cos(a)-t.y*this.sinX0*Math.sin(a)))),n=-1*r.i(l.a)(this.e,Math.tan(.5*(s.b+o)));return t.x=e,t.y=n,t}var s=r(3),u=r(42),h=r(34),c=r(67),l=r(66),d=r(4),f=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"];e.a={init:i,forward:a,inverse:o,names:f,ssfn_:n}},function(t,e,r){"use strict";function n(){o.a.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function i(t){var e,n,i,a;return t.x=r.i(s.a)(t.x-this.long0),o.a.forward.apply(this,[t]),e=Math.sin(t.y),n=Math.cos(t.y),i=Math.cos(t.x),a=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*n*i),t.x=a*n*Math.sin(t.x),t.y=a*(this.cosc0*e-this.sinc0*n*i),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function a(t){var e,n,i,a,u;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,u=Math.sqrt(t.x*t.x+t.y*t.y)){var h=2*Math.atan2(u,this.R2);e=Math.sin(h),n=Math.cos(h),a=Math.asin(n*this.sinc0+t.y*e*this.cosc0/u),i=Math.atan2(t.x*e,u*this.cosc0*n-t.y*this.sinc0*e)}else a=this.phic0,i=0;return t.x=i,t.y=a,o.a.inverse.apply(this,[t]),t.x=r.i(s.a)(t.x+this.long0),t}var o=r(458),s=r(4),u=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative"];e.a={init:n,forward:i,inverse:a,names:u}},function(t,e,r){"use strict";function n(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=r.i(o.a)(this.es),this.ml0=r.i(s.a)(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function i(t){var e,n,i,a=t.x,o=t.y,u=r.i(h.a)(a-this.long0),l=Math.sin(o),d=Math.cos(o);if(this.es){var f=d*u,p=Math.pow(f,2),m=this.ep2*Math.pow(d,2),v=Math.pow(m,2),g=Math.abs(d)>c.a?Math.tan(o):0,y=Math.pow(g,2),x=Math.pow(y,2);e=1-this.es*Math.pow(l,2),f/=Math.sqrt(e);var _=r.i(s.a)(o,l,d,this.en);n=this.a*(this.k0*f*(1+p/6*(1-y+m+p/20*(5-18*y+x+14*m-58*y*m+p/42*(61+179*x-x*y-479*y)))))+this.x0,i=this.a*(this.k0*(_-this.ml0+l*u*f/2*(1+p/12*(5-y+9*m+4*v+p/30*(61+x-58*y+270*m-330*y*m+p/56*(1385+543*x-x*y-3111*y))))))+this.y0}else{var b=d*Math.sin(u);if(Math.abs(Math.abs(b)-1)<c.a)return 93;if(n=.5*this.a*this.k0*Math.log((1+b)/(1-b))+this.x0,i=d*Math.cos(u)/Math.sqrt(1-Math.pow(b,2)),(b=Math.abs(i))>=1){if(b-1>c.a)return 93;i=0}else i=Math.acos(i);o<0&&(i=-i),i=this.a*this.k0*(i-this.lat0)+this.y0}return t.x=n,t.y=i,t}function a(t){var e,n,i,a,o=(t.x-this.x0)*(1/this.a),s=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+s/this.k0,n=r.i(u.a)(e,this.es,this.en),Math.abs(n)<c.b){var d=Math.sin(n),f=Math.cos(n),p=Math.abs(f)>c.a?Math.tan(n):0,m=this.ep2*Math.pow(f,2),v=Math.pow(m,2),g=Math.pow(p,2),y=Math.pow(g,2);e=1-this.es*Math.pow(d,2);var x=o*Math.sqrt(e)/this.k0,_=Math.pow(x,2);e*=p,i=n-e*_/(1-this.es)*.5*(1-_/12*(5+3*g-9*m*g+m-4*v-_/30*(61+90*g-252*m*g+45*y+46*m-_/56*(1385+3633*g+4095*y+1574*y*g)))),a=r.i(h.a)(this.long0+x*(1-_/6*(1+2*g+m-_/20*(5+28*g+24*y+8*m*g+6*m-_/42*(61+662*g+1320*y+720*y*g))))/f)}else i=c.b*r.i(l.a)(s),a=0;else{var b=Math.exp(o/this.k0),w=.5*(b-1/b),M=this.lat0+s/this.k0,E=Math.cos(M);e=Math.sqrt((1-Math.pow(E,2))/(1+Math.pow(w,2))),i=Math.asin(e),s<0&&(i=-i),a=0===w&&0===E?0:r.i(h.a)(Math.atan2(w,E)+this.long0)}return t.x=a,t.y=i,t}var o=r(254),s=r(101),u=r(255),h=r(4),c=r(3),l=r(42),d=["Transverse_Mercator","Transverse Mercator","tmerc"];e.a={init:n,forward:i,inverse:a,names:d}},function(t,e,r){"use strict";function n(){var t=r.i(i.a)(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*o.g,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,a.a.init.apply(this),this.forward=a.a.forward,this.inverse=a.a.inverse}var i=r(430),a=r(261),o=r(3),s=["Universal Transverse Mercator System","utm"];e.a={init:n,names:s,dependsOn:"etmerc"}},function(t,e,r){"use strict";function n(){this.R=this.a}function i(t){var e,n,i=t.x,a=t.y,h=r.i(o.a)(i-this.long0);Math.abs(a)<=s.a&&(e=this.x0+this.R*h,n=this.y0);var c=r.i(u.a)(2*Math.abs(a/Math.PI));(Math.abs(h)<=s.a||Math.abs(Math.abs(a)-s.b)<=s.a)&&(e=this.x0,n=a>=0?this.y0+Math.PI*this.R*Math.tan(.5*c):this.y0+Math.PI*this.R*-Math.tan(.5*c));var l=.5*Math.abs(Math.PI/h-h/Math.PI),d=l*l,f=Math.sin(c),p=Math.cos(c),m=p/(f+p-1),v=m*m,g=m*(2/f-1),y=g*g,x=Math.PI*this.R*(l*(m-y)+Math.sqrt(d*(m-y)*(m-y)-(y+d)*(v-y)))/(y+d);h<0&&(x=-x),e=this.x0+x;var _=d+m;return x=Math.PI*this.R*(g*_-l*Math.sqrt((y+d)*(d+1)-_*_))/(y+d),n=a>=0?this.y0+x:this.y0-x,t.x=e,t.y=n,t}function a(t){var e,n,i,a,u,h,c,l,d,f,p,m,v;return t.x-=this.x0,t.y-=this.y0,p=Math.PI*this.R,i=t.x/p,a=t.y/p,u=i*i+a*a,h=-Math.abs(a)*(1+u),c=h-2*a*a+i*i,l=-2*h+1+2*a*a+u*u,v=a*a/l+(2*c*c*c/l/l/l-9*h*c/l/l)/27,d=(h-c*c/3/l)/l,f=2*Math.sqrt(-d/3),p=3*v/d/f,Math.abs(p)>1&&(p=p>=0?1:-1),m=Math.acos(p)/3,n=t.y>=0?(-f*Math.cos(m+Math.PI/3)-c/3/l)*Math.PI:-(-f*Math.cos(m+Math.PI/3)-c/3/l)*Math.PI,e=Math.abs(i)<s.a?this.long0:r.i(o.a)(this.long0+Math.PI*(u-1+Math.sqrt(1+2*(i*i-a*a)+u*u))/2/i),t.x=e,t.y=n,t}var o=r(4),s=r(3),u=r(33),h=["Van_der_Grinten_I","VanDerGrinten","vandg"];e.a={init:n,forward:i,inverse:a,names:h}},function(t,e,r){"use strict";var n=r(479);r.n(n);r.o(n,"version")&&r.d(e,"a",function(){return n.version})},function(t,e){t.exports={_args:[[{raw:"proj4@^2.4.3",scope:null,escapedName:"proj4",name:"proj4",rawSpec:"^2.4.3",spec:">=2.4.3 <3.0.0",type:"range"},"/home/augustin/workspace/itowns"]],_from:"proj4@>=2.4.3 <3.0.0",_id:"[email protected]",_inCache:!0,_location:"/proj4",_nodeVersion:"6.9.2",_npmOperationalInternal:{host:"packages-18-east.internal.npmjs.com",tmp:"tmp/proj4-2.4.3.tgz_1488570790416_0.3068596587982029"},_npmUser:{name:"cwmma",email:"[email protected]"},_npmVersion:"4.0.5",_phantomChildren:{},_requested:{raw:"proj4@^2.4.3",scope:null,escapedName:"proj4",name:"proj4",rawSpec:"^2.4.3",spec:">=2.4.3 <3.0.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/proj4/-/proj4-2.4.3.tgz",_shasum:"f3bb7e631bffc047c36a1a3cc14533a03bbe9969",_shrinkwrap:null,_spec:"proj4@^2.4.3",_where:"/home/augustin/workspace/itowns",author:"",bugs:{url:"https://github.com/proj4js/proj4js/issues"},contributors:[{name:"Mike Adair",email:"[email protected]"},{name:"Richard Greenwood",email:"[email protected]"},{name:"Calvin Metcalf",email:"[email protected]"},{name:"Richard Marsden",url:"http://www.winwaed.com"},{name:"T. Mittan"},{name:"D. Steinwand"},{name:"S. Nelson"}],dependencies:{mgrs:"1.0.0","wkt-parser":"^1.1.3"},description:"Proj4js is a JavaScript library to transform point coordinates from one coordinate system to another, including datum transformations.",devDependencies:{chai:"~1.8.1",curl:"git://github.com/cujojs/curl.git",grunt:"~0.4.2","grunt-cli":"~0.1.13","grunt-contrib-connect":"~0.6.0","grunt-contrib-jshint":"~1.1.0","grunt-contrib-uglify":"~0.11.1","grunt-mocha-phantomjs":"~0.4.0","grunt-rollup":"^1.0.1",istanbul:"~0.2.4",mocha:"~1.17.1",rollup:"^0.41.4","rollup-plugin-json":"^2.0.1","rollup-plugin-node-resolve":"^2.0.0",tin:"~0.4.0"},directories:{test:"test",doc:"docs"},dist:{shasum:"f3bb7e631bffc047c36a1a3cc14533a03bbe9969",tarball:"https://registry.npmjs.org/proj4/-/proj4-2.4.3.tgz"},gitHead:"e975a5462ad7abb23e33ea75281eb749e77e1510",homepage:"https://github.com/proj4js/proj4js#readme",license:"MIT",main:"dist/proj4-src.js",maintainers:[{name:"cwmma",email:"[email protected]"},{name:"ahocevar",email:"[email protected]"}],module:"lib/index.js",name:"proj4",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/proj4js/proj4js.git"},scripts:{build:"grunt","build:tmerc":"grunt build:tmerc",test:"npm run build && istanbul test _mocha test/test.js"},version:"2.4.3"}},function(t,e,r){"use strict";var n=r(475),i=r(261),a=r(476),o=r(474),s=r(473),u=r(472),h=r(468),c=r(462),l=r(460),d=r(454),f=r(461),p=r(452),m=r(459),v=r(455),g=r(456),y=r(470),x=r(467),_=r(465),b=r(471),w=r(466),M=r(457),E=r(477),T=r(453),S=r(469);e.a=function(t){t.Proj.projections.add(n.a),t.Proj.projections.add(i.a),t.Proj.projections.add(a.a),t.Proj.projections.add(o.a),t.Proj.projections.add(s.a),t.Proj.projections.add(u.a),t.Proj.projections.add(h.a),t.Proj.projections.add(c.a),t.Proj.projections.add(l.a),t.Proj.projections.add(d.a),t.Proj.projections.add(f.a),t.Proj.projections.add(p.a),t.Proj.projections.add(m.a),t.Proj.projections.add(v.a),t.Proj.projections.add(g.a),t.Proj.projections.add(y.a),t.Proj.projections.add(x.a),t.Proj.projections.add(_.a),t.Proj.projections.add(b.a),t.Proj.projections.add(w.a),t.Proj.projections.add(M.a),t.Proj.projections.add(E.a),t.Proj.projections.add(T.a),t.Proj.projections.add(S.a)}},function(t,e){t.exports="#include <logdepthbuf_pars_fragment>\n\nuniform int atmoIN;\nvarying float intensity;\n\nvec4 glowColor = vec4(0.45, 0.74, 1. ,1.0);\n\nvoid main()\n{\n #include <logdepthbuf_fragment>\n gl_FragColor = glowColor * intensity;\n}\n\n"},function(t,e){t.exports="#include <logdepthbuf_pars_vertex>\n#define EPSILON 1e-6\n\nuniform int atmoIN;\nvarying float intensity;\n\nvoid main()\n{\n vec3 normalES = normalize( normalMatrix * normal );\n vec3 normalCAMES = normalize( normalMatrix * cameraPosition );\n\n if(atmoIN == 0) {\n intensity = pow(0.666 - dot(normalES, normalCAMES), 4. );\n } else {\n intensity = pow( 1. - dot(normalES, normalCAMES), 0.8 );\n }\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n #include <logdepthbuf_vertex>\n}\n\n\n"},function(t,e){t.exports="varying vec3 c0;\nvarying vec3 c1;\n\nvoid main (void) {\n\tgl_FragColor = vec4(c1, 1.0 - c0/4.);\n}"},function(t,e){t.exports="uniform vec3 v3LightPosition; // The direction vector to the light source\nuniform vec3 v3InvWavelength; // 1 / pow(wavelength, 4) for the red, green, and blue channels\nuniform float fCameraHeight; // The camera's current height\nuniform float fCameraHeight2; // fCameraHeight^2\nuniform float fOuterRadius; // The outer (atmosphere) radius\nuniform float fOuterRadius2; // fOuterRadius^2\nuniform float fInnerRadius; // The inner (planetary) radius\nuniform float fInnerRadius2; // fInnerRadius^2\nuniform float fKrESun; // Kr * ESun\nuniform float fKmESun; // Km * ESun\nuniform float fKr4PI; // Kr * 4 * PI\nuniform float fKm4PI; // Km * 4 * PI\nuniform float fScale; // 1 / (fOuterRadius - fInnerRadius)\nuniform float fScaleDepth; // The scale depth (i.e. the altitude at which the atmosphere's average density is found)\nuniform float fScaleOverScaleDepth; // fScale / fScaleDepth\n\nvarying vec3 c0;\nvarying vec3 c1;\n\nconst int nSamples = 3;\nconst float fSamples = 3.0;\n\nfloat scale(float fCos)\n{\n float x = 1.0 - fCos;\n return fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\n\nvoid main(void) {\n\n float cameraHeight2 = length(cameraPosition) * length(cameraPosition);\n\n // Get the ray from the camera to the vertex and its length (which is the far point of the ray passing through the atmosphere)\n vec3 v3Ray = position - cameraPosition;\n float fFar = length(v3Ray);\n v3Ray /= fFar;\n\n // Calculate the closest intersection of the ray with the outer atmosphere (which is the near point of the ray passing through the atmosphere)\n float B = 2.0 * dot(cameraPosition, v3Ray);\n float C = cameraHeight2 - fOuterRadius2;\n float fDet = max(0.0, B*B - 4.0 * C);\n float fNear = 0.5 * (-B - sqrt(fDet));\n\n // Calculate the ray's starting position, then calculate its scattering offset\n vec3 v3Start = cameraPosition + v3Ray * fNear;\n fFar -= fNear;\n float fDepth = exp((fInnerRadius - fOuterRadius) / fScaleDepth);\n float fCameraAngle = dot(-v3Ray, position) / length(position);\n float fLightAngle = dot(v3LightPosition, position) / length(position);\n float fCameraScale = scale(fCameraAngle);\n float fLightScale = scale(fLightAngle);\n float fCameraOffset = fDepth*fCameraScale;\n float fTemp = (fLightScale + fCameraScale);\n\n // Initialize the scattering loop variables\n float fSampleLength = fFar / fSamples;\n float fScaledLength = fSampleLength * fScale;\n vec3 v3SampleRay = v3Ray * fSampleLength;\n vec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\n\n // Now loop through the sample rays\n vec3 v3FrontColor = vec3(0.0, 0.0, 0.0);\n vec3 v3Attenuate = vec3(0.0, 0.0, 0.0);\n for(int i=0; i<nSamples; i++)\n {\n float fHeight = length(v3SamplePoint);\n float fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\n float fScatter = fDepth*fTemp - fCameraOffset;\n v3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\n v3FrontColor += v3Attenuate * (fDepth * fScaledLength);\n v3SamplePoint += v3SampleRay;\n }\n\n // Calculate the attenuation factor for the ground\n c0 = v3Attenuate;\n c1 = v3FrontColor * (v3InvWavelength * fKrESun + fKmESun);\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}"},function(t,e){t.exports="uniform vec3 v3LightPos;\nuniform float g;\nuniform float g2;\n\nvarying vec3 v3Direction;\nvarying vec3 c0;\nvarying vec3 c1;\n\n// Calculates the Mie phase function\nfloat getMiePhase(float fCos, float fCos2, float g, float g2) {\n return 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + fCos2) / pow(1.0 + g2 - 2.0 * g * fCos, 1.5);\n}\n\n// Calculates the Rayleigh phase function\nfloat getRayleighPhase(float fCos2) {\n return 0.75 + 0.75 * fCos2;\n}\n\nvoid main (void) {\n float fCos = dot(v3LightPos, v3Direction) / length(v3Direction);\n float fCos2 = fCos * fCos;\n\n vec3 color = getRayleighPhase(fCos2) * c0 + getMiePhase(fCos, fCos2, g, g2) * c1;\n\n gl_FragColor = vec4(color, 1.0);\n gl_FragColor.a = gl_FragColor.b;\n}"},function(t,e){t.exports="uniform vec3 v3LightPosition; // The direction vector to the light source\nuniform vec3 v3InvWavelength; // 1 / pow(wavelength, 4) for the red, green, and blue channels\nuniform float fCameraHeight; // The camera's current height\nuniform float fCameraHeight2; // fCameraHeight^2\nuniform float fOuterRadius; // The outer (atmosphere) radius\nuniform float fOuterRadius2; // fOuterRadius^2\nuniform float fInnerRadius; // The inner (planetary) radius\nuniform float fInnerRadius2; // fInnerRadius^2\nuniform float fKrESun; // Kr * ESun\nuniform float fKmESun; // Km * ESun\nuniform float fKr4PI; // Kr * 4 * PI\nuniform float fKm4PI; // Km * 4 * PI\nuniform float fScale; // 1 / (fOuterRadius - fInnerRadius)\nuniform float fScaleDepth; // The scale depth (i.e. the altitude at which the atmosphere's average density is found)\nuniform float fScaleOverScaleDepth; // fScale / fScaleDepth\n\nconst int nSamples = 3;\nconst float fSamples = 3.0;\n\nvarying vec3 v3Direction;\nvarying vec3 c0;\nvarying vec3 c1;\n\nfloat scale(float fCos) {\n float x = 1.0 - fCos;\n return fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\n\nvoid main(void) {\n float lengthCamera = length(cameraPosition);\n float cameraHeight2 = lengthCamera * lengthCamera;\n\n // Get the ray from the camera to the vertex and its length (which is the far point of the ray passing through the atmosphere)\n vec3 v3Ray = position - cameraPosition;\n float fFar = length(v3Ray);\n v3Ray /= fFar;\n\n // Calculate the closest intersection of the ray with the outer atmosphere (which is the near point of the ray passing through the atmosphere)\n float B = 2.0 * dot(cameraPosition, v3Ray);\n float C = cameraHeight2 - fOuterRadius2;\n float fDet = max(0.0, B*B - 4.0 * C);\n float fNear = 0.5 * (-B - sqrt(fDet));\n\n // Calculate the ray's starting position, then calculate its scattering offset\n vec3 v3Start = cameraPosition + v3Ray * fNear;\n fFar -= fNear;\n float fStartAngle = dot(v3Ray, v3Start) / fOuterRadius;\n float fStartDepth = exp(-1.0 / fScaleDepth);\n float fStartOffset = fStartDepth * scale(fStartAngle);\n\n // Initialize the scattering loop variables\n float fSampleLength = fFar / fSamples;\n float fScaledLength = fSampleLength * fScale;\n vec3 v3SampleRay = v3Ray * fSampleLength;\n vec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\n\n // Now loop through the sample rays\n vec3 v3FrontColor = vec3(0.0, 0.0, 0.0);\n for(int i=0; i<nSamples; i++)\n {\n float fHeight = length(v3SamplePoint);\n float fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\n float fLightAngle = dot(v3LightPosition, v3SamplePoint) / fHeight;\n float fCameraAngle = dot(v3Ray, v3SamplePoint) / fHeight;\n float fScatter = (fStartOffset + fDepth * (scale(fLightAngle) - scale(fCameraAngle)));\n vec3 v3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\n\n v3FrontColor += v3Attenuate * (fDepth * fScaledLength);\n v3SamplePoint += v3SampleRay;\n }\n\n // Finally, scale the Mie and Rayleigh colors and set up the varying variables for the pixel shader\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n c0 = v3FrontColor * (v3InvWavelength * fKrESun);\n c1 = v3FrontColor * fKmESun;\n v3Direction = cameraPosition - position;\n}"},function(t,e){t.exports="vec2 pitUV(vec2 uvIn, vec3 pit)\n{\n vec2 uv;\n uv.x = uvIn.x* pit.z + pit.x;\n uv.y = 1.0 -( (1.0 - uvIn.y) * pit.z + pit.y);\n\n return uv;\n}\n\n"},function(t,e){t.exports="precision highp float;\nprecision highp int;\n\n#include <logdepthbuf_pars_fragment>\n\nvarying vec4 vColor;\nuniform bool pickingMode;\n\n#ifdef DEBUG\nuniform bool useDebugColor;\nuniform vec3 debugColor;\n#endif\n\nvoid main() {\n // circular point rendering\n float u = 2.0 * gl_PointCoord.x - 1.0;\n float v = 2.0 * gl_PointCoord.y - 1.0;\n float cc = u*u + v*v;\n if(cc > 1.0){\n discard;\n }\n\n gl_FragColor = vColor;\n#ifdef DEBUG\n if (useDebugColor && !pickingMode) {\n gl_FragColor = mix(vColor, vec4(debugColor, 1.0), 0.5);\n }\n#endif\n\n #include <logdepthbuf_fragment>\n}\n"},function(t,e){t.exports="precision highp float;\nprecision highp int;\n\n#include <logdepthbuf_pars_vertex>\n#define EPSILON 1e-6\n\nuniform float size;\nuniform float scale;\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\nuniform vec2 resolution;\nuniform bool pickingMode;\nuniform float density; // points per on screen pixels\n\nattribute vec4 unique_id;\nattribute vec3 color;\nattribute vec3 position;\n\nvarying vec4 vColor;\n\nvoid main() {\n if (pickingMode) {\n vColor = unique_id;\n } else {\n vColor = vec4(color, 1.0);\n }\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n mat4 projModelViewMatrix = projectionMatrix * modelViewMatrix;\n gl_Position = projModelViewMatrix* vec4( position, 1.0);\n\n if (size > 0.01) {\n gl_PointSize = size;\n } else {\n float pointSize = 1.0;\n float slope = tan(1.0 / 2.0);\n float projFactor = -0.5 * resolution.y / (slope * mvPosition.z);\n\n float z = min(0.5 * -gl_Position.z / gl_Position.w, 1.0);\n gl_PointSize = max(3.0, min(10.0, 0.05 * projFactor));\n }\n\n #include <logdepthbuf_vertex>\n}\n"},function(t,e){t.exports="#include <logdepthbuf_pars_fragment>\n\n// BUG CHROME 50 UBUNTU 16.04\n// Lose context on compiling shader with too many IF STATEMENT\n// runconformance/glsl/bugs/conditional-discard-in-loop.html\n// conformance/glsl/bugs/nested-loops-with-break-and-continue.html\n// Resolve CHROME unstable 52\n\nconst vec4 CFog = vec4( 0.76, 0.85, 1.0, 1.0);\nconst vec4 CWhite = vec4(1.0,1.0,1.0,1.0);\nconst vec4 COrange = vec4( 1.0, 0.3, 0.0, 1.0);\nconst vec4 CRed = vec4( 1.0, 0.0, 0.0, 1.0);\n\n\nuniform sampler2D dTextures_01[TEX_UNITS];\nuniform vec3 offsetScale_L01[TEX_UNITS];\n\n// offset texture | Projection | fx | Opacity\nuniform vec4 paramLayers[8];\nuniform int loadedTexturesCount[8];\nuniform bool visibility[8];\n\nuniform float distanceFog;\nuniform int colorLayersCount;\nuniform vec3 lightPosition;\n\nuniform vec3 noTextureColor;\n\n// Options global\nuniform bool selected;\nuniform bool lightingEnabled;\n\nvarying vec2 vUv_WGS84;\nvarying float vUv_PM;\nvarying vec3 vNormal;\n\n#if defined(DEBUG)\n uniform bool showOutline;\n const float sLine = 0.008;\n#endif\n\n#if defined(MATTE_ID_MODE) || defined(DEPTH_MODE)\n#include <packing>\nuniform int uuid;\n#endif\n\nvoid main() {\n #include <logdepthbuf_fragment>\n\n #if defined(MATTE_ID_MODE)\n gl_FragColor = packDepthToRGBA(float(uuid) / (256.0 * 256.0 * 256.0));\n #elif defined(DEPTH_MODE)\n #if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n float z = gl_FragDepthEXT ;\n #else\n float z = gl_FragCoord.z;\n #endif\n gl_FragColor = packDepthToRGBA(z);\n #else\n\n\n #if defined(DEBUG)\n if (showOutline && (vUv_WGS84.x < sLine || vUv_WGS84.x > 1.0 - sLine || vUv_WGS84.y < sLine || vUv_WGS84.y > 1.0 - sLine))\n gl_FragColor = CRed;\n else\n #endif\n {\n // Reconstruct PM uv and PM subtexture id (see TileGeometry)\n vec2 uvPM ;\n uvPM.x = vUv_WGS84.x;\n float y = vUv_PM;\n int pmSubTextureIndex = int(floor(y));\n uvPM.y = y - float(pmSubTextureIndex);\n\n #if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n float depth = gl_FragDepthEXT / gl_FragCoord.w;\n float fogIntensity = 1.0/(exp(depth/distanceFog));\n #else\n float fogIntensity = 1.0;\n #endif\n\n vec4 diffuseColor = CWhite;\n bool validTexture = false;\n\n // TODO Optimisation des uv1 peuvent copier pas lignes!!\n for (int layer = 0; layer < 8; layer++) {\n if(layer == colorLayersCount) {\n break;\n }\n\n if(visibility[layer]) {\n vec4 paramsA = paramLayers[layer];\n\n if(paramsA.w > 0.0) {\n bool projWGS84 = paramsA.y == 0.0;\n int textureIndex = int(paramsA.x) + (projWGS84 ? 0 : pmSubTextureIndex);\n\n /* if (0 <= textureIndex && textureIndex < loadedTexturesCount[1]) */ {\n\n // TODO: Try other OS before delete dead\n // get value in array, the index must be constant\n // Strangely it's work with function returning a global variable, doesn't work on Chrome Windows\n // vec4 layerColor = texture2D(dTextures_01[getTextureIndex()], pitUV(projWGS84 ? vUv_WGS84 : uvPM,pitScale_L01[getTextureIndex()]));\n vec4 layerColor = colorAtIdUv(\n dTextures_01,\n offsetScale_L01,\n textureIndex,\n projWGS84 ? vUv_WGS84 : uvPM);\n\n if (layerColor.a > 0.0) {\n validTexture = true;\n float lum = 1.0;\n\n if(paramsA.z > 0.0) {\n float a = max(0.05,1.0 - length(layerColor.xyz-CWhite.xyz));\n if(paramsA.z > 2.0) {\n a = (layerColor.r + layerColor.g + layerColor.b)*0.333333333;\n layerColor*= layerColor*layerColor;\n }\n lum = 1.0-pow(abs(a),paramsA.z);\n }\n\n diffuseColor = mix( diffuseColor,layerColor, lum*paramsA.w * layerColor.a);\n\n }\n }\n }\n }\n }\n\n // No texture color\n if (!validTexture) {\n diffuseColor.rgb = noTextureColor;\n }\n\n // Selected\n if(selected) {\n diffuseColor = mix(COrange, diffuseColor, 0.5 );\n }\n\n // Fog\n gl_FragColor = mix(CFog, diffuseColor, fogIntensity);\n gl_FragColor.a = 1.0;\n\n if(lightingEnabled) { // Add lighting\n float light = min(2. * dot(vNormal, lightPosition),1.);\n gl_FragColor.rgb *= light;\n }\n }\n #endif\n}\n"},function(t,e){t.exports="#include <logdepthbuf_pars_vertex>\n#define EPSILON 1e-6\n\nconst float PI = 3.14159265359;\nconst float INV_TWO_PI = 1.0 / (2.0*PI);\nconst float PI4 = 0.78539816339;\n\nattribute float uv_pm;\nattribute vec2 uv_wgs84;\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform sampler2D dTextures_00[1];\nuniform vec3 offsetScale_L00[1];\nuniform int loadedTexturesCount[8];\n\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n\nvarying vec2 vUv_WGS84;\nvarying float vUv_PM;\nvarying vec3 vNormal;\nvarying vec4 pos;\n\nhighp float decode32(highp vec4 rgba) {\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n}\n\nvoid main() {\n\n vUv_WGS84 = uv_wgs84;\n vUv_PM = uv_pm;\n\n vec4 vPosition;\n\n vNormal = normal;\n\n if(loadedTexturesCount[0] > 0) {\n vec2 vVv = vec2(\n vUv_WGS84.x * offsetScale_L00[0].z + offsetScale_L00[0].x,\n (1.0 - vUv_WGS84.y) * offsetScale_L00[0].z + offsetScale_L00[0].y);\n\n #if defined(RGBA_TEXTURE_ELEVATION)\n vec4 rgba = texture2D( dTextures_00[0], vVv ) * 255.0;\n\n rgba.rgba = rgba.abgr;\n\n float dv = max(decode32(rgba),0.0);\n\n // TODO In RGBA elevation texture LinearFilter give some errors with nodata value.\n // need to rewrite sample function in shader\n // simple solution\n if(dv>5000.0) {\n dv = 0.0;\n }\n\n #elif defined(DATA_TEXTURE_ELEVATION)\n float dv = max(texture2D( dTextures_00[0], vVv ).w, 0.);\n #elif defined(COLOR_TEXTURE_ELEVATION)\n float dv = max(texture2D( dTextures_00[0], vVv ).r, 0.);\n dv = _minElevation + dv * (_maxElevation - _minElevation);\n #else\n\n #error Must define either RGBA_TEXTURE_ELEVATION, DATA_TEXTURE_ELEVATION or COLOR_TEXTURE_ELEVATION\n #endif\n\n vPosition = vec4( position + vNormal * dv ,1.0 );\n } else {\n vPosition = vec4( position ,1.0 );\n }\n\n gl_Position = projectionMatrix * modelViewMatrix * vPosition;\n #include <logdepthbuf_vertex>\n}\n"},,function(t,e,r){"use strict";function n(t,e){for(var r=new Array(t.length-1),n=1;n<t.length;++n)for(var i=r[n-1]=new Array(t.length-1),a=0,o=0;a<t.length;++a)a!==e&&(i[o++]=t[n][a]);return r}function i(t){for(var e=new Array(t),r=0;r<t;++r){e[r]=new Array(t);for(var n=0;n<t;++n)e[r][n]=["m",n,"[",t-r-1,"]"].join("")}return e}function a(t){return 1&t?"-":""}function o(t){if(1===t.length)return t[0];if(2===t.length)return["sum(",t[0],",",t[1],")"].join("");var e=t.length>>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r<t.length;++r)e.push(["scale(",o(s(n(t,r))),",",a(r),t[0][r],")"].join(""));return e}function u(t){for(var e=[],r=[],a=i(t),u=[],h=0;h<t;++h)0==(1&h)?e.push.apply(e,s(n(a,h))):r.push.apply(r,s(n(a,h))),u.push("m"+h);var p=o(e),m=o(r),v="orientation"+t+"Exact",g=["function ",v,"(",u.join(),"){var p=",p,",n=",m,",d=sub(p,n);return d[d.length-1];};return ",v].join("");return new Function("sum","prod","scale","sub",g)(l,c,d,f)}function h(t){var e=g[t.length];return e||(e=g[t.length]=u(t.length)),e.apply(void 0,t)}var c=r(264),l=r(496),d=r(494),f=r(495),p=5,m=u(3),v=u(4),g=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,r){var n,i=(t[1]-r[1])*(e[0]-r[0]),a=(t[0]-r[0])*(e[1]-r[1]),o=i-a;if(i>0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=3.3306690738754716e-16*n;return o>=s||o<=-s?o:m(t,e,r)},function(t,e,r,n){var i=t[0]-n[0],a=e[0]-n[0],o=r[0]-n[0],s=t[1]-n[1],u=e[1]-n[1],h=r[1]-n[1],c=t[2]-n[2],l=e[2]-n[2],d=r[2]-n[2],f=a*h,p=o*u,m=o*s,g=i*h,y=i*u,x=a*s,_=c*(f-p)+l*(m-g)+d*(y-x),b=(Math.abs(f)+Math.abs(p))*Math.abs(c)+(Math.abs(m)+Math.abs(g))*Math.abs(l)+(Math.abs(y)+Math.abs(x))*Math.abs(d),w=7.771561172376103e-16*b;return _>w||-_>w?_:v(t,e,r,n)}];!function(){for(;g.length<=p;)g.push(u(g.length));for(var e=[],r=["slow"],n=0;n<=p;++n)e.push("a"+n),r.push("o"+n);for(var i=["function getOrientation(",e.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;n<=p;++n)i.push("case ",n,":return o",n,"(",e.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i<arguments.length;++i){s[i]=arguments[i]};return slow(s);}return getOrientation"),r.push(i.join(""));var a=Function.apply(void 0,r);t.exports=a.apply(void 0,[h].concat(g));for(var n=0;n<=p;++n)t.exports[n]=g[n]}()},function(t,e,r){"use strict";function n(t,e){var r=t.length;if(1===r){var n=i(t[0],e);return n[0]?n:[n[1]]}var o=new Array(2*r),s=[.1,.1],u=[.1,.1],h=0;i(t[0],e,s),s[0]&&(o[h++]=s[0]);for(var c=1;c<r;++c){i(t[c],e,u);var l=s[1];a(l,u[0],s),s[0]&&(o[h++]=s[0]);var d=u[1],f=s[1],p=d+f,m=p-d,v=f-m;s[1]=p,v&&(o[h++]=v)}return s[1]&&(o[h++]=s[1]),0===h&&(o[h++]=0),o.length=h,o}var i=r(264),a=r(500);t.exports=n},function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],-e[0]);var a,o,s=r+i,u=new Array(s),h=0,c=0,l=0,d=Math.abs,f=t[c],p=d(f),m=-e[l],v=d(m);p<v?(o=f,(c+=1)<r&&(f=t[c],p=d(f))):(o=m,(l+=1)<i&&(m=-e[l],v=d(m))),c<r&&p<v||l>=i?(a=f,(c+=1)<r&&(f=t[c],p=d(f))):(a=m,(l+=1)<i&&(m=-e[l],v=d(m)));for(var g,y,x,_,b,w=a+o,M=w-a,E=o-M,T=E,S=w;c<r&&l<i;)p<v?(a=f,(c+=1)<r&&(f=t[c],p=d(f))):(a=m,(l+=1)<i&&(m=-e[l],v=d(m))),o=T,w=a+o,M=w-a,E=o-M,E&&(u[h++]=E),g=S+w,y=g-S,x=g-y,_=w-y,b=S-x,T=b+_,S=g;for(;c<r;)a=f,o=T,w=a+o,M=w-a,E=o-M,E&&(u[h++]=E),g=S+w,y=g-S,x=g-y,_=w-y,b=S-x,T=b+_,S=g,(c+=1)<r&&(f=t[c]);for(;l<i;)a=m,o=T,w=a+o,M=w-a,E=o-M,E&&(u[h++]=E),g=S+w,y=g-S,x=g-y,_=w-y,b=S-x,T=b+_,S=g,(l+=1)<i&&(m=-e[l]);return T&&(u[h++]=T),S&&(u[h++]=S),h||(u[h++]=0),u.length=h,u}t.exports=i},function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],e[0]);var a,o,s=r+i,u=new Array(s),h=0,c=0,l=0,d=Math.abs,f=t[c],p=d(f),m=e[l],v=d(m);p<v?(o=f,(c+=1)<r&&(f=t[c],p=d(f))):(o=m,(l+=1)<i&&(m=e[l],v=d(m))),c<r&&p<v||l>=i?(a=f,(c+=1)<r&&(f=t[c],p=d(f))):(a=m,(l+=1)<i&&(m=e[l],v=d(m)));for(var g,y,x,_,b,w=a+o,M=w-a,E=o-M,T=E,S=w;c<r&&l<i;)p<v?(a=f,(c+=1)<r&&(f=t[c],p=d(f))):(a=m,(l+=1)<i&&(m=e[l],v=d(m))),o=T,w=a+o,M=w-a,E=o-M,E&&(u[h++]=E),g=S+w,y=g-S,x=g-y,_=w-y,b=S-x,T=b+_,S=g;for(;c<r;)a=f,o=T,w=a+o,M=w-a,E=o-M,E&&(u[h++]=E),g=S+w,y=g-S,x=g-y,_=w-y,b=S-x,T=b+_,S=g,(c+=1)<r&&(f=t[c]);for(;l<i;)a=m,o=T,w=a+o,M=w-a,E=o-M,E&&(u[h++]=E),g=S+w,y=g-S,x=g-y,_=w-y,b=S-x,T=b+_,S=g,(l+=1)<i&&(m=e[l]);return T&&(u[h++]=T),S&&(u[h++]=S),h||(u[h++]=0),u.length=h,u}t.exports=i},function(t,e,r){"use strict";function n(t,e,r){return e<=t&&t<=r}function i(t){if(void 0===t)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function a(t){for(var e=String(t),r=e.length,n=0,i=[];n<r;){var a=e.charCodeAt(n);if(a<55296||a>57343)i.push(a);else if(56320<=a&&a<=57343)i.push(65533);else if(55296<=a&&a<=56319)if(n===r-1)i.push(65533);else{var o=t.charCodeAt(n+1);if(56320<=o&&o<=57343){var s=1023&a,u=1023&o;i.push(65536+(s<<10)+u),n+=1}else i.push(65533)}n+=1}return i}function o(t){for(var e="",r=0;r<t.length;++r){var n=t[r];n<=65535?e+=String.fromCharCode(n):(n-=65536,e+=String.fromCharCode(55296+(n>>10),56320+(1023&n)))}return e}function s(t){this.tokens=[].slice.call(t)}function u(t,e){if(t)throw TypeError("Decoder error");return e||65533}function h(t,e){if(!(this instanceof h))return new h(t,e);if((t=void 0!==t?String(t).toLowerCase():m)!==m)throw new Error("Encoding not supported. Only utf-8 is supported");e=i(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(e.fatal),this._ignoreBOM=Boolean(e.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function c(t,e){if(!(this instanceof c))return new c(t,e);if((t=void 0!==t?String(t).toLowerCase():m)!==m)throw new Error("Encoding not supported. Only utf-8 is supported");e=i(e),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(e.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}function l(t){var e=t.fatal,r=0,i=0,a=0,o=128,s=191;this.handler=function(t,h){if(h===f&&0!==a)return a=0,u(e);if(h===f)return p;if(0===a){if(n(h,0,127))return h;if(n(h,194,223))a=1,r=h-192;else if(n(h,224,239))224===h&&(o=160),237===h&&(s=159),a=2,r=h-224;else{if(!n(h,240,244))return u(e);240===h&&(o=144),244===h&&(s=143),a=3,r=h-240}return r<<=6*a,null}if(!n(h,o,s))return r=a=i=0,o=128,s=191,t.prepend(h),u(e);if(o=128,s=191,i+=1,r+=h-128<<6*(a-i),i!==a)return null;var c=r;return r=a=i=0,c}}function d(t){t.fatal;this.handler=function(t,e){if(e===f)return p;if(n(e,0,127))return e;var r,i;n(e,128,2047)?(r=1,i=192):n(e,2048,65535)?(r=2,i=224):n(e,65536,1114111)&&(r=3,i=240);for(var a=[(e>>6*r)+i];r>0;){var o=e>>6*(r-1);a.push(128|63&o),r-=1}return a}}var f=-1;s.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():f},prepend:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(t)},push:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.push(e.shift());else this.tokens.push(t)}};var p=-1,m="utf-8";h.prototype={decode:function(t,e){var r;r="object"==typeof t&&t instanceof ArrayBuffer?new Uint8Array(t):"object"==typeof t&&"buffer"in t&&t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e=i(e),this._streaming||(this._decoder=new l({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(e.stream);for(var n,a=new s(r),u=[];!a.endOfStream()&&(n=this._decoder.handler(a,a.read()))!==p;)null!==n&&(Array.isArray(n)?u.push.apply(u,n):u.push(n));if(!this._streaming){do{if((n=this._decoder.handler(a,a.read()))===p)break;null!==n&&(Array.isArray(n)?u.push.apply(u,n):u.push(n))}while(!a.endOfStream());this._decoder=null}return u.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===u[0]?(this._BOMseen=!0,u.shift()):this._BOMseen=!0)),o(u)}},c.prototype={encode:function(t,e){t=t?String(t):"",e=i(e),this._streaming||(this._encoder=new d(this._options)),this._streaming=Boolean(e.stream);for(var r,n=[],o=new s(a(t));!o.endOfStream()&&(r=this._encoder.handler(o,o.read()))!==p;)Array.isArray(r)?n.push.apply(n,r):n.push(r);if(!this._streaming){for(;;){if((r=this._encoder.handler(o,o.read()))===p)break;Array.isArray(r)?n.push.apply(n,r):n.push(r)}this._encoder=null}return new Uint8Array(n)}},e.TextEncoder=c,e.TextDecoder=h},function(t,e,r){(function(){"use strict";function n(){this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this.geometry=new s.BufferGeometry,this.widthCallback=null}function i(t,e,r,n,i){var a;if(t=t.subarray||t.slice?t:t.buffer,r=r.subarray||r.slice?r:r.buffer,t=e?t.subarray?t.subarray(e,i&&e+i):t.slice(e,i&&e+i):t,r.set)r.set(t,n);else for(a=0;a<t.length;a++)r[a+n]=t[a];return r}function a(t){function e(t,e){return void 0===t?e:t}var r=["precision highp float;","","attribute vec3 position;","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute vec2 uv;","attribute float counters;","","uniform mat4 projectionMatrix;","uniform mat4 modelViewMatrix;","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float near;","uniform float far;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;","\t vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;","\t float pixelWidthRatio = 1. / (resolution.x * projectionMatrix[0][0]);",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );","","\t float pixelWidth = finalPosition.w * pixelWidthRatio;"," float w = 1.8 * pixelWidth * lineWidth * width;",""," if( sizeAttenuation == 1. ) {"," w = 1.8 * lineWidth * width;"," }",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec2 normal = vec2( -dir.y, dir.x );"," normal.x /= aspect;"," normal *= .5 * w;",""," vec4 offset = vec4( normal * side, 0.0, 1.0 );"," finalPosition.xy += offset.xy;",""," gl_Position = finalPosition;","","}"],n=["#extension GL_OES_standard_derivatives : enable","precision mediump float;","","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform vec2 dashArray;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {",""," vec4 c = vColor;"," if( useMap == 1. ) c *= texture2D( map, vUV * repeat );"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;","\t if( c.a < alphaTest ) discard;","\t if( useDash == 1. ){","\t \t ","\t }"," gl_FragColor = c;","\t gl_FragColor.a *= step(vCounters,visibility);","}"];s.Material.call(this),t=t||{},this.lineWidth=e(t.lineWidth,1),this.map=e(t.map,null),this.useMap=e(t.useMap,0),this.alphaMap=e(t.alphaMap,null),this.useAlphaMap=e(t.useAlphaMap,0),this.color=e(t.color,new s.Color(16777215)),this.opacity=e(t.opacity,1),this.resolution=e(t.resolution,new s.Vector2(1,1)),this.sizeAttenuation=e(t.sizeAttenuation,1),this.near=e(t.near,1),this.far=e(t.far,1),this.dashArray=e(t.dashArray,[]),this.useDash=this.dashArray!==[]?1:0,this.visibility=e(t.visibility,1),this.alphaTest=e(t.alphaTest,0),this.repeat=e(t.repeat,new s.Vector2(1,1));var i=new s.RawShaderMaterial({uniforms:{lineWidth:{type:"f",value:this.lineWidth},map:{type:"t",value:this.map},useMap:{type:"f",value:this.useMap},alphaMap:{type:"t",value:this.alphaMap},useAlphaMap:{type:"f",value:this.useAlphaMap},color:{type:"c",value:this.color},opacity:{type:"f",value:this.opacity},resolution:{type:"v2",value:this.resolution},sizeAttenuation:{type:"f",value:this.sizeAttenuation},near:{type:"f",value:this.near},far:{type:"f",value:this.far},dashArray:{type:"v2",value:new s.Vector2(this.dashArray[0],this.dashArray[1])},useDash:{type:"f",value:this.useDash},visibility:{type:"f",value:this.visibility},alphaTest:{type:"f",value:this.alphaTest},repeat:{type:"v2",value:this.repeat}},vertexShader:r.join("\r\n"),fragmentShader:n.join("\r\n")});return delete t.lineWidth,delete t.map,delete t.useMap,delete t.alphaMap,delete t.useAlphaMap,delete t.color,delete t.opacity,delete t.resolution,delete t.sizeAttenuation,delete t.near,delete t.far,delete t.dashArray,delete t.visibility,delete t.alphaTest,delete t.repeat,i.type="MeshLineMaterial",i.setValues(t),i}var o=this,s=o.THREE||r(1);if(!s)throw new Error("EquirectangularToCubemap requires three.js");n.prototype.setGeometry=function(t,e){if(this.widthCallback=e,this.positions=[],this.counters=[],t instanceof s.Geometry)for(var r=0;r<t.vertices.length;r++){var n=t.vertices[r],e=r/t.vertices.length;this.positions.push(n.x,n.y,n.z),this.positions.push(n.x,n.y,n.z),this.counters.push(e),this.counters.push(e)}if(s.BufferGeometry,t instanceof Float32Array||t instanceof Array)for(var r=0;r<t.length;r+=3){var e=r/t.length;this.positions.push(t[r],t[r+1],t[r+2]),this.positions.push(t[r],t[r+1],t[r+2]),this.counters.push(e),this.counters.push(e)}this.process()},n.prototype.compareV3=function(t,e){var r=6*t,n=6*e;return this.positions[r]===this.positions[n]&&this.positions[r+1]===this.positions[n+1]&&this.positions[r+2]===this.positions[n+2]},n.prototype.copyV3=function(t){var e=6*t;return[this.positions[e],this.positions[e+1],this.positions[e+2]]},n.prototype.process=function(){var t=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];for(var e=0;e<t;e++)this.side.push(1),this.side.push(-1);for(var r,e=0;e<t;e++)r=this.widthCallback?this.widthCallback(e/(t-1)):1,this.width.push(r),this.width.push(r);for(var e=0;e<t;e++)this.uvs.push(e/(t-1),0),this.uvs.push(e/(t-1),1);var n;n=this.compareV3(0,t-1)?this.copyV3(t-2):this.copyV3(0),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);for(var e=0;e<t-1;e++)n=this.copyV3(e),this.previous.push(n[0],n[1],n[2]),this.previous.push(n[0],n[1],n[2]);for(var e=1;e<t;e++)n=this.copyV3(e),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]);n=this.compareV3(t-1,0)?this.copyV3(1):this.copyV3(t-1),this.next.push(n[0],n[1],n[2]),this.next.push(n[0],n[1],n[2]);for(var e=0;e<t-1;e++){var i=2*e;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}this.attributes?(this.attributes.position.copyArray(new Float32Array(this.positions)),this.attributes.position.needsUpdate=!0,this.attributes.previous.copyArray(new Float32Array(this.previous)),this.attributes.previous.needsUpdate=!0,this.attributes.next.copyArray(new Float32Array(this.next)),this.attributes.next.needsUpdate=!0,this.attributes.side.copyArray(new Float32Array(this.side)),this.attributes.side.needsUpdate=!0,this.attributes.width.copyArray(new Float32Array(this.width)),this.attributes.width.needsUpdate=!0,this.attributes.uv.copyArray(new Float32Array(this.uvs)),this.attributes.uv.needsUpdate=!0,this.attributes.index.copyArray(new Uint16Array(this.indices_array)),this.attributes.index.needsUpdate=!0):this.attributes={position:new s.BufferAttribute(new Float32Array(this.positions),3),previous:new s.BufferAttribute(new Float32Array(this.previous),3),next:new s.BufferAttribute(new Float32Array(this.next),3),side:new s.BufferAttribute(new Float32Array(this.side),1),width:new s.BufferAttribute(new Float32Array(this.width),1),uv:new s.BufferAttribute(new Float32Array(this.uvs),2),index:new s.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new s.BufferAttribute(new Float32Array(this.counters),1)},this.geometry.addAttribute("position",this.attributes.position),this.geometry.addAttribute("previous",this.attributes.previous),this.geometry.addAttribute("next",this.attributes.next),this.geometry.addAttribute("side",this.attributes.side),this.geometry.addAttribute("width",this.attributes.width),this.geometry.addAttribute("uv",this.attributes.uv),this.geometry.addAttribute("counters",this.attributes.counters),this.geometry.setIndex(this.attributes.index)},n.prototype.advance=function(t){var e=this.attributes.position.array,r=this.attributes.previous.array,n=this.attributes.next.array,a=e.length;i(e,0,r,0,a),i(e,6,e,0,a-6),e[a-6]=t.x,e[a-5]=t.y,e[a-4]=t.z,e[a-3]=t.x,e[a-2]=t.y,e[a-1]=t.z,i(e,6,n,0,a-6),n[a-6]=t.x,n[a-5]=t.y,n[a-4]=t.z,n[a-3]=t.x,n[a-2]=t.y,n[a-1]=t.z,this.attributes.position.needsUpdate=!0,this.attributes.previous.needsUpdate=!0,this.attributes.next.needsUpdate=!0},a.prototype=Object.create(s.Material.prototype),a.prototype.constructor=a,a.prototype.copy=function(t){return s.Material.prototype.copy.call(this,t),this.lineWidth=t.lineWidth,this.map=t.map,this.useMap=t.useMap,this.alphaMap=t.alphaMap,this.useAlphaMap=t.useAlphaMap,this.color.copy(t.color),this.opacity=t.opacity,this.resolution.copy(t.resolution),this.sizeAttenuation=t.sizeAttenuation,this.near=t.near,this.far=t.far,this.dashArray.copy(t.dashArray),this.useDash=t.useDash,this.visibility=t.visibility,this.alphaTest=t.alphaTest,this.repeat.copy(t.repeat),this},void 0!==t&&t.exports&&(e=t.exports={MeshLine:n,MeshLineMaterial:a}),e.MeshLine=n,e.MeshLineMaterial=a}).call(this)},function(t,e,r){(function(n){var i=function(){"use strict";function t(t){if(!t||!t.length)return 0;for(var e=0,r=0;e<t.length;e++)r=(r<<5)-r+t.charCodeAt(e)|0;return r}function i(t,e){return t.getElementsByTagName(e)}function a(t,e){return t.getAttribute(e)}function o(t,e){return parseFloat(a(t,e))}function s(t,e){var r=i(t,e);return r.length?r[0]:null}function u(t){return t.normalize&&t.normalize(),t}function h(t){for(var e=0,r=[];e<t.length;e++)r[e]=parseFloat(t[e]);return r}function c(t){return t&&u(t),t&&t.textContent||""}function l(t,e){var r,n,i={};for(n=0;n<e.length;n++)(r=s(t,e[n]))&&(i[e[n]]=c(r));return i}function d(t,e){for(var r in e)t[r]=e[r]}function f(t){return h(t.replace(x,"").split(","))}function p(t){for(var e=t.replace(_,"").split(b),r=[],n=0;n<e.length;n++)r.push(f(e[n]));return r}function m(t){var e,r=[o(t,"lon"),o(t,"lat")],n=s(t,"ele"),i=s(t,"gpxtpx:hr")||s(t,"hr"),a=s(t,"time");return n&&(e=parseFloat(c(n)),isNaN(e)||r.push(e)),{coordinates:r,time:a?c(a):null,heartRate:i?parseFloat(c(i)):null}}function v(){return{type:"FeatureCollection",features:[]}}function g(t){return void 0!==t.xml?t.xml:y.serializeToString(t)}var y,x=/\s*/g,_=/^\s*|\s*$/g,b=/\s+/;return"undefined"!=typeof XMLSerializer?y=new XMLSerializer:"object"!=typeof e||"object"!=typeof n||n.browser||(y=new(r(505).XMLSerializer)),{kml:function(e){function r(t){var e,r;return t=t||"","#"===t.substr(0,1)&&(t=t.substr(1)),6!==t.length&&3!==t.length||(e=t),8===t.length&&(r=parseInt(t.substr(0,2),16)/255,e="#"+t.substr(6,2)+t.substr(4,2)+t.substr(2,2)),[e,isNaN(r)?void 0:r]}function n(t){return h(t.split(" "))}function o(t){var e=i(t,"coord","gx"),r=[],a=[];0===e.length&&(e=i(t,"gx:coord"));for(var o=0;o<e.length;o++)r.push(n(c(e[o])));for(var s=i(t,"when"),u=0;u<s.length;u++)a.push(c(s[u]));return{coords:r,times:a}}function u(t){var e,r,n,a,h,l=[],d=[];if(s(t,"MultiGeometry"))return u(s(t,"MultiGeometry"));if(s(t,"MultiTrack"))return u(s(t,"MultiTrack"));if(s(t,"gx:MultiTrack"))return u(s(t,"gx:MultiTrack"));for(n=0;n<x.length;n++)if(r=i(t,x[n]))for(a=0;a<r.length;a++)if(e=r[a],"Point"===x[n])l.push({type:"Point",coordinates:f(c(s(e,"coordinates")))});else if("LineString"===x[n])l.push({type:"LineString",coordinates:p(c(s(e,"coordinates")))});else if("Polygon"===x[n]){var m=i(e,"LinearRing"),v=[];for(h=0;h<m.length;h++)v.push(p(c(s(m[h],"coordinates"))));l.push({type:"Polygon",coordinates:v})}else if("Track"===x[n]||"gx:Track"===x[n]){var g=o(e);l.push({type:"LineString",coordinates:g.coords}),g.times.length&&d.push(g.times)}return{geoms:l,coordTimes:d}}for(var l=v(),d={},m={},y={},x=["Polygon","LineString","Point","Track","gx:Track"],_=i(e,"Placemark"),b=i(e,"Style"),w=i(e,"StyleMap"),M=0;M<b.length;M++){var E=t(g(b[M])).toString(16);d["#"+a(b[M],"id")]=E,m[E]=b[M]}for(var T=0;T<w.length;T++){d["#"+a(w[T],"id")]=t(g(w[T])).toString(16);for(var S=i(w[T],"Pair"),A={},L=0;L<S.length;L++)A[c(s(S[L],"key"))]=c(s(S[L],"styleUrl"));y["#"+a(w[T],"id")]=A}for(var P=0;P<_.length;P++)l.features=l.features.concat(function(t){var e,n=u(t),o={},h=c(s(t,"name")),l=c(s(t,"styleUrl")),f=c(s(t,"description")),p=s(t,"TimeSpan"),v=s(t,"TimeStamp"),g=s(t,"ExtendedData"),x=s(t,"LineStyle"),_=s(t,"PolyStyle"),b=s(t,"visibility");if(!n.geoms.length)return[];if(h&&(o.name=h),l){"#"!==l[0]&&(l="#"+l),o.styleUrl=l,d[l]&&(o.styleHash=d[l]),y[l]&&(o.styleMapHash=y[l],o.styleHash=d[y[l].normal]);var w=m[o.styleHash];w&&(x||(x=s(w,"LineStyle")),_||(_=s(w,"PolyStyle")))}if(f&&(o.description=f),p){var M=c(s(p,"begin")),E=c(s(p,"end"));o.timespan={begin:M,end:E}}if(v&&(o.timestamp=c(s(v,"when"))),x){var T=r(c(s(x,"color"))),S=T[0],A=T[1],L=parseFloat(c(s(x,"width")));S&&(o.stroke=S),isNaN(A)||(o["stroke-opacity"]=A),isNaN(L)||(o["stroke-width"]=L)}if(_){var P=r(c(s(_,"color"))),R=P[0],C=P[1],O=c(s(_,"fill")),I=c(s(_,"outline"));R&&(o.fill=R),isNaN(C)||(o["fill-opacity"]=C),O&&(o["fill-opacity"]="1"===O?o["fill-opacity"]||1:0),I&&(o["stroke-opacity"]="1"===I?o["stroke-opacity"]||1:0)}if(g){var D=i(g,"Data"),N=i(g,"SimpleData");for(e=0;e<D.length;e++)o[D[e].getAttribute("name")]=c(s(D[e],"value"));for(e=0;e<N.length;e++)o[N[e].getAttribute("name")]=c(N[e])}b&&(o.visibility=c(b)),n.coordTimes.length&&(o.coordTimes=1===n.coordTimes.length?n.coordTimes[0]:n.coordTimes);var U={type:"Feature",geometry:1===n.geoms.length?n.geoms[0]:{type:"GeometryCollection",geometries:n.geoms},properties:o};return a(t,"id")&&(U.id=a(t,"id")),[U]}(_[P]));return l},gpx:function(t){function e(t,e){var r=i(t,e),n=[],a=[],o=[],s=r.length;if(s<2)return{};for(var u=0;u<s;u++){var h=m(r[u]);n.push(h.coordinates),h.time&&a.push(h.time),h.heartRate&&o.push(h.heartRate)}return{line:n,times:a,heartRates:o}}function r(t){var e,r;e=l(t,["name","cmt","desc","time","keywords"]),r=i(t,"link"),r.length&&(e.links=[]);for(var n,o=0;o<r.length;o++)n={href:a(r[o],"href")},d(n,l(r[o],["text","type"])),e.links.push(n);return e}var n,o,s=i(t,"trk"),u=i(t,"rte"),h=i(t,"wpt"),c=v();for(n=0;n<s.length;n++)(o=function(t){for(var n,a=i(t,"trkseg"),o=[],s=[],u=[],h=0;h<a.length;h++)(n=e(a[h],"trkpt"))&&(n.line&&o.push(n.line),n.times&&n.times.length&&s.push(n.times),n.heartRates&&n.heartRates.length&&u.push(n.heartRates));if(0!==o.length){var c=r(t);return s.length&&(c.coordTimes=1===o.length?s[0]:s),u.length&&(c.heartRates=1===o.length?u[0]:u),{type:"Feature",properties:c,geometry:{type:1===o.length?"LineString":"MultiLineString",coordinates:1===o.length?o[0]:o}}}}(s[n]))&&c.features.push(o);for(n=0;n<u.length;n++)(o=function(t){var n=e(t,"rtept");if(n.line){return{type:"Feature",properties:r(t),geometry:{type:"LineString",coordinates:n.line}}}}(u[n]))&&c.features.push(o);for(n=0;n<h.length;n++)c.features.push(function(t){var e=r(t);return d(e,l(t,["sym","type"])),{type:"Feature",properties:e,geometry:{type:"Point",coordinates:m(t).coordinates}}}(h[n]));return c}}}();t.exports=i}).call(e,r(252))},function(t,e,r){"use strict";function n(t,e,r){var n=t+e,i=n-t,a=n-i,o=e-i,s=t-a;return r?(r[0]=s+o,r[1]=n,r):[s+o,n]}t.exports=n},,function(t,e,r){"use strict";function n(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=a}function i(t){return new n(t).output()}e.a=i;var a=1,o=/\s/,s=/[A-Za-z]/,u=/[A-Za-z84]/,h=/[,\]]/,c=/[\d\.E\-\+]/;n.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;o.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case a:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},n.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(h.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},n.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=a)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=a,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},n.prototype.number=function(t){if(c.test(t))return void(this.word+=t);if(h.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)},n.prototype.quoted=function(t){if('"'===t)return void(this.state=5);this.word+=t},n.prototype.keyword=function(t){if(u.test(t))return void(this.word+=t);if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=a)}if(h.test(t))return void this.afterItem(t);throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place)},n.prototype.neutral=function(t){if(s.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(c.test(t))return this.word=t,void(this.state=3);if(h.test(t))return void this.afterItem(t);throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place)},n.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)}},function(t,e,r){"use strict";function n(t,e,r){Array.isArray(e)&&(r.unshift(e),e=null);var n=e?{}:t,a=r.reduce(function(t,e){return i(e,t),t},n);e&&(t[e]=a)}function i(t,e){if(!Array.isArray(t))return void(e[t]=!0);var r=t.shift();if("PARAMETER"===r&&(r=t.shift()),1===t.length)return Array.isArray(t[0])?(e[r]={},void i(t[0],e[r])):void(e[r]=t[0]);if(!t.length)return void(e[r]=!0);if("TOWGS84"===r)return void(e[r]=t);Array.isArray(r)||(e[r]={});var a;switch(r){case"UNIT":case"PRIMEM":case"VERT_DATUM":return e[r]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&i(t[2],e[r]));case"SPHEROID":case"ELLIPSOID":return e[r]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&i(t[3],e[r]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return t[0]=["name",t[0]],void n(e,r,t);default:for(a=-1;++a<t.length;)if(!Array.isArray(t[a]))return i(t,e[r]);return n(e,r,t)}}e.a=i},function(t,e){},function(t,e){},,function(t,e,r){r(269),r(270),t.exports=r(267)}])});
//# sourceMappingURL=itowns.js.map