!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).THREE={})}(this,(function(e){function t(){}function i(e,t){this.x=e||0,this.y=t||0}function n(e,t,i,n){this._x=e||0,this._y=t||0,this._z=i||0,this._w=void 0!==n?n:1}function r(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0}function o(){this.elements=[1,0,0,0,1,0,0,0,1],0t&&(t=e[i]);return t}function F(){Object.defineProperty(this,"id",{value:Eo+=2}),this.uuid=ho.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:1/0},this.userData={}}function H(e,t,i,n,r,o){T.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:n,heightSegments:r,depthSegments:o},this.fromBufferGeometry(new U(e,t,i,n,r,o)),this.mergeVertices()}function U(e,t,i,n,o,s){function a(e,t,i,n,o,s,a,m,g,v,y){var b=s/g,x=a/v,w=s/2,_=a/2,E=m/2;a=g+1;var M,S,T=v+1,A=s=0,C=new r;for(S=0;Sc;c++)(h=n[c])&&(a=h[0],l=h[1])?(u&&r.addAttribute("morphTarget"+c,u[a]),o&&r.addAttribute("morphNormal"+c,o[a]),i[c]=l):i[c]=0;s.getUniforms().setValue(e,"morphTargetInfluences",i)}}}function se(e,t){var i={};return{update:function(n){var r=t.render.frame,o=n.geometry,s=e.get(n,o);return i[s.id]!==r&&(o.isGeometry&&s.updateFromObject(n),e.update(s),i[s.id]=r),s},dispose:function(){i={}}}}function ae(e,t,i,n,r,o,a,l,c,u){e=void 0!==e?e:[],s.call(this,e,void 0!==t?t:301,i,n,r,o,void 0!==a?a:1022,l,c,u),this.flipY=!1}function le(e,t,i,n){s.call(this,null),this.image={data:e,width:t,height:i,depth:n},this.minFilter=this.magFilter=1003,this.wrapR=1001,this.flipY=this.generateMipmaps=!1}function ce(e,t,i,n){s.call(this,null),this.image={data:e,width:t,height:i,depth:n},this.minFilter=this.magFilter=1003,this.wrapR=1001,this.flipY=this.generateMipmaps=!1}function ue(e,t,i){var n=e[0];if(0>=n||0/gm,(function(e,t){if(void 0===(e=go[t]))throw Error("Can not resolve #include <"+t+">");return et(e)}))}function tt(e){return e.replace(/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g,(function(e,t,i,n){for(e="",t=parseInt(t);ti;i++)t.probe.push(new r);var n=new r,o=new g,s=new g;return{setup:function(i,r,a){for(var l=0,c=0,u=0,h=0;9>h;h++)t.probe[h].set(0,0,0);var d=0,p=0,f=0,m=0,g=0;a=a.matrixWorldInverse,h=0;for(var v=i.length;h_;_++)t.probe[_].addScaledVector(y.sh.coefficients[_],x);else if(y.isDirectionalLight){var E=e.get(y);E.color.copy(y.color).multiplyScalar(y.intensity),E.direction.setFromMatrixPosition(y.matrixWorld),n.setFromMatrixPosition(y.target.matrixWorld),E.direction.sub(n),E.direction.transformDirection(a),(E.shadow=y.castShadow)&&(x=y.shadow,E.shadowBias=x.bias,E.shadowRadius=x.radius,E.shadowMapSize=x.mapSize),t.directionalShadowMap[d]=_,t.directionalShadowMatrix[d]=y.shadow.matrix,t.directional[d]=E,d++}else y.isSpotLight?((E=e.get(y)).position.setFromMatrixPosition(y.matrixWorld),E.position.applyMatrix4(a),E.color.copy(b).multiplyScalar(x),E.distance=w,E.direction.setFromMatrixPosition(y.matrixWorld),n.setFromMatrixPosition(y.target.matrixWorld),E.direction.sub(n),E.direction.transformDirection(a),E.coneCos=Math.cos(y.angle),E.penumbraCos=Math.cos(y.angle*(1-y.penumbra)),E.decay=y.decay,(E.shadow=y.castShadow)&&(x=y.shadow,E.shadowBias=x.bias,E.shadowRadius=x.radius,E.shadowMapSize=x.mapSize),t.spotShadowMap[f]=_,t.spotShadowMatrix[f]=y.shadow.matrix,t.spot[f]=E,f++):y.isRectAreaLight?((E=e.get(y)).color.copy(b).multiplyScalar(x),E.position.setFromMatrixPosition(y.matrixWorld),E.position.applyMatrix4(a),s.identity(),o.copy(y.matrixWorld),o.premultiply(a),s.extractRotation(o),E.halfWidth.set(.5*y.width,0,0),E.halfHeight.set(0,.5*y.height,0),E.halfWidth.applyMatrix4(s),E.halfHeight.applyMatrix4(s),t.rectArea[m]=E,m++):y.isPointLight?((E=e.get(y)).position.setFromMatrixPosition(y.matrixWorld),E.position.applyMatrix4(a),E.color.copy(y.color).multiplyScalar(y.intensity),E.distance=y.distance,E.decay=y.decay,(E.shadow=y.castShadow)&&(x=y.shadow,E.shadowBias=x.bias,E.shadowRadius=x.radius,E.shadowMapSize=x.mapSize,E.shadowCameraNear=x.camera.near,E.shadowCameraFar=x.camera.far),t.pointShadowMap[p]=_,t.pointShadowMatrix[p]=y.shadow.matrix,t.point[p]=E,p++):y.isHemisphereLight&&((E=e.get(y)).direction.setFromMatrixPosition(y.matrixWorld),E.direction.transformDirection(a),E.direction.normalize(),E.skyColor.copy(y.color).multiplyScalar(x),E.groundColor.copy(y.groundColor).multiplyScalar(x),t.hemi[g]=E,g++)}t.ambient[0]=l,t.ambient[1]=c,t.ambient[2]=u,t.directional.length=d,t.spot.length=f,t.rectArea.length=m,t.point.length=p,t.hemi.length=g,t.hash.stateID=t.id,t.hash.directionalLength=d,t.hash.pointLength=p,t.hash.spotLength=f,t.hash.rectAreaLength=m,t.hash.hemiLength=g,t.hash.shadowsLength=r.length},state:t}}function ht(){var e=new ut,t=[],i=[];return{init:function(){t.length=0,i.length=0},state:{lightsArray:t,shadowsArray:i,lights:e},setupLights:function(n){e.setup(t,i,n)},pushLight:function(e){t.push(e)},pushShadow:function(e){i.push(e)}}}function dt(){function e(i){(i=i.target).removeEventListener("dispose",e),delete t[i.id]}var t={};return{get:function(i,n){if(void 0===t[i.id]){var r=new ht;t[i.id]={},t[i.id][n.id]=r,i.addEventListener("dispose",e)}else void 0===t[i.id][n.id]?(r=new ht,t[i.id][n.id]=r):r=t[i.id][n.id];return r},dispose:function(){t={}}}}function pt(e){V.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.morphTargets=this.skinning=!1,this.displacementMap=this.alphaMap=this.map=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.lights=this.fog=!1,this.setValues(e)}function ft(e){V.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new r,this.nearDistance=1,this.farDistance=1e3,this.morphTargets=this.skinning=!1,this.displacementMap=this.alphaMap=this.map=null,this.displacementScale=1,this.displacementBias=0,this.lights=this.fog=!1,this.setValues(e)}function mt(e,t,n){function o(t,i,n,r,o,s){var a=t.geometry,l=v,c=t.customDepthMaterial;return n&&(l=y,c=t.customDistanceMaterial),c?l=c:(c=!1,i.morphTargets&&(a&&a.isBufferGeometry?c=a.morphAttributes&&a.morphAttributes.position&&0n||e.height>n)&&(r=n/Math.max(e.width,e.height)),1>r||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap)return t=(n=t?ho.floorPowerOfTwo:Math.floor)(r*e.width),r=n(r*e.height),void 0===S&&(S=a(t,r)),(i=i?a(t,r):S).width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,t,r),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+t+"x"+r+")."),i;"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+").")}return e}function c(e){return ho.isPowerOfTwo(e.width)&&ho.isPowerOfTwo(e.height)}function u(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function h(t,i,r,o){e.generateMipmap(t),n.get(i).__maxMipLevel=Math.log(Math.max(r,o))*Math.LOG2E}function d(e,i){if(!r.isWebGL2)return e;var n=e;return 6403===e&&(5126===i&&(n=33326),5131===i&&(n=33325),5121===i&&(n=33321)),6407===e&&(5126===i&&(n=34837),5131===i&&(n=34843),5121===i&&(n=32849)),6408===e&&(5126===i&&(n=34836),5131===i&&(n=34842),5121===i&&(n=32856)),33325===n||33326===n||34842===n||34836===n?t.get("EXT_color_buffer_float"):(34843===n||34837===n)&&console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),n}function p(e){return 1003===e||1004===e||1005===e?9728:9729}function f(t){(t=t.target).removeEventListener("dispose",f);var i=n.get(t);void 0!==i.__webglInit&&(e.deleteTexture(i.__webglTexture),n.remove(t)),t.isVideoTexture&&delete T[t.id],s.memory.textures--}function m(t){(t=t.target).removeEventListener("dispose",m);var i=n.get(t),r=n.get(t.texture);if(t){if(void 0!==r.__webglTexture&&e.deleteTexture(r.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLRenderTargetCube)for(r=0;6>r;r++)e.deleteFramebuffer(i.__webglFramebuffer[r]),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[r]);else e.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer);n.remove(t.texture),n.remove(t)}s.memory.textures--}function g(e,t){var r=n.get(e);if(e.isVideoTexture){var o=e.id,a=s.render.frame;T[o]!==a&&(T[o]=a,e.update())}if(0m;m++)f[m]=s||p?p?t.image[m].image:t.image[m]:l(t.image[m],!1,!0,r.maxCubemapSize);var g=f[0],v=c(g)||r.isWebGL2,y=o.convert(t.format),w=o.convert(t.type),_=d(y,w);for(b(34067,t,v),m=0;6>m;m++)if(s)for(var E,M=f[m].mipmaps,S=0,T=M.length;S=r.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+r.maxTextures),C+=1,e},this.resetTextureUnits=function(){C=0},this.setTexture2D=g,this.setTexture2DArray=function(e,t){var r=n.get(e);0f;f++)a.__webglFramebuffer[f]=e.createFramebuffer();else if(a.__webglFramebuffer=e.createFramebuffer(),f)if(r.isWebGL2){a.__webglMultisampledFramebuffer=e.createFramebuffer(),a.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,a.__webglColorRenderbuffer),f=o.convert(t.texture.format);var y=o.convert(t.texture.type);f=d(f,y),y=M(t),e.renderbufferStorageMultisample(36161,y,f,t.width,t.height),e.bindFramebuffer(36160,a.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,a.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(a.__webglDepthRenderbuffer=e.createRenderbuffer(),E(a.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(p){for(i.bindTexture(34067,l.__webglTexture),b(34067,t.texture,v),f=0;6>f;f++)_(a.__webglFramebuffer[f],t,36064,34069+f);u(t.texture,v)&&h(34067,t.texture,t.width,t.height),i.bindTexture(34067,null)}else i.bindTexture(3553,l.__webglTexture),b(3553,t.texture,v),_(a.__webglFramebuffer,t,36064,3553),u(t.texture,v)&&h(3553,t.texture,t.width,t.height),i.bindTexture(3553,null);if(t.depthBuffer){if(a=n.get(t),l=!0===t.isWebGLRenderTargetCube,t.depthTexture){if(l)throw Error("target.depthTexture not supported in Cube render targets");if(t&&t.isWebGLRenderTargetCube)throw Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,a.__webglFramebuffer),!t.depthTexture||!t.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");if(n.get(t.depthTexture).__webglTexture&&t.depthTexture.image.width===t.width&&t.depthTexture.image.height===t.height||(t.depthTexture.image.width=t.width,t.depthTexture.image.height=t.height,t.depthTexture.needsUpdate=!0),g(t.depthTexture,0),a=n.get(t.depthTexture).__webglTexture,1026===t.depthTexture.format)e.framebufferTexture2D(36160,36096,3553,a,0);else{if(1027!==t.depthTexture.format)throw Error("Unknown depthTexture format");e.framebufferTexture2D(36160,33306,3553,a,0)}}else if(l)for(a.__webglDepthbuffer=[],l=0;6>l;l++)e.bindFramebuffer(36160,a.__webglFramebuffer[l]),a.__webglDepthbuffer[l]=e.createRenderbuffer(),E(a.__webglDepthbuffer[l],t);else e.bindFramebuffer(36160,a.__webglFramebuffer),a.__webglDepthbuffer=e.createRenderbuffer(),E(a.__webglDepthbuffer,t);e.bindFramebuffer(36160,null)}},this.updateRenderTargetMipmap=function(e){var t=e.texture,o=c(e)||r.isWebGL2;if(u(t,o)){o=e.isWebGLRenderTargetCube?34067:3553;var s=n.get(t).__webglTexture;i.bindTexture(o,s),h(o,t,e.width,e.height),i.bindTexture(o,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(r.isWebGL2){var i=n.get(t);e.bindFramebuffer(36008,i.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,i.__webglFramebuffer),i=t.width;var o=t.height,s=16384;t.depthBuffer&&(s|=256),t.stencilBuffer&&(s|=1024),e.blitFramebuffer(0,0,i,o,0,0,i,o,s,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===L&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),L=!0),e=e.texture),g(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLRenderTargetCube&&(!1===P&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),P=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?v(e,t):y(e,t)}}function yt(e,t,i){return{convert:function(e){if(1e3===e)return 10497;if(1001===e)return 33071;if(1002===e)return 33648;if(1003===e)return 9728;if(1004===e)return 9984;if(1005===e)return 9986;if(1006===e)return 9729;if(1007===e)return 9985;if(1008===e)return 9987;if(1009===e)return 5121;if(1017===e)return 32819;if(1018===e)return 32820;if(1019===e)return 33635;if(1010===e)return 5120;if(1011===e)return 5122;if(1012===e)return 5123;if(1013===e)return 5124;if(1014===e)return 5125;if(1015===e)return 5126;if(1016===e){if(i.isWebGL2)return 5131;var n=t.get("OES_texture_half_float");if(null!==n)return n.HALF_FLOAT_OES}if(1021===e)return 6406;if(1022===e)return 6407;if(1023===e)return 6408;if(1024===e)return 6409;if(1025===e)return 6410;if(1026===e)return 6402;if(1027===e)return 34041;if(1028===e)return 6403;if(100===e)return 32774;if(101===e)return 32778;if(102===e)return 32779;if(200===e)return 0;if(201===e)return 1;if(202===e)return 768;if(203===e)return 769;if(204===e)return 770;if(205===e)return 771;if(206===e)return 772;if(207===e)return 773;if(208===e)return 774;if(209===e)return 775;if(210===e)return 776;if((33776===e||33777===e||33778===e||33779===e)&&null!==(n=t.get("WEBGL_compressed_texture_s3tc"))){if(33776===e)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===e)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===e)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===e)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((35840===e||35841===e||35842===e||35843===e)&&null!==(n=t.get("WEBGL_compressed_texture_pvrtc"))){if(35840===e)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===e)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===e)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===e)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===e&&null!==(n=t.get("WEBGL_compressed_texture_etc1")))return n.COMPRESSED_RGB_ETC1_WEBGL;if((37808===e||37809===e||37810===e||37811===e||37812===e||37813===e||37814===e||37815===e||37816===e||37817===e||37818===e||37819===e||37820===e||37821===e)&&null!==(n=t.get("WEBGL_compressed_texture_astc")))return e;if(103===e||104===e){if(i.isWebGL2){if(103===e)return 32775;if(104===e)return 32776}if(null!==(n=t.get("EXT_blend_minmax"))){if(103===e)return n.MIN_EXT;if(104===e)return n.MAX_EXT}}if(1020===e){if(i.isWebGL2)return 34042;if(null!==(n=t.get("WEBGL_depth_texture")))return n.UNSIGNED_INT_24_8_WEBGL}return 0}}}function bt(){S.call(this),this.type="Group"}function xt(){S.call(this),this.type="Camera",this.matrixWorldInverse=new g,this.projectionMatrix=new g,this.projectionMatrixInverse=new g}function wt(e,t,i,n){xt.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==i?i:.1,this.far=void 0!==n?n:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function _t(e){wt.call(this),this.cameras=e||[]}function Et(e,t,i){No.setFromMatrixPosition(t.matrixWorld),Fo.setFromMatrixPosition(i.matrixWorld);var n=No.distanceTo(Fo),r=t.projectionMatrix.elements,o=i.projectionMatrix.elements,s=r[14]/(r[10]-1);i=r[14]/(r[10]+1);var a=(r[9]+1)/r[5],l=(r[9]-1)/r[5],c=(r[8]-1)/r[0],u=(o[8]+1)/o[0];r=s*c,o=s*u,c=(u=n/(-c+u))*-c,t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(c),e.translateZ(u),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld),t=s+u,s=i+u,e.projectionMatrix.makePerspective(r-c,o+(n-c),a*i/s*t,l*i/s*t,t,s)}function Mt(e){function t(){return null!==h&&!0===h.isPresenting}function o(){if(t()){var i=h.getEyeParameters("left");l=2*i.renderWidth*y,c=i.renderHeight*y,A=e.getPixelRatio(),e.getSize(C),e.setDrawingBufferSize(l,c,1),M.viewport.set(0,0,l/2,c),S.viewport.set(l/2,0,l/2,c),P.start()}else u.enabled&&e.setDrawingBufferSize(C.width,C.height,A),P.stop()}function s(e,t){null!==t&&4===t.length&&e.set(t[0]*l,t[1]*c,t[2]*l,t[3]*c)}var l,c,u=this,h=null,d=null,p=null,f=[],m=new g,v=new g,y=1,b="local-floor";"undefined"!=typeof window&&"VRFrameData"in window&&(d=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",o,!1));var w=new g,_=new n,E=new r,M=new wt;M.viewport=new a,M.layers.enable(1);var S=new wt;S.viewport=new a,S.layers.enable(2);var T=new _t([M,S]);T.layers.enable(1),T.layers.enable(2);var A,C=new i,L=[];this.enabled=!1,this.getController=function(e){var t=f[e];return void 0===t&&((t=new bt).matrixAutoUpdate=!1,t.visible=!1,f[e]=t),t},this.getDevice=function(){return h},this.setDevice=function(e){void 0!==e&&(h=e),P.setContext(e)},this.setFramebufferScaleFactor=function(e){y=e},this.setReferenceSpaceType=function(e){b=e},this.setPoseTarget=function(e){void 0!==e&&(p=e)},this.getCamera=function(e){var i="local-floor"===b?1.6:0;if(!1===t())return e.position.set(0,i,0),e.rotation.set(0,0,0),e;if(h.depthNear=e.near,h.depthFar=e.far,h.getFrameData(d),"local-floor"===b){var n=h.stageParameters;n?m.fromArray(n.sittingToStandingTransform):m.makeTranslation(0,i,0)}i=d.pose,(n=null!==p?p:e).matrix.copy(m),n.matrix.decompose(n.position,n.quaternion,n.scale),null!==i.orientation&&(_.fromArray(i.orientation),n.quaternion.multiply(_)),null!==i.position&&(_.setFromRotationMatrix(m),E.fromArray(i.position),E.applyQuaternion(_),n.position.add(E)),n.updateMatrixWorld(),M.near=e.near,S.near=e.near,M.far=e.far,S.far=e.far,M.matrixWorldInverse.fromArray(d.leftViewMatrix),S.matrixWorldInverse.fromArray(d.rightViewMatrix),v.getInverse(m),"local-floor"===b&&(M.matrixWorldInverse.multiply(v),S.matrixWorldInverse.multiply(v)),null!==(e=n.parent)&&(w.getInverse(e.matrixWorld),M.matrixWorldInverse.multiply(w),S.matrixWorldInverse.multiply(w)),M.matrixWorld.getInverse(M.matrixWorldInverse),S.matrixWorld.getInverse(S.matrixWorldInverse),M.projectionMatrix.fromArray(d.leftProjectionMatrix),S.projectionMatrix.fromArray(d.rightProjectionMatrix),Et(T,M,S),(e=h.getLayers()).length&&(e=e[0],s(M.viewport,e.leftBounds),s(S.viewport,e.rightBounds));e:for(e=0;eo.matrixWorld.determinant();B.setMaterial(r,a);var l=f(e,i,r,o),c=!1;t===n.id&&ge===l.id&&ve===(!0===r.wireframe)||(t=n.id,ge=l.id,ve=!0===r.wireframe,c=!0),o.morphTargetInfluences&&(Y.update(o,n,r,l),c=!0),a=n.index;var u=n.attributes.position;if(i=1,!0===r.wireframe&&(a=j.getWireframeAttribute(n),i=2),e=Z,null!==a){var h=U.get(a);(e=re).setIndex(h)}if(c){if(n&&n.isInstancedBufferGeometry&&!z.isWebGL2&&null===k.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{B.initAttributes(),c=n.attributes,l=l.getAttributes();var d=r.defaultAttributeValues;for(E in l){var p=l[E];if(0<=p){var m=c[E];if(void 0!==m){var g=m.normalized,v=m.itemSize,y=U.get(m);if(void 0!==y){var b=y.buffer,x=y.type;if(y=y.bytesPerElement,m.isInterleavedBufferAttribute){var w=m.data,_=w.stride;m=m.offset,w&&w.isInstancedInterleavedBuffer?(B.enableAttributeAndDivisor(p,w.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=w.meshPerAttribute*w.count)):B.enableAttribute(p),ke.bindBuffer(34962,b),ke.vertexAttribPointer(p,v,x,g,_*y,m*y)}else m.isInstancedBufferAttribute?(B.enableAttributeAndDivisor(p,m.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=m.meshPerAttribute*m.count)):B.enableAttribute(p),ke.bindBuffer(34962,b),ke.vertexAttribPointer(p,v,x,g,0,0)}}else if(void 0!==d&&void 0!==(g=d[E]))switch(g.length){case 2:ke.vertexAttrib2fv(p,g);break;case 3:ke.vertexAttrib3fv(p,g);break;case 4:ke.vertexAttrib4fv(p,g);break;default:ke.vertexAttrib1fv(p,g)}}}B.disableUnusedAttributes()}null!==a&&ke.bindBuffer(34963,h.buffer)}h=1/0,null!==a?h=a.count:void 0!==u&&(h=u.count),a=n.drawRange.start*i,u=null!==s?s.start*i:0;var E=Math.max(a,u);if(0!==(s=Math.max(0,Math.min(h,a+n.drawRange.count*i,u+(null!==s?s.count*i:1/0))-1-E+1))){if(o.isMesh)if(!0===r.wireframe)B.setLineWidth(r.wireframeLinewidth*(null===pe?Se:1)),e.setMode(1);else switch(o.drawMode){case 0:e.setMode(4);break;case 1:e.setMode(5);break;case 2:e.setMode(6)}else o.isLine?(void 0===(r=r.linewidth)&&(r=1),B.setLineWidth(r*(null===pe?Se:1)),o.isLineSegments?e.setMode(1):o.isLineLoop?e.setMode(2):e.setMode(3)):o.isPoints?e.setMode(0):o.isSprite&&e.setMode(4);n&&n.isInstancedBufferGeometry?0t;t++){var d=h[l[t]],p=h[l[(t+1)%3]];s[0]=Math.min(d,p),s[1]=Math.max(d,p),void 0===a[d=s[0]+","+s[1]]&&(a[d]={index1:s[0],index2:s[1]})}}for(d in a)u=a[d],l=e.vertices[u.index1],o.push(l.x,l.y,l.z),l=e.vertices[u.index2],o.push(l.x,l.y,l.z)}else if(e&&e.isBufferGeometry)if(l=new r,null!==e.index){c=e.attributes.position,h=e.index;var f=e.groups;for(0===f.length&&(f=[{start:0,count:h.count,materialIndex:0}]),e=0,n=f.length;et;t++)d=h.getX(u+t),p=h.getX(u+(t+1)%3),s[0]=Math.min(d,p),s[1]=Math.max(d,p),void 0===a[d=s[0]+","+s[1]]&&(a[d]={index1:s[0],index2:s[1]});for(d in a)u=a[d],l.fromBufferAttribute(c,u.index1),o.push(l.x,l.y,l.z),l.fromBufferAttribute(c,u.index2),o.push(l.x,l.y,l.z)}else for(u=0,i=(c=e.attributes.position).count/3;ut;t++)a=3*u+t,l.fromBufferAttribute(c,a),o.push(l.x,l.y,l.z),a=3*u+(t+1)%3,l.fromBufferAttribute(c,a),o.push(l.x,l.y,l.z);this.addAttribute("position",new k(o,3))}function Zt(e,t,i){T.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:i},this.fromBufferGeometry(new Qt(e,t,i)),this.mergeVertices()}function Qt(e,t,i){F.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:i};var n,o,s=[],a=[],l=[],c=[],u=new r,h=new r,d=new r,p=new r,f=new r;3>e.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var m=t+1;for(n=0;n<=i;n++){var g=n/i;for(o=0;o<=t;o++){var v=o/t;e(v,g,h),a.push(h.x,h.y,h.z),0<=v-1e-5?(e(v-1e-5,g,d),p.subVectors(h,d)):(e(v+1e-5,g,d),p.subVectors(d,h)),0<=g-1e-5?(e(v,g-1e-5,d),f.subVectors(h,d)):(e(v,g+1e-5,d),f.subVectors(d,h)),u.crossVectors(p,f).normalize(),l.push(u.x,u.y,u.z),c.push(v,g)}}for(n=0;nn&&1===e.x&&(u[t]=e.x-1),0===i.x&&0===i.z&&(u[t]=n/2/Math.PI+.5)}F.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:o},n=n||1;var c=[],u=[];!function(e){for(var i=new r,n=new r,o=new r,l=0;ls&&(.2>t&&(u[e+0]+=1),.2>n&&(u[e+2]+=1),.2>o&&(u[e+4]+=1))}(),this.addAttribute("position",new k(c,3)),this.addAttribute("normal",new k(c.slice(),3)),this.addAttribute("uv",new k(u,2)),0===o?this.computeVertexNormals():this.normalizeNormals()}function $t(e,t){T.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new ei(e,t)),this.mergeVertices()}function ei(e,t){Kt.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],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function ti(e,t){T.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new ii(e,t)),this.mergeVertices()}function ii(e,t){Kt.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],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function ni(e,t){T.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new ri(e,t)),this.mergeVertices()}function ri(e,t){var i=(1+Math.sqrt(5))/2;Kt.call(this,[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,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],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function oi(e,t){T.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new si(e,t)),this.mergeVertices()}function si(e,t){var i=(1+Math.sqrt(5))/2,n=1/i;Kt.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,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n],[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],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function ai(e,t,i,n,r,o){T.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:n,closed:r},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed."),e=new li(e,t,i,n,r),this.tangents=e.tangents,this.normals=e.normals,this.binormals=e.binormals,this.fromBufferGeometry(e),this.mergeVertices()}function li(e,t,n,o,s){function a(i){f=e.getPointAt(i/t,f);var r=l.normals[i];for(i=l.binormals[i],u=0;u<=o;u++){var s=u/o*Math.PI*2,a=Math.sin(s);s=-Math.cos(s),d.x=s*r.x+a*i.x,d.y=s*r.y+a*i.y,d.z=s*r.z+a*i.z,d.normalize(),g.push(d.x,d.y,d.z),h.x=f.x+n*d.x,h.y=f.y+n*d.y,h.z=f.z+n*d.z,m.push(h.x,h.y,h.z)}}F.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:o,closed:s},t=t||64,n=n||1,o=o||8,s=s||!1;var l=e.computeFrenetFrames(t,s);this.tangents=l.tangents,this.normals=l.normals,this.binormals=l.binormals;var c,u,h=new r,d=new r,p=new i,f=new r,m=[],g=[],v=[],y=[];for(c=0;c=t;r-=n)o=Si(r,e[r],e[r+1],o);return o&&wi(o,o.next)&&(Ti(o),o=o.next),o}function fi(e,t){if(!e)return e;t||(t=e);do{var i=!1;if(e.steiner||!wi(e,e.next)&&0!==xi(e.prev,e,e.next))e=e.next;else{if(Ti(e),(e=t=e.prev)===e.next)break;i=!0}}while(i||e!==t);return t}function mi(e,t){return e.x-t.x}function gi(e,t){var i=t,n=e.x,r=e.y,o=-1/0;do{if(r<=i.y&&r>=i.next.y&&i.next.y!==i.y){var s=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&s>o){if(o=s,s===n){if(r===i.y)return i;if(r===i.next.y)return i.next}var a=i.x=i.x&&i.x>=s&&n!==i.x&&bi(ra.x)&&Ei(i,e)&&(a=i,c=u)}i=i.next}return a}function vi(e,t,i,n,r){return 1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1)|(1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function yi(e){var t=e,i=e;do{t.xxi(e.prev,e,e.next)?0<=xi(e,t,e.next)&&0<=xi(e,e.prev,t):0>xi(e,t,e.prev)||0>xi(e,e.next,t)}function Mi(e,t){var i=new Ai(e.i,e.x,e.y),n=new Ai(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function Si(e,t,i,n){return e=new Ai(e,t,i),n?(e.next=n.next,e.prev=n,n.next.prev=e,n.next=e):(e.prev=e,e.next=e),e}function Ti(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Ai(e,t,i){this.i=e,this.x=t,this.y=i,this.nextZ=this.prevZ=this.z=this.next=this.prev=null,this.steiner=!1}function Ci(e){var t=e.length;2Number.EPSILON){var c=Math.sqrt(l),u=Math.sqrt(s*s+a*a);if(l=t.x-o/c,t=t.y+r/c,2>=(o=(s=l+r*(a=((n.x-a/u-l)*a-(n.y+s/u-t)*s)/(r*a-o*s))-e.x)*s+(r=t+o*a-e.y)*r))return new i(s,r);o=Math.sqrt(o/2)}else e=!1,r>Number.EPSILON?s>Number.EPSILON&&(e=!0):r<-Number.EPSILON?s<-Number.EPSILON&&(e=!0):Math.sign(o)===Math.sign(a)&&(e=!0),e?(s=-o,o=Math.sqrt(l)):(s=r,r=o,o=Math.sqrt(l/2));return new i(s/o,r/o)}function c(e,t){for(U=e.length;0<=--U;){var i=U,n=U-1;0>n&&(n=e.length-1);var r,a=g+2*_;for(r=0;ru;u++){var h=c[o[u]],d=c[o[(u+1)%3]];n[0]=Math.min(h,d),n[1]=Math.max(h,d),void 0===r[h=n[0]+","+n[1]]?r[h]={index1:n[0],index2:n[1],face1:a,face2:void 0}:r[h].face2=a}for(h in r)(void 0===(n=r[h]).face2||s[n.face1].normal.dot(s[n.face2].normal)<=t)&&(o=e[n.index1],i.push(o.x,o.y,o.z),o=e[n.index2],i.push(o.x,o.y,o.z));this.addAttribute("position",new k(i,3))}function Wi(e,t,i,n,r,o,s,a){T.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:n,heightSegments:r,openEnded:o,thetaStart:s,thetaLength:a},this.fromBufferGeometry(new qi(e,t,i,n,r,o,s,a)),this.mergeVertices()}function qi(e,t,n,o,s,a,l,c){function u(n){var s,a=new i,u=new r,v=0,x=!0===n?e:t,w=!0===n?1:-1,_=g;for(s=1;s<=o;s++)p.push(0,y*w,0),f.push(0,w,0),m.push(.5,.5),g++;var E=g;for(s=0;s<=o;s++){var M=s/o*c+l,S=Math.cos(M);M=Math.sin(M),u.x=x*M,u.y=y*w,u.z=x*S,p.push(u.x,u.y,u.z),f.push(0,w,0),a.x=.5*S+.5,a.y=.5*M*w+.5,m.push(a.x,a.y),g++}for(s=0;sthis.duration&&this.resetDuration()}function wn(e){if(void 0===e.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return mn;case"vector":case"vector2":case"vector3":case"vector4":return bn;case"color":return fn;case"quaternion":return vn;case"bool":case"boolean":return pn;case"string":return yn}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){var i=[],n=[];Wo.flattenJSON(e.keys,i,n,"value"),e.times=i,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}function _n(e,t,i){var n=this,r=!1,o=0,s=0,a=void 0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(e){s++,!1===r&&void 0!==n.onStart&&n.onStart(e,o,s),r=!0},this.itemEnd=function(e){o++,void 0!==n.onProgress&&n.onProgress(e,o,s),o===s&&(r=!1,void 0!==n.onLoad)&&n.onLoad()},this.itemError=function(e){void 0!==n.onError&&n.onError(e)},this.resolveURL=function(e){return a?a(e):e},this.setURLModifier=function(e){return a=e,this}}function En(e){this.manager=void 0!==e?e:Xo}function Mn(e){this.manager=void 0!==e?e:Xo}function Sn(e){this.manager=void 0!==e?e:Xo,this._parser=null}function Tn(e){this.manager=void 0!==e?e:Xo,this._parser=null}function An(e){this.manager=void 0!==e?e:Xo}function Cn(e){this.manager=void 0!==e?e:Xo}function Ln(e){this.manager=void 0!==e?e:Xo}function Pn(){this.type="Curve",this.arcLengthDivisions=200}function In(e,t,i,n,r,o,s,a){Pn.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=i||1,this.yRadius=n||1,this.aStartAngle=r||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=s||!1,this.aRotation=a||0}function Rn(e,t,i,n,r,o){In.call(this,e,t,i,i,n,r,o),this.type="ArcCurve"}function On(){var e=0,t=0,i=0,n=0;return{initCatmullRom:function(r,o,s,a,l){e=o,t=r=l*(s-r),i=-3*o+3*s-2*r-(a=l*(a-o)),n=2*o-2*s+r+a},initNonuniformCatmullRom:function(r,o,s,a,l,c,u){e=o,t=r=((o-r)/l-(s-r)/(l+c)+(s-o)/c)*c,i=-3*o+3*s-2*r-(a=((s-o)/c-(a-o)/(c+u)+(a-s)/u)*c),n=2*o-2*s+r+a},calc:function(r){var o=r*r;return e+t*r+i*o+n*o*r}}}function Dn(e,t,i,n){Pn.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=i||"centripetal",this.tension=n||.5}function kn(e,t,i,n,r){var o=e*e;return(2*i-2*n+(t=.5*(n-t))+(r=.5*(r-i)))*e*o+(-3*i+3*n-2*t-r)*o+t*e+i}function zn(e,t,i,n){var r=1-e;return r*r*t+2*(1-e)*e*i+e*e*n}function Bn(e,t,i,n,r){var o=1-e,s=1-e;return o*o*o*t+3*s*s*e*i+3*(1-e)*e*e*n+e*e*e*r}function Nn(e,t,n,r){Pn.call(this),this.type="CubicBezierCurve",this.v0=e||new i,this.v1=t||new i,this.v2=n||new i,this.v3=r||new i}function Fn(e,t,i,n){Pn.call(this),this.type="CubicBezierCurve3",this.v0=e||new r,this.v1=t||new r,this.v2=i||new r,this.v3=n||new r}function Hn(e,t){Pn.call(this),this.type="LineCurve",this.v1=e||new i,this.v2=t||new i}function Un(e,t){Pn.call(this),this.type="LineCurve3",this.v1=e||new r,this.v2=t||new r}function jn(e,t,n){Pn.call(this),this.type="QuadraticBezierCurve",this.v0=e||new i,this.v1=t||new i,this.v2=n||new i}function Gn(e,t,i){Pn.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new r,this.v1=t||new r,this.v2=i||new r}function Vn(e){Pn.call(this),this.type="SplineCurve",this.points=e||[]}function Wn(){Pn.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function qn(e){Wn.call(this),this.type="Path",this.currentPoint=new i,e&&this.setFromPoints(e)}function Xn(e){qn.call(this,e),this.uuid=ho.generateUUID(),this.type="Shape",this.holes=[]}function Yn(e,t){S.call(this),this.type="Light",this.color=new b(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function Zn(e,t,i){Yn.call(this,e,i),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(S.DefaultUp),this.updateMatrix(),this.groundColor=new b(t)}function Qn(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new i(512,512),this.map=null,this.matrix=new g}function Jn(){Qn.call(this,new wt(50,1,.5,500))}function Kn(e,t,i,n,r,o){Yn.call(this,e,t),this.type="SpotLight",this.position.copy(S.DefaultUp),this.updateMatrix(),this.target=new S,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==i?i:0,this.angle=void 0!==n?n:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==o?o:1,this.shadow=new Jn}function $n(e,t,i,n){Yn.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==i?i:0,this.decay=void 0!==n?n:1,this.shadow=new Qn(new wt(90,1,.5,500))}function er(e,t,i,n,r,o){xt.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==e?e:-1,this.right=void 0!==t?t:1,this.top=void 0!==i?i:1,this.bottom=void 0!==n?n:-1,this.near=void 0!==r?r:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function tr(){Qn.call(this,new er(-5,5,5,-5,.5,500))}function ir(e,t){Yn.call(this,e,t),this.type="DirectionalLight",this.position.copy(S.DefaultUp),this.updateMatrix(),this.target=new S,this.shadow=new tr}function nr(e,t){Yn.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function rr(e,t,i,n){Yn.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==i?i:10,this.height=void 0!==n?n:10}function or(e){this.manager=void 0!==e?e:Xo,this.textures={}}function sr(){F.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function ar(e,t,i,n){"number"==typeof i&&(n=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),A.call(this,e,t,i),this.meshPerAttribute=n||1}function lr(e){this.manager=void 0!==e?e:Xo}function cr(e){this.manager=void 0!==e?e:Xo,this.resourcePath=""}function ur(e){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.manager=void 0!==e?e:Xo,this.options=void 0}function hr(){this.type="ShapePath",this.color=new b,this.subPaths=[],this.currentPath=null}function dr(e){this.type="Font",this.data=e}function pr(e){this.manager=void 0!==e?e:Xo}function fr(){}function mr(e){this.manager=void 0!==e?e:Xo}function gr(){this.coefficients=[];for(var e=0;9>e;e++)this.coefficients.push(new r)}function vr(e,t){Yn.call(this,void 0,t),this.sh=void 0!==e?e:new gr}function yr(e,t,i){vr.call(this,void 0,i),e=(new b).set(e),i=(new b).set(t),t=new r(e.r,e.g,e.b),e=new r(i.r,i.g,i.b);var n=(i=Math.sqrt(Math.PI))*Math.sqrt(.75);this.sh.coefficients[0].copy(t).add(e).multiplyScalar(i),this.sh.coefficients[1].copy(t).sub(e).multiplyScalar(n)}function br(e,t){vr.call(this,void 0,t),e=(new b).set(e),this.sh.coefficients[0].set(e.r,e.g,e.b).multiplyScalar(2*Math.sqrt(Math.PI))}function xr(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new wt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new wt,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function wr(e,t,i,n){S.call(this),this.type="CubeCamera";var o=new wt(90,1,e,t);o.up.set(0,-1,0),o.lookAt(new r(1,0,0)),this.add(o);var s=new wt(90,1,e,t);s.up.set(0,-1,0),s.lookAt(new r(-1,0,0)),this.add(s);var a=new wt(90,1,e,t);a.up.set(0,0,1),a.lookAt(new r(0,1,0)),this.add(a);var l=new wt(90,1,e,t);l.up.set(0,0,-1),l.lookAt(new r(0,-1,0)),this.add(l);var c=new wt(90,1,e,t);c.up.set(0,-1,0),c.lookAt(new r(0,0,1)),this.add(c);var h=new wt(90,1,e,t);h.up.set(0,-1,0),h.lookAt(new r(0,0,-1)),this.add(h),n=n||{format:1022,magFilter:1006,minFilter:1006},this.renderTarget=new u(i,i,n),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var i=e.getRenderTarget(),n=this.renderTarget,r=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,o),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,a),e.setRenderTarget(n,3),e.render(t,l),e.setRenderTarget(n,4),e.render(t,c),n.texture.generateMipmaps=r,e.setRenderTarget(n,5),e.render(t,h),e.setRenderTarget(i)},this.clear=function(e,t,i,n){for(var r=e.getRenderTarget(),o=this.renderTarget,s=0;6>s;s++)e.setRenderTarget(o,s),e.clear(t,i,n);e.setRenderTarget(r)}}function _r(e){this.autoStart=void 0===e||e,this.elapsedTime=this.oldTime=this.startTime=0,this.running=!1}function Er(){S.call(this),this.type="AudioListener",this.context=ls.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0}function Mr(e){S.call(this),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.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 Sr(e){Mr.call(this,e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function Tr(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function Ar(e,t,i){switch(this.binding=e,this.valueSize=i,e=Float64Array,t){case"quaternion":t=this._slerp;break;case"string":case"bool":e=Array,t=this._select;break;default:t=this._lerp}this.buffer=new e(4*i),this._mixBufferRegion=t,this.referenceCount=this.useCount=this.cumulativeWeight=0}function Cr(e,t,i){i=i||Lr.parseTrackName(t),this._targetGroup=e,this._bindings=e.subscribe_(t,i)}function Lr(e,t,i){this.path=t,this.parsedPath=i||Lr.parseTrackName(t),this.node=Lr.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function Pr(){this.uuid=ho.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,i=arguments.length;t!==i;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}function Ir(e,t,i){this._mixer=e,this._clip=t,this._localRoot=i||null,t=(e=t.tracks).length,i=Array(t);for(var n={endingStart:2400,endingEnd:2400},r=0;r!==t;++r){var o=e[r].createInterpolant(null);i[r]=o,o.settings=n}this._interpolantSettings=n,this._interpolants=i,this._propertyBindings=Array(t),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=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtEnd=this.zeroSlopeAtStart=!0}function Rr(e){this._root=e,this._initMemoryManager(),this.time=this._accuIndex=0,this.timeScale=1}function Or(e,t){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=t),this.value=e}function Dr(e,t,i){Pt.call(this,e,t),this.meshPerAttribute=i||1}function kr(e,t,i,n){this.ray=new q(e,t),this.near=i||0,this.far=n||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function zr(e,t){return e.distance-t.distance}function Br(e,t,i,n){if(!1!==e.visible&&(e.raycast(t,i),!0===n)){n=0;for(var r=(e=e.children).length;ni;i++,n++){var r=i/32*Math.PI*2,o=n/32*Math.PI*2;t.push(Math.cos(r),Math.sin(r),1,Math.cos(o),Math.sin(o),1)}e.addAttribute("position",new k(t,3)),t=new Nt({fog:!1}),this.cone=new Ht(e,t),this.add(this.cone),this.update()}function Wr(e){for(var t=function e(t){var i=[];t&&t.isBone&&i.push(t);for(var n=0;ne?-1:0t;t++)e[t]=(16>t?"0":"")+t.toString(16);return function(){var t=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(e[255&t]+e[t>>8&255]+e[t>>16&255]+e[t>>24&255]+"-"+e[255&i]+e[i>>8&255]+"-"+e[i>>16&15|64]+e[i>>24&255]+"-"+e[63&n|128]+e[n>>8&255]+"-"+e[n>>16&255]+e[n>>24&255]+e[255&r]+e[r>>8&255]+e[r>>16&255]+e[r>>24&255]).toUpperCase()}}(),clamp:function(e,t,i){return Math.max(t,Math.min(i,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,i,n,r){return n+(e-t)*(r-n)/(i-t)},lerp:function(e,t,i){return(1-i)*e+i*t},smoothstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*(3-2*e)},smootherstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*ho.DEG2RAD},radToDeg:function(e){return e*ho.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}};Object.defineProperties(i.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(i.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.y=this.x=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,i=this.y;return e=e.elements,this.x=e[0]*t+e[3]*i+e[6],this.y=e[1]*t+e[4]*i+e[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this},clampLength:function(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=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},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.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 e=Math.atan2(this.y,this.x);return 0>e&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x;return t*t+(e=this.y-e.y)*e},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var i=Math.cos(t);t=Math.sin(t);var n=this.x-e.x,r=this.y-e.y;return this.x=n*i-r*t+e.x,this.y=n*t+r*i+e.y,this}}),Object.assign(n,{slerp:function(e,t,i,n){return i.copy(e).slerp(t,n)},slerpFlat:function(e,t,i,n,r,o,s){var a=i[n+0],l=i[n+1],c=i[n+2];i=i[n+3],n=r[o+0];var u=r[o+1],h=r[o+2];if(i!==(r=r[o+3])||a!==n||l!==u||c!==h){o=1-s;var d=a*n+l*u+c*h+i*r,p=0<=d?1:-1,f=1-d*d;f>Number.EPSILON&&(f=Math.sqrt(f),d=Math.atan2(f,d*p),o=Math.sin(o*d)/f,s=Math.sin(s*d)/f),a=a*o+n*(p*=s),l=l*o+u*p,c=c*o+h*p,i=i*o+r*p,o===1-s&&(a*=s=1/Math.sqrt(a*a+l*l+c*c+i*i),l*=s,c*=s,i*=s)}e[t]=a,e[t+1]=l,e[t+2]=c,e[t+3]=i}}),Object.defineProperties(n.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this.onChangeCallback()}}}),Object.assign(n.prototype,{isQuaternion:!0,set:function(e,t,i,n){return this._x=e,this._y=t,this._z=i,this._w=n,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var i=e._x,n=e._y,r=e._z;e=e.order;var o=Math.cos,s=Math.sin,a=o(i/2),l=o(n/2);return o=o(r/2),i=s(i/2),n=s(n/2),r=s(r/2),"XYZ"===e?(this._x=i*l*o+a*n*r,this._y=a*n*o-i*l*r,this._z=a*l*r+i*n*o,this._w=a*l*o-i*n*r):"YXZ"===e?(this._x=i*l*o+a*n*r,this._y=a*n*o-i*l*r,this._z=a*l*r-i*n*o,this._w=a*l*o+i*n*r):"ZXY"===e?(this._x=i*l*o-a*n*r,this._y=a*n*o+i*l*r,this._z=a*l*r+i*n*o,this._w=a*l*o-i*n*r):"ZYX"===e?(this._x=i*l*o-a*n*r,this._y=a*n*o+i*l*r,this._z=a*l*r-i*n*o,this._w=a*l*o+i*n*r):"YZX"===e?(this._x=i*l*o+a*n*r,this._y=a*n*o+i*l*r,this._z=a*l*r-i*n*o,this._w=a*l*o-i*n*r):"XZY"===e&&(this._x=i*l*o-a*n*r,this._y=a*n*o-i*l*r,this._z=a*l*r+i*n*o,this._w=a*l*o+i*n*r),!1!==t&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){t/=2;var i=Math.sin(t);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(t),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t=e.elements,i=t[0];e=t[4];var n=t[8],r=t[1],o=t[5],s=t[9],a=t[2],l=t[6],c=i+o+(t=t[10]);return 0o&&i>t?(i=2*Math.sqrt(1+i-o-t),this._w=(l-s)/i,this._x=.25*i,this._y=(e+r)/i,this._z=(n+a)/i):o>t?(i=2*Math.sqrt(1+o-i-t),this._w=(n-a)/i,this._x=(e+r)/i,this._y=.25*i,this._z=(s+l)/i):(i=2*Math.sqrt(1+t-i-o),this._w=(r-e)/i,this._x=(n+a)/i,this._y=(s+l)/i,this._z=.25*i),this.onChangeCallback(),this},setFromUnitVectors:function(e,t){var i=e.dot(t)+1;return 1e-6>i?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x),this._w=i,this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(ho.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var i=this.angleTo(e);return 0===i||this.slerp(e,Math.min(1,t/i)),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return 0===e?(this._z=this._y=this._x=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this.onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var i=e._x,n=e._y,r=e._z;e=e._w;var o=t._x,s=t._y,a=t._z;return t=t._w,this._x=i*t+e*o+n*a-r*s,this._y=n*t+e*s+r*o-i*a,this._z=r*t+e*a+i*s-n*o,this._w=e*t-i*o-n*s-r*a,this.onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var i=this._x,n=this._y,r=this._z,o=this._w,s=o*e._w+i*e._x+n*e._y+r*e._z;if(0>s?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,s=-s):this.copy(e),1<=s)return this._w=o,this._x=i,this._y=n,this._z=r,this;if((e=1-s*s)<=Number.EPSILON)return s=1-t,this._w=s*o+t*this._w,this._x=s*i+t*this._x,this._y=s*n+t*this._y,this._z=s*r+t*this._z,this.normalize();e=Math.sqrt(e);var a=Math.atan2(e,s);return s=Math.sin((1-t)*a)/e,t=Math.sin(t*a)/e,this._w=o*s+this._w*t,this._x=i*s+this._x*t,this._y=n*s+this._y*t,this._z=r*s+this._z*t,this.onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(r.prototype,{isVector3:!0,set:function(e,t,i){return this.x=e,this.y=t,this.z=i,this},setScalar:function(e){return this.z=this.y=this.x=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:(uo=new n,function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(uo.setFromEuler(e))}),applyAxisAngle:function(){var e=new n;return function(t,i){return this.applyQuaternion(e.setFromAxisAngle(t,i))}}(),applyMatrix3:function(e){var t=this.x,i=this.y,n=this.z;return e=e.elements,this.x=e[0]*t+e[3]*i+e[6]*n,this.y=e[1]*t+e[4]*i+e[7]*n,this.z=e[2]*t+e[5]*i+e[8]*n,this},applyMatrix4:function(e){var t=this.x,i=this.y,n=this.z,r=1/((e=e.elements)[3]*t+e[7]*i+e[11]*n+e[15]);return this.x=(e[0]*t+e[4]*i+e[8]*n+e[12])*r,this.y=(e[1]*t+e[5]*i+e[9]*n+e[13])*r,this.z=(e[2]*t+e[6]*i+e[10]*n+e[14])*r,this},applyQuaternion:function(e){var t=this.x,i=this.y,n=this.z,r=e.x,o=e.y,s=e.z,a=(e=e.w)*t+o*n-s*i,l=e*i+s*t-r*n,c=e*n+r*i-o*t;return t=-r*t-o*i-s*n,this.x=a*e+t*-r+l*-s-c*-o,this.y=l*e+t*-o+c*-r-a*-s,this.z=c*e+t*-s+a*-o-l*-r,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var t=this.x,i=this.y,n=this.z;return e=e.elements,this.x=e[0]*t+e[4]*i+e[8]*n,this.y=e[1]*t+e[5]*i+e[9]*n,this.z=e[2]*t+e[6]*i+e[10]*n,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this},clampLength:function(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=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},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.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(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e)},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var i=e.x,n=e.y;e=e.z;var r=t.x,o=t.y;return t=t.z,this.x=n*t-e*o,this.y=e*r-i*t,this.z=i*o-n*r,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:function(){var e=new r;return function(t){return e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e=new r;return function(t){return this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){return e=this.dot(e)/Math.sqrt(this.lengthSq()*e.lengthSq()),Math.acos(ho.clamp(e,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,i=this.y-e.y;return t*t+i*i+(e=this.z-e.z)*e},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,t,i){var n=Math.sin(t)*e;return this.x=n*Math.sin(i),this.y=Math.cos(t)*e,this.z=n*Math.cos(i),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,i){return this.x=e*Math.sin(t),this.y=i,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){return e=e.elements,this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length();return e=this.setFromMatrixColumn(e,2).length(),this.x=t,this.y=i,this.z=e,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}}),Object.assign(o.prototype,{isMatrix3:!0,set:function(e,t,i,n,r,o,s,a,l){var c=this.elements;return c[0]=e,c[1]=n,c[2]=s,c[3]=t,c[4]=r,c[5]=a,c[6]=i,c[7]=o,c[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=this.elements;return e=e.elements,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],this},setFromMatrix4:function(e){return e=e.elements,this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToBufferAttribute:function(){var e=new r;return function(t){for(var i=0,n=t.count;ii;i++)if(t[i]!==e[i])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var i=0;9>i;i++)this.elements[i]=e[i+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}});var po,fo={getDataURL:function(e){if("undefined"==typeof HTMLCanvasElement)return e.src;if(!(e instanceof HTMLCanvasElement)){void 0===po&&(po=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),po.width=e.width,po.height=e.height;var t=po.getContext("2d");e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),e=po}return 2048e.x||1e.x?0:1;break;case 1002:e.x=1===Math.abs(Math.floor(e.x)%2)?Math.ceil(e.x)-e.x:e.x-Math.floor(e.x)}if(0>e.y||1e.y?0:1;break;case 1002:e.y=1===Math.abs(Math.floor(e.y)%2)?Math.ceil(e.y)-e.y:e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(s.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(a.prototype,{isVector4:!0,set:function(e,t,i,n){return this.x=e,this.y=t,this.z=i,this.w=n,this},setScalar:function(e){return this.w=this.z=this.y=this.x=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){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: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,i=this.y,n=this.z,r=this.w;return e=e.elements,this.x=e[0]*t+e[4]*i+e[8]*n+e[12]*r,this.y=e[1]*t+e[5]*i+e[9]*n+e[13]*r,this.z=e[2]*t+e[6]*i+e[10]*n+e[14]*r,this.w=e[3]*t+e[7]*i+e[11]*n+e[15]*r,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return 1e-4>t?(this.x=1,this.z=this.y=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t=(e=e.elements)[0],i=e[4],n=e[8],r=e[1],o=e[5],s=e[9],a=e[2],l=e[6],c=e[10];return.01>Math.abs(i-r)&&.01>Math.abs(n-a)&&.01>Math.abs(s-l)?.1>Math.abs(i+r)&&.1>Math.abs(n+a)&&.1>Math.abs(s+l)&&.1>Math.abs(t+o+c-3)?(this.set(1,0,0,0),this):(e=Math.PI,c=(c+1)/2,i=(i+r)/4,n=(n+a)/4,s=(s+l)/4,(t=(t+1)/2)>(o=(o+1)/2)&&t>c?.01>t?(l=0,i=a=.707106781):(a=i/(l=Math.sqrt(t)),i=n/l):o>c?.01>o?(l=.707106781,a=0,i=.707106781):(l=i/(a=Math.sqrt(o)),i=s/a):.01>c?(a=l=.707106781,i=0):(l=n/(i=Math.sqrt(c)),a=s/i),this.set(l,a,i,e),this):(e=Math.sqrt((l-s)*(l-s)+(n-a)*(n-a)+(r-i)*(r-i)),.001>Math.abs(e)&&(e=1),this.x=(l-s)/e,this.y=(n-a)/e,this.z=(r-i)/e,this.w=Math.acos((t+o+c-1)/2),this)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(){var e,t;return function(i,n){return void 0===e&&(e=new a,t=new a),e.set(i,i,i,i),t.set(n,n,n,n),this.clamp(e,t)}}(),clampLength:function(e,t){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(e,Math.min(t,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=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),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.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(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,i){return this.subVectors(t,e).multiplyScalar(i).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),l.prototype=Object.assign(Object.create(t.prototype),{constructor:l,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),c.prototype=Object.assign(Object.create(l.prototype),{constructor:c,isWebGLMultisampleRenderTarget:!0,copy:function(e){return l.prototype.copy.call(this,e),this.samples=e.samples,this}}),u.prototype=Object.create(l.prototype),u.prototype.constructor=u,u.prototype.isWebGLRenderTargetCube=!0,h.prototype=Object.create(s.prototype),h.prototype.constructor=h,h.prototype.isDataTexture=!0,Object.assign(d.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,i=1/0,n=1/0,r=-1/0,o=-1/0,s=-1/0,a=0,l=e.length;ar&&(r=c),u>o&&(o=u),h>s&&(s=h)}return this.min.set(t,i,n),this.max.set(r,o,s),this},setFromBufferAttribute:function(e){for(var t=1/0,i=1/0,n=1/0,r=-1/0,o=-1/0,s=-1/0,a=0,l=e.count;ar&&(r=c),u>o&&(o=u),h>s&&(s=h)}return this.min.set(t,i,n),this.max.set(r,o,s),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,i=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new r),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)},intersectsSphere:function(){var e=new r;return function(t){return this.clampPoint(t.center,e),e.distanceToSquared(t.center)<=t.radius*t.radius}}(),intersectsPlane:function(e){if(0=-e.constant},intersectsTriangle:function(){function e(e){var r,o=0;for(r=e.length-3;o<=r;o+=3){l.fromArray(e,o);var s=u.x*Math.abs(l.x)+u.y*Math.abs(l.y)+u.z*Math.abs(l.z),a=t.dot(l),c=i.dot(l),h=n.dot(l);if(Math.max(-Math.max(a,c,h),Math.min(a,c,h))>s)return!1}return!0}var t=new r,i=new r,n=new r,o=new r,s=new r,a=new r,l=new r,c=new r,u=new r,h=new r;return function(r){return!this.isEmpty()&&(this.getCenter(c),u.subVectors(this.max,c),t.subVectors(r.a,c),i.subVectors(r.b,c),n.subVectors(r.c,c),o.subVectors(i,t),s.subVectors(n,i),a.subVectors(t,n),!!e(r=[0,-o.z,o.y,0,-s.z,s.y,0,-a.z,a.y,o.z,0,-o.x,s.z,0,-s.x,a.z,0,-a.x,-o.y,o.x,0,-s.y,s.x,0,-a.y,a.x,0])&&(!!e(r=[1,0,0,0,1,0,0,0,1])&&(h.crossVectors(o,s),e(r=[h.x,h.y,h.z]))))}}(),clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new r),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new r;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),getBoundingSphere:function(){var e=new r;return function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(e).length(),t}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(){var e=[new r,new r,new r,new r,new r,new r,new r,new r];return function(t){return this.isEmpty()||(e[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),e[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),e[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),e[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),e[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),e[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),e[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),e[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(e)),this}}(),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Object.assign(p.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(){var e=new d;return function(t,i){var n=this.center;void 0!==i?n.copy(i):e.setFromPoints(t).getCenter(n);for(var r=i=0,o=t.length;r=this.radius},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var i=this.center.distanceToSquared(e);return void 0===t&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new r),t.copy(e),i>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},getBoundingBox:function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new d),e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius*=e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}}),Object.assign(f.prototype,{set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,i,n){return this.normal.set(e,t,i),this.constant=n,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new r,t=new r;return function(i,n,r){return n=e.subVectors(r,n).cross(t.subVectors(i,n)).normalize(),this.setFromNormalAndCoplanarPoint(n,i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return void 0===t&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new r),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(){var e=new r;return function(t,i){void 0===i&&(console.warn("THREE.Plane: .intersectLine() target is now required"),i=new r);var n=t.delta(e),o=this.normal.dot(n);if(0===o){if(0===this.distanceToPoint(t.start))return i.copy(t.start)}else if(!(0>(o=-(t.start.dot(this.normal)+this.constant)/o)||1t&&0e&&0i;i++)t[i].copy(e.planes[i]);return this},setFromMatrix:function(e){var t=this.planes,i=e.elements;e=i[0];var n=i[1],r=i[2],o=i[3],s=i[4],a=i[5],l=i[6],c=i[7],u=i[8],h=i[9],d=i[10],p=i[11],f=i[12],m=i[13],g=i[14];return i=i[15],t[0].setComponents(o-e,c-s,p-u,i-f).normalize(),t[1].setComponents(o+e,c+s,p+u,i+f).normalize(),t[2].setComponents(o+n,c+a,p+h,i+m).normalize(),t[3].setComponents(o-n,c-a,p-h,i-m).normalize(),t[4].setComponents(o-r,c-l,p-d,i-g).normalize(),t[5].setComponents(o+r,c+l,p+d,i+g).normalize(),this},intersectsObject:function(){var e=new p;return function(t){var i=t.geometry;return null===i.boundingSphere&&i.computeBoundingSphere(),e.copy(i.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSprite:function(){var e=new p;return function(t){return e.center.set(0,0,0),e.radius=.7071067811865476,e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){var t=this.planes,i=e.center;e=-e.radius;for(var n=0;6>n;n++)if(t[n].distanceToPoint(i)n;n++){var r=i[n];if(e.x=0r.distanceToPoint(e))return!1}return!0}}(),containsPoint:function(e){for(var t=this.planes,i=0;6>i;i++)if(0>t[i].distanceToPoint(e))return!1;return!0}}),Object.assign(g.prototype,{isMatrix4:!0,set:function(e,t,i,n,r,o,s,a,l,c,u,h,d,p,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=n,g[1]=r,g[5]=o,g[9]=s,g[13]=a,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new g).fromArray(this.elements)},copy:function(e){var t=this.elements;return e=e.elements,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],this},copyPosition:function(e){var t=this.elements;return e=e.elements,t[12]=e[12],t[13]=e[13],t[14]=e[14],this},extractBasis:function(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this},extractRotation:function(){var e=new r;return function(t){var i=this.elements,n=t.elements,r=1/e.setFromMatrixColumn(t,0).length(),o=1/e.setFromMatrixColumn(t,1).length();return t=1/e.setFromMatrixColumn(t,2).length(),i[0]=n[0]*r,i[1]=n[1]*r,i[2]=n[2]*r,i[3]=0,i[4]=n[4]*o,i[5]=n[5]*o,i[6]=n[6]*o,i[7]=0,i[8]=n[8]*t,i[9]=n[9]*t,i[10]=n[10]*t,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}}(),makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,i=e.x,n=e.y,r=e.z,o=Math.cos(i);i=Math.sin(i);var s=Math.cos(n);n=Math.sin(n);var a=Math.cos(r);if(r=Math.sin(r),"XYZ"===e.order){e=o*a;var l=o*r,c=i*a,u=i*r;t[0]=s*a,t[4]=-s*r,t[8]=n,t[1]=l+c*n,t[5]=e-u*n,t[9]=-i*s,t[2]=u-e*n,t[6]=c+l*n,t[10]=o*s}else"YXZ"===e.order?(e=s*a,l=s*r,c=n*a,u=n*r,t[0]=e+u*i,t[4]=c*i-l,t[8]=o*n,t[1]=o*r,t[5]=o*a,t[9]=-i,t[2]=l*i-c,t[6]=u+e*i,t[10]=o*s):"ZXY"===e.order?(e=s*a,l=s*r,c=n*a,u=n*r,t[0]=e-u*i,t[4]=-o*r,t[8]=c+l*i,t[1]=l+c*i,t[5]=o*a,t[9]=u-e*i,t[2]=-o*n,t[6]=i,t[10]=o*s):"ZYX"===e.order?(e=o*a,l=o*r,c=i*a,u=i*r,t[0]=s*a,t[4]=c*n-l,t[8]=e*n+u,t[1]=s*r,t[5]=u*n+e,t[9]=l*n-c,t[2]=-n,t[6]=i*s,t[10]=o*s):"YZX"===e.order?(e=o*s,l=o*n,c=i*s,u=i*n,t[0]=s*a,t[4]=u-e*r,t[8]=c*r+l,t[1]=r,t[5]=o*a,t[9]=-i*a,t[2]=-n*a,t[6]=l*r+c,t[10]=e-u*r):"XZY"===e.order&&(e=o*s,l=o*n,c=i*s,u=i*n,t[0]=s*a,t[4]=-r,t[8]=n*a,t[1]=e*r+u,t[5]=o*a,t[9]=l*r-c,t[2]=c*r-l,t[6]=i*a,t[10]=u*r+e);return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(){var e=new r(0,0,0),t=new r(1,1,1);return function(i){return this.compose(e,i,t)}}(),lookAt:function(){var e=new r,t=new r,i=new r;return function(n,r,o){var s=this.elements;return i.subVectors(n,r),0===i.lengthSq()&&(i.z=1),i.normalize(),e.crossVectors(o,i),0===e.lengthSq()&&(1===Math.abs(o.z)?i.x+=1e-4:i.z+=1e-4,i.normalize(),e.crossVectors(o,i)),e.normalize(),t.crossVectors(i,e),s[0]=e.x,s[4]=t.x,s[8]=i.x,s[1]=e.y,s[5]=t.y,s[9]=i.y,s[2]=e.z,s[6]=t.z,s[10]=i.z,this}}(),multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var i=e.elements,n=t.elements;t=this.elements,e=i[0];var r=i[4],o=i[8],s=i[12],a=i[1],l=i[5],c=i[9],u=i[13],h=i[2],d=i[6],p=i[10],f=i[14],m=i[3],g=i[7],v=i[11];i=i[15];var y=n[0],b=n[4],x=n[8],w=n[12],_=n[1],E=n[5],M=n[9],S=n[13],T=n[2],A=n[6],C=n[10],L=n[14],P=n[3],I=n[7],R=n[11];return n=n[15],t[0]=e*y+r*_+o*T+s*P,t[4]=e*b+r*E+o*A+s*I,t[8]=e*x+r*M+o*C+s*R,t[12]=e*w+r*S+o*L+s*n,t[1]=a*y+l*_+c*T+u*P,t[5]=a*b+l*E+c*A+u*I,t[9]=a*x+l*M+c*C+u*R,t[13]=a*w+l*S+c*L+u*n,t[2]=h*y+d*_+p*T+f*P,t[6]=h*b+d*E+p*A+f*I,t[10]=h*x+d*M+p*C+f*R,t[14]=h*w+d*S+p*L+f*n,t[3]=m*y+g*_+v*T+i*P,t[7]=m*b+g*E+v*A+i*I,t[11]=m*x+g*M+v*C+i*R,t[15]=m*w+g*S+v*L+i*n,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},applyToBufferAttribute:function(){var e=new r;return function(t){for(var i=0,n=t.count;ithis.determinant()&&(s=-s),i.x=o[12],i.y=o[13],i.z=o[14],t.copy(this),i=1/s,o=1/a;var c=1/l;return t.elements[0]*=i,t.elements[1]*=i,t.elements[2]*=i,t.elements[4]*=o,t.elements[5]*=o,t.elements[6]*=o,t.elements[8]*=c,t.elements[9]*=c,t.elements[10]*=c,n.setFromRotationMatrix(t),r.x=s,r.y=a,r.z=l,this}}(),makePerspective:function(e,t,i,n,r,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var s=this.elements;return s[0]=2*r/(t-e),s[4]=0,s[8]=(t+e)/(t-e),s[12]=0,s[1]=0,s[5]=2*r/(i-n),s[9]=(i+n)/(i-n),s[13]=0,s[2]=0,s[6]=0,s[10]=-(o+r)/(o-r),s[14]=-2*o*r/(o-r),s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this},makeOrthographic:function(e,t,i,n,r,o){var s=this.elements,a=1/(t-e),l=1/(i-n),c=1/(o-r);return s[0]=2*a,s[4]=0,s[8]=0,s[12]=-(t+e)*a,s[1]=0,s[5]=2*l,s[9]=0,s[13]=-(i+n)*l,s[2]=0,s[6]=0,s[10]=-2*c,s[14]=-(o+r)*c,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this},equals:function(e){var t=this.elements;e=e.elements;for(var i=0;16>i;i++)if(t[i]!==e[i])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var i=0;16>i;i++)this.elements[i]=e[i+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}});var go={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}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\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_RoughnessDependent( specularColor, dotNV, roughness );\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}",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = normalMatrix * objectTangent;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent ));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",lights_pars_begin:"uniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#endif\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\tfloat clearCoatInv = 1.0 - clearCoatDHR;\n\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec3 singleScattering = vec3( 0.0 );\n\t\tvec3 multiScattering = vec3( 0.0 );\n\t\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\t\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * singleScattering;\n\t\treflectedLight.indirectDiffuse += multiScattering * cosineWeightedIrradiance;\n\t\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\t#else\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#endif\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearCoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\n\t#ifndef STANDARD\n\t\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, irradiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t#endif\n#endif",normal_fragment_maps:"#ifdef USE_NORMALMAP\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t#ifdef FLIP_SIDED\n\t\t\tnormal = - normal;\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\tnormal = normalize( normalMatrix * normal );\n\t#else\n\t\t#ifdef USE_TANGENT\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy = normalScale * mapN.xy;\n\t\t\tnormal = normalize( vTBN * mapN );\n\t\t#else\n\t\t\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\t\t#endif\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tuniform mat3 normalMatrix;\n\t#else\n\t\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\t\tvec2 st0 = dFdx( vUv.st );\n\t\t\tvec2 st1 = dFdy( vUv.st );\n\t\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\t\tvec3 N = normalize( surf_norm );\n\t\t\tmat3 tsn = mat3( S, T, N );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy *= normalScale;\n\t\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\treturn normalize( tsn * mapN );\n\t\t}\n\t#endif\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#if defined( DITHERING )\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_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\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",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}"},vo={clone:v,merge:y},yo={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(b.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.b=this.g=this.r=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,i){return this.r=e,this.g=t,this.b=i,this},setHSL:function(){function e(e,t,i){return 0>i&&(i+=1),1i?t:i<2/3?e+6*(t-e)*(2/3-i):e}return function(t,i,n){return t=ho.euclideanModulo(t,1),i=ho.clamp(i,0,1),n=ho.clamp(n,0,1),0===i?this.r=this.g=this.b=n:(n=2*n-(i=.5>=n?n*(1+i):n+i-n*i),this.r=e(n,i,t+1/3),this.g=e(n,i,t),this.b=e(n,i,t-1/3)),this}}(),setStyle:function(e){function t(t){void 0!==t&&1>parseFloat(t)&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var i;if(i=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var n=i[2];switch(i[1]){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(n))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[5]),this;if(i=/^(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(n))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(n)){n=parseFloat(i[1])/360;var r=parseInt(i[2],10)/100,o=parseInt(i[3],10)/100;return t(i[5]),this.setHSL(n,r,o)}}}else if(i=/^#([A-Fa-f0-9]+)$/.exec(e)){if(3===(n=(i=i[1]).length))return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(6===n)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&0e?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}return function(t){return this.r=e(t.r),this.g=e(t.g),this.b=e(t.b),this}}(),copyLinearToSRGB:function(){function e(e){return.0031308>e?12.92*e:1.055*Math.pow(e,.41666)-.055}return function(t){return this.r=e(t.r),this.g=e(t.g),this.b=e(t.b),this}}(),convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),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(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,i=this.r,n=this.g,r=this.b,o=Math.max(i,n,r),s=Math.min(i,n,r),a=(s+o)/2;if(s===o)s=t=0;else{var l=o-s;switch(s=.5>=a?l/(o+s):l/(2-o-s),o){case i:t=(n-r)/l+(nMath.abs(s)?(this._x=Math.atan2(-c,r),this._z=Math.atan2(-o,e)):(this._x=Math.atan2(h,l),this._z=0)):"YXZ"===t?(this._x=Math.asin(-n(c,-1,1)),.99999>Math.abs(c)?(this._y=Math.atan2(s,r),this._z=Math.atan2(a,l)):(this._y=Math.atan2(-u,e),this._z=0)):"ZXY"===t?(this._x=Math.asin(n(h,-1,1)),.99999>Math.abs(h)?(this._y=Math.atan2(-u,r),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(a,e))):"ZYX"===t?(this._y=Math.asin(-n(u,-1,1)),.99999>Math.abs(u)?(this._x=Math.atan2(h,r),this._z=Math.atan2(a,e)):(this._x=0,this._z=Math.atan2(-o,l))):"YZX"===t?(this._z=Math.asin(n(a,-1,1)),.99999>Math.abs(a)?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,e)):(this._x=0,this._y=Math.atan2(s,r))):"XZY"===t?(this._z=Math.asin(-n(o,-1,1)),.99999>Math.abs(o)?(this._x=Math.atan2(h,l),this._y=Math.atan2(s,e)):(this._x=Math.atan2(-c,r),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==i&&this.onChangeCallback(),this},setFromQuaternion:function(){var e=new g;return function(t,i,n){return e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,i,n)}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(){var e=new n;return function(t){return e.setFromEuler(this),this.setFromQuaternion(e,t)}}(),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new r(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(M.prototype,{set:function(e){this.mask=1<s;s++)if(r[s]===r[(s+1)%3]){t.push(o);break}for(o=t.length-1;0<=o;o--)for(r=t[o],this.faces.splice(r,1),n=0,e=this.faceVertexUvs.length;nthis.opacity&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),0(e=t.dot(this.direction))?t.copy(this.origin):t.copy(this.direction).multiplyScalar(e).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(){var e=new r;return function(t){var i=e.subVectors(t,this.origin).dot(this.direction);return 0>i?this.origin.distanceToSquared(t):(e.copy(this.direction).multiplyScalar(i).add(this.origin),e.distanceToSquared(t))}}(),distanceSqToSegment:function(){var e=new r,t=new r,i=new r;return function(n,r,o,s){e.copy(n).add(r).multiplyScalar(.5),t.copy(r).sub(n).normalize(),i.copy(this.origin).sub(e);var a=.5*n.distanceTo(r),l=-this.direction.dot(t),c=i.dot(this.direction),u=-i.dot(t),h=i.lengthSq(),d=Math.abs(1-l*l);if(0=-p?r<=p?l=(n*=a=1/d)*(n+l*(r*=a)+2*c)+r*(l*n+r+2*u)+h:(r=a,l=-(n=Math.max(0,-(l*r+c)))*n+r*(r+2*u)+h):(r=-a,l=-(n=Math.max(0,-(l*r+c)))*n+r*(r+2*u)+h):r<=-p?l=-(n=Math.max(0,-(-l*a+c)))*n+(r=0(t=t.radius*t.radius)?null:(r=n-(t=Math.sqrt(t-r)),n+=t,0>r&&0>n?null:0>r?this.at(n,i):this.at(r,i))}}(),intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);return 0===t?0===e.distanceToPoint(this.origin)?0:null:0<=(e=-(this.origin.dot(e.normal)+e.constant)/t)?e:null},intersectPlane:function(e,t){return null===(e=this.distanceToPlane(e))?null:this.at(e,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||0>e.normal.dot(this.direction)*t},intersectBox:function(e,t){var i=1/this.direction.x,n=1/this.direction.y,r=1/this.direction.z,o=this.origin;if(0<=i){var s=(e.min.x-o.x)*i;i*=e.max.x-o.x}else s=(e.max.x-o.x)*i,i*=e.min.x-o.x;if(0<=n){var a=(e.min.y-o.y)*n;n*=e.max.y-o.y}else a=(e.max.y-o.y)*n,n*=e.min.y-o.y;return s>n||a>i?null:((a>s||s!=s)&&(s=a),(ne||a>i?null:((a>s||s!=s)&&(s=a),(ei?null:this.at(0<=s?s:i,t)))},intersectsBox:function(){var e=new r;return function(t){return null!==this.intersectBox(t,e)}}(),intersectTriangle:function(){var e=new r,t=new r,i=new r,n=new r;return function(r,o,s,a,l){if(t.subVectors(o,r),i.subVectors(s,r),n.crossVectors(t,i),0<(o=this.direction.dot(n))){if(a)return null;a=1}else{if(!(0>o))return null;a=-1,o=-o}return e.subVectors(this.origin,r),0>(r=a*this.direction.dot(i.crossVectors(e,i)))||0>(s=a*this.direction.dot(t.cross(e)))||r+s>o||0>(r=-a*e.dot(n))?null:this.at(r/o,l)}}(),applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}),Object.assign(X,{getNormal:function(){var e=new r;return function(t,i,n,o){return void 0===o&&(console.warn("THREE.Triangle: .getNormal() target is now required"),o=new r),o.subVectors(n,i),e.subVectors(t,i),o.cross(e),0<(t=o.lengthSq())?o.multiplyScalar(1/Math.sqrt(t)):o.set(0,0,0)}}(),getBarycoord:function(){var e=new r,t=new r,i=new r;return function(n,o,s,a,l){e.subVectors(a,o),t.subVectors(s,o),i.subVectors(n,o),n=e.dot(e),o=e.dot(t),s=e.dot(i);var c=t.dot(t);a=t.dot(i);var u=n*c-o*o;return void 0===l&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),l=new r),0===u?l.set(-2,-1,-1):(c=(c*s-o*a)*(u=1/u),n=(n*a-o*s)*u,l.set(1-c-n,n,c))}}(),containsPoint:function(){var e=new r;return function(t,i,n,r){return X.getBarycoord(t,i,n,r,e),0<=e.x&&0<=e.y&&1>=e.x+e.y}}(),getUV:function(){var e=new r;return function(t,i,n,r,o,s,a,l){return this.getBarycoord(t,i,n,r,e),l.set(0,0),l.addScaledVector(o,e.x),l.addScaledVector(s,e.y),l.addScaledVector(a,e.z),l}}(),isFrontFacing:function(){var e=new r,t=new r;return function(i,n,r,o){return e.subVectors(r,n),t.subVectors(i,n),0>e.cross(t).dot(o)}}()}),Object.assign(X.prototype,{set:function(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this},setFromPointsAndIndices:function(e,t,i,n){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[n]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:function(){var e=new r,t=new r;return function(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),.5*e.cross(t).length()}}(),getMidpoint:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new r),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return X.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new r),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return X.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,i,n,r){return X.getUV(e,this.a,this.b,this.c,t,i,n,r)},containsPoint:function(e){return X.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return X.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(){var e=new r,t=new r,i=new r,n=new r,o=new r,s=new r;return function(a,l){void 0===l&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),l=new r);var c=this.a,u=this.b,h=this.c;e.subVectors(u,c),t.subVectors(h,c),n.subVectors(a,c);var d=e.dot(n),p=t.dot(n);if(0>=d&&0>=p)return l.copy(c);o.subVectors(a,u);var f=e.dot(o),m=t.dot(o);if(0<=f&&m<=f)return l.copy(u);var g=d*m-f*p;if(0>=g&&0<=d&&0>=f)return u=d/(d-f),l.copy(c).addScaledVector(e,u);s.subVectors(a,h),a=e.dot(s);var v=t.dot(s);return 0<=v&&a<=v?l.copy(h):0>=(d=a*p-d*v)&&0<=p&&0>=v?(g=p/(p-v),l.copy(c).addScaledVector(t,g)):0>=(p=f*v-a*m)&&0<=m-f&&0<=a-v?(i.subVectors(h,u),g=(m-f)/(m-f+(a-v)),l.copy(u).addScaledVector(i,g)):(u=d*(h=1/(p+d+g)),g*=h,l.copy(c).addScaledVector(e,u).addScaledVector(t,g))}}(),equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}),Y.prototype=Object.create(V.prototype),Y.prototype.constructor=Y,Y.prototype.isMeshBasicMaterial=!0,Y.prototype.copy=function(e){return V.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this},Z.prototype=Object.assign(Object.create(S.prototype),{constructor:Z,isMesh:!0,setDrawMode:function(e){this.drawMode=e},copy:function(e){return S.prototype.copy.call(this,e),this.drawMode=e.drawMode,void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e=this.geometry;if(e.isBufferGeometry){e=e.morphAttributes;var t=Object.keys(e);if(0i.far?null:{distance:t,point:E.clone(),object:e})}function t(t,n,r,o,s,p,g,E,M,S){if(a.fromBufferAttribute(s,E),l.fromBufferAttribute(s,M),c.fromBufferAttribute(s,S),s=t.morphTargetInfluences,n.morphTargets&&p&&s){f.set(0,0,0),m.set(0,0,0),v.set(0,0,0);for(var T=0,A=p.length;Tr.far||s.push({distance:g,point:t.clone(),uv:X.getUV(t,c,u,h,d,p,f,new i),face:null,object:this})}}(),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return S.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}}),Dt.prototype=Object.assign(Object.create(S.prototype),{constructor:Dt,isLOD:!0,copy:function(e){S.prototype.copy.call(this,e,!1);for(var t=0,i=(e=e.levels).length;t=n[r].distance;r++)n[r-1].object.visible=!1,n[r].object.visible=!0;for(;rs||(h.applyMatrix4(this.matrixWorld),(g=n.ray.origin.distanceTo(h))n.far||o.push({distance:g,point:l.clone().applyMatrix4(this.matrixWorld),index:a,face:null,faceIndex:null,object:this}))}}else for(a=0,m=f.length/3-1;as||(h.applyMatrix4(this.matrixWorld),(g=n.ray.origin.distanceTo(h))n.far||o.push({distance:g,point:l.clone().applyMatrix4(this.matrixWorld),index:a,face:null,faceIndex:null,object:this}))}else if(a.isGeometry)for(u=(c=a.vertices).length,a=0;as||(h.applyMatrix4(this.matrixWorld),(g=n.ray.origin.distanceTo(h))n.far||o.push({distance:g,point:l.clone().applyMatrix4(this.matrixWorld),index:a,face:null,faceIndex:null,object:this}))}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Ht.prototype=Object.assign(Object.create(Ft.prototype),{constructor:Ht,isLineSegments:!0,computeLineDistances:function(){var e=new r,t=new r;return function(){var i=this.geometry;if(i.isBufferGeometry)if(null===i.index){for(var n=i.attributes.position,r=[],o=0,s=n.count;on.far||o.push({distance:e,distanceToRay:Math.sqrt(r),point:d.clone(),index:i,face:null,object:a}))}var a=this,l=this.geometry,c=this.matrixWorld,u=n.params.Points.threshold;if(null===l.boundingSphere&&l.computeBoundingSphere(),i.copy(l.boundingSphere),i.applyMatrix4(c),i.radius+=u,!1!==n.ray.intersectsSphere(i)){e.getInverse(c),t.copy(n.ray).applyMatrix4(e);var h=(u/=(this.scale.x+this.scale.y+this.scale.z)/3)*u;u=new r;var d=new r;if(l.isBufferGeometry){var p=l.index;if(l=l.attributes.position.array,null!==p){var f=p.array;p=0;for(var m=f.length;p=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Wt.prototype=Object.create(s.prototype),Wt.prototype.constructor=Wt,Wt.prototype.isCompressedTexture=!0,qt.prototype=Object.create(s.prototype),qt.prototype.constructor=qt,qt.prototype.isCanvasTexture=!0,Xt.prototype=Object.create(s.prototype),Xt.prototype.constructor=Xt,Xt.prototype.isDepthTexture=!0,Yt.prototype=Object.create(F.prototype),Yt.prototype.constructor=Yt,Zt.prototype=Object.create(T.prototype),Zt.prototype.constructor=Zt,Qt.prototype=Object.create(F.prototype),Qt.prototype.constructor=Qt,Jt.prototype=Object.create(T.prototype),Jt.prototype.constructor=Jt,Kt.prototype=Object.create(F.prototype),Kt.prototype.constructor=Kt,$t.prototype=Object.create(T.prototype),$t.prototype.constructor=$t,ei.prototype=Object.create(Kt.prototype),ei.prototype.constructor=ei,ti.prototype=Object.create(T.prototype),ti.prototype.constructor=ti,ii.prototype=Object.create(Kt.prototype),ii.prototype.constructor=ii,ni.prototype=Object.create(T.prototype),ni.prototype.constructor=ni,ri.prototype=Object.create(Kt.prototype),ri.prototype.constructor=ri,oi.prototype=Object.create(T.prototype),oi.prototype.constructor=oi,si.prototype=Object.create(Kt.prototype),si.prototype.constructor=si,ai.prototype=Object.create(T.prototype),ai.prototype.constructor=ai,li.prototype=Object.create(F.prototype),li.prototype.constructor=li,li.prototype.toJSON=function(){var e=F.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},ci.prototype=Object.create(T.prototype),ci.prototype.constructor=ci,ui.prototype=Object.create(F.prototype),ui.prototype.constructor=ui,hi.prototype=Object.create(T.prototype),hi.prototype.constructor=hi,di.prototype=Object.create(F.prototype),di.prototype.constructor=di;var Ho=function(e,t,i){i=i||2;var n,r=t&&t.length,o=r?t[0]*i:e.length,s=pi(e,0,o,i,!0),a=[];if(!s)return a;if(r){var l,c=i;r=[];var u=0;for(l=t.length;u80*i){var d=n=e[0],p=r=e[1];for(c=i;cn&&(n=u),t>r&&(r=t);n=0!==(n=Math.max(n-d,r-p))?1/n:0}return function e(t,i,n,r,o,s,a){if(t){if(!a&&s){var l=t,c=l;do{null===c.z&&(c.z=vi(c.x,c.y,r,o,s)),c.prevZ=c.prev,c=c.nextZ=c.next}while(c!==l);c.prevZ.nextZ=null,c.prevZ=null,l=c;var u,h,d,p,f=1;do{c=l;var m=l=null;for(h=0;c;){h++;var g=c;for(u=d=0;ud.x?h.x>f.x?h.x:f.x:d.x>f.x?d.x:f.x,x=h.y>d.y?h.y>f.y?h.y:f.y:d.y>f.y?d.y:f.y;for(u=vi(h.x=u;){if(v!==m.prev&&v!==m.next&&bi(h.x,h.y,d.x,d.y,f.x,f.y,v.x,v.y)&&0<=xi(v.prev,v,v.next)){m=!1;break e}v=v.prevZ}m=!0}}else e:if(m=t,h=m.prev,d=m,f=m.next,0<=xi(h,d,f))m=!1;else{for(u=m.next.next;u!==m.prev;){if(bi(h.x,h.y,d.x,d.y,f.x,f.y,u.x,u.y)&&0<=xi(u.prev,u,u.next)){m=!1;break e}u=u.next}m=!0}if(m)i.push(c.i/n),i.push(t.i/n),i.push(g.i/n),Ti(t),l=t=g.next;else if((t=g)===l){if(a){if(1===a){a=i,l=n,c=t;do{!wi(g=c.prev,m=c.next.next)&&_i(g,c,c.next,m)&&Ei(g,m)&&Ei(m,g)&&(a.push(g.i/l),a.push(c.i/l),a.push(m.i/l),Ti(c),Ti(c.next),c=t=m),c=c.next}while(c!==t);e(t=c,i,n,r,o,s,2)}else if(2===a)e:{a=t;do{for(l=a.next.next;l!==a.prev;){if(c=a.i!==l.i){if(g=l,m=(c=a).next.i!==g.i&&c.prev.i!==g.i){t:{m=c;do{if(m.i!==c.i&&m.next.i!==c.i&&m.i!==g.i&&m.next.i!==g.i&&_i(m,m.next,c,g)){m=!0;break t}m=m.next}while(m!==c);m=!1}m=!m}if(m=m&&Ei(c,g)&&Ei(g,c)){m=c,h=!1,d=(c.x+g.x)/2,g=(c.y+g.y)/2;do{m.y>g!=m.next.y>g&&m.next.y!==m.y&&d<(m.next.x-m.x)*(g-m.y)/(m.next.y-m.y)+m.x&&(h=!h),m=m.next}while(m!==c);m=h}c=m}if(c){t=Mi(a,l),a=fi(a,a.next),t=fi(t,t.next),e(a,i,n,r,o,s),e(t,i,n,r,o,s);break e}l=l.next}a=a.next}while(a!==t)}}else e(fi(t),i,n,r,o,s,1);break}}}}(s,a,i,d,p,n),a},Uo={area:function(e){for(var t=e.length,i=0,n=t-1,r=0;rUo.area(e)},triangulateShape:function(e,t){var i=[],n=[],r=[];Ci(e),Li(i,e);var o=e.length;for(t.forEach(Ci),e=0;eMath.abs(a-c)?[new i(e,1-n),new i(l,1-r),new i(u,1-o),new i(d,1-t)]:[new i(a,1-n),new i(c,1-r),new i(h,1-o),new i(p,1-t)]}};Oi.prototype=Object.create(T.prototype),Oi.prototype.constructor=Oi,Di.prototype=Object.create(Ii.prototype),Di.prototype.constructor=Di,ki.prototype=Object.create(T.prototype),ki.prototype.constructor=ki,zi.prototype=Object.create(F.prototype),zi.prototype.constructor=zi,Bi.prototype=Object.create(T.prototype),Bi.prototype.constructor=Bi,Ni.prototype=Object.create(F.prototype),Ni.prototype.constructor=Ni,Fi.prototype=Object.create(T.prototype),Fi.prototype.constructor=Fi,Hi.prototype=Object.create(F.prototype),Hi.prototype.constructor=Hi,Ui.prototype=Object.create(T.prototype),Ui.prototype.constructor=Ui,Ui.prototype.toJSON=function(){var e=T.prototype.toJSON.call(this);return Gi(this.parameters.shapes,e)},ji.prototype=Object.create(F.prototype),ji.prototype.constructor=ji,ji.prototype.toJSON=function(){var e=F.prototype.toJSON.call(this);return Gi(this.parameters.shapes,e)},Vi.prototype=Object.create(F.prototype),Vi.prototype.constructor=Vi,Wi.prototype=Object.create(T.prototype),Wi.prototype.constructor=Wi,qi.prototype=Object.create(F.prototype),qi.prototype.constructor=qi,Xi.prototype=Object.create(Wi.prototype),Xi.prototype.constructor=Xi,Yi.prototype=Object.create(qi.prototype),Yi.prototype.constructor=Yi,Zi.prototype=Object.create(T.prototype),Zi.prototype.constructor=Zi,Qi.prototype=Object.create(F.prototype),Qi.prototype.constructor=Qi;var Go=Object.freeze({WireframeGeometry:Yt,ParametricGeometry:Zt,ParametricBufferGeometry:Qt,TetrahedronGeometry:$t,TetrahedronBufferGeometry:ei,OctahedronGeometry:ti,OctahedronBufferGeometry:ii,IcosahedronGeometry:ni,IcosahedronBufferGeometry:ri,DodecahedronGeometry:oi,DodecahedronBufferGeometry:si,PolyhedronGeometry:Jt,PolyhedronBufferGeometry:Kt,TubeGeometry:ai,TubeBufferGeometry:li,TorusKnotGeometry:ci,TorusKnotBufferGeometry:ui,TorusGeometry:hi,TorusBufferGeometry:di,TextGeometry:Oi,TextBufferGeometry:Di,SphereGeometry:ki,SphereBufferGeometry:zi,RingGeometry:Bi,RingBufferGeometry:Ni,PlaneGeometry:j,PlaneBufferGeometry:G,LatheGeometry:Fi,LatheBufferGeometry:Hi,ShapeGeometry:Ui,ShapeBufferGeometry:ji,ExtrudeGeometry:Pi,ExtrudeBufferGeometry:Ii,EdgesGeometry:Vi,ConeGeometry:Xi,ConeBufferGeometry:Yi,CylinderGeometry:Wi,CylinderBufferGeometry:qi,CircleGeometry:Zi,CircleBufferGeometry:Qi,BoxGeometry:H,BoxBufferGeometry:U});Ji.prototype=Object.create(V.prototype),Ji.prototype.constructor=Ji,Ji.prototype.isShadowMaterial=!0,Ji.prototype.copy=function(e){return V.prototype.copy.call(this,e),this.color.copy(e.color),this},Ki.prototype=Object.create(W.prototype),Ki.prototype.constructor=Ki,Ki.prototype.isRawShaderMaterial=!0,$i.prototype=Object.create(V.prototype),$i.prototype.constructor=$i,$i.prototype.isMeshStandardMaterial=!0,$i.prototype.copy=function(e){return V.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},en.prototype=Object.create($i.prototype),en.prototype.constructor=en,en.prototype.isMeshPhysicalMaterial=!0,en.prototype.copy=function(e){return $i.prototype.copy.call(this,e),this.defines={PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearCoat=e.clearCoat,this.clearCoatRoughness=e.clearCoatRoughness,this},tn.prototype=Object.create(V.prototype),tn.prototype.constructor=tn,tn.prototype.isMeshPhongMaterial=!0,tn.prototype.copy=function(e){return V.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},nn.prototype=Object.create(tn.prototype),nn.prototype.constructor=nn,nn.prototype.isMeshToonMaterial=!0,nn.prototype.copy=function(e){return tn.prototype.copy.call(this,e),this.gradientMap=e.gradientMap,this},rn.prototype=Object.create(V.prototype),rn.prototype.constructor=rn,rn.prototype.isMeshNormalMaterial=!0,rn.prototype.copy=function(e){return V.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},on.prototype=Object.create(V.prototype),on.prototype.constructor=on,on.prototype.isMeshLambertMaterial=!0,on.prototype.copy=function(e){return V.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},sn.prototype=Object.create(V.prototype),sn.prototype.constructor=sn,sn.prototype.isMeshMatcapMaterial=!0,sn.prototype.copy=function(e){return V.prototype.copy.call(this,e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},an.prototype=Object.create(Nt.prototype),an.prototype.constructor=an,an.prototype.isLineDashedMaterial=!0,an.prototype.copy=function(e){return Nt.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var Vo=Object.freeze({ShadowMaterial:Ji,SpriteMaterial:Rt,RawShaderMaterial:Ki,ShaderMaterial:W,PointsMaterial:jt,MeshPhysicalMaterial:en,MeshStandardMaterial:$i,MeshPhongMaterial:tn,MeshToonMaterial:nn,MeshNormalMaterial:rn,MeshLambertMaterial:on,MeshDepthMaterial:pt,MeshDistanceMaterial:ft,MeshBasicMaterial:Y,MeshMatcapMaterial:sn,LineDashedMaterial:an,LineBasicMaterial:Nt,Material:V}),Wo={arraySlice:function(e,t,i){return Wo.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==i?i:e.length)):e.slice(t,i)},convertArray:function(e,t,i){return!e||!i&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,i=Array(t),n=0;n!==t;++n)i[n]=n;return i.sort((function(t,i){return e[t]-e[i]})),i},sortedArray:function(e,t,i){for(var n=e.length,r=new e.constructor(n),o=0,s=0;s!==n;++o)for(var a=i[o]*t,l=0;l!==t;++l)r[s++]=e[a+l];return r},flattenJSON:function(e,t,i,n){for(var r=1,o=e[0];void 0!==o&&void 0===o[n];)o=e[r++];if(void 0!==o){var s=o[n];if(void 0!==s)if(Array.isArray(s))do{void 0!==(s=o[n])&&(t.push(o.time),i.push.apply(i,s)),o=e[r++]}while(void 0!==o);else if(void 0!==s.toArray)do{void 0!==(s=o[n])&&(t.push(o.time),s.toArray(i,i.length)),o=e[r++]}while(void 0!==o);else do{void 0!==(s=o[n])&&(t.push(o.time),i.push(s)),o=e[r++]}while(void 0!==o)}}};Object.assign(ln.prototype,{evaluate:function(e){var t=this.parameterPositions,i=this._cachedIndex,n=t[i],r=t[i-1];e:{t:{i:{n:if(!(e=r)break e;for(e<(o=t[1])&&(i=2,r=o),o=i-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,e,n);if(i===o)break;if(n=r,e>=(r=t[--i-1]))break t}n=i,i=0}for(;i>>1]?n=r:i=r+1;if(n=t[i],void 0===(r=t[i-1]))return this._cachedIndex=0,this.beforeStart_(0,e,n);if(void 0===n)return this._cachedIndex=i=t.length,this.afterEnd_(i-1,r,e)}this._cachedIndex=i,this.intervalChanged_(i,r,n)}return this.interpolate_(i,r,e,n)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){var t=this.resultBuffer,i=this.sampleValues,n=this.valueSize;e*=n;for(var r=0;r!==n;++r)t[r]=i[e+r];return t},interpolate_:function(){throw Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(ln.prototype,{beforeStart_:ln.prototype.copySampleValue_,afterEnd_:ln.prototype.copySampleValue_}),cn.prototype=Object.assign(Object.create(ln.prototype),{constructor:cn,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(e,t,i){var n=this.parameterPositions,r=e-2,o=e+1,s=n[r],a=n[o];if(void 0===s)switch(this.getSettings_().endingStart){case 2401:r=e,s=2*t-i;break;case 2402:s=t+n[r=n.length-2]-n[r+1];break;default:r=e,s=i}if(void 0===a)switch(this.getSettings_().endingEnd){case 2401:o=e,a=2*i-t;break;case 2402:o=1,a=i+n[1]-n[0];break;default:o=e-1,a=t}e=.5*(i-t),n=this.valueSize,this._weightPrev=e/(t-s),this._weightNext=e/(a-i),this._offsetPrev=r*n,this._offsetNext=o*n},interpolate_:function(e,t,i,n){var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=(e*=s)-s,l=this._offsetPrev,c=this._offsetNext,u=this._weightPrev,h=this._weightNext,d=(i-t)/(n-t);for(t=-u*(n=(i=d*d)*d)+2*u*i-u*d,u=(1+u)*n+(-1.5-2*u)*i+(-.5+u)*d+1,d=(-1-h)*n+(1.5+h)*i+.5*d,h=h*n-h*i,i=0;i!==s;++i)r[i]=t*o[l+i]+u*o[a+i]+d*o[e+i]+h*o[c+i];return r}}),un.prototype=Object.assign(Object.create(ln.prototype),{constructor:un,interpolate_:function(e,t,i,n){var r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=(e*=s)-s;for(i=1-(t=(i-t)/(n-t)),n=0;n!==s;++n)r[n]=o[a+n]*i+o[e+n]*t;return r}}),hn.prototype=Object.assign(Object.create(ln.prototype),{constructor:hn,interpolate_:function(e){return this.copySampleValue_(e-1)}}),Object.assign(dn,{toJSON:function(e){var t=e.constructor;if(void 0!==t.toJSON)t=t.toJSON(e);else{t={name:e.name,times:Wo.convertArray(e.times,Array),values:Wo.convertArray(e.values,Array)};var i=e.getInterpolation();i!==e.DefaultInterpolation&&(t.interpolation=i)}return t.type=e.ValueTypeName,t}}),Object.assign(dn.prototype,{constructor:dn,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(e){return new hn(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new un(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new cn(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){switch(e){case 2300:var t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){if(t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name,void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,i=0,n=t.length;i!==n;++i)t[i]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,i=0,n=t.length;i!==n;++i)t[i]*=e;return this},trim:function(e,t){for(var i=this.times,n=i.length,r=0,o=n-1;r!==n&&i[r]t;)--o;return++o,0===r&&o===n||(r>=o&&(r=(o=Math.max(o,1))-1),e=this.getValueSize(),this.times=Wo.arraySlice(i,r,o),this.values=Wo.arraySlice(this.values,r*e,o*e)),this},validate:function(){var e=!0,t=this.getValueSize();0!=t-Math.floor(t)&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var i=this.times;t=this.values;var n=i.length;0===n&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var r=null,o=0;o!==n;o++){var s=i[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(null!==r&&r>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,r),e=!1;break}r=s}if(void 0!==t&&Wo.isTypedArray(t))for(o=0,i=t.length;o!==i;++o)if(n=t[o],isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,n),e=!1;break}return e},optimize:function(){for(var e=this.times,t=this.values,i=this.getValueSize(),n=2302===this.getInterpolation(),r=1,o=e.length-1,s=1;s(r=i[e=Math.floor(o+(s-o)/2)]-t))o=e+1;else{if(!(0t&&(t=0),1<(e+=1e-4)&&(e=1),t=this.getPoint(t),this.getPoint(e).clone().sub(t).normalize()},getTangentAt:function(e){return e=this.getUtoTmapping(e),this.getTangent(e)},computeFrenetFrames:function(e,t){var i,n=new r,o=[],s=[],a=[],l=new r,c=new g;for(i=0;i<=e;i++){var u=i/e;o[i]=this.getTangentAt(u),o[i].normalize()}s[0]=new r,a[0]=new r,i=Number.MAX_VALUE,u=Math.abs(o[0].x);var h=Math.abs(o[0].y),d=Math.abs(o[0].z);for(u<=i&&(i=u,n.set(1,0,0)),h<=i&&(i=h,n.set(0,1,0)),d<=i&&n.set(0,0,1),l.crossVectors(o[0],n).normalize(),s[0].crossVectors(o[0],l),a[0].crossVectors(o[0],s[0]),i=1;i<=e;i++)s[i]=s[i-1].clone(),a[i]=a[i-1].clone(),l.crossVectors(o[i-1],o[i]),l.length()>Number.EPSILON&&(l.normalize(),n=Math.acos(ho.clamp(o[i-1].dot(o[i]),-1,1)),s[i].applyMatrix4(c.makeRotationAxis(l,n))),a[i].crossVectors(o[i],s[i]);if(!0===t)for(n=Math.acos(ho.clamp(s[0].dot(s[e]),-1,1)),n/=e,0r;)r+=n;for(;r>n;)r-=n;r(o=Math.pow(a.distanceToSquared(l),c))&&(o=1),1e-4>n&&(n=o),1e-4>(c=Math.pow(l.distanceToSquared(i),c))&&(c=o),Qo.initNonuniformCatmullRom(s.x,a.x,l.x,i.x,n,o,c),Jo.initNonuniformCatmullRom(s.y,a.y,l.y,i.y,n,o,c),Ko.initNonuniformCatmullRom(s.z,a.z,l.z,i.z,n,o,c)}else"catmullrom"===this.curveType&&(Qo.initCatmullRom(s.x,a.x,l.x,i.x,this.tension),Jo.initCatmullRom(s.y,a.y,l.y,i.y,this.tension),Ko.initCatmullRom(s.z,a.z,l.z,i.z,this.tension));return t.set(Qo.calc(e),Jo.calc(e),Ko.calc(e)),t},Dn.prototype.copy=function(e){Pn.prototype.copy.call(this,e),this.points=[];for(var t=0,i=e.points.length;tn.length-2?n.length-1:e+1];return n=n[e>n.length-3?n.length-1:e+2],t.set(kn(r,o.x,s.x,a.x,n.x),kn(r,o.y,s.y,a.y,n.y)),t},Vn.prototype.copy=function(e){Pn.prototype.copy.call(this,e),this.points=[];for(var t=0,i=e.points.length;t=t)return t=i[e]-t,i=(e=this.curves[e]).getLength(),e.getPointAt(0===i?0:1-t/i);e++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.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 e=[],t=0,i=0,n=this.curves.length;iNumber.EPSILON){if(0>c&&(s=t[o],l=-l,a=t[r],c=-c),!(e.ya.y))if(e.y===s.y){if(e.x===s.x)return!0}else{if(0===(r=c*(e.x-s.x)-l*(e.y-s.y)))return!0;0>r||(n=!n)}}else if(e.y===s.y&&(a.x<=e.x&&e.x<=s.x||s.x<=e.x&&e.x<=a.x))return!0}return n}var r=Uo.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===t)return i(o);if(t=[],1===o.length){var s=o[0],a=new Xn;return a.curves=s.curves,t.push(a),t}var l=!r(o[0].getPoints());l=e?!l:l,a=[];var c=[],u=[],h=0;c[h]=void 0,u[h]=[];for(var d=0,p=o.length;du.opacity&&(u.transparent=!0),n.setTextures(c),n.parse(u)}}()});var os,ss,as,ls={getContext:function(){return void 0===os&&(os=new(window.AudioContext||window.webkitAudioContext)),os},setContext:function(e){os=e}};Object.assign(mr.prototype,{load:function(e,t,i,n){var r=new En(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.load(e,(function(e){e=e.slice(0),ls.getContext().decodeAudioData(e,(function(e){t(e)}))}),i,n)},setPath:function(e){return this.path=e,this}}),Object.assign(gr.prototype,{isSphericalHarmonics3:!0,set:function(e){for(var t=0;9>t;t++)this.coefficients[t].copy(e[t]);return this},zero:function(){for(var e=0;9>e;e++)this.coefficients[e].set(0,0,0);return this},getAt:function(e,t){var i=e.x,n=e.y;e=e.z;var r=this.coefficients;return t=.282095*r[0],t+=.488603*r[1]*n,t+=.488603*r[2]*e,t+=.488603*r[3]*i,t+=1.092548*r[4]*i*n,t+=1.092548*r[5]*n*e,t+=.315392*r[6]*(3*e*e-1),(t+=1.092548*r[7]*i*e)+.546274*r[8]*(i*i-n*n)},getIrradianceAt:function(e,t){var i=e.x,n=e.y;e=e.z;var r=this.coefficients;return t=.886227*r[0],t+=1.023328*r[1]*n,t+=1.023328*r[2]*e,t+=1.023328*r[3]*i,t+=.858086*r[4]*i*n,t+=.858086*r[5]*n*e,t+=r[6]*(.743125*e*e-.247708),(t+=.858086*r[7]*i*e)+.429043*r[8]*(i*i-n*n)},add:function(e){for(var t=0;9>t;t++)this.coefficients[t].add(e.coefficients[t]);return this},scale:function(e){for(var t=0;9>t;t++)this.coefficients[t].multiplyScalar(e);return this},lerp:function(e,t){for(var i=0;9>i;i++)this.coefficients[i].lerp(e.coefficients[i],t);return this},equals:function(e){for(var t=0;9>t;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0},copy:function(e){return this.set(e.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(e){for(var t=this.coefficients,i=0;9>i;i++)t[i].fromArray(e,3*i);return this},toArray:function(){for(var e=[],t=this.coefficients,i=0;9>i;i++)t[i].toArray(e,3*i);return e}}),Object.assign(gr,{getBasisAt:function(e,t){var i=e.x,n=e.y;e=e.z,t[0]=.282095,t[1]=.488603*n,t[2]=.488603*e,t[3]=.488603*i,t[4]=1.092548*i*n,t[5]=1.092548*n*e,t[6]=.315392*(3*e*e-1),t[7]=1.092548*i*e,t[8]=.546274*(i*i-n*n)}}),vr.prototype=Object.assign(Object.create(Yn.prototype),{constructor:vr,isLightProbe:!0,copy:function(e){return Yn.prototype.copy.call(this,e),this.sh.copy(e.sh),this.intensity=e.intensity,this},toJSON:function(e){return Yn.prototype.toJSON.call(this,e)}}),yr.prototype=Object.assign(Object.create(vr.prototype),{constructor:yr,isHemisphereLightProbe:!0,copy:function(e){return vr.prototype.copy.call(this,e),this},toJSON:function(e){return vr.prototype.toJSON.call(this,e)}}),br.prototype=Object.assign(Object.create(vr.prototype),{constructor:br,isAmbientLightProbe:!0,copy:function(e){return vr.prototype.copy.call(this,e),this},toJSON:function(e){return vr.prototype.toJSON.call(this,e)}}),Object.assign(xr.prototype,{update:function(){var e,t,i,n,r,o,s,a,l=new g,c=new g;return function(u){if(e!==this||t!==u.focus||i!==u.fov||n!==u.aspect*this.aspect||r!==u.near||o!==u.far||s!==u.zoom||a!==this.eyeSep){e=this,t=u.focus,i=u.fov,n=u.aspect*this.aspect,r=u.near,o=u.far,s=u.zoom;var h=u.projectionMatrix.clone(),d=(a=this.eyeSep/2)*r/t,p=r*Math.tan(ho.DEG2RAD*i*.5)/s;c.elements[12]=-a,l.elements[12]=a;var f=-p*n+d,m=p*n+d;h.elements[0]=2*r/(m-f),h.elements[8]=(m+f)/(m-f),this.cameraL.projectionMatrix.copy(h),f=-p*n-d,m=p*n-d,h.elements[0]=2*r/(m-f),h.elements[8]=(m+f)/(m-f),this.cameraR.projectionMatrix.copy(h)}this.cameraL.matrixWorld.copy(u.matrixWorld).multiply(c),this.cameraR.matrixWorld.copy(u.matrixWorld).multiply(l)}}()}),wr.prototype=Object.create(S.prototype),wr.prototype.constructor=wr,Object.assign(_r.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(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}),Er.prototype=Object.assign(Object.create(S.prototype),{constructor:Er,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this},updateMatrixWorld:function(){var e=new r,t=new n,i=new r,o=new r,s=new _r;return function(n){S.prototype.updateMatrixWorld.call(this,n),n=this.context.listener;var r=this.up;if(this.timeDelta=s.getDelta(),this.matrixWorld.decompose(e,t,i),o.set(0,0,-1).applyQuaternion(t),n.positionX){var a=this.context.currentTime+this.timeDelta;n.positionX.linearRampToValueAtTime(e.x,a),n.positionY.linearRampToValueAtTime(e.y,a),n.positionZ.linearRampToValueAtTime(e.z,a),n.forwardX.linearRampToValueAtTime(o.x,a),n.forwardY.linearRampToValueAtTime(o.y,a),n.forwardZ.linearRampToValueAtTime(o.z,a),n.upX.linearRampToValueAtTime(r.x,a),n.upY.linearRampToValueAtTime(r.y,a),n.upZ.linearRampToValueAtTime(r.z,a)}else n.setPosition(e.x,e.y,e.z),n.setOrientation(o.x,o.y,o.z,r.x,r.y,r.z)}}()}),Mr.prototype=Object.assign(Object.create(S.prototype),{constructor:Mr,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setMediaElementSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0===this.isPlaying)console.warn("THREE.Audio: Audio is already playing.");else{if(!1!==this.hasPlaybackControl){var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.onended=this.onEnded.bind(this),this.startTime=this.context.currentTime,e.start(this.startTime,this.offset),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this.source.stop(),this.source.onended=null,this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.source.onended=null,this.offset=0,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(0n&&this._mixBufferRegion(i,e,3*t,1-n,t),n=t;for(var o=t+t;n!==o;++n)if(i[n]!==i[n+t]){r.setValue(i,e);break}},saveOriginalState:function(){var e=this.buffer,t=this.valueSize,i=3*t;this.binding.getValue(e,i);for(var n=t;n!==i;++n)e[n]=e[i+n%t];this.cumulativeWeight=0},restoreOriginalState:function(){this.binding.setValue(this.buffer,3*this.valueSize)},_select:function(e,t,i,n,r){if(.5<=n)for(n=0;n!==r;++n)e[t+n]=e[i+n]},_slerp:function(e,t,i,r){n.slerpFlat(e,t,e,t,e,i,r)},_lerp:function(e,t,i,n,r){for(var o=1-n,s=0;s!==r;++s){var a=t+s;e[a]=e[a]*o+e[i+s]*n}}}),Object.assign(Cr.prototype,{getValue:function(e,t){this.bind();var i=this._bindings[this._targetGroup.nCachedObjects_];void 0!==i&&i.getValue(e,t)},setValue:function(e,t){for(var i=this._bindings,n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}}),Object.assign(Lr,{Composite:Cr,create:function(e,t,i){return e&&e.isAnimationObjectGroup?new Lr.Composite(e,t,i):new Lr(e,t,i)},sanitizeNodeName:function(){var e=/[\[\]\.:\/]/g;return function(t){return t.replace(/\s/g,"_").replace(e,"")}}(),parseTrackName:function(){var e="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",t=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]");e=/(WCOD+)?/.source.replace("WCOD",e);var i=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),n=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),r=new RegExp("^"+t+e+i+n+"$"),o=["material","materials","bones"];return function(e){var t=r.exec(e);if(!t)throw Error("PropertyBinding: Cannot parse trackName: "+e);var i=(t={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]}).nodeName&&t.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){var n=t.nodeName.substring(i+1);-1!==o.indexOf(n)&&(t.nodeName=t.nodeName.substring(0,i),t.objectName=n)}if(null===t.propertyName||0===t.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+e);return t}}(),findNode:function(e,t){if(!t||""===t||"root"===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var i=e.skeleton.getBoneByName(t);if(void 0!==i)return i}if(e.children){var n=function(e){for(var i=0;i=t){var u=t++,h=e[u];for(i[h.uuid]=c,e[c]=h,i[l]=u,e[u]=a,a=0,l=r;a!==l;++a){var d=(h=n[a])[c];h[c]=h[u],h[u]=d}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,i=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,o=r.length,s=0,a=arguments.length;s!==a;++s){var l=arguments[s].uuid,c=n[l];if(void 0!==c)if(delete n[l],c(t=(e-r)*i)||0===i)return;this._startTime=null,t*=i}if(t*=this._updateTimeScale(e),i=this._updateTime(t),0<(e=this._updateWeight(e))){t=this._interpolants,r=this._propertyBindings;for(var o=0,s=t.length;o!==s;++o)t[o].evaluate(i),r[o].accumulate(n,e)}}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var i=this._weightInterpolant;if(null!==i){var n=i.evaluate(e)[0];t*=n,e>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var i=this._timeScaleInterpolant;if(null!==i)t*=i.evaluate(e)[0],e>i.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t},_updateTime:function(e){var t=this.time+e,i=this._clip.duration,n=this.loop,r=this._loopCount,o=2202===n;if(0===e)return-1===r?t:o&&1==(1&r)?i-t:t;if(2200===n)e:{if(-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1)),t>=i)t=i;else{if(!(0>t)){this.time=t;break e}t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:0>e?-1:1})}else{if(-1===r&&(0<=e?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),t>=i||0>t){t-=i*(n=Math.floor(t/i)),r+=Math.abs(n);var s=this.repetitions-r;0>=s?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=t=0e,this._setEndings(e,!e,o)):this._setEndings(!1,!1,o),this._loopCount=r,this.time=t,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n}))}else this.time=t;if(o&&1==(1&r))return i-t}return t},_setEndings:function(e,t,i){var n=this._interpolantSettings;i?(n.endingStart=2401,n.endingEnd=2401):(n.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,n.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(e,t,i){var n=this._mixer,r=n.time,o=this._weightInterpolant;return null===o&&(this._weightInterpolant=o=n._lendControlInterpolant()),n=o.parameterPositions,o=o.sampleValues,n[0]=r,o[0]=t,n[1]=r+e,o[1]=i,this}}),Rr.prototype=Object.assign(Object.create(t.prototype),{constructor:Rr,_bindAction:function(e,t){var i=e._localRoot||this._root,n=e._clip.tracks,r=n.length,o=e._propertyBindings;e=e._interpolants;var s=i.uuid,a=this._bindingsByRootAndName,l=a[s];for(void 0===l&&(l={},a[s]=l),a=0;a!==r;++a){var c=n[a],u=c.name,h=l[u];if(void 0===h){if(void 0!==(h=o[a])){null===h._cacheIndex&&(++h.referenceCount,this._addInactiveBinding(h,s,u));continue}++(h=new Ar(Lr.create(i,u,t&&t._propertyBindings[a].binding.parsedPath),c.ValueTypeName,c.getValueSize())).referenceCount,this._addInactiveBinding(h,s,u)}o[a]=h,e[a].resultBuffer=h.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,i=e._clip.uuid,n=this._actionsByClip[i];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,i,t)}for(i=0,n=(t=e._propertyBindings).length;i!==n;++i){var r=t[i];0==r.useCount++&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,i=0,n=t.length;i!==n;++i){var r=t[i];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){return null!==(e=e._cacheIndex)&&ethis.max.x||e.ythis.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new i),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new i),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new i;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Object.assign(Ur.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new r),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new r),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new r),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(){var e=new r,t=new r;return function(i,n){return e.subVectors(i,this.start),t.subVectors(this.end,this.start),i=t.dot(t),i=t.dot(e)/i,n&&(i=ho.clamp(i,0,1)),i}}(),closestPointToPoint:function(e,t,i){return e=this.closestPointToPointParameter(e,t),void 0===i&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),i=new r),this.delta(i).multiplyScalar(e).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),jr.prototype=Object.create(S.prototype),jr.prototype.constructor=jr,jr.prototype.isImmediateRenderObject=!0,Gr.prototype=Object.create(Ht.prototype),Gr.prototype.constructor=Gr,Gr.prototype.update=function(){var e=new r,t=new r,i=new o;return function(){var n=["a","b","c"];this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);var r=this.object.matrixWorld,o=this.geometry.attributes.position,s=this.object.geometry;if(s&&s.isGeometry)for(var a=s.vertices,l=s.faces,c=s=0,u=l.length;cMath.abs(t)&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=0>t?1:0,this.lookAt(this.plane.normal),S.prototype.updateMatrixWorld.call(this,e)},oo.prototype=Object.create(S.prototype),oo.prototype.constructor=oo,oo.prototype.setDirection=function(){var e,t=new r;return function(i){.99999i.y?this.quaternion.set(1,0,0,0):(t.set(i.z,0,-i.x).normalize(),e=Math.acos(i.y),this.quaternion.setFromAxisAngle(t,e))}}(),oo.prototype.setLength=function(e,t,i){void 0===t&&(t=.2*e),void 0===i&&(i=.2*t),this.line.scale.set(1,Math.max(0,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()},oo.prototype.setColor=function(e){this.line.material.color.copy(e),this.cone.material.color.copy(e)},oo.prototype.copy=function(e){return S.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},oo.prototype.clone=function(){return(new this.constructor).copy(this)},so.prototype=Object.create(Ht.prototype),so.prototype.constructor=so,Pn.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Pn.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(Wn.prototype,{createPointsGeometry:function(e){return console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead."),e=this.getPoints(e),this.createGeometry(e)},createSpacedPointsGeometry:function(e){return console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead."),e=this.getSpacedPoints(e),this.createGeometry(e)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new T,i=0,n=e.length;i0,n._pointerEvent=Boolean(window.PointerEvent),n._addEventListeners(),n}n(r,e);var o=r.prototype;return o.next=function(){this._isSliding||this._slide("next")},o.nextWhenVisible=function(){!document.hidden&&m(this._element)&&this.next()},o.prev=function(){this._isSliding||this._slide("prev")},o.pause=function(e){e||(this._isPaused=!0),W.findOne(".carousel-item-next, .carousel-item-prev",this._element)&&(h(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},o.cycle=function(e){e||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config&&this._config.interval&&!this._isPaused&&(this._updateInterval(),this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},o.to=function(e){var t=this;this._activeElement=W.findOne(".active.carousel-item",this._element);var i=this._getItemIndex(this._activeElement);if(!(e>this._items.length-1||e<0))if(this._isSliding)B.one(this._element,"slid.bs.carousel",(function(){return t.to(e)}));else{if(i===e)return this.pause(),void this.cycle();var n=e>i?"next":"prev";this._slide(n,this._items[e])}},o.dispose=function(){e.prototype.dispose.call(this),B.off(this._element,".bs.carousel"),this._items=null,this._config=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},o._getConfig=function(e){return e=i({},X,e),f(q,e,Y),e},o._handleSwipe=function(){var e=Math.abs(this.touchDeltaX);if(!(e<=40)){var t=e/this.touchDeltaX;this.touchDeltaX=0,t>0&&this.prev(),t<0&&this.next()}},o._addEventListeners=function(){var e=this;this._config.keyboard&&B.on(this._element,"keydown.bs.carousel",(function(t){return e._keydown(t)})),"hover"===this._config.pause&&(B.on(this._element,"mouseenter.bs.carousel",(function(t){return e.pause(t)})),B.on(this._element,"mouseleave.bs.carousel",(function(t){return e.cycle(t)}))),this._config.touch&&this._touchSupported&&this._addTouchEventListeners()},o._addTouchEventListeners=function(){var e=this,t=function(t){e._pointerEvent&&Z[t.pointerType.toUpperCase()]?e.touchStartX=t.clientX:e._pointerEvent||(e.touchStartX=t.touches[0].clientX)},i=function(t){e._pointerEvent&&Z[t.pointerType.toUpperCase()]&&(e.touchDeltaX=t.clientX-e.touchStartX),e._handleSwipe(),"hover"===e._config.pause&&(e.pause(),e.touchTimeout&&clearTimeout(e.touchTimeout),e.touchTimeout=setTimeout((function(t){return e.cycle(t)}),500+e._config.interval))};W.find(".carousel-item img",this._element).forEach((function(e){B.on(e,"dragstart.bs.carousel",(function(e){return e.preventDefault()}))})),this._pointerEvent?(B.on(this._element,"pointerdown.bs.carousel",(function(e){return t(e)})),B.on(this._element,"pointerup.bs.carousel",(function(e){return i(e)})),this._element.classList.add("pointer-event")):(B.on(this._element,"touchstart.bs.carousel",(function(e){return t(e)})),B.on(this._element,"touchmove.bs.carousel",(function(t){return function(t){t.touches&&t.touches.length>1?e.touchDeltaX=0:e.touchDeltaX=t.touches[0].clientX-e.touchStartX}(t)})),B.on(this._element,"touchend.bs.carousel",(function(e){return i(e)})))},o._keydown=function(e){if(!/input|textarea/i.test(e.target.tagName))switch(e.key){case"ArrowLeft":e.preventDefault(),this.prev();break;case"ArrowRight":e.preventDefault(),this.next()}},o._getItemIndex=function(e){return this._items=e&&e.parentNode?W.find(".carousel-item",e.parentNode):[],this._items.indexOf(e)},o._getItemByDirection=function(e,t){var i="next"===e,n="prev"===e,r=this._getItemIndex(t),o=this._items.length-1;if((n&&0===r||i&&r===o)&&!this._config.wrap)return t;var s=(r+("prev"===e?-1:1))%this._items.length;return-1===s?this._items[this._items.length-1]:this._items[s]},o._triggerSlideEvent=function(e,t){var i=this._getItemIndex(e),n=this._getItemIndex(W.findOne(".active.carousel-item",this._element));return B.trigger(this._element,"slide.bs.carousel",{relatedTarget:e,direction:t,from:n,to:i})},o._setActiveIndicatorElement=function(e){if(this._indicatorsElement){for(var t=W.find(".active",this._indicatorsElement),i=0;i0)for(var n=0;n=0}function be(e){return((he(e)?e.ownerDocument:e.document)||window.document).documentElement}function xe(e){return"html"===ce(e)?e:e.assignedSlot||e.parentNode||e.host||be(e)}function we(e){if(!de(e)||"fixed"===ve(e).position)return null;var t=e.offsetParent;if(t){var i=be(t);if("body"===ce(t)&&"static"===ve(t).position&&"static"!==ve(i).position)return i}return t}function _e(e){for(var t=ue(e),i=we(e);i&&ye(i)&&"static"===ve(i).position;)i=we(i);return i&&"body"===ce(i)&&"static"===ve(i).position?t:i||function(e){for(var t=xe(e);de(t)&&["html","body"].indexOf(ce(t))<0;){var i=ve(t);if("none"!==i.transform||"none"!==i.perspective||i.willChange&&"auto"!==i.willChange)return t;t=t.parentNode}return null}(e)||t}function Ee(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Me(e,t,i){return Math.max(e,Math.min(t,i))}function Se(e){return Object.assign(Object.assign({},{top:0,right:0,bottom:0,left:0}),e)}function Te(e,t){return t.reduce((function(t,i){return t[i]=e,t}),{})}var Ae={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,n=e.name,r=i.elements.arrow,o=i.modifiersData.popperOffsets,s=fe(i.placement),a=Ee(s),l=[re,ne].indexOf(s)>=0?"height":"width";if(r&&o){var c=i.modifiersData[n+"#persistent"].padding,u=me(r),h="y"===a?te:re,d="y"===a?ie:ne,p=i.rects.reference[l]+i.rects.reference[a]-o[a]-i.rects.popper[l],f=o[a]-i.rects.reference[a],m=_e(r),g=m?"y"===a?m.clientHeight||0:m.clientWidth||0:0,v=p/2-f/2,y=c[h],b=g-u[l]-c[d],x=g/2-u[l]/2+v,w=Me(y,x,b),_=a;i.modifiersData[n]=((t={})[_]=w,t.centerOffset=w-x,t)}},effect:function(e){var t=e.state,i=e.options,n=e.name,r=i.element,o=void 0===r?"[data-popper-arrow]":r,s=i.padding,a=void 0===s?0:s;null!=o&&("string"!=typeof o||(o=t.elements.popper.querySelector(o)))&&ge(t.elements.popper,o)&&(t.elements.arrow=o,t.modifiersData[n+"#persistent"]={padding:Se("number"!=typeof a?a:Te(a,oe))})},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},Ce={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Le(e){var t,i=e.popper,n=e.popperRect,r=e.placement,o=e.offsets,s=e.position,a=e.gpuAcceleration,l=e.adaptive,c=function(e){var t=e.x,i=e.y,n=window.devicePixelRatio||1;return{x:Math.round(t*n)/n||0,y:Math.round(i*n)/n||0}}(o),u=c.x,h=c.y,d=o.hasOwnProperty("x"),p=o.hasOwnProperty("y"),f=re,m=te,g=window;if(l){var v=_e(i);v===ue(i)&&(v=be(i)),r===te&&(m=ie,h-=v.clientHeight-n.height,h*=a?1:-1),r===re&&(f=ne,u-=v.clientWidth-n.width,u*=a?1:-1)}var y,b=Object.assign({position:s},l&&Ce);return a?Object.assign(Object.assign({},b),{},((y={})[m]=p?"0":"",y[f]=d?"0":"",y.transform=(g.devicePixelRatio||1)<2?"translate("+u+"px, "+h+"px)":"translate3d("+u+"px, "+h+"px, 0)",y)):Object.assign(Object.assign({},b),{},((t={})[m]=p?h+"px":"",t[f]=d?u+"px":"",t.transform="",t))}var Pe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,i=e.options,n=i.gpuAcceleration,r=void 0===n||n,o=i.adaptive,s=void 0===o||o,a={placement:fe(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign(Object.assign({},t.styles.popper),Le(Object.assign(Object.assign({},a),{},{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign(Object.assign({},t.styles.arrow),Le(Object.assign(Object.assign({},a),{},{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1})))),t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-placement":t.placement})},data:{}},Ie={passive:!0},Re={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,i=e.instance,n=e.options,r=n.scroll,o=void 0===r||r,s=n.resize,a=void 0===s||s,l=ue(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach((function(e){e.addEventListener("scroll",i.update,Ie)})),a&&l.addEventListener("resize",i.update,Ie),function(){o&&c.forEach((function(e){e.removeEventListener("scroll",i.update,Ie)})),a&&l.removeEventListener("resize",i.update,Ie)}},data:{}},Oe={left:"right",right:"left",bottom:"top",top:"bottom"};function De(e){return e.replace(/left|right|bottom|top/g,(function(e){return Oe[e]}))}var ke={start:"end",end:"start"};function ze(e){return e.replace(/start|end/g,(function(e){return ke[e]}))}function Be(e){var t=e.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left,x:t.left,y:t.top}}function Ne(e){var t=ue(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Fe(e){return Be(be(e)).left+Ne(e).scrollLeft}function He(e){var t=ve(e),i=t.overflow,n=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function Ue(e,t){void 0===t&&(t=[]);var i=function e(t){return["html","body","#document"].indexOf(ce(t))>=0?t.ownerDocument.body:de(t)&&He(t)?t:e(xe(t))}(e),n="body"===ce(i),r=ue(i),o=n?[r].concat(r.visualViewport||[],He(i)?i:[]):i,s=t.concat(o);return n?s:s.concat(Ue(xe(o)))}function je(e){return Object.assign(Object.assign({},e),{},{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ge(e,t){return"viewport"===t?je(function(e){var t=ue(e),i=be(e),n=t.visualViewport,r=i.clientWidth,o=i.clientHeight,s=0,a=0;return n&&(r=n.width,o=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=n.offsetLeft,a=n.offsetTop)),{width:r,height:o,x:s+Fe(e),y:a}}(e)):de(t)?function(e){var t=Be(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):je(function(e){var t=be(e),i=Ne(e),n=e.ownerDocument.body,r=Math.max(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=Math.max(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),s=-i.scrollLeft+Fe(e),a=-i.scrollTop;return"rtl"===ve(n||t).direction&&(s+=Math.max(t.clientWidth,n?n.clientWidth:0)-r),{width:r,height:o,x:s,y:a}}(be(e)))}function Ve(e){return e.split("-")[1]}function We(e){var t,i=e.reference,n=e.element,r=e.placement,o=r?fe(r):null,s=r?Ve(r):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case te:t={x:a,y:i.y-n.height};break;case ie:t={x:a,y:i.y+i.height};break;case ne:t={x:i.x+i.width,y:l};break;case re:t={x:i.x-n.width,y:l};break;default:t={x:i.x,y:i.y}}var c=o?Ee(o):null;if(null!=c){var u="y"===c?"height":"width";switch(s){case"start":t[c]=Math.floor(t[c])-Math.floor(i[u]/2-n[u]/2);break;case"end":t[c]=Math.floor(t[c])+Math.ceil(i[u]/2-n[u]/2)}}return t}function qe(e,t){void 0===t&&(t={});var i=t,n=i.placement,r=void 0===n?e.placement:n,o=i.boundary,s=void 0===o?"clippingParents":o,a=i.rootBoundary,l=void 0===a?"viewport":a,c=i.elementContext,u=void 0===c?"popper":c,h=i.altBoundary,d=void 0!==h&&h,p=i.padding,f=void 0===p?0:p,m=Se("number"!=typeof f?f:Te(f,oe)),g="popper"===u?"reference":"popper",v=e.elements.reference,y=e.rects.popper,b=e.elements[d?g:u],x=function(e,t,i){var n="clippingParents"===t?function(e){var t=Ue(xe(e)),i=["absolute","fixed"].indexOf(ve(e).position)>=0&&de(e)?_e(e):e;return he(i)?t.filter((function(e){return he(e)&&ge(e,i)&&"body"!==ce(e)})):[]}(e):[].concat(t),r=[].concat(n,[i]),o=r[0],s=r.reduce((function(t,i){var n=Ge(e,i);return t.top=Math.max(n.top,t.top),t.right=Math.min(n.right,t.right),t.bottom=Math.min(n.bottom,t.bottom),t.left=Math.max(n.left,t.left),t}),Ge(e,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}(he(b)?b:b.contextElement||be(e.elements.popper),s,l),w=Be(v),_=We({reference:w,element:y,strategy:"absolute",placement:r}),E=je(Object.assign(Object.assign({},y),_)),M="popper"===u?E:w,S={top:x.top-M.top+m.top,bottom:M.bottom-x.bottom+m.bottom,left:x.left-M.left+m.left,right:M.right-x.right+m.right},T=e.modifiersData.offset;if("popper"===u&&T){var A=T[r];Object.keys(S).forEach((function(e){var t=[ne,ie].indexOf(e)>=0?1:-1,i=[te,ie].indexOf(e)>=0?"y":"x";S[e]+=A[i]*t}))}return S}var Xe={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var r=i.mainAxis,o=void 0===r||r,s=i.altAxis,a=void 0===s||s,l=i.fallbackPlacements,c=i.padding,u=i.boundary,h=i.rootBoundary,d=i.altBoundary,p=i.flipVariations,f=void 0===p||p,m=i.allowedAutoPlacements,g=t.options.placement,v=fe(g),y=l||(v!==g&&f?function(e){if("auto"===fe(e))return[];var t=De(e);return[ze(e),t,ze(t)]}(g):[De(g)]),b=[g].concat(y).reduce((function(e,i){return e.concat("auto"===fe(i)?function(e,t){void 0===t&&(t={});var i=t,n=i.placement,r=i.boundary,o=i.rootBoundary,s=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?ae:l,u=Ve(n),h=u?a?se:se.filter((function(e){return Ve(e)===u})):oe,d=h.filter((function(e){return c.indexOf(e)>=0}));0===d.length&&(d=h);var p=d.reduce((function(t,i){return t[i]=qe(e,{placement:i,boundary:r,rootBoundary:o,padding:s})[fe(i)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:i,boundary:u,rootBoundary:h,padding:c,flipVariations:f,allowedAutoPlacements:m}):i)}),[]),x=t.rects.reference,w=t.rects.popper,_=new Map,E=!0,M=b[0],S=0;S=0,P=L?"width":"height",I=qe(t,{placement:T,boundary:u,rootBoundary:h,altBoundary:d,padding:c}),R=L?C?ne:re:C?ie:te;x[P]>w[P]&&(R=De(R));var O=De(R),D=[];if(o&&D.push(I[A]<=0),a&&D.push(I[R]<=0,I[O]<=0),D.every((function(e){return e}))){M=T,E=!1;break}_.set(T,D)}if(E)for(var k=function(e){var t=b.find((function(t){var i=_.get(t);if(i)return i.slice(0,e).every((function(e){return e}))}));if(t)return M=t,"break"},z=f?3:1;z>0&&"break"!==k(z);z--);t.placement!==M&&(t.modifiersData[n]._skip=!0,t.placement=M,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Ye(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function Ze(e){return[te,ne,ie,re].some((function(t){return e[t]>=0}))}var Qe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,n=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,s=qe(t,{elementContext:"reference"}),a=qe(t,{altBoundary:!0}),l=Ye(s,n),c=Ye(a,r,o),u=Ze(l),h=Ze(c);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:h},t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-reference-hidden":u,"data-popper-escaped":h})}},Je={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,n=e.name,r=i.offset,o=void 0===r?[0,0]:r,s=ae.reduce((function(e,i){return e[i]=function(e,t,i){var n=fe(e),r=[re,te].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign(Object.assign({},t),{},{placement:e})):i,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,[re,ne].indexOf(n)>=0?{x:a,y:s}:{x:s,y:a}}(i,t.rects,o),e}),{}),a=s[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=s}},Ke={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=We({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},$e={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name,r=i.mainAxis,o=void 0===r||r,s=i.altAxis,a=void 0!==s&&s,l=i.boundary,c=i.rootBoundary,u=i.altBoundary,h=i.padding,d=i.tether,p=void 0===d||d,f=i.tetherOffset,m=void 0===f?0:f,g=qe(t,{boundary:l,rootBoundary:c,padding:h,altBoundary:u}),v=fe(t.placement),y=Ve(t.placement),b=!y,x=Ee(v),w="x"===x?"y":"x",_=t.modifiersData.popperOffsets,E=t.rects.reference,M=t.rects.popper,S="function"==typeof m?m(Object.assign(Object.assign({},t.rects),{},{placement:t.placement})):m,T={x:0,y:0};if(_){if(o){var A="y"===x?te:re,C="y"===x?ie:ne,L="y"===x?"height":"width",P=_[x],I=_[x]+g[A],R=_[x]-g[C],O=p?-M[L]/2:0,D="start"===y?E[L]:M[L],k="start"===y?-M[L]:-E[L],z=t.elements.arrow,B=p&&z?me(z):{width:0,height:0},N=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},F=N[A],H=N[C],U=Me(0,E[L],B[L]),j=b?E[L]/2-O-U-F-S:D-U-F-S,G=b?-E[L]/2+O+U+H+S:k+U+H+S,V=t.elements.arrow&&_e(t.elements.arrow),W=V?"y"===x?V.clientTop||0:V.clientLeft||0:0,q=t.modifiersData.offset?t.modifiersData.offset[t.placement][x]:0,X=_[x]+j-q-W,Y=_[x]+G-q,Z=Me(p?Math.min(I,X):I,P,p?Math.max(R,Y):R);_[x]=Z,T[x]=Z-P}if(a){var Q="x"===x?te:re,J="x"===x?ie:ne,K=_[w],$=Me(K+g[Q],K,K-g[J]);_[w]=$,T[w]=$-K}t.modifiersData[n]=T}},requiresIfExists:["offset"]};function et(e,t,i){void 0===i&&(i=!1);var n,r,o=be(t),s=Be(e),a=de(t),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(a||!a&&!i)&&(("body"!==ce(t)||He(o))&&(l=(n=t)!==ue(n)&&de(n)?{scrollLeft:(r=n).scrollLeft,scrollTop:r.scrollTop}:Ne(n)),de(t)?((c=Be(t)).x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=Fe(o))),{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}var tt={placement:"bottom",modifiers:[],strategy:"absolute"};function it(){for(var e=arguments.length,t=new Array(e),i=0;i0&&o--,"ArrowDown"===e.key&&odocument.documentElement.clientHeight;t||(this._element.style.overflowY="hidden"),this._element.classList.add("modal-static");var i=u(this._dialog);B.off(this._element,"transitionend"),B.one(this._element,"transitionend",(function(){e._element.classList.remove("modal-static"),t||(B.one(e._element,"transitionend",(function(){e._element.style.overflowY=""})),p(e._element,i))})),p(this._element,i),this._element.focus()}},o._adjustDialog=function(){var e=this._element.scrollHeight>document.documentElement.clientHeight;(!this._isBodyOverflowing&&e&&!x||this._isBodyOverflowing&&!e&&x)&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),(this._isBodyOverflowing&&!e&&!x||!this._isBodyOverflowing&&e&&x)&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},o._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},o._checkScrollbar=function(){var e=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(e.left+e.right)
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",container:!1,fallbackPlacements:null,boundary:"clippingParents",customClass:"",sanitize:!0,sanitizeFn:null,allowList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},popperConfig:null},Rt={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},Ot=function(e){function r(t,i){var n;if(void 0===at)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");return(n=e.call(this,t)||this)._isEnabled=!0,n._timeout=0,n._hoverState="",n._activeTrigger={},n._popper=null,n.config=n._getConfig(i),n.tip=null,n._setListeners(),n}n(r,e);var o=r.prototype;return o.enable=function(){this._isEnabled=!0},o.disable=function(){this._isEnabled=!1},o.toggleEnabled=function(){this._isEnabled=!this._isEnabled},o.toggle=function(e){if(this._isEnabled)if(e){var t=this.constructor.DATA_KEY,i=E(e.delegateTarget,t);i||(i=new this.constructor(e.delegateTarget,this._getDelegateConfig()),_(e.delegateTarget,t,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(this.getTipElement().classList.contains("show"))return void this._leave(null,this);this._enter(null,this)}},o.dispose=function(){clearTimeout(this._timeout),B.off(this._element,this.constructor.EVENT_KEY),B.off(this._element.closest(".modal"),"hide.bs.modal",this._hideModalHandler),this.tip&&this.tip.parentNode.removeChild(this.tip),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.config=null,this.tip=null,e.prototype.dispose.call(this)},o.show=function(){var e=this;if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(this.isWithContent()&&this._isEnabled){var t=B.trigger(this._element,this.constructor.Event.SHOW),i=function e(t){if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){var i=t.getRootNode();return i instanceof ShadowRoot?i:null}return t instanceof ShadowRoot?t:t.parentNode?e(t.parentNode):null}(this._element),n=null===i?this._element.ownerDocument.documentElement.contains(this._element):i.contains(this._element);if(t.defaultPrevented||!n)return;var r=this.getTipElement(),o=s(this.constructor.NAME);r.setAttribute("id",o),this._element.setAttribute("aria-describedby",o),this.setContent(),this.config.animation&&r.classList.add("fade");var a="function"==typeof this.config.placement?this.config.placement.call(this,r,this._element):this.config.placement,l=this._getAttachment(a);this._addAttachmentClass(l);var c=this._getContainer();_(r,this.constructor.DATA_KEY,this),this._element.ownerDocument.documentElement.contains(this.tip)||c.appendChild(r),B.trigger(this._element,this.constructor.Event.INSERTED),this._popper=st(this._element,r,this._getPopperConfig(l)),r.classList.add("show");var h,d,f="function"==typeof this.config.customClass?this.config.customClass():this.config.customClass;f&&(h=r.classList).add.apply(h,f.split(" ")),"ontouchstart"in document.documentElement&&(d=[]).concat.apply(d,document.body.children).forEach((function(e){B.on(e,"mouseover",(function(){}))}));var m=function(){var t=e._hoverState;e._hoverState=null,B.trigger(e._element,e.constructor.Event.SHOWN),"out"===t&&e._leave(null,e)};if(this.tip.classList.contains("fade")){var g=u(this.tip);B.one(this.tip,"transitionend",m),p(this.tip,g)}else m()}},o.hide=function(){var e=this;if(this._popper){var t=this.getTipElement(),i=function(){"show"!==e._hoverState&&t.parentNode&&t.parentNode.removeChild(t),e._cleanTipClass(),e._element.removeAttribute("aria-describedby"),B.trigger(e._element,e.constructor.Event.HIDDEN),e._popper&&(e._popper.destroy(),e._popper=null)};if(!B.trigger(this._element,this.constructor.Event.HIDE).defaultPrevented){var n;if(t.classList.remove("show"),"ontouchstart"in document.documentElement&&(n=[]).concat.apply(n,document.body.children).forEach((function(e){return B.off(e,"mouseover",g)})),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,this.tip.classList.contains("fade")){var r=u(t);B.one(t,"transitionend",i),p(t,r)}else i();this._hoverState=""}}},o.update=function(){null!==this._popper&&this._popper.update()},o.isWithContent=function(){return Boolean(this.getTitle())},o.getTipElement=function(){if(this.tip)return this.tip;var e=document.createElement("div");return e.innerHTML=this.config.template,this.tip=e.children[0],this.tip},o.setContent=function(){var e=this.getTipElement();this.setElementContent(W.findOne(".tooltip-inner",e),this.getTitle()),e.classList.remove("fade","show")},o.setElementContent=function(e,t){if(null!==e)return"object"==typeof t&&d(t)?(t.jquery&&(t=t[0]),void(this.config.html?t.parentNode!==e&&(e.innerHTML="",e.appendChild(t)):e.textContent=t.textContent)):void(this.config.html?(this.config.sanitize&&(t=St(t,this.config.allowList,this.config.sanitizeFn)),e.innerHTML=t):e.textContent=t)},o.getTitle=function(){var e=this._element.getAttribute("data-bs-original-title");return e||(e="function"==typeof this.config.title?this.config.title.call(this._element):this.config.title),e},o.updateAttachment=function(e){return"right"===e?"end":"left"===e?"start":e},o._getPopperConfig=function(e){var t=this,n={name:"flip",options:{altBoundary:!0}};return this.config.fallbackPlacements&&(n.options.fallbackPlacements=this.config.fallbackPlacements),i({},{placement:e,modifiers:[n,{name:"preventOverflow",options:{rootBoundary:this.config.boundary}},{name:"arrow",options:{element:"."+this.constructor.NAME+"-arrow"}},{name:"onChange",enabled:!0,phase:"afterWrite",fn:function(e){return t._handlePopperPlacementChange(e)}}],onFirstUpdate:function(e){e.options.placement!==e.placement&&t._handlePopperPlacementChange(e)}},this.config.popperConfig)},o._addAttachmentClass=function(e){this.getTipElement().classList.add("bs-tooltip-"+this.updateAttachment(e))},o._getContainer=function(){return!1===this.config.container?document.body:d(this.config.container)?this.config.container:W.findOne(this.config.container)},o._getAttachment=function(e){return Pt[e.toUpperCase()]},o._setListeners=function(){var e=this;this.config.trigger.split(" ").forEach((function(t){if("click"===t)B.on(e._element,e.constructor.Event.CLICK,e.config.selector,(function(t){return e.toggle(t)}));else if("manual"!==t){var i="hover"===t?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,n="hover"===t?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;B.on(e._element,i,e.config.selector,(function(t){return e._enter(t)})),B.on(e._element,n,e.config.selector,(function(t){return e._leave(t)}))}})),this._hideModalHandler=function(){e._element&&e.hide()},B.on(this._element.closest(".modal"),"hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=i({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},o._fixTitle=function(){var e=this._element.getAttribute("title"),t=typeof this._element.getAttribute("data-bs-original-title");(e||"string"!==t)&&(this._element.setAttribute("data-bs-original-title",e||""),!e||this._element.getAttribute("aria-label")||this._element.textContent||this._element.setAttribute("aria-label",e),this._element.setAttribute("title",""))},o._enter=function(e,t){var i=this.constructor.DATA_KEY;(t=t||E(e.delegateTarget,i))||(t=new this.constructor(e.delegateTarget,this._getDelegateConfig()),_(e.delegateTarget,i,t)),e&&(t._activeTrigger["focusin"===e.type?"focus":"hover"]=!0),t.getTipElement().classList.contains("show")||"show"===t._hoverState?t._hoverState="show":(clearTimeout(t._timeout),t._hoverState="show",t.config.delay&&t.config.delay.show?t._timeout=setTimeout((function(){"show"===t._hoverState&&t.show()}),t.config.delay.show):t.show())},o._leave=function(e,t){var i=this.constructor.DATA_KEY;(t=t||E(e.delegateTarget,i))||(t=new this.constructor(e.delegateTarget,this._getDelegateConfig()),_(e.delegateTarget,i,t)),e&&(t._activeTrigger["focusout"===e.type?"focus":"hover"]=!1),t._isWithActiveTrigger()||(clearTimeout(t._timeout),t._hoverState="out",t.config.delay&&t.config.delay.hide?t._timeout=setTimeout((function(){"out"===t._hoverState&&t.hide()}),t.config.delay.hide):t.hide())},o._isWithActiveTrigger=function(){for(var e in this._activeTrigger)if(this._activeTrigger[e])return!0;return!1},o._getConfig=function(e){var t=V.getDataAttributes(this._element);return Object.keys(t).forEach((function(e){Ct.has(e)&&delete t[e]})),e&&"object"==typeof e.container&&e.container.jquery&&(e.container=e.container[0]),"number"==typeof(e=i({},this.constructor.Default,t,"object"==typeof e&&e?e:{})).delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),f(Tt,e,this.constructor.DefaultType),e.sanitize&&(e.template=St(e.template,e.allowList,e.sanitizeFn)),e},o._getDelegateConfig=function(){var e={};if(this.config)for(var t in this.config)this.constructor.Default[t]!==this.config[t]&&(e[t]=this.config[t]);return e},o._cleanTipClass=function(){var e=this.getTipElement(),t=e.getAttribute("class").match(At);null!==t&&t.length>0&&t.map((function(e){return e.trim()})).forEach((function(t){return e.classList.remove(t)}))},o._handlePopperPlacementChange=function(e){var t=e.state;t&&(this.tip=t.elements.popper,this._cleanTipClass(),this._addAttachmentClass(this._getAttachment(t.placement)))},r.jQueryInterface=function(e){return this.each((function(){var t=E(this,"bs.tooltip"),i="object"==typeof e&&e;if((t||!/dispose|hide/.test(e))&&(t||(t=new r(this,i)),"string"==typeof e)){if(void 0===t[e])throw new TypeError('No method named "'+e+'"');t[e]()}}))},t(r,null,[{key:"Default",get:function(){return It}},{key:"NAME",get:function(){return Tt}},{key:"DATA_KEY",get:function(){return"bs.tooltip"}},{key:"Event",get:function(){return Rt}},{key:"EVENT_KEY",get:function(){return".bs.tooltip"}},{key:"DefaultType",get:function(){return Lt}}]),r}(N);b((function(){var e=y();if(e){var t=e.fn[Tt];e.fn[Tt]=Ot.jQueryInterface,e.fn[Tt].Constructor=Ot,e.fn[Tt].noConflict=function(){return e.fn[Tt]=t,Ot.jQueryInterface}}}));var Dt="popover",kt=new RegExp("(^|\\s)bs-popover\\S+","g"),zt=i({},Ot.Default,{placement:"right",trigger:"click",content:"",template:''}),Bt=i({},Ot.DefaultType,{content:"(string|element|function)"}),Nt={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},Ft=function(e){function i(){return e.apply(this,arguments)||this}n(i,e);var r=i.prototype;return r.isWithContent=function(){return this.getTitle()||this._getContent()},r.setContent=function(){var e=this.getTipElement();this.setElementContent(W.findOne(".popover-header",e),this.getTitle());var t=this._getContent();"function"==typeof t&&(t=t.call(this._element)),this.setElementContent(W.findOne(".popover-body",e),t),e.classList.remove("fade","show")},r._addAttachmentClass=function(e){this.getTipElement().classList.add("bs-popover-"+this.updateAttachment(e))},r._getContent=function(){return this._element.getAttribute("data-bs-content")||this.config.content},r._cleanTipClass=function(){var e=this.getTipElement(),t=e.getAttribute("class").match(kt);null!==t&&t.length>0&&t.map((function(e){return e.trim()})).forEach((function(t){return e.classList.remove(t)}))},i.jQueryInterface=function(e){return this.each((function(){var t=E(this,"bs.popover"),n="object"==typeof e?e:null;if((t||!/dispose|hide/.test(e))&&(t||(t=new i(this,n),_(this,"bs.popover",t)),"string"==typeof e)){if(void 0===t[e])throw new TypeError('No method named "'+e+'"');t[e]()}}))},t(i,null,[{key:"Default",get:function(){return zt}},{key:"NAME",get:function(){return Dt}},{key:"DATA_KEY",get:function(){return"bs.popover"}},{key:"Event",get:function(){return Nt}},{key:"EVENT_KEY",get:function(){return".bs.popover"}},{key:"DefaultType",get:function(){return Bt}}]),i}(Ot);b((function(){var e=y();if(e){var t=e.fn[Dt];e.fn[Dt]=Ft.jQueryInterface,e.fn[Dt].Constructor=Ft,e.fn[Dt].noConflict=function(){return e.fn[Dt]=t,Ft.jQueryInterface}}}));var Ht="scrollspy",Ut={offset:10,method:"auto",target:""},jt={offset:"number",method:"string",target:"(string|element)"},Gt=function(e){function r(t,i){var n;return(n=e.call(this,t)||this)._scrollElement="BODY"===t.tagName?window:t,n._config=n._getConfig(i),n._selector=n._config.target+" .nav-link, "+n._config.target+" .list-group-item, "+n._config.target+" .dropdown-item",n._offsets=[],n._targets=[],n._activeTarget=null,n._scrollHeight=0,B.on(n._scrollElement,"scroll.bs.scrollspy",(function(e){return n._process(e)})),n.refresh(),n._process(),n}n(r,e);var o=r.prototype;return o.refresh=function(){var e=this,t=this._scrollElement===this._scrollElement.window?"offset":"position",i="auto"===this._config.method?t:this._config.method,n="position"===i?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),W.find(this._selector).map((function(e){var t=l(e),r=t?W.findOne(t):null;if(r){var o=r.getBoundingClientRect();if(o.width||o.height)return[V[i](r).top+n,t]}return null})).filter((function(e){return e})).sort((function(e,t){return e[0]-t[0]})).forEach((function(t){e._offsets.push(t[0]),e._targets.push(t[1])}))},o.dispose=function(){e.prototype.dispose.call(this),B.off(this._scrollElement,".bs.scrollspy"),this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},o._getConfig=function(e){if("string"!=typeof(e=i({},Ut,"object"==typeof e&&e?e:{})).target&&d(e.target)){var t=e.target.id;t||(t=s(Ht),e.target.id=t),e.target="#"+t}return f(Ht,e,jt),e},o._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},o._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},o._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},o._process=function(){var e=this._getScrollTop()+this._config.offset,t=this._getScrollHeight(),i=this._config.offset+t-this._getOffsetHeight();if(this._scrollHeight!==t&&this.refresh(),e>=i){var n=this._targets[this._targets.length-1];this._activeTarget!==n&&this._activate(n)}else{if(this._activeTarget&&e0)return this._activeTarget=null,void this._clear();for(var r=this._offsets.length;r--;)this._activeTarget!==this._targets[r]&&e>=this._offsets[r]&&(void 0===this._offsets[r+1]||e li > .active":".active";t=(t=W.find(r,n))[t.length-1]}var o=null;if(t&&(o=B.trigger(t,"hide.bs.tab",{relatedTarget:this._element})),!(B.trigger(this._element,"show.bs.tab",{relatedTarget:t}).defaultPrevented||null!==o&&o.defaultPrevented)){this._activate(this._element,n);var s=function(){B.trigger(t,"hidden.bs.tab",{relatedTarget:e._element}),B.trigger(e._element,"shown.bs.tab",{relatedTarget:t})};i?this._activate(i,i.parentNode,s):s()}}},r._activate=function(e,t,i){var n=this,r=(!t||"UL"!==t.nodeName&&"OL"!==t.nodeName?W.children(t,".active"):W.find(":scope > li > .active",t))[0],o=i&&r&&r.classList.contains("fade"),s=function(){return n._transitionComplete(e,r,i)};if(r&&o){var a=u(r);r.classList.remove("show"),B.one(r,"transitionend",s),p(r,a)}else s()},r._transitionComplete=function(e,t,i){if(t){t.classList.remove("active");var n=W.findOne(":scope > .dropdown-menu .active",t.parentNode);n&&n.classList.remove("active"),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!1)}e.classList.add("active"),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!0),v(e),e.classList.contains("fade")&&e.classList.add("show"),e.parentNode&&e.parentNode.classList.contains("dropdown-menu")&&(e.closest(".dropdown")&&W.find(".dropdown-toggle").forEach((function(e){return e.classList.add("active")})),e.setAttribute("aria-expanded",!0)),i&&i()},i.jQueryInterface=function(e){return this.each((function(){var t=E(this,"bs.tab")||new i(this);if("string"==typeof e){if(void 0===t[e])throw new TypeError('No method named "'+e+'"');t[e]()}}))},t(i,null,[{key:"DATA_KEY",get:function(){return"bs.tab"}}]),i}(N);B.on(document,"click.bs.tab.data-api",'[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',(function(e){e.preventDefault(),(E(this,"bs.tab")||new Vt(this)).show()})),b((function(){var e=y();if(e){var t=e.fn.tab;e.fn.tab=Vt.jQueryInterface,e.fn.tab.Constructor=Vt,e.fn.tab.noConflict=function(){return e.fn.tab=t,Vt.jQueryInterface}}}));var Wt={animation:"boolean",autohide:"boolean",delay:"number"},qt={animation:!0,autohide:!0,delay:5e3},Xt=function(e){function r(t,i){var n;return(n=e.call(this,t)||this)._config=n._getConfig(i),n._timeout=null,n._setListeners(),n}n(r,e);var o=r.prototype;return o.show=function(){var e=this;if(!B.trigger(this._element,"show.bs.toast").defaultPrevented){this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");var t=function(){e._element.classList.remove("showing"),e._element.classList.add("show"),B.trigger(e._element,"shown.bs.toast"),e._config.autohide&&(e._timeout=setTimeout((function(){e.hide()}),e._config.delay))};if(this._element.classList.remove("hide"),v(this._element),this._element.classList.add("showing"),this._config.animation){var i=u(this._element);B.one(this._element,"transitionend",t),p(this._element,i)}else t()}},o.hide=function(){var e=this;if(this._element.classList.contains("show")&&!B.trigger(this._element,"hide.bs.toast").defaultPrevented){var t=function(){e._element.classList.add("hide"),B.trigger(e._element,"hidden.bs.toast")};if(this._element.classList.remove("show"),this._config.animation){var i=u(this._element);B.one(this._element,"transitionend",t),p(this._element,i)}else t()}},o.dispose=function(){this._clearTimeout(),this._element.classList.contains("show")&&this._element.classList.remove("show"),B.off(this._element,"click.dismiss.bs.toast"),e.prototype.dispose.call(this),this._config=null},o._getConfig=function(e){return e=i({},qt,V.getDataAttributes(this._element),"object"==typeof e&&e?e:{}),f("toast",e,this.constructor.DefaultType),e},o._setListeners=function(){var e=this;B.on(this._element,"click.dismiss.bs.toast",'[data-bs-dismiss="toast"]',(function(){return e.hide()}))},o._clearTimeout=function(){clearTimeout(this._timeout),this._timeout=null},r.jQueryInterface=function(e){return this.each((function(){var t=E(this,"bs.toast");if(t||(t=new r(this,"object"==typeof e&&e)),"string"==typeof e){if(void 0===t[e])throw new TypeError('No method named "'+e+'"');t[e](this)}}))},t(r,null,[{key:"DefaultType",get:function(){return Wt}},{key:"Default",get:function(){return qt}},{key:"DATA_KEY",get:function(){return"bs.toast"}}]),r}(N);return b((function(){var e=y();if(e){var t=e.fn.toast;e.fn.toast=Xt.jQueryInterface,e.fn.toast.Constructor=Xt,e.fn.toast.noConflict=function(){return e.fn.toast=t,Xt.jQueryInterface}}})),{Alert:H,Button:U,Carousel:Q,Collapse:ee,Dropdown:yt,Modal:wt,Popover:Ft,ScrollSpy:Gt,Tab:Vt,Toast:Xt,Tooltip:Ot}})),function(e){if("function"==typeof define&&define.amd)define(["jquery"],e);else if("object"==typeof module&&module.exports){var t=require("jquery");e(t),module.exports=t}else e(jQuery)}((function(e){function t(e){this.init(e)}t.prototype={value:0,size:100,startAngle:-Math.PI,thickness:"auto",fill:{gradient:["#3aeabb","#fdd250"]},emptyFill:"rgba(0, 0, 0, .1)",animation:{duration:1200,easing:"circleProgressEasing"},animationStartValue:0,reverse:!1,lineCap:"butt",insertMode:"prepend",constructor:t,el:null,canvas:null,ctx:null,radius:0,arcFill:null,lastFrameValue:0,init:function(t){e.extend(this,t),this.radius=this.size/2,this.initWidget(),this.initFill(),this.draw(),this.el.trigger("circle-inited")},initWidget:function(){this.canvas||(this.canvas=e("")["prepend"==this.insertMode?"prependTo":"appendTo"](this.el)[0]);var t=this.canvas;if(t.width=this.size,t.height=this.size,this.ctx=t.getContext("2d"),window.devicePixelRatio>1){var i=window.devicePixelRatio;t.style.width=t.style.height=this.size+"px",t.width=t.height=this.size*i,this.ctx.scale(i,i)}},initFill:function(){var t,i=this,n=this.fill,r=this.ctx,o=this.size;if(!n)throw Error("The fill is not specified!");if("string"==typeof n&&(n={color:n}),n.color&&(this.arcFill=n.color),n.gradient){var s=n.gradient;if(1==s.length)this.arcFill=s[0];else if(s.length>1){for(var a=n.gradientAngle||0,l=n.gradientDirection||[o/2*(1-Math.cos(a)),o/2*(1+Math.sin(a)),o/2*(1+Math.cos(a)),o/2*(1-Math.sin(a))],c=r.createLinearGradient.apply(r,l),u=0;u")[0];n.width=i.size,n.height=i.size,n.getContext("2d").drawImage(t,0,0,o,o),i.arcFill=i.ctx.createPattern(n,"no-repeat"),i.drawFrame(i.lastFrameValue)}n.image&&(n.image instanceof Image?t=n.image:(t=new Image).src=n.image,t.complete?p():t.onload=p)},draw:function(){this.animation?this.drawAnimated(this.value):this.drawFrame(this.value)},drawFrame:function(e){this.lastFrameValue=e,this.ctx.clearRect(0,0,this.size,this.size),this.drawEmptyArc(e),this.drawArc(e)},drawArc:function(e){if(0!==e){var t=this.ctx,i=this.radius,n=this.getThickness(),r=this.startAngle;t.save(),t.beginPath(),this.reverse?t.arc(i,i,i-n/2,r-2*Math.PI*e,r):t.arc(i,i,i-n/2,r,r+2*Math.PI*e),t.lineWidth=n,t.lineCap=this.lineCap,t.strokeStyle=this.arcFill,t.stroke(),t.restore()}},drawEmptyArc:function(e){var t=this.ctx,i=this.radius,n=this.getThickness(),r=this.startAngle;e<1&&(t.save(),t.beginPath(),e<=0?t.arc(i,i,i-n/2,0,2*Math.PI):this.reverse?t.arc(i,i,i-n/2,r,r-2*Math.PI*e):t.arc(i,i,i-n/2,r+2*Math.PI*e,r),t.lineWidth=n,t.strokeStyle=this.emptyFill,t.stroke(),t.restore())},drawAnimated:function(t){var i=this,n=this.el,r=e(this.canvas);r.stop(!0,!1),n.trigger("circle-animation-start"),r.css({animationProgress:0}).animate({animationProgress:1},e.extend({},this.animation,{step:function(e){var r=i.animationStartValue*(1-e)+t*e;i.drawFrame(r),n.trigger("circle-animation-progress",[e,r])}})).promise().always((function(){n.trigger("circle-animation-end")}))},getThickness:function(){return e.isNumeric(this.thickness)?this.thickness:this.size/14},getValue:function(){return this.value},setValue:function(e){this.animation&&(this.animationStartValue=this.lastFrameValue),this.value=e,this.draw()}},e.circleProgress={defaults:t.prototype},e.easing.circleProgressEasing=function(e){return e<.5?.5*(e*=2)*e*e:1-.5*(e=2-2*e)*e*e},e.fn.circleProgress=function(i,n){var r="circle-progress",o=this.data(r);if("widget"==i){if(!o)throw Error('Calling "widget" method on not initialized instance is forbidden');return o.canvas}if("value"==i){if(!o)throw Error('Calling "value" method on not initialized instance is forbidden');if(void 0===n)return o.getValue();var s=arguments[1];return this.each((function(){e(this).data(r).setValue(s)}))}return this.each((function(){var n=e(this),o=n.data(r),s=e.isPlainObject(i)?i:{};if(o)o.init(s);else{var a=e.extend({},n.data());"string"==typeof a.fill&&(a.fill=JSON.parse(a.fill)),"string"==typeof a.animation&&(a.animation=JSON.parse(a.animation)),(s=e.extend(a,s)).el=n,o=new t(s),n.data(r,o)}}))}})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).window=e.window||{})}(this,(function(e){"use strict";function t(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function n(e){return"string"==typeof e}function r(e){return"function"==typeof e}function o(e){return"number"==typeof e}function s(e){return void 0===e}function a(e){return"object"==typeof e}function l(e){return!1!==e}function c(){return"undefined"!=typeof window}function u(e){return r(e)||n(e)}function h(e){return(Me=_t(e,ut))&&zi}function d(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")}function p(e,t){return!t&&console.warn(e)}function f(e,t){return e&&(ut[e]=t)&&Me&&(Me[e]=t)||ut}function m(){return 0}function g(e){var t,i,n=e[0];if(a(n)||r(n)||(e=[e]),!(t=(n._gsap||{}).harness)){for(i=xt.length;i--&&!xt[i].targetTest(n););t=xt[i]}for(i=e.length;i--;)e[i]&&(e[i]._gsap||(e[i]._gsap=new qt(e[i],t)))||e.splice(i,1);return e}function v(e){return e._gsap||g(Lt(e))[0]._gsap}function y(e,t,i){return(i=e[t])&&r(i)?e[t]():s(i)&&e.getAttribute&&e.getAttribute(t)||i}function b(e,t){return(e=e.split(",")).forEach(t)||e}function x(e){return Math.round(1e5*e)/1e5||0}function w(e){return Math.round(1e7*e)/1e7||0}function _(e,t){var i=t.charAt(0),n=parseFloat(t.substr(2));return e=parseFloat(e),"+"===i?e+n:"-"===i?e-n:"*"===i?e*n:e/n}function E(e,t){for(var i=t.length,n=0;e.indexOf(t[n])<0&&++no;)s=s._prev;return s?(t._next=s._next,s._next=t):(t._next=e[i],e[i]=t),t._next?t._next._prev=t:e[n]=t,t._prev=s,t.parent=t._dp=e,t}function O(e,t,i,n){void 0===i&&(i="_first"),void 0===n&&(n="_last");var r=t._prev,o=t._next;r?r._next=o:e[i]===t&&(e[i]=o),o?o._prev=r:e[n]===t&&(e[n]=r),t._next=t._prev=t.parent=null}function D(e,t){!e.parent||t&&!e.parent.autoRemoveChildren||e.parent.remove(e),e._act=0}function k(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var i=e;i;)i._dirty=1,i=i.parent;return e}function z(e,t,i,n){return e._startAt&&(ye?e._startAt.revert(dt):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,n))}function B(e){return e._repeat?Et(e._tTime,e=e.duration()+e._rDelay)*e:0}function N(e,t){return(e-t._start)*t._ts+(0<=t._ts?0:t._dirty?t.totalDuration():t._tDur)}function F(e){return e._end=w(e._start+(e._tDur/Math.abs(e._ts||e._rts||Ye)||0))}function H(e,t){var i=e._dp;return i&&i.smoothChildTiming&&e._ts&&(e._start=w(i._time-(0Ye)&&t.render(i,!0)),k(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur(r=Math.abs(r))&&(o=n,a=r);return o}function se(e){return D(e),e.scrollTrigger&&e.scrollTrigger.kill(!!ye),e.progress()<1&&It(e,"onInterrupt"),e}function ae(e,t,i){return(6*(e+=e<0?1:1>16,e>>8&Rt,e&Rt]:0:Ot.black;if(!f){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),Ot[e])f=Ot[e];else if("#"===e.charAt(0)){if(e.length<6&&(e="#"+(n=e.charAt(1))+n+(r=e.charAt(2))+r+(s=e.charAt(3))+s+(5===e.length?e.charAt(4)+e.charAt(4):"")),9===e.length)return[(f=parseInt(e.substr(1,6),16))>>16,f>>8&Rt,f&Rt,parseInt(e.substr(7),16)/255];f=[(e=parseInt(e.substr(1),16))>>16,e>>8&Rt,e&Rt]}else if("hsl"===e.substr(0,3))if(f=p=e.match(nt),t){if(~e.indexOf("="))return f=e.match(rt),i&&f.length<4&&(f[3]=1),f}else a=+f[0]%360/360,l=f[1]/100,n=2*(c=f[2]/100)-(r=c<=.5?c*(l+1):c+l-c*l),3=Xe?c.endTime(!1):t._dur;return n(i)&&(isNaN(i)||i in l)?(s=i.charAt(0),a="%"===i.substr(-1),o=i.indexOf("="),"<"===s||">"===s?(0<=o&&(i=i.replace(/=/,"")),("<"===s?c._start:c.endTime(0<=c._repeat))+(parseFloat(i.substr(1))||0)*(a?(o<0?c:r).totalDuration()/100:1)):o<0?(i in l||(l[i]=u),l[i]):(s=parseFloat(i.charAt(o-1)+i.substr(o+1)),a&&r&&(s=s/100*(it(r)?r[0]:r).totalDuration()),1=i&&et)return n;n=n._next}else for(n=e._last;n&&n._start>=i;){if("isPause"===n.data&&n._start=r._start)&&r._ts&&c!==r){if(r.parent!==this)return this.render(e,t,i);if(r.render(0=this.totalDuration()||!y&&m)&&(h!==this._start&&Math.abs(u)===Math.abs(this._ts)||this._lock||(!e&&v||!(y===g&&0=n&&(o instanceof oi?t&&r.push(o):(i&&r.push(o),e&&r.push.apply(r,o.getChildren(!0,t,i)))),o=o._next;return r},a.getById=function(e){for(var t=this.getChildren(1,1,1),i=t.length;i--;)if(t[i].vars.id===e)return t[i]},a.remove=function(e){return n(e)?this.removeLabel(e):r(e)?this.killTweensOf(e):(O(this,e),e===this._recent&&(this._recent=this._last),k(this))},a.totalTime=function(t,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=w(zt.time-(0t:!t||s.isActive())&&n.push(s):(i=s.getTweensOf(r,t)).length&&n.push.apply(n,i),s=s._next;return n},a.tweenTo=function(e,t){t=t||{};var i,n=this,r=Tt(n,e),o=t.startAt,s=t.onStart,a=t.onStartParams,l=t.immediateRender,c=oi.to(n,C({ease:t.ease||"none",lazy:!1,immediateRender:!1,time:r,overwrite:"auto",duration:t.duration||Math.abs((r-(o&&"time"in o?o.time:n._time))/n.timeScale())||Ye,onStart:function(){if(n.pause(),!i){var e=t.duration||Math.abs((r-(o&&"time"in o?o.time:n._time))/n.timeScale());c._dur!==e&&W(c,e,0,1).render(c._time,!0,!0),i=1}s&&s.apply(c,a||[])}},t));return l?c.render(0):c},a.tweenFromTo=function(e,t,i){return this.tweenTo(t,C({startAt:{time:Tt(this,e)}},i))},a.recent=function(){return this._recent},a.nextLabel=function(e){return void 0===e&&(e=this._time),oe(this,Tt(this,e))},a.previousLabel=function(e){return void 0===e&&(e=this._time),oe(this,Tt(this,e),1)},a.currentLabel=function(e){return arguments.length?this.seek(e,!0):this.previousLabel(this._time+Ye)},a.shiftChildren=function(e,t,i){void 0===i&&(i=0);for(var n,r=this._first,o=this.labels;r;)r._start>=i&&(r._start+=e,r._end+=e),r=r._next;if(t)for(n in o)o[n]>=i&&(o[n]+=e);return k(this)},a.invalidate=function(t){var i=this._first;for(this._lock=0;i;)i.invalidate(t),i=i._next;return e.prototype.invalidate.call(this,t)},a.clear=function(e){void 0===e&&(e=!0);for(var t,i=this._first;i;)t=i._next,this.remove(i),i=t;return this._dp&&(this._time=this._tTime=this._pTime=0),e&&(this.labels={}),k(this)},a.totalDuration=function(e){var t,i,n,r=0,o=this,s=o._last,a=Xe;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-e:e));if(o._dirty){for(n=o.parent;s;)t=s._prev,s._dirty&&s.totalDuration(),a<(i=s._start)&&o._sort&&s._ts&&!o._lock?(o._lock=1,j(o,s,i-s._delay,1)._lock=0):a=i,i<0&&s._ts&&(r-=i,(!n&&!o._dp||n&&n.smoothChildTiming)&&(o._start+=i/o._ts,o._time-=i,o._tTime-=i),o.shiftChildren(-i,!1,-1/0),a=0),s._end>r&&s._ts&&(r=s._end),s=t;W(o,o===xe&&o._time>r?o._time:r,1,1),o._dirty=0}return o._tDur},s.updateRoot=function(e){if(xe._ts&&(S(xe,N(e,xe)),Te=zt.frame),zt.frame>=bt){bt+=We.autoSleep||120;var t=xe._first;if((!t||!t._ts)&&We.autoSleep&&zt._listeners.length<2){for(;t&&!t._ts;)t=t._next;t||zt.sleep()}}},s}(Xt);function Qt(e,t,i,o,s,l){var c,u,h,d;if(vt[e]&&!1!==(c=new vt[e]).init(s,c.rawVars?t[e]:function(e,t,i,o,s){if(r(e)&&(e=ii(e,s,t,i,o)),!a(e)||e.style&&e.nodeType||it(e)||tt(e))return n(e)?ii(e,s,t,i,o):e;var l,c={};for(l in e)c[l]=ii(e[l],s,t,i,o);return c}(t[e],o,s,l,i),i,o,l)&&(i._pt=u=new bi(i._pt,s,e,0,1,c.render,c,0,c.priority),i!==Ae))for(h=i._ptLookup[i._targets.indexOf(s)],d=c._props.length;d--;)h[c._props[d]]=u;return c}function Jt(e,t,i,n){var r,o,s=t.ease||n||"power1.inOut";if(it(t))o=i[e]||(i[e]=[]),t.forEach((function(e,i){return o.push({t:i/(t.length-1)*100,v:e,e:s})}));else for(r in t)o=i[r]||(i[r]=[]),"ease"===r||o.push({t:parseFloat(e),v:t[r],e:s})}C(Zt.prototype,{_lock:0,_hasPause:0,_forcing:0});var Kt,$t,ei=function(e,t,i,o,s,a,l,c,u,h){r(o)&&(o=o(s||0,e,a));var p,f=e[t],m="get"!==i?i:r(f)?u?e[t.indexOf("set")||!r(e["get"+t.substr(3)])?t:"get"+t.substr(3)](u):e[t]():f,g=r(f)?u?ui:ci:li;if(n(o)&&(~o.indexOf("random(")&&(o=re(o)),"="===o.charAt(1)&&(!(p=_(m,o)+(Z(m)||0))&&0!==p||(o=p))),!h||m!==o||$t)return isNaN(m*o)||""===o?(f||t in e||d(t,o),function(e,t,i,n,r,o,s){var a,l,c,u,h,d,p,f,m=new bi(this._pt,e,t,0,1,fi,null,r),g=0,v=0;for(m.b=i,m.e=n,i+="",(p=~(n+="").indexOf("random("))&&(n=re(n)),o&&(o(f=[i,n],e,t),i=f[0],n=f[1]),l=i.match(st)||[];a=st.exec(n);)u=a[0],h=n.substring(g,a.index),c?c=(c+1)%5:"rgba("===h.substr(-5)&&(c=1),u!==l[v++]&&(d=parseFloat(l[v-1])||0,m._pt={_next:m._pt,p:h||1===v?h:",",s:d,c:"="===u.charAt(1)?_(d,u)-d:parseFloat(u)-d,m:c&&c<4?Math.round:0},g=st.lastIndex);return m.c=g")})),h.duration();else{for(v in f={},L)"ease"===v||"easeEach"===v||Jt(v,L[v],f,L.easeEach);for(v in f)for(B=f[v].sort((function(e,t){return e.t-t.t})),d=H=0;d=e._tDur||t<0)&&e.ratio===l&&(l&&D(e,1),i||ye||(It(e,l?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)}(this,e,t,i);return this},s.targets=function(){return this._targets},s.invalidate=function(t){return t&&this.vars.runBackwards||(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(t),e.prototype.invalidate.call(this,t)},s.resetTo=function(e,t,i,n){Ce||zt.wake(),this._ts||this.play();var r=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||ti(this,r),function(e,t,i,n,r,o,s){var a,l,c,u,h=(e._pt&&e._ptCache||(e._ptCache={}))[t];if(!h)for(h=e._ptCache[t]=[],c=e._ptLookup,u=e._targets.length;u--;){if((a=c[u][t])&&a.d&&a.d._pt)for(a=a.d._pt;a&&a.p!==t&&a.fp!==t;)a=a._next;if(!a)return $t=1,e.vars[t]="+=0",ti(e,s),$t=0,1;h.push(a)}for(u=h.length;u--;)(a=(l=h[u])._pt||l).s=!n&&0!==n||r?a.s+(n||0)+o*a.c:n,a.c=i-a.s,l.e&&(l.e=x(i)+Z(l.e)),l.b&&(l.b=a.s+Z(l.b))}(this,e,t,i,n,this._ease(r/this._dur),r)?this.resetTo(e,t,i,n):(H(this,0),this.parent||R(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},s.kill=function(e,t){if(void 0===t&&(t="all"),!(e||t&&"all"!==t))return this._lazy=this._pt=0,this.parent?se(this):this;if(this.timeline){var i=this.timeline.totalDuration();return this.timeline.killTweensOf(e,t,Kt&&!0!==Kt.vars.overwrite)._first||se(this),this.parent&&i!==this.timeline.totalDuration()&&W(this,this._dur*this.timeline._tDur/i,0,1),this}var r,o,s,a,l,c,u,h=this._targets,d=e?Lt(e):h,p=this._ptLookup,f=this._pt;if((!t||"all"===t)&&function(e,t){for(var i=e.length,n=i===t.length;n&&i--&&e[i]===t[i];);return i<0}(h,d))return"all"===t&&(this._pt=0),se(this);for(r=this._op=this._op||[],"all"!==t&&(n(t)&&(l={},b(t,(function(e){return l[e]=1})),t=l),t=function(e,t){var i,n,r,o,s=e[0]?v(e[0]).harness:0,a=s&&s.aliases;if(!a)return t;for(n in i=_t({},t),a)if(n in i)for(r=(o=a[n].split(",")).length;r--;)i[o[r]]=i[n];return i}(h,t)),u=h.length;u--;)if(~d.indexOf(h[u]))for(l in o=p[u],"all"===t?(r[u]=t,a=o,s={}):(s=r[u]=r[u]||{},a=t),a)(c=o&&o[l])&&("kill"in c.d&&!0!==c.d.kill(l)||O(this,c,"_pt"),delete o[l]),"all"!==s&&(s[l]=1);return this._initted&&!this._pt&&f&&se(this),this},r.to=function(e,t,i){return new r(e,t,i)},r.from=function(e,t){return X(1,arguments)},r.delayedCall=function(e,t,i,n){return new r(t,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:e,onComplete:t,onReverseComplete:t,onCompleteParams:i,onReverseCompleteParams:i,callbackScope:n})},r.fromTo=function(e,t,i){return X(2,arguments)},r.set=function(e,t){return t.duration=0,t.repeatDelay||(t.repeat=0),new r(e,t)},r.killTweensOf=function(e,t,i){return xe.killTweensOf(e,t,i)},r}(Xt);function si(e,t,i){return e.setAttribute(t,i)}function ai(e,t,i,n){n.mSet(e,t,n.m.call(n.tween,i,n.mt),n)}C(oi.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),b("staggerTo,staggerFrom,staggerFromTo",(function(e){oi[e]=function(){var t=new Zt,i=Ct.call(arguments,0);return i.splice("staggerFromTo"===e?5:4,0,0),t[e].apply(t,i)}}));var li=function(e,t,i){return e[t]=i},ci=function(e,t,i){return e[t](i)},ui=function(e,t,i,n){return e[t](n.fp,i)},hi=function(e,t){return r(e[t])?ci:s(e[t])&&e.setAttribute?si:li},di=function(e,t){return t.set(t.t,t.p,Math.round(1e6*(t.s+t.c*e))/1e6,t)},pi=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},fi=function(e,t){var i=t._pt,n="";if(!e&&t.b)n=t.b;else if(1===e&&t.e)n=t.e;else{for(;i;)n=i.p+(i.m?i.m(i.s+i.c*e):Math.round(1e4*(i.s+i.c*e))/1e4)+n,i=i._next;n+=t.c}t.set(t.t,t.p,n,t)},mi=function(e,t){for(var i=t._pt;i;)i.r(e,i.d),i=i._next},gi=function(e,t,i,n){for(var r,o=this._pt;o;)r=o._next,o.p===n&&o.modifier(e,t,i),o=r},vi=function(e){for(var t,i,n=this._pt;n;)i=n._next,n.p===e&&!n.op||n.op===e?O(this,n,"_pt"):n.dep||(t=1),n=i;return!t},yi=function(e){for(var t,i,n,r,o=e._pt;o;){for(t=o._next,i=n;i&&i.pr>o.pr;)i=i._next;(o._prev=i?i._prev:r)?o._prev._next=o:n=o,(o._next=i)?i._prev=o:r=o,o=t}e._pt=n},bi=(xi.prototype.modifier=function(e,t,i){this.mSet=this.mSet||this.set,this.set=ai,this.m=e,this.mt=i,this.tween=t},xi);function xi(e,t,i,n,r,o,s,a,l){this.t=t,this.s=n,this.c=r,this.p=i,this.r=o||di,this.d=s||this,this.set=a||li,this.pr=l||0,(this._next=e)&&(e._prev=this)}function wi(e){return(Si[e]||Ti).map((function(e){return e()}))}function _i(){var e=Date.now(),t=[];2