From 5ef17047e86a3f96742a1ffbcb7b7b61bcfae2b8 Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Tue, 26 Mar 2019 21:05:41 -0700 Subject: [PATCH] Updated builds. --- build/three.js | 324 ++++----- build/three.min.js | 1443 ++++++++++++++++++++--------------------- build/three.module.js | 324 ++++----- 3 files changed, 1001 insertions(+), 1090 deletions(-) diff --git a/build/three.js b/build/three.js index 3a5c018725..0627aa12da 100644 --- a/build/three.js +++ b/build/three.js @@ -15977,7 +15977,7 @@ * * Uniforms of a program. * Those form a tree structure with a special top-level container for the root, - * which you get by calling 'new WebGLUniforms( gl, program, renderer )'. + * which you get by calling 'new WebGLUniforms( gl, program )'. * * * Properties of inner nodes including the top-level container: @@ -15988,15 +15988,15 @@ * * Methods of all nodes except the top-level container: * - * .setValue( gl, value, [renderer] ) + * .setValue( gl, value, [textures] ) * * uploads a uniform value(s) - * the 'renderer' parameter is needed for sampler uniforms + * the 'textures' parameter is needed for sampler uniforms * * - * Static methods of the top-level container (renderer factorizations): + * Static methods of the top-level container (textures factorizations): * - * .upload( gl, seq, values, renderer ) + * .upload( gl, seq, values, textures ) * * sets uniforms in 'seq' to 'values[id].value' * @@ -16005,16 +16005,12 @@ * filters 'seq' entries with corresponding entry in values * * - * Methods of the top-level container (renderer factorizations): + * Methods of the top-level container (textures factorizations): * - * .setValue( gl, name, value ) + * .setValue( gl, name, value, textures ) * * sets uniform with name 'name' to 'value' * - * .set( gl, obj, prop ) - * - * sets uniform from object and property with same name than uniform - * * .setOptional( gl, obj, prop ) * * like .set for an optional property of the object @@ -16026,15 +16022,6 @@ var emptyTexture3d = new DataTexture3D(); var emptyCubeTexture = new CubeTexture(); - // --- Base for inner nodes (including the root) --- - - function UniformContainer() { - - this.seq = []; - this.map = {}; - - } - // --- Utilities --- // Array Caches (provide typed arrays for temporary by size) @@ -16111,7 +16098,7 @@ // Texture unit allocation - function allocTexUnits( renderer, n ) { + function allocTexUnits( textures, n ) { var r = arrayCacheI32[ n ]; @@ -16123,7 +16110,7 @@ } for ( var i = 0; i !== n; ++ i ) - r[ i ] = renderer.allocTextureUnit(); + r[ i ] = textures.allocateTextureUnit(); return r; @@ -16343,10 +16330,10 @@ // Single texture (2D / Cube) - function setValueT1( gl, v, renderer ) { + function setValueT1( gl, v, textures ) { var cache = this.cache; - var unit = renderer.allocTextureUnit(); + var unit = textures.allocateTextureUnit(); if ( cache[ 0 ] !== unit ) { @@ -16355,14 +16342,14 @@ } - renderer.setTexture2D( v || emptyTexture, unit ); + textures.safeSetTexture2D( v || emptyTexture, unit ); } - function setValueT2DArray1( gl, v, renderer ) { + function setValueT2DArray1( gl, v, textures ) { var cache = this.cache; - var unit = renderer.allocTextureUnit(); + var unit = textures.allocateTextureUnit(); if ( cache[ 0 ] !== unit ) { @@ -16371,14 +16358,14 @@ } - renderer.setTexture2DArray( v || emptyTexture2dArray, unit ); + textures.setTexture2DArray( v || emptyTexture2dArray, unit ); } - function setValueT3D1( gl, v, renderer ) { + function setValueT3D1( gl, v, textures ) { var cache = this.cache; - var unit = renderer.allocTextureUnit(); + var unit = textures.allocateTextureUnit(); if ( cache[ 0 ] !== unit ) { @@ -16387,14 +16374,14 @@ } - renderer.setTexture3D( v || emptyTexture3d, unit ); + textures.setTexture3D( v || emptyTexture3d, unit ); } - function setValueT6( gl, v, renderer ) { + function setValueT6( gl, v, textures ) { var cache = this.cache; - var unit = renderer.allocTextureUnit(); + var unit = textures.allocateTextureUnit(); if ( cache[ 0 ] !== unit ) { @@ -16403,7 +16390,7 @@ } - renderer.setTextureCube( v || emptyCubeTexture, unit ); + textures.safeSetTextureCube( v || emptyCubeTexture, unit ); } @@ -16583,12 +16570,12 @@ // Array of textures (2D / Cube) - function setValueT1a( gl, v, renderer ) { + function setValueT1a( gl, v, textures ) { var cache = this.cache; var n = v.length; - var units = allocTexUnits( renderer, n ); + var units = allocTexUnits( textures, n ); if ( arraysEqual( cache, units ) === false ) { @@ -16599,18 +16586,18 @@ for ( var i = 0; i !== n; ++ i ) { - renderer.setTexture2D( v[ i ] || emptyTexture, units[ i ] ); + textures.safeSetTexture2D( v[ i ] || emptyTexture, units[ i ] ); } } - function setValueT6a( gl, v, renderer ) { + function setValueT6a( gl, v, textures ) { var cache = this.cache; var n = v.length; - var units = allocTexUnits( renderer, n ); + var units = allocTexUnits( textures, n ); if ( arraysEqual( cache, units ) === false ) { @@ -16621,7 +16608,7 @@ for ( var i = 0; i !== n; ++ i ) { - renderer.setTextureCube( v[ i ] || emptyCubeTexture, units[ i ] ); + textures.safeSetTextureCube( v[ i ] || emptyCubeTexture, units[ i ] ); } @@ -16697,18 +16684,19 @@ this.id = id; - UniformContainer.call( this ); // mix-in + this.seq = []; + this.map = {}; } - StructuredUniform.prototype.setValue = function ( gl, value, renderer ) { + StructuredUniform.prototype.setValue = function ( gl, value, textures ) { var seq = this.seq; for ( var i = 0, n = seq.length; i !== n; ++ i ) { var u = seq[ i ]; - u.setValue( gl, value[ u.id ], renderer ); + u.setValue( gl, value[ u.id ], textures ); } @@ -16788,11 +16776,10 @@ // Root Container - function WebGLUniforms( gl, program, renderer ) { - - UniformContainer.call( this ); + function WebGLUniforms( gl, program ) { - this.renderer = renderer; + this.seq = []; + this.map = {}; var n = gl.getProgramParameter( program, 35718 ); @@ -16807,11 +16794,11 @@ } - WebGLUniforms.prototype.setValue = function ( gl, name, value ) { + WebGLUniforms.prototype.setValue = function ( gl, name, value, textures ) { var u = this.map[ name ]; - if ( u !== undefined ) u.setValue( gl, value, this.renderer ); + if ( u !== undefined ) u.setValue( gl, value, textures ); }; @@ -16826,7 +16813,7 @@ // Static interface - WebGLUniforms.upload = function ( gl, seq, values, renderer ) { + WebGLUniforms.upload = function ( gl, seq, values, textures ) { for ( var i = 0, n = seq.length; i !== n; ++ i ) { @@ -16836,7 +16823,7 @@ if ( v.needsUpdate !== false ) { // note: always updating when .needsUpdate is undefined - u.setValue( gl, v.value, renderer ); + u.setValue( gl, v.value, textures ); } @@ -17106,7 +17093,7 @@ } - function WebGLProgram( renderer, extensions, code, material, shader, parameters, capabilities ) { + function WebGLProgram( renderer, extensions, code, material, shader, parameters, capabilities, textures ) { var gl = renderer.context; @@ -17570,7 +17557,7 @@ if ( cachedUniforms === undefined ) { - cachedUniforms = new WebGLUniforms( gl, program, renderer ); + cachedUniforms = new WebGLUniforms( gl, program, textures ); } @@ -17646,7 +17633,7 @@ * @author mrdoob / http://mrdoob.com/ */ - function WebGLPrograms( renderer, extensions, capabilities ) { + function WebGLPrograms( renderer, extensions, capabilities, textures ) { var programs = []; @@ -17920,7 +17907,7 @@ if ( program === undefined ) { - program = new WebGLProgram( renderer, extensions, code, material, shader, parameters, capabilities ); + program = new WebGLProgram( renderer, extensions, code, material, shader, parameters, capabilities, textures ); programs.push( program ); } @@ -20474,7 +20461,31 @@ // + var textureUnits = 0; + + function resetTextureUnits() { + + textureUnits = 0; + + } + + function allocateTextureUnit() { + + var textureUnit = textureUnits; + + if ( textureUnit >= capabilities.maxTextures ) { + + console.warn( 'THREE.WebGLTextures: Trying to use ' + textureUnit + ' texture units while this GPU supports only ' + capabilities.maxTextures ); + + } + + textureUnits += 1; + + return textureUnit; + } + + // function setTexture2D( texture, slot ) { @@ -21286,6 +21297,69 @@ } + // backwards compatibility + + var warnedTexture2D = false; + var warnedTextureCube = false; + + function safeSetTexture2D( texture, slot ) { + + if ( texture && texture.isWebGLRenderTarget ) { + + if ( warnedTexture2D === false ) { + + console.warn( "THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead." ); + warnedTexture2D = true; + + } + + texture = texture.texture; + + } + + setTexture2D( texture, slot ); + + } + + function safeSetTextureCube( texture, slot ) { + + if ( texture && texture.isWebGLRenderTargetCube ) { + + if ( warnedTextureCube === false ) { + + console.warn( "THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead." ); + warnedTextureCube = true; + + } + + texture = texture.texture; + + } + + // currently relying on the fact that WebGLRenderTargetCube.texture is a Texture and NOT a CubeTexture + // TODO: unify these code paths + if ( ( texture && texture.isCubeTexture ) || + ( Array.isArray( texture.image ) && texture.image.length === 6 ) ) { + + // CompressedTexture can have Array in image :/ + + // this function alone should take care of cube textures + setTextureCube( texture, slot ); + + } else { + + // assumed: texture property of THREE.WebGLRenderTargetCube + setTextureCubeDynamic( texture, slot ); + + } + + } + + // + + this.allocateTextureUnit = allocateTextureUnit; + this.resetTextureUnits = resetTextureUnits; + this.setTexture2D = setTexture2D; this.setTexture2DArray = setTexture2DArray; this.setTexture3D = setTexture3D; @@ -21295,6 +21369,9 @@ this.updateRenderTargetMipmap = updateRenderTargetMipmap; this.updateMultisampleRenderTarget = updateMultisampleRenderTarget; + this.safeSetTexture2D = safeSetTexture2D; + this.safeSetTextureCube = safeSetTextureCube; + } /** @@ -22672,10 +22749,6 @@ // - _usedTextureUnits = 0, - - // - _width = _canvas.width, _height = _canvas.height, @@ -22804,7 +22877,7 @@ geometries = new WebGLGeometries( _gl, attributes, info ); objects = new WebGLObjects( geometries, info ); morphtargets = new WebGLMorphtargets( _gl ); - programCache = new WebGLPrograms( _this, extensions, capabilities ); + programCache = new WebGLPrograms( _this, extensions, capabilities, textures ); renderLists = new WebGLRenderLists(); renderStates = new WebGLRenderStates(); @@ -24162,7 +24235,7 @@ function setProgram( camera, fog, material, object ) { - _usedTextureUnits = 0; + textures.resetTextureUnits(); var materialProperties = properties.get( material ); var lights = currentRenderState.state.lights; @@ -24349,7 +24422,7 @@ } - p_uniforms.setValue( _gl, 'boneTexture', skeleton.boneTexture ); + p_uniforms.setValue( _gl, 'boneTexture', skeleton.boneTexture, textures ); p_uniforms.setValue( _gl, 'boneTextureSize', skeleton.boneTextureSize ); } else { @@ -24479,13 +24552,13 @@ if ( m_uniforms.ltc_1 !== undefined ) m_uniforms.ltc_1.value = UniformsLib.LTC_1; if ( m_uniforms.ltc_2 !== undefined ) m_uniforms.ltc_2.value = UniformsLib.LTC_2; - WebGLUniforms.upload( _gl, materialProperties.uniformsList, m_uniforms, _this ); + WebGLUniforms.upload( _gl, materialProperties.uniformsList, m_uniforms, textures ); } if ( material.isShaderMaterial && material.uniformsNeedUpdate === true ) { - WebGLUniforms.upload( _gl, materialProperties.uniformsList, m_uniforms, _this ); + WebGLUniforms.upload( _gl, materialProperties.uniformsList, m_uniforms, textures ); material.uniformsNeedUpdate = false; } @@ -24948,126 +25021,6 @@ } - // Textures - - function allocTextureUnit() { - - var textureUnit = _usedTextureUnits; - - if ( textureUnit >= capabilities.maxTextures ) { - - console.warn( 'THREE.WebGLRenderer: Trying to use ' + textureUnit + ' texture units while this GPU supports only ' + capabilities.maxTextures ); - - } - - _usedTextureUnits += 1; - - return textureUnit; - - } - - this.allocTextureUnit = allocTextureUnit; - - // this.setTexture2D = setTexture2D; - this.setTexture2D = ( function () { - - var warned = false; - - // backwards compatibility: peel texture.texture - return function setTexture2D( texture, slot ) { - - if ( texture && texture.isWebGLRenderTarget ) { - - if ( ! warned ) { - - console.warn( "THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead." ); - warned = true; - - } - - texture = texture.texture; - - } - - textures.setTexture2D( texture, slot ); - - }; - - }() ); - - this.setTexture2DArray = function ( texture, slot ) { - - textures.setTexture2DArray( texture, slot ); - - }; - - this.setTexture3D = function ( texture, slot ) { - - textures.setTexture3D( texture, slot ); - - }; - - this.setTexture = ( function () { - - var warned = false; - - return function setTexture( texture, slot ) { - - if ( ! warned ) { - - console.warn( "THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead." ); - warned = true; - - } - - textures.setTexture2D( texture, slot ); - - }; - - }() ); - - this.setTextureCube = ( function () { - - var warned = false; - - return function setTextureCube( texture, slot ) { - - // backwards compatibility: peel texture.texture - if ( texture && texture.isWebGLRenderTargetCube ) { - - if ( ! warned ) { - - console.warn( "THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead." ); - warned = true; - - } - - texture = texture.texture; - - } - - // currently relying on the fact that WebGLRenderTargetCube.texture is a Texture and NOT a CubeTexture - // TODO: unify these code paths - if ( ( texture && texture.isCubeTexture ) || - ( Array.isArray( texture.image ) && texture.image.length === 6 ) ) { - - // CompressedTexture can have Array in image :/ - - // this function alone should take care of cube textures - textures.setTextureCube( texture, slot ); - - } else { - - // assumed: texture property of THREE.WebGLRenderTargetCube - - textures.setTextureCubeDynamic( texture, slot ); - - } - - }; - - }() ); - // this.setFramebuffer = function ( value ) { @@ -45281,6 +45234,9 @@ Object.assign( this.parameters, source.parameters ); + this.geometry.copy( source.geometry ); + this.material.copy( source.material ); + return this; }, diff --git a/build/three.min.js b/build/three.min.js index bb7a0b48fa..847eb280e3 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -1,424 +1,423 @@ // threejs.org/license -(function(k,la){"object"===typeof exports&&"undefined"!==typeof module?la(exports):"function"===typeof define&&define.amd?define(["exports"],la):(k=k||self,la(k.THREE={}))})(this,function(k){function la(){}function z(a,b){this.x=a||0;this.y=b||0}function aa(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._w=void 0!==d?d:1}function n(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}function qa(){this.elements=[1,0,0,0,1,0,0,0,1];0b&&(b=a[c]);return b}function D(){Object.defineProperty(this,"id",{value:Wf+=2});this.uuid=P.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity};this.userData={}} -function Ob(a,b,c,d,e,f){G.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.fromBufferGeometry(new rb(a,b,c,d,e,f));this.mergeVertices()}function rb(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,k,ea,F,Xf){var t=f/ea,u=g/F,x=f/2,w=g/2,C=k/2;g=ea+1;var y=F+1,K=f=0,A,z,W=new n;for(z=0;zb&&(b=a[c]);return b}function z(){Object.defineProperty(this,"id",{value:Yf+=2});this.uuid=K.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity};this.userData={}} +function Rb(a,b,c,d,e,f){N.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f};this.fromBufferGeometry(new ub(a,b,c,d,e,f));this.mergeVertices()}function ub(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,l,ua,F,Zf){var r=f/ua,u=g/F,x=f/2,w=g/2,A=l/2;g=ua+1;var y=F+1,X=f=0,Q,J,D=new n;for(J=0;Jm;m++){if(p=d[m])if(h=p[0],l=p[1]){q&&e.addAttribute("morphTarget"+m, -q[h]);f&&e.addAttribute("morphNormal"+m,f[h]);c[m]=l;continue}c[m]=0}g.getUniforms().setValue(a,"morphTargetInfluences",c)}}}function ig(a,b){var c={};return{update:function(d){var e=b.render.frame,f=d.geometry,g=a.get(d,f);c[g.id]!==e&&(f.isGeometry&&g.updateFromObject(d),a.update(g),c[g.id]=e);return g},dispose:function(){c={}}}}function Za(a,b,c,d,e,f,g,h,l,m){a=void 0!==a?a:[];U.call(this,a,void 0!==b?b:301,c,d,e,f,void 0!==g?g:1022,h,l,m);this.flipY=!1}function Pb(a,b,c,d){U.call(this,null); -this.image={data:a,width:b,height:c,depth:d};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1}function Qb(a,b,c,d){U.call(this,null);this.image={data:a,width:b,height:c,depth:d};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1}function Rb(a,b,c){var d=a[0];if(0>=d||0/gm,function(a,c){a=T[c];if(void 0===a)throw Error("Can not resolve #include <"+c+">");return ee(a)})}function jf(a){return a.replace(/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g, -function(a,c,d,e){a="";for(c=parseInt(c);cm;m++){if(q=d[m])if(h=q[0],k=q[1]){p&&e.addAttribute("morphTarget"+m, +p[h]);f&&e.addAttribute("morphNormal"+m,f[h]);c[m]=k;continue}c[m]=0}g.getUniforms().setValue(a,"morphTargetInfluences",c)}}}function kg(a,b){var c={};return{update:function(d){var e=b.render.frame,f=d.geometry,g=a.get(d,f);c[g.id]!==e&&(f.isGeometry&&g.updateFromObject(d),a.update(g),c[g.id]=e);return g},dispose:function(){c={}}}}function bb(a,b,c,d,e,f,g,h,k,m){a=void 0!==a?a:[];W.call(this,a,void 0!==b?b:301,c,d,e,f,void 0!==g?g:1022,h,k,m);this.flipY=!1}function Sb(a,b,c,d){W.call(this,null); +this.image={data:a,width:b,height:c,depth:d};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1}function Tb(a,b,c,d){W.call(this,null);this.image={data:a,width:b,height:c,depth:d};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1}function Ub(a,b,c){var d=a[0];if(0>=d||0/gm,function(a,c){a=T[c];if(void 0===a)throw Error("Can not resolve #include <"+c+">");return ee(a)})}function kf(a){return a.replace(/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g, +function(a,c,d,e){a="";for(c=parseInt(c);cd||a.height>d)e=d/Math.max(a.width,a.height);if(1>e||!0===b){if("undefined"!==typeof HTMLImageElement&&a instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&a instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&a instanceof ImageBitmap)return d=b?P.floorPowerOfTwo:Math.floor,b=d(e*a.width),e=d(e*a.height), -void 0===z&&(z=h(b,e)),c=c?h(b,e):z,c.width=b,c.height=e,c.getContext("2d").drawImage(a,0,0,b,e),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+a.width+"x"+a.height+") to ("+b+"x"+e+")."),c;"data"in a&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+a.width+"x"+a.height+").")}return a}function m(a){return P.isPowerOfTwo(a.width)&&P.isPowerOfTwo(a.height)}function q(a,b){return a.generateMipmaps&&b&&1003!==a.minFilter&&1006!==a.minFilter}function p(b,c,e, +"",f.doubleSided?"#define DOUBLE_SIDED":"",f.flipSided?"#define FLIP_SIDED":"",f.shadowMapEnabled?"#define USE_SHADOWMAP":"",f.shadowMapEnabled?"#define "+v:"",f.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",f.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",f.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",f.logarithmicDepthBuffer&&(g.isWebGL2||b.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",f.envMap&&(g.isWebGL2||b.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT": +"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",0!==f.toneMapping?"#define TONE_MAPPING":"",0!==f.toneMapping?T.tonemapping_pars_fragment:"",0!==f.toneMapping?Og("toneMapping",f.toneMapping):"",f.dithering?"#define DITHERING":"",f.outputEncoding||f.mapEncoding||f.matcapEncoding||f.envMapEncoding||f.emissiveMapEncoding?T.encodings_pars_fragment:"",f.mapEncoding?xd("mapTexelToLinear",f.mapEncoding):"",f.matcapEncoding?xd("matcapTexelToLinear",f.matcapEncoding):"",f.envMapEncoding?xd("envMapTexelToLinear", +f.envMapEncoding):"",f.emissiveMapEncoding?xd("emissiveMapTexelToLinear",f.emissiveMapEncoding):"",f.outputEncoding?Ng("linearToOutputTexel",f.outputEncoding):"",f.depthPacking?"#define DEPTH_PACKING "+d.depthPacking:"","\n"].filter(Ec).join("\n"));p=ee(p);p=hf(p,f);p=jf(p,f);q=ee(q);q=hf(q,f);q=jf(q,f);p=kf(p);q=kf(q);g.isWebGL2&&!d.isRawShaderMaterial&&(g=!1,v=/^\s*#version\s+300\s+es\s*\n/,d.isShaderMaterial&&null!==p.match(v)&&null!==q.match(v)&&(g=!0,p=p.replace(v,""),q=q.replace(v,"")),m="#version 300 es\n\n#define attribute in\n#define varying out\n#define texture2D texture\n"+ +m,b=["#version 300 es\n\n#define varying in",g?"":"out highp vec4 pc_fragColor;",g?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad"].join("\n")+ +"\n"+b);q=b+q;p=ff(k,35633,m+p);q=ff(k,35632,q);k.attachShader(w,p);k.attachShader(w,q);void 0!==d.index0AttributeName?k.bindAttribLocation(w,0,d.index0AttributeName):!0===f.morphTargets&&k.bindAttribLocation(w,0,"position");k.linkProgram(w);f=k.getProgramInfoLog(w).trim();g=k.getShaderInfoLog(p).trim();v=k.getShaderInfoLog(q).trim();r=l=!0;if(!1===k.getProgramParameter(w,35714))l=!1,console.error("THREE.WebGLProgram: shader error: ",k.getError(),"35715",k.getProgramParameter(w,35715),"gl.getProgramInfoLog", +f,g,v);else if(""!==f)console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",f);else if(""===g||""===v)r=!1;r&&(this.diagnostics={runnable:l,material:d,programLog:f,vertexShader:{log:g,prefix:m},fragmentShader:{log:v,prefix:b}});k.deleteShader(p);k.deleteShader(q);var y;this.getUniforms=function(){void 0===y&&(y=new hb(k,w,h));return y};var D;this.getAttributes=function(){if(void 0===D){for(var a={},b=k.getProgramParameter(w,35721),c=0;cd||a.height>d)e=d/Math.max(a.width,a.height);if(1>e||!0===b){if("undefined"!==typeof HTMLImageElement&&a instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&a instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&a instanceof ImageBitmap)return d=b?K.floorPowerOfTwo:Math.floor,b=d(e*a.width),e=d(e*a.height), +void 0===C&&(C=h(b,e)),c=c?h(b,e):C,c.width=b,c.height=e,c.getContext("2d").drawImage(a,0,0,b,e),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+a.width+"x"+a.height+") to ("+b+"x"+e+")."),c;"data"in a&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+a.width+"x"+a.height+").")}return a}function m(a){return K.isPowerOfTwo(a.width)&&K.isPowerOfTwo(a.height)}function p(a,b){return a.generateMipmaps&&b&&1003!==a.minFilter&&1006!==a.minFilter}function q(b,c,e, f){a.generateMipmap(b);d.get(c).__maxMipLevel=Math.log(Math.max(e,f))*Math.LOG2E}function v(a,c){if(!e.isWebGL2)return a;var d=a;6403===a&&(5126===c&&(d=33326),5131===c&&(d=33325),5121===c&&(d=33321));6407===a&&(5126===c&&(d=34837),5131===c&&(d=34843),5121===c&&(d=32849));6408===a&&(5126===c&&(d=34836),5131===c&&(d=34842),5121===c&&(d=32856));33325===d||33326===d||34842===d||34836===d?b.get("EXT_color_buffer_float"):(34843===d||34837===d)&&console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."); -return d}function k(a){return 1003===a||1004===a||1005===a?9728:9729}function t(b){b=b.target;b.removeEventListener("dispose",t);var c=d.get(b);void 0!==c.__webglInit&&(a.deleteTexture(c.__webglTexture),d.remove(b));b.isVideoTexture&&delete F[b.id];g.memory.textures--}function u(b){b=b.target;b.removeEventListener("dispose",u);var c=d.get(b),e=d.get(b.texture);if(b){void 0!==e.__webglTexture&&a.deleteTexture(e.__webglTexture);b.depthTexture&&b.depthTexture.dispose();if(b.isWebGLRenderTargetCube)for(e= -0;6>e;e++)a.deleteFramebuffer(c.__webglFramebuffer[e]),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer[e]);else a.deleteFramebuffer(c.__webglFramebuffer),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer);d.remove(b.texture);d.remove(b)}g.memory.textures--}function n(a,b){var e=d.get(a);if(a.isVideoTexture){var f=a.id,h=g.render.frame;F[f]!==h&&(F[f]=h,a.update())}if(0t;t++)r[t]=g||k?k?b.image[t].image:b.image[t]:l(b.image[t],!1,!0, -e.maxCubemapSize);var u=r[0],n=m(u)||e.isWebGL2,x=f.convert(b.format),y=f.convert(b.type),F=v(x,y);C(34067,b,n);for(t=0;6>t;t++)if(g)for(var A,K=r[t].mipmaps,ea=0,Ac=K.length;ear;r++)h.__webglFramebuffer[r]=a.createFramebuffer();else if(h.__webglFramebuffer=a.createFramebuffer(),r)if(e.isWebGL2){h.__webglMultisampledFramebuffer=a.createFramebuffer();h.__webglColorRenderbuffer=a.createRenderbuffer();a.bindRenderbuffer(36161,h.__webglColorRenderbuffer);r=f.convert(b.texture.format); -var x=f.convert(b.texture.type);r=v(r,x);x=ea(b);a.renderbufferStorageMultisample(36161,x,r,b.width,b.height);a.bindFramebuffer(36160,h.__webglMultisampledFramebuffer);a.framebufferRenderbuffer(36160,36064,36161,h.__webglColorRenderbuffer);a.bindRenderbuffer(36161,null);b.depthBuffer&&(h.__webglDepthRenderbuffer=a.createRenderbuffer(),K(h.__webglDepthRenderbuffer,b,!0));a.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."); -if(k){c.bindTexture(34067,l.__webglTexture);C(34067,b.texture,t);for(r=0;6>r;r++)A(h.__webglFramebuffer[r],b,36064,34069+r);q(b.texture,t)&&p(34067,b.texture,b.width,b.height);c.bindTexture(34067,null)}else c.bindTexture(3553,l.__webglTexture),C(3553,b.texture,t),A(h.__webglFramebuffer,b,36064,3553),q(b.texture,t)&&p(3553,b.texture,b.width,b.height),c.bindTexture(3553,null);if(b.depthBuffer){h=d.get(b);l=!0===b.isWebGLRenderTargetCube;if(b.depthTexture){if(l)throw Error("target.depthTexture not supported in Cube render targets"); -if(b&&b.isWebGLRenderTargetCube)throw Error("Depth Texture with cube render targets is not supported");a.bindFramebuffer(36160,h.__webglFramebuffer);if(!b.depthTexture||!b.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");d.get(b.depthTexture).__webglTexture&&b.depthTexture.image.width===b.width&&b.depthTexture.image.height===b.height||(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate=!0); -n(b.depthTexture,0);h=d.get(b.depthTexture).__webglTexture;if(1026===b.depthTexture.format)a.framebufferTexture2D(36160,36096,3553,h,0);else if(1027===b.depthTexture.format)a.framebufferTexture2D(36160,33306,3553,h,0);else throw Error("Unknown depthTexture format");}else if(l)for(h.__webglDepthbuffer=[],l=0;6>l;l++)a.bindFramebuffer(36160,h.__webglFramebuffer[l]),h.__webglDepthbuffer[l]=a.createRenderbuffer(),K(h.__webglDepthbuffer[l],b);else a.bindFramebuffer(36160,h.__webglFramebuffer),h.__webglDepthbuffer= -a.createRenderbuffer(),K(h.__webglDepthbuffer,b);a.bindFramebuffer(36160,null)}};this.updateRenderTargetMipmap=function(a){var b=a.texture,f=m(a)||e.isWebGL2;if(q(b,f)){f=a.isWebGLRenderTargetCube?34067:3553;var g=d.get(b).__webglTexture;c.bindTexture(f,g);p(f,b,a.width,a.height);c.bindTexture(f,null)}};this.updateMultisampleRenderTarget=function(b){if(b.isWebGLMultisampleRenderTarget)if(e.isWebGL2){var c=d.get(b);a.bindFramebuffer(36008,c.__webglMultisampledFramebuffer);a.bindFramebuffer(36009,c.__webglFramebuffer); -c=b.width;var f=b.height,g=16384;b.depthBuffer&&(g|=256);b.stencilBuffer&&(g|=1024);a.blitFramebuffer(0,0,c,f,0,0,c,f,g,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}}function nf(a,b,c){return{convert:function(a){if(1E3===a)return 10497;if(1001===a)return 33071;if(1002===a)return 33648;if(1003===a)return 9728;if(1004===a)return 9984;if(1005===a)return 9986;if(1006===a)return 9729;if(1007===a)return 9985;if(1008===a)return 9987;if(1009=== -a)return 5121;if(1017===a)return 32819;if(1018===a)return 32820;if(1019===a)return 33635;if(1010===a)return 5120;if(1011===a)return 5122;if(1012===a)return 5123;if(1013===a)return 5124;if(1014===a)return 5125;if(1015===a)return 5126;if(1016===a){if(c.isWebGL2)return 5131;var d=b.get("OES_texture_half_float");if(null!==d)return d.HALF_FLOAT_OES}if(1021===a)return 6406;if(1022===a)return 6407;if(1023===a)return 6408;if(1024===a)return 6409;if(1025===a)return 6410;if(1026===a)return 6402;if(1027===a)return 34041; -if(1028===a)return 6403;if(100===a)return 32774;if(101===a)return 32778;if(102===a)return 32779;if(200===a)return 0;if(201===a)return 1;if(202===a)return 768;if(203===a)return 769;if(204===a)return 770;if(205===a)return 771;if(206===a)return 772;if(207===a)return 773;if(208===a)return 774;if(209===a)return 775;if(210===a)return 776;if(33776===a||33777===a||33778===a||33779===a)if(d=b.get("WEBGL_compressed_texture_s3tc"),null!==d){if(33776===a)return d.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===a)return d.COMPRESSED_RGBA_S3TC_DXT1_EXT; -if(33778===a)return d.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===a)return d.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===a||35841===a||35842===a||35843===a)if(d=b.get("WEBGL_compressed_texture_pvrtc"),null!==d){if(35840===a)return d.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===a)return d.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===a)return d.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===a)return d.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===a&&(d=b.get("WEBGL_compressed_texture_etc1"),null!==d))return d.COMPRESSED_RGB_ETC1_WEBGL; -if(37808===a||37809===a||37810===a||37811===a||37812===a||37813===a||37814===a||37815===a||37816===a||37817===a||37818===a||37819===a||37820===a||37821===a)if(d=b.get("WEBGL_compressed_texture_astc"),null!==d)return a;if(103===a||104===a){if(c.isWebGL2){if(103===a)return 32775;if(104===a)return 32776}d=b.get("EXT_blend_minmax");if(null!==d){if(103===a)return d.MIN_EXT;if(104===a)return d.MAX_EXT}}if(1020===a){if(c.isWebGL2)return 34042;d=b.get("WEBGL_depth_texture");if(null!==d)return d.UNSIGNED_INT_24_8_WEBGL}return 0}}} -function Sb(){E.call(this);this.type="Group"}function Ua(){E.call(this);this.type="Camera";this.matrixWorldInverse=new Q;this.projectionMatrix=new Q;this.projectionMatrixInverse=new Q}function V(a,b,c,d){Ua.call(this);this.type="PerspectiveCamera";this.fov=void 0!==a?a:50;this.zoom=1;this.near=void 0!==c?c:.1;this.far=void 0!==d?d:2E3;this.focus=10;this.aspect=void 0!==b?b:1;this.view=null;this.filmGauge=35;this.filmOffset=0;this.updateProjectionMatrix()}function Ec(a){V.call(this);this.cameras=a|| -[]}function of(a,b,c){pf.setFromMatrixPosition(b.matrixWorld);qf.setFromMatrixPosition(c.matrixWorld);var d=pf.distanceTo(qf),e=b.projectionMatrix.elements,f=c.projectionMatrix.elements,g=e[14]/(e[10]-1);c=e[14]/(e[10]+1);var h=(e[9]+1)/e[5],l=(e[9]-1)/e[5],m=(e[8]-1)/e[0],q=(f[8]+1)/f[0];e=g*m;f=g*q;q=d/(-m+q);m=q*-m;b.matrixWorld.decompose(a.position,a.quaternion,a.scale);a.translateX(m);a.translateZ(q);a.matrixWorld.compose(a.position,a.quaternion,a.scale);a.matrixWorldInverse.getInverse(a.matrixWorld); -b=g+q;g=c+q;a.projectionMatrix.makePerspective(e-m,f+(d-m),h*c/g*b,l*c/g*b,b,g)}function rf(a){function b(){return null!==e&&!0===e.isPresenting}function c(){if(b()){var c=e.getEyeParameters("left"),f=c.renderWidth*q;c=c.renderHeight*q;y=a.getPixelRatio();a.getSize(w);a.setDrawingBufferSize(2*f,c,1);K.start()}else d.enabled&&a.setDrawingBufferSize(w.width,w.height,y),K.stop()}var d=this,e=null,f=null,g=null,h=[],l=new Q,m=new Q,q=1,p="stage";"undefined"!==typeof window&&"VRFrameData"in window&&(f= -new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",c,!1));var k=new Q,r=new aa,t=new n,u=new V;u.bounds=new ba(0,0,.5,1);u.layers.enable(1);var x=new V;x.bounds=new ba(.5,0,.5,1);x.layers.enable(2);var C=new Ec([u,x]);C.layers.enable(1);C.layers.enable(2);var w=new z,y,A=[];this.enabled=!1;this.getController=function(a){var b=h[a];void 0===b&&(b=new Sb,b.matrixAutoUpdate=!1,b.visible=!1,h[a]=b);return b};this.getDevice=function(){return e};this.setDevice=function(a){void 0!== -a&&(e=a);K.setContext(a)};this.setFramebufferScaleFactor=function(a){q=a};this.setFrameOfReferenceType=function(a){p=a};this.setPoseTarget=function(a){void 0!==a&&(g=a)};this.getCamera=function(a){var c="stage"===p?1.6:0;if(!1===b())return a.position.set(0,c,0),a.rotation.set(0,0,0),a;e.depthNear=a.near;e.depthFar=a.far;e.getFrameData(f);if("stage"===p){var d=e.stageParameters;d?l.fromArray(d.sittingToStandingTransform):l.makeTranslation(0,c,0)}c=f.pose;d=null!==g?g:a;d.matrix.copy(l);d.matrix.decompose(d.position, -d.quaternion,d.scale);null!==c.orientation&&(r.fromArray(c.orientation),d.quaternion.multiply(r));null!==c.position&&(r.setFromRotationMatrix(l),t.fromArray(c.position),t.applyQuaternion(r),d.position.add(t));d.updateMatrixWorld();u.near=a.near;x.near=a.near;u.far=a.far;x.far=a.far;u.matrixWorldInverse.fromArray(f.leftViewMatrix);x.matrixWorldInverse.fromArray(f.rightViewMatrix);m.getInverse(l);"stage"===p&&(u.matrixWorldInverse.multiply(m),x.matrixWorldInverse.multiply(m));a=d.parent;null!==a&&(k.getInverse(a.matrixWorld), -u.matrixWorldInverse.multiply(k),x.matrixWorldInverse.multiply(k));u.matrixWorld.getInverse(u.matrixWorldInverse);x.matrixWorld.getInverse(x.matrixWorldInverse);u.projectionMatrix.fromArray(f.leftProjectionMatrix);x.projectionMatrix.fromArray(f.rightProjectionMatrix);of(C,u,x);a=e.getLayers();a.length&&(a=a[0],null!==a.leftBounds&&4===a.leftBounds.length&&u.bounds.fromArray(a.leftBounds),null!==a.rightBounds&&4===a.rightBounds.length&&x.bounds.fromArray(a.rightBounds));a:for(a=0;ae;e++)a.deleteFramebuffer(c.__webglFramebuffer[e]),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer[e]);else a.deleteFramebuffer(c.__webglFramebuffer),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer);d.remove(b.texture);d.remove(b)}g.memory.textures--}function n(a,b){var e=d.get(a);if(a.isVideoTexture){var f=a.id,h=g.render.frame;E[f]!==h&&(E[f]=h,a.update())}if(0r;r++)t[r]=g||l?l?b.image[r].image: +b.image[r]:k(b.image[r],!1,!0,e.maxCubemapSize);var u=t[0],n=m(u)||e.isWebGL2,x=f.convert(b.format),w=f.convert(b.type),Q=v(x,w);y(34067,b,n);for(r=0;6>r;r++)if(g)for(var X,J=t[r].mipmaps,A=0,F=J.length;A=e.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+a+" texture units while this GPU supports only "+e.maxTextures);z+=1;return a};this.resetTextureUnits=function(){z=0};this.setTexture2D=n;this.setTexture2DArray=function(a,b){var e=d.get(a);0r;r++)h.__webglFramebuffer[r]=a.createFramebuffer();else if(h.__webglFramebuffer=a.createFramebuffer(),r)if(e.isWebGL2){h.__webglMultisampledFramebuffer= +a.createFramebuffer();h.__webglColorRenderbuffer=a.createRenderbuffer();a.bindRenderbuffer(36161,h.__webglColorRenderbuffer);r=f.convert(b.texture.format);var x=f.convert(b.texture.type);r=v(r,x);x=B(b);a.renderbufferStorageMultisample(36161,x,r,b.width,b.height);a.bindFramebuffer(36160,h.__webglMultisampledFramebuffer);a.framebufferRenderbuffer(36160,36064,36161,h.__webglColorRenderbuffer);a.bindRenderbuffer(36161,null);b.depthBuffer&&(h.__webglDepthRenderbuffer=a.createRenderbuffer(),F(h.__webglDepthRenderbuffer, +b,!0));a.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(l){c.bindTexture(34067,k.__webglTexture);y(34067,b.texture,t);for(r=0;6>r;r++)ua(h.__webglFramebuffer[r],b,36064,34069+r);p(b.texture,t)&&q(34067,b.texture,b.width,b.height);c.bindTexture(34067,null)}else c.bindTexture(3553,k.__webglTexture),y(3553,b.texture,t),ua(h.__webglFramebuffer,b,36064,3553),p(b.texture,t)&&q(3553,b.texture,b.width,b.height),c.bindTexture(3553, +null);if(b.depthBuffer){h=d.get(b);k=!0===b.isWebGLRenderTargetCube;if(b.depthTexture){if(k)throw Error("target.depthTexture not supported in Cube render targets");if(b&&b.isWebGLRenderTargetCube)throw Error("Depth Texture with cube render targets is not supported");a.bindFramebuffer(36160,h.__webglFramebuffer);if(!b.depthTexture||!b.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");d.get(b.depthTexture).__webglTexture&&b.depthTexture.image.width=== +b.width&&b.depthTexture.image.height===b.height||(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate=!0);n(b.depthTexture,0);h=d.get(b.depthTexture).__webglTexture;if(1026===b.depthTexture.format)a.framebufferTexture2D(36160,36096,3553,h,0);else if(1027===b.depthTexture.format)a.framebufferTexture2D(36160,33306,3553,h,0);else throw Error("Unknown depthTexture format");}else if(k)for(h.__webglDepthbuffer=[],k=0;6>k;k++)a.bindFramebuffer(36160,h.__webglFramebuffer[k]), +h.__webglDepthbuffer[k]=a.createRenderbuffer(),F(h.__webglDepthbuffer[k],b);else a.bindFramebuffer(36160,h.__webglFramebuffer),h.__webglDepthbuffer=a.createRenderbuffer(),F(h.__webglDepthbuffer,b);a.bindFramebuffer(36160,null)}};this.updateRenderTargetMipmap=function(a){var b=a.texture,f=m(a)||e.isWebGL2;if(p(b,f)){f=a.isWebGLRenderTargetCube?34067:3553;var g=d.get(b).__webglTexture;c.bindTexture(f,g);q(f,b,a.width,a.height);c.bindTexture(f,null)}};this.updateMultisampleRenderTarget=function(b){if(b.isWebGLMultisampleRenderTarget)if(e.isWebGL2){var c= +d.get(b);a.bindFramebuffer(36008,c.__webglMultisampledFramebuffer);a.bindFramebuffer(36009,c.__webglFramebuffer);c=b.width;var f=b.height,g=16384;b.depthBuffer&&(g|=256);b.stencilBuffer&&(g|=1024);a.blitFramebuffer(0,0,c,f,0,0,c,f,g,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")};this.safeSetTexture2D=function(a,b){a&&a.isWebGLRenderTarget&&(!1===G&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."), +G=!0),a=a.texture);n(a,b)};this.safeSetTextureCube=function(a,b){a&&a.isWebGLRenderTargetCube&&(!1===I&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),I=!0),a=a.texture);a&&a.isCubeTexture||Array.isArray(a.image)&&6===a.image.length?A(a,b):w(a,b)}}function pf(a,b,c){return{convert:function(a){if(1E3===a)return 10497;if(1001===a)return 33071;if(1002===a)return 33648;if(1003===a)return 9728;if(1004===a)return 9984; +if(1005===a)return 9986;if(1006===a)return 9729;if(1007===a)return 9985;if(1008===a)return 9987;if(1009===a)return 5121;if(1017===a)return 32819;if(1018===a)return 32820;if(1019===a)return 33635;if(1010===a)return 5120;if(1011===a)return 5122;if(1012===a)return 5123;if(1013===a)return 5124;if(1014===a)return 5125;if(1015===a)return 5126;if(1016===a){if(c.isWebGL2)return 5131;var d=b.get("OES_texture_half_float");if(null!==d)return d.HALF_FLOAT_OES}if(1021===a)return 6406;if(1022===a)return 6407;if(1023=== +a)return 6408;if(1024===a)return 6409;if(1025===a)return 6410;if(1026===a)return 6402;if(1027===a)return 34041;if(1028===a)return 6403;if(100===a)return 32774;if(101===a)return 32778;if(102===a)return 32779;if(200===a)return 0;if(201===a)return 1;if(202===a)return 768;if(203===a)return 769;if(204===a)return 770;if(205===a)return 771;if(206===a)return 772;if(207===a)return 773;if(208===a)return 774;if(209===a)return 775;if(210===a)return 776;if(33776===a||33777===a||33778===a||33779===a)if(d=b.get("WEBGL_compressed_texture_s3tc"), +null!==d){if(33776===a)return d.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===a)return d.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===a)return d.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===a)return d.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===a||35841===a||35842===a||35843===a)if(d=b.get("WEBGL_compressed_texture_pvrtc"),null!==d){if(35840===a)return d.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===a)return d.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===a)return d.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===a)return d.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196=== +a&&(d=b.get("WEBGL_compressed_texture_etc1"),null!==d))return d.COMPRESSED_RGB_ETC1_WEBGL;if(37808===a||37809===a||37810===a||37811===a||37812===a||37813===a||37814===a||37815===a||37816===a||37817===a||37818===a||37819===a||37820===a||37821===a)if(d=b.get("WEBGL_compressed_texture_astc"),null!==d)return a;if(103===a||104===a){if(c.isWebGL2){if(103===a)return 32775;if(104===a)return 32776}d=b.get("EXT_blend_minmax");if(null!==d){if(103===a)return d.MIN_EXT;if(104===a)return d.MAX_EXT}}if(1020===a){if(c.isWebGL2)return 34042; +d=b.get("WEBGL_depth_texture");if(null!==d)return d.UNSIGNED_INT_24_8_WEBGL}return 0}}}function Vb(){C.call(this);this.type="Group"}function Xa(){C.call(this);this.type="Camera";this.matrixWorldInverse=new P;this.projectionMatrix=new P;this.projectionMatrixInverse=new P}function ja(a,b,c,d){Xa.call(this);this.type="PerspectiveCamera";this.fov=void 0!==a?a:50;this.zoom=1;this.near=void 0!==c?c:.1;this.far=void 0!==d?d:2E3;this.focus=10;this.aspect=void 0!==b?b:1;this.view=null;this.filmGauge=35;this.filmOffset= +0;this.updateProjectionMatrix()}function Gc(a){ja.call(this);this.cameras=a||[]}function qf(a,b,c){rf.setFromMatrixPosition(b.matrixWorld);sf.setFromMatrixPosition(c.matrixWorld);var d=rf.distanceTo(sf),e=b.projectionMatrix.elements,f=c.projectionMatrix.elements,g=e[14]/(e[10]-1);c=e[14]/(e[10]+1);var h=(e[9]+1)/e[5],k=(e[9]-1)/e[5],m=(e[8]-1)/e[0],p=(f[8]+1)/f[0];e=g*m;f=g*p;p=d/(-m+p);m=p*-m;b.matrixWorld.decompose(a.position,a.quaternion,a.scale);a.translateX(m);a.translateZ(p);a.matrixWorld.compose(a.position, +a.quaternion,a.scale);a.matrixWorldInverse.getInverse(a.matrixWorld);b=g+p;g=c+p;a.projectionMatrix.makePerspective(e-m,f+(d-m),h*c/g*b,k*c/g*b,b,g)}function tf(a){function b(){return null!==e&&!0===e.isPresenting}function c(){if(b()){var c=e.getEyeParameters("left"),f=c.renderWidth*p;c=c.renderHeight*p;y=a.getPixelRatio();a.getSize(w);a.setDrawingBufferSize(2*f,c,1);J.start()}else d.enabled&&a.setDrawingBufferSize(w.width,w.height,y),J.stop()}var d=this,e=null,f=null,g=null,h=[],k=new P,m=new P, +p=1,q="stage";"undefined"!==typeof window&&"VRFrameData"in window&&(f=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",c,!1));var v=new P,l=new Z,r=new n,u=new ja;u.bounds=new ca(0,0,.5,1);u.layers.enable(1);var x=new ja;x.bounds=new ca(.5,0,.5,1);x.layers.enable(2);var A=new Gc([u,x]);A.layers.enable(1);A.layers.enable(2);var w=new B,y,D=[];this.enabled=!1;this.getController=function(a){var b=h[a];void 0===b&&(b=new Vb,b.matrixAutoUpdate=!1,b.visible=!1,h[a]=b);return b};this.getDevice= +function(){return e};this.setDevice=function(a){void 0!==a&&(e=a);J.setContext(a)};this.setFramebufferScaleFactor=function(a){p=a};this.setFrameOfReferenceType=function(a){q=a};this.setPoseTarget=function(a){void 0!==a&&(g=a)};this.getCamera=function(a){var c="stage"===q?1.6:0;if(!1===b())return a.position.set(0,c,0),a.rotation.set(0,0,0),a;e.depthNear=a.near;e.depthFar=a.far;e.getFrameData(f);if("stage"===q){var d=e.stageParameters;d?k.fromArray(d.sittingToStandingTransform):k.makeTranslation(0, +c,0)}c=f.pose;d=null!==g?g:a;d.matrix.copy(k);d.matrix.decompose(d.position,d.quaternion,d.scale);null!==c.orientation&&(l.fromArray(c.orientation),d.quaternion.multiply(l));null!==c.position&&(l.setFromRotationMatrix(k),r.fromArray(c.position),r.applyQuaternion(l),d.position.add(r));d.updateMatrixWorld();u.near=a.near;x.near=a.near;u.far=a.far;x.far=a.far;u.matrixWorldInverse.fromArray(f.leftViewMatrix);x.matrixWorldInverse.fromArray(f.rightViewMatrix);m.getInverse(k);"stage"===q&&(u.matrixWorldInverse.multiply(m), +x.matrixWorldInverse.multiply(m));a=d.parent;null!==a&&(v.getInverse(a.matrixWorld),u.matrixWorldInverse.multiply(v),x.matrixWorldInverse.multiply(v));u.matrixWorld.getInverse(u.matrixWorldInverse);x.matrixWorld.getInverse(x.matrixWorldInverse);u.projectionMatrix.fromArray(f.leftProjectionMatrix);x.projectionMatrix.fromArray(f.rightProjectionMatrix);qf(A,u,x);a=e.getLayers();a.length&&(a=a[0],null!==a.leftBounds&&4===a.leftBounds.length&&u.bounds.fromArray(a.leftBounds),null!==a.rightBounds&&4=== +a.rightBounds.length&&x.bounds.fromArray(a.rightBounds));a:for(a=0;af.matrixWorld.determinant();Z.setMaterial(e,h);var l=k(a,c,e,f),m=!1;if(b!==d.id||M!==l.id||W!==(!0===e.wireframe))b=d.id,M=l.id,W=!0===e.wireframe,m=!0;f.morphTargetInfluences&&(xa.update(f,d,e,l),m=!0);h=d.index;var q=d.attributes.position;c=1;!0===e.wireframe&&(h=ua.getWireframeAttribute(d),c=2);a=Aa;if(null!==h){var p=sa.get(h);a=Ba;a.setIndex(p)}if(m){if(d&& -d.isInstancedBufferGeometry&&!za.isWebGL2&&null===ma.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{Z.initAttributes();m=d.attributes;l=l.getAttributes();var v=e.defaultAttributeValues;for(A in l){var r=l[A];if(0<=r){var t=m[A];if(void 0!==t){var n=t.normalized,u=t.itemSize,x=sa.get(t);if(void 0!==x){var w=x.buffer,y=x.type;x=x.bytesPerElement;if(t.isInterleavedBufferAttribute){var C= -t.data,K=C.stride;t=t.offset;C&&C.isInstancedInterleavedBuffer?(Z.enableAttributeAndDivisor(r,C.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=C.meshPerAttribute*C.count)):Z.enableAttribute(r);L.bindBuffer(34962,w);L.vertexAttribPointer(r,u,y,n,K*x,t*x)}else t.isInstancedBufferAttribute?(Z.enableAttributeAndDivisor(r,t.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=t.meshPerAttribute*t.count)):Z.enableAttribute(r),L.bindBuffer(34962,w),L.vertexAttribPointer(r, -u,y,n,0,0)}}else if(void 0!==v&&(n=v[A],void 0!==n))switch(n.length){case 2:L.vertexAttrib2fv(r,n);break;case 3:L.vertexAttrib3fv(r,n);break;case 4:L.vertexAttrib4fv(r,n);break;default:L.vertexAttrib1fv(r,n)}}}Z.disableUnusedAttributes()}null!==h&&L.bindBuffer(34963,p.buffer)}p=Infinity;null!==h?p=h.count:void 0!==q&&(p=q.count);h=d.drawRange.start*c;q=null!==g?g.start*c:0;var A=Math.max(h,q);g=Math.max(0,Math.min(p,h+d.drawRange.count*c,q+(null!==g?g.count*c:Infinity))-1-A+1);if(0!==g){if(f.isMesh)if(!0=== -e.wireframe)Z.setLineWidth(e.wireframeLinewidth*(null===G?S:1)),a.setMode(1);else switch(f.drawMode){case 0:a.setMode(4);break;case 1:a.setMode(5);break;case 2:a.setMode(6)}else f.isLine?(e=e.linewidth,void 0===e&&(e=1),Z.setLineWidth(e*(null===G?S:1)),f.isLineSegments?a.setMode(1):f.isLineLoop?a.setMode(2):a.setMode(3)):f.isPoints?a.setMode(0):f.isSprite&&a.setMode(4);d&&d.isInstancedBufferGeometry?0=za.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+a+" texture units while this GPU supports only "+ -za.maxTextures);ja+=1;return a};this.setTexture2D=function(){var a=!1;return function(b,c){b&&b.isWebGLRenderTarget&&(a||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),a=!0),b=b.texture);da.setTexture2D(b,c)}}();this.setTexture2DArray=function(a,b){da.setTexture2DArray(a,b)};this.setTexture3D=function(a,b){da.setTexture3D(a,b)};this.setTexture=function(){var a=!1;return function(b,c){a||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."), -a=!0);da.setTexture2D(b,c)}}();this.setTextureCube=function(){var a=!1;return function(b,c){b&&b.isWebGLRenderTargetCube&&(a||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),a=!0),b=b.texture);b&&b.isCubeTexture||Array.isArray(b.image)&&6===b.image.length?da.setTextureCube(b,c):da.setTextureCubeDynamic(b,c)}}();this.setFramebuffer=function(a){O=a};this.getRenderTarget=function(){return G};this.setRenderTarget=function(a, -b,c){(G=a)&&void 0===Da.get(a).__webglFramebuffer&&da.setupRenderTarget(a);var d=O,e=!1;a?(d=Da.get(a).__webglFramebuffer,a.isWebGLRenderTargetCube?(d=d[b||0],e=!0):d=a.isWebGLMultisampleRenderTarget?Da.get(a).__webglMultisampledFramebuffer:d,U.copy(a.viewport),X.copy(a.scissor),ca=a.scissorTest):(U.copy(ha).multiplyScalar(S),X.copy(aa).multiplyScalar(S),ca=qa);eb!==d&&(L.bindFramebuffer(36160,d),eb=d);Z.viewport(U);Z.scissor(X);Z.setScissorTest(ca);e&&(a=Da.get(a.texture),L.framebufferTexture2D(36160, -36064,34069+(b||0),a.__webglTexture,c||0))};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(a&&a.isWebGLRenderTarget){var g=Da.get(a).__webglFramebuffer;if(g){var h=!1;g!==eb&&(L.bindFramebuffer(36160,g),h=!0);try{var l=a.texture,m=l.format,q=l.type;1023!==m&&ka.convert(m)!==L.getParameter(35739)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):1009===q||ka.convert(q)===L.getParameter(35738)||1015===q&&(za.isWebGL2||ma.get("OES_texture_float")|| -ma.get("WEBGL_color_buffer_float"))||1016===q&&(za.isWebGL2?ma.get("EXT_color_buffer_float"):ma.get("EXT_color_buffer_half_float"))?36053===L.checkFramebufferStatus(36160)?0<=b&&b<=a.width-d&&0<=c&&c<=a.height-e&&L.readPixels(b,c,d,e,ka.convert(m),ka.convert(q),f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{h&& -L.bindFramebuffer(36160,eb)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")};this.copyFramebufferToTexture=function(a,b,c){var d=b.image.width,e=b.image.height,f=ka.convert(b.format);this.setTexture2D(b,0);L.copyTexImage2D(3553,c||0,f,a.x,a.y,d,e,0)};this.copyTextureToTexture=function(a,b,c,d){var e=b.image.width,f=b.image.height,g=ka.convert(c.format),h=ka.convert(c.type);this.setTexture2D(c,0);b.isDataTexture?L.texSubImage2D(3553, -d||0,a.x,a.y,e,f,g,h,b.image.data):L.texSubImage2D(3553,d||0,a.x,a.y,g,h,b.image)}}function xd(a,b){this.name="";this.color=new J(a);this.density=void 0!==b?b:2.5E-4}function yd(a,b,c){this.name="";this.color=new J(a);this.near=void 0!==b?b:1;this.far=void 0!==c?c:1E3}function zd(){E.call(this);this.type="Scene";this.overrideMaterial=this.fog=this.background=null;this.autoUpdate=!0}function ub(a,b){this.array=a;this.stride=b;this.count=void 0!==a?a.length/b:0;this.dynamic=!1;this.updateRange={offset:0, -count:-1};this.version=0}function Fc(a,b,c,d){this.data=a;this.itemSize=b;this.offset=c;this.normalized=!0===d}function jb(a){N.call(this);this.type="SpriteMaterial";this.color=new J(16777215);this.map=null;this.rotation=0;this.sizeAttenuation=!0;this.lights=!1;this.transparent=!0;this.setValues(a)}function Gc(a){E.call(this);this.type="Sprite";if(void 0===Tb){Tb=new D;var b=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]);b=new ub(b,5);Tb.setIndex([0,1,2,0,2,3]);Tb.addAttribute("position", -new Fc(b,3,0,!1));Tb.addAttribute("uv",new Fc(b,2,3,!1))}this.geometry=Tb;this.material=void 0!==a?a:new jb;this.center=new z(.5,.5)}function Hc(){E.call(this);this.type="LOD";Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Ic(a,b){a&&a.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");va.call(this,a,b);this.type="SkinnedMesh";this.bindMode="attached";this.bindMatrix=new Q;this.bindMatrixInverse=new Q}function Ad(a, -b){a=a||[];this.bones=a.slice(0);this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===b)this.calculateInverses();else if(this.bones.length===b.length)this.boneInverses=b.slice(0);else for(console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[],a=0,b=this.bones.length;ac;c++){var p=q[h[c]];var k=q[h[(c+1)%3]];f[0]=Math.min(p,k);f[1]=Math.max(p,k);p=f[0]+","+f[1];void 0===g[p]&&(g[p]={index1:f[0],index2:f[1]})}}for(p in g)m=g[p],h=a.vertices[m.index1],b.push(h.x,h.y,h.z),h=a.vertices[m.index2],b.push(h.x,h.y,h.z)}else if(a&& -a.isBufferGeometry)if(h=new n,null!==a.index){l=a.attributes.position;q=a.index;var r=a.groups;0===r.length&&(r=[{start:0,count:q.count,materialIndex:0}]);a=0;for(e=r.length;ac;c++)p=q.getX(m+c),k=q.getX(m+(c+1)%3),f[0]=Math.min(p,k),f[1]=Math.max(p,k),p=f[0]+","+f[1],void 0===g[p]&&(g[p]={index1:f[0],index2:f[1]});for(p in g)m=g[p],h.fromBufferAttribute(l,m.index1),b.push(h.x,h.y,h.z),h.fromBufferAttribute(l,m.index2),b.push(h.x, -h.y,h.z)}else for(l=a.attributes.position,m=0,d=l.count/3;mc;c++)g=3*m+c,h.fromBufferAttribute(l,g),b.push(h.x,h.y,h.z),g=3*m+(c+1)%3,h.fromBufferAttribute(l,g),b.push(h.x,h.y,h.z);this.addAttribute("position",new B(b,3))}function Lc(a,b,c){G.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};this.fromBufferGeometry(new Xb(a,b,c));this.mergeVertices()}function Xb(a,b,c){D.call(this);this.type="ParametricBufferGeometry";this.parameters={func:a,slices:b, -stacks:c};var d=[],e=[],f=[],g=[],h=new n,l=new n,m=new n,q=new n,p=new n,k,r;3>a.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var t=b+1;for(k=0;k<=c;k++){var u=k/c;for(r=0;r<=b;r++){var x=r/b;a(x,u,l);e.push(l.x,l.y,l.z);0<=x-1E-5?(a(x-1E-5,u,m),q.subVectors(l,m)):(a(x+1E-5,u,m),q.subVectors(m,l));0<=u-1E-5?(a(x,u-1E-5,m),p.subVectors(l,m)):(a(x,u+1E-5,m),p.subVectors(m,l));h.crossVectors(q,p).normalize();f.push(h.x,h.y,h.z);g.push(x,u)}}for(k= -0;kd&&1===a.x&&(l[b]=a.x-1);0===c.x&&0===c.z&&(l[b]=d/2/Math.PI+.5)}D.call(this);this.type="PolyhedronBufferGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;var h=[],l=[];(function(a){for(var c=new n,d=new n,g=new n,h=0;he&&(.2>b&&(l[a+0]+=1),.2>c&&(l[a+2]+=1),.2>d&&(l[a+ -4]+=1))})();this.addAttribute("position",new B(h,3));this.addAttribute("normal",new B(h.slice(),3));this.addAttribute("uv",new B(l,2));0===d?this.computeVertexNormals():this.normalizeNormals()}function Nc(a,b){G.call(this);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Yb(a,b));this.mergeVertices()}function Yb(a,b){Aa.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b);this.type="TetrahedronBufferGeometry";this.parameters={radius:a, -detail:b}}function Oc(a,b){G.call(this);this.type="OctahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new vb(a,b));this.mergeVertices()}function vb(a,b){Aa.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type="OctahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Pc(a,b){G.call(this);this.type="IcosahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Zb(a,b));this.mergeVertices()} -function Zb(a,b){var c=(1+Math.sqrt(5))/2;Aa.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[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],a,b);this.type="IcosahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Qc(a,b){G.call(this);this.type="DodecahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new $b(a,b));this.mergeVertices()} -function $b(a,b){var c=(1+Math.sqrt(5))/2,d=1/c;Aa.call(this,[-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,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[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],a,b);this.type="DodecahedronBufferGeometry"; -this.parameters={radius:a,detail:b}}function Rc(a,b,c,d,e,f){G.call(this);this.type="TubeGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};void 0!==f&&console.warn("THREE.TubeGeometry: taper has been removed.");a=new wb(a,b,c,d,e);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;this.fromBufferGeometry(a);this.mergeVertices()}function wb(a,b,c,d,e){function f(e){q=a.getPointAt(e/b,q);var f=g.normals[e];e=g.binormals[e];for(k=0;k<=d;k++){var m= -k/d*Math.PI*2,p=Math.sin(m);m=-Math.cos(m);l.x=m*f.x+p*e.x;l.y=m*f.y+p*e.y;l.z=m*f.z+p*e.z;l.normalize();t.push(l.x,l.y,l.z);h.x=q.x+c*l.x;h.y=q.y+c*l.y;h.z=q.z+c*l.z;r.push(h.x,h.y,h.z)}}D.call(this);this.type="TubeBufferGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var g=a.computeFrenetFrames(b,e);this.tangents=g.tangents;this.normals=g.normals;this.binormals=g.binormals;var h=new n,l=new n,m=new z,q=new n,p,k,r=[],t=[],u=[], -x=[];for(p=0;p=b;e-=d)f=uf(e,a[e],a[e+1],f);f&&xb(f,f.next)&&(Uc(f),f=f.next);return f} -function Vc(a,b){if(!a)return a;b||(b=a);do{var c=!1;if(a.steiner||!xb(a,a.next)&&0!==ra(a.prev,a,a.next))a=a.next;else{Uc(a);a=b=a.prev;if(a===a.next)break;c=!0}}while(c||a!==b);return b}function Wc(a,b,c,d,e,f,g){if(a){if(!g&&f){var h=a,l=h;do null===l.z&&(l.z=je(l.x,l.y,d,e,f)),l.prevZ=l.prev,l=l.nextZ=l.next;while(l!==h);l.prevZ.nextZ=null;l.prevZ=null;h=l;var m,q,p,k,r=1;do{l=h;var t=h=null;for(q=0;l;){q++;var n=l;for(m=p=0;mp.x?q.x>r.x?q.x:r.x:p.x>r.x?p.x:r.x,y=q.y>p.y?q.y>r.y?q.y:r.y:p.y>r.y?p.y:r.y;m=je(q.x=m;){if(x!==t.prev&&x!==t.next&&Cd(q.x,q.y,p.x,p.y,r.x,r.y,x.x,x.y)&&0<=ra(x.prev,x,x.next)){t=!1;break a}x=x.prevZ}t=!0}}else a:if(t=a,q=t.prev,p=t,r=t.next,0<=ra(q,p,r))t=!1;else{for(m=t.next.next;m!==t.prev;){if(Cd(q.x,q.y,p.x,p.y,r.x,r.y,m.x,m.y)&&0<=ra(m.prev,m,m.next)){t=!1;break a}m=m.next}t=!0}if(t)b.push(l.i/c),b.push(a.i/c),b.push(n.i/c),Uc(a),h=a=n.next;else if(a=n,a===h){if(!g)Wc(Vc(a),b,c,d,e,f,1);else if(1=== -g){g=b;h=c;l=a;do n=l.prev,t=l.next.next,!xb(n,t)&&vf(n,l,l.next,t)&&Xc(n,t)&&Xc(t,n)&&(g.push(n.i/h),g.push(l.i/h),g.push(t.i/h),Uc(l),Uc(l.next),l=a=t),l=l.next;while(l!==a);a=l;Wc(a,b,c,d,e,f,2)}else if(2===g)a:{g=a;do{for(h=g.next.next;h!==g.prev;){if(l=g.i!==h.i){l=g;n=h;if(t=l.next.i!==n.i&&l.prev.i!==n.i){b:{t=l;do{if(t.i!==l.i&&t.next.i!==l.i&&t.i!==n.i&&t.next.i!==n.i&&vf(t,t.next,l,n)){t=!0;break b}t=t.next}while(t!==l);t=!1}t=!t}if(t=t&&Xc(l,n)&&Xc(n,l)){t=l;q=!1;p=(l.x+n.x)/2;n=(l.y+n.y)/ -2;do t.y>n!==t.next.y>n&&t.next.y!==t.y&&p<(t.next.x-t.x)*(n-t.y)/(t.next.y-t.y)+t.x&&(q=!q),t=t.next;while(t!==l);t=q}l=t}if(l){a=wf(g,h);g=Vc(g,g.next);a=Vc(a,a.next);Wc(g,b,c,d,e,f);Wc(a,b,c,d,e,f);break a}h=h.next}g=g.next}while(g!==a)}break}}}}function ch(a,b){return a.x-b.x}function dh(a,b){var c=b,d=a.x,e=a.y,f=-Infinity;do{if(e<=c.y&&e>=c.next.y&&c.next.y!==c.y){var g=c.x+(e-c.y)*(c.next.x-c.x)/(c.next.y-c.y);if(g<=d&&g>f){f=g;if(g===d){if(e===c.y)return c;if(e===c.next.y)return c.next}var h= -c.x=c.x&&c.x>=g&&d!==c.x&&Cd(eh.x)&&Xc(c,a)&&(h=c,m=q)}c=c.next}return h}function je(a,b,c,d,e){a=32767*(a-c)*e;b=32767*(b-d)*e;a=(a|a<<8)&16711935;a=(a|a<<4)&252645135;a=(a|a<<2)&858993459;b=(b|b<<8)&16711935;b=(b|b<<4)&252645135;b=(b|b<<2)&858993459;return(a|a<<1)&1431655765|((b| -b<<1)&1431655765)<<1}function eh(a){var b=a,c=a;do b.xra(a.prev,a,a.next)?0<=ra(a,b, -a.next)&&0<=ra(a,a.prev,b):0>ra(a,b,a.prev)||0>ra(a,a.next,b)}function wf(a,b){var c=new ke(a.i,a.x,a.y),d=new ke(b.i,b.x,b.y),e=a.next,f=b.prev;a.next=b;b.prev=a;c.next=e;e.prev=c;d.next=c;c.prev=d;f.next=d;d.prev=f;return d}function uf(a,b,c,d){a=new ke(a,b,c);d?(a.next=d.next,a.prev=d,d.next.prev=a,d.next=a):(a.prev=a,a.next=a);return a}function Uc(a){a.next.prev=a.prev;a.prev.next=a.next;a.prevZ&&(a.prevZ.nextZ=a.nextZ);a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function ke(a,b,c){this.i=a;this.x=b;this.y= -c;this.nextZ=this.prevZ=this.z=this.next=this.prev=null;this.steiner=!1}function xf(a){var b=a.length;2Number.EPSILON){var l=Math.sqrt(h),m=Math.sqrt(f*f+g*g);h=b.x-e/l;b=b.y+d/l;g=((c.x-g/m-h)*g-(c.y+f/m-b)*f)/(d*g-e*f);f=h+d*g-a.x;d=b+e*g-a.y;e=f*f+d*d;if(2>=e)return new z(f,d);e=Math.sqrt(e/2)}else a=!1,d>Number.EPSILON?f>Number.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(f=-e,e=Math.sqrt(h)):(f=d,d=e,e=Math.sqrt(h/2));return new z(f/e,d/ -e)}function h(a,b){for(I=a.length;0<=--I;){var c=I;var f=I-1;0>f&&(f=a.length-1);var g,h=w+2*F;for(g=0;gq;q++){var k=m[f[q]];var n=m[f[(q+1)%3]];d[0]=Math.min(k,n);d[1]=Math.max(k,n);k=d[0]+","+d[1];void 0=== -e[k]?e[k]={index1:d[0],index2:d[1],face1:h,face2:void 0}:e[k].face2=h}for(k in e)if(d=e[k],void 0===d.face2||g[d.face1].normal.dot(g[d.face2].normal)<=b)f=a[d.index1],c.push(f.x,f.y,f.z),f=a[d.index2],c.push(f.x,f.y,f.z);this.addAttribute("position",new B(c,3))}function Cb(a,b,c,d,e,f,g,h){G.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};this.fromBufferGeometry(new ab(a,b,c,d,e, -f,g,h));this.mergeVertices()}function ab(a,b,c,d,e,f,g,h){function l(c){var e,f=new z,l=new n,p=0,u=!0===c?a:b,w=!0===c?1:-1;var D=t;for(e=1;e<=d;e++)k.push(0,x*w,0),v.push(0,w,0),r.push(.5,.5),t++;var E=t;for(e=0;e<=d;e++){var B=e/d*h+g,G=Math.cos(B);B=Math.sin(B);l.x=u*B;l.y=x*w;l.z=u*G;k.push(l.x,l.y,l.z);v.push(0,w,0);f.x=.5*G+.5;f.y=.5*B*w+.5;r.push(f.x,f.y);t++}for(e=0;ethis.duration&&this.resetDuration()}function gh(a){switch(a.toLowerCase()){case "scalar":case "double":case "float":case "number":case "integer":return ic;case "vector":case "vector2":case "vector3":case "vector4":return jc;case "color":return Gd;case "quaternion":return fd;case "bool":case "boolean":return Fd;case "string":return Id}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+a);}function hh(a){if(void 0===a.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse"); -var b=gh(a.type);if(void 0===a.times){var c=[],d=[];ta.flattenJSON(a.keys,c,d,"value");a.times=c;a.values=d}return void 0!==b.parse?b.parse(a):new b(a.name,a.times,a.values,a.interpolation)}function le(a,b,c){var d=this,e=!1,f=0,g=0,h=void 0;this.onStart=void 0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){g++;if(!1===e&&void 0!==d.onStart)d.onStart(a,f,g);e=!0};this.itemEnd=function(a){f++;if(void 0!==d.onProgress)d.onProgress(a,f,g);if(f===g&&(e=!1,void 0!==d.onLoad))d.onLoad()}; -this.itemError=function(a){if(void 0!==d.onError)d.onError(a)};this.resolveURL=function(a){return h?h(a):a};this.setURLModifier=function(a){h=a;return this}}function Ja(a){this.manager=void 0!==a?a:Ba}function Bf(a){this.manager=void 0!==a?a:Ba}function Cf(a){this.manager=void 0!==a?a:Ba;this._parser=null}function me(a){this.manager=void 0!==a?a:Ba;this._parser=null}function gd(a){this.manager=void 0!==a?a:Ba}function ne(a){this.manager=void 0!==a?a:Ba}function Jd(a){this.manager=void 0!==a?a:Ba} -function O(){this.type="Curve";this.arcLengthDivisions=200}function Ea(a,b,c,d,e,f,g,h){O.call(this);this.type="EllipseCurve";this.aX=a||0;this.aY=b||0;this.xRadius=c||1;this.yRadius=d||1;this.aStartAngle=e||0;this.aEndAngle=f||2*Math.PI;this.aClockwise=g||!1;this.aRotation=h||0}function kc(a,b,c,d,e,f){Ea.call(this,a,b,c,c,d,e,f);this.type="ArcCurve"}function oe(){var a=0,b=0,c=0,d=0;return{initCatmullRom:function(e,f,g,h,l){e=l*(g-e);h=l*(h-f);a=f;b=e;c=-3*f+3*g-2*e-h;d=2*f-2*g+e+h},initNonuniformCatmullRom:function(e, -f,g,h,l,m,q){e=((f-e)/l-(g-e)/(l+m)+(g-f)/m)*m;h=((g-f)/m-(h-f)/(m+q)+(h-g)/q)*m;a=f;b=e;c=-3*f+3*g-2*e-h;d=2*f-2*g+e+h},calc:function(e){var f=e*e;return a+b*e+c*f+d*f*e}}}function pa(a,b,c,d){O.call(this);this.type="CatmullRomCurve3";this.points=a||[];this.closed=b||!1;this.curveType=c||"centripetal";this.tension=d||.5}function Df(a,b,c,d,e){b=.5*(d-b);e=.5*(e-c);var f=a*a;return(2*c-2*d+b+e)*a*f+(-3*c+3*d-2*b-e)*f+b*a+c}function hd(a,b,c,d){var e=1-a;return e*e*b+2*(1-a)*a*c+a*a*d}function id(a, -b,c,d,e){var f=1-a,g=1-a;return f*f*f*b+3*g*g*a*c+3*(1-a)*a*a*d+a*a*a*e}function Ka(a,b,c,d){O.call(this);this.type="CubicBezierCurve";this.v0=a||new z;this.v1=b||new z;this.v2=c||new z;this.v3=d||new z}function Xa(a,b,c,d){O.call(this);this.type="CubicBezierCurve3";this.v0=a||new n;this.v1=b||new n;this.v2=c||new n;this.v3=d||new n}function ka(a,b){O.call(this);this.type="LineCurve";this.v1=a||new z;this.v2=b||new z}function La(a,b){O.call(this);this.type="LineCurve3";this.v1=a||new n;this.v2=b|| -new n}function Ma(a,b,c){O.call(this);this.type="QuadraticBezierCurve";this.v0=a||new z;this.v1=b||new z;this.v2=c||new z}function Ya(a,b,c){O.call(this);this.type="QuadraticBezierCurve3";this.v0=a||new n;this.v1=b||new n;this.v2=c||new n}function Na(a){O.call(this);this.type="SplineCurve";this.points=a||[]}function bb(){O.call(this);this.type="CurvePath";this.curves=[];this.autoClose=!1}function Oa(a){bb.call(this);this.type="Path";this.currentPoint=new z;a&&this.setFromPoints(a)}function kb(a){Oa.call(this, -a);this.uuid=P.generateUUID();this.type="Shape";this.holes=[]}function ja(a,b){E.call(this);this.type="Light";this.color=new J(a);this.intensity=void 0!==b?b:1;this.receiveShadow=void 0}function Kd(a,b,c){ja.call(this,a,c);this.type="HemisphereLight";this.castShadow=void 0;this.position.copy(E.DefaultUp);this.updateMatrix();this.groundColor=new J(b)}function Kb(a){this.camera=a;this.bias=0;this.radius=1;this.mapSize=new z(512,512);this.map=null;this.matrix=new Q}function Ld(){Kb.call(this,new V(50, -1,.5,500))}function Md(a,b,c,d,e,f){ja.call(this,a,b);this.type="SpotLight";this.position.copy(E.DefaultUp);this.updateMatrix();this.target=new E;Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(a){this.intensity=a/Math.PI}});this.distance=void 0!==c?c:0;this.angle=void 0!==d?d:Math.PI/3;this.penumbra=void 0!==e?e:0;this.decay=void 0!==f?f:1;this.shadow=new Ld}function Nd(a,b,c,d){ja.call(this,a,b);this.type="PointLight";Object.defineProperty(this,"power", -{get:function(){return 4*this.intensity*Math.PI},set:function(a){this.intensity=a/(4*Math.PI)}});this.distance=void 0!==c?c:0;this.decay=void 0!==d?d:1;this.shadow=new Kb(new V(90,1,.5,500))}function jd(a,b,c,d,e,f){Ua.call(this);this.type="OrthographicCamera";this.zoom=1;this.view=null;this.left=void 0!==a?a:-1;this.right=void 0!==b?b:1;this.top=void 0!==c?c:1;this.bottom=void 0!==d?d:-1;this.near=void 0!==e?e:.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()}function Od(){Kb.call(this, -new jd(-5,5,5,-5,.5,500))}function Pd(a,b){ja.call(this,a,b);this.type="DirectionalLight";this.position.copy(E.DefaultUp);this.updateMatrix();this.target=new E;this.shadow=new Od}function Qd(a,b){ja.call(this,a,b);this.type="AmbientLight";this.castShadow=void 0}function Rd(a,b,c,d){ja.call(this,a,b);this.type="RectAreaLight";this.width=void 0!==c?c:10;this.height=void 0!==d?d:10}function Sd(a){this.manager=void 0!==a?a:Ba;this.textures={}}function pe(a){this.manager=void 0!==a?a:Ba}function qe(a){this.manager= -void 0!==a?a:Ba;this.resourcePath=""}function re(a){"undefined"===typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported.");"undefined"===typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported.");this.manager=void 0!==a?a:Ba;this.options=void 0}function se(){this.type="ShapePath";this.color=new J;this.subPaths=[];this.currentPath=null}function te(a){this.type="Font";this.data=a}function Ef(a){this.manager=void 0!==a?a:Ba}function kd(){} -function ue(a){this.manager=void 0!==a?a:Ba}function Ff(){this.type="StereoCamera";this.aspect=1;this.eyeSep=.064;this.cameraL=new V;this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate=!1;this.cameraR=new V;this.cameraR.layers.enable(2);this.cameraR.matrixAutoUpdate=!1}function ld(a,b,c,d){E.call(this);this.type="CubeCamera";var e=new V(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new n(1,0,0));this.add(e);var f=new V(90,1,a,b);f.up.set(0,-1,0);f.lookAt(new n(-1,0,0));this.add(f);var g=new V(90,1, -a,b);g.up.set(0,0,1);g.lookAt(new n(0,1,0));this.add(g);var h=new V(90,1,a,b);h.up.set(0,0,-1);h.lookAt(new n(0,-1,0));this.add(h);var l=new V(90,1,a,b);l.up.set(0,-1,0);l.lookAt(new n(0,0,1));this.add(l);var m=new V(90,1,a,b);m.up.set(0,-1,0);m.lookAt(new n(0,0,-1));this.add(m);d=d||{format:1022,magFilter:1006,minFilter:1006};this.renderTarget=new mb(c,c,d);this.renderTarget.texture.name="CubeCamera";this.update=function(a,b){null===this.parent&&this.updateMatrixWorld();var c=a.getRenderTarget(), -d=this.renderTarget,q=d.texture.generateMipmaps;d.texture.generateMipmaps=!1;a.setRenderTarget(d,0);a.render(b,e);a.setRenderTarget(d,1);a.render(b,f);a.setRenderTarget(d,2);a.render(b,g);a.setRenderTarget(d,3);a.render(b,h);a.setRenderTarget(d,4);a.render(b,l);d.texture.generateMipmaps=q;a.setRenderTarget(d,5);a.render(b,m);a.setRenderTarget(c)};this.clear=function(a,b,c,d){for(var e=a.getRenderTarget(),f=this.renderTarget,g=0;6>g;g++)a.setRenderTarget(f,g),a.clear(b,c,d);a.setRenderTarget(e)}}function ve(a){this.autoStart= -void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}function we(){E.call(this);this.type="AudioListener";this.context=xe.getContext();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.filter=null;this.timeDelta=0}function lc(a){E.call(this);this.type="Audio";this.listener=a;this.context=a.context;this.gain=this.context.createGain();this.gain.connect(a.getInput());this.autoplay=!1;this.buffer=null;this.detune=0;this.loop=!1;this.offset= -this.startTime=0;this.playbackRate=1;this.isPlaying=!1;this.hasPlaybackControl=!0;this.sourceType="empty";this.filters=[]}function ye(a){lc.call(this,a);this.panner=this.context.createPanner();this.panner.connect(this.gain)}function ze(a,b){this.analyser=a.context.createAnalyser();this.analyser.fftSize=void 0!==b?b:2048;this.data=new Uint8Array(this.analyser.frequencyBinCount);a.getOutput().connect(this.analyser)}function Ae(a,b,c){this.binding=a;this.valueSize=c;a=Float64Array;switch(b){case "quaternion":b= -this._slerp;break;case "string":case "bool":a=Array;b=this._select;break;default:b=this._lerp}this.buffer=new a(4*c);this._mixBufferRegion=b;this.referenceCount=this.useCount=this.cumulativeWeight=0}function Gf(a,b,c){c=c||na.parseTrackName(b);this._targetGroup=a;this._bindings=a.subscribe_(b,c)}function na(a,b,c){this.path=b;this.parsedPath=c||na.parseTrackName(b);this.node=na.findNode(a,this.parsedPath.nodeName)||a;this.rootNode=a}function Hf(){this.uuid=P.generateUUID();this._objects=Array.prototype.slice.call(arguments); -this.nCachedObjects_=0;var a={};this._indicesByUUID=a;for(var b=0,c=arguments.length;b!==c;++b)a[arguments[b].uuid]=b;this._paths=[];this._parsedPaths=[];this._bindings=[];this._bindingsIndicesByPath={};var d=this;this.stats={objects:{get total(){return d._objects.length},get inUse(){return this.total-d.nCachedObjects_}},get bindingsPerObject(){return d._bindings.length}}}function If(a,b,c){this._mixer=a;this._clip=b;this._localRoot=c||null;a=b.tracks;b=a.length;c=Array(b);for(var d={endingStart:2400, +a=d.program.getUniforms();a=hb.seqWithValue(a.seq,c);d.uniformsList=a}function l(a,b,c,d){aa.resetTextureUnits();var e=Ba.get(c),f=e.lightsHash,g=z.state.lights.state.hash;ha&&(fe||a!==S)&&Z.setState(c.clippingPlanes,c.clipIntersection,c.clipShadows,a,e,a===S&&c.id===Q);!1===c.needsUpdate&&(void 0===e.program?c.needsUpdate=!0:c.fog&&e.fog!==b?c.needsUpdate=!0:!c.lights||f.stateID===g.stateID&&f.directionalLength===g.directionalLength&&f.pointLength===g.pointLength&&f.spotLength===g.spotLength&&f.rectAreaLength=== +g.rectAreaLength&&f.hemiLength===g.hemiLength&&f.shadowsLength===g.shadowsLength?void 0===e.numClippingPlanes||e.numClippingPlanes===Z.numPlanes&&e.numIntersection===Z.numIntersection||(c.needsUpdate=!0):c.needsUpdate=!0);c.needsUpdate&&(q(c,b,d),c.needsUpdate=!1);var h=!1,k=!1,m=!1;f=e.program;g=f.getUniforms();var p=e.shader.uniforms;ba.useProgram(f.program)&&(m=k=h=!0);c.id!==Q&&(Q=c.id,k=!0);if(h||S!==a){g.setValue(L,"projectionMatrix",a.projectionMatrix);Aa.logarithmicDepthBuffer&&g.setValue(L, +"logDepthBufFC",2/(Math.log(a.far+1)/Math.LN2));S!==a&&(S=a,m=k=!0);if(c.isShaderMaterial||c.isMeshPhongMaterial||c.isMeshStandardMaterial||c.envMap)h=g.map.cameraPosition,void 0!==h&&h.setValue(L,kb.setFromMatrixPosition(a.matrixWorld));(c.isMeshPhongMaterial||c.isMeshLambertMaterial||c.isMeshBasicMaterial||c.isMeshStandardMaterial||c.isShaderMaterial||c.skinning)&&g.setValue(L,"viewMatrix",a.matrixWorldInverse)}if(c.skinning&&(g.setOptional(L,d,"bindMatrix"),g.setOptional(L,d,"bindMatrixInverse"), +a=d.skeleton))if(h=a.bones,Aa.floatVertexTextures){if(void 0===a.boneTexture){h=Math.sqrt(4*h.length);h=K.ceilPowerOfTwo(h);h=Math.max(h,4);var l=new Float32Array(h*h*4);l.set(a.boneMatrices);var v=new qb(l,h,h,1023,1015);v.needsUpdate=!0;a.boneMatrices=l;a.boneTexture=v;a.boneTextureSize=h}g.setValue(L,"boneTexture",a.boneTexture,aa);g.setValue(L,"boneTextureSize",a.boneTextureSize)}else g.setOptional(L,a,"boneMatrices");k&&(g.setValue(L,"toneMappingExposure",fa.toneMappingExposure),g.setValue(L, +"toneMappingWhitePoint",fa.toneMappingWhitePoint),c.lights&&(k=m,p.ambientLightColor.needsUpdate=k,p.directionalLights.needsUpdate=k,p.pointLights.needsUpdate=k,p.spotLights.needsUpdate=k,p.rectAreaLights.needsUpdate=k,p.hemisphereLights.needsUpdate=k),b&&c.fog&&(p.fogColor.value=b.color,b.isFog?(p.fogNear.value=b.near,p.fogFar.value=b.far):b.isFogExp2&&(p.fogDensity.value=b.density)),c.isMeshBasicMaterial?t(p,c):c.isMeshLambertMaterial?(t(p,c),c.emissiveMap&&(p.emissiveMap.value=c.emissiveMap)): +c.isMeshPhongMaterial?(t(p,c),c.isMeshToonMaterial?(r(p,c),c.gradientMap&&(p.gradientMap.value=c.gradientMap)):r(p,c)):c.isMeshStandardMaterial?(t(p,c),c.isMeshPhysicalMaterial?(u(p,c),p.reflectivity.value=c.reflectivity,p.clearCoat.value=c.clearCoat,p.clearCoatRoughness.value=c.clearCoatRoughness):u(p,c)):c.isMeshMatcapMaterial?(t(p,c),c.matcap&&(p.matcap.value=c.matcap),c.bumpMap&&(p.bumpMap.value=c.bumpMap,p.bumpScale.value=c.bumpScale,1===c.side&&(p.bumpScale.value*=-1)),c.normalMap&&(p.normalMap.value= +c.normalMap,p.normalScale.value.copy(c.normalScale),1===c.side&&p.normalScale.value.negate()),c.displacementMap&&(p.displacementMap.value=c.displacementMap,p.displacementScale.value=c.displacementScale,p.displacementBias.value=c.displacementBias)):c.isMeshDepthMaterial?(t(p,c),c.displacementMap&&(p.displacementMap.value=c.displacementMap,p.displacementScale.value=c.displacementScale,p.displacementBias.value=c.displacementBias)):c.isMeshDistanceMaterial?(t(p,c),c.displacementMap&&(p.displacementMap.value= +c.displacementMap,p.displacementScale.value=c.displacementScale,p.displacementBias.value=c.displacementBias),p.referencePosition.value.copy(c.referencePosition),p.nearDistance.value=c.nearDistance,p.farDistance.value=c.farDistance):c.isMeshNormalMaterial?(t(p,c),c.bumpMap&&(p.bumpMap.value=c.bumpMap,p.bumpScale.value=c.bumpScale,1===c.side&&(p.bumpScale.value*=-1)),c.normalMap&&(p.normalMap.value=c.normalMap,p.normalScale.value.copy(c.normalScale),1===c.side&&p.normalScale.value.negate()),c.displacementMap&& +(p.displacementMap.value=c.displacementMap,p.displacementScale.value=c.displacementScale,p.displacementBias.value=c.displacementBias)):c.isLineBasicMaterial?(p.diffuse.value=c.color,p.opacity.value=c.opacity,c.isLineDashedMaterial&&(p.dashSize.value=c.dashSize,p.totalSize.value=c.dashSize+c.gapSize,p.scale.value=c.scale)):c.isPointsMaterial?(p.diffuse.value=c.color,p.opacity.value=c.opacity,p.size.value=c.size*H,p.scale.value=.5*U,p.map.value=c.map,null!==c.map&&(!0===c.map.matrixAutoUpdate&&c.map.updateMatrix(), +p.uvTransform.value.copy(c.map.matrix))):c.isSpriteMaterial?(p.diffuse.value=c.color,p.opacity.value=c.opacity,p.rotation.value=c.rotation,p.map.value=c.map,null!==c.map&&(!0===c.map.matrixAutoUpdate&&c.map.updateMatrix(),p.uvTransform.value.copy(c.map.matrix))):c.isShadowMaterial&&(p.color.value=c.color,p.opacity.value=c.opacity),void 0!==p.ltc_1&&(p.ltc_1.value=G.LTC_1),void 0!==p.ltc_2&&(p.ltc_2.value=G.LTC_2),hb.upload(L,e.uniformsList,p,aa));c.isShaderMaterial&&!0===c.uniformsNeedUpdate&&(hb.upload(L, +e.uniformsList,p,aa),c.uniformsNeedUpdate=!1);c.isSpriteMaterial&&g.setValue(L,"center",d.center);g.setValue(L,"modelViewMatrix",d.modelViewMatrix);g.setValue(L,"normalMatrix",d.normalMatrix);g.setValue(L,"modelMatrix",d.matrixWorld);return f}function t(a,b){a.opacity.value=b.opacity;b.color&&(a.diffuse.value=b.color);b.emissive&&a.emissive.value.copy(b.emissive).multiplyScalar(b.emissiveIntensity);b.map&&(a.map.value=b.map);b.alphaMap&&(a.alphaMap.value=b.alphaMap);b.specularMap&&(a.specularMap.value= +b.specularMap);b.envMap&&(a.envMap.value=b.envMap,a.flipEnvMap.value=b.envMap.isCubeTexture?-1:1,a.reflectivity.value=b.reflectivity,a.refractionRatio.value=b.refractionRatio,a.maxMipLevel.value=Ba.get(b.envMap).__maxMipLevel);b.lightMap&&(a.lightMap.value=b.lightMap,a.lightMapIntensity.value=b.lightMapIntensity);b.aoMap&&(a.aoMap.value=b.aoMap,a.aoMapIntensity.value=b.aoMapIntensity);if(b.map)var c=b.map;else b.specularMap?c=b.specularMap:b.displacementMap?c=b.displacementMap:b.normalMap?c=b.normalMap: +b.bumpMap?c=b.bumpMap:b.roughnessMap?c=b.roughnessMap:b.metalnessMap?c=b.metalnessMap:b.alphaMap?c=b.alphaMap:b.emissiveMap&&(c=b.emissiveMap);void 0!==c&&(c.isWebGLRenderTarget&&(c=c.texture),!0===c.matrixAutoUpdate&&c.updateMatrix(),a.uvTransform.value.copy(c.matrix))}function r(a,b){a.specular.value=b.specular;a.shininess.value=Math.max(b.shininess,1E-4);b.emissiveMap&&(a.emissiveMap.value=b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,a.bumpScale.value=b.bumpScale,1===b.side&&(a.bumpScale.value*= +-1));b.normalMap&&(a.normalMap.value=b.normalMap,a.normalScale.value.copy(b.normalScale),1===b.side&&a.normalScale.value.negate());b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias)}function u(a,b){a.roughness.value=b.roughness;a.metalness.value=b.metalness;b.roughnessMap&&(a.roughnessMap.value=b.roughnessMap);b.metalnessMap&&(a.metalnessMap.value=b.metalnessMap);b.emissiveMap&&(a.emissiveMap.value= +b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,a.bumpScale.value=b.bumpScale,1===b.side&&(a.bumpScale.value*=-1));b.normalMap&&(a.normalMap.value=b.normalMap,a.normalScale.value.copy(b.normalScale),1===b.side&&a.normalScale.value.negate());b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias);b.envMap&&(a.envMapIntensity.value=b.envMapIntensity)}console.log("THREE.WebGLRenderer","103dev");a=a|| +{};var x=void 0!==a.canvas?a.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),A=void 0!==a.context?a.context:null,w=void 0!==a.alpha?a.alpha:!1,y=void 0!==a.depth?a.depth:!0,D=void 0!==a.stencil?a.stencil:!0,J=void 0!==a.antialias?a.antialias:!1,ua=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,F=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,E=void 0!==a.powerPreference?a.powerPreference:"default",C=null,z=null;this.domElement=x;this.context=null;this.sortObjects= +this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.clippingPlanes=[];this.localClippingEnabled=!1;this.gammaFactor=2;this.physicallyCorrectLights=this.gammaOutput=this.gammaInput=!1;this.toneMappingWhitePoint=this.toneMappingExposure=this.toneMapping=1;this.maxMorphTargets=8;this.maxMorphNormals=4;var fa=this,I=!1,M=null,N=null,X=null,Q=-1;var O=b=null;var da=!1;var S=null,T=null,R=new ca,W=new ca,V=null,Ea=x.width,U=x.height,H=1,Y=new ca(0,0,Ea,U),Ha=new ca(0,0, +Ea,U),ea=!1,ja=new vd,Z=new dg,ha=!1,fe=!1,Fc=new P,kb=new n;try{w={alpha:w,depth:y,stencil:D,antialias:J,premultipliedAlpha:ua,preserveDrawingBuffer:F,powerPreference:E};x.addEventListener("webglcontextlost",d,!1);x.addEventListener("webglcontextrestored",e,!1);var L=A||x.getContext("webgl",w)||x.getContext("experimental-webgl",w);if(null===L){if(null!==x.getContext("webgl"))throw Error("Error creating WebGL context with your selected attributes.");throw Error("Error creating WebGL context.");}void 0=== +L.getShaderPrecisionFormat&&(L.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(uf){throw console.error("THREE.WebGLRenderer: "+uf.message),uf;}var na,Aa,ba,lb,Ba,aa,pa,sa,oa,la,ra,qa,ma,va,wa,ya,ia;c();var ka=null;"undefined"!==typeof navigator&&(ka="xr"in navigator?new dh(fa):new tf(fa));this.vr=ka;var za=new nf(fa,oa,Aa.maxTextureSize);this.shadowMap=za;this.getContext=function(){return L};this.getContextAttributes=function(){return L.getContextAttributes()}; +this.forceContextLoss=function(){var a=na.get("WEBGL_lose_context");a&&a.loseContext()};this.forceContextRestore=function(){var a=na.get("WEBGL_lose_context");a&&a.restoreContext()};this.getPixelRatio=function(){return H};this.setPixelRatio=function(a){void 0!==a&&(H=a,this.setSize(Ea,U,!1))};this.getSize=function(a){void 0===a&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),a=new B);return a.set(Ea,U)};this.setSize=function(a,b,c){ka.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."): +(Ea=a,U=b,x.width=a*H,x.height=b*H,!1!==c&&(x.style.width=a+"px",x.style.height=b+"px"),this.setViewport(0,0,a,b))};this.getDrawingBufferSize=function(a){void 0===a&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),a=new B);return a.set(Ea*H,U*H)};this.setDrawingBufferSize=function(a,b,c){Ea=a;U=b;H=c;x.width=a*c;x.height=b*c;this.setViewport(0,0,a,b)};this.getCurrentViewport=function(a){void 0===a&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"), +a=new ca);return a.copy(R)};this.getViewport=function(a){return a.copy(Y)};this.setViewport=function(a,b,c,d){a.isVector4?Y.set(a.x,a.y,a.z,a.w):Y.set(a,b,c,d);ba.viewport(R.copy(Y).multiplyScalar(H))};this.getScissor=function(a){return a.copy(Ha)};this.setScissor=function(a,b,c,d){a.isVector4?Ha.set(a.x,a.y,a.z,a.w):Ha.set(a,b,c,d);ba.scissor(W.copy(Ha).multiplyScalar(H))};this.getScissorTest=function(){return ea};this.setScissorTest=function(a){ba.setScissorTest(ea=a)};this.getClearColor=function(){return ma.getClearColor()}; +this.setClearColor=function(){ma.setClearColor.apply(ma,arguments)};this.getClearAlpha=function(){return ma.getClearAlpha()};this.setClearAlpha=function(){ma.setClearAlpha.apply(ma,arguments)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=16384;if(void 0===b||b)d|=256;if(void 0===c||c)d|=1024;L.clear(d)};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.dispose=function(){x.removeEventListener("webglcontextlost", +d,!1);x.removeEventListener("webglcontextrestored",e,!1);ra.dispose();qa.dispose();Ba.dispose();oa.dispose();ka.dispose();ta.stop()};this.renderBufferImmediate=function(a,b){ba.initAttributes();var c=Ba.get(a);a.hasPositions&&!c.position&&(c.position=L.createBuffer());a.hasNormals&&!c.normal&&(c.normal=L.createBuffer());a.hasUvs&&!c.uv&&(c.uv=L.createBuffer());a.hasColors&&!c.color&&(c.color=L.createBuffer());b=b.getAttributes();a.hasPositions&&(L.bindBuffer(34962,c.position),L.bufferData(34962,a.positionArray, +35048),ba.enableAttribute(b.position),L.vertexAttribPointer(b.position,3,5126,!1,0,0));a.hasNormals&&(L.bindBuffer(34962,c.normal),L.bufferData(34962,a.normalArray,35048),ba.enableAttribute(b.normal),L.vertexAttribPointer(b.normal,3,5126,!1,0,0));a.hasUvs&&(L.bindBuffer(34962,c.uv),L.bufferData(34962,a.uvArray,35048),ba.enableAttribute(b.uv),L.vertexAttribPointer(b.uv,2,5126,!1,0,0));a.hasColors&&(L.bindBuffer(34962,c.color),L.bufferData(34962,a.colorArray,35048),ba.enableAttribute(b.color),L.vertexAttribPointer(b.color, +3,5126,!1,0,0));ba.disableUnusedAttributes();L.drawArrays(4,0,a.count);a.count=0};this.renderBufferDirect=function(a,c,d,e,f,g){var h=f.isMesh&&0>f.matrixWorld.determinant();ba.setMaterial(e,h);var k=l(a,c,e,f),m=!1;if(b!==d.id||O!==k.id||da!==(!0===e.wireframe))b=d.id,O=k.id,da=!0===e.wireframe,m=!0;f.morphTargetInfluences&&(va.update(f,d,e,k),m=!0);h=d.index;var p=d.attributes.position;c=1;!0===e.wireframe&&(h=sa.getWireframeAttribute(d),c=2);a=wa;if(null!==h){var q=pa.get(h);a=ya;a.setIndex(q)}if(m){if(d&& +d.isInstancedBufferGeometry&&!Aa.isWebGL2&&null===na.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{ba.initAttributes();m=d.attributes;k=k.getAttributes();var v=e.defaultAttributeValues;for(D in k){var r=k[D];if(0<=r){var t=m[D];if(void 0!==t){var n=t.normalized,u=t.itemSize,x=pa.get(t);if(void 0!==x){var w=x.buffer,A=x.type;x=x.bytesPerElement;if(t.isInterleavedBufferAttribute){var y= +t.data,J=y.stride;t=t.offset;y&&y.isInstancedInterleavedBuffer?(ba.enableAttributeAndDivisor(r,y.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=y.meshPerAttribute*y.count)):ba.enableAttribute(r);L.bindBuffer(34962,w);L.vertexAttribPointer(r,u,A,n,J*x,t*x)}else t.isInstancedBufferAttribute?(ba.enableAttributeAndDivisor(r,t.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=t.meshPerAttribute*t.count)):ba.enableAttribute(r),L.bindBuffer(34962,w),L.vertexAttribPointer(r, +u,A,n,0,0)}}else if(void 0!==v&&(n=v[D],void 0!==n))switch(n.length){case 2:L.vertexAttrib2fv(r,n);break;case 3:L.vertexAttrib3fv(r,n);break;case 4:L.vertexAttrib4fv(r,n);break;default:L.vertexAttrib1fv(r,n)}}}ba.disableUnusedAttributes()}null!==h&&L.bindBuffer(34963,q.buffer)}q=Infinity;null!==h?q=h.count:void 0!==p&&(q=p.count);h=d.drawRange.start*c;p=null!==g?g.start*c:0;var D=Math.max(h,p);g=Math.max(0,Math.min(q,h+d.drawRange.count*c,p+(null!==g?g.count*c:Infinity))-1-D+1);if(0!==g){if(f.isMesh)if(!0=== +e.wireframe)ba.setLineWidth(e.wireframeLinewidth*(null===N?H:1)),a.setMode(1);else switch(f.drawMode){case 0:a.setMode(4);break;case 1:a.setMode(5);break;case 2:a.setMode(6)}else f.isLine?(e=e.linewidth,void 0===e&&(e=1),ba.setLineWidth(e*(null===N?H:1)),f.isLineSegments?a.setMode(1):f.isLineLoop?a.setMode(2):a.setMode(3)):f.isPoints?a.setMode(0):f.isSprite&&a.setMode(4);d&&d.isInstancedBufferGeometry?0c;c++){var q=p[h[c]];var l=p[h[(c+1)%3]];f[0]=Math.min(q,l);f[1]=Math.max(q,l);q=f[0]+","+f[1];void 0===g[q]&&(g[q]={index1:f[0],index2:f[1]})}}for(q in g)m=g[q],h=a.vertices[m.index1],b.push(h.x,h.y,h.z),h=a.vertices[m.index2],b.push(h.x,h.y,h.z)}else if(a&&a.isBufferGeometry)if(h=new n,null!==a.index){k= +a.attributes.position;p=a.index;var t=a.groups;0===t.length&&(t=[{start:0,count:p.count,materialIndex:0}]);a=0;for(e=t.length;ac;c++)q=p.getX(m+c),l=p.getX(m+(c+1)%3),f[0]=Math.min(q,l),f[1]=Math.max(q,l),q=f[0]+","+f[1],void 0===g[q]&&(g[q]={index1:f[0],index2:f[1]});for(q in g)m=g[q],h.fromBufferAttribute(k,m.index1),b.push(h.x,h.y,h.z),h.fromBufferAttribute(k,m.index2),b.push(h.x,h.y,h.z)}else for(k=a.attributes.position,m=0,d= +k.count/3;mc;c++)g=3*m+c,h.fromBufferAttribute(k,g),b.push(h.x,h.y,h.z),g=3*m+(c+1)%3,h.fromBufferAttribute(k,g),b.push(h.x,h.y,h.z);this.addAttribute("position",new E(b,3))}function Nc(a,b,c){N.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};this.fromBufferGeometry(new $b(a,b,c));this.mergeVertices()}function $b(a,b,c){z.call(this);this.type="ParametricBufferGeometry";this.parameters={func:a,slices:b,stacks:c};var d=[],e=[],f=[],g=[],h=new n, +k=new n,m=new n,p=new n,q=new n,l,t;3>a.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var r=b+1;for(l=0;l<=c;l++){var u=l/c;for(t=0;t<=b;t++){var x=t/b;a(x,u,k);e.push(k.x,k.y,k.z);0<=x-1E-5?(a(x-1E-5,u,m),p.subVectors(k,m)):(a(x+1E-5,u,m),p.subVectors(m,k));0<=u-1E-5?(a(x,u-1E-5,m),q.subVectors(k,m)):(a(x,u+1E-5,m),q.subVectors(m,k));h.crossVectors(p,q).normalize();f.push(h.x,h.y,h.z);g.push(x,u)}}for(l=0;ld&&1===a.x&&(k[b]=a.x-1);0===c.x&&0===c.z&&(k[b]=d/2/Math.PI+.5)}z.call(this);this.type="PolyhedronBufferGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;var h=[],k=[];(function(a){for(var c=new n,d=new n,g=new n,h=0;he&&(.2>b&&(k[a+0]+=1),.2>c&&(k[a+2]+=1),.2>d&&(k[a+4]+=1))})();this.addAttribute("position", +new E(h,3));this.addAttribute("normal",new E(h.slice(),3));this.addAttribute("uv",new E(k,2));0===d?this.computeVertexNormals():this.normalizeNormals()}function Pc(a,b){N.call(this);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new ac(a,b));this.mergeVertices()}function ac(a,b){ka.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b);this.type="TetrahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Qc(a,b){N.call(this); +this.type="OctahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new yb(a,b));this.mergeVertices()}function yb(a,b){ka.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type="OctahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Rc(a,b){N.call(this);this.type="IcosahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new bc(a,b));this.mergeVertices()}function bc(a,b){var c= +(1+Math.sqrt(5))/2;ka.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[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],a,b);this.type="IcosahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Sc(a,b){N.call(this);this.type="DodecahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new cc(a,b));this.mergeVertices()}function cc(a,b){var c= +(1+Math.sqrt(5))/2,d=1/c;ka.call(this,[-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,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[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],a,b);this.type="DodecahedronBufferGeometry";this.parameters= +{radius:a,detail:b}}function Tc(a,b,c,d,e,f){N.call(this);this.type="TubeGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};void 0!==f&&console.warn("THREE.TubeGeometry: taper has been removed.");a=new zb(a,b,c,d,e);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;this.fromBufferGeometry(a);this.mergeVertices()}function zb(a,b,c,d,e){function f(e){p=a.getPointAt(e/b,p);var f=g.normals[e];e=g.binormals[e];for(l=0;l<=d;l++){var m=l/d*Math.PI* +2,q=Math.sin(m);m=-Math.cos(m);k.x=m*f.x+q*e.x;k.y=m*f.y+q*e.y;k.z=m*f.z+q*e.z;k.normalize();r.push(k.x,k.y,k.z);h.x=p.x+c*k.x;h.y=p.y+c*k.y;h.z=p.z+c*k.z;t.push(h.x,h.y,h.z)}}z.call(this);this.type="TubeBufferGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var g=a.computeFrenetFrames(b,e);this.tangents=g.tangents;this.normals=g.normals;this.binormals=g.binormals;var h=new n,k=new n,m=new B,p=new n,q,l,t=[],r=[],u=[],x=[];for(q= +0;q=b;e-=d)f=wf(e,a[e],a[e+1],f);f&&Ab(f,f.next)&&(Wc(f),f=f.next);return f}function Xc(a,b){if(!a)return a; +b||(b=a);do{var c=!1;if(a.steiner||!Ab(a,a.next)&&0!==wa(a.prev,a,a.next))a=a.next;else{Wc(a);a=b=a.prev;if(a===a.next)break;c=!0}}while(c||a!==b);return b}function Yc(a,b,c,d,e,f,g){if(a){if(!g&&f){var h=a,k=h;do null===k.z&&(k.z=je(k.x,k.y,d,e,f)),k.prevZ=k.prev,k=k.nextZ=k.next;while(k!==h);k.prevZ.nextZ=null;k.prevZ=null;h=k;var m,p,q,l,t=1;do{k=h;var r=h=null;for(p=0;k;){p++;var n=k;for(m=q=0;mq.x?p.x>t.x?p.x:t.x:q.x>t.x?q.x:t.x,y=p.y>q.y?p.y>t.y?p.y:t.y:q.y>t.y?q.y:t.y;m=je(p.x=m;){if(x!==r.prev&&x!==r.next&&Dd(p.x,p.y,q.x,q.y,t.x,t.y,x.x,x.y)&&0<=wa(x.prev,x,x.next)){r=!1;break a}x=x.prevZ}r=!0}}else a:if(r=a,p=r.prev,q=r,t=r.next,0<=wa(p,q,t))r=!1;else{for(m=r.next.next;m!==r.prev;){if(Dd(p.x,p.y,q.x,q.y,t.x,t.y,m.x,m.y)&&0<=wa(m.prev,m,m.next)){r=!1;break a}m=m.next}r=!0}if(r)b.push(k.i/c),b.push(a.i/c),b.push(n.i/c),Wc(a),h=a=n.next;else if(a=n,a===h){if(!g)Yc(Xc(a),b,c,d,e,f,1);else if(1===g){g=b;h=c;k=a;do n=k.prev, +r=k.next.next,!Ab(n,r)&&xf(n,k,k.next,r)&&Zc(n,r)&&Zc(r,n)&&(g.push(n.i/h),g.push(k.i/h),g.push(r.i/h),Wc(k),Wc(k.next),k=a=r),k=k.next;while(k!==a);a=k;Yc(a,b,c,d,e,f,2)}else if(2===g)a:{g=a;do{for(h=g.next.next;h!==g.prev;){if(k=g.i!==h.i){k=g;n=h;if(r=k.next.i!==n.i&&k.prev.i!==n.i){b:{r=k;do{if(r.i!==k.i&&r.next.i!==k.i&&r.i!==n.i&&r.next.i!==n.i&&xf(r,r.next,k,n)){r=!0;break b}r=r.next}while(r!==k);r=!1}r=!r}if(r=r&&Zc(k,n)&&Zc(n,k)){r=k;p=!1;q=(k.x+n.x)/2;n=(k.y+n.y)/2;do r.y>n!==r.next.y>n&& +r.next.y!==r.y&&q<(r.next.x-r.x)*(n-r.y)/(r.next.y-r.y)+r.x&&(p=!p),r=r.next;while(r!==k);r=p}k=r}if(k){a=yf(g,h);g=Xc(g,g.next);a=Xc(a,a.next);Yc(g,b,c,d,e,f);Yc(a,b,c,d,e,f);break a}h=h.next}g=g.next}while(g!==a)}break}}}}function eh(a,b){return a.x-b.x}function fh(a,b){var c=b,d=a.x,e=a.y,f=-Infinity;do{if(e<=c.y&&e>=c.next.y&&c.next.y!==c.y){var g=c.x+(e-c.y)*(c.next.x-c.x)/(c.next.y-c.y);if(g<=d&&g>f){f=g;if(g===d){if(e===c.y)return c;if(e===c.next.y)return c.next}var h=c.x=c.x&&c.x>=g&&d!==c.x&&Dd(eh.x)&&Zc(c,a)&&(h=c,m=p)}c=c.next}return h}function je(a,b,c,d,e){a=32767*(a-c)*e;b=32767*(b-d)*e;a=(a|a<<8)&16711935;a=(a|a<<4)&252645135;a=(a|a<<2)&858993459;b=(b|b<<8)&16711935;b=(b|b<<4)&252645135;b=(b|b<<2)&858993459;return(a|a<<1)&1431655765|((b|b<<1)&1431655765)<<1}function gh(a){var b= +a,c=a;do b.xwa(a.prev,a,a.next)?0<=wa(a,b,a.next)&&0<=wa(a,a.prev,b):0>wa(a,b,a.prev)|| +0>wa(a,a.next,b)}function yf(a,b){var c=new ke(a.i,a.x,a.y),d=new ke(b.i,b.x,b.y),e=a.next,f=b.prev;a.next=b;b.prev=a;c.next=e;e.prev=c;d.next=c;c.prev=d;f.next=d;d.prev=f;return d}function wf(a,b,c,d){a=new ke(a,b,c);d?(a.next=d.next,a.prev=d,d.next.prev=a,d.next=a):(a.prev=a,a.next=a);return a}function Wc(a){a.next.prev=a.prev;a.prev.next=a.next;a.prevZ&&(a.prevZ.nextZ=a.nextZ);a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function ke(a,b,c){this.i=a;this.x=b;this.y=c;this.nextZ=this.prevZ=this.z=this.next= +this.prev=null;this.steiner=!1}function zf(a){var b=a.length;2Number.EPSILON){var k=Math.sqrt(h),m=Math.sqrt(f*f+g*g);h=b.x-e/k;b=b.y+d/k;g=((c.x-g/m-h)*g-(c.y+f/m-b)*f)/(d*g-e*f);f=h+d*g-a.x;d=b+e*g-a.y;e=f*f+d*d;if(2>=e)return new B(f,d);e=Math.sqrt(e/2)}else a=!1,d>Number.EPSILON?f>Number.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(f=-e,e=Math.sqrt(h)):(f=d,d=e,e=Math.sqrt(h/2));return new B(f/e,d/e)}function h(a,b){for(H=a.length;0<= +--H;){var c=H;var f=H-1;0>f&&(f=a.length-1);var g,h=w+2*F;for(g=0;gp;p++){var l=m[f[p]];var n=m[f[(p+1)%3]];d[0]=Math.min(l,n);d[1]=Math.max(l,n);l=d[0]+","+d[1];void 0===e[l]?e[l]={index1:d[0],index2:d[1], +face1:h,face2:void 0}:e[l].face2=h}for(l in e)if(d=e[l],void 0===d.face2||g[d.face1].normal.dot(g[d.face2].normal)<=b)f=a[d.index1],c.push(f.x,f.y,f.z),f=a[d.index2],c.push(f.x,f.y,f.z);this.addAttribute("position",new E(c,3))}function Fb(a,b,c,d,e,f,g,h){N.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};this.fromBufferGeometry(new db(a,b,c,d,e,f,g,h));this.mergeVertices()}function db(a, +b,c,d,e,f,g,h){function k(c){var e,f=new B,k=new n,q=0,u=!0===c?a:b,w=!0===c?1:-1;var z=r;for(e=1;e<=d;e++)l.push(0,x*w,0),v.push(0,w,0),t.push(.5,.5),r++;var C=r;for(e=0;e<=d;e++){var E=e/d*h+g,G=Math.cos(E);E=Math.sin(E);k.x=u*E;k.y=x*w;k.z=u*G;l.push(k.x,k.y,k.z);v.push(0,w,0);f.x=.5*G+.5;f.y=.5*E*w+.5;t.push(f.x,f.y);r++}for(e=0;ethis.duration&&this.resetDuration()}function ih(a){switch(a.toLowerCase()){case "scalar":case "double":case "float":case "number":case "integer":return lc;case "vector":case "vector2":case "vector3":case "vector4":return mc;case "color":return Hd;case "quaternion":return hd;case "bool":case "boolean":return Gd;case "string":return Jd}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+a);}function jh(a){if(void 0===a.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse"); +var b=ih(a.type);if(void 0===a.times){var c=[],d=[];pa.flattenJSON(a.keys,c,d,"value");a.times=c;a.values=d}return void 0!==b.parse?b.parse(a):new b(a.name,a.times,a.values,a.interpolation)}function le(a,b,c){var d=this,e=!1,f=0,g=0,h=void 0;this.onStart=void 0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){g++;if(!1===e&&void 0!==d.onStart)d.onStart(a,f,g);e=!0};this.itemEnd=function(a){f++;if(void 0!==d.onProgress)d.onProgress(a,f,g);if(f===g&&(e=!1,void 0!==d.onLoad))d.onLoad()}; +this.itemError=function(a){if(void 0!==d.onError)d.onError(a)};this.resolveURL=function(a){return h?h(a):a};this.setURLModifier=function(a){h=a;return this}}function Ma(a){this.manager=void 0!==a?a:za}function Df(a){this.manager=void 0!==a?a:za}function Ef(a){this.manager=void 0!==a?a:za;this._parser=null}function me(a){this.manager=void 0!==a?a:za;this._parser=null}function id(a){this.manager=void 0!==a?a:za}function ne(a){this.manager=void 0!==a?a:za}function Kd(a){this.manager=void 0!==a?a:za} +function I(){this.type="Curve";this.arcLengthDivisions=200}function Ga(a,b,c,d,e,f,g,h){I.call(this);this.type="EllipseCurve";this.aX=a||0;this.aY=b||0;this.xRadius=c||1;this.yRadius=d||1;this.aStartAngle=e||0;this.aEndAngle=f||2*Math.PI;this.aClockwise=g||!1;this.aRotation=h||0}function nc(a,b,c,d,e,f){Ga.call(this,a,b,c,c,d,e,f);this.type="ArcCurve"}function oe(){var a=0,b=0,c=0,d=0;return{initCatmullRom:function(e,f,g,h,k){e=k*(g-e);h=k*(h-f);a=f;b=e;c=-3*f+3*g-2*e-h;d=2*f-2*g+e+h},initNonuniformCatmullRom:function(e, +f,g,h,k,m,p){e=((f-e)/k-(g-e)/(k+m)+(g-f)/m)*m;h=((g-f)/m-(h-f)/(m+p)+(h-g)/p)*m;a=f;b=e;c=-3*f+3*g-2*e-h;d=2*f-2*g+e+h},calc:function(e){var f=e*e;return a+b*e+c*f+d*f*e}}}function qa(a,b,c,d){I.call(this);this.type="CatmullRomCurve3";this.points=a||[];this.closed=b||!1;this.curveType=c||"centripetal";this.tension=d||.5}function Ff(a,b,c,d,e){b=.5*(d-b);e=.5*(e-c);var f=a*a;return(2*c-2*d+b+e)*a*f+(-3*c+3*d-2*b-e)*f+b*a+c}function jd(a,b,c,d){var e=1-a;return e*e*b+2*(1-a)*a*c+a*a*d}function kd(a, +b,c,d,e){var f=1-a,g=1-a;return f*f*f*b+3*g*g*a*c+3*(1-a)*a*a*d+a*a*a*e}function Na(a,b,c,d){I.call(this);this.type="CubicBezierCurve";this.v0=a||new B;this.v1=b||new B;this.v2=c||new B;this.v3=d||new B}function $a(a,b,c,d){I.call(this);this.type="CubicBezierCurve3";this.v0=a||new n;this.v1=b||new n;this.v2=c||new n;this.v3=d||new n}function xa(a,b){I.call(this);this.type="LineCurve";this.v1=a||new B;this.v2=b||new B}function Oa(a,b){I.call(this);this.type="LineCurve3";this.v1=a||new n;this.v2=b|| +new n}function Pa(a,b,c){I.call(this);this.type="QuadraticBezierCurve";this.v0=a||new B;this.v1=b||new B;this.v2=c||new B}function ab(a,b,c){I.call(this);this.type="QuadraticBezierCurve3";this.v0=a||new n;this.v1=b||new n;this.v2=c||new n}function Qa(a){I.call(this);this.type="SplineCurve";this.points=a||[]}function eb(){I.call(this);this.type="CurvePath";this.curves=[];this.autoClose=!1}function Ra(a){eb.call(this);this.type="Path";this.currentPoint=new B;a&&this.setFromPoints(a)}function nb(a){Ra.call(this, +a);this.uuid=K.generateUUID();this.type="Shape";this.holes=[]}function ea(a,b){C.call(this);this.type="Light";this.color=new M(a);this.intensity=void 0!==b?b:1;this.receiveShadow=void 0}function Ld(a,b,c){ea.call(this,a,c);this.type="HemisphereLight";this.castShadow=void 0;this.position.copy(C.DefaultUp);this.updateMatrix();this.groundColor=new M(b)}function Nb(a){this.camera=a;this.bias=0;this.radius=1;this.mapSize=new B(512,512);this.map=null;this.matrix=new P}function Md(){Nb.call(this,new ja(50, +1,.5,500))}function Nd(a,b,c,d,e,f){ea.call(this,a,b);this.type="SpotLight";this.position.copy(C.DefaultUp);this.updateMatrix();this.target=new C;Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(a){this.intensity=a/Math.PI}});this.distance=void 0!==c?c:0;this.angle=void 0!==d?d:Math.PI/3;this.penumbra=void 0!==e?e:0;this.decay=void 0!==f?f:1;this.shadow=new Md}function Od(a,b,c,d){ea.call(this,a,b);this.type="PointLight";Object.defineProperty(this,"power", +{get:function(){return 4*this.intensity*Math.PI},set:function(a){this.intensity=a/(4*Math.PI)}});this.distance=void 0!==c?c:0;this.decay=void 0!==d?d:1;this.shadow=new Nb(new ja(90,1,.5,500))}function ld(a,b,c,d,e,f){Xa.call(this);this.type="OrthographicCamera";this.zoom=1;this.view=null;this.left=void 0!==a?a:-1;this.right=void 0!==b?b:1;this.top=void 0!==c?c:1;this.bottom=void 0!==d?d:-1;this.near=void 0!==e?e:.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()}function Pd(){Nb.call(this, +new ld(-5,5,5,-5,.5,500))}function Qd(a,b){ea.call(this,a,b);this.type="DirectionalLight";this.position.copy(C.DefaultUp);this.updateMatrix();this.target=new C;this.shadow=new Pd}function Rd(a,b){ea.call(this,a,b);this.type="AmbientLight";this.castShadow=void 0}function Sd(a,b,c,d){ea.call(this,a,b);this.type="RectAreaLight";this.width=void 0!==c?c:10;this.height=void 0!==d?d:10}function Td(a){this.manager=void 0!==a?a:za;this.textures={}}function pe(a){this.manager=void 0!==a?a:za}function qe(a){this.manager= +void 0!==a?a:za;this.resourcePath=""}function re(a){"undefined"===typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported.");"undefined"===typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported.");this.manager=void 0!==a?a:za;this.options=void 0}function se(){this.type="ShapePath";this.color=new M;this.subPaths=[];this.currentPath=null}function te(a){this.type="Font";this.data=a}function Gf(a){this.manager=void 0!==a?a:za}function md(){} +function ue(a){this.manager=void 0!==a?a:za}function Hf(){this.type="StereoCamera";this.aspect=1;this.eyeSep=.064;this.cameraL=new ja;this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate=!1;this.cameraR=new ja;this.cameraR.layers.enable(2);this.cameraR.matrixAutoUpdate=!1}function nd(a,b,c,d){C.call(this);this.type="CubeCamera";var e=new ja(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new n(1,0,0));this.add(e);var f=new ja(90,1,a,b);f.up.set(0,-1,0);f.lookAt(new n(-1,0,0));this.add(f);var g=new ja(90, +1,a,b);g.up.set(0,0,1);g.lookAt(new n(0,1,0));this.add(g);var h=new ja(90,1,a,b);h.up.set(0,0,-1);h.lookAt(new n(0,-1,0));this.add(h);var k=new ja(90,1,a,b);k.up.set(0,-1,0);k.lookAt(new n(0,0,1));this.add(k);var m=new ja(90,1,a,b);m.up.set(0,-1,0);m.lookAt(new n(0,0,-1));this.add(m);d=d||{format:1022,magFilter:1006,minFilter:1006};this.renderTarget=new pb(c,c,d);this.renderTarget.texture.name="CubeCamera";this.update=function(a,b){null===this.parent&&this.updateMatrixWorld();var c=a.getRenderTarget(), +d=this.renderTarget,p=d.texture.generateMipmaps;d.texture.generateMipmaps=!1;a.setRenderTarget(d,0);a.render(b,e);a.setRenderTarget(d,1);a.render(b,f);a.setRenderTarget(d,2);a.render(b,g);a.setRenderTarget(d,3);a.render(b,h);a.setRenderTarget(d,4);a.render(b,k);d.texture.generateMipmaps=p;a.setRenderTarget(d,5);a.render(b,m);a.setRenderTarget(c)};this.clear=function(a,b,c,d){for(var e=a.getRenderTarget(),f=this.renderTarget,g=0;6>g;g++)a.setRenderTarget(f,g),a.clear(b,c,d);a.setRenderTarget(e)}}function ve(a){this.autoStart= +void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}function we(){C.call(this);this.type="AudioListener";this.context=xe.getContext();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.filter=null;this.timeDelta=0}function oc(a){C.call(this);this.type="Audio";this.listener=a;this.context=a.context;this.gain=this.context.createGain();this.gain.connect(a.getInput());this.autoplay=!1;this.buffer=null;this.detune=0;this.loop=!1;this.offset= +this.startTime=0;this.playbackRate=1;this.isPlaying=!1;this.hasPlaybackControl=!0;this.sourceType="empty";this.filters=[]}function ye(a){oc.call(this,a);this.panner=this.context.createPanner();this.panner.connect(this.gain)}function ze(a,b){this.analyser=a.context.createAnalyser();this.analyser.fftSize=void 0!==b?b:2048;this.data=new Uint8Array(this.analyser.frequencyBinCount);a.getOutput().connect(this.analyser)}function Ae(a,b,c){this.binding=a;this.valueSize=c;a=Float64Array;switch(b){case "quaternion":b= +this._slerp;break;case "string":case "bool":a=Array;b=this._select;break;default:b=this._lerp}this.buffer=new a(4*c);this._mixBufferRegion=b;this.referenceCount=this.useCount=this.cumulativeWeight=0}function If(a,b,c){c=c||ma.parseTrackName(b);this._targetGroup=a;this._bindings=a.subscribe_(b,c)}function ma(a,b,c){this.path=b;this.parsedPath=c||ma.parseTrackName(b);this.node=ma.findNode(a,this.parsedPath.nodeName)||a;this.rootNode=a}function Jf(){this.uuid=K.generateUUID();this._objects=Array.prototype.slice.call(arguments); +this.nCachedObjects_=0;var a={};this._indicesByUUID=a;for(var b=0,c=arguments.length;b!==c;++b)a[arguments[b].uuid]=b;this._paths=[];this._parsedPaths=[];this._bindings=[];this._bindingsIndicesByPath={};var d=this;this.stats={objects:{get total(){return d._objects.length},get inUse(){return this.total-d.nCachedObjects_}},get bindingsPerObject(){return d._bindings.length}}}function Kf(a,b,c){this._mixer=a;this._clip=b;this._localRoot=c||null;a=b.tracks;b=a.length;c=Array(b);for(var d={endingStart:2400, endingEnd:2400},e=0;e!==b;++e){var f=a[e].createInterpolant(null);c[e]=f;f.settings=d}this._interpolantSettings=d;this._interpolants=c;this._propertyBindings=Array(b);this._weightInterpolant=this._timeScaleInterpolant=this._byClipCacheIndex=this._cacheIndex=null;this.loop=2201;this._loopCount=-1;this._startTime=null;this.time=0;this._effectiveWeight=this.weight=this._effectiveTimeScale=this.timeScale=1;this.repetitions=Infinity;this.paused=!1;this.enabled=!0;this.clampWhenFinished=!1;this.zeroSlopeAtEnd= -this.zeroSlopeAtStart=!0}function Be(a){this._root=a;this._initMemoryManager();this.time=this._accuIndex=0;this.timeScale=1}function Td(a,b){"string"===typeof a&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),a=b);this.value=a}function Ce(){D.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=void 0}function De(a,b,c){ub.call(this,a,b);this.meshPerAttribute=c||1}function Ee(a,b,c,d){"number"===typeof c&&(d=c,c=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")); -M.call(this,a,b,c);this.meshPerAttribute=d||1}function Jf(a,b,c,d){this.ray=new tb(a,b);this.near=c||0;this.far=d||Infinity;this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}};Object.defineProperties(this.params,{PointCloud:{get:function(){console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points.");return this.Points}}})}function Kf(a,b){return a.distance-b.distance}function Fe(a,b,c,d){if(!1!==a.visible&&(a.raycast(b,c),!0===d)){a=a.children;d=0;for(var e= -a.length;dc;c++,d++){var e=c/32*Math.PI*2,f=d/32*Math.PI*2;b.push(Math.cos(e),Math.sin(e),1,Math.cos(f),Math.sin(f),1)}a.addAttribute("position",new B(b,3));b=new R({fog:!1});this.cone=new X(a,b);this.add(this.cone);this.update()}function Nf(a){var b=[];a&&a.isBone&&b.push(a);for(var c=0;c +this.zeroSlopeAtStart=!0}function Be(a){this._root=a;this._initMemoryManager();this.time=this._accuIndex=0;this.timeScale=1}function Ud(a,b){"string"===typeof a&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),a=b);this.value=a}function Ce(){z.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=void 0}function De(a,b,c){xb.call(this,a,b);this.meshPerAttribute=c||1}function Ee(a,b,c,d){"number"===typeof c&&(d=c,c=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")); +S.call(this,a,b,c);this.meshPerAttribute=d||1}function Lf(a,b,c,d){this.ray=new wb(a,b);this.near=c||0;this.far=d||Infinity;this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}};Object.defineProperties(this.params,{PointCloud:{get:function(){console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points.");return this.Points}}})}function Mf(a,b){return a.distance-b.distance}function Fe(a,b,c,d){if(!1!==a.visible&&(a.raycast(b,c),!0===d)){a=a.children;d=0;for(var e= +a.length;dc;c++,d++){var e=c/32*Math.PI*2,f=d/32*Math.PI*2;b.push(Math.cos(e),Math.sin(e),1,Math.cos(f),Math.sin(f),1)}a.addAttribute("position",new E(b,3));b=new R({fog:!1});this.cone=new V(a,b);this.add(this.cone);this.update()}function Pf(a){var b=[];a&&a.isBone&&b.push(a);for(var c=0;c a?-1:0b;b++)a[b]=(16>b?"0":"")+b.toString(16);return function(){var b=4294967295*Math.random()|0,d=4294967295*Math.random()|0,e=4294967295*Math.random()|0,f=4294967295*Math.random()|0;return(a[b&255]+a[b>>8&255]+a[b>>16&255]+a[b>>24&255]+"-"+a[d&255]+a[d>>8&255]+"-"+a[d>>16&15|64]+a[d>>24&255]+ +Object.assign(ta.prototype,{addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&&c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)},removeEventListener:function(a,b){void 0!==this._listeners&&(a=this._listeners[a],void 0!==a&&(b=a.indexOf(b),-1!==b&&a.splice(b,1)))},dispatchEvent:function(a){if(void 0!==this._listeners){var b= +this._listeners[a.type];if(void 0!==b){a.target=this;b=b.slice(0);for(var c=0,d=b.length;cb;b++)a[b]=(16>b?"0":"")+b.toString(16);return function(){var b=4294967295*Math.random()|0,d=4294967295*Math.random()|0,e=4294967295*Math.random()|0,f=4294967295*Math.random()|0;return(a[b&255]+a[b>>8&255]+a[b>>16&255]+a[b>>24&255]+"-"+a[d&255]+a[d>>8&255]+"-"+a[d>>16&15|64]+a[d>>24&255]+ "-"+a[e&63|128]+a[e>>8&255]+"-"+a[e>>16&255]+a[e>>24&255]+a[f&255]+a[f>>8&255]+a[f>>16&255]+a[f>>24&255]).toUpperCase()}}(),clamp:function(a,b,c){return Math.max(b,Math.min(c,a))},euclideanModulo:function(a,b){return(a%b+b)%b},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},lerp:function(a,b,c){return(1-c)*a+c*b},smoothstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a* -a*a*(a*(6*a-15)+10)},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(a){return a*P.DEG2RAD},radToDeg:function(a){return a*P.RAD2DEG},isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},ceilPowerOfTwo:function(a){return Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))},floorPowerOfTwo:function(a){return Math.pow(2,Math.floor(Math.log(a)/Math.LN2))}};Object.defineProperties(z.prototype, -{width:{get:function(){return this.x},set:function(a){this.x=a}},height:{get:function(){return this.y},set:function(a){this.y=a}}});Object.assign(z.prototype,{isVector2:!0,set:function(a,b){this.x=a;this.y=b;return this},setScalar:function(a){this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x; +a*a*(a*(6*a-15)+10)},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(a){return a*K.DEG2RAD},radToDeg:function(a){return a*K.RAD2DEG},isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},ceilPowerOfTwo:function(a){return Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))},floorPowerOfTwo:function(a){return Math.pow(2,Math.floor(Math.log(a)/Math.LN2))}};Object.defineProperties(B.prototype, +{width:{get:function(){return this.x},set:function(a){this.x=a}},height:{get:function(){return this.y},set:function(a){this.y=a}}});Object.assign(B.prototype,{isVector2:!0,set:function(a,b){this.x=a;this.y=b;return this},setScalar:function(a){this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x; case 1:return this.y;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this}, addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this},subScalar:function(a){this.x-=a;this.y-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this}, divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},applyMatrix3:function(a){var b=this.x,c=this.y;a=a.elements;this.x=a[0]*b+a[3]*c+a[6];this.y=a[1]*b+a[4]*c+a[7];return this},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y, -this.y));return this},clampScalar:function(){var a=new z,b=new z;return function(c,d){a.set(c,c);b.set(d,d);return this.clamp(a,b)}}(),clampLength:function(a,b){var c=this.length();return this.divideScalar(c||1).multiplyScalar(Math.max(a,Math.min(b,c)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},roundToZero:function(){this.x= +this.y));return this},clampScalar:function(){var a=new B,b=new B;return function(c,d){a.set(c,c);b.set(d,d);return this.clamp(a,b)}}(),clampLength:function(a,b){var c=this.length();return this.divideScalar(c||1).multiplyScalar(Math.max(a,Math.min(b,c)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this},roundToZero:function(){this.x= 0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x*a.x+this.y*a.y},cross:function(a){return this.x*a.y-this.y*a.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()|| 1)},angle:function(){var a=Math.atan2(this.y,this.x);0>a&&(a+=2*Math.PI);return a},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x;a=this.y-a.y;return b*b+a*a},manhattanDistanceTo:function(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},lerpVectors:function(a,b,c){return this.subVectors(b, a).multiplyScalar(c).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute().");this.x=a.getX(b);this.y=a.getY(b);return this},rotateAround:function(a,b){var c=Math.cos(b);b=Math.sin(b);var d= -this.x-a.x,e=this.y-a.y;this.x=d*c-e*b+a.x;this.y=d*b+e*c+a.y;return this}});Object.assign(aa,{slerp:function(a,b,c,d){return c.copy(a).slerp(b,d)},slerpFlat:function(a,b,c,d,e,f,g){var h=c[d+0],l=c[d+1],m=c[d+2];c=c[d+3];d=e[f+0];var k=e[f+1],p=e[f+2];e=e[f+3];if(c!==e||h!==d||l!==k||m!==p){f=1-g;var n=h*d+l*k+m*p+c*e,r=0<=n?1:-1,t=1-n*n;t>Number.EPSILON&&(t=Math.sqrt(t),n=Math.atan2(t,n*r),f=Math.sin(f*n)/t,g=Math.sin(g*n)/t);r*=g;h=h*f+d*r;l=l*f+k*r;m=m*f+p*r;c=c*f+e*r;f===1-g&&(g=1/Math.sqrt(h* -h+l*l+m*m+c*c),h*=g,l*=g,m*=g,c*=g)}a[b]=h;a[b+1]=l;a[b+2]=m;a[b+3]=c}});Object.defineProperties(aa.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this.onChangeCallback()}},y:{get:function(){return this._y},set:function(a){this._y=a;this.onChangeCallback()}},z:{get:function(){return this._z},set:function(a){this._z=a;this.onChangeCallback()}},w:{get:function(){return this._w},set:function(a){this._w=a;this.onChangeCallback()}}});Object.assign(aa.prototype,{isQuaternion:!0, -set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._w=d;this.onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(a){this._x=a.x;this._y=a.y;this._z=a.z;this._w=a.w;this.onChangeCallback();return this},setFromEuler:function(a,b){if(!a||!a.isEuler)throw Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var c=a._x,d=a._y,e=a._z;a=a.order;var f=Math.cos,g=Math.sin,h=f(c/ -2),l=f(d/2);f=f(e/2);c=g(c/2);d=g(d/2);e=g(e/2);"XYZ"===a?(this._x=c*l*f+h*d*e,this._y=h*d*f-c*l*e,this._z=h*l*e+c*d*f,this._w=h*l*f-c*d*e):"YXZ"===a?(this._x=c*l*f+h*d*e,this._y=h*d*f-c*l*e,this._z=h*l*e-c*d*f,this._w=h*l*f+c*d*e):"ZXY"===a?(this._x=c*l*f-h*d*e,this._y=h*d*f+c*l*e,this._z=h*l*e+c*d*f,this._w=h*l*f-c*d*e):"ZYX"===a?(this._x=c*l*f-h*d*e,this._y=h*d*f+c*l*e,this._z=h*l*e-c*d*f,this._w=h*l*f+c*d*e):"YZX"===a?(this._x=c*l*f+h*d*e,this._y=h*d*f+c*l*e,this._z=h*l*e-c*d*f,this._w=h*l*f- -c*d*e):"XZY"===a&&(this._x=c*l*f-h*d*e,this._y=h*d*f-c*l*e,this._z=h*l*e+c*d*f,this._w=h*l*f+c*d*e);if(!1!==b)this.onChangeCallback();return this},setFromAxisAngle:function(a,b){b/=2;var c=Math.sin(b);this._x=a.x*c;this._y=a.y*c;this._z=a.z*c;this._w=Math.cos(b);this.onChangeCallback();return this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],l=b[6];b=b[10];var m=c+f+b;0f&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(l-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=.25*c,this._z=(g+l)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+l)/c,this._z=.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(a,b){var c=a.dot(b)+1;1E-6>c?(c=0,Math.abs(a.x)>Math.abs(a.z)?(this._x=-a.y,this._y=a.x,this._z=0):(this._x=0,this._y=-a.z,this._z=a.y)):(this._x= -a.y*b.z-a.z*b.y,this._y=a.z*b.x-a.x*b.z,this._z=a.x*b.y-a.y*b.x);this._w=c;return this.normalize()},angleTo:function(a){return 2*Math.acos(Math.abs(P.clamp(this.dot(a),-1,1)))},rotateTowards:function(a,b){var c=this.angleTo(a);if(0===c)return this;this.slerp(a,Math.min(1,b/c));return this},inverse:function(){return this.conjugate()},conjugate:function(){this._x*=-1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._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 a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this.onChangeCallback();return this},multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."), -this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},premultiply:function(a){return this.multiplyQuaternions(a,this)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z;a=a._w;var f=b._x,g=b._y,h=b._z;b=b._w;this._x=c*b+a*f+d*h-e*g;this._y=d*b+a*g+e*f-c*h;this._z=e*b+a*h+c*g-d*f;this._w=a*b-c*f-d*g-e*h;this.onChangeCallback();return this},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z; -0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;a=1-g*g;if(a<=Number.EPSILON)return g=1-b,this._w=g*f+b*this._w,this._x=g*c+b*this._x,this._y=g*d+b*this._y,this._z=g*e+b*this._z,this.normalize();a=Math.sqrt(a);var h=Math.atan2(a,g);g=Math.sin((1-b)*h)/a;b=Math.sin(b*h)/a;this._w=f*g+this._w*b;this._x=c*g+this._x*b;this._y=d*g+this._y*b;this._z=e*g+this._z*b;this.onChangeCallback();return this},equals:function(a){return a._x=== -this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a,b){void 0===b&&(b=0);this._x=a[b];this._y=a[b+1];this._z=a[b+2];this._w=a[b+3];this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._w;return a},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){}});Object.assign(n.prototype,{isVector3:!0,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this}, +this.x-a.x,e=this.y-a.y;this.x=d*c-e*b+a.x;this.y=d*b+e*c+a.y;return this}});Object.assign(Z,{slerp:function(a,b,c,d){return c.copy(a).slerp(b,d)},slerpFlat:function(a,b,c,d,e,f,g){var h=c[d+0],k=c[d+1],m=c[d+2];c=c[d+3];d=e[f+0];var p=e[f+1],l=e[f+2];e=e[f+3];if(c!==e||h!==d||k!==p||m!==l){f=1-g;var n=h*d+k*p+m*l+c*e,t=0<=n?1:-1,r=1-n*n;r>Number.EPSILON&&(r=Math.sqrt(r),n=Math.atan2(r,n*t),f=Math.sin(f*n)/r,g=Math.sin(g*n)/r);t*=g;h=h*f+d*t;k=k*f+p*t;m=m*f+l*t;c=c*f+e*t;f===1-g&&(g=1/Math.sqrt(h* +h+k*k+m*m+c*c),h*=g,k*=g,m*=g,c*=g)}a[b]=h;a[b+1]=k;a[b+2]=m;a[b+3]=c}});Object.defineProperties(Z.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this.onChangeCallback()}},y:{get:function(){return this._y},set:function(a){this._y=a;this.onChangeCallback()}},z:{get:function(){return this._z},set:function(a){this._z=a;this.onChangeCallback()}},w:{get:function(){return this._w},set:function(a){this._w=a;this.onChangeCallback()}}});Object.assign(Z.prototype,{isQuaternion:!0,set:function(a, +b,c,d){this._x=a;this._y=b;this._z=c;this._w=d;this.onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(a){this._x=a.x;this._y=a.y;this._z=a.z;this._w=a.w;this.onChangeCallback();return this},setFromEuler:function(a,b){if(!a||!a.isEuler)throw Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var c=a._x,d=a._y,e=a._z;a=a.order;var f=Math.cos,g=Math.sin,h=f(c/2),k=f(d/2); +f=f(e/2);c=g(c/2);d=g(d/2);e=g(e/2);"XYZ"===a?(this._x=c*k*f+h*d*e,this._y=h*d*f-c*k*e,this._z=h*k*e+c*d*f,this._w=h*k*f-c*d*e):"YXZ"===a?(this._x=c*k*f+h*d*e,this._y=h*d*f-c*k*e,this._z=h*k*e-c*d*f,this._w=h*k*f+c*d*e):"ZXY"===a?(this._x=c*k*f-h*d*e,this._y=h*d*f+c*k*e,this._z=h*k*e+c*d*f,this._w=h*k*f-c*d*e):"ZYX"===a?(this._x=c*k*f-h*d*e,this._y=h*d*f+c*k*e,this._z=h*k*e-c*d*f,this._w=h*k*f+c*d*e):"YZX"===a?(this._x=c*k*f+h*d*e,this._y=h*d*f+c*k*e,this._z=h*k*e-c*d*f,this._w=h*k*f-c*d*e):"XZY"=== +a&&(this._x=c*k*f-h*d*e,this._y=h*d*f-c*k*e,this._z=h*k*e+c*d*f,this._w=h*k*f+c*d*e);if(!1!==b)this.onChangeCallback();return this},setFromAxisAngle:function(a,b){b/=2;var c=Math.sin(b);this._x=a.x*c;this._y=a.y*c;this._z=a.z*c;this._w=Math.cos(b);this.onChangeCallback();return this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],k=b[6];b=b[10];var m=c+f+b;0f&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(k-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=.25*c,this._z=(g+k)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+k)/c,this._z=.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(a,b){var c=a.dot(b)+1;1E-6>c?(c=0,Math.abs(a.x)>Math.abs(a.z)?(this._x=-a.y,this._y=a.x,this._z=0):(this._x=0,this._y=-a.z,this._z=a.y)):(this._x=a.y*b.z-a.z*b.y, +this._y=a.z*b.x-a.x*b.z,this._z=a.x*b.y-a.y*b.x);this._w=c;return this.normalize()},angleTo:function(a){return 2*Math.acos(Math.abs(K.clamp(this.dot(a),-1,1)))},rotateTowards:function(a,b){var c=this.angleTo(a);if(0===c)return this;this.slerp(a,Math.min(1,b/c));return this},inverse:function(){return this.conjugate()},conjugate:function(){this._x*=-1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._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 a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this.onChangeCallback();return this},multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a, +b)):this.multiplyQuaternions(this,a)},premultiply:function(a){return this.multiplyQuaternions(a,this)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z;a=a._w;var f=b._x,g=b._y,h=b._z;b=b._w;this._x=c*b+a*f+d*h-e*g;this._y=d*b+a*g+e*f-c*h;this._z=e*b+a*h+c*g-d*f;this._w=a*b-c*f-d*g-e*h;this.onChangeCallback();return this},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x= +-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;a=1-g*g;if(a<=Number.EPSILON)return g=1-b,this._w=g*f+b*this._w,this._x=g*c+b*this._x,this._y=g*d+b*this._y,this._z=g*e+b*this._z,this.normalize();a=Math.sqrt(a);var h=Math.atan2(a,g);g=Math.sin((1-b)*h)/a;b=Math.sin(b*h)/a;this._w=f*g+this._w*b;this._x=c*g+this._x*b;this._y=d*g+this._y*b;this._z=e*g+this._z*b;this.onChangeCallback();return this},equals:function(a){return a._x===this._x&& +a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a,b){void 0===b&&(b=0);this._x=a[b];this._y=a[b+1];this._z=a[b+2];this._w=a[b+3];this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._w;return a},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){}});Object.assign(n.prototype,{isVector3:!0,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this}, setScalar:function(a){this.z=this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x, this.y,this.z)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;this.z+= a.z*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subScalar:function(a){this.x-=a;this.y-=a;this.z-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."), -this.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(){var a=new aa;return function(b){b&&b.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.");return this.applyQuaternion(a.setFromEuler(b))}}(),applyAxisAngle:function(){var a=new aa;return function(b, +this.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(){var a=new Z;return function(b){b&&b.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.");return this.applyQuaternion(a.setFromEuler(b))}}(),applyAxisAngle:function(){var a=new Z;return function(b, c){return this.applyQuaternion(a.setFromAxisAngle(b,c))}}(),applyMatrix3:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]*d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z=(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x, -c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,l=a*c+g*b-e*d,m=a*d+e*c-f*b;b=-e*b-f*c-g*d;this.x=h*a+b*-e+l*-g-m*-f;this.y=l*a+b*-f+m*-e-h*-g;this.z=m*a+b*-g+h*-f-l*-e;return this},project:function(a){return this.applyMatrix4(a.matrixWorldInverse).applyMatrix4(a.projectionMatrix)},unproject:function(a){return this.applyMatrix4(a.projectionMatrixInverse).applyMatrix4(a.matrixWorld)},transformDirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d; +c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,k=a*c+g*b-e*d,m=a*d+e*c-f*b;b=-e*b-f*c-g*d;this.x=h*a+b*-e+k*-g-m*-f;this.y=k*a+b*-f+m*-e-h*-g;this.z=m*a+b*-g+h*-f-k*-e;return this},project:function(a){return this.applyMatrix4(a.matrixWorldInverse).applyMatrix4(a.projectionMatrix)},unproject:function(a){return this.applyMatrix4(a.projectionMatrixInverse).applyMatrix4(a.matrixWorld)},transformDirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d; this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;return this.normalize()},divide:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);this.z=Math.min(this.z,a.z);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.z=Math.max(this.z,a.z);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y= Math.max(a.y,Math.min(b.y,this.y));this.z=Math.max(a.z,Math.min(b.z,this.z));return this},clampScalar:function(){var a=new n,b=new n;return function(c,d){a.set(c,c,c);b.set(d,d,d);return this.clamp(a,b)}}(),clampLength:function(a,b){var c=this.length();return this.divideScalar(c||1).multiplyScalar(Math.max(a,Math.min(b,c)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y); this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.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)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a)}, cross:function(a,b){return void 0!==b?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b)):this.crossVectors(this,a)},crossVectors:function(a,b){var c=a.x,d=a.y;a=a.z;var e=b.x,f=b.y;b=b.z;this.x=d*b-a*f;this.y=a*e-c*b;this.z=c*f-d*e;return this},projectOnVector:function(a){var b=a.dot(this)/a.lengthSq();return this.copy(a).multiplyScalar(b)},projectOnPlane:function(){var a=new n;return function(b){a.copy(this).projectOnVector(b); -return this.sub(a)}}(),reflect:function(){var a=new n;return function(b){return this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){a=this.dot(a)/Math.sqrt(this.lengthSq()*a.lengthSq());return Math.acos(P.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},manhattanDistanceTo:function(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)+Math.abs(this.z- +return this.sub(a)}}(),reflect:function(){var a=new n;return function(b){return this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){a=this.dot(a)/Math.sqrt(this.lengthSq()*a.lengthSq());return Math.acos(K.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},manhattanDistanceTo:function(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)+Math.abs(this.z- a.z)},setFromSpherical:function(a){return this.setFromSphericalCoords(a.radius,a.phi,a.theta)},setFromSphericalCoords:function(a,b,c){var d=Math.sin(b)*a;this.x=d*Math.sin(c);this.y=Math.cos(b)*a;this.z=d*Math.cos(c);return this},setFromCylindrical:function(a){return this.setFromCylindricalCoords(a.radius,a.theta,a.y)},setFromCylindricalCoords:function(a,b,c){this.x=a*Math.sin(b);this.y=c;this.z=a*Math.cos(b);return this},setFromMatrixPosition:function(a){a=a.elements;this.x=a[12];this.y=a[13];this.z= a[14];return this},setFromMatrixScale:function(a){var b=this.setFromMatrixColumn(a,0).length(),c=this.setFromMatrixColumn(a,1).length();a=this.setFromMatrixColumn(a,2).length();this.x=b;this.y=c;this.z=a;return this},setFromMatrixColumn:function(a,b){return this.fromArray(a.elements,4*b)},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0=== -b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute().");this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);return this}});Object.assign(qa.prototype,{isMatrix3:!0,set:function(a,b,c,d,e,f,g,h,l){var m=this.elements;m[0]=a;m[1]=d;m[2]=g;m[3]=b;m[4]=e;m[5]=h;m[6]=c;m[7]=f;m[8]=l;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},clone:function(){return(new this.constructor).fromArray(this.elements)}, +b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute().");this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);return this}});Object.assign(aa.prototype,{isMatrix3:!0,set:function(a,b,c,d,e,f,g,h,k){var m=this.elements;m[0]=a;m[1]=d;m[2]=g;m[3]=b;m[4]=e;m[5]=h;m[6]=c;m[7]=f;m[8]=k;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},clone:function(){return(new this.constructor).fromArray(this.elements)}, copy:function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return this},setFromMatrix4:function(a){a=a.elements;this.set(a[0],a[4],a[8],a[1],a[5],a[9],a[2],a[6],a[10]);return this},applyToBufferAttribute:function(){var a=new n;return function(b){for(var c=0,d=b.count;cc;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;9>c;c++)this.elements[c]=a[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c= -this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a}});var tc,lb={getDataURL:function(a){if("undefined"==typeof HTMLCanvasElement)return a.src;if(!(a instanceof HTMLCanvasElement)){void 0===tc&&(tc=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"));tc.width=a.width;tc.height=a.height;var b=tc.getContext("2d");a instanceof ImageData?b.putImageData(a,0,0):b.drawImage(a,0,0,a.width,a.height);a=tc}return 2048< -a.width||2048c;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;9>c;c++)this.elements[c]=a[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c= +this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a}});var wc,ob={getDataURL:function(a){if("undefined"==typeof HTMLCanvasElement)return a.src;if(!(a instanceof HTMLCanvasElement)){void 0===wc&&(wc=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"));wc.width=a.width;wc.height=a.height;var b=wc.getContext("2d");a instanceof ImageData?b.putImageData(a,0,0):b.drawImage(a,0,0,a.width,a.height);a=wc}return 2048< +a.width||2048a.x||1a.x?0:1;break;case 1002:a.x=1===Math.abs(Math.floor(a.x)%2)?Math.ceil(a.x)-a.x:a.x-Math.floor(a.x)}if(0>a.y||1a.y?0:1;break;case 1002:a.y=1===Math.abs(Math.floor(a.y)%2)?Math.ceil(a.y)-a.y:a.y-Math.floor(a.y)}this.flipY&&(a.y=1-a.y);return a}});Object.defineProperty(U.prototype, -"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.assign(ba.prototype,{isVector4:!0,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},setScalar:function(a){this.w=this.z=this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w= +magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var d=this.image;void 0===d.uuid&&(d.uuid=K.generateUUID());if(!b&&void 0===a.images[d.uuid]){if(Array.isArray(d)){var e=[];for(var f=0,g=d.length;fa.x||1a.x?0:1;break;case 1002:a.x=1===Math.abs(Math.floor(a.x)%2)?Math.ceil(a.x)-a.x:a.x-Math.floor(a.x)}if(0>a.y||1a.y?0:1;break;case 1002:a.y=1===Math.abs(Math.floor(a.y)%2)?Math.ceil(a.y)-a.y:a.y-Math.floor(a.y)}this.flipY&&(a.y=1-a.y);return a}});Object.defineProperty(W.prototype, +"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.assign(ca.prototype,{isVector4:!0,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},setScalar:function(a){this.w=this.z=this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w= b;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."), this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;this.z+=a.z*b;this.w+=a.w*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a, b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subScalar:function(a){this.x-=a;this.y-=a;this.z-=a;this.w-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z,e=this.w;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e;this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e;this.z=a[2]*b+a[6]*c+a[10]*d+a[14]* -e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b);return this},setAxisAngleFromRotationMatrix:function(a){a=a.elements;var b=a[0];var c=a[4];var d=a[8],e=a[1],f=a[5],g=a[9];var h=a[2];var l=a[6];var m=a[10];if(.01>Math.abs(c-e)&&.01>Math.abs(d-h)&&.01>Math.abs(g-l)){if(.1>Math.abs(c+ -e)&&.1>Math.abs(d+h)&&.1>Math.abs(g+l)&&.1>Math.abs(b+f+m-3))return this.set(1,0,0,0),this;a=Math.PI;b=(b+1)/2;f=(f+1)/2;m=(m+1)/2;c=(c+e)/4;d=(d+h)/4;g=(g+l)/4;b>f&&b>m?.01>b?(l=0,c=h=.707106781):(l=Math.sqrt(b),h=c/l,c=d/l):f>m?.01>f?(l=.707106781,h=0,c=.707106781):(h=Math.sqrt(f),l=c/h,c=g/h):.01>m?(h=l=.707106781,c=0):(c=Math.sqrt(m),l=d/c,h=g/c);this.set(l,h,c,a);return this}a=Math.sqrt((l-g)*(l-g)+(d-h)*(d-h)+(e-c)*(e-c));.001>Math.abs(a)&&(a=1);this.x=(l-g)/a;this.y=(d-h)/a;this.z=(e-c)/a; +e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b);return this},setAxisAngleFromRotationMatrix:function(a){a=a.elements;var b=a[0];var c=a[4];var d=a[8],e=a[1],f=a[5],g=a[9];var h=a[2];var k=a[6];var m=a[10];if(.01>Math.abs(c-e)&&.01>Math.abs(d-h)&&.01>Math.abs(g-k)){if(.1>Math.abs(c+ +e)&&.1>Math.abs(d+h)&&.1>Math.abs(g+k)&&.1>Math.abs(b+f+m-3))return this.set(1,0,0,0),this;a=Math.PI;b=(b+1)/2;f=(f+1)/2;m=(m+1)/2;c=(c+e)/4;d=(d+h)/4;g=(g+k)/4;b>f&&b>m?.01>b?(k=0,c=h=.707106781):(k=Math.sqrt(b),h=c/k,c=d/k):f>m?.01>f?(k=.707106781,h=0,c=.707106781):(h=Math.sqrt(f),k=c/h,c=g/h):.01>m?(h=k=.707106781,c=0):(c=Math.sqrt(m),k=d/c,h=g/c);this.set(k,h,c,a);return this}a=Math.sqrt((k-g)*(k-g)+(d-h)*(d-h)+(e-c)*(e-c));.001>Math.abs(a)&&(a=1);this.x=(k-g)/a;this.y=(d-h)/a;this.z=(e-c)/a; this.w=Math.acos((b+f+m-1)/2);return this},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);this.z=Math.min(this.z,a.z);this.w=Math.min(this.w,a.w);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.z=Math.max(this.z,a.z);this.w=Math.max(this.w,a.w);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y,this.y));this.z=Math.max(a.z,Math.min(b.z,this.z));this.w=Math.max(a.w,Math.min(b.w, -this.w));return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new ba,b=new ba);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),clampLength:function(a,b){var c=this.length();return this.divideScalar(c||1).multiplyScalar(Math.max(a,Math.min(b,c)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z); +this.w));return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new ca,b=new ca);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),clampLength:function(a,b){var c=this.length();return this.divideScalar(c||1).multiplyScalar(Math.max(a,Math.min(b,c)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z); this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this}, dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.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)},manhattanLength: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(a){return this.normalize().multiplyScalar(a)},lerp:function(a,b){this.x+= (a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];this.w=a[b+3];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;a[b+3]=this.w;return a},fromBufferAttribute:function(a, -b,c){void 0!==c&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute().");this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);this.w=a.getW(b);return this}});Qa.prototype=Object.assign(Object.create(la.prototype),{constructor:Qa,isWebGLRenderTarget:!0,setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.dispose();this.viewport.set(0,0,a,b);this.scissor.set(0,0,a,b)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width= -a.width;this.height=a.height;this.viewport.copy(a.viewport);this.texture=a.texture.clone();this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;this.depthTexture=a.depthTexture;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});Zd.prototype=Object.assign(Object.create(Qa.prototype),{constructor:Zd,isWebGLMultisampleRenderTarget:!0,copy:function(a){Qa.prototype.copy.call(this,a);this.samples=a.samples;return this}});mb.prototype=Object.create(Qa.prototype);mb.prototype.constructor= -mb;mb.prototype.isWebGLRenderTargetCube=!0;nb.prototype=Object.create(U.prototype);nb.prototype.constructor=nb;nb.prototype.isDataTexture=!0;Object.assign(Ga.prototype,{isBox3:!0,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromArray:function(a){for(var b=Infinity,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,g=-Infinity,h=0,l=a.length;he&&(e=m);k>f&&(f=k);p>g&&(g=p)}this.min.set(b,c,d);this.max.set(e, -f,g);return this},setFromBufferAttribute:function(a){for(var b=Infinity,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,g=-Infinity,h=0,l=a.count;he&&(e=m);k>f&&(f=k);p>g&&(g=p)}this.min.set(b,c,d);this.max.set(e,f,g);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;be&&(e=m);p>f&&(f=p);l>g&&(g=l)}this.min.set(b,c,d);this.max.set(e, +f,g);return this},setFromBufferAttribute:function(a){for(var b=Infinity,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,g=-Infinity,h=0,k=a.count;he&&(e=m);p>f&&(f=p);l>g&&(g=l)}this.min.set(b,c,d);this.max.set(e,f,g);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y||a.zthis.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z},getParameter:function(a,b){void 0===b&&(console.warn("THREE.Box3: .getParameter() target is now required"),b=new n);return b.set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))}, intersectsBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y||a.max.zthis.max.z?!1:!0},intersectsSphere:function(){var a=new n;return function(b){this.clampPoint(b.center,a);return a.distanceToSquared(b.center)<=b.radius*b.radius}}(),intersectsPlane:function(a){if(0=-a.constant},intersectsTriangle:function(){function a(a){var e;var f=0;for(e=a.length-3;f<=e;f+=3){h.fromArray(a,f);var g=m.x*Math.abs(h.x)+m.y*Math.abs(h.y)+m.z*Math.abs(h.z),l=b.dot(h),k=c.dot(h),q=d.dot(h);if(Math.max(-Math.max(l,k,q),Math.min(l,k,q))>g)return!1}return!0}var b=new n, -c=new n,d=new n,e=new n,f=new n,g=new n,h=new n,l=new n,m=new n,k=new n;return function(h){if(this.isEmpty())return!1;this.getCenter(l);m.subVectors(this.max,l);b.subVectors(h.a,l);c.subVectors(h.b,l);d.subVectors(h.c,l);e.subVectors(c,b);f.subVectors(d,c);g.subVectors(b,d);h=[0,-e.z,e.y,0,-f.z,f.y,0,-g.z,g.y,e.z,0,-e.x,f.z,0,-f.x,g.z,0,-g.x,-e.y,e.x,0,-f.y,f.x,0,-g.y,g.x,0];if(!a(h))return!1;h=[1,0,0,0,1,0,0,0,1];if(!a(h))return!1;k.crossVectors(e,f);h=[k.x,k.y,k.z];return a(h)}}(),clampPoint:function(a, +a.normal.y*this.max.y):(b+=a.normal.y*this.max.y,c+=a.normal.y*this.min.y);0=-a.constant},intersectsTriangle:function(){function a(a){var e;var f=0;for(e=a.length-3;f<=e;f+=3){h.fromArray(a,f);var g=m.x*Math.abs(h.x)+m.y*Math.abs(h.y)+m.z*Math.abs(h.z),k=b.dot(h),p=c.dot(h),l=d.dot(h);if(Math.max(-Math.max(k,p,l),Math.min(k,p,l))>g)return!1}return!0}var b=new n, +c=new n,d=new n,e=new n,f=new n,g=new n,h=new n,k=new n,m=new n,p=new n;return function(h){if(this.isEmpty())return!1;this.getCenter(k);m.subVectors(this.max,k);b.subVectors(h.a,k);c.subVectors(h.b,k);d.subVectors(h.c,k);e.subVectors(c,b);f.subVectors(d,c);g.subVectors(b,d);h=[0,-e.z,e.y,0,-f.z,f.y,0,-g.z,g.y,e.z,0,-e.x,f.z,0,-f.x,g.z,0,-g.x,-e.y,e.x,0,-f.y,f.x,0,-g.y,g.x,0];if(!a(h))return!1;h=[1,0,0,0,1,0,0,0,1];if(!a(h))return!1;p.crossVectors(e,f);h=[p.x,p.y,p.z];return a(h)}}(),clampPoint:function(a, b){void 0===b&&(console.warn("THREE.Box3: .clampPoint() target is now required"),b=new n);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new n;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a=new n;return function(b){void 0===b&&console.error("THREE.Box3: .getBoundingSphere() target is now required");this.getCenter(b.center);b.radius=.5*this.getSize(a).length();return b}}(),intersect:function(a){this.min.max(a.min); this.max.min(a.max);this.isEmpty()&&this.makeEmpty();return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(){var a=[new n,new n,new n,new n,new n,new n,new n,new n];return function(b){if(this.isEmpty())return this;a[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(b);a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b);a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b);a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b); -a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b);a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b);a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b);a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b);this.setFromPoints(a);return this}}(),translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}});Object.assign(Ra.prototype,{set:function(a,b){this.center.copy(a);this.radius=b;return this}, -setFromPoints:function(){var a=new Ga;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).getCenter(d);for(var e=c=0,f=b.length;e=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius}, +a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b);a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b);a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b);a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b);this.setFromPoints(a);return this}}(),translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}});Object.assign(Ua.prototype,{set:function(a,b){this.center.copy(a);this.radius=b;return this}, +setFromPoints:function(){var a=new Ja;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).getCenter(d);for(var e=c=0,f=b.length;e=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius}, distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},intersectsBox:function(a){return a.intersectsSphere(this)},intersectsPlane:function(a){return Math.abs(a.distanceToPoint(this.center))<=this.radius},clampPoint:function(a,b){var c=this.center.distanceToSquared(a);void 0===b&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),b=new n);b.copy(a);c>this.radius* -this.radius&&(b.sub(this.center).normalize(),b.multiplyScalar(this.radius).add(this.center));return b},getBoundingBox:function(a){void 0===a&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),a=new Ga);a.set(this.center,this.center);a.expandByScalar(this.radius);return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&& -a.radius===this.radius}});Object.assign(Sa.prototype,{set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new n,b=new n;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,c);return this}}(), +this.radius&&(b.sub(this.center).normalize(),b.multiplyScalar(this.radius).add(this.center));return b},getBoundingBox:function(a){void 0===a&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),a=new Ja);a.set(this.center,this.center);a.expandByScalar(this.radius);return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&& +a.radius===this.radius}});Object.assign(Va.prototype,{set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new n,b=new n;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,c);return this}}(), clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){void 0=== b&&(console.warn("THREE.Plane: .projectPoint() target is now required"),b=new n);return b.copy(this.normal).multiplyScalar(-this.distanceToPoint(a)).add(a)},intersectLine:function(){var a=new n;return function(b,c){void 0===c&&(console.warn("THREE.Plane: .intersectLine() target is now required"),c=new n);var d=b.delta(a),e=this.normal.dot(d);if(0===e){if(0===this.distanceToPoint(b.start))return c.copy(b.start)}else if(e=-(b.start.dot(this.normal)+this.constant)/e,!(0>e||1b&&0a&&0c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],l=c[6],m=c[7],k=c[8],p=c[9],n=c[10],r=c[11],t=c[12],u=c[13],x=c[14];c=c[15];b[0].setComponents(f-a,m-g,r-k,c-t).normalize();b[1].setComponents(f+a,m+g,r+k,c+t).normalize();b[2].setComponents(f+d,m+h,r+p,c+u).normalize();b[3].setComponents(f-d,m-h,r-p,c-u).normalize();b[4].setComponents(f-e,m-l,r-n,c-x).normalize();b[5].setComponents(f+e, -m+l,r+n,c+x).normalize();return this},intersectsObject:function(){var a=new Ra;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere).applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSprite:function(){var a=new Ra;return function(b){a.center.set(0,0,0);a.radius=.7071067811865476;a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d= -0;6>d;d++)if(b[d].distanceToPoint(c)d;d++){var e=c[d];a.x=0e.distanceToPoint(a))return!1}return!0}}(),containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0}});Object.assign(Q.prototype,{isMatrix4:!0,set:function(a,b,c,d,e,f,g,h,l,m,k,p,n,r,t,u){var q= -this.elements;q[0]=a;q[4]=b;q[8]=c;q[12]=d;q[1]=e;q[5]=f;q[9]=g;q[13]=h;q[2]=l;q[6]=m;q[10]=k;q[14]=p;q[3]=n;q[7]=r;q[11]=t;q[15]=u;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},clone:function(){return(new Q).fromArray(this.elements)},copy:function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return this}, +intersectsLine:function(a){var b=this.distanceToPoint(a.start);a=this.distanceToPoint(a.end);return 0>b&&0a&&0c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],m=c[7],p=c[8],l=c[9],n=c[10],t=c[11],r=c[12],u=c[13],x=c[14];c=c[15];b[0].setComponents(f-a,m-g,t-p,c-r).normalize();b[1].setComponents(f+a,m+g,t+p,c+r).normalize();b[2].setComponents(f+d,m+h,t+l,c+u).normalize();b[3].setComponents(f-d,m-h,t-l,c-u).normalize();b[4].setComponents(f-e,m-k,t-n,c-x).normalize();b[5].setComponents(f+e, +m+k,t+n,c+x).normalize();return this},intersectsObject:function(){var a=new Ua;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere).applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSprite:function(){var a=new Ua;return function(b){a.center.set(0,0,0);a.radius=.7071067811865476;a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d= +0;6>d;d++)if(b[d].distanceToPoint(c)d;d++){var e=c[d];a.x=0e.distanceToPoint(a))return!1}return!0}}(),containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0}});Object.assign(P.prototype,{isMatrix4:!0,set:function(a,b,c,d,e,f,g,h,k,m,l,q,n,t,r,u){var p= +this.elements;p[0]=a;p[4]=b;p[8]=c;p[12]=d;p[1]=e;p[5]=f;p[9]=g;p[13]=h;p[2]=k;p[6]=m;p[10]=l;p[14]=q;p[3]=n;p[7]=t;p[11]=r;p[15]=u;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},clone:function(){return(new P).fromArray(this.elements)},copy:function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11];b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return this}, copyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractBasis:function(a,b,c){a.setFromMatrixColumn(this,0);b.setFromMatrixColumn(this,1);c.setFromMatrixColumn(this,2);return this},makeBasis:function(a,b,c){this.set(a.x,b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1);return this},extractRotation:function(){var a=new n;return function(b){var c=this.elements,d=b.elements,e=1/a.setFromMatrixColumn(b,0).length(),f=1/a.setFromMatrixColumn(b,1).length(); b=1/a.setFromMatrixColumn(b,2).length();c[0]=d[0]*e;c[1]=d[1]*e;c[2]=d[2]*e;c[3]=0;c[4]=d[4]*f;c[5]=d[5]*f;c[6]=d[6]*f;c[7]=0;c[8]=d[8]*b;c[9]=d[9]*b;c[10]=d[10]*b;c[11]=0;c[12]=0;c[13]=0;c[14]=0;c[15]=1;return this}}(),makeRotationFromEuler:function(a){a&&a.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c);c=Math.sin(c);var g=Math.cos(d);d=Math.sin(d);var h=Math.cos(e); -e=Math.sin(e);if("XYZ"===a.order){a=f*h;var l=f*e,m=c*h,k=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=l+m*d;b[5]=a-k*d;b[9]=-c*g;b[2]=k-a*d;b[6]=m+l*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,l=g*e,m=d*h,k=d*e,b[0]=a+k*c,b[4]=m*c-l,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=l*c-m,b[6]=k+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,l=g*e,m=d*h,k=d*e,b[0]=a-k*c,b[4]=-f*e,b[8]=m+l*c,b[1]=l+m*c,b[5]=f*h,b[9]=k-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,l=f*e,m=c*h,k=c*e,b[0]=g*h,b[4]=m*d-l,b[8]=a*d+k,b[1]=g*e,b[5]= -k*d+a,b[9]=l*d-m,b[2]=-d,b[6]=c*g,b[10]=f*g):"YZX"===a.order?(a=f*g,l=f*d,m=c*g,k=c*d,b[0]=g*h,b[4]=k-a*e,b[8]=m*e+l,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=l*e+m,b[10]=a-k*e):"XZY"===a.order&&(a=f*g,l=f*d,m=c*g,k=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+k,b[5]=f*h,b[9]=l*e-m,b[2]=m*e-l,b[6]=c*h,b[10]=k*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},makeRotationFromQuaternion:function(){var a=new n(0,0,0),b=new n(1,1,1);return function(c){return this.compose(a,c,b)}}(),lookAt:function(){var a= +e=Math.sin(e);if("XYZ"===a.order){a=f*h;var k=f*e,m=c*h,p=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=k+m*d;b[5]=a-p*d;b[9]=-c*g;b[2]=p-a*d;b[6]=m+k*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,k=g*e,m=d*h,p=d*e,b[0]=a+p*c,b[4]=m*c-k,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=k*c-m,b[6]=p+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,k=g*e,m=d*h,p=d*e,b[0]=a-p*c,b[4]=-f*e,b[8]=m+k*c,b[1]=k+m*c,b[5]=f*h,b[9]=p-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,k=f*e,m=c*h,p=c*e,b[0]=g*h,b[4]=m*d-k,b[8]=a*d+p,b[1]=g*e,b[5]= +p*d+a,b[9]=k*d-m,b[2]=-d,b[6]=c*g,b[10]=f*g):"YZX"===a.order?(a=f*g,k=f*d,m=c*g,p=c*d,b[0]=g*h,b[4]=p-a*e,b[8]=m*e+k,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+m,b[10]=a-p*e):"XZY"===a.order&&(a=f*g,k=f*d,m=c*g,p=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+p,b[5]=f*h,b[9]=k*e-m,b[2]=m*e-k,b[6]=c*h,b[10]=p*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},makeRotationFromQuaternion:function(){var a=new n(0,0,0),b=new n(1,1,1);return function(c){return this.compose(a,c,b)}}(),lookAt:function(){var a= new n,b=new n,c=new n;return function(d,e,f){var g=this.elements;c.subVectors(d,e);0===c.lengthSq()&&(c.z=1);c.normalize();a.crossVectors(f,c);0===a.lengthSq()&&(1===Math.abs(f.z)?c.x+=1E-4:c.z+=1E-4,c.normalize(),a.crossVectors(f,c));a.normalize();b.crossVectors(c,a);g[0]=a.x;g[4]=b.x;g[8]=c.x;g[1]=a.y;g[5]=b.y;g[9]=c.y;g[2]=a.z;g[6]=b.z;g[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."), -this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},premultiply:function(a){return this.multiplyMatrices(a,this)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements;b=this.elements;a=c[0];var e=c[4],f=c[8],g=c[12],h=c[1],l=c[5],m=c[9],k=c[13],p=c[2],n=c[6],r=c[10],t=c[14],u=c[3],x=c[7],C=c[11];c=c[15];var w=d[0],y=d[4],A=d[8],K=d[12],z=d[1],F=d[5],D=d[9],B=d[13],E=d[2],G=d[6],H=d[10],J=d[14],M=d[3],N=d[7],O=d[11];d=d[15];b[0]=a*w+e*z+f*E+g*M;b[4]=a*y+e*F+f*G+g*N;b[8]=a*A+e*D+f*H+ -g*O;b[12]=a*K+e*B+f*J+g*d;b[1]=h*w+l*z+m*E+k*M;b[5]=h*y+l*F+m*G+k*N;b[9]=h*A+l*D+m*H+k*O;b[13]=h*K+l*B+m*J+k*d;b[2]=p*w+n*z+r*E+t*M;b[6]=p*y+n*F+r*G+t*N;b[10]=p*A+n*D+r*H+t*O;b[14]=p*K+n*B+r*J+t*d;b[3]=u*w+x*z+C*E+c*M;b[7]=u*y+x*F+C*G+c*N;b[11]=u*A+x*D+C*H+c*O;b[15]=u*K+x*B+C*J+c*d;return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},applyToBufferAttribute:function(){var a= -new n;return function(b){for(var c=0,d=b.count;cthis.determinant()&&(g=-g);c.x=f[12];c.y=f[13];c.z=f[14];b.copy(this);c=1/g;f=1/h;var m=1/l;b.elements[0]*=c;b.elements[1]*=c;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=m;b.elements[9]*=m;b.elements[10]*=m;d.setFromRotationMatrix(b);e.x=g;e.y=h;e.z=l;return this}}(),makePerspective:function(a,b,c,d,e,f){void 0===f&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs."); -var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(c-d);g[9]=(c+d)/(c-d);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=1/(b-a),l=1/(c-d),m=1/(f-e);g[0]=2*h;g[4]=0;g[8]=0;g[12]=-((b+a)*h);g[1]=0;g[5]=2*l;g[9]=0;g[13]=-((c+d)*l);g[2]=0;g[6]=0;g[10]=-2*m;g[14]=-((f+e)*m);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},equals:function(a){var b=this.elements; +c,0,a,1,c,0,a,b,1,0,0,0,0,1);return this},compose:function(a,b,c){var d=this.elements,e=b._x,f=b._y,g=b._z,h=b._w,k=e+e,m=f+f,l=g+g;b=e*k;var q=e*m;e*=l;var n=f*m;f*=l;g*=l;k*=h;m*=h;h*=l;l=c.x;var t=c.y;c=c.z;d[0]=(1-(n+g))*l;d[1]=(q+h)*l;d[2]=(e-m)*l;d[3]=0;d[4]=(q-h)*t;d[5]=(1-(b+g))*t;d[6]=(f+k)*t;d[7]=0;d[8]=(e+m)*c;d[9]=(f-k)*c;d[10]=(1-(b+n))*c;d[11]=0;d[12]=a.x;d[13]=a.y;d[14]=a.z;d[15]=1;return this},decompose:function(){var a=new n,b=new P;return function(c,d,e){var f=this.elements,g=a.set(f[0], +f[1],f[2]).length(),h=a.set(f[4],f[5],f[6]).length(),k=a.set(f[8],f[9],f[10]).length();0>this.determinant()&&(g=-g);c.x=f[12];c.y=f[13];c.z=f[14];b.copy(this);c=1/g;f=1/h;var m=1/k;b.elements[0]*=c;b.elements[1]*=c;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=m;b.elements[9]*=m;b.elements[10]*=m;d.setFromRotationMatrix(b);e.x=g;e.y=h;e.z=k;return this}}(),makePerspective:function(a,b,c,d,e,f){void 0===f&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs."); +var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(c-d);g[9]=(c+d)/(c-d);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=1/(b-a),k=1/(c-d),m=1/(f-e);g[0]=2*h;g[4]=0;g[8]=0;g[12]=-((b+a)*h);g[1]=0;g[5]=2*k;g[9]=0;g[13]=-((c+d)*k);g[2]=0;g[6]=0;g[10]=-2*m;g[14]=-((f+e)*m);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},equals:function(a){var b=this.elements; a=a.elements;for(var c=0;16>c;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;16>c;c++)this.elements[c]=a[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a}});var T={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif", alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",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", aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\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\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\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 dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\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.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - 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 * transposeMat3( 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\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( 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\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick( specularColor, dotNV );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\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}", @@ -487,109 +486,109 @@ points_vert:"uniform float size;\nuniform float scale;\n#include \n#incl shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n}",shadow_vert:"#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}", sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}", sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"}, -ih={clone:Mb,merge:xa},jh={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, +kh={clone:Pb,merge:ia},lh={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(J.prototype,{isColor:!0,r:1,g:1,b:1,set:function(a){a&&a.isColor?this.copy(a):"number"===typeof a?this.setHex(a):"string"===typeof a&&this.setStyle(a);return this},setScalar:function(a){this.b=this.g=this.r=a;return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255; -return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(){function a(a,c,d){0>d&&(d+=1);1d?c:d<2/3?a+6*(c-a)*(2/3-d):a}return function(b,c,d){b=P.euclideanModulo(b,1);c=P.clamp(c,0,1);d=P.clamp(d,0,1);0===c?this.r=this.g=this.b=d:(c=.5>=d?d*(1+c):d+c-d*c,d=2*d-c,this.r=a(d,c,b+1/3),this.g=a(d,c,b),this.b=a(d,c,b-1/3));return this}}(),setStyle:function(a){function b(b){void 0!==b&&1>parseFloat(b)&&console.warn("THREE.Color: Alpha component of "+ +teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Object.assign(M.prototype,{isColor:!0,r:1,g:1,b:1,set:function(a){a&&a.isColor?this.copy(a):"number"===typeof a?this.setHex(a):"string"===typeof a&&this.setStyle(a);return this},setScalar:function(a){this.b=this.g=this.r=a;return this},setHex:function(a){a=Math.floor(a);this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255; +return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(){function a(a,c,d){0>d&&(d+=1);1d?c:d<2/3?a+6*(c-a)*(2/3-d):a}return function(b,c,d){b=K.euclideanModulo(b,1);c=K.clamp(c,0,1);d=K.clamp(d,0,1);0===c?this.r=this.g=this.b=d:(c=.5>=d?d*(1+c):d+c-d*c,d=2*d-c,this.r=a(d,c,b+1/3),this.g=a(d,c,b),this.b=a(d,c,b-1/3));return this}}(),setStyle:function(a){function b(b){void 0!==b&&1>parseFloat(b)&&console.warn("THREE.Color: Alpha component of "+ a+" will be ignored.")}var c;if(c=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(a)){var d=c[2];switch(c[1]){case "rgb":case "rgba":if(c=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r=Math.min(255,parseInt(c[1],10))/255,this.g=Math.min(255,parseInt(c[2],10))/255,this.b=Math.min(255,parseInt(c[3],10))/255,b(c[5]),this;if(c=/^(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r=Math.min(100,parseInt(c[1],10))/100,this.g=Math.min(100,parseInt(c[2], 10))/100,this.b=Math.min(100,parseInt(c[3],10))/100,b(c[5]),this;break;case "hsl":case "hsla":if(c=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d)){d=parseFloat(c[1])/360;var e=parseInt(c[2],10)/100,f=parseInt(c[3],10)/100;b(c[5]);return this.setHSL(d,e,f)}}}else if(c=/^#([A-Fa-f0-9]+)$/.exec(a)){c=c[1];d=c.length;if(3===d)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2), -16)/255,this;if(6===d)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}a&&0a?.0773993808*a:Math.pow(.9478672986*a+.0521327014,2.4)}return function(b){this.r=a(b.r);this.g=a(b.g);this.b= a(b.b);return this}}(),copyLinearToSRGB:function(){function a(a){return.0031308>a?12.92*a:1.055*Math.pow(a,.41666)-.055}return function(b){this.r=a(b.r);this.g=a(b.g);this.b=a(b.b);return this}}(),convertSRGBToLinear:function(){this.copySRGBToLinear(this);return this},convertLinearToSRGB:function(){this.copyLinearToSRGB(this);return 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(a){void 0=== -a&&(console.warn("THREE.Color: .getHSL() target is now required"),a={h:0,s:0,l:0});var b=this.r,c=this.g,d=this.b,e=Math.max(b,c,d),f=Math.min(b,c,d),g,h=(f+e)/2;if(f===e)f=g=0;else{var l=e-f;f=.5>=h?l/(e+f):l/(2-e-f);switch(e){case b:g=(c-d)/l+(c=h?k/(e+f):k/(2-e-f);switch(e){case b:g=(c-d)/k+(cMath.abs(g)?(this._x=Math.atan2(-m,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(p,l),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(m,-1,1)),.99999>Math.abs(m)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h,l)):(this._y=Math.atan2(-k,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(p,-1,1)),.99999>Math.abs(p)?(this._y=Math.atan2(-k,e),this._z=Math.atan2(-f,l)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(k, --1,1)),.99999>Math.abs(k)?(this._x=Math.atan2(p,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,l))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-m,l),this._y=Math.atan2(-k,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z=Math.asin(-d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(p,l),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-m,e),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order= -b;if(!1!==c)this.onChangeCallback();return this},setFromQuaternion:function(){var a=new Q;return function(b,c,d){a.makeRotationFromQuaternion(b);return this.setFromRotationMatrix(a,c,d)}}(),setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,b||this._order)},reorder:function(){var a=new aa;return function(b){a.setFromEuler(this);return this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x= -a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._order;return a},toVector3:function(a){return a?a.set(this._x,this._y,this._z):new n(this._x,this._y,this._z)},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){}});Object.assign(ae.prototype,{set:function(a){this.mask=1<Math.abs(g)?(this._x=Math.atan2(-m,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(q,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(m,-1,1)),.99999>Math.abs(m)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h,k)):(this._y=Math.atan2(-l,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(q,-1,1)),.99999>Math.abs(q)?(this._y=Math.atan2(-l,e),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(l, +-1,1)),.99999>Math.abs(l)?(this._x=Math.atan2(q,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-m,k),this._y=Math.atan2(-l,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z=Math.asin(-d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(q,k),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-m,e),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order= +b;if(!1!==c)this.onChangeCallback();return this},setFromQuaternion:function(){var a=new P;return function(b,c,d){a.makeRotationFromQuaternion(b);return this.setFromRotationMatrix(a,c,d)}}(),setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,b||this._order)},reorder:function(){var a=new Z;return function(b){a.setFromEuler(this);return this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x= +a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._order;return a},toVector3:function(a){return a?a.set(this._x,this._y,this._z):new n(this._x,this._y,this._z)},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){}});Object.assign(be.prototype,{set:function(a){this.mask=1<g;g++)if(d[g]===d[(g+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(d=a[f],this.faces.splice(d,1),c=0,e= this.faceVertexUvs.length;ca?b.copy(this.origin):b.copy(this.direction).multiplyScalar(a).add(this.origin)},distanceToPoint:function(a){return Math.sqrt(this.distanceSqToPoint(a))},distanceSqToPoint:function(){var a=new n;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceToSquared(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceToSquared(b)}}(),distanceSqToSegment:function(){var a= -new n,b=new n,c=new n;return function(d,e,f,g){a.copy(d).add(e).multiplyScalar(.5);b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var h=.5*d.distanceTo(e),l=-this.direction.dot(b),m=c.dot(this.direction),k=-c.dot(b),p=c.lengthSq(),n=Math.abs(1-l*l);if(0=-r?e<=r?(h=1/n,d*=h,e*=h,l=d*(d+l*e+2*m)+e*(l*d+e+2*k)+p):(e=h,d=Math.max(0,-(l*e+m)),l=-d*d+e*(e+2*k)+p):(e=-h,d=Math.max(0,-(l*e+m)),l=-d*d+e*(e+2*k)+p):e<=-r?(d=Math.max(0,-(-l*h+m)),e=0b)return null; +new n,b=new n,c=new n;return function(d,e,f,g){a.copy(d).add(e).multiplyScalar(.5);b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var h=.5*d.distanceTo(e),k=-this.direction.dot(b),m=c.dot(this.direction),l=-c.dot(b),n=c.lengthSq(),v=Math.abs(1-k*k);if(0=-t?e<=t?(h=1/v,d*=h,e*=h,k=d*(d+k*e+2*m)+e*(k*d+e+2*l)+n):(e=h,d=Math.max(0,-(k*e+m)),k=-d*d+e*(e+2*l)+n):(e=-h,d=Math.max(0,-(k*e+m)),k=-d*d+e*(e+2*l)+n):e<=-t?(d=Math.max(0,-(-k*h+m)),e=0b)return null; b=Math.sqrt(b-e);e=d-b;d+=b;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),intersectsSphere:function(a){return this.distanceSqToPoint(a.center)<=a.radius*a.radius},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0===b)return 0===a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){a=this.distanceToPlane(a);return null===a?null:this.at(a,b)},intersectsPlane:function(a){var b=a.distanceToPoint(this.origin); return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},intersectBox:function(a,b){var c=1/this.direction.x;var d=1/this.direction.y;var e=1/this.direction.z,f=this.origin;if(0<=c){var g=(a.min.x-f.x)*c;c*=a.max.x-f.x}else g=(a.max.x-f.x)*c,c*=a.min.x-f.x;if(0<=d){var h=(a.min.y-f.y)*d;d*=a.max.y-f.y}else h=(a.max.y-f.y)*d,d*=a.min.y-f.y;if(g>d||h>c)return null;if(h>g||g!==g)g=h;if(da||h>c)return null; -if(h>g||g!==g)g=h;if(ac?null:this.at(0<=g?g:c,b)},intersectsBox:function(){var a=new n;return function(b){return null!==this.intersectBox(b,a)}}(),intersectTriangle:function(){var a=new n,b=new n,c=new n,d=new n;return function(e,f,g,h,l){b.subVectors(f,e);c.subVectors(g,e);d.crossVectors(b,c);f=this.direction.dot(d);if(0f)h=-1,f=-f;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null; -g=h*this.direction.dot(b.cross(a));if(0>g||e+g>f)return null;e=-h*a.dot(d);return 0>e?null:this.at(e/f,l)}}(),applyMatrix4:function(a){this.origin.applyMatrix4(a);this.direction.transformDirection(a);return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)}});Object.assign(ua,{getNormal:function(){var a=new n;return function(b,c,d,e){void 0===e&&(console.warn("THREE.Triangle: .getNormal() target is now required"),e=new n);e.subVectors(d,c);a.subVectors(b, -c);e.cross(a);b=e.lengthSq();return 0=a.x+a.y}}(),getUV:function(){var a=new n;return function(b,c,d,e,f,g,h,l){this.getBarycoord(b,c,d,e,a);l.set(0,0);l.addScaledVector(f,a.x);l.addScaledVector(g,a.y);l.addScaledVector(h,a.z);return l}}()});Object.assign(ua.prototype,{set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this}, -clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},getArea:function(){var a=new n,b=new n;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return.5*a.cross(b).length()}}(),getMidpoint:function(a){void 0===a&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),a=new n);return a.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(a){return ua.getNormal(this.a, -this.b,this.c,a)},getPlane:function(a){void 0===a&&(console.warn("THREE.Triangle: .getPlane() target is now required"),a=new n);return a.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(a,b){return ua.getBarycoord(a,this.a,this.b,this.c,b)},containsPoint:function(a){return ua.containsPoint(a,this.a,this.b,this.c)},getUV:function(a,b,c,d,e){return ua.getUV(a,this.a,this.b,this.c,b,c,d,e)},intersectsBox:function(a){return a.intersectsTriangle(this)},closestPointToPoint:function(){var a= -new n,b=new n,c=new n,d=new n,e=new n,f=new n;return function(g,h){void 0===h&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),h=new n);var l=this.a,m=this.b,k=this.c;a.subVectors(m,l);b.subVectors(k,l);d.subVectors(g,l);var p=a.dot(d),v=b.dot(d);if(0>=p&&0>=v)return h.copy(l);e.subVectors(g,m);var r=a.dot(e),t=b.dot(e);if(0<=r&&t<=r)return h.copy(m);var u=p*t-r*v;if(0>=u&&0<=p&&0>=r)return m=p/(p-r),h.copy(l).addScaledVector(a,m);f.subVectors(g,k);g=a.dot(f);var x= -b.dot(f);if(0<=x&&g<=x)return h.copy(k);p=g*v-p*x;if(0>=p&&0<=v&&0>=x)return u=v/(v-x),h.copy(l).addScaledVector(b,u);v=r*x-g*t;if(0>=v&&0<=t-r&&0<=g-x)return c.subVectors(k,m),u=(t-r)/(t-r+(g-x)),h.copy(m).addScaledVector(c,u);k=1/(v+p+u);m=p*k;u*=k;return h.copy(l).addScaledVector(a,m).addScaledVector(b,u)}}(),equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}});ya.prototype=Object.create(N.prototype);ya.prototype.constructor=ya;ya.prototype.isMeshBasicMaterial= -!0;ya.prototype.copy=function(a){N.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap; -this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;return this};va.prototype=Object.assign(Object.create(E.prototype),{constructor:va,isMesh:!0,setDrawMode:function(a){this.drawMode=a},copy:function(a){E.prototype.copy.call(this,a);this.drawMode=a.drawMode;void 0!==a.morphTargetInfluences&&(this.morphTargetInfluences=a.morphTargetInfluences.slice());void 0!==a.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},a.morphTargetDictionary)); +if(h>g||g!==g)g=h;if(ac?null:this.at(0<=g?g:c,b)},intersectsBox:function(){var a=new n;return function(b){return null!==this.intersectBox(b,a)}}(),intersectTriangle:function(){var a=new n,b=new n,c=new n,d=new n;return function(e,f,g,h,k){b.subVectors(f,e);c.subVectors(g,e);d.crossVectors(b,c);f=this.direction.dot(d);if(0f)h=-1,f=-f;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null; +g=h*this.direction.dot(b.cross(a));if(0>g||e+g>f)return null;e=-h*a.dot(d);return 0>e?null:this.at(e/f,k)}}(),applyMatrix4:function(a){this.origin.applyMatrix4(a);this.direction.transformDirection(a);return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)}});Object.assign(ra,{getNormal:function(){var a=new n;return function(b,c,d,e){void 0===e&&(console.warn("THREE.Triangle: .getNormal() target is now required"),e=new n);e.subVectors(d,c);a.subVectors(b, +c);e.cross(a);b=e.lengthSq();return 0=a.x+a.y}}(),getUV:function(){var a=new n;return function(b,c,d,e,f,g,h,k){this.getBarycoord(b,c,d,e,a);k.set(0,0);k.addScaledVector(f,a.x);k.addScaledVector(g,a.y);k.addScaledVector(h,a.z);return k}}()});Object.assign(ra.prototype,{set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this}, +clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},getArea:function(){var a=new n,b=new n;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return.5*a.cross(b).length()}}(),getMidpoint:function(a){void 0===a&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),a=new n);return a.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(a){return ra.getNormal(this.a, +this.b,this.c,a)},getPlane:function(a){void 0===a&&(console.warn("THREE.Triangle: .getPlane() target is now required"),a=new n);return a.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(a,b){return ra.getBarycoord(a,this.a,this.b,this.c,b)},containsPoint:function(a){return ra.containsPoint(a,this.a,this.b,this.c)},getUV:function(a,b,c,d,e){return ra.getUV(a,this.a,this.b,this.c,b,c,d,e)},intersectsBox:function(a){return a.intersectsTriangle(this)},closestPointToPoint:function(){var a= +new n,b=new n,c=new n,d=new n,e=new n,f=new n;return function(g,h){void 0===h&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),h=new n);var k=this.a,m=this.b,l=this.c;a.subVectors(m,k);b.subVectors(l,k);d.subVectors(g,k);var q=a.dot(d),v=b.dot(d);if(0>=q&&0>=v)return h.copy(k);e.subVectors(g,m);var t=a.dot(e),r=b.dot(e);if(0<=t&&r<=t)return h.copy(m);var u=q*r-t*v;if(0>=u&&0<=q&&0>=t)return m=q/(q-t),h.copy(k).addScaledVector(a,m);f.subVectors(g,l);g=a.dot(f);var x= +b.dot(f);if(0<=x&&g<=x)return h.copy(l);q=g*v-q*x;if(0>=q&&0<=v&&0>=x)return u=v/(v-x),h.copy(k).addScaledVector(b,u);v=t*x-g*r;if(0>=v&&0<=r-t&&0<=g-x)return c.subVectors(l,m),u=(r-t)/(r-t+(g-x)),h.copy(m).addScaledVector(c,u);l=1/(v+q+u);m=q*l;u*=l;return h.copy(k).addScaledVector(a,m).addScaledVector(b,u)}}(),equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}});Da.prototype=Object.create(O.prototype);Da.prototype.constructor=Da;Da.prototype.isMeshBasicMaterial= +!0;Da.prototype.copy=function(a){O.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap; +this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;return this};va.prototype=Object.assign(Object.create(C.prototype),{constructor:va,isMesh:!0,setDrawMode:function(a){this.drawMode=a},copy:function(a){C.prototype.copy.call(this,a);this.drawMode=a.drawMode;void 0!==a.morphTargetInfluences&&(this.morphTargetInfluences=a.morphTargetInfluences.slice());void 0!==a.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},a.morphTargetDictionary)); return this},updateMorphTargets:function(){var a=this.geometry;if(a.isBufferGeometry){a=a.morphAttributes;var b=Object.keys(a);if(0c.far?null:{distance:b,point:w.clone(),object:a}}function b(b,c,d,e,q,n,w,D,B,E){f.fromBufferAttribute(q,D);g.fromBufferAttribute(q,B);h.fromBufferAttribute(q,E);q=b.morphTargetInfluences;if(c.morphTargets&&n&&q){p.set(0,0,0);v.set(0,0,0);r.set(0,0,0);for(var y= -0,A=n.length;yc.far?null:{distance:b,point:w.clone(),object:a}}function b(b,c,d,e,p,n,w,C,z,E){f.fromBufferAttribute(p,C);g.fromBufferAttribute(p,z);h.fromBufferAttribute(p,E);p=b.morphTargetInfluences;if(c.morphTargets&&n&&p){q.set(0,0,0);v.set(0,0,0);t.set(0,0,0);for(var y= +0,J=n.length;ye.far||f.push({distance:r,point:b.clone(),uv:ua.getUV(b,h,l,m,k,p,v,new z),face:null,object:this})}}(),clone:function(){return(new this.constructor(this.material)).copy(this)}, -copy:function(a){E.prototype.copy.call(this,a);void 0!==a.center&&this.center.copy(a.center);return this}});Hc.prototype=Object.assign(Object.create(E.prototype),{constructor:Hc,copy:function(a){E.prototype.copy.call(this,a,!1);a=a.levels;for(var b=0,c=a.length;be.far||f.push({distance:r,point:b.clone(),uv:ra.getUV(b,h,k,m,l,q,v,new B),face:null,object:this})}}(),clone:function(){return(new this.constructor(this.material)).copy(this)}, +copy:function(a){C.prototype.copy.call(this,a);void 0!==a.center&&this.center.copy(a.center);return this}});Jc.prototype=Object.assign(Object.create(C.prototype),{constructor:Jc,copy:function(a){C.prototype.copy.call(this,a,!1);a=a.levels;for(var b=0,c=a.length;b=d[e].distance)d[e-1].object.visible=!1,d[e].object.visible=!0;else break;for(;ef||(k.applyMatrix4(this.matrixWorld), -u=d.ray.origin.distanceTo(k),ud.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}}else for(g=0,t=r.length/3-1;gf||(k.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(k),ud.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g.isGeometry)for(l= -g.vertices,m=l.length,g=0;gf||(k.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(k),ud.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});X.prototype=Object.assign(Object.create(da.prototype),{constructor:X,isLineSegments:!0,computeLineDistances:function(){var a=new n, -b=new n;return function(){var c=this.geometry;if(c.isBufferGeometry)if(null===c.index){for(var d=c.attributes.position,e=[],f=0,g=d.count;fd.far||e.push({distance:a,distanceToRay:Math.sqrt(f),point:p.clone(),index:c,face:null,object:g}))}var g=this,h=this.geometry,l=this.matrixWorld,m=d.params.Points.threshold;null===h.boundingSphere&&h.computeBoundingSphere();c.copy(h.boundingSphere);c.applyMatrix4(l); -c.radius+=m;if(!1!==d.ray.intersectsSphere(c)){a.getInverse(l);b.copy(d.ray).applyMatrix4(a);m/=(this.scale.x+this.scale.y+this.scale.z)/3;var k=m*m;m=new n;var p=new n;if(h.isBufferGeometry){var v=h.index;h=h.attributes.position.array;if(null!==v){var r=v.array;v=0;for(var t=r.length;v=a.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});Vb.prototype=Object.create(U.prototype);Vb.prototype.constructor=Vb;Vb.prototype.isCompressedTexture=!0;Jc.prototype=Object.create(U.prototype);Jc.prototype.constructor=Jc;Jc.prototype.isCanvasTexture=!0;Kc.prototype=Object.create(U.prototype);Kc.prototype.constructor=Kc;Kc.prototype.isDepthTexture= -!0;Wb.prototype=Object.create(D.prototype);Wb.prototype.constructor=Wb;Lc.prototype=Object.create(G.prototype);Lc.prototype.constructor=Lc;Xb.prototype=Object.create(D.prototype);Xb.prototype.constructor=Xb;Mc.prototype=Object.create(G.prototype);Mc.prototype.constructor=Mc;Aa.prototype=Object.create(D.prototype);Aa.prototype.constructor=Aa;Nc.prototype=Object.create(G.prototype);Nc.prototype.constructor=Nc;Yb.prototype=Object.create(Aa.prototype);Yb.prototype.constructor=Yb;Oc.prototype=Object.create(G.prototype); -Oc.prototype.constructor=Oc;vb.prototype=Object.create(Aa.prototype);vb.prototype.constructor=vb;Pc.prototype=Object.create(G.prototype);Pc.prototype.constructor=Pc;Zb.prototype=Object.create(Aa.prototype);Zb.prototype.constructor=Zb;Qc.prototype=Object.create(G.prototype);Qc.prototype.constructor=Qc;$b.prototype=Object.create(Aa.prototype);$b.prototype.constructor=$b;Rc.prototype=Object.create(G.prototype);Rc.prototype.constructor=Rc;wb.prototype=Object.create(D.prototype);wb.prototype.constructor= -wb;wb.prototype.toJSON=function(){var a=D.prototype.toJSON.call(this);a.path=this.parameters.path.toJSON();return a};Sc.prototype=Object.create(G.prototype);Sc.prototype.constructor=Sc;ac.prototype=Object.create(D.prototype);ac.prototype.constructor=ac;Tc.prototype=Object.create(G.prototype);Tc.prototype.constructor=Tc;bc.prototype=Object.create(D.prototype);bc.prototype.constructor=bc;var kh={triangulate:function(a,b,c){c=c||2;var d=b&&b.length,e=d?b[0]*c:a.length,f=tf(a,0,e,c,!0),g=[];if(!f)return g; -var h;if(d){var l=c;d=[];var m;var k=0;for(m=b.length;k80*c){var r=h=a[0];var t=d=a[1];for(l=c;lh&&(h=k),b>d&&(d=b);h=Math.max(h-r,d-t);h=0!==h?1/h:0}Wc(f,g,c,r,t,h);return g}},$a={area:function(a){for(var b=a.length,c=0,d=b-1,e=0;e$a.area(a)},triangulateShape:function(a,b){var c=[],d=[],e=[];xf(a);yf(c,a);var f=a.length;b.forEach(xf);for(a=0;aMath.abs(g-l)?[new z(a,1-c),new z(h,1-d),new z(m,1-e),new z(p,1-b)]:[new z(g,1-c),new z(l,1-d),new z(k,1-e),new z(n,1-b)]}};Yc.prototype=Object.create(G.prototype);Yc.prototype.constructor=Yc;cc.prototype=Object.create(Va.prototype);cc.prototype.constructor=cc;Zc.prototype=Object.create(G.prototype);Zc.prototype.constructor=Zc;zb.prototype=Object.create(D.prototype);zb.prototype.constructor=zb;$c.prototype=Object.create(G.prototype);$c.prototype.constructor=$c;dc.prototype= -Object.create(D.prototype);dc.prototype.constructor=dc;ad.prototype=Object.create(G.prototype);ad.prototype.constructor=ad;ec.prototype=Object.create(D.prototype);ec.prototype.constructor=ec;Ab.prototype=Object.create(G.prototype);Ab.prototype.constructor=Ab;Ab.prototype.toJSON=function(){var a=G.prototype.toJSON.call(this);return Af(this.parameters.shapes,a)};Bb.prototype=Object.create(D.prototype);Bb.prototype.constructor=Bb;Bb.prototype.toJSON=function(){var a=D.prototype.toJSON.call(this);return Af(this.parameters.shapes, -a)};fc.prototype=Object.create(D.prototype);fc.prototype.constructor=fc;Cb.prototype=Object.create(G.prototype);Cb.prototype.constructor=Cb;ab.prototype=Object.create(D.prototype);ab.prototype.constructor=ab;bd.prototype=Object.create(Cb.prototype);bd.prototype.constructor=bd;cd.prototype=Object.create(ab.prototype);cd.prototype.constructor=cd;dd.prototype=Object.create(G.prototype);dd.prototype.constructor=dd;gc.prototype=Object.create(D.prototype);gc.prototype.constructor=gc;var oa=Object.freeze({WireframeGeometry:Wb, -ParametricGeometry:Lc,ParametricBufferGeometry:Xb,TetrahedronGeometry:Nc,TetrahedronBufferGeometry:Yb,OctahedronGeometry:Oc,OctahedronBufferGeometry:vb,IcosahedronGeometry:Pc,IcosahedronBufferGeometry:Zb,DodecahedronGeometry:Qc,DodecahedronBufferGeometry:$b,PolyhedronGeometry:Mc,PolyhedronBufferGeometry:Aa,TubeGeometry:Rc,TubeBufferGeometry:wb,TorusKnotGeometry:Sc,TorusKnotBufferGeometry:ac,TorusGeometry:Tc,TorusBufferGeometry:bc,TextGeometry:Yc,TextBufferGeometry:cc,SphereGeometry:Zc,SphereBufferGeometry:zb, -RingGeometry:$c,RingBufferGeometry:dc,PlaneGeometry:Bc,PlaneBufferGeometry:sb,LatheGeometry:ad,LatheBufferGeometry:ec,ShapeGeometry:Ab,ShapeBufferGeometry:Bb,ExtrudeGeometry:yb,ExtrudeBufferGeometry:Va,EdgesGeometry:fc,ConeGeometry:bd,ConeBufferGeometry:cd,CylinderGeometry:Cb,CylinderBufferGeometry:ab,CircleGeometry:dd,CircleBufferGeometry:gc,BoxGeometry:Ob,BoxBufferGeometry:rb});Db.prototype=Object.create(N.prototype);Db.prototype.constructor=Db;Db.prototype.isShadowMaterial=!0;Db.prototype.copy= -function(a){N.prototype.copy.call(this,a);this.color.copy(a.color);return this};hc.prototype=Object.create(Ca.prototype);hc.prototype.constructor=hc;hc.prototype.isRawShaderMaterial=!0;Wa.prototype=Object.create(N.prototype);Wa.prototype.constructor=Wa;Wa.prototype.isMeshStandardMaterial=!0;Wa.prototype.copy=function(a){N.prototype.copy.call(this,a);this.defines={STANDARD:""};this.color.copy(a.color);this.roughness=a.roughness;this.metalness=a.metalness;this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity= +!0;for(var e=1,f=d.length;e=d[e].distance)d[e-1].object.visible=!1,d[e].object.visible=!0;else break;for(;ef||(l.applyMatrix4(this.matrixWorld), +u=d.ray.origin.distanceTo(l),ud.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}}else for(g=0,r=t.length/3-1;gf||(l.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(l),ud.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g.isGeometry)for(k= +g.vertices,m=k.length,g=0;gf||(l.applyMatrix4(this.matrixWorld),u=d.ray.origin.distanceTo(l),ud.far||e.push({distance:u,point:h.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});V.prototype=Object.assign(Object.create(oa.prototype),{constructor:V,isLineSegments:!0,computeLineDistances:function(){var a=new n, +b=new n;return function(){var c=this.geometry;if(c.isBufferGeometry)if(null===c.index){for(var d=c.attributes.position,e=[],f=0,g=d.count;fd.far||e.push({distance:a,distanceToRay:Math.sqrt(f),point:q.clone(),index:c,face:null,object:g}))}var g=this,h=this.geometry,k=this.matrixWorld,m=d.params.Points.threshold;null===h.boundingSphere&&h.computeBoundingSphere();c.copy(h.boundingSphere);c.applyMatrix4(k); +c.radius+=m;if(!1!==d.ray.intersectsSphere(c)){a.getInverse(k);b.copy(d.ray).applyMatrix4(a);m/=(this.scale.x+this.scale.y+this.scale.z)/3;var l=m*m;m=new n;var q=new n;if(h.isBufferGeometry){var v=h.index;h=h.attributes.position.array;if(null!==v){var t=v.array;v=0;for(var r=t.length;v=a.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});Yb.prototype=Object.create(W.prototype);Yb.prototype.constructor=Yb;Yb.prototype.isCompressedTexture=!0;Lc.prototype=Object.create(W.prototype);Lc.prototype.constructor=Lc;Lc.prototype.isCanvasTexture=!0;Mc.prototype=Object.create(W.prototype);Mc.prototype.constructor=Mc;Mc.prototype.isDepthTexture= +!0;Zb.prototype=Object.create(z.prototype);Zb.prototype.constructor=Zb;Nc.prototype=Object.create(N.prototype);Nc.prototype.constructor=Nc;$b.prototype=Object.create(z.prototype);$b.prototype.constructor=$b;Oc.prototype=Object.create(N.prototype);Oc.prototype.constructor=Oc;ka.prototype=Object.create(z.prototype);ka.prototype.constructor=ka;Pc.prototype=Object.create(N.prototype);Pc.prototype.constructor=Pc;ac.prototype=Object.create(ka.prototype);ac.prototype.constructor=ac;Qc.prototype=Object.create(N.prototype); +Qc.prototype.constructor=Qc;yb.prototype=Object.create(ka.prototype);yb.prototype.constructor=yb;Rc.prototype=Object.create(N.prototype);Rc.prototype.constructor=Rc;bc.prototype=Object.create(ka.prototype);bc.prototype.constructor=bc;Sc.prototype=Object.create(N.prototype);Sc.prototype.constructor=Sc;cc.prototype=Object.create(ka.prototype);cc.prototype.constructor=cc;Tc.prototype=Object.create(N.prototype);Tc.prototype.constructor=Tc;zb.prototype=Object.create(z.prototype);zb.prototype.constructor= +zb;zb.prototype.toJSON=function(){var a=z.prototype.toJSON.call(this);a.path=this.parameters.path.toJSON();return a};Uc.prototype=Object.create(N.prototype);Uc.prototype.constructor=Uc;dc.prototype=Object.create(z.prototype);dc.prototype.constructor=dc;Vc.prototype=Object.create(N.prototype);Vc.prototype.constructor=Vc;ec.prototype=Object.create(z.prototype);ec.prototype.constructor=ec;var mh={triangulate:function(a,b,c){c=c||2;var d=b&&b.length,e=d?b[0]*c:a.length,f=vf(a,0,e,c,!0),g=[];if(!f)return g; +var h;if(d){var k=c;d=[];var m;var l=0;for(m=b.length;l80*c){var t=h=a[0];var r=d=a[1];for(k=c;kh&&(h=l),b>d&&(d=b);h=Math.max(h-t,d-r);h=0!==h?1/h:0}Yc(f,g,c,t,r,h);return g}},cb={area:function(a){for(var b=a.length,c=0,d=b-1,e=0;ecb.area(a)},triangulateShape:function(a,b){var c=[],d=[],e=[];zf(a);Af(c,a);var f=a.length;b.forEach(zf);for(a=0;aMath.abs(g-k)?[new B(a,1-c),new B(h,1-d),new B(m,1-e),new B(n,1-b)]:[new B(g,1-c),new B(k,1-d),new B(l,1-e),new B(v,1-b)]}};$c.prototype=Object.create(N.prototype);$c.prototype.constructor=$c;fc.prototype=Object.create(Ya.prototype);fc.prototype.constructor=fc;ad.prototype=Object.create(N.prototype);ad.prototype.constructor=ad;Cb.prototype=Object.create(z.prototype);Cb.prototype.constructor=Cb;bd.prototype=Object.create(N.prototype);bd.prototype.constructor=bd;gc.prototype= +Object.create(z.prototype);gc.prototype.constructor=gc;cd.prototype=Object.create(N.prototype);cd.prototype.constructor=cd;hc.prototype=Object.create(z.prototype);hc.prototype.constructor=hc;Db.prototype=Object.create(N.prototype);Db.prototype.constructor=Db;Db.prototype.toJSON=function(){var a=N.prototype.toJSON.call(this);return Cf(this.parameters.shapes,a)};Eb.prototype=Object.create(z.prototype);Eb.prototype.constructor=Eb;Eb.prototype.toJSON=function(){var a=z.prototype.toJSON.call(this);return Cf(this.parameters.shapes, +a)};ic.prototype=Object.create(z.prototype);ic.prototype.constructor=ic;Fb.prototype=Object.create(N.prototype);Fb.prototype.constructor=Fb;db.prototype=Object.create(z.prototype);db.prototype.constructor=db;dd.prototype=Object.create(Fb.prototype);dd.prototype.constructor=dd;ed.prototype=Object.create(db.prototype);ed.prototype.constructor=ed;fd.prototype=Object.create(N.prototype);fd.prototype.constructor=fd;jc.prototype=Object.create(z.prototype);jc.prototype.constructor=jc;var ya=Object.freeze({WireframeGeometry:Zb, +ParametricGeometry:Nc,ParametricBufferGeometry:$b,TetrahedronGeometry:Pc,TetrahedronBufferGeometry:ac,OctahedronGeometry:Qc,OctahedronBufferGeometry:yb,IcosahedronGeometry:Rc,IcosahedronBufferGeometry:bc,DodecahedronGeometry:Sc,DodecahedronBufferGeometry:cc,PolyhedronGeometry:Oc,PolyhedronBufferGeometry:ka,TubeGeometry:Tc,TubeBufferGeometry:zb,TorusKnotGeometry:Uc,TorusKnotBufferGeometry:dc,TorusGeometry:Vc,TorusBufferGeometry:ec,TextGeometry:$c,TextBufferGeometry:fc,SphereGeometry:ad,SphereBufferGeometry:Cb, +RingGeometry:bd,RingBufferGeometry:gc,PlaneGeometry:Dc,PlaneBufferGeometry:vb,LatheGeometry:cd,LatheBufferGeometry:hc,ShapeGeometry:Db,ShapeBufferGeometry:Eb,ExtrudeGeometry:Bb,ExtrudeBufferGeometry:Ya,EdgesGeometry:ic,ConeGeometry:dd,ConeBufferGeometry:ed,CylinderGeometry:Fb,CylinderBufferGeometry:db,CircleGeometry:fd,CircleBufferGeometry:jc,BoxGeometry:Rb,BoxBufferGeometry:ub});Gb.prototype=Object.create(O.prototype);Gb.prototype.constructor=Gb;Gb.prototype.isShadowMaterial=!0;Gb.prototype.copy= +function(a){O.prototype.copy.call(this,a);this.color.copy(a.color);return this};kc.prototype=Object.create(Ca.prototype);kc.prototype.constructor=kc;kc.prototype.isRawShaderMaterial=!0;Za.prototype=Object.create(O.prototype);Za.prototype.constructor=Za;Za.prototype.isMeshStandardMaterial=!0;Za.prototype.copy=function(a){O.prototype.copy.call(this,a);this.defines={STANDARD:""};this.color.copy(a.color);this.roughness=a.roughness;this.metalness=a.metalness;this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity= a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.roughnessMap=a.roughnessMap;this.metalnessMap= -a.metalnessMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.envMapIntensity=a.envMapIntensity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Eb.prototype=Object.create(Wa.prototype);Eb.prototype.constructor=Eb;Eb.prototype.isMeshPhysicalMaterial= -!0;Eb.prototype.copy=function(a){Wa.prototype.copy.call(this,a);this.defines={PHYSICAL:""};this.reflectivity=a.reflectivity;this.clearCoat=a.clearCoat;this.clearCoatRoughness=a.clearCoatRoughness;return this};Ia.prototype=Object.create(N.prototype);Ia.prototype.constructor=Ia;Ia.prototype.isMeshPhongMaterial=!0;Ia.prototype.copy=function(a){N.prototype.copy.call(this,a);this.color.copy(a.color);this.specular.copy(a.specular);this.shininess=a.shininess;this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity= +a.metalnessMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.envMapIntensity=a.envMapIntensity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Hb.prototype=Object.create(Za.prototype);Hb.prototype.constructor=Hb;Hb.prototype.isMeshPhysicalMaterial= +!0;Hb.prototype.copy=function(a){Za.prototype.copy.call(this,a);this.defines={PHYSICAL:""};this.reflectivity=a.reflectivity;this.clearCoat=a.clearCoat;this.clearCoatRoughness=a.clearCoatRoughness;return this};La.prototype=Object.create(O.prototype);La.prototype.constructor=La;La.prototype.isMeshPhongMaterial=!0;La.prototype.copy=function(a){O.prototype.copy.call(this,a);this.color.copy(a.color);this.specular.copy(a.specular);this.shininess=a.shininess;this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity= a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap; -this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Fb.prototype=Object.create(Ia.prototype);Fb.prototype.constructor=Fb;Fb.prototype.isMeshToonMaterial=!0;Fb.prototype.copy=function(a){Ia.prototype.copy.call(this, -a);this.gradientMap=a.gradientMap;return this};Gb.prototype=Object.create(N.prototype);Gb.prototype.constructor=Gb;Gb.prototype.isMeshNormalMaterial=!0;Gb.prototype.copy=function(a){N.prototype.copy.call(this,a);this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe; -this.wireframeLinewidth=a.wireframeLinewidth;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Hb.prototype=Object.create(N.prototype);Hb.prototype.constructor=Hb;Hb.prototype.isMeshLambertMaterial=!0;Hb.prototype.copy=function(a){N.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive); +this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Ib.prototype=Object.create(La.prototype);Ib.prototype.constructor=Ib;Ib.prototype.isMeshToonMaterial=!0;Ib.prototype.copy=function(a){La.prototype.copy.call(this, +a);this.gradientMap=a.gradientMap;return this};Jb.prototype=Object.create(O.prototype);Jb.prototype.constructor=Jb;Jb.prototype.isMeshNormalMaterial=!0;Jb.prototype.copy=function(a){O.prototype.copy.call(this,a);this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe; +this.wireframeLinewidth=a.wireframeLinewidth;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Kb.prototype=Object.create(O.prototype);Kb.prototype.constructor=Kb;Kb.prototype.isMeshLambertMaterial=!0;Kb.prototype.copy=function(a){O.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive); this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this}; -Ib.prototype=Object.create(N.prototype);Ib.prototype.constructor=Ib;Ib.prototype.isMeshMatcapMaterial=!0;Ib.prototype.copy=function(a){N.prototype.copy.call(this,a);this.defines={MATCAP:""};this.color.copy(a.color);this.matcap=a.matcap;this.map=a.map;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias= -a.displacementBias;this.alphaMap=a.alphaMap;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Jb.prototype=Object.create(R.prototype);Jb.prototype.constructor=Jb;Jb.prototype.isLineDashedMaterial=!0;Jb.prototype.copy=function(a){R.prototype.copy.call(this,a);this.scale=a.scale;this.dashSize=a.dashSize;this.gapSize=a.gapSize;return this};var lh=Object.freeze({ShadowMaterial:Db,SpriteMaterial:jb,RawShaderMaterial:hc,ShaderMaterial:Ca,PointsMaterial:Ha, -MeshPhysicalMaterial:Eb,MeshStandardMaterial:Wa,MeshPhongMaterial:Ia,MeshToonMaterial:Fb,MeshNormalMaterial:Gb,MeshLambertMaterial:Hb,MeshDepthMaterial:gb,MeshDistanceMaterial:hb,MeshBasicMaterial:ya,MeshMatcapMaterial:Ib,LineDashedMaterial:Jb,LineBasicMaterial:R,Material:N}),ta={arraySlice:function(a,b,c){return ta.isTypedArray(a)?new a.constructor(a.subarray(b,void 0!==c?c:a.length)):a.slice(b,c)},convertArray:function(a,b,c){return!a||!c&&a.constructor===b?a:"number"===typeof b.BYTES_PER_ELEMENT? -new b(a):Array.prototype.slice.call(a)},isTypedArray:function(a){return ArrayBuffer.isView(a)&&!(a instanceof DataView)},getKeyframeOrder:function(a){for(var b=a.length,c=Array(b),d=0;d!==b;++d)c[d]=d;c.sort(function(b,c){return a[b]-a[c]});return c},sortedArray:function(a,b,c){for(var d=a.length,e=new a.constructor(d),f=0,g=0;g!==d;++f)for(var h=c[f]*b,l=0;l!==b;++l)e[g++]=a[h+l];return e},flattenJSON:function(a,b,c,d){for(var e=1,f=a[0];void 0!==f&&void 0===f[d];)f=a[e++];if(void 0!==f){var g=f[d]; -if(void 0!==g)if(Array.isArray(g)){do g=f[d],void 0!==g&&(b.push(f.time),c.push.apply(c,g)),f=a[e++];while(void 0!==f)}else if(void 0!==g.toArray){do g=f[d],void 0!==g&&(b.push(f.time),g.toArray(c,c.length)),f=a[e++];while(void 0!==f)}else{do g=f[d],void 0!==g&&(b.push(f.time),c.push(g)),f=a[e++];while(void 0!==f)}}}};Object.assign(wa.prototype,{evaluate:function(a){var b=this.parameterPositions,c=this._cachedIndex,d=b[c],e=b[c-1];a:{b:{c:{d:if(!(a=e)break a;else{f=b[1];a=e)break b}d=c;c=0}}for(;c>>1,ab;)--f;++f;if(0!==e||f!==d)e>=f&&(f=Math.max(f,1),e=f-1),a=this.getValueSize(),this.times=ta.arraySlice(c,e,f),this.values=ta.arraySlice(this.values,e*a,f*a);return this},validate:function(){var a=!0,b=this.getValueSize();0!==b-Math.floor(b)&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),a=!1);var c=this.times;b=this.values;var d=c.length;0===d&&(console.error("THREE.KeyframeTrack: Track is empty.", -this),a=!1);for(var e=null,f=0;f!==d;f++){var g=c[f];if("number"===typeof g&&isNaN(g)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,f,g);a=!1;break}if(null!==e&&e>g){console.error("THREE.KeyframeTrack: Out of order keys.",this,f,g,e);a=!1;break}e=g}if(void 0!==b&&ta.isTypedArray(b))for(f=0,c=b.length;f!==c;++f)if(d=b[f],isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,f,d);a=!1;break}return a},optimize:function(){for(var a=this.times,b=this.values, -c=this.getValueSize(),d=2302===this.getInterpolation(),e=1,f=a.length-1,g=1;gb;)--f;++f;if(0!==e||f!==d)e>=f&&(f=Math.max(f,1),e=f-1),a=this.getValueSize(),this.times=pa.arraySlice(c,e,f),this.values=pa.arraySlice(this.values,e*a,f*a);return this},validate:function(){var a=!0,b=this.getValueSize();0!==b-Math.floor(b)&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),a=!1);var c=this.times;b=this.values;var d=c.length;0===d&&(console.error("THREE.KeyframeTrack: Track is empty.", +this),a=!1);for(var e=null,f=0;f!==d;f++){var g=c[f];if("number"===typeof g&&isNaN(g)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,f,g);a=!1;break}if(null!==e&&e>g){console.error("THREE.KeyframeTrack: Out of order keys.",this,f,g,e);a=!1;break}e=g}if(void 0!==b&&pa.isTypedArray(b))for(f=0,c=b.length;f!==c;++f)if(d=b[f],isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,f,d);a=!1;break}return a},optimize:function(){for(var a=this.times,b=this.values, +c=this.getValueSize(),d=2302===this.getInterpolation(),e=1,f=a.length-1,g=1;gg)e=a+1;else if(0b&&(b=0);1Number.EPSILON&&(g.normalize(),c=Math.acos(P.clamp(d[l-1].dot(d[l]),-1,1)),e[l].applyMatrix4(h.makeRotationAxis(g,c))),f[l].crossVectors(d[l],e[l]);if(!0===b)for(c=Math.acos(P.clamp(e[0].dot(e[a]),-1,1)),c/=a,0d;)d+=c;for(;d>c;)d-=c;de&&(e=1);1E-4>d&&(d=e);1E-4>l&&(l=e);Ke.initNonuniformCatmullRom(f.x,g.x,h.x,c.x,d,e,l);Le.initNonuniformCatmullRom(f.y,g.y,h.y,c.y,d,e,l);Me.initNonuniformCatmullRom(f.z,g.z,h.z,c.z,d,e,l)}else"catmullrom"===this.curveType&&(Ke.initCatmullRom(f.x,g.x,h.x,c.x,this.tension),Le.initCatmullRom(f.y,g.y,h.y,c.y,this.tension),Me.initCatmullRom(f.z,g.z,h.z,c.z,this.tension));b.set(Ke.calc(a), -Le.calc(a),Me.calc(a));return b};pa.prototype.copy=function(a){O.prototype.copy.call(this,a);this.points=[];for(var b=0,c=a.points.length;bc.length-2?c.length-1:a+1];c=c[a>c.length-3?c.length-1:a+2];b.set(Df(d,e.x,f.x,g.x,c.x),Df(d,e.y,f.y,g.y,c.y));return b};Na.prototype.copy=function(a){O.prototype.copy.call(this,a);this.points=[];for(var b=0,c=a.points.length;b=b)return b=c[a]-b,a=this.curves[a],c=a.getLength(),a.getPointAt(0===c?0:1-b/c);a++}return null},getLength:function(){var a=this.getCurveLengths(); +a-1E-4;a+=1E-4;0>b&&(b=0);1Number.EPSILON&&(g.normalize(),c=Math.acos(K.clamp(d[k-1].dot(d[k]),-1,1)),e[k].applyMatrix4(h.makeRotationAxis(g,c))),f[k].crossVectors(d[k],e[k]);if(!0===b)for(c=Math.acos(K.clamp(e[0].dot(e[a]),-1,1)),c/=a,0d;)d+=c;for(;d>c;)d-=c;de&&(e=1);1E-4>d&&(d=e);1E-4>k&&(k=e);Ke.initNonuniformCatmullRom(f.x,g.x,h.x,c.x,d,e,k);Le.initNonuniformCatmullRom(f.y,g.y,h.y,c.y,d,e,k);Me.initNonuniformCatmullRom(f.z,g.z,h.z,c.z,d,e,k)}else"catmullrom"===this.curveType&&(Ke.initCatmullRom(f.x,g.x,h.x,c.x,this.tension),Le.initCatmullRom(f.y,g.y,h.y,c.y,this.tension),Me.initCatmullRom(f.z,g.z,h.z,c.z,this.tension));b.set(Ke.calc(a), +Le.calc(a),Me.calc(a));return b};qa.prototype.copy=function(a){I.prototype.copy.call(this,a);this.points=[];for(var b=0,c=a.points.length;bc.length-2?c.length-1:a+1];c=c[a>c.length-3?c.length-1:a+2];b.set(Ff(d,e.x,f.x,g.x,c.x),Ff(d,e.y,f.y,g.y,c.y));return b};Qa.prototype.copy=function(a){I.prototype.copy.call(this,a);this.points=[];for(var b=0,c=a.points.length;b=b)return b=c[a]-b,a=this.curves[a],c=a.getLength(),a.getPointAt(0===c?0:1-b/c);a++}return null},getLength:function(){var a=this.getCurveLengths(); return a[a.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 a=[],b=0,c=0,d=this.curves.length;cNumber.EPSILON){if(0>k&&(g=b[f],l=-l,h=b[e],k=-k),!(a.yh.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=k*(a.x-g.x)-l*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=$a.isClockWise,f=this.subPaths;if(0===f.length)return[];if(!0===b)return c(f);b=[];if(1===f.length){var g=f[0];var h=new kb;h.curves=g.curves; -b.push(h);return b}var l=!e(f[0].getPoints());l=a?!l:l;h=[];var k=[],n=[],p=0;k[p]=void 0;n[p]=[];for(var v=0,r=f.length;vk.opacity&&(k.transparent=!0);d.setTextures(l);return d.parse(k)}}()});var Yd,xe={getContext:function(){void 0===Yd&&(Yd=new (window.AudioContext||window.webkitAudioContext));return Yd},setContext:function(a){Yd=a}};Object.assign(ue.prototype,{load:function(a,b,c,d){var e=new Ja(this.manager);e.setResponseType("arraybuffer");e.setPath(this.path);e.load(a,function(a){a=a.slice(0);xe.getContext().decodeAudioData(a,function(a){b(a)})},c,d)},setPath:function(a){this.path=a; -return this}});Object.assign(Ff.prototype,{update:function(){var a,b,c,d,e,f,g,h,l=new Q,k=new Q;return function(m){if(a!==this||b!==m.focus||c!==m.fov||d!==m.aspect*this.aspect||e!==m.near||f!==m.far||g!==m.zoom||h!==this.eyeSep){a=this;b=m.focus;c=m.fov;d=m.aspect*this.aspect;e=m.near;f=m.far;g=m.zoom;var n=m.projectionMatrix.clone();h=this.eyeSep/2;var q=h*e/b,r=e*Math.tan(P.DEG2RAD*c*.5)/g;k.elements[12]=-h;l.elements[12]=h;var t=-r*d+q;var u=r*d+q;n.elements[0]=2*e/(u-t);n.elements[8]=(u+t)/ -(u-t);this.cameraL.projectionMatrix.copy(n);t=-r*d-q;u=r*d-q;n.elements[0]=2*e/(u-t);n.elements[8]=(u+t)/(u-t);this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(m.matrixWorld).multiply(k);this.cameraR.matrixWorld.copy(m.matrixWorld).multiply(l)}}()});ld.prototype=Object.create(E.prototype);ld.prototype.constructor=ld;Object.assign(ve.prototype,{start:function(){this.oldTime=this.startTime=("undefined"===typeof performance?Date:performance).now();this.elapsedTime=0;this.running=!0}, -stop:function(){this.getElapsedTime();this.autoStart=this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var b=("undefined"===typeof performance?Date:performance).now();a=(b-this.oldTime)/1E3;this.oldTime=b;this.elapsedTime+=a}return a}});we.prototype=Object.assign(Object.create(E.prototype),{constructor:we,getInput:function(){return this.gain},removeFilter:function(){null!== +void 0!==a.userData&&(f.userData=a.userData);void 0!==a.layers&&(f.layers.mask=a.layers);if(void 0!==a.children){g=a.children;for(var h=0;hNumber.EPSILON){if(0>m&&(g=b[f],k=-k,h=b[e],m=-m),!(a.yh.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=m*(a.x-g.x)-k*(a.y-g.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=cb.isClockWise,f=this.subPaths;if(0===f.length)return[];if(!0===b)return c(f);b=[];if(1===f.length){var g=f[0];var h=new nb;h.curves=g.curves; +b.push(h);return b}var k=!e(f[0].getPoints());k=a?!k:k;h=[];var m=[],l=[],n=0;m[n]=void 0;l[n]=[];for(var v=0,t=f.length;vl.opacity&&(l.transparent=!0);d.setTextures(k);return d.parse(l)}}()});var Zd,xe={getContext:function(){void 0===Zd&&(Zd=new (window.AudioContext||window.webkitAudioContext));return Zd},setContext:function(a){Zd=a}};Object.assign(ue.prototype,{load:function(a,b,c,d){var e=new Ma(this.manager);e.setResponseType("arraybuffer");e.setPath(this.path);e.load(a,function(a){a=a.slice(0);xe.getContext().decodeAudioData(a,function(a){b(a)})},c,d)},setPath:function(a){this.path=a; +return this}});Object.assign(Hf.prototype,{update:function(){var a,b,c,d,e,f,g,h,k=new P,l=new P;return function(m){if(a!==this||b!==m.focus||c!==m.fov||d!==m.aspect*this.aspect||e!==m.near||f!==m.far||g!==m.zoom||h!==this.eyeSep){a=this;b=m.focus;c=m.fov;d=m.aspect*this.aspect;e=m.near;f=m.far;g=m.zoom;var n=m.projectionMatrix.clone();h=this.eyeSep/2;var p=h*e/b,t=e*Math.tan(K.DEG2RAD*c*.5)/g;l.elements[12]=-h;k.elements[12]=h;var r=-t*d+p;var u=t*d+p;n.elements[0]=2*e/(u-r);n.elements[8]=(u+r)/ +(u-r);this.cameraL.projectionMatrix.copy(n);r=-t*d-p;u=t*d-p;n.elements[0]=2*e/(u-r);n.elements[8]=(u+r)/(u-r);this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(m.matrixWorld).multiply(l);this.cameraR.matrixWorld.copy(m.matrixWorld).multiply(k)}}()});nd.prototype=Object.create(C.prototype);nd.prototype.constructor=nd;Object.assign(ve.prototype,{start:function(){this.oldTime=this.startTime=("undefined"===typeof performance?Date:performance).now();this.elapsedTime=0;this.running=!0}, +stop:function(){this.getElapsedTime();this.autoStart=this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var b=("undefined"===typeof performance?Date:performance).now();a=(b-this.oldTime)/1E3;this.oldTime=b;this.elapsedTime+=a}return a}});we.prototype=Object.assign(Object.create(C.prototype),{constructor:we,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);return this},getFilter:function(){return this.filter},setFilter:function(a){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination);this.filter=a;this.gain.connect(this.filter);this.filter.connect(this.context.destination);return this},getMasterVolume:function(){return this.gain.gain.value}, -setMasterVolume:function(a){this.gain.gain.setTargetAtTime(a,this.context.currentTime,.01);return this},updateMatrixWorld:function(){var a=new n,b=new aa,c=new n,d=new n,e=new ve;return function(f){E.prototype.updateMatrixWorld.call(this,f);f=this.context.listener;var g=this.up;this.timeDelta=e.getDelta();this.matrixWorld.decompose(a,b,c);d.set(0,0,-1).applyQuaternion(b);if(f.positionX){var h=this.context.currentTime+this.timeDelta;f.positionX.linearRampToValueAtTime(a.x,h);f.positionY.linearRampToValueAtTime(a.y, -h);f.positionZ.linearRampToValueAtTime(a.z,h);f.forwardX.linearRampToValueAtTime(d.x,h);f.forwardY.linearRampToValueAtTime(d.y,h);f.forwardZ.linearRampToValueAtTime(d.z,h);f.upX.linearRampToValueAtTime(g.x,h);f.upY.linearRampToValueAtTime(g.y,h);f.upZ.linearRampToValueAtTime(g.z,h)}else f.setPosition(a.x,a.y,a.z),f.setOrientation(d.x,d.y,d.z,g.x,g.y,g.z)}}()});lc.prototype=Object.assign(Object.create(E.prototype),{constructor:lc,getOutput:function(){return this.gain},setNodeSource:function(a){this.hasPlaybackControl= +setMasterVolume:function(a){this.gain.gain.setTargetAtTime(a,this.context.currentTime,.01);return this},updateMatrixWorld:function(){var a=new n,b=new Z,c=new n,d=new n,e=new ve;return function(f){C.prototype.updateMatrixWorld.call(this,f);f=this.context.listener;var g=this.up;this.timeDelta=e.getDelta();this.matrixWorld.decompose(a,b,c);d.set(0,0,-1).applyQuaternion(b);if(f.positionX){var h=this.context.currentTime+this.timeDelta;f.positionX.linearRampToValueAtTime(a.x,h);f.positionY.linearRampToValueAtTime(a.y, +h);f.positionZ.linearRampToValueAtTime(a.z,h);f.forwardX.linearRampToValueAtTime(d.x,h);f.forwardY.linearRampToValueAtTime(d.y,h);f.forwardZ.linearRampToValueAtTime(d.z,h);f.upX.linearRampToValueAtTime(g.x,h);f.upY.linearRampToValueAtTime(g.y,h);f.upZ.linearRampToValueAtTime(g.z,h)}else f.setPosition(a.x,a.y,a.z),f.setOrientation(d.x,d.y,d.z,g.x,g.y,g.z)}}()});oc.prototype=Object.assign(Object.create(C.prototype),{constructor:oc,getOutput:function(){return this.gain},setNodeSource:function(a){this.hasPlaybackControl= !1;this.sourceType="audioNode";this.source=a;this.connect();return this},setMediaElementSource:function(a){this.hasPlaybackControl=!1;this.sourceType="mediaNode";this.source=this.context.createMediaElementSource(a);this.connect();return this},setBuffer:function(a){this.buffer=a;this.sourceType="buffer";this.autoplay&&this.play();return this},play:function(){if(!0===this.isPlaying)console.warn("THREE.Audio: Audio is already playing.");else if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control."); else{var a=this.context.createBufferSource();a.buffer=this.buffer;a.loop=this.loop;a.onended=this.onEnded.bind(this);this.startTime=this.context.currentTime;a.start(this.startTime,this.offset);this.isPlaying=!0;this.source=a;this.setDetune(this.detune);this.setPlaybackRate(this.playbackRate);return this.connect()}},pause:function(){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return!0===this.isPlaying&&(this.source.stop(),this.source.onended= null,this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this},stop:function(){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return this.source.stop(),this.source.onended=null,this.offset=0,this.isPlaying=!1,this},connect:function(){if(0d&&this._mixBufferRegion(c,a,3*b,1-d,b);d=b;for(var f=b+b;d!==f;++d)if(c[d]!==c[d+b]){e.setValue(c,a);break}},saveOriginalState:function(){var a=this.buffer,b=this.valueSize,c=3*b;this.binding.getValue(a,c);for(var d=b;d!==c;++d)a[d]=a[c+d%b];this.cumulativeWeight=0},restoreOriginalState:function(){this.binding.setValue(this.buffer,3*this.valueSize)},_select:function(a, -b,c,d,e){if(.5<=d)for(d=0;d!==e;++d)a[b+d]=a[c+d]},_slerp:function(a,b,c,d){aa.slerpFlat(a,b,a,b,a,c,d)},_lerp:function(a,b,c,d,e){for(var f=1-d,g=0;g!==e;++g){var h=b+g;a[h]=a[h]*f+a[c+g]*d}}});Object.assign(Gf.prototype,{getValue:function(a,b){this.bind();var c=this._bindings[this._targetGroup.nCachedObjects_];void 0!==c&&c.getValue(a,b)},setValue:function(a,b){for(var c=this._bindings,d=this._targetGroup.nCachedObjects_,e=c.length;d!==e;++d)c[d].setValue(a,b)},bind:function(){for(var a=this._bindings, -b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].bind()},unbind:function(){for(var a=this._bindings,b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].unbind()}});Object.assign(na,{Composite:Gf,create:function(a,b,c){return a&&a.isAnimationObjectGroup?new na.Composite(a,b,c):new na(a,b,c)},sanitizeNodeName:function(){var a=/[\[\]\.:\/]/g;return function(b){return b.replace(/\s/g,"_").replace(a,"")}}(),parseTrackName:function(){var a="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]", +b,c,d,e){if(.5<=d)for(d=0;d!==e;++d)a[b+d]=a[c+d]},_slerp:function(a,b,c,d){Z.slerpFlat(a,b,a,b,a,c,d)},_lerp:function(a,b,c,d,e){for(var f=1-d,g=0;g!==e;++g){var h=b+g;a[h]=a[h]*f+a[c+g]*d}}});Object.assign(If.prototype,{getValue:function(a,b){this.bind();var c=this._bindings[this._targetGroup.nCachedObjects_];void 0!==c&&c.getValue(a,b)},setValue:function(a,b){for(var c=this._bindings,d=this._targetGroup.nCachedObjects_,e=c.length;d!==e;++d)c[d].setValue(a,b)},bind:function(){for(var a=this._bindings, +b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].bind()},unbind:function(){for(var a=this._bindings,b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].unbind()}});Object.assign(ma,{Composite:If,create:function(a,b,c){return a&&a.isAnimationObjectGroup?new ma.Composite(a,b,c):new ma(a,b,c)},sanitizeNodeName:function(){var a=/[\[\]\.:\/]/g;return function(b){return b.replace(/\s/g,"_").replace(a,"")}}(),parseTrackName:function(){var a="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]", b=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]");a=/(WCOD+)?/.source.replace("WCOD",a);var c=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),d=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),e=new RegExp("^"+b+a+c+d+"$"),f=["material","materials","bones"];return function(a){var b=e.exec(a);if(!b)throw Error("PropertyBinding: Cannot parse trackName: "+a);b={nodeName:b[2],objectName:b[3],objectIndex:b[4],propertyName:b[5],propertyIndex:b[6]};var c=b.nodeName&& b.nodeName.lastIndexOf(".");if(void 0!==c&&-1!==c){var d=b.nodeName.substring(c+1);-1!==f.indexOf(d)&&(b.nodeName=b.nodeName.substring(0,c),b.objectName=d)}if(null===b.propertyName||0===b.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+a);return b}}(),findNode:function(a,b){if(!b||""===b||"root"===b||"."===b||-1===b||b===a.name||b===a.uuid)return a;if(a.skeleton){var c=a.skeleton.getBoneByName(b);if(void 0!==c)return c}if(a.children){var d=function(a){for(var c= -0;c=b){var n=b++,p=a[n];c[p.uuid]=k;a[k]=p;c[l]=n;a[n]=h;h=0;for(l=e;h!==l;++h){p=d[h];var v=p[k];p[k]=p[n];p[n]=v}}}this.nCachedObjects_=b},uncache:function(){for(var a=this._objects,b=a.length,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._bindings,f=e.length,g=0,h=arguments.length;g!==h;++g){var l=arguments[g].uuid,k=d[l];if(void 0!==k)if(delete d[l],k=b){var n=b++,q=a[n];c[q.uuid]=l;a[l]=q;c[k]=n;a[n]=h;h=0;for(k=e;h!==k;++h){q=d[h];var v=q[l];q[l]=q[n];q[n]=v}}}this.nCachedObjects_=b},uncache:function(){for(var a=this._objects,b=a.length,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._bindings,f=e.length,g=0,h=arguments.length;g!==h;++g){var k=arguments[g].uuid,l=d[k];if(void 0!==l)if(delete d[k],lc.parameterPositions[1]&&(this.stopWarping(),0===b?this.paused=!0:this.timeScale=b)}}return this._effectiveTimeScale=b},_updateTime:function(a){var b=this.time+a,c=this._clip.duration,d=this.loop,e=this._loopCount,f=2202===d;if(0===a)return-1===e?b:f&&1===(e&1)?c-b:b;if(2200===d)a:{if(-1===e&&(this._loopCount=0,this._setEndings(!0,!0,!1)),b>=c)b=c;else if(0>b)b=0;else break a;this.clampWhenFinished?this.paused=!0:this.enabled=!1;this._mixer.dispatchEvent({type:"finished",action:this,direction:0> a?-1:1})}else{-1===e&&(0<=a?(e=0,this._setEndings(!0,0===this.repetitions,f)):this._setEndings(0===this.repetitions,!0,f));if(b>=c||0>b){d=Math.floor(b/c);b-=c*d;e+=Math.abs(d);var g=this.repetitions-e;0>=g?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,b=0a,this._setEndings(a,!a,f)):this._setEndings(!1,!1,f),this._loopCount=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:d}))}if(f&& 1===(e&1))return this.time=b,c-b}return this.time=b},_setEndings:function(a,b,c){var d=this._interpolantSettings;c?(d.endingStart=2401,d.endingEnd=2401):(d.endingStart=a?this.zeroSlopeAtStart?2401:2400:2402,d.endingEnd=b?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(a,b,c){var d=this._mixer,e=d.time,f=this._weightInterpolant;null===f&&(this._weightInterpolant=f=d._lendControlInterpolant());d=f.parameterPositions;f=f.sampleValues;d[0]=e;f[0]=b;d[1]=e+a;f[1]=c;return this}});Be.prototype= -Object.assign(Object.create(la.prototype),{constructor:Be,_bindAction:function(a,b){var c=a._localRoot||this._root,d=a._clip.tracks,e=d.length,f=a._propertyBindings;a=a._interpolants;var g=c.uuid,h=this._bindingsByRootAndName,k=h[g];void 0===k&&(k={},h[g]=k);for(h=0;h!==e;++h){var m=d[h],n=m.name,p=k[n];if(void 0===p){p=f[h];if(void 0!==p){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,g,n));continue}p=new Ae(na.create(c,n,b&&b._propertyBindings[h].binding.parsedPath),m.ValueTypeName, -m.getValueSize());++p.referenceCount;this._addInactiveBinding(p,g,n)}f[h]=p;a[h].resultBuffer=p.buffer}},_activateAction:function(a){if(!this._isActiveAction(a)){if(null===a._cacheIndex){var b=(a._localRoot||this._root).uuid,c=a._clip.uuid,d=this._actionsByClip[c];this._bindAction(a,d&&d.knownActions[0]);this._addInactiveAction(a,c,b)}b=a._propertyBindings;c=0;for(d=b.length;c!==d;++c){var e=b[c];0===e.useCount++&&(this._lendBinding(e),e.saveOriginalState())}this._lendAction(a)}},_deactivateAction:function(a){if(this._isActiveAction(a)){for(var b= +Object.assign(Object.create(ta.prototype),{constructor:Be,_bindAction:function(a,b){var c=a._localRoot||this._root,d=a._clip.tracks,e=d.length,f=a._propertyBindings;a=a._interpolants;var g=c.uuid,h=this._bindingsByRootAndName,k=h[g];void 0===k&&(k={},h[g]=k);for(h=0;h!==e;++h){var l=d[h],n=l.name,q=k[n];if(void 0===q){q=f[h];if(void 0!==q){null===q._cacheIndex&&(++q.referenceCount,this._addInactiveBinding(q,g,n));continue}q=new Ae(ma.create(c,n,b&&b._propertyBindings[h].binding.parsedPath),l.ValueTypeName, +l.getValueSize());++q.referenceCount;this._addInactiveBinding(q,g,n)}f[h]=q;a[h].resultBuffer=q.buffer}},_activateAction:function(a){if(!this._isActiveAction(a)){if(null===a._cacheIndex){var b=(a._localRoot||this._root).uuid,c=a._clip.uuid,d=this._actionsByClip[c];this._bindAction(a,d&&d.knownActions[0]);this._addInactiveAction(a,c,b)}b=a._propertyBindings;c=0;for(d=b.length;c!==d;++c){var e=b[c];0===e.useCount++&&(this._lendBinding(e),e.saveOriginalState())}this._lendAction(a)}},_deactivateAction:function(a){if(this._isActiveAction(a)){for(var b= a._propertyBindings,c=0,d=b.length;c!==d;++c){var e=b[c];0===--e.useCount&&(e.restoreOriginalState(),this._takeBackBinding(e))}this._takeBackAction(a)}},_initMemoryManager:function(){this._actions=[];this._nActiveActions=0;this._actionsByClip={};this._bindings=[];this._nActiveBindings=0;this._bindingsByRootAndName={};this._controlInterpolants=[];this._nActiveControlInterpolants=0;var a=this;this.stats={actions:{get total(){return a._actions.length},get inUse(){return a._nActiveActions}},bindings:{get total(){return a._bindings.length}, get inUse(){return a._nActiveBindings}},controlInterpolants:{get total(){return a._controlInterpolants.length},get inUse(){return a._nActiveControlInterpolants}}}},_isActiveAction:function(a){a=a._cacheIndex;return null!==a&&athis.max.x||a.ythis.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y},getParameter:function(a,b){void 0===b&&(console.warn("THREE.Box2: .getParameter() target is now required"),b=new z); -return b.set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y?!1:!0},clampPoint:function(a,b){void 0===b&&(console.warn("THREE.Box2: .clampPoint() target is now required"),b=new z);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new z;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){this.min.max(a.min); +a.uuid;var b=this._actionsByClip;for(d in b){var c=b[d].actionByRoot[a];void 0!==c&&(this._deactivateAction(c),this._removeInactiveAction(c))}var d=this._bindingsByRootAndName[a];if(void 0!==d)for(var e in d)a=d[e],a.restoreOriginalState(),this._removeInactiveBinding(a)},uncacheAction:function(a,b){a=this.existingAction(a,b);null!==a&&(this._deactivateAction(a),this._removeInactiveAction(a))}});Ud.prototype.clone=function(){return new Ud(void 0===this.value.clone?this.value:this.value.clone())};Ce.prototype= +Object.assign(Object.create(z.prototype),{constructor:Ce,isInstancedBufferGeometry:!0,copy:function(a){z.prototype.copy.call(this,a);this.maxInstancedCount=a.maxInstancedCount;return this},clone:function(){return(new this.constructor).copy(this)}});De.prototype=Object.assign(Object.create(xb.prototype),{constructor:De,isInstancedInterleavedBuffer:!0,copy:function(a){xb.prototype.copy.call(this,a);this.meshPerAttribute=a.meshPerAttribute;return this}});Ee.prototype=Object.assign(Object.create(S.prototype), +{constructor:Ee,isInstancedBufferAttribute:!0,copy:function(a){S.prototype.copy.call(this,a);this.meshPerAttribute=a.meshPerAttribute;return this}});Object.assign(Lf.prototype,{linePrecision:1,set:function(a,b){this.ray.set(a,b)},setFromCamera:function(a,b){b&&b.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(b.matrixWorld),this.ray.direction.set(a.x,a.y,.5).unproject(b).sub(this.ray.origin).normalize()):b&&b.isOrthographicCamera?(this.ray.origin.set(a.x,a.y,(b.near+b.far)/(b.near-b.far)).unproject(b), +this.ray.direction.set(0,0,-1).transformDirection(b.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(a,b,c){c=c||[];Fe(a,this,c,b);c.sort(Mf);return c},intersectObjects:function(a,b,c){c=c||[];if(!1===Array.isArray(a))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),c;for(var d=0,e=a.length;dthis.max.x||a.ythis.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y},getParameter:function(a,b){void 0===b&&(console.warn("THREE.Box2: .getParameter() target is now required"),b=new B); +return b.set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y?!1:!0},clampPoint:function(a,b){void 0===b&&(console.warn("THREE.Box2: .clampPoint() target is now required"),b=new B);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new B;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){this.min.max(a.min); this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}});Object.assign(He.prototype,{set:function(a,b){this.start.copy(a);this.end.copy(b);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},getCenter:function(a){void 0=== a&&(console.warn("THREE.Line3: .getCenter() target is now required"),a=new n);return a.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){void 0===a&&(console.warn("THREE.Line3: .delta() target is now required"),a=new n);return a.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a,b){void 0===b&&(console.warn("THREE.Line3: .at() target is now required"),b= -new n);return this.delta(b).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new n,b=new n;return function(c,d){a.subVectors(c,this.start);b.subVectors(this.end,this.start);c=b.dot(b);c=b.dot(a)/c;d&&(c=P.clamp(c,0,1));return c}}(),closestPointToPoint:function(a,b,c){a=this.closestPointToPointParameter(a,b);void 0===c&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),c=new n);return this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){this.start.applyMatrix4(a); -this.end.applyMatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)}});md.prototype=Object.create(E.prototype);md.prototype.constructor=md;md.prototype.isImmediateRenderObject=!0;nd.prototype=Object.create(X.prototype);nd.prototype.constructor=nd;nd.prototype.update=function(){var a=new n,b=new n,c=new qa;return function(){var d=["a","b","c"];this.object.updateMatrixWorld(!0);c.getNormalMatrix(this.object.matrixWorld);var e=this.object.matrixWorld,f= -this.geometry.attributes.position,g=this.object.geometry;if(g&&g.isGeometry)for(var h=g.vertices,k=g.faces,m=g=0,n=k.length;mMath.abs(b)&&(b=1E-8);this.scale.set(.5*this.size,.5*this.size,b);this.children[0].material.side=0>b?1:0;this.lookAt(this.plane.normal);E.prototype.updateMatrixWorld.call(this,a)};var Wd,Ie;db.prototype= -Object.create(E.prototype);db.prototype.constructor=db;db.prototype.setDirection=function(){var a=new n,b;return function(c){.99999c.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}();db.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a);void 0===c&&(c=.2*b);this.line.scale.set(1,Math.max(0,a-b),1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()}; -db.prototype.setColor=function(a){this.line.material.color.copy(a);this.cone.material.color.copy(a)};db.prototype.copy=function(a){E.prototype.copy.call(this,a,!1);this.line.copy(a.line);this.cone.copy(a.cone);return this};db.prototype.clone=function(){return(new this.constructor).copy(this)};sd.prototype=Object.create(X.prototype);sd.prototype.constructor=sd;O.create=function(a,b){console.log("THREE.Curve.create() has been deprecated");a.prototype=Object.create(O.prototype);a.prototype.constructor= -a;a.prototype.getPoint=b;return a};Object.assign(bb.prototype,{createPointsGeometry:function(a){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");a=this.getPoints(a);return this.createGeometry(a)},createSpacedPointsGeometry:function(a){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");a=this.getSpacedPoints(a);return this.createGeometry(a)}, -createGeometry:function(a){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var b=new G,c=0,d=a.length;cMath.abs(b)&&(b=1E-8);this.scale.set(.5*this.size,.5*this.size,b);this.children[0].material.side=0>b?1:0;this.lookAt(this.plane.normal);C.prototype.updateMatrixWorld.call(this, +a)};var Xd,Ie;gb.prototype=Object.create(C.prototype);gb.prototype.constructor=gb;gb.prototype.setDirection=function(){var a=new n,b;return function(c){.99999c.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}();gb.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a);void 0===c&&(c=.2*b);this.line.scale.set(1,Math.max(0,a-b),1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y= +a;this.cone.updateMatrix()};gb.prototype.setColor=function(a){this.line.material.color.copy(a);this.cone.material.color.copy(a)};gb.prototype.copy=function(a){C.prototype.copy.call(this,a,!1);this.line.copy(a.line);this.cone.copy(a.cone);return this};gb.prototype.clone=function(){return(new this.constructor).copy(this)};ud.prototype=Object.create(V.prototype);ud.prototype.constructor=ud;I.create=function(a,b){console.log("THREE.Curve.create() has been deprecated");a.prototype=Object.create(I.prototype); +a.prototype.constructor=a;a.prototype.getPoint=b;return a};Object.assign(eb.prototype,{createPointsGeometry:function(a){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");a=this.getPoints(a);return this.createGeometry(a)},createSpacedPointsGeometry:function(a){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");a=this.getSpacedPoints(a); +return this.createGeometry(a)},createGeometry:function(a){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var b=new N,c=0,d=a.length;c= capabilities.maxTextures ) { + + console.warn( 'THREE.WebGLTextures: Trying to use ' + textureUnit + ' texture units while this GPU supports only ' + capabilities.maxTextures ); + + } + + textureUnits += 1; + + return textureUnit; + } + + // function setTexture2D( texture, slot ) { @@ -21280,6 +21291,69 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, } + // backwards compatibility + + var warnedTexture2D = false; + var warnedTextureCube = false; + + function safeSetTexture2D( texture, slot ) { + + if ( texture && texture.isWebGLRenderTarget ) { + + if ( warnedTexture2D === false ) { + + console.warn( "THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead." ); + warnedTexture2D = true; + + } + + texture = texture.texture; + + } + + setTexture2D( texture, slot ); + + } + + function safeSetTextureCube( texture, slot ) { + + if ( texture && texture.isWebGLRenderTargetCube ) { + + if ( warnedTextureCube === false ) { + + console.warn( "THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead." ); + warnedTextureCube = true; + + } + + texture = texture.texture; + + } + + // currently relying on the fact that WebGLRenderTargetCube.texture is a Texture and NOT a CubeTexture + // TODO: unify these code paths + if ( ( texture && texture.isCubeTexture ) || + ( Array.isArray( texture.image ) && texture.image.length === 6 ) ) { + + // CompressedTexture can have Array in image :/ + + // this function alone should take care of cube textures + setTextureCube( texture, slot ); + + } else { + + // assumed: texture property of THREE.WebGLRenderTargetCube + setTextureCubeDynamic( texture, slot ); + + } + + } + + // + + this.allocateTextureUnit = allocateTextureUnit; + this.resetTextureUnits = resetTextureUnits; + this.setTexture2D = setTexture2D; this.setTexture2DArray = setTexture2DArray; this.setTexture3D = setTexture3D; @@ -21289,6 +21363,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, this.updateRenderTargetMipmap = updateRenderTargetMipmap; this.updateMultisampleRenderTarget = updateMultisampleRenderTarget; + this.safeSetTexture2D = safeSetTexture2D; + this.safeSetTextureCube = safeSetTextureCube; + } /** @@ -22666,10 +22743,6 @@ function WebGLRenderer( parameters ) { // - _usedTextureUnits = 0, - - // - _width = _canvas.width, _height = _canvas.height, @@ -22798,7 +22871,7 @@ function WebGLRenderer( parameters ) { geometries = new WebGLGeometries( _gl, attributes, info ); objects = new WebGLObjects( geometries, info ); morphtargets = new WebGLMorphtargets( _gl ); - programCache = new WebGLPrograms( _this, extensions, capabilities ); + programCache = new WebGLPrograms( _this, extensions, capabilities, textures ); renderLists = new WebGLRenderLists(); renderStates = new WebGLRenderStates(); @@ -24156,7 +24229,7 @@ function WebGLRenderer( parameters ) { function setProgram( camera, fog, material, object ) { - _usedTextureUnits = 0; + textures.resetTextureUnits(); var materialProperties = properties.get( material ); var lights = currentRenderState.state.lights; @@ -24343,7 +24416,7 @@ function WebGLRenderer( parameters ) { } - p_uniforms.setValue( _gl, 'boneTexture', skeleton.boneTexture ); + p_uniforms.setValue( _gl, 'boneTexture', skeleton.boneTexture, textures ); p_uniforms.setValue( _gl, 'boneTextureSize', skeleton.boneTextureSize ); } else { @@ -24473,13 +24546,13 @@ function WebGLRenderer( parameters ) { if ( m_uniforms.ltc_1 !== undefined ) m_uniforms.ltc_1.value = UniformsLib.LTC_1; if ( m_uniforms.ltc_2 !== undefined ) m_uniforms.ltc_2.value = UniformsLib.LTC_2; - WebGLUniforms.upload( _gl, materialProperties.uniformsList, m_uniforms, _this ); + WebGLUniforms.upload( _gl, materialProperties.uniformsList, m_uniforms, textures ); } if ( material.isShaderMaterial && material.uniformsNeedUpdate === true ) { - WebGLUniforms.upload( _gl, materialProperties.uniformsList, m_uniforms, _this ); + WebGLUniforms.upload( _gl, materialProperties.uniformsList, m_uniforms, textures ); material.uniformsNeedUpdate = false; } @@ -24942,126 +25015,6 @@ function WebGLRenderer( parameters ) { } - // Textures - - function allocTextureUnit() { - - var textureUnit = _usedTextureUnits; - - if ( textureUnit >= capabilities.maxTextures ) { - - console.warn( 'THREE.WebGLRenderer: Trying to use ' + textureUnit + ' texture units while this GPU supports only ' + capabilities.maxTextures ); - - } - - _usedTextureUnits += 1; - - return textureUnit; - - } - - this.allocTextureUnit = allocTextureUnit; - - // this.setTexture2D = setTexture2D; - this.setTexture2D = ( function () { - - var warned = false; - - // backwards compatibility: peel texture.texture - return function setTexture2D( texture, slot ) { - - if ( texture && texture.isWebGLRenderTarget ) { - - if ( ! warned ) { - - console.warn( "THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead." ); - warned = true; - - } - - texture = texture.texture; - - } - - textures.setTexture2D( texture, slot ); - - }; - - }() ); - - this.setTexture2DArray = function ( texture, slot ) { - - textures.setTexture2DArray( texture, slot ); - - }; - - this.setTexture3D = function ( texture, slot ) { - - textures.setTexture3D( texture, slot ); - - }; - - this.setTexture = ( function () { - - var warned = false; - - return function setTexture( texture, slot ) { - - if ( ! warned ) { - - console.warn( "THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead." ); - warned = true; - - } - - textures.setTexture2D( texture, slot ); - - }; - - }() ); - - this.setTextureCube = ( function () { - - var warned = false; - - return function setTextureCube( texture, slot ) { - - // backwards compatibility: peel texture.texture - if ( texture && texture.isWebGLRenderTargetCube ) { - - if ( ! warned ) { - - console.warn( "THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead." ); - warned = true; - - } - - texture = texture.texture; - - } - - // currently relying on the fact that WebGLRenderTargetCube.texture is a Texture and NOT a CubeTexture - // TODO: unify these code paths - if ( ( texture && texture.isCubeTexture ) || - ( Array.isArray( texture.image ) && texture.image.length === 6 ) ) { - - // CompressedTexture can have Array in image :/ - - // this function alone should take care of cube textures - textures.setTextureCube( texture, slot ); - - } else { - - // assumed: texture property of THREE.WebGLRenderTargetCube - - textures.setTextureCubeDynamic( texture, slot ); - - } - - }; - - }() ); - // this.setFramebuffer = function ( value ) { @@ -45275,6 +45228,9 @@ GridHelper.prototype = Object.assign( Object.create( LineSegments.prototype ), { Object.assign( this.parameters, source.parameters ); + this.geometry.copy( source.geometry ); + this.material.copy( source.material ); + return this; }, -- GitLab