lkspencer-Herosaver/dist/saver.min.c9e0b205-7610-446...

27 lines
683 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var e;e=function(){"use strict";function e(){}function t(e,t){this.x=e||0,this.y=t||0}function n(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function r(e,i,a,o,s,c,l,u,h,p){Object.defineProperty(this,"id",{value:Ia++}),this.uuid=Na.generateUUID(),this.name="",this.image=void 0!==e?e:r.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==i?i:r.DEFAULT_MAPPING,this.wrapS=void 0!==a?a:1001,this.wrapT=void 0!==o?o:1001,this.magFilter=void 0!==s?s:1006,this.minFilter=void 0!==c?c:1008,this.anisotropy=void 0!==h?h:1,this.format=void 0!==l?l:1023,this.internalFormat=null,this.type=void 0!==u?u:1009,this.offset=new t(0,0),this.repeat=new t(1,1),this.center=new t(0,0),this.rotation=0,this.matrixAutoUpdate=1,this.matrix=new n,this.generateMipmaps=1,this.premultiplyAlpha=0,this.flipY=1,this.unpackAlignment=4,this.encoding=void 0!==p?p:3e3,this.version=0,this.onUpdate=null}function i(e,t,n,r){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==r?r:1}function a(e,t,n){this.width=e,this.height=t,this.scissor=new i(0,0,e,t),this.scissorTest=0,this.viewport=new i(0,0,e,t),n=n||{},this.texture=new r(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps?n.generateMipmaps:0,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:1006,this.depthBuffer=void 0!==n.depthBuffer?n.depthBuffer:1,this.stencilBuffer=void 0!==n.stencilBuffer?n.stencilBuffer:1,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function o(e,t,n){a.call(this,e,t,n),this.samples=4}function s(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==r?r:1}function c(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}function l(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function u(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._order=r||u.DefaultOrder}function h(){this.mask=1}function p(){Object.defineProperty(this,"id",{value:Xa++}),this.uuid=Na.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=p.DefaultUp.clone();var e=new c,t=new u,r=new s,i=new c(1,1,1);t._onChange((function(){r.setFromEuler(t,0)})),r._onChange((function(){t.setFromQuaternion(r,void 0,0)})),Object.defineProperties(this,{position:{configurable:1,enumerable:1,value:e},rotation:{configurable:1,enumerable:1,value:t},quaternion:{configurable:1,enumerable:1,value:r},scale:{configurable:1,enumerable:1,value:i},modelViewMatrix:{value:new l},normalMatrix:{value:new n}}),this.matrix=new l,this.matrixWorld=new l,this.matrixAutoUpdate=p.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=0,this.layers=new h,this.visible=1,this.castShadow=0,this.receiveShadow=0,this.frustumCulled=1,this.renderOrder=0,this.userData={}}function d(){p.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=1,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function f(e,t){this.min=void 0!==e?e:new c(1/0,1/0,1/0),this.max=void 0!==t?t:new c(-1/0,-1/0,-1/0)}function m(e,t,n,r,i){var a,o;for(a=0,o=e.length-3;a<=o;a+=3){xo.fromArray(e,a);var s=i.x*Math.abs(xo.x)+i.y*Math.abs(xo.y)+i.z*Math.abs(xo.z),c=t.dot(xo),l=n.dot(xo),u=r.dot(xo);if(Math.max(-Math.max(c,l,u),Math.min(c,l,u))>s)return 0}return 1}function g(e,t){this.center=void 0!==e?e:new c,this.radius=void 0!==t?t:0}function v(e,t){this.origin=void 0!==e?e:new c,this.direction=void 0!==t?t:new c(0,0,-1)}function y(e,t){this.normal=void 0!==e?e:new c(1,0,0),this.constant=void 0!==t?t:0}function x(e,t,n){this.a=void 0!==e?e:new c,this.b=void 0!==t?t:new c,this.c=void 0!==n?n:new c}function b(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}function w(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function _(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function M(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}function S(e,t,n,r,i,a){this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new c,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new b,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==a?a:0}function T(){Object.defineProperty(this,"id",{value:Vo++}),this.uuid=Na.generateUUID(),this.name="",this.type="Material",this.fog=1,this.blending=1,this.side=0,this.flatShading=0,this.vertexColors=0,this.opacity=1,this.transparent=0,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=1,this.depthWrite=1,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,this.stencilWrite=0,this.clippingPlanes=null,this.clipIntersection=0,this.clipShadows=0,this.shadowSide=null,this.colorWrite=1,this.precision=null,this.polygonOffset=0,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=0,this.alphaTest=0,this.premultipliedAlpha=0,this.visible=1,this.toneMapped=1,this.userData={},this.version=0}function E(e){T.call(this),this.type="MeshBasicMaterial",this.color=new b(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=0,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=0,this.morphTargets=0,this.setValues(e)}function A(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=1==n,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function L(e,t,n){A.call(this,new Int8Array(e),t,n)}function C(e,t,n){A.call(this,new Uint8Array(e),t,n)}function R(e,t,n){A.call(this,new Uint8ClampedArray(e),t,n)}function P(e,t,n){A.call(this,new Int16Array(e),t,n)}function O(e,t,n){A.call(this,new Uint16Array(e),t,n)}function N(e,t,n){A.call(this,new Int32Array(e),t,n)}function D(e,t,n){A.call(this,new Uint32Array(e),t,n)}function I(e,t,n){A.call(this,new Float32Array(e),t,n)}function z(e,t,n){A.call(this,new Float64Array(e),t,n)}function B(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=0,this.normalsNeedUpdate=0,this.colorsNeedUpdate=0,this.uvsNeedUpdate=0,this.groupsNeedUpdate=0}function U(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,r=e.length;n<r;++n)e[n]>t&&(t=e[n]);return t}function F(){Object.defineProperty(this,"id",{value:qo+=2}),this.uuid=Na.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=0,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function H(e,t){p.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new F,this.material=void 0!==t?t:new E,this.updateMorphTargets()}function k(e,t,n,r,i,a,o,s){if(null===(1===t.side?r.intersectTriangle(o,a,i,1,s):r.intersectTriangle(i,a,o,2!==t.side,s)))return null;ms.copy(s),ms.applyMatrix4(e.matrixWorld);var c=n.ray.origin.distanceTo(ms);return c<n.near||c>n.far?null:{distance:c,point:ms.clone(),object:e}}function G(e,n,r,i,a,o,s,c,l,u,h,p){ns.fromBufferAttribute(a,u),rs.fromBufferAttribute(a,h),is.fromBufferAttribute(a,p);var d=e.morphTargetInfluences;if(n.morphTargets&&o&&d){cs.set(0,0,0),ls.set(0,0,0),us.set(0,0,0);for(var f=0,m=o.length;f<m;f++){var g=d[f],v=o[f];0!==g&&(as.fromBufferAttribute(v,u),os.fromBufferAttribute(v,h),ss.fromBufferAttribute(v,p),s?(cs.addScaledVector(as,g),ls.addScaledVector(os,g),us.addScaledVector(ss,g)):(cs.addScaledVector(as.sub(ns),g),ls.addScaledVector(os.sub(rs),g),us.addScaledVector(ss.sub(is),g)))}ns.add(cs),rs.add(ls),is.add(us)}var y=k(e,n,r,i,ns,rs,is,fs);if(y){c&&(hs.fromBufferAttribute(c,u),ps.fromBufferAttribute(c,h),ds.fromBufferAttribute(c,p),y.uv=x.getUV(fs,ns,rs,is,hs,ps,ds,new t)),l&&(hs.fromBufferAttribute(l,u),ps.fromBufferAttribute(l,h),ds.fromBufferAttribute(l,p),y.uv2=x.getUV(fs,ns,rs,is,hs,ps,ds,new t));var b=new S(u,h,p);x.getNormal(ns,rs,is,b.normal),y.face=b}return y}function j(){Object.defineProperty(this,"id",{value:gs+=2}),this.uuid=Na.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=0,this.verticesNeedUpdate=0,this.uvsNeedUpdate=0,this.normalsNeedUpdate=0,this.colorsNeedUpdate=0,this.lineDistancesNeedUpdate=0,this.groupsNeedUpdate=0}function V(e){var t={};for(var n in e)for(var r in t[n]={},e[n]){var i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture)?t[n][r]=i.clone():t[n][r]=Array.isArray(i)?i.slice():i}return t}function W(e){for(var t={},n=0;n<e.length;n++){var r=V(e[n]);for(var i in r)t[i]=r[i]}return t}function q(e){T.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=0,this.wireframeLinewidth=1,this.fog=0,this.lights=0,this.clipping=0,this.skinning=0,this.morphTargets=0,this.morphNormals=0,this.extensions={derivatives:0,fragDepth:0,drawBuffers:0,shaderTextureLOD:0},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=0,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function X(){p.call(this),this.type="Camera",this.matrixWorldInverse=new l,this.projectionMatrix=new l,this.projectionMatrixInverse=new l}function Y(e,t,n,r){X.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function Z(e,t,n,r){p.call(this),this.type="CubeCamera";var i=new Y(90,1,e,t);i.up.set(0,-1,0),i.lookAt(new c(1,0,0)),this.add(i);var a=new Y(90,1,e,t);a.up.set(0,-1,0),a.lookAt(new c(-1,0,0)),this.add(a);var o=new Y(90,1,e,t);o.up.set(0,0,1),o.lookAt(new c(0,1,0)),this.add(o);var s=new Y(90,1,e,t);s.up.set(0,0,-1),s.lookAt(new c(0,-1,0)),this.add(s);var l=new Y(90,1,e,t);l.up.set(0,-1,0),l.lookAt(new c(0,0,1)),this.add(l);var u=new Y(90,1,e,t);u.up.set(0,-1,0),u.lookAt(new c(0,0,-1)),this.add(u),r=r||{format:1022,magFilter:1006,minFilter:1006},this.renderTarget=new J(n,r),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var n=e.getRenderTarget(),r=this.renderTarget,c=r.texture.generateMipmaps;r.texture.generateMipmaps=0,e.setRenderTarget(r,0),e.render(t,i),e.setRenderTarget(r,1),e.render(t,a),e.setRenderTarget(r,2),e.render(t,o),e.setRenderTarget(r,3),e.render(t,s),e.setRenderTarget(r,4),e.render(t,l),r.texture.generateMipmaps=c,e.setRenderTarget(r,5),e.render(t,u),e.setRenderTarget(n)},this.clear=function(e,t,n,r){for(var i=e.getRenderTarget(),a=this.renderTarget,o=0;o<6;o++)e.setRenderTarget(a,o),e.clear(t,n,r);e.setRenderTarget(i)}}function J(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),a.call(this,e,e,t)}function $(e,t,n,i,a,o,s,c,l,u,h,p){r.call(this,null,o,s,c,l,u,i,a,h,p),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==l?l:1003,this.minFilter=void 0!==u?u:1003,this.generateMipmaps=0,this.flipY=0,this.unpackAlignment=1,this.needsUpdate=1}function Q(e,t,n,r,i,a){this.planes=[void 0!==e?e:new y,void 0!==t?t:new y,void 0!==n?n:new y,void 0!==r?r:new y,void 0!==i?i:new y,void 0!==a?a:new y]}function K(){function e(i,a){0!=n&&(r(i,a),t.requestAnimationFrame(e))}var t=null,n=0,r=null;return{start:function(){1!=n&&null!==r&&(t.requestAnimationFrame(e),n=1)},stop:function(){n=0},setAnimationLoop:function(e){r=e},setContext:function(e){t=e}}}function ee(e,t){var n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){t.isInterleavedBufferAttribute&&(t=t.data);var a=r.get(t);void 0===a?r.set(t,function(t,n){var r=t.array,i=t.usage,a=e.createBuffer();e.bindBuffer(n,a),e.bufferData(n,r,i),t.onUploadCallback();var o=5126;return r instanceof Float32Array?o=5126:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?o=5123:r instanceof Int16Array?o=5122:r instanceof Uint32Array?o=5125:r instanceof Int32Array?o=5124:r instanceof Int8Array?o=5120:r instanceof Uint8Array&&(o=5121),{buffer:a,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}(t,i)):a.version<t.version&&(function(t,r,i){var a=r.array,o=r.updateRange;e.bindBuffer(i,t),-1===o.count?e.bufferSubData(i,0,a):(n?e.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a,o.offset,o.count):e.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a.subarray(o.offset,o.offset+o.count)),o.count=-1)}(a.buffer,t,i),a.version=t.version)}}}function te(e,t,n,r){j.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r},this.fromBufferGeometry(new ne(e,t,n,r)),this.mergeVertices()}function ne(e,t,n,r){F.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};var i,a,o=(e=e||1)/2,s=(t=t||1)/2,c=Math.floor(n)||1,l=Math.floor(r)||1,u=c+1,h=l+1,p=e/c,d=t/l,f=[],m=[],g=[],v=[];for(a=0;a<h;a++){var y=a*d-s;for(i=0;i<u;i++){var x=i*p-o;m.push(x,-y,0),g.push(0,0,1),v.push(i/c),v.push(1-a/l)}}for(a=0;a<l;a++)for(i=0;i<c;i++){var b=i+u*a,w=i+u*(a+1),_=i+1+u*(a+1),M=i+1+u*a;f.push(b,w,M),f.push(w,_,M)}this.setIndex(f),this.setAttribute("position",new I(m,3)),this.setAttribute("normal",new I(g,3)),this.setAttribute("uv",new I(v,2))}function re(e,t,n,r){function i(e,n){t.buffers.color.setClear(e.r,e.g,e.b,n,r)}var a,o,s=new b(0),c=0,l=null,u=0,h=null;return{getClearColor:function(){return s},setClearColor:function(e,t){s.set(e),i(s,c=void 0!==t?t:1)},getClearAlpha:function(){return c},setClearAlpha:function(e){i(s,c=e)},render:function(t,r,p,d){var f=r.background,m=e.xr,g=m.getSession&&m.getSession();if(g&&"additive"===g.environmentBlendMode&&(f=null),null===f?i(s,c):f&&f.isColor&&(i(f,1),d=1),(e.autoClear||d)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),f&&(f.isCubeTexture||f.isWebGLCubeRenderTarget||306===f.mapping)){void 0===o&&((o=new H(new bs(1,1,1),new q({type:"BackgroundCubeMaterial",uniforms:V(Es.cube.uniforms),vertexShader:Es.cube.vertexShader,fragmentShader:Es.cube.fragmentShader,side:1,depthTest:0,depthWrite:0,fog:0}))).geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(o));var v=f.isWebGLCubeRenderTarget?f.texture:f;o.material.uniforms.envMap.value=v,o.material.uniforms.flipEnvMap.value=v.isCubeTexture?-1:1,l===f&&u===v.version&&h===e.toneMapping||(o.material.needsUpdate=1,l=f,u=v.version,h=e.toneMapping),t.unshift(o,o.geometry,o.material,0,0,null)}else f&&f.isTexture&&(void 0===a&&((a=new H(new ne(2,2),new q({type:"BackgroundMaterial",uniforms:V(Es.background.uniforms),vertexShader:Es.background.vertexShader,fragmentShader:Es.background.fragmentShader,side:0,depthTest:0,depthWrite:0,fog:0}))).geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=f,1==f.matrixAutoUpdate&&f.updateMatrix(),a.material.uniforms.uvTransform.value.copy(f.matrix),l===f&&u===f.version&&h===e.toneMapping||(a.material.needsUpdate=1,l=f,u=f.version,h=e.toneMapping),t.unshift(a,a.geometry,a.material,0,0,null))}}}function ie(e,t,n,r){var i,a=r.isWebGL2;this.setMode=function(e){i=e},this.render=function(t,r){e.drawArrays(i,t,r),n.update(r,i)},this.renderInstances=function(r,o,s,c){if(0!==c){var l,u;if(a)l=e,u="drawArraysInstanced";else if(u="drawArraysInstancedANGLE",null===(l=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[u](i,o,s,c),n.update(s,i,c)}}}function ae(e,t,n){function r(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var i,a="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,o=void 0!==n.precision?n.precision:"highp",s=r(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var c=1==n.logarithmicDepthBuffer,l=e.getParameter(34930),u=e.getParameter(35660),h=e.getParameter(3379),p=e.getParameter(34076),d=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),g=e.getParameter(36349),v=u>0,y=a||!!t.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==i)return i;var n=t.get("EXT_texture_filter_anisotropic");return i=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:c,maxTextures:l,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:p,maxAttributes:d,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:a?e.getParameter(36183):0}}function oe(){function e(){u.value!==i&&(u.value=i,u.needsUpdate=a>0),r.numPlanes=a,r.numIntersection=0}function t(e,t,n,i){var a=null!==e?e.length:0,o=null;if(0!==a){if(o=u.value,1!=i||null===o){var s=n+4*a,h=t.matrixWorldInverse;l.getNormalMatrix(h),(null===o||o.length<s)&&(o=new Float32Array(s));for(var p=0,d=n;p!==a;++p,d+=4)c.copy(e[p]).applyMatrix4(h,l),c.normal.toArray(o,d),o[d+3]=c.constant}u.value=o,u.needsUpdate=1}return r.numPlanes=a,r.numIntersection=0,o}var r=this,i=null,a=0,o=0,s=0,c=new y,l=new n,u={value:null,needsUpdate:0};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(e,n,r){var s=0!==e.length||n||0!==a||o;return o=n,i=t(e,r,0),a=e.length,s},this.beginShadows=function(){s=1,t(null)},this.endShadows=function(){s=0,e()},this.setState=function(n,r,c,l,h,p){if(!o||null===n||0===n.length||s&&!c)s?t(null):e();else{var d=s?0:a,f=4*d,m=h.clippingState||null;u.value=m,m=t(n,l,f,p);for(var g=0;g!==f;++g)m[g]=i[g];h.clippingState=m,this.numIntersection=r?this.numPlanes:0,this.numPlanes+=d}}}function se(e){var t={};return{get:function(n){if(void 0!==t[n])return t[n];var r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return null===r&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),t[n]=r,r}}}function ce(e,t,n){function r(e){var i=e.target,s=a.get(i);for(var c in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[c]);i.removeEventListener("dispose",r),a.delete(i);var l=o.get(s);l&&(t.remove(l),o.delete(s)),n.memory.geometries--}function i(e){var n=[],r=e.index,i=e.attributes.position,a=0;if(null!==r){var s=r.array;a=r.version;for(var c=0,l=s.length;c<l;c+=3){var u=s[c+0],h=s[c+1],p=s[c+2];n.push(u,h,h,p,p,u)}}else for(s=i.array,a=i.version,c=0,l=s.length/3-1;c<l;c+=3)u=c+0,h=c+1,p=c+2,n.push(u,h,h,p,p,u);var d=new(U(n)>65535?D:O)(n,1);d.version=a,t.update(d,34963);var f=o.get(e);f&&t.remove(f),o.set(e,d)}var a=new WeakMap,o=new WeakMap;return{get:function(e,t){var i=a.get(t);return i||(t.addEventListener("dispose",r),t.isBufferGeometry?i=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new F).setFromObject(e)),i=t._bufferGeometry),a.set(t,i),n.memory.geometries++,i)},update:function(e){var n=e.index,r=e.attributes;for(var i in null!==n&&t.update(n,34963),r)t.update(r[i],34962);var a=e.morphAttributes;for(var i in a)for(var o=a[i],s=0,c=o.length;s<c;s++)t.update(o[s],34962)},getWireframeAttribute:function(e){var t=o.get(e);if(t){var n=e.index;null!==n&&t.version<n.version&&i(e)}else i(e);return o.get(e)}}}function le(e,t,n,r){var i,a,o,s=r.isWebGL2;this.setMode=function(e){i=e},this.setIndex=function(e){a=e.type,o=e.bytesPerElement},this.render=function(t,r){e.drawElements(i,r,a,t*o),n.update(r,i)},this.renderInstances=function(r,c,l,u){if(0!==u){var h,p;if(s)h=e,p="drawElementsInstanced";else if(p="drawElementsInstancedANGLE",null===(h=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[p](i,l,a,c*o,u),n.update(l,i,u)}}}function ue(){var e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:1,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(t,n,r){switch(r=r||1,e.calls++,n){case 4:e.triangles+=r*(t/3);break;case 1:e.lines+=r*(t/2);break;case 3:e.lines+=r*(t-1);break;case 2:e.lines+=r*t;break;case 0:e.points+=r*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function he(e,t){return Math.abs(t[1])-Math.abs(e[1])}function pe(e){var t={},n=new Float32Array(8);return{update:function(r,i,a,o){var s=r.morphTargetInfluences,c=void 0===s?0:s.length,l=t[i.id];if(void 0===l){l=[];for(var u=0;u<c;u++)l[u]=[u,0];t[i.id]=l}var h=a.morphTargets&&i.morphAttributes.position,p=a.morphNormals&&i.morphAttributes.normal;for(u=0;u<c;u++)0!==(f=l[u])[1]&&(h&&i.deleteAttribute("morphTarget"+u),p&&i.deleteAttribute("morphNormal"+u));for(u=0;u<c;u++)(f=l[u])[0]=u,f[1]=s[u];l.sort(he);var d=0;for(u=0;u<8;u++){var f;if(f=l[u]){var m=f[0],g=f[1];if(g){h&&i.setAttribute("morphTarget"+u,h[m]),p&&i.setAttribute("morphNormal"+u,p[m]),n[u]=g,d+=g;continue}}n[u]=0}var v=i.morphTargetsRelative?1:1-d;o.getUniforms().setValue(e,"morphTargetBaseInfluence",v),o.getUniforms().setValue(e,"morphTargetInfluences",n)}}}function de(e,t,n,r){var i=new WeakMap;return{update:function(e){var a=r.render.frame,o=e.geometry,s=t.get(e,o);return i.get(s)!==a&&(o.isGeometry&&s.updateFromObject(e),t.update(s),i.set(s,a)),e.isInstancedMesh&&n.update(e.instanceMatrix,34962),s},dispose:function(){i=new WeakMap}}}function fe(e,t,n,i,a,o,s,c,l,u){e=void 0!==e?e:[],t=void 0!==t?t:301,s=void 0!==s?s:1022,r.call(this,e,t,n,i,a,o,s,c,l,u),this.flipY=0}function me(e,t,n,i){r.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:i||1},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=0,this.flipY=0,this.needsUpdate=1}function ge(e,t,n,i){r.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:i||1},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=0,this.flipY=0,this.needsUpdate=1}function ve(e,t,n){var r=e[0];if(r<=0||r>0)return e;var i=t*n,a=Ps[i];if(void 0===a&&(a=new Float32Array(i),Ps[i]=a),0!==t){r.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function ye(e,t){if(e.length!==t.length)return 0;for(var n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return 0;return 1}function xe(e,t){for(var n=0,r=t.length;n<r;n++)e[n]=t[n]}function be(e,t){var n=Os[t];void 0===n&&(n=new Int32Array(t),Os[t]=n);for(var r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function we(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function _e(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(ye(n,t))return;e.uniform2fv(this.addr,t),xe(n,t)}}function Me(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(ye(n,t))return;e.uniform3fv(this.addr,t),xe(n,t)}}function Se(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(ye(n,t))return;e.uniform4fv(this.addr,t),xe(n,t)}}function Te(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(ye(n,t))return;e.uniformMatrix2fv(this.addr,0,t),xe(n,t)}else{if(ye(n,r))return;Is.set(r),e.uniformMatrix2fv(this.addr,0,Is),xe(n,r)}}function Ee(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(ye(n,t))return;e.uniformMatrix3fv(this.addr,0,t),xe(n,t)}else{if(ye(n,r))return;Ds.set(r),e.uniformMatrix3fv(this.addr,0,Ds),xe(n,r)}}function Ae(e,t){var n=this.cache,r=t.elements;if(void 0===r){if(ye(n,t))return;e.uniformMatrix4fv(this.addr,0,t),xe(n,t)}else{if(ye(n,r))return;Ns.set(r),e.uniformMatrix4fv(this.addr,0,Ns),xe(n,r)}}function Le(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTexture2D(t||As,i)}function Ce(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||Ls,i)}function Re(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||Cs,i)}function Pe(e,t,n){var r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.safeSetTextureCube(t||Rs,i)}function Oe(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Ne(e,t){var n=this.cache;ye(n,t)||(e.uniform2iv(this.addr,t),xe(n,t))}function De(e,t){var n=this.cache;ye(n,t)||(e.uniform3iv(this.addr,t),xe(n,t))}function Ie(e,t){var n=this.cache;ye(n,t)||(e.uniform4iv(this.addr,t),xe(n,t))}function ze(e,t){var n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function Be(e,t){e.uniform1fv(this.addr,t)}function Ue(e,t){e.uniform1iv(this.addr,t)}function Fe(e,t){e.uniform2iv(this.addr,t)}function He(e,t){e.uniform3iv(this.addr,t)}function ke(e,t){e.uniform4iv(this.addr,t)}function Ge(e,t){var n=ve(t,this.size,2);e.uniform2fv(this.addr,n)}function je(e,t){var n=ve(t,this.size,3);e.uniform3fv(this.addr,n)}function Ve(e,t){var n=ve(t,this.size,4);e.uniform4fv(this.addr,n)}function We(e,t){var n=ve(t,this.size,4);e.uniformMatrix2fv(this.addr,0,n)}function qe(e,t){var n=ve(t,this.size,9);e.uniformMatrix3fv(this.addr,0,n)}function Xe(e,t){var n=ve(t,this.size,16);e.uniformMatrix4fv(this.addr,0,n)}function Ye(e,t,n){var r=t.length,i=be(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTexture2D(t[a]||As,i[a])}function Ze(e,t,n){var r=t.length,i=be(n,r);e.uniform1iv(this.addr,i);for(var a=0;a!==r;++a)n.safeSetTextureCube(t[a]||Rs,i[a])}function Je(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(e){switch(e){case 5126:return we;case 35664:return _e;case 35665:return Me;case 35666:return Se;case 35674:return Te;case 35675:return Ee;case 35676:return Ae;case 5124:case 35670:return Oe;case 35667:case 35671:return Ne;case 35668:case 35672:return De;case 35669:case 35673:return Ie;case 5125:return ze;case 35678:case 36198:case 36298:case 36306:case 35682:return Le;case 35679:case 36299:case 36307:return Re;case 35680:case 36300:case 36308:case 36293:return Pe;case 36289:case 36303:case 36311:case 36292:return Ce}}(t.type)}function $e(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return Be;case 35664:return Ge;case 35665:return je;case 35666:return Ve;case 35674:return We;case 35675:return qe;case 35676:return Xe;case 5124:case 35670:return Ue;case 35667:case 35671:return Fe;case 35668:case 35672:return He;case 35669:case 35673:return ke;case 35678:case 36198:case 36298:case 36306:case 35682:return Ye;case 35680:case 36300:case 36308:case 36293:return Ze}}(t.type)}function Qe(e){this.id=e,this.seq=[],this.map={}}function Ke(e,t){e.seq.push(t),e.map[t.id]=t}function et(e,t,n){var r=e.name,i=r.length;for(zs.lastIndex=0;;){var a=zs.exec(r),o=zs.lastIndex,s=a[1],c="]"===a[2],l=a[3];if(c&&(s|=0),void 0===l||"["===l&&o+2===i){Ke(n,void 0===l?new Je(s,e,t):new $e(s,e,t));break}var u=n.map[s];void 0===u&&Ke(n,u=new Qe(s)),n=u}}function tt(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),r=0;r<n;++r){var i=e.getActiveUniform(t,r);et(i,e.getUniformLocation(t,i.name),this)}}function nt(e,t,n){var r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}function rt(e){switch(e){case 3e3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:throw Error("unsupported encoding: "+e)}}function it(e,t,n){var r=e.getShaderParameter(t,35713),i=e.getShaderInfoLog(t).trim();return r&&""===i?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+i+function(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join("\n")}(e.getShaderSource(t))}function at(e,t){var n=rt(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function ot(e,t){var n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Uncharted2";break;case 4:n="OptimizedCineon";break;case 5:n="ACESFilmic";break;default:throw Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function st(e){return""!==e}function ct(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function lt(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}function ut(e){return e.replace(Us,ht)}function ht(e,t){var n=Ts[t];if(void 0===n)throw Error("Can not resolve #include <"+t+">");return ut(n)}function pt(e){return e.replace(Hs,ft).replace(Fs,dt)}function dt(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),ft(0,t,n,r)}function ft(e,t,n,r){for(var i="",a=parseInt(t);a<parseInt(n);a++)i+=r.replace(/\[ i \]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return i}function mt(e){var t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function gt(e,t,n){var r,i,a,o,s=e.getContext(),c=n.defines,l=n.vertexShader,u=n.fragmentShader,h=function(e){var t="SHADOWMAP_TYPE_BASIC";return 1===e.shadowMapType?t="SHADOWMAP_TYPE_PCF":2===e.shadowMapType?t="SHADOWMAP_TYPE_PCF_SOFT":3===e.shadowMapType&&(t="SHADOWMAP_TYPE_VSM"),t}(n),p=function(e){var t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case 301:case 302:t="ENVMAP_TYPE_CUBE";break;case 306:case 307:t="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:t="ENVMAP_TYPE_EQUIREC";break;case 305:t="ENVMAP_TYPE_SPHERE"}return t}(n),d=function(e){var t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case 302:case 304:t="ENVMAP_MODE_REFRACTION"}return t}(n),f=function(e){var t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case 0:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD"}return t}(n),m=e.gammaFactor>0?e.gammaFactor:1,g=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(st).join("\n")}(n),v=function(e){var t=[];for(var n in e){var r=e[n];0!=r&&t.push("#define "+n+" "+r)}return t.join("\n")}(c),y=s.createProgram();if(n.isRawShaderMaterial?((r=[v].filter(st).join("\n")).length>0&&(r+="\n"),(i=[g,v].filter(st).join("\n")).length>0&&(i+="\n")):(r=[mt(n),"#define SHADER_NAME "+n.shaderName,v,n.instancing?"#define USE_INSTANCING":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+m,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+d:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&0==n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+h:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(st).join("\n"),i=[g,mt(n),"#define SHADER_NAME "+n.shaderName,v,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+m,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+p:"",n.envMap?"#define "+d:"",n.envMap?"#define "+f:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+h:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?Ts.tonemapping_pars_fragment:"",0!==n.toneMapping?ot("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.outputEncoding||n.mapEncoding||n.matcapEncoding||n.envMapEncoding||n.emissiveMapEncoding||n.lightMapEncoding?Ts.encodings_pars_fragment:"",n.mapEncoding?at("mapTexelToLinear",n.mapEncoding):"",n.matcapEncoding?at("matcapTexelToLinear",n.matcapEncoding):"",n.envMapEncoding?at("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?at("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMapEncoding?at("lightMapTexelToLinear",n.lightMapEncoding):"",n.outputEncoding?("linearToOutputTexel",a=n.outputEncoding,o=rt(a),"vec4 linearToOutputTexel( vec4 value ) { return LinearTo"+o[0]+o[1]+"; }"):"",n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(st).join("\n")),l=lt(l=ct(l=ut(l),n),n),u=lt(u=ct(u=ut(u),n),n),l=pt(l),u=pt(u),n.isWebGL2&&!n.isRawShaderMaterial){var x=0,b=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&null!==l.match(b)&&null!==u.match(b)&&(x=1,l=l.replace(b,""),u=u.replace(b,"")),r="#version 300 es\n\n#define attribute in\n#define varying out\n#define texture2D texture\n"+r,i=["#version 300 es\n\n#define varying in",x?"":"out highp vec4 pc_fragColor;",x?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+i}var w,_,M=i+u,S=nt(s,35633,r+l),T=nt(s,35632,M);if(s.attachShader(y,S),s.attachShader(y,T),void 0!==n.index0AttributeName?s.bindAttribLocation(y,0,n.index0AttributeName):1==n.morphTargets&&s.bindAttribLocation(y,0,"position"),s.linkProgram(y),e.debug.checkShaderErrors){var E=s.getProgramInfoLog(y).trim(),A=s.getShaderInfoLog(S).trim(),L=s.getShaderInfoLog(T).trim(),C=1,R=1;if(0==s.getProgramParameter(y,35714)){C=0;var P=it(s,S,"vertex"),O=it(s,T,"fragment");console.error("THREE.WebGLProgram: shader error: ",s.getError(),"35715",s.getProgramParameter(y,35715),"gl.getProgramInfoLog",E,P,O)}else""!==E?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",E):""!==A&&""!==L||(R=0);R&&(this.diagnostics={runnable:C,programLog:E,vertexShader:{log:A,prefix:r},fragmentShader:{log:L,prefix:i}})}return s.detachShader(y,S),s.detachShader(y,T),s.deleteShader(S),s.deleteShader(T),this.getUniforms=function(){return void 0===w&&(w=new tt(s,y)),w},this.getAttributes=function(){return void 0===_&&(_=function(e,t){for(var n={},r=e.getProgramParameter(t,35721),i=0;i<r;i++){var a=e.getActiveAttrib(t,i).name;n[a]=e.getAttribLocation(t,a)}return n}(s,y)),_},this.destroy=function(){s.deleteProgram(y),this.program=void 0},this.name=n.shaderName,this.id=Bs++,this.cacheKey=t,this.usedTimes=1,this.program=y,this.vertexShader=S,this.fragmentShader=T,this}function vt(e,t,n){function r(e){var t;return e?e.isTexture?t=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),t=e.texture.encoding):t=3e3,t}var i=[],a=n.isWebGL2,o=n.logarithmicDepthBuffer,s=n.floatVertexTextures,c=n.precision,l=n.maxVertexUniforms,u=n.vertexTextures,h={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},p=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen"];this.getParameters=function(i,p,d,f,m,g,v){var y=f.fog,x=i.isMeshStandardMaterial?f.environment:null,b=i.envMap||x,w=h[i.type],_=v.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(s)return 1024;var n=Math.min(Math.floor((l-20)/4),t.length);return n<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+n+"."),0):n}(v):0;null!==i.precision&&(c=n.getMaxPrecision(i.precision))!==i.precision&&console.warn("THREE.WebGLProgram.getParameters:",i.precision,"not supported, using",c,"instead.");var M=function(e,t){var n;if(t){var r=Es[t];n={name:e.type,uniforms:ws.clone(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader}}else n={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};return n}(i,w);i.onBeforeCompile(M,e);var S=e.getRenderTarget();return{isWebGL2:a,shaderID:w,shaderName:M.name,uniforms:M.uniforms,vertexShader:M.vertexShader,fragmentShader:M.fragmentShader,defines:i.defines,isRawShaderMaterial:i.isRawShaderMaterial,isShaderMaterial:i.isShaderMaterial,precision:c,instancing:1==v.isInstancedMesh,supportsVertexTextures:u,outputEncoding:null!==S?r(S.texture):e.outputEncoding,map:!!i.map,mapEncoding:r(i.map),matcap:!!i.matcap,matcapEncoding:r(i.matcap),envMap:!!b,envMapMode:b&&b.mapping,envMapEncoding:r(b),envMapCubeUV:!!b&&(306===b.mapping||307===b.mapping),lightMap:!!i.lightMap,lightMapEncoding:r(i.lightMap),aoMap:!!i.aoMap,emissiveMap:!!i.emissiveMap,emissiveMapEncoding:r(i.emissiveMap),bumpMap:!!i.bumpMap,normalMap:!!i.normalMap,objectSpaceNormalMap:1===i.normalMapType,tangentSpaceNormalMap:0===i.normalMapType,clearcoatMap:!!i.clearcoatMap,clearcoatRoughnessMap:!!i.clearcoatRoughnessMap,clearcoatNormalMap:!!i.clearcoatNormalMap,displacementMap:!!i.displacementMap,roughnessMap:!!i.roughnessMap,metalnessMap:!!i.metalnessMap,specularMap:!!i.specularMap,alphaMap:!!i.alphaMap,gradientMap:!!i.gradientMap,sheen:!!i.sheen,combine:i.combine,vertexTangents:i.normalMap&&i.vertexTangents,vertexColors:i.vertexColors,vertexUvs:!!(i.map||i.bumpMap||i.normalMap||i.specularMap||i.alphaMap||i.emissiveMap||i.roughnessMap||i.metalnessMap||i.clearcoatMap||i.clearcoatRoughnessMap||i.clearcoatNormalMap||i.displacementMap),uvsVertexOnly:!(i.map||i.bumpMap||i.normalMap||i.specularMap||i.alphaMap||i.emissiveMap||i.roughnessMap||i.metalnessMap||i.clearcoatNormalMap||!i.displacementMap),fog:!!y,useFog:i.fog,fogExp2:y&&y.isFogExp2,flatShading:i.flatShading,sizeAttenuation:i.sizeAttenuation,logarithmicDepthBuffer:o,skinning:i.skinning&&_>0,maxBones:_,useVertexTexture:s,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:p.directional.length,numPointLights:p.point.length,numSpotLights:p.spot.length,numRectAreaLights:p.rectArea.length,numHemiLights:p.hemi.length,numDirLightShadows:p.directionalShadowMap.length,numPointLightShadows:p.pointShadowMap.length,numSpotLightShadows:p.spotShadowMap.length,numClippingPlanes:m,numClipIntersection:g,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&d.length>0,shadowMapType:e.shadowMap.type,toneMapping:i.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:2===i.side,flipSided:1===i.side,depthPacking:void 0!==i.depthPacking?i.depthPacking:0,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:a||null!==t.get("EXT_frag_depth"),rendererExtensionDrawBuffers:a||null!==t.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:a||null!==t.get("EXT_shader_texture_lod"),onBeforeCompile:i.onBeforeCompile}},this.getProgramCacheKey=function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var r in t.defines)n.push(r),n.push(t.defines[r]);if(void 0===t.isRawShaderMaterial){for(var i=0;i<70;i++)n.push(t[p[i]]);n.push(e.outputEncoding),n.push(e.gammaFactor)}return n.push(t.onBeforeCompile.toString()),n.join()},this.acquireProgram=function(t,n){for(var r,a=0,o=i.length;a<o;a++){var s=i[a];if(s.cacheKey===n){++(r=s).usedTimes;break}}return void 0===r&&(r=new gt(e,n,t),i.push(r)),r},this.releaseProgram=function(e){if(0==--e.usedTimes){var t=i.indexOf(e);i[t]=i[i.length-1],i.pop(),e.destroy()}},this.programs=i}function yt(){var e=new WeakMap;return{get:function(t){var n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new WeakMap}}}function xt(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function bt(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function wt(){function e(e,r,i,o,s,c){var l=t[n];return void 0===l?(l={id:e.id,object:e,geometry:r,material:i,program:i.program||a,groupOrder:o,renderOrder:e.renderOrder,z:s,group:c},t[n]=l):(l.id=e.id,l.object=e,l.geometry=r,l.material=i,l.program=i.program||a,l.groupOrder=o,l.renderOrder=e.renderOrder,l.z=s,l.group=c),n++,l}var t=[],n=0,r=[],i=[],a={id:-1};return{opaque:r,transparent:i,init:function(){n=0,r.length=0,i.length=0},push:function(t,n,a,o,s,c){var l=e(t,n,a,o,s,c);(1==a.transparent?i:r).push(l)},unshift:function(t,n,a,o,s,c){var l=e(t,n,a,o,s,c);(1==a.transparent?i:r).unshift(l)},finish:function(){for(var e=n,r=t.length;e<r;e++){var i=t[e];if(null===i.id)break;i.id=null,i.object=null,i.geometry=null,i.material=null,i.program=null,i.group=null}},sort:function(e,t){r.length>1&&r.sort(e||xt),i.length>1&&i.sort(t||bt)}}}function _t(){function e(n){var r=n.target;r.removeEventListener("dispose",e),t.delete(r)}var t=new WeakMap;return{get:function(n,r){var i,a=t.get(n);return void 0===a?(i=new wt,t.set(n,new WeakMap),t.get(n).set(r,i),n.addEventListener("dispose",e)):void 0===(i=a.get(r))&&(i=new wt,a.set(r,i)),i},dispose:function(){t=new WeakMap}}}function Mt(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new c,color:new b};break;case"SpotLight":n={position:new c,direction:new c,color:new b,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new c,color:new b,distance:0,decay:0};break;case"HemisphereLight":n={direction:new c,skyColor:new b,groundColor:new b};break;case"RectAreaLight":n={color:new b,position:new c,halfWidth:new c,halfHeight:new c}}return e[t.id]=n,n}}}function St(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Tt(){for(var e,n=new Mt,r=(e={},{get:function(n){if(void 0!==e[n.id])return e[n.id];var r;switch(n.type){case"DirectionalLight":case"SpotLight":r={shadowBias:0,shadowRadius:1,shadowMapSize:new t};break;case"PointLight":r={shadowBias:0,shadowRadius:1,shadowMapSize:new t,shadowCameraNear:1,shadowCameraFar:1e3}}return e[n.id]=r,r}}),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},a=0;a<9;a++)i.probe.push(new c);var o=new c,s=new l,u=new l;return{setup:function(e,t,a){for(var c=0,l=0,h=0,p=0;p<9;p++)i.probe[p].set(0,0,0);var d=0,f=0,m=0,g=0,v=0,y=0,x=0,b=0,w=a.matrixWorldInverse;e.sort(St),p=0;for(var _=e.length;p<_;p++){var M=e[p],S=M.color,T=M.intensity,E=M.distance,A=M.shadow&&M.shadow.map?M.shadow.map.texture:null;if(M.isAmbientLight)c+=S.r*T,l+=S.g*T,h+=S.b*T;else if(M.isLightProbe)for(var L=0;L<9;L++)i.probe[L].addScaledVector(M.sh.coefficients[L],T);else if(M.isDirectionalLight){if((P=n.get(M)).color.copy(M.color).multiplyScalar(M.intensity),P.direction.setFromMatrixPosition(M.matrixWorld),o.setFromMatrixPosition(M.target.matrixWorld),P.direction.sub(o),P.direction.transformDirection(w),M.castShadow){var C=M.shadow;(R=r.get(M)).shadowBias=C.bias,R.shadowRadius=C.radius,R.shadowMapSize=C.mapSize,i.directionalShadow[d]=R,i.directionalShadowMap[d]=A,i.directionalShadowMatrix[d]=M.shadow.matrix,y++}i.directional[d]=P,d++}else if(M.isSpotLight)(P=n.get(M)).position.setFromMatrixPosition(M.matrixWorld),P.position.applyMatrix4(w),P.color.copy(S).multiplyScalar(T),P.distance=E,P.direction.setFromMatrixPosition(M.matrixWorld),o.setFromMatrixPosition(M.target.matrixWorld),P.direction.sub(o),P.direction.transformDirection(w),P.coneCos=Math.cos(M.angle),P.penumbraCos=Math.cos(M.angle*(1-M.penumbra)),P.decay=M.decay,M.castShadow&&(C=M.shadow,(R=r.get(M)).shadowBias=C.bias,R.shadowRadius=C.radius,R.shadowMapSize=C.mapSize,i.spotShadow[m]=R,i.spotShadowMap[m]=A,i.spotShadowMatrix[m]=M.shadow.matrix,b++),i.spot[m]=P,m++;else if(M.isRectAreaLight)(P=n.get(M)).color.copy(S).multiplyScalar(T),P.position.setFromMatrixPosition(M.matrixWorld),P.position.applyMatrix4(w),u.identity(),s.copy(M.matrixWorld),s.premultiply(w),u.extractRotation(s),P.halfWidth.set(.5*M.width,0,0),P.halfHeight.set(0,.5*M.height,0),P.halfWidth.applyMatrix4(u),P.halfHeight.applyMatrix4(u),i.rectArea[g]=P,g++;else if(M.isPointLight){var R;(P=n.get(M)).position.setFromMatrixPosition(M.matrixWorld),P.position.applyMatrix4(w),P.color.copy(M.color).multiplyScalar(M.intensity),P.distance=M.distance,P.decay=M.decay,M.castShadow&&(C=M.shadow,(R=r.get(M)).shadowBias=C.bias,R.shadowRadius=C.radius,R.shadowMapSize=C.mapSize,R.shadowCameraNear=C.camera.near,R.shadowCameraFar=C.camera.far,i.pointShadow[f]=R,i.pointShadowMap[f]=A,i.pointShadowMatrix[f]=M.shadow.matrix,x++),i.point[f]=P,f++}else if(M.isHemisphereLight){var P;(P=n.get(M)).direction.setFromMatrixPosition(M.matrixWorld),P.direction.transformDirection(w),P.direction.normalize(),P.skyColor.copy(M.color).multiplyScalar(T),P.groundColor.copy(M.groundColor).multiplyScalar(T),i.hemi[v]=P,v++}}i.ambient[0]=c,i.ambient[1]=l,i.ambient[2]=h;var O=i.hash;O.directionalLength===d&&O.pointLength===f&&O.spotLength===m&&O.rectAreaLength===g&&O.hemiLength===v&&O.numDirectionalShadows===y&&O.numPointShadows===x&&O.numSpotShadows===b||(i.directional.length=d,i.spot.length=m,i.rectArea.length=g,i.point.length=f,i.hemi.length=v,i.directionalShadow.length=y,i.directionalShadowMap.length=y,i.pointShadow.length=x,i.pointShadowMap.length=x,i.spotShadow.length=b,i.spotShadowMap.length=b,i.directionalShadowMatrix.length=y,i.pointShadowMatrix.length=x,i.spotShadowMatrix.length=b,O.directionalLength=d,O.pointLength=f,O.spotLength=m,O.rectAreaLength=g,O.hemiLength=v,O.numDirectionalShadows=y,O.numPointShadows=x,O.numSpotShadows=b,i.version=ks++)},state:i}}function Et(){var e=new Tt,t=[],n=[];return{init:function(){t.length=0,n.length=0},state:{lightsArray:t,shadowsArray:n,lights:e},setupLights:function(r){e.setup(t,n,r)},pushLight:function(e){t.push(e)},pushShadow:function(e){n.push(e)}}}function At(){function e(n){var r=n.target;r.removeEventListener("dispose",e),t.delete(r)}var t=new WeakMap;return{get:function(n,r){var i;return 0==t.has(n)?(i=new Et,t.set(n,new WeakMap),t.get(n).set(r,i),n.addEventListener("dispose",e)):0==t.get(n).has(r)?(i=new Et,t.get(n).set(r,i)):i=t.get(n).get(r),i},dispose:function(){t=new WeakMap}}}function Lt(e){T.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=0,this.morphTargets=0,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=0,this.wireframeLinewidth=1,this.fog=0,this.setValues(e)}function Ct(e){T.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new c,this.nearDistance=1,this.farDistance=1e3,this.skinning=0,this.morphTargets=0,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=0,this.setValues(e)}function Rt(e,n,r){function o(t,r){var i=n.update(_);x.uniforms.shadow_pass.value=t.map.texture,x.uniforms.resolution.value=t.mapSize,x.uniforms.radius.value=t.radius,e.setRenderTarget(t.mapPass),e.clear(),e.renderBufferDirect(r,null,i,x,_,null),b.uniforms.shadow_pass.value=t.mapPass.texture,b.uniforms.resolution.value=t.mapSize,b.uniforms.radius.value=t.radius,e.setRenderTarget(t.map),e.clear(),e.renderBufferDirect(r,null,i,b,_,null)}function s(e,t,n){var r=e<<0|t<<1|n<<2,i=m[r];return void 0===i&&(i=new Lt({depthPacking:3201,morphTargets:e,skinning:t}),m[r]=i),i}function c(e,t,n){var r=e<<0|t<<1|n<<2,i=g[r];return void 0===i&&(i=new Ct({morphTargets:e,skinning:t}),g[r]=i),i}function l(t,n,r,i,a,o){var l=t.geometry,u=null,h=s,p=t.customDepthMaterial;if(1==r.isPointLight&&(h=c,p=t.customDistanceMaterial),void 0===p){var d=0;1==n.morphTargets&&(1==l.isBufferGeometry?d=l.morphAttributes&&l.morphAttributes.position&&l.morphAttributes.position.length>0:1==l.isGeometry&&(d=l.morphTargets&&l.morphTargets.length>0));var f=0;1==t.isSkinnedMesh&&(1==n.skinning?f=1:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),u=h(d,f,1==t.isInstancedMesh)}else u=p;if(e.localClippingEnabled&&1==n.clipShadows&&0!==n.clippingPlanes.length){var m=u.uuid,g=n.uuid,x=v[m];void 0===x&&(x={},v[m]=x);var b=x[g];void 0===b&&(b=u.clone(),x[g]=b),u=b}return u.visible=n.visible,u.wireframe=n.wireframe,u.side=3===o?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:y[n.side],u.clipShadows=n.clipShadows,u.clippingPlanes=n.clippingPlanes,u.clipIntersection=n.clipIntersection,u.wireframeLinewidth=n.wireframeLinewidth,u.linewidth=n.linewidth,1==r.isPointLight&&1==u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(r.matrixWorld),u.nearDistance=i,u.farDistance=a),u}function u(t,r,i,a,o){if(0!=t.visible){if(t.layers.test(r.layers)&&(t.isMesh||t.isLine||t.isPoints)&&(t.castShadow||t.receiveShadow&&3===o)&&(!t.frustumCulled||h.intersectsObject(t))){t.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld);var s=n.update(t),c=t.material;if(Array.isArray(c))for(var p=s.groups,d=0,f=p.length;d<f;d++){var m=p[d],g=c[m.materialIndex];if(g&&g.visible){var v=l(t,g,a,i.near,i.far,o);e.renderBufferDirect(i,null,s,v,t,m)}}else c.visible&&(v=l(t,c,a,i.near,i.far,o),e.renderBufferDirect(i,null,s,v,t,null))}for(var y=t.children,x=0,b=y.length;x<b;x++)u(y[x],r,i,a,o)}}var h=new Q,p=new t,d=new t,f=new i,m=[],g=[],v={},y={0:1,1:0,2:2},x=new q({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new t},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),b=x.clone();b.defines.HORIZONAL_PASS=1;var w=new F;w.setAttribute("position",new A(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var _=new H(w,x),M=this;this.enabled=0,this.autoUpdate=1,this.needsUpdate=0,this.type=1,this.render=function(t,n,i){if(0!=M.enabled&&(0!=M.autoUpdate||0!=M.needsUpdate)&&0!==t.length){var s=e.getRenderTarget(),c=e.getActiveCubeFace(),l=e.getActiveMipmapLevel(),m=e.state;m.setBlending(0),m.buffers.color.setClear(1,1,1,1),m.buffers.depth.setTest(1),m.setScissorTest(0);for(var g=0,v=t.length;g<v;g++){var y=t[g],x=y.shadow;if(void 0!==x){p.copy(x.mapSize);var b=x.getFrameExtents();if(p.multiply(b),d.copy(x.mapSize),(p.x>r||p.y>r)&&(console.warn("THREE.WebGLShadowMap:",y,"has shadow exceeding max texture size, reducing"),p.x>r&&(d.x=Math.floor(r/b.x),p.x=d.x*b.x,x.mapSize.x=d.x),p.y>r&&(d.y=Math.floor(r/b.y),p.y=d.y*b.y,x.mapSize.y=d.y)),null===x.map&&!x.isPointLightShadow&&3===this.type){var w={minFilter:1006,magFilter:1006,format:1023};x.map=new a(p.x,p.y,w),x.map.texture.name=y.name+".shadowMap",x.mapPass=new a(p.x,p.y,w),x.camera.updateProjectionMatrix()}null===x.map&&(w={minFilter:1003,magFilter:1003,format:1023},x.map=new a(p.x,p.y,w),x.map.texture.name=y.name+".shadowMap",x.camera.updateProjectionMatrix()),e.setRenderTarget(x.map),e.clear();for(var _=x.getViewportCount(),S=0;S<_;S++){var T=x.getViewport(S);f.set(d.x*T.x,d.y*T.y,d.x*T.z,d.y*T.w),m.viewport(f),x.updateMatrices(y,S),h=x.getFrustum(),u(n,i,x.camera,y,this.type)}x.isPointLightShadow||3!==this.type||o(x,i)}else console.warn("THREE.WebGLShadowMap:",y,"has no shadow.")}M.needsUpdate=0,e.setRenderTarget(s,c,l)}}}function Pt(e,t,n){function r(t,n,r){var i=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var o=0;o<r;o++)e.texImage2D(n+o,0,6408,1,1,0,6408,5121,i);return a}function a(n,r){y[n]=1,0===x[n]&&(e.enableVertexAttribArray(n),x[n]=1),b[n]!==r&&((d?e:t.get("ANGLE_instanced_arrays"))[d?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,r),b[n]=r)}function o(t){1!=w[t]&&(e.enable(t),w[t]=1)}function s(t){0!=w[t]&&(e.disable(t),w[t]=0)}function c(t,n,r,i,a,c,l,u){if(0!==t){if(M||(o(3042),M=1),5===t)a=a||n,c=c||r,l=l||i,n===T&&a===L||(e.blendEquationSeparate(q[n],q[a]),T=n,L=a),r===E&&i===A&&c===C&&l===R||(e.blendFuncSeparate(Y[r],Y[i],Y[c],Y[l]),E=r,A=i,C=c,R=l),S=t,P=null;else if(t!==S||u!==P){if(100===T&&100===L||(e.blendEquation(32774),T=100,L=100),u)switch(t){case 1:e.blendFuncSeparate(1,771,1,771);break;case 2:e.blendFunc(1,1);break;case 3:e.blendFuncSeparate(0,0,769,771);break;case 4:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case 1:e.blendFuncSeparate(770,771,1,771);break;case 2:e.blendFunc(770,1);break;case 3:e.blendFunc(0,769);break;case 4:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}E=null,A=null,C=null,R=null,S=t,P=u}}else M&&(s(3042),M=0)}function l(t){O!==t&&(t?e.frontFace(2304):e.frontFace(2305),O=t)}function u(t){0!==t?(o(2884),t!==N&&(1===t?e.cullFace(1029):2===t?e.cullFace(1028):e.cullFace(1032))):s(2884),N=t}function h(t,n,r){t?(o(32823),I===n&&z===r||(e.polygonOffset(n,r),I=n,z=r)):s(32823)}function p(t){void 0===t&&(t=33984+B-1),k!==t&&(e.activeTexture(t),k=t)}var d=n.isWebGL2,f=new function(){var t=0,n=new i,r=null,a=new i(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,i,o,s){1==s&&(t*=o,r*=o,i*=o),n.set(t,r,i,o),0==a.equals(n)&&(e.clearColor(t,r,i,o),a.copy(n))},reset:function(){t=0,r=null,a.set(-1,0,0,0)}}},m=new function(){var t=0,n=null,r=null,i=null;return{setTest:function(e){e?o(2929):s(2929)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case 0:e.depthFunc(512);break;case 1:e.depthFunc(519);break;case 2:e.depthFunc(513);break;case 3:e.depthFunc(515);break;case 4:e.depthFunc(514);break;case 5:e.depthFunc(518);break;case 6:e.depthFunc(516);break;case 7:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=0,n=null,r=null,i=null}}},g=new function(){var t=0,n=null,r=null,i=null,a=null,c=null,l=null,u=null,h=null;return{setTest:function(e){t||(e?o(2960):s(2960))},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,o){r===t&&i===n&&a===o||(e.stencilFunc(t,n,o),r=t,i=n,a=o)},setOp:function(t,n,r){c===t&&l===n&&u===r||(e.stencilOp(t,n,r),c=t,l=n,u=r)},setLocked:function(e){t=e},setClear:function(t){h!==t&&(e.clearStencil(t),h=t)},reset:function(){t=0,n=null,r=null,i=null,a=null,c=null,l=null,u=null,h=null}}},v=e.getParameter(34921),y=new Uint8Array(v),x=new Uint8Array(v),b=new Uint8Array(v),w={},_=null,M=null,S=null,T=null,E=null,A=null,L=null,C=null,R=null,P=0,O=null,N=null,D=null,I=null,z=null,B=e.getParameter(35661),U=0,F=0,H=e.getParameter(7938);-1!==H.indexOf("WebGL")?(F=parseFloat(/^WebGL\ ([0-9])/.exec(H)[1]),U=F>=1):-1!==H.indexOf("OpenGL ES")&&(F=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(H)[1]),U=F>=2);var k=null,G={},j=new i,V=new i,W={};W[3553]=r(3553,3553,1),W[34067]=r(34067,34069,6),f.setClear(0,0,0,1),m.setClear(1),g.setClear(0),o(2929),m.setFunc(3),l(0),u(1),o(2884),c(0);var q={100:32774,101:32778,102:32779};if(d)q[103]=32775,q[104]=32776;else{var X=t.get("EXT_blend_minmax");null!==X&&(q[103]=X.MIN_EXT,q[104]=X.MAX_EXT)}var Y={200:0,201:1,202:768,204:770,210:776,208:774,206:772,203:769,205:771,209:775,207:773};return{buffers:{color:f,depth:m,stencil:g},initAttributes:function(){for(var e=0,t=y.length;e<t;e++)y[e]=0},enableAttribute:function(e){a(e,0)},enableAttributeAndDivisor:a,disableUnusedAttributes:function(){for(var t=0,n=x.length;t!==n;++t)x[t]!==y[t]&&(e.disableVertexAttribArray(t),x[t]=0)},enable:o,disable:s,useProgram:function(t){return _!==t?(e.useProgram(t),_=t,1):0},setBlending:c,setMaterial:function(e,t){2===e.side?s(2884):o(2884);var n=1===e.side;t&&(n=!n),l(n),1===e.blending&&0==e.transparent?c(0):c(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),m.setFunc(e.depthFunc),m.setTest(e.depthTest),m.setMask(e.depthWrite),f.setMask(e.colorWrite);var r=e.stencilWrite;g.setTest(r),r&&(g.setMask(e.stencilWriteMask),g.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),g.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),h(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)},setFlipSided:l,setCullFace:u,setLineWidth:function(t){t!==D&&(U&&e.lineWidth(t),D=t)},setPolygonOffset:h,setScissorTest:function(e){e?o(3089):s(3089)},activeTexture:p,bindTexture:function(t,n){null===k&&p();var r=G[k];void 0===r&&(r={type:void 0,texture:void 0},G[k]=r),r.type===t&&r.texture===n||(e.bindTexture(t,n||W[t]),r.type=t,r.texture=n)},unbindTexture:function(){var t=G[k];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){0==j.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),j.copy(t))},viewport:function(t){0==V.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),V.copy(t))},reset:function(){for(var t=0;t<x.length;t++)1===x[t]&&(e.disableVertexAttribArray(t),x[t]=0);w={},k=null,G={},_=null,S=null,O=null,N=null,f.reset(),m.reset(),g.reset()}}}function Ot(e,t,n,r,i,a,o){function s(e,t){return O?new OffscreenCanvas(e,t):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function c(e,t,n,r){var i=1;if((e.width>r||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||1==t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var a=t?Na.floorPowerOfTwo:Math.floor,o=a(i*e.width),c=a(i*e.height);void 0===T&&(T=s(o,c));var l=n?s(o,c):T;return l.width=o,l.height=c,l.getContext("2d").drawImage(e,0,0,o,c),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+c+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function l(e){return Na.isPowerOfTwo(e.width)&&Na.isPowerOfTwo(e.height)}function u(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function h(t,n,i,a){e.generateMipmap(t),r.get(n).__maxMipLevel=Math.log(Math.max(i,a))*Math.LOG2E}function p(n,r,i){if(0==E)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var a=r;return 6403===r&&(5126===i&&(a=33326),5131===i&&(a=33325),5121===i&&(a=33321)),6407===r&&(5126===i&&(a=34837),5131===i&&(a=34843),5121===i&&(a=32849)),6408===r&&(5126===i&&(a=34836),5131===i&&(a=34842),5121===i&&(a=32856)),33325!==a&&33326!==a&&34842!==a&&34836!==a||t.get("EXT_color_buffer_float"),a}function d(e){return 1003===e||1004===e||1005===e?9728:9729}function f(t){var n=t.target;n.removeEventListener("dispose",f),function(t){var n=r.get(t);void 0!==n.__webglInit&&(e.deleteTexture(n.__webglTexture),r.remove(t))}(n),n.isVideoTexture&&P.delete(n),o.memory.textures--}function m(t){var n=t.target;n.removeEventListener("dispose",m),function(t){var n=r.get(t),i=r.get(t.texture);if(t){if(void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(var a=0;a<6;a++)e.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[a]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&e.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(t.texture),r.remove(t)}}(n),o.memory.textures--}function g(e,t){var i=r.get(e);if(e.isVideoTexture&&function(e){var t=o.render.frame;P.get(e)!==t&&(P.set(e,t),e.update())}(e),e.version>0&&i.__version!==e.version){var a=e.image;if(void 0===a)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(0!=a.complete)return void w(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,i.__webglTexture)}function v(t,i){if(6===t.image.length){var o=r.get(t);if(t.version>0&&o.__version!==t.version){b(o,t),n.activeTexture(33984+i),n.bindTexture(34067,o.__webglTexture),e.pixelStorei(37440,t.flipY);for(var s=t&&(t.isCompressedTexture||t.image[0].isCompressedTexture),d=t.image[0]&&t.image[0].isDataTexture,f=[],m=0;m<6;m++)f[m]=s||d?d?t.image[m].image:t.image[m]:c(t.image[m],0,1,L);var g,v=f[0],y=l(v)||E,w=a.convert(t.format),_=a.convert(t.type),M=p(t.internalFormat,w,_);if(x(34067,t,y),s){for(m=0;m<6;m++){g=f[m].mipmaps;for(var S=0;S<g.length;S++){var T=g[S];1023!==t.format&&1022!==t.format?null!==w?n.compressedTexImage2D(34069+m,S,M,T.width,T.height,0,T.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+m,S,M,T.width,T.height,0,w,_,T.data)}}o.__maxMipLevel=g.length-1}else{for(g=t.mipmaps,m=0;m<6;m++)if(d)for(n.texImage2D(34069+m,0,M,f[m].width,f[m].height,0,w,_,f[m].data),S=0;S<g.length;S++){var A=(T=g[S]).image[m].image;n.texImage2D(34069+m,S+1,M,A.width,A.height,0,w,_,A.data)}else for(n.texImage2D(34069+m,0,M,w,_,f[m]),S=0;S<g.length;S++)T=g[S],n.texImage2D(34069+m,S+1,M,w,_,T.image[m]);o.__maxMipLevel=g.length}u(t,y)&&h(34067,t,v.width,v.height),o.__version=t.version,t.onUpdate&&t.onUpdate(t)}else n.activeTexture(33984+i),n.bindTexture(34067,o.__webglTexture)}}function y(e,t){n.activeTexture(33984+t),n.bindTexture(34067,r.get(e).__webglTexture)}function x(n,a,o){o?(e.texParameteri(n,10242,D[a.wrapS]),e.texParameteri(n,10243,D[a.wrapT]),32879!==n&&35866!==n||e.texParameteri(n,32882,D[a.wrapR]),e.texParameteri(n,10240,I[a.magFilter]),e.texParameteri(n,10241,I[a.minFilter])):(e.texParameteri(n,10242,33071),e.texParameteri(n,10243,33071),32879!==n&&35866!==n||e.texParameteri(n,32882,33071),1001===a.wrapS&&1001===a.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,10240,d(a.magFilter)),e.texParameteri(n,10241,d(a.minFilter)),1003!==a.minFilter&&1006!==a.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var s=t.get("EXT_texture_filter_anisotropic");if(s){if(1015===a.type&&null===t.get("OES_texture_float_linear"))return;if(1016===a.type&&null===(E||t.get("OES_texture_half_float_linear")))return;(a.anisotropy>1||r.get(a).__currentAnisotropy)&&(e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function b(t,n){void 0===t.__webglInit&&(t.__webglInit=1,n.addEventListener("dispose",f),t.__webglTexture=e.createTexture(),o.memory.textures++)}function w(t,r,i){var o=3553;r.isDataTexture2DArray&&(o=35866),r.isDataTexture3D&&(o=32879),b(t,r),n.activeTexture(33984+i),n.bindTexture(o,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);var s=function(e){return E?0:1001!==e.wrapS||1001!==e.wrapT||1003!==e.minFilter&&1006!==e.minFilter}(r)&&0==l(r.image),d=c(r.image,s,0,C),f=l(d)||E,m=a.convert(r.format),g=a.convert(r.type),v=p(r.internalFormat,m,g);x(o,r,f);var y,w=r.mipmaps;if(r.isDepthTexture)v=6402,E?v=1015===r.type?36012:1014===r.type?33190:1020===r.type?35056:33189:1015===r.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===r.format&&6402===v&&1012!==r.type&&1014!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=1012,g=a.convert(r.type)),1027===r.format&&6402===v&&(v=34041,1020!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=1020,g=a.convert(r.type))),n.texImage2D(3553,0,v,d.width,d.height,0,m,g,null);else if(r.isDataTexture)if(w.length>0&&f){for(var _=0,M=w.length;_<M;_++)y=w[_],n.texImage2D(3553,_,v,y.width,y.height,0,m,g,y.data);r.generateMipmaps=0,t.__maxMipLevel=w.length-1}else n.texImage2D(3553,0,v,d.width,d.height,0,m,g,d.data),t.__maxMipLevel=0;else if(r.isCompressedTexture){for(_=0,M=w.length;_<M;_++)y=w[_],1023!==r.format&&1022!==r.format?null!==m?n.compressedTexImage2D(3553,_,v,y.width,y.height,0,y.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,_,v,y.width,y.height,0,m,g,y.data);t.__maxMipLevel=w.length-1}else if(r.isDataTexture2DArray)n.texImage3D(35866,0,v,d.width,d.height,d.depth,0,m,g,d.data),t.__maxMipLevel=0;else if(r.isDataTexture3D)n.texImage3D(32879,0,v,d.width,d.height,d.depth,0,m,g,d.data),t.__maxMipLevel=0;else if(w.length>0&&f){for(_=0,M=w.length;_<M;_++)y=w[_],n.texImage2D(3553,_,v,m,g,y);r.generateMipmaps=0,t.__maxMipLevel=w.length-1}else n.texImage2D(3553,0,v,m,g,d),t.__maxMipLevel=0;u(r,f)&&h(o,r,d.width,d.height),t.__version=r.version,r.onUpdate&&r.onUpdate(r)}function _(t,i,o,s){var c=a.convert(i.texture.format),l=a.convert(i.texture.type),u=p(i.texture.internalFormat,c,l);n.texImage2D(s,0,u,i.width,i.height,0,c,l,null),e.bindFramebuffer(36160,t),e.framebufferTexture2D(36160,o,s,r.get(i.texture).__webglTexture,0),e.bindFramebuffer(36160,null)}function M(t,n,r){if(e.bindRenderbuffer(36161,t),n.depthBuffer&&!n.stencilBuffer){var i=33189;if(r){var o=n.depthTexture;o&&o.isDepthTexture&&(1015===o.type?i=36012:1014===o.type&&(i=33190));var s=S(n);e.renderbufferStorageMultisample(36161,s,i,n.width,n.height)}else e.renderbufferStorage(36161,i,n.width,n.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(n.depthBuffer&&n.stencilBuffer)r?(s=S(n),e.renderbufferStorageMultisample(36161,s,35056,n.width,n.height)):e.renderbufferStorage(36161,34041,n.width,n.height),e.framebufferRenderbuffer(36160,33306,36161,t);else{var c=a.convert(n.texture.format),l=a.convert(n.texture.type);i=p(n.texture.internalFormat,c,l),r?(s=S(n),e.renderbufferStorageMultisample(36161,s,i,n.width,n.height)):e.renderbufferStorage(36161,i,n.width,n.height)}e.bindRenderbuffer(36161,null)}function S(e){return E&&e.isWebGLMultisampleRenderTarget?Math.min(R,e.samples):0}var T,E=i.isWebGL2,A=i.maxTextures,L=i.maxCubemapSize,C=i.maxTextureSize,R=i.maxSamples,P=new WeakMap,O=0;try{O="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}var N=0,D={1e3:10497,1001:33071,1002:33648},I={1003:9728,1004:9984,1005:9986,1006:9729,1007:9985,1008:9987},z=0,B=0;this.allocateTextureUnit=function(){var e=N;return e>=A&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+A),N+=1,e},this.resetTextureUnits=function(){N=0},this.setTexture2D=g,this.setTexture2DArray=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?w(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?w(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=v,this.setTextureCubeDynamic=y,this.setupRenderTarget=function(t){var i=r.get(t),s=r.get(t.texture);t.addEventListener("dispose",m),s.__webglTexture=e.createTexture(),o.memory.textures++;var c=1==t.isWebGLCubeRenderTarget,d=1==t.isWebGLMultisampleRenderTarget,f=l(t)||E;if(!E||1022!==t.texture.format||1015!==t.texture.type&&1016!==t.texture.type||(t.texture.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),c){i.__webglFramebuffer=[];for(var v=0;v<6;v++)i.__webglFramebuffer[v]=e.createFramebuffer()}else if(i.__webglFramebuffer=e.createFramebuffer(),d)if(E){i.__webglMultisampledFramebuffer=e.createFramebuffer(),i.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,i.__webglColorRenderbuffer);var y=a.convert(t.texture.format),b=a.convert(t.texture.type),w=p(t.texture.internalFormat,y,b),T=S(t);e.renderbufferStorageMultisample(36161,T,w,t.width,t.height),e.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(i.__webglDepthRenderbuffer=e.createRenderbuffer(),M(i.__webglDepthRenderbuffer,t,1)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(c){for(n.bindTexture(34067,s.__webglTexture),x(34067,t.texture,f),v=0;v<6;v++)_(i.__webglFramebuffer[v],t,36064,34069+v);u(t.texture,f)&&h(34067,t.texture,t.width,t.height),n.bindTexture(34067,null)}else n.bindTexture(3553,s.__webglTexture),x(3553,t.texture,f),_(i.__webglFramebuffer,t,36064,3553),u(t.texture,f)&&h(3553,t.texture,t.width,t.height),n.bindTexture(3553,null);t.depthBuffer&&function(t){var n=r.get(t),i=1==t.isWebGLCubeRenderTarget;if(t.depthTexture){if(i)throw Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLCubeRenderTarget)throw Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=1),g(n.depthTexture,0);var i=r.get(n.depthTexture).__webglTexture;if(1026===n.depthTexture.format)e.framebufferTexture2D(36160,36096,3553,i,0);else{if(1027!==n.depthTexture.format)throw Error("Unknown depthTexture format");e.framebufferTexture2D(36160,33306,3553,i,0)}}(n.__webglFramebuffer,t)}else if(i){n.__webglDepthbuffer=[];for(var a=0;a<6;a++)e.bindFramebuffer(36160,n.__webglFramebuffer[a]),n.__webglDepthbuffer[a]=e.createRenderbuffer(),M(n.__webglDepthbuffer[a],t,0)}else e.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),M(n.__webglDepthbuffer,t,0);e.bindFramebuffer(36160,null)}(t)},this.updateRenderTargetMipmap=function(e){var t=e.texture;if(u(t,l(e)||E)){var i=e.isWebGLCubeRenderTarget?34067:3553,a=r.get(t).__webglTexture;n.bindTexture(i,a),h(i,t,e.width,e.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(E){var n=r.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);var i=t.width,a=t.height,o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024),e.blitFramebuffer(0,0,i,a,0,0,i,a,o,9728),e.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(0==z&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),z=1),e=e.texture),g(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(0==B&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),B=1),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?v(e,t):y(e,t)}}function Nt(e,t,n){var r=n.isWebGL2;return{convert:function(e){var n;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)return r?5131:null!==(n=t.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;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(1029===e)return 36244;if(1030===e)return 33319;if(1031===e)return 33320;if(1032===e)return 36248;if(1033===e)return 36249;if(33776===e||33777===e||33778===e||33779===e){if(null===(n=t.get("WEBGL_compressed_texture_s3tc")))return null;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){if(null===(n=t.get("WEBGL_compressed_texture_pvrtc")))return null;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)return null!==(n=t.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===e||37496===e)&&null!==(n=t.get("WEBGL_compressed_texture_etc"))){if(37492===e)return n.COMPRESSED_RGB8_ETC2;if(37496===e)return n.COMPRESSED_RGBA8_ETC2_EAC}return 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||37840===e||37841===e||37842===e||37843===e||37844===e||37845===e||37846===e||37847===e||37848===e||37849===e||37850===e||37851===e||37852===e||37853===e?null!==(n=t.get("WEBGL_compressed_texture_astc"))?e:null:36492===e?null!==(n=t.get("EXT_texture_compression_bptc"))?e:null:1020===e?r?34042:null!==(n=t.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function Dt(e){Y.call(this),this.cameras=e||[]}function It(){p.call(this),this.type="Group"}function zt(e,t){function n(e){var t=g.get(e.inputSource);t&&(t.targetRay&&t.targetRay.dispatchEvent({type:e.type}),t.grip&&t.grip.dispatchEvent({type:e.type}))}function r(){g.forEach((function(e,t){e.targetRay&&(e.targetRay.dispatchEvent({type:"disconnected",data:t}),e.targetRay.visible=0),e.grip&&(e.grip.dispatchEvent({type:"disconnected",data:t}),e.grip.visible=0)})),g.clear(),e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),T.stop(),l.isPresenting=0,l.dispatchEvent({type:"sessionend"})}function a(e){p=e,T.setContext(u),T.start(),l.isPresenting=1,l.dispatchEvent({type:"sessionstart"})}function o(e){for(var t=u.inputSources,n=0;n<m.length;n++)g.set(t[n],m[n]);for(n=0;n<e.removed.length;n++){var r=e.removed[n];(i=g.get(r))&&(i.targetRay&&i.targetRay.dispatchEvent({type:"disconnected",data:r}),i.grip&&i.grip.dispatchEvent({type:"disconnected",data:r}),g.delete(r))}for(n=0;n<e.added.length;n++){var i;r=e.added[n],(i=g.get(r))&&(i.targetRay&&i.targetRay.dispatchEvent({type:"connected",data:r}),i.grip&&i.grip.dispatchEvent({type:"connected",data:r}))}}function s(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)}var l=this,u=null,h=1,p=null,d="local-floor",f=null,m=[],g=new Map,v=new Y;v.layers.enable(1),v.viewport=new i;var y=new Y;y.layers.enable(2),y.viewport=new i;var x=new Dt([v,y]);x.layers.enable(1),x.layers.enable(2);var b=null,w=null;this.enabled=0,this.isPresenting=0,this.getController=function(e){var t=m[e];return void 0===t&&(t={},m[e]=t),void 0===t.targetRay&&(t.targetRay=new It,t.targetRay.matrixAutoUpdate=0,t.targetRay.visible=0),t.targetRay},this.getControllerGrip=function(e){var t=m[e];return void 0===t&&(t={},m[e]=t),void 0===t.grip&&(t.grip=new It,t.grip.matrixAutoUpdate=0,t.grip.visible=0),t.grip},this.setFramebufferScaleFactor=function(e){h=e,1==l.isPresenting&&console.warn("WebXRManager: Cannot change framebuffer scale while presenting VR content")},this.setReferenceSpaceType=function(e){d=e},this.getReferenceSpace=function(){return p},this.getSession=function(){return u},this.setSession=function(e){if(null!==(u=e)){u.addEventListener("select",n),u.addEventListener("selectstart",n),u.addEventListener("selectend",n),u.addEventListener("squeeze",n),u.addEventListener("squeezestart",n),u.addEventListener("squeezeend",n),u.addEventListener("end",r);var i=t.getContextAttributes(),s={antialias:i.antialias,alpha:i.alpha,depth:i.depth,stencil:i.stencil,framebufferScaleFactor:h},c=new XRWebGLLayer(u,t,s);u.updateRenderState({baseLayer:c}),u.requestReferenceSpace(d).then(a),u.addEventListener("inputsourceschange",o)}};var _=new c,M=new c;this.getCamera=function(e){x.near=y.near=v.near=e.near,x.far=y.far=v.far=e.far,b===x.near&&w===x.far||(u.updateRenderState({depthNear:x.near,depthFar:x.far}),b=x.near,w=x.far);var t=e.parent,n=x.cameras;s(x,t);for(var r=0;r<n.length;r++)s(n[r],t);e.matrixWorld.copy(x.matrixWorld);for(var i=e.children,a=(r=0,i.length);r<a;r++)i[r].updateMatrixWorld(1);return function(e,t,n){_.setFromMatrixPosition(t.matrixWorld),M.setFromMatrixPosition(n.matrixWorld);var r=_.distanceTo(M),i=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),c=(i[9]+1)/i[5],l=(i[9]-1)/i[5],u=(i[8]-1)/i[0],h=(a[8]+1)/a[0],p=o*u,d=o*h,f=r/(-u+h),m=f*-u;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld);var g=o+f,v=s+f,y=p-m,x=d+(r-m),b=c*s/v*g,w=l*s/v*g;e.projectionMatrix.makePerspective(y,x,b,w,g,v)}(x,v,y),x};var S=null,T=new K;T.setAnimationLoop((function(t,n){if(null!==(f=n.getViewerPose(p))){var r=f.views,i=u.renderState.baseLayer;e.setFramebuffer(i.framebuffer);for(var a=0;a<r.length;a++){var o=r[a],s=i.getViewport(o),c=x.cameras[a];c.matrix.fromArray(o.transform.matrix),c.projectionMatrix.fromArray(o.projectionMatrix),c.viewport.set(s.x,s.y,s.width,s.height),0===a&&x.matrix.copy(c.matrix)}}var l=u.inputSources;for(a=0;a<m.length;a++){var h=m[a],d=l[a],g=null,v=null;d&&(h.targetRay&&null!==(g=n.getPose(d.targetRaySpace,p))&&(h.targetRay.matrix.fromArray(g.transform.matrix),h.targetRay.matrix.decompose(h.targetRay.position,h.targetRay.rotation,h.targetRay.scale)),h.grip&&d.gripSpace&&null!==(v=n.getPose(d.gripSpace,p))&&(h.grip.matrix.fromArray(v.transform.matrix),h.grip.matrix.decompose(h.grip.position,h.grip.rotation,h.grip.scale))),h.targetRay&&(h.targetRay.visible=null!==g),h.grip&&(h.grip.visible=null!==v)}S&&S(t,n)})),this.setAnimationLoop=function(e){S=e},this.dispose=function(){}}function Bt(e){function n(){return null===he?Se:1}function r(){P=new se(R),0==(O=new ae(R,P,e)).isWebGL2&&(P.get("WEBGL_depth_texture"),P.get("OES_texture_float"),P.get("OES_texture_half_float"),P.get("OES_texture_half_float_linear"),P.get("OES_standard_derivatives"),P.get("OES_element_index_uint"),P.get("ANGLE_instanced_arrays")),P.get("OES_texture_float_linear"),X=new Nt(R,P,O),(N=new Pt(R,P,O)).scissor(be.copy(Le).multiplyScalar(Se).floor()),N.viewport(xe.copy(Ae).multiplyScalar(Se).floor()),D=new ue(R),I=new yt,z=new Ot(R,P,N,I,O,X,D),B=new ee(R,O),U=new ce(R,B,D),F=new de(R,U,B,D),V=new pe(R),H=new vt(Y,P,O),k=new _t,G=new At,j=new re(Y,N,F,S),W=new ie(R,P,D,O),q=new le(R,P,D,O),D.programs=H.programs,Y.capabilities=O,Y.extensions=P,Y.properties=I,Y.renderLists=k,Y.state=N,Y.info=D}function a(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),Z=1}function o(){console.log("THREE.WebGLRenderer: Context Restored."),Z=0,r()}function s(e){var t=e.target;t.removeEventListener("dispose",s),function(e){u(e),I.remove(e)}(t)}function u(e){var t=I.get(e).program;e.program=void 0,void 0!==t&&H.releaseProgram(t)}function h(e,t,n,r){for(var i=0,a=e.length;i<a;i++){var o=e[i],s=o.object,c=o.geometry,l=void 0===r?o.material:r,u=o.group;if(n.isArrayCamera){ye=n;for(var h=n.cameras,d=0,f=h.length;d<f;d++){var m=h[d];s.layers.test(m.layers)&&(N.viewport(xe.copy(m.viewport)),C.setupLights(m),p(s,t,m,c,l,u))}}else ye=null,p(s,t,n,c,l,u)}}function p(e,t,n,r,i,a){if(e.onBeforeRender(Y,t,n,r,i,a),C=G.get(t,ye||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){var o=m(n,t,i,e);N.setMaterial(i),ge.geometry=null,ge.program=null,ge.wireframe=0,function(e,t){e.render((function(e){Y.renderBufferImmediate(e,t)}))}(e,o)}else Y.renderBufferDirect(n,t,r,i,e,a);e.onAfterRender(Y,t,n,r,i,a),C=G.get(t,ye||n)}function f(e,t,n){var r=I.get(e),i=C.state.lights,a=C.state.shadowsArray,o=i.state.version,c=H.getParameters(e,i.state,a,t,Pe.numPlanes,Pe.numIntersection,n),l=H.getProgramCacheKey(c),h=r.program,p=1;if(void 0===h)e.addEventListener("dispose",s);else if(h.cacheKey!==l)u(e);else if(r.lightsStateVersion!==o)r.lightsStateVersion=o,p=0;else{if(void 0!==c.shaderID)return;p=0}p&&(h=H.acquireProgram(c,l),r.program=h,r.uniforms=c.uniforms,r.environment=e.isMeshStandardMaterial?t.environment:null,r.outputEncoding=Y.outputEncoding,e.program=h);var d=h.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var f=0;f<Y.maxMorphTargets;f++)d["morphTarget"+f]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals)for(e.numSupportedMorphNormals=0,f=0;f<Y.maxMorphNormals;f++)d["morphNormal"+f]>=0&&e.numSupportedMorphNormals++;var m=r.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&1!=e.clipping||(r.numClippingPlanes=Pe.numPlanes,r.numIntersection=Pe.numIntersection,m.clippingPlanes=Pe.uniform),r.fog=t.fog,r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&1==e.lights}(e),r.lightsStateVersion=o,r.needsLights&&(m.ambientLightColor.value=i.state.ambient,m.lightProbe.value=i.state.probe,m.directionalLights.value=i.state.directional,m.directionalLightShadows.value=i.state.directionalShadow,m.spotLights.value=i.state.spot,m.spotLightShadows.value=i.state.spotShadow,m.rectAreaLights.value=i.state.rectArea,m.pointLights.value=i.state.point,m.pointLightShadows.value=i.state.pointShadow,m.hemisphereLights.value=i.state.hemi,m.directionalShadowMap.value=i.state.directionalShadowMap,m.directionalShadowMatrix.value=i.state.directionalShadowMatrix,m.spotShadowMap.value=i.state.spotShadowMap,m.spotShadowMatrix.value=i.state.spotShadowMatrix,m.pointShadowMap.value=i.state.pointShadowMap,m.pointShadowMatrix.value=i.state.pointShadowMatrix);var g=r.program.getUniforms(),v=tt.seqWithValue(g.seq,m);r.uniformsList=v}function m(e,t,n,r){z.resetTextureUnits();var i=t.fog,a=n.isMeshStandardMaterial?t.environment:null,o=I.get(n),s=C.state.lights;if(Oe&&(Ne||e!==ve)){var c=e===ve&&n.id===me;Pe.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,o,c)}n.version===o.__version?void 0===o.program||n.fog&&o.fog!==i||o.environment!==a||o.needsLights&&o.lightsStateVersion!==s.state.version?f(n,t,r):void 0===o.numClippingPlanes||o.numClippingPlanes===Pe.numPlanes&&o.numIntersection===Pe.numIntersection?o.outputEncoding!==Y.outputEncoding&&f(n,t,r):f(n,t,r):(f(n,t,r),o.__version=n.version);var l,u,h=0,p=0,d=0,m=o.program,y=m.getUniforms(),x=o.uniforms;if(N.useProgram(m.program)&&(h=1,p=1,d=1),n.id!==me&&(me=n.id,p=1),h||ve!==e){if(y.setValue(R,"projectionMatrix",e.projectionMatrix),O.logarithmicDepthBuffer&&y.setValue(R,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),ve!==e&&(ve=e,p=1,d=1),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var b=y.map.cameraPosition;void 0!==b&&b.setValue(R,Ie.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&y.setValue(R,"isOrthographic",1==e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&y.setValue(R,"viewMatrix",e.matrixWorldInverse)}if(n.skinning){y.setOptional(R,r,"bindMatrix"),y.setOptional(R,r,"bindMatrixInverse");var w=r.skeleton;if(w){var _=w.bones;if(O.floatVertexTextures){if(void 0===w.boneTexture){var M=Math.sqrt(4*_.length);M=Na.ceilPowerOfTwo(M),M=Math.max(M,4);var S=new Float32Array(M*M*4);S.set(w.boneMatrices);var T=new $(S,M,M,1023,1015);w.boneMatrices=S,w.boneTexture=T,w.boneTextureSize=M}y.setValue(R,"boneTexture",w.boneTexture,z),y.setValue(R,"boneTextureSize",w.boneTextureSize)}else y.setOptional(R,w,"boneMatrices")}}return(p||o.receiveShadow!==r.receiveShadow)&&(o.receiveShadow=r.receiveShadow,y.setValue(R,"receiveShadow",r.receiveShadow)),p&&(y.setValue(R,"toneMappingExposure",Y.toneMappingExposure),y.setValue(R,"toneMappingWhitePoint",Y.toneMappingWhitePoint),o.needsLights&&(u=d,(l=x).ambientLightColor.needsUpdate=u,l.lightProbe.needsUpdate=u,l.directionalLights.needsUpdate=u,l.directionalLightShadows.needsUpdate=u,l.pointLights.needsUpdate=u,l.pointLightShadows.needsUpdate=u,l.spotLights.needsUpdate=u,l.spotLightShadows.needsUpdate=u,l.rectAreaLights.needsUpdate=u,l.hemisphereLights.needsUpdate=u),i&&n.fog&&function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}(x,i),n.isMeshBasicMaterial?g(x,n):n.isMeshLambertMaterial?(g(x,n),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(x,n)):n.isMeshToonMaterial?(g(x,n),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.gradientMap&&(e.gradientMap.value=t.gradientMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(x,n)):n.isMeshPhongMaterial?(g(x,n),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(x,n)):n.isMeshStandardMaterial?(g(x,n,a),n.isMeshPhysicalMaterial?function(e,t,n){v(e,t,n),e.reflectivity.value=t.reflectivity,e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.sheen&&e.sheen.value.copy(t.sheen),t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,1===t.side&&e.clearcoatNormalScale.value.negate()),e.transparency.value=t.transparency}(x,n,a):v(x,n,a)):n.isMeshMatcapMaterial?(g(x,n),function(e,t){t.matcap&&(e.matcap.value=t.matcap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(x,n)):n.isMeshDepthMaterial?(g(x,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(x,n)):n.isMeshDistanceMaterial?(g(x,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(x,n)):n.isMeshNormalMaterial?(g(x,n),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(x,n)):n.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(x,n),n.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(x,n)):n.isPointsMaterial?function(e,t){var n;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*Se,e.scale.value=.5*Me,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.map?n=t.map:t.alphaMap&&(n=t.alphaMap),void 0!==n&&(1==n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(x,n):n.isSpriteMaterial?function(e,t){var n;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.map?n=t.map:t.alphaMap&&(n=t.alphaMap),void 0!==n&&(1==n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(x,n):n.isShadowMaterial&&(x.color.value.copy(n.color),x.opacity.value=n.opacity),void 0!==x.ltc_1&&(x.ltc_1.value=Ss.LTC_1),void 0!==x.ltc_2&&(x.ltc_2.value=Ss.LTC_2),tt.upload(R,o.uniformsList,x,z),n.isShaderMaterial&&(n.uniformsNeedUpdate=0)),n.isShaderMaterial&&1==n.uniformsNeedUpdate&&(tt.upload(R,o.uniformsList,x,z),n.uniformsNeedUpdate=0),n.isSpriteMaterial&&y.setValue(R,"center",r.center),y.setValue(R,"modelViewMatrix",r.modelViewMatrix),y.setValue(R,"normalMatrix",r.normalMatrix),y.setValue(R,"modelMatrix",r.matrixWorld),m}function g(e,t,n){e.opacity.value=t.opacity,t.color&&e.diffuse.value.copy(t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap);var r,i,a=t.envMap||n;a&&(e.envMap.value=a,e.flipEnvMap.value=a.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio,e.maxMipLevel.value=I.get(a).__maxMipLevel),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),t.map?r=t.map:t.specularMap?r=t.specularMap:t.displacementMap?r=t.displacementMap:t.normalMap?r=t.normalMap:t.bumpMap?r=t.bumpMap:t.roughnessMap?r=t.roughnessMap:t.metalnessMap?r=t.metalnessMap:t.alphaMap?r=t.alphaMap:t.emissiveMap&&(r=t.emissiveMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),1==r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix)),t.aoMap?i=t.aoMap:t.lightMap&&(i=t.lightMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),1==i.matrixAutoUpdate&&i.updateMatrix(),e.uv2Transform.value.copy(i.matrix))}function v(e,t,n){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),(t.envMap||n)&&(e.envMapIntensity.value=t.envMapIntensity)}var y=void 0!==(e=e||{}).canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),x=void 0!==e.context?e.context:null,b=void 0!==e.alpha?e.alpha:0,w=void 0!==e.depth?e.depth:1,_=void 0!==e.stencil?e.stencil:1,M=void 0!==e.antialias?e.antialias:0,S=void 0!==e.premultipliedAlpha?e.premultipliedAlpha:1,T=void 0!==e.preserveDrawingBuffer?e.preserveDrawingBuffer:0,E=void 0!==e.powerPreference?e.powerPreference:"default",A=void 0!==e.failIfMajorPerformanceCaveat?e.failIfMajorPerformanceCaveat:0,L=null,C=null;this.domElement=y,this.debug={checkShaderErrors:1},this.autoClear=1,this.autoClearColor=1,this.autoClearDepth=1,this.autoClearStencil=1,this.sortObjects=1,this.clippingPlanes=[],this.localClippingEnabled=0,this.gammaFactor=2,this.outputEncoding=3e3,this.physicallyCorrectLights=0,this.toneMapping=1,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var R,P,O,N,D,I,z,B,U,F,H,k,G,j,V,W,q,X,Y=this,Z=0,J=null,te=0,ne=0,he=null,fe=null,me=-1,ge={geometry:null,program:null,wireframe:0},ve=null,ye=null,xe=new i,be=new i,we=null,_e=y.width,Me=y.height,Se=1,Te=null,Ee=null,Ae=new i(0,0,_e,Me),Le=new i(0,0,_e,Me),Ce=0,Re=new Q,Pe=new oe,Oe=0,Ne=0,De=new l,Ie=new c;try{var ze={alpha:b,depth:w,stencil:_,antialias:M,premultipliedAlpha:S,preserveDrawingBuffer:T,powerPreference:E,failIfMajorPerformanceCaveat:A,xrCompatible:1};if(y.addEventListener("webglcontextlost",a,0),y.addEventListener("webglcontextrestored",o,0),null===(R=x||y.getContext("webgl",ze)||y.getContext("experimental-webgl",ze)))throw null!==y.getContext("webgl")?Error("Error creating WebGL context with your selected attributes."):Error("Error creating WebGL context.");void 0===R.getShaderPrecisionFormat&&(R.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}r();var Be=new zt(Y,R);this.xr=Be;var Ue=new Rt(Y,F,O.maxTextureSize);this.shadowMap=Ue,this.getContext=function(){return R},this.getContextAttributes=function(){return R.getContextAttributes()},this.forceContextLoss=function(){var e=P.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=P.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return Se},this.setPixelRatio=function(e){void 0!==e&&(Se=e,this.setSize(_e,Me,0))},this.getSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),e=new t),e.set(_e,Me)},this.setSize=function(e,t,n){Be.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(_e=e,Me=t,y.width=Math.floor(e*Se),y.height=Math.floor(t*Se),0!=n&&(y.style.width=e+"px",y.style.height=t+"px"),this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),e=new t),e.set(_e*Se,Me*Se).floor()},this.setDrawingBufferSize=function(e,t,n){_e=e,Me=t,Se=n,y.width=Math.floor(e*n),y.height=Math.floor(t*n),this.setViewport(0,0,e,t)},this.getCurrentViewport=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),e=new i),e.copy(xe)},this.getViewport=function(e){return e.copy(Ae)},this.setViewport=function(e,t,n,r){e.isVector4?Ae.set(e.x,e.y,e.z,e.w):Ae.set(e,t,n,r),N.viewport(xe.copy(Ae).multiplyScalar(Se).floor())},this.getScissor=function(e){return e.copy(Le)},this.setScissor=function(e,t,n,r){e.isVector4?Le.set(e.x,e.y,e.z,e.w):Le.set(e,t,n,r),N.scissor(be.copy(Le).multiplyScalar(Se).floor())},this.getScissorTest=function(){return Ce},this.setScissorTest=function(e){N.setScissorTest(Ce=e)},this.setOpaqueSort=function(e){Te=e},this.setTransparentSort=function(e){Ee=e},this.getClearColor=function(){return j.getClearColor()},this.setClearColor=function(){j.setClearColor.apply(j,arguments)},this.getClearAlpha=function(){return j.getClearAlpha()},this.setClearAlpha=function(){j.setClearAlpha.apply(j,arguments)},this.clear=function(e,t,n){var r=0;(void 0===e||e)&&(r|=16384),(void 0===t||t)&&(r|=256),(void 0===n||n)&&(r|=1024),R.clear(r)},this.clearColor=function(){this.clear(1,0,0)},this.clearDepth=function(){this.clear(0,1,0)},this.clearStencil=function(){this.clear(0,0,1)},this.dispose=function(){y.removeEventListener("webglcontextlost",a,0),y.removeEventListener("webglcontextrestored",o,0),k.dispose(),G.dispose(),I.dispose(),F.dispose(),Be.dispose(),ke.stop(),this.forceContextLoss()},this.renderBufferImmediate=function(e,t){N.initAttributes();var n=I.get(e);e.hasPositions&&!n.position&&(n.position=R.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=R.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=R.createBuffer()),e.hasColors&&!n.color&&(n.color=R.createBuffer());var r=t.getAttributes();e.hasPositions&&(R.bindBuffer(34962,n.position),R.bufferData(34962,e.positionArray,35048),N.enableAttribute(r.position),R.vertexAttribPointer(r.position,3,5126,0,0,0)),e.hasNormals&&(R.bindBuffer(34962,n.normal),R.bufferData(34962,e.normalArray,35048),N.enableAttribute(r.normal),R.vertexAttribPointer(r.normal,3,5126,0,0,0)),e.hasUvs&&(R.bindBuffer(34962,n.uv),R.bufferData(34962,e.uvArray,35048),N.enableAttribute(r.uv),R.vertexAttribPointer(r.uv,2,5126,0,0,0)),e.hasColors&&(R.bindBuffer(34962,n.color),R.bufferData(34962,e.colorArray,35048),N.enableAttribute(r.color),R.vertexAttribPointer(r.color,3,5126,0,0,0)),N.disableUnusedAttributes(),R.drawArrays(4,0,e.count),e.count=0};var Fe=new d;this.renderBufferDirect=function(e,t,r,i,a,o){null===t&&(t=Fe);var s=a.isMesh&&a.matrixWorld.determinant()<0,c=m(e,t,i,a);N.setMaterial(i,s);var l=0;ge.geometry===r.id&&ge.program===c.id&&ge.wireframe===(1==i.wireframe)||(ge.geometry=r.id,ge.program=c.id,ge.wireframe=1==i.wireframe,l=1),(i.morphTargets||i.morphNormals)&&(V.update(a,r,i,c),l=1);var u=r.index,h=r.attributes.position;if(null===u){if(void 0===h||0===h.count)return}else if(0===u.count)return;var p,d=1;1==i.wireframe&&(u=U.getWireframeAttribute(r),d=2);var f=W;null!==u&&(p=B.get(u),(f=q).setIndex(p)),l&&(function(e,t,n,r){if(0!=O.isWebGL2||!e.isInstancedMesh&&!t.isInstancedBufferGeometry||null!==P.get("ANGLE_instanced_arrays")){N.initAttributes();var i=t.attributes,a=r.getAttributes(),o=n.defaultAttributeValues;for(var s in a){var c=a[s];if(c>=0){var l=i[s];if(void 0!==l){var u=l.normalized,h=l.itemSize;if(void 0===(y=B.get(l)))continue;var p=y.buffer,d=y.type,f=y.bytesPerElement;if(l.isInterleavedBufferAttribute){var m=l.data,g=m.stride,v=l.offset;m&&m.isInstancedInterleavedBuffer?(N.enableAttributeAndDivisor(c,m.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=m.meshPerAttribute*m.count)):N.enableAttribute(c),R.bindBuffer(34962,p),R.vertexAttribPointer(c,h,d,u,g*f,v*f)}else l.isInstancedBufferAttribute?(N.enableAttributeAndDivisor(c,l.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=l.meshPerAttribute*l.count)):N.enableAttribute(c),R.bindBuffer(34962,p),R.vertexAttribPointer(c,h,d,u,0,0)}else if("instanceMatrix"===s){var y;if(void 0===(y=B.get(e.instanceMatrix)))continue;p=y.buffer,d=y.type,N.enableAttributeAndDivisor(c+0,1),N.enableAttributeAndDivisor(c+1,1),N.enableAttributeAndDivisor(c+2,1),N.enableAttributeAndDivisor(c+3,1),R.bindBuffer(34962,p),R.vertexAttribPointer(c+0,4,d,0,64,0),R.vertexAttribPointer(c+1,4,d,0,64,16),R.vertexAttribPointer(c+2,4,d,0,64,32),R.vertexAttribPointer(c+3,4,d,0,64,48)}else if(void 0!==o){var x=o[s];if(void 0!==x)switch(x.length){case 2:R.vertexAttrib2fv(c,x);break;case 3:R.vertexAttrib3fv(c,x);break;case 4:R.vertexAttrib4fv(c,x);break;default:R.vertexAttrib1fv(c,x)}}}}N.disableUnusedAttributes()}}(a,r,i,c),null!==u&&R.bindBuffer(34963,p.buffer));var g=null!==u?u.count:h.count,v=r.drawRange.start*d,y=r.drawRange.count*d,x=null!==o?o.start*d:0,b=null!==o?o.count*d:1/0,w=Math.max(v,x),_=Math.max(0,Math.min(g,v+y,x+b)-1-w+1);if(0!==_){if(a.isMesh)1==i.wireframe?(N.setLineWidth(i.wireframeLinewidth*n()),f.setMode(1)):f.setMode(4);else if(a.isLine){var M=i.linewidth;void 0===M&&(M=1),N.setLineWidth(M*n()),a.isLineSegments?f.setMode(1):a.isLineLoop?f.setMode(2):f.setMode(3)}else a.isPoints?f.setMode(0):a.isSprite&&f.setMode(4);a.isInstancedMesh?f.renderInstances(r,w,_,a.count):r.isInstancedBufferGeometry?f.renderInstances(r,w,_,r.maxInstancedCount):f.render(w,_)}},this.compile=function(e,t){(C=G.get(e,t)).init(),e.traverse((function(e){e.isLight&&(C.pushLight(e),e.castShadow&&C.pushShadow(e))})),C.setupLights(t);var n={};e.traverse((function(t){if(t.material)if(Array.isArray(t.material))for(var r=0;r<t.material.length;r++)t.material[r].uuid in n==0&&(f(t.material[r],e,t),n[t.material[r].uuid]=1);else t.material.uuid in n==0&&(f(t.material,e,t),n[t.material.uuid]=1)}))};var He=null,ke=new K;ke.setAnimationLoop((function(e){Be.isPresenting||He&&He(e)})),"undefined"!=typeof window&&ke.setContext(window),this.setAnimationLoop=function(e){He=e,Be.setAnimationLoop(e),ke.start()},this.render=function(e,t,n,r){var i,a;if(void 0!==n&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),i=n),void 0!==r&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),a=r),t&&t.isCamera){if(!Z){ge.geometry=null,ge.program=null,ge.wireframe=0,me=-1,ve=null,1==e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),Be.enabled&&Be.isPresenting&&(t=Be.getCamera(t)),(C=G.get(e,t)).init(),e.onBeforeRender(Y,e,t,i||he),De.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Re.setFromProjectionMatrix(De),Ne=this.localClippingEnabled,Oe=Pe.init(this.clippingPlanes,Ne,t),(L=k.get(e,t)).init(),function e(t,n,r,i){if(0!=t.visible){if(t.layers.test(n.layers))if(t.isGroup)r=t.renderOrder;else if(t.isLOD)1==t.autoUpdate&&t.update(n);else if(t.isLight)C.pushLight(t),t.castShadow&&C.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||Re.intersectsSprite(t)){i&&Ie.setFromMatrixPosition(t.matrixWorld).applyMatrix4(De);var a=F.update(t);(o=t.material).visible&&L.push(t,a,o,r,Ie.z,null)}}else if(t.isImmediateRenderObject)i&&Ie.setFromMatrixPosition(t.matrixWorld).applyMatrix4(De),L.push(t,null,t.material,r,Ie.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==D.render.frame&&(t.skeleton.update(),t.skeleton.frame=D.render.frame),!t.frustumCulled||Re.intersectsObject(t))){i&&Ie.setFromMatrixPosition(t.matrixWorld).applyMatrix4(De),a=F.update(t);var o=t.material;if(Array.isArray(o))for(var s=a.groups,c=0,l=s.length;c<l;c++){var u=s[c],h=o[u.materialIndex];h&&h.visible&&L.push(t,a,h,r,Ie.z,u)}else o.visible&&L.push(t,a,o,r,Ie.z,null)}var p=t.children;for(c=0,l=p.length;c<l;c++)e(p[c],n,r,i)}}(e,t,0,Y.sortObjects),L.finish(),1==Y.sortObjects&&L.sort(Te,Ee),Oe&&Pe.beginShadows();var o=C.state.shadowsArray;Ue.render(o,e,t),C.setupLights(t),Oe&&Pe.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==i&&this.setRenderTarget(i),j.render(L,e,t,a);var s=L.opaque,c=L.transparent;if(e.overrideMaterial){var l=e.overrideMaterial;s.length&&h(s,e,t,l),c.length&&h(c,e,t,l)}else s.length&&h(s,e,t),c.length&&h(c,e,t);e.onAfterRender(Y,e,t),null!==he&&(z.updateRenderTargetMipmap(he),z.updateMultisampleRenderTarget(he)),N.buffers.depth.setTest(1),N.buffers.depth.setMask(1),N.buffers.color.setMask(1),N.setPolygonOffset(0),L=null,C=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(e){J!==e&&null===he&&R.bindFramebuffer(36160,e),J=e},this.getActiveCubeFace=function(){return te},this.getActiveMipmapLevel=function(){return ne},this.getRenderTarget=function(){return he},this.setRenderTarget=function(e,t,n){he=e,te=t,ne=n,e&&void 0===I.get(e).__webglFramebuffer&&z.setupRenderTarget(e);var r=J,i=0;if(e){var a=I.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=a[t||0],i=1):r=e.isWebGLMultisampleRenderTarget?I.get(e).__webglMultisampledFramebuffer:a,xe.copy(e.viewport),be.copy(e.scissor),we=e.scissorTest}else xe.copy(Ae).multiplyScalar(Se).floor(),be.copy(Le).multiplyScalar(Se).floor(),we=Ce;if(fe!==r&&(R.bindFramebuffer(36160,r),fe=r),N.viewport(xe),N.scissor(be),N.setScissorTest(we),i){var o=I.get(e.texture);R.framebufferTexture2D(36160,36064,34069+(t||0),o.__webglTexture,n||0)}},this.readRenderTargetPixels=function(e,t,n,r,i,a,o){if(e&&e.isWebGLRenderTarget){var s=I.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){var c=0;s!==fe&&(R.bindFramebuffer(36160,s),c=1);try{var l=e.texture,u=l.format,h=l.type;if(1023!==u&&X.convert(u)!==R.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(1009===h||X.convert(h)===R.getParameter(35738)||1015===h&&(O.isWebGL2||P.get("OES_texture_float")||P.get("WEBGL_color_buffer_float"))||1016===h&&(O.isWebGL2?P.get("EXT_color_buffer_float"):P.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===R.checkFramebufferStatus(36160)?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&R.readPixels(t,n,r,i,X.convert(u),X.convert(h),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{c&&R.bindFramebuffer(36160,fe)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){void 0===n&&(n=0);var r=Math.pow(2,-n),i=Math.floor(t.image.width*r),a=Math.floor(t.image.height*r),o=X.convert(t.format);z.setTexture2D(t,0),R.copyTexImage2D(3553,n,o,e.x,e.y,i,a,0),N.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r){var i=t.image.width,a=t.image.height,o=X.convert(n.format),s=X.convert(n.type);z.setTexture2D(n,0),t.isDataTexture?R.texSubImage2D(3553,r||0,e.x,e.y,i,a,o,s,t.image.data):R.texSubImage2D(3553,r||0,e.x,e.y,o,s,t.image),N.unbindTexture()},this.initTexture=function(e){z.setTexture2D(e,0),N.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Ut(e,t){this.name="",this.color=new b(e),this.density=void 0!==t?t:25e-5}function Ft(e,t,n){this.name="",this.color=new b(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}function Ht(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function kt(e,t,n,r){this.data=e,this.itemSize=t,this.offset=n,this.normalized=1==r}function Gt(e){T.call(this),this.type="SpriteMaterial",this.color=new b(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=1,this.transparent=1,this.setValues(e)}function jt(e){if(p.call(this),this.type="Sprite",void 0===Gs){Gs=new F;var n=new Ht(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);Gs.setIndex([0,1,2,0,2,3]),Gs.setAttribute("position",new kt(n,3,0,0)),Gs.setAttribute("uv",new kt(n,2,3,0))}this.geometry=Gs,this.material=void 0!==e?e:new Gt,this.center=new t(.5,.5)}function Vt(e,t,n,r,i,a){Xs.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(Ys.x=a*Xs.x-i*Xs.y,Ys.y=i*Xs.x+a*Xs.y):Ys.copy(Xs),e.copy(t),e.x+=Ys.x,e.y+=Ys.y,e.applyMatrix4(Zs)}function Wt(){p.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:1,value:[]}}),this.autoUpdate=1}function qt(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),H.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new l,this.bindMatrixInverse=new l}function Xt(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new l)}}function Yt(){p.call(this),this.type="Bone"}function Zt(e,t,n){H.call(this,e,t),this.instanceMatrix=new A(new Float32Array(16*n),16),this.count=n,this.frustumCulled=0}function Jt(e){T.call(this),this.type="LineBasicMaterial",this.color=new b(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}function $t(e,t,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),p.call(this),this.type="Line",this.geometry=void 0!==e?e:new F,this.material=void 0!==t?t:new Jt}function Qt(e,t){$t.call(this,e,t),this.type="LineSegments"}function Kt(e,t){$t.call(this,e,t),this.type="LineLoop"}function en(e){T.call(this),this.type="PointsMaterial",this.color=new b(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=1,this.morphTargets=0,this.setValues(e)}function tn(e,t){p.call(this),this.type="Points",this.geometry=void 0!==e?e:new F,this.material=void 0!==t?t:new en,this.updateMorphTargets()}function nn(e,t,n,r,i,a,o){var s=yc.distanceSqToPoint(e);if(s<n){var l=new c;yc.closestPointToPoint(e,l),l.applyMatrix4(r);var u=i.ray.origin.distanceTo(l);if(u<i.near||u>i.far)return;a.push({distance:u,distanceToRay:Math.sqrt(s),point:l,index:t,face:null,object:o})}}function rn(e,t,n,i,a,o,s,c,l){r.call(this,e,t,n,i,a,o,s,c,l),this.format=void 0!==s?s:1022,this.minFilter=void 0!==o?o:1006,this.magFilter=void 0!==a?a:1006,this.generateMipmaps=0}function an(e,t,n,i,a,o,s,c,l,u,h,p){r.call(this,null,o,s,c,l,u,i,a,h,p),this.image={width:t,height:n},this.mipmaps=e,this.flipY=0,this.generateMipmaps=0}function on(e,t,n,i,a,o,s,c,l){r.call(this,e,t,n,i,a,o,s,c,l),this.needsUpdate=1}function sn(e,t,n,i,a,o,s,c,l,u){if(1026!==(u=void 0!==u?u:1026)&&1027!==u)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===u&&(n=1012),void 0===n&&1027===u&&(n=1020),r.call(this,null,i,a,o,s,c,u,n,l),this.image={width:e,height:t},this.magFilter=void 0!==s?s:1003,this.minFilter=void 0!==c?c:1003,this.flipY=0,this.generateMipmaps=0}function cn(e){F.call(this),this.type="WireframeGeometry";var t,n,r,i,a,o,s,l,u,h,p=[],d=[0,0],f={},m=["a","b","c"];if(e&&e.isGeometry){var g=e.faces;for(t=0,r=g.length;t<r;t++){var v=g[t];for(n=0;n<3;n++)s=v[m[n]],l=v[m[(n+1)%3]],d[0]=Math.min(s,l),d[1]=Math.max(s,l),void 0===f[u=d[0]+","+d[1]]&&(f[u]={index1:d[0],index2:d[1]})}for(u in f)o=f[u],h=e.vertices[o.index1],p.push(h.x,h.y,h.z),h=e.vertices[o.index2],p.push(h.x,h.y,h.z)}else if(e&&e.isBufferGeometry){var y,x,b,w,_,M,S;if(h=new c,null!==e.index){for(y=e.attributes.position,x=e.index,0===(b=e.groups).length&&(b=[{start:0,count:x.count,materialIndex:0}]),i=0,a=b.length;i<a;++i)for(t=_=(w=b[i]).start,r=_+w.count;t<r;t+=3)for(n=0;n<3;n++)s=x.getX(t+n),l=x.getX(t+(n+1)%3),d[0]=Math.min(s,l),d[1]=Math.max(s,l),void 0===f[u=d[0]+","+d[1]]&&(f[u]={index1:d[0],index2:d[1]});for(u in f)o=f[u],h.fromBufferAttribute(y,o.index1),p.push(h.x,h.y,h.z),h.fromBufferAttribute(y,o.index2),p.push(h.x,h.y,h.z)}else for(t=0,r=(y=e.attributes.position).count/3;t<r;t++)for(n=0;n<3;n++)M=3*t+n,h.fromBufferAttribute(y,M),p.push(h.x,h.y,h.z),S=3*t+(n+1)%3,h.fromBufferAttribute(y,S),p.push(h.x,h.y,h.z)}this.setAttribute("position",new I(p,3))}function ln(e,t,n){j.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new un(e,t,n)),this.mergeVertices()}function un(e,t,n){F.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var r,i,a=[],o=[],s=[],l=[],u=1e-5,h=new c,p=new c,d=new c,f=new c,m=new c;e.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var g=t+1;for(r=0;r<=n;r++){var v=r/n;for(i=0;i<=t;i++){var y=i/t;e(y,v,p),o.push(p.x,p.y,p.z),y-u>=0?(e(y-u,v,d),f.subVectors(p,d)):(e(y+u,v,d),f.subVectors(d,p)),v-u>=0?(e(y,v-u,d),m.subVectors(p,d)):(e(y,v+u,d),m.subVectors(d,p)),h.crossVectors(f,m).normalize(),s.push(h.x,h.y,h.z),l.push(y,v)}}for(r=0;r<n;r++)for(i=0;i<t;i++){var x=r*g+i,b=r*g+i+1,w=(r+1)*g+i+1,_=(r+1)*g+i;a.push(x,b,_),a.push(b,w,_)}this.setIndex(a),this.setAttribute("position",new I(o,3)),this.setAttribute("normal",new I(s,3)),this.setAttribute("uv",new I(l,2))}function hn(e,t,n,r){j.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r},this.fromBufferGeometry(new pn(e,t,n,r)),this.mergeVertices()}function pn(e,n,r,i){function a(e,t,n,r){var i,a,s=Math.pow(2,r),c=[];for(i=0;i<=s;i++){c[i]=[];var l=e.clone().lerp(n,i/s),u=t.clone().lerp(n,i/s),h=s-i;for(a=0;a<=h;a++)c[i][a]=0===a&&i===s?l:l.clone().lerp(u,a/h)}for(i=0;i<s;i++)for(a=0;a<2*(s-i)-1;a++){var p=Math.floor(a/2);a%2==0?(o(c[i][p+1]),o(c[i+1][p]),o(c[i][p])):(o(c[i][p+1]),o(c[i+1][p+1]),o(c[i+1][p]))}}function o(e){h.push(e.x,e.y,e.z)}function s(t,n){var r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function l(e,t,n,r){r<0&&1===e.x&&(p[t]=e.x-1),0===n.x&&0===n.z&&(p[t]=r/2/Math.PI+.5)}function u(e){return Math.atan2(e.z,-e.x)}F.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:n,radius:r,detail:i},r=r||1;var h=[],p=[];!function(e){for(var t=new c,r=new c,i=new c,o=0;o<n.length;o+=3)s(n[o+0],t),s(n[o+1],r),s(n[o+2],i),a(t,r,i,e)}(i=i||0),function(e){for(var t=new c,n=0;n<h.length;n+=3)t.x=h[n+0],t.y=h[n+1],t.z=h[n+2],t.normalize().multiplyScalar(e),h[n+0]=t.x,h[n+1]=t.y,h[n+2]=t.z}(r),function(){for(var e,n=new c,r=0;r<h.length;r+=3){n.x=h[r+0],n.y=h[r+1],n.z=h[r+2];var i=u(n)/2/Math.PI+.5,a=Math.atan2(-(e=n).y,Math.sqrt(e.x*e.x+e.z*e.z))/Math.PI+.5;p.push(i,1-a)}!function(){for(var e=new c,n=new c,r=new c,i=new c,a=new t,o=new t,s=new t,d=0,f=0;d<h.length;d+=9,f+=6){e.set(h[d+0],h[d+1],h[d+2]),n.set(h[d+3],h[d+4],h[d+5]),r.set(h[d+6],h[d+7],h[d+8]),a.set(p[f+0],p[f+1]),o.set(p[f+2],p[f+3]),s.set(p[f+4],p[f+5]),i.copy(e).add(n).add(r).divideScalar(3);var m=u(i);l(a,f+0,e,m),l(o,f+2,n,m),l(s,f+4,r,m)}}(),function(){for(var e=0;e<p.length;e+=6){var t=p[e+0],n=p[e+2],r=p[e+4];Math.max(t,n,r)>.9&&Math.min(t,n,r)<.1&&(t<.2&&(p[e+0]+=1),n<.2&&(p[e+2]+=1),r<.2&&(p[e+4]+=1))}}()}(),this.setAttribute("position",new I(h,3)),this.setAttribute("normal",new I(h.slice(),3)),this.setAttribute("uv",new I(p,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}function dn(e,t){j.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new fn(e,t)),this.mergeVertices()}function fn(e,t){pn.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 mn(e,t){j.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new gn(e,t)),this.mergeVertices()}function gn(e,t){pn.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 vn(e,t){j.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new yn(e,t)),this.mergeVertices()}function yn(e,t){var n=1.618033988749895,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];pn.call(this,r,[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 xn(e,t){j.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new bn(e,t)),this.mergeVertices()}function bn(e,t){var n=1.618033988749895,r=1/n,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r];pn.call(this,i,[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 wn(e,t,n,r,i,a){j.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new _n(e,t,n,r,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function _n(e,n,r,i,a){function o(t){f=e.getPointAt(t/n,f);var a=s.normals[t],o=s.binormals[t];for(u=0;u<=i;u++){var c=u/i*Math.PI*2,l=Math.sin(c),d=-Math.cos(c);p.x=d*a.x+l*o.x,p.y=d*a.y+l*o.y,p.z=d*a.z+l*o.z,p.normalize(),g.push(p.x,p.y,p.z),h.x=f.x+r*p.x,h.y=f.y+r*p.y,h.z=f.z+r*p.z,m.push(h.x,h.y,h.z)}}F.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:n,radius:r,radialSegments:i,closed:a},n=n||64,r=r||1,i=i||8,a=a||0;var s=e.computeFrenetFrames(n,a);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;var l,u,h=new c,p=new c,d=new t,f=new c,m=[],g=[],v=[],y=[];!function(){for(l=0;l<n;l++)o(l);o(0==a?n:0),function(){for(l=0;l<=n;l++)for(u=0;u<=i;u++)d.x=l/n,d.y=u/i,v.push(d.x,d.y)}(),function(){for(u=1;u<=n;u++)for(l=1;l<=i;l++){var e=(i+1)*(u-1)+(l-1),t=(i+1)*u+(l-1),r=(i+1)*u+l,a=(i+1)*(u-1)+l;y.push(e,t,a),y.push(t,r,a)}}()}(),this.setIndex(y),this.setAttribute("position",new I(m,3)),this.setAttribute("normal",new I(g,3)),this.setAttribute("uv",new I(v,2))}function Mn(e,t,n,r,i,a,o){j.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Sn(e,t,n,r,i,a)),this.mergeVertices()}function Sn(e,t,n,r,i,a){function o(e,t,n,r,i){var a=Math.cos(e),o=Math.sin(e),s=n/t*e,c=Math.cos(s);i.x=r*(2+c)*.5*a,i.y=r*(2+c)*o*.5,i.z=r*Math.sin(s)*.5}F.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:a},e=e||1,t=t||.4,n=Math.floor(n)||64,r=Math.floor(r)||8,i=i||2,a=a||3;var s,l,u=[],h=[],p=[],d=[],f=new c,m=new c,g=new c,v=new c,y=new c,x=new c,b=new c;for(s=0;s<=n;++s){var w=s/n*i*Math.PI*2;for(o(w,i,a,e,g),o(w+.01,i,a,e,v),x.subVectors(v,g),b.addVectors(v,g),y.crossVectors(x,b),b.crossVectors(y,x),y.normalize(),b.normalize(),l=0;l<=r;++l){var _=l/r*Math.PI*2,M=-t*Math.cos(_),S=t*Math.sin(_);f.x=g.x+(M*b.x+S*y.x),f.y=g.y+(M*b.y+S*y.y),f.z=g.z+(M*b.z+S*y.z),h.push(f.x,f.y,f.z),m.subVectors(f,g).normalize(),p.push(m.x,m.y,m.z),d.push(s/n),d.push(l/r)}}for(l=1;l<=n;l++)for(s=1;s<=r;s++){var T=(r+1)*(l-1)+(s-1),E=(r+1)*l+(s-1),A=(r+1)*l+s,L=(r+1)*(l-1)+s;u.push(T,E,L),u.push(E,A,L)}this.setIndex(u),this.setAttribute("position",new I(h,3)),this.setAttribute("normal",new I(p,3)),this.setAttribute("uv",new I(d,2))}function Tn(e,t,n,r,i){j.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},this.fromBufferGeometry(new En(e,t,n,r,i)),this.mergeVertices()}function En(e,t,n,r,i){F.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},e=e||1,t=t||.4,n=Math.floor(n)||8,r=Math.floor(r)||6,i=i||2*Math.PI;var a,o,s=[],l=[],u=[],h=[],p=new c,d=new c,f=new c;for(a=0;a<=n;a++)for(o=0;o<=r;o++){var m=o/r*i,g=a/n*Math.PI*2;d.x=(e+t*Math.cos(g))*Math.cos(m),d.y=(e+t*Math.cos(g))*Math.sin(m),d.z=t*Math.sin(g),l.push(d.x,d.y,d.z),p.x=e*Math.cos(m),p.y=e*Math.sin(m),f.subVectors(d,p).normalize(),u.push(f.x,f.y,f.z),h.push(o/r),h.push(a/n)}for(a=1;a<=n;a++)for(o=1;o<=r;o++){var v=(r+1)*a+o-1,y=(r+1)*(a-1)+o-1,x=(r+1)*(a-1)+o,b=(r+1)*a+o;s.push(v,y,b),s.push(y,x,b)}this.setIndex(s),this.setAttribute("position",new I(l,3)),this.setAttribute("normal",new I(u,3)),this.setAttribute("uv",new I(h,2))}function An(e,t,n,r,i){var a,o;if(i===function(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}(e,t,n,r)>0)for(a=t;a<n;a+=r)o=Wn(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=Wn(a,e[a],e[a+1],o);return o&&kn(o,o.next)&&(qn(o),o=o.next),o}function Ln(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=0,r.steiner||!kn(r,r.next)&&0!==Hn(r.prev,r,r.next))r=r.next;else{if(qn(r),(r=t=r.prev)===r.next)break;n=1}}while(n||r!==t);return t}function Cn(e,t,n,r,i,a,o){if(e){!o&&a&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=zn(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,a,o,s,c,l=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t<l&&(s++,r=r.nextZ);t++);for(c=l;s>0||c>0&&r;)0!==s&&(0===c||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,c--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1)}(i)}(e,r,i,a);for(var s,c,l=e;e.prev!==e.next;)if(s=e.prev,c=e.next,a?Pn(e,r,i,a):Rn(e))t.push(s.i/n),t.push(e.i/n),t.push(c.i/n),qn(e),e=c.next,l=c.next;else if((e=c)===l){o?1===o?Cn(e=On(e,t,n),t,n,r,i,a,2):2===o&&Nn(e,t,n,r,i,a):Cn(Ln(e),t,n,r,i,a,1);break}}}function Rn(e){var t=e.prev,n=e,r=e.next;if(Hn(t,n,r)>=0)return 0;for(var i=e.next.next;i!==e.prev;){if(Un(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Hn(i.prev,i,i.next)>=0)return 0;i=i.next}return 1}function Pn(e,t,n,r){var i=e.prev,a=e,o=e.next;if(Hn(i,a,o)>=0)return 0;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,c=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,l=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=zn(s,c,t,n,r),p=zn(l,u,t,n,r),d=e.prevZ,f=e.nextZ;d&&d.z>=h&&f&&f.z<=p;){if(d!==e.prev&&d!==e.next&&Un(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Hn(d.prev,d,d.next)>=0)return 0;if(d=d.prevZ,f!==e.prev&&f!==e.next&&Un(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Hn(f.prev,f,f.next)>=0)return 0;f=f.nextZ}for(;d&&d.z>=h;){if(d!==e.prev&&d!==e.next&&Un(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Hn(d.prev,d,d.next)>=0)return 0;d=d.prevZ}for(;f&&f.z<=p;){if(f!==e.prev&&f!==e.next&&Un(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Hn(f.prev,f,f.next)>=0)return 0;f=f.nextZ}return 1}function On(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!kn(i,a)&&Gn(i,r,r.next,a)&&jn(i,a)&&jn(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),qn(r),qn(r.next),r=e=a),r=r.next}while(r!==e);return r}function Nn(e,t,n,r,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Fn(o,s)){var c=Vn(o,s);return o=Ln(o,o.next),c=Ln(c,c.next),Cn(o,t,n,r,i,a),void Cn(c,t,n,r,i,a)}s=s.next}o=o.next}while(o!==e)}function Dn(e,t){return e.x-t.x}function In(e,t){if(t=function(e,t){var n,r=t,i=e.x,a=e.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o){if(o=s,s===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===o)return n.prev;var c,l=n,u=n.x,h=n.y,p=1/0;for(r=n.next;r!==l;)i>=r.x&&r.x>=u&&i!==r.x&&Un(a<h?i:o,a,u,h,a<h?o:i,a,r.x,r.y)&&((c=Math.abs(a-r.y)/(i-r.x))<p||c===p&&r.x>n.x)&&jn(r,e)&&(n=r,p=c),r=r.next;return n}(e,t)){var n=Vn(t,e);Ln(n,n.next)}}function zn(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Bn(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Un(e,t,n,r,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function Fn(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Gn(n,n.next,e,t))return 1;n=n.next}while(n!==e);return 0}(e,t)&&jn(e,t)&&jn(t,e)&&function(e,t){var n=e,r=0,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)}function Hn(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function kn(e,t){return e.x===t.x&&e.y===t.y}function Gn(e,t,n,r){return kn(e,n)&&kn(t,r)||kn(e,r)&&kn(n,t)?1:Hn(e,t,n)>0!=Hn(e,t,r)>0&&Hn(n,r,e)>0!=Hn(n,r,t)>0}function jn(e,t){return Hn(e.prev,e,e.next)<0?Hn(e,t,e.next)>=0&&Hn(e,e.prev,t)>=0:Hn(e,t,e.prev)<0||Hn(e,e.next,t)<0}function Vn(e,t){var n=new Xn(e.i,e.x,e.y),r=new Xn(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Wn(e,t,n,r){var i=new Xn(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function qn(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 Xn(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=0}function Yn(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Zn(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function Jn(e,t){j.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new $n(e,t)),this.mergeVertices()}function $n(e,n){function r(e){function r(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}function s(e,n,r){var i,a,o,s=e.x-n.x,c=e.y-n.y,l=r.x-e.x,u=r.y-e.y,h=s*s+c*c;if(Math.abs(s*u-c*l)>Number.EPSILON){var p=Math.sqrt(h),d=Math.sqrt(l*l+u*u),f=n.x-c/p,m=n.y+s/p,g=((r.x-u/d-f)*u-(r.y+l/d-m)*l)/(s*u-c*l),v=(i=f+s*g-e.x)*i+(a=m+c*g-e.y)*a;if(v<=2)return new t(i,a);o=Math.sqrt(v/2)}else{var y=0;s>Number.EPSILON?l>Number.EPSILON&&(y=1):s<-Number.EPSILON?l<-Number.EPSILON&&(y=1):Math.sign(c)===Math.sign(u)&&(y=1),y?(i=-c,a=s,o=Math.sqrt(h)):(i=s,a=c,o=Math.sqrt(h/2))}return new t(i/o,a/o)}function l(e,t){var n,r;for(Z=e.length;--Z>=0;){n=Z,(r=Z-1)<0&&(r=e.length-1);var i=0,a=v+2*M;for(i=0;i<a;i++){var o=q*i,s=q*(i+1);p(t+n+o,t+r+o,t+r+s,t+n+s)}}}function u(e,t,n){m.push(e),m.push(t),m.push(n)}function h(e,t,n){d(e),d(t),d(n);var r=a.length/3,o=T.generateTopUV(i,a,r-3,r-2,r-1);f(o[0]),f(o[1]),f(o[2])}function p(e,t,n,r){d(e),d(t),d(r),d(t),d(n),d(r);var o=a.length/3,s=T.generateSideWallUV(i,a,o-6,o-3,o-2,o-1);f(s[0]),f(s[1]),f(s[3]),f(s[1]),f(s[2]),f(s[3])}function d(e){a.push(m[3*e+0]),a.push(m[3*e+1]),a.push(m[3*e+2])}function f(e){o.push(e.x),o.push(e.y)}var m=[],g=void 0!==n.curveSegments?n.curveSegments:12,v=void 0!==n.steps?n.steps:1,y=void 0!==n.depth?n.depth:100,x=void 0!==n.bevelEnabled?n.bevelEnabled:1,b=void 0!==n.bevelThickness?n.bevelThickness:6,w=void 0!==n.bevelSize?n.bevelSize:b-2,_=void 0!==n.bevelOffset?n.bevelOffset:0,M=void 0!==n.bevelSegments?n.bevelSegments:3,S=n.extrudePath,T=void 0!==n.UVGenerator?n.UVGenerator:_c;void 0!==n.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),y=n.amount);var E,A,L,C,R,P,O,N,D=0;S&&(E=S.getSpacedPoints(v),D=1,x=0,A=S.computeFrenetFrames(v,0),L=new c,C=new c,R=new c),x||(M=0,b=0,w=0,_=0);var I=e.extractPoints(g),z=I.shape,B=I.holes;if(!wc.isClockWise(z))for(z=z.reverse(),O=0,N=B.length;O<N;O++)P=B[O],wc.isClockWise(P)&&(B[O]=P.reverse());var U=wc.triangulateShape(z,B),F=z;for(O=0,N=B.length;O<N;O++)P=B[O],z=z.concat(P);for(var H,k,G,j,V,W,q=z.length,X=U.length,Y=[],Z=0,J=F.length,$=J-1,Q=Z+1;Z<J;Z++,$++,Q++)$===J&&($=0),Q===J&&(Q=0),Y[Z]=s(F[Z],F[$],F[Q]);var K,ee,te=[],ne=Y.concat();for(O=0,N=B.length;O<N;O++){for(P=B[O],K=[],Z=0,$=(J=P.length)-1,Q=Z+1;Z<J;Z++,$++,Q++)$===J&&($=0),Q===J&&(Q=0),K[Z]=s(P[Z],P[$],P[Q]);te.push(K),ne=ne.concat(K)}for(H=0;H<M;H++){for(j=b*Math.cos((G=H/M)*Math.PI/2),k=w*Math.sin(G*Math.PI/2)+_,Z=0,J=F.length;Z<J;Z++)u((V=r(F[Z],Y[Z],k)).x,V.y,-j);for(O=0,N=B.length;O<N;O++)for(P=B[O],K=te[O],Z=0,J=P.length;Z<J;Z++)u((V=r(P[Z],K[Z],k)).x,V.y,-j)}for(k=w+_,Z=0;Z<q;Z++)V=x?r(z[Z],ne[Z],k):z[Z],D?(C.copy(A.normals[0]).multiplyScalar(V.x),L.copy(A.binormals[0]).multiplyScalar(V.y),R.copy(E[0]).add(C).add(L),u(R.x,R.y,R.z)):u(V.x,V.y,0);for(ee=1;ee<=v;ee++)for(Z=0;Z<q;Z++)V=x?r(z[Z],ne[Z],k):z[Z],D?(C.copy(A.normals[ee]).multiplyScalar(V.x),L.copy(A.binormals[ee]).multiplyScalar(V.y),R.copy(E[ee]).add(C).add(L),u(R.x,R.y,R.z)):u(V.x,V.y,y/v*ee);for(H=M-1;H>=0;H--){for(j=b*Math.cos((G=H/M)*Math.PI/2),k=w*Math.sin(G*Math.PI/2)+_,Z=0,J=F.length;Z<J;Z++)u((V=r(F[Z],Y[Z],k)).x,V.y,y+j);for(O=0,N=B.length;O<N;O++)for(P=B[O],K=te[O],Z=0,J=P.length;Z<J;Z++)V=r(P[Z],K[Z],k),D?u(V.x,V.y+E[v-1].y,E[v-1].x+j):u(V.x,V.y,y+j)}!function(){var e=a.length/3;if(x){var t=0,n=q*t;for(Z=0;Z<X;Z++)h((W=U[Z])[2]+n,W[1]+n,W[0]+n);for(n=q*(t=v+2*M),Z=0;Z<X;Z++)h((W=U[Z])[0]+n,W[1]+n,W[2]+n)}else{for(Z=0;Z<X;Z++)h((W=U[Z])[2],W[1],W[0]);for(Z=0;Z<X;Z++)h((W=U[Z])[0]+q*v,W[1]+q*v,W[2]+q*v)}i.addGroup(e,a.length/3-e,0)}(),function(){var e=a.length/3,t=0;for(l(F,t),t+=F.length,O=0,N=B.length;O<N;O++)l(P=B[O],t),t+=P.length;i.addGroup(e,a.length/3-e,1)}()}F.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:e,options:n};for(var i=this,a=[],o=[],s=0,l=(e=Array.isArray(e)?e:[e]).length;s<l;s++)r(e[s]);this.setAttribute("position",new I(a,3)),this.setAttribute("uv",new I(o,2)),this.computeVertexNormals()}function Qn(e,t,n){if(n.shapes=[],Array.isArray(e))for(var r=0,i=e.length;r<i;r++){var a=e[r];n.shapes.push(a.uuid)}else n.shapes.push(e.uuid);return void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}function Kn(e,t){j.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new er(e,t)),this.mergeVertices()}function er(e,t){var n=(t=t||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new j;var r=n.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=0),$n.call(this,r,t),this.type="TextBufferGeometry"}function tr(e,t,n,r,i,a,o){j.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new nr(e,t,n,r,i,a,o)),this.mergeVertices()}function nr(e,t,n,r,i,a,o){F.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI;var s,l,u=Math.min((a=void 0!==a?a:0)+(o=void 0!==o?o:Math.PI),Math.PI),h=0,p=[],d=new c,f=new c,m=[],g=[],v=[],y=[];for(l=0;l<=n;l++){var x=[],b=l/n,w=0;for(0==l&&0==a?w=.5/t:l==n&&u==Math.PI&&(w=-.5/t),s=0;s<=t;s++){var _=s/t;d.x=-e*Math.cos(r+_*i)*Math.sin(a+b*o),d.y=e*Math.cos(a+b*o),d.z=e*Math.sin(r+_*i)*Math.sin(a+b*o),g.push(d.x,d.y,d.z),f.copy(d).normalize(),v.push(f.x,f.y,f.z),y.push(_+w,1-b),x.push(h++)}p.push(x)}for(l=0;l<n;l++)for(s=0;s<t;s++){var M=p[l][s+1],S=p[l][s],T=p[l+1][s],E=p[l+1][s+1];(0!==l||a>0)&&m.push(M,S,E),(l!==n-1||u<Math.PI)&&m.push(S,T,E)}this.setIndex(m),this.setAttribute("position",new I(g,3)),this.setAttribute("normal",new I(v,3)),this.setAttribute("uv",new I(y,2))}function rr(e,t,n,r,i,a){j.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:a},this.fromBufferGeometry(new ir(e,t,n,r,i,a)),this.mergeVertices()}function ir(e,n,r,i,a,o){F.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:n,thetaSegments:r,phiSegments:i,thetaStart:a,thetaLength:o},e=e||.5,n=n||1,a=void 0!==a?a:0,o=void 0!==o?o:2*Math.PI,r=void 0!==r?Math.max(3,r):8;var s,l,u,h=[],p=[],d=[],f=[],m=e,g=(n-e)/(i=void 0!==i?Math.max(1,i):1),v=new c,y=new t;for(l=0;l<=i;l++){for(u=0;u<=r;u++)s=a+u/r*o,v.x=m*Math.cos(s),v.y=m*Math.sin(s),p.push(v.x,v.y,v.z),d.push(0,0,1),y.x=(v.x/n+1)/2,y.y=(v.y/n+1)/2,f.push(y.x,y.y);m+=g}for(l=0;l<i;l++){var x=l*(r+1);for(u=0;u<r;u++){var b=s=u+x,w=s+r+1,_=s+r+2,M=s+1;h.push(b,w,M),h.push(w,_,M)}}this.setIndex(h),this.setAttribute("position",new I(p,3)),this.setAttribute("normal",new I(d,3)),this.setAttribute("uv",new I(f,2))}function ar(e,t,n,r){j.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},this.fromBufferGeometry(new or(e,t,n,r)),this.mergeVertices()}function or(e,n,r,i){F.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:n,phiStart:r,phiLength:i},n=Math.floor(n)||12,r=r||0,i=i||2*Math.PI,i=Na.clamp(i,0,2*Math.PI);var a,o,s,l=[],u=[],h=[],p=1/n,d=new c,f=new t;for(o=0;o<=n;o++){var m=r+o*p*i,g=Math.sin(m),v=Math.cos(m);for(s=0;s<=e.length-1;s++)d.x=e[s].x*g,d.y=e[s].y,d.z=e[s].x*v,u.push(d.x,d.y,d.z),f.x=o/n,f.y=s/(e.length-1),h.push(f.x,f.y)}for(o=0;o<n;o++)for(s=0;s<e.length-1;s++){var y=a=s+o*e.length,x=a+e.length,b=a+e.length+1,w=a+1;l.push(y,x,w),l.push(x,b,w)}if(this.setIndex(l),this.setAttribute("position",new I(u,3)),this.setAttribute("uv",new I(h,2)),this.computeVertexNormals(),i===2*Math.PI){var _=this.attributes.normal.array,M=new c,S=new c,T=new c;for(a=n*e.length*3,o=0,s=0;o<e.length;o++,s+=3)M.x=_[s+0],M.y=_[s+1],M.z=_[s+2],S.x=_[a+s+0],S.y=_[a+s+1],S.z=_[a+s+2],T.addVectors(M,S).normalize(),_[s+0]=_[a+s+0]=T.x,_[s+1]=_[a+s+1]=T.y,_[s+2]=_[a+s+2]=T.z}}function sr(e,t){j.call(this),this.type="ShapeGeometry","object"==typeof t&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new cr(e,t)),this.mergeVertices()}function cr(e,t){function n(e){var n,s,l,u=i.length/3,h=e.extractPoints(t),p=h.shape,d=h.holes;for(0==wc.isClockWise(p)&&(p=p.reverse()),n=0,s=d.length;n<s;n++)l=d[n],1==wc.isClockWise(l)&&(d[n]=l.reverse());var f=wc.triangulateShape(p,d);for(n=0,s=d.length;n<s;n++)l=d[n],p=p.concat(l);for(n=0,s=p.length;n<s;n++){var m=p[n];i.push(m.x,m.y,0),a.push(0,0,1),o.push(m.x,m.y)}for(n=0,s=f.length;n<s;n++){var g=f[n],v=g[0]+u,y=g[1]+u,x=g[2]+u;r.push(v,y,x),c+=3}}F.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var r=[],i=[],a=[],o=[],s=0,c=0;if(0==Array.isArray(e))n(e);else for(var l=0;l<e.length;l++)n(e[l]),this.addGroup(s,c,l),s+=c,c=0;this.setIndex(r),this.setAttribute("position",new I(i,3)),this.setAttribute("normal",new I(a,3)),this.setAttribute("uv",new I(o,2))}function lr(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,r=e.length;n<r;n++){var i=e[n];t.shapes.push(i.uuid)}else t.shapes.push(e.uuid);return t}function ur(e,t){F.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var n,r,i,a,o=[],s=Math.cos(Na.DEG2RAD*t),c=[0,0],l={},u=["a","b","c"];e.isBufferGeometry?(a=new j).fromBufferGeometry(e):a=e.clone(),a.mergeVertices(),a.computeFaceNormals();for(var h=a.vertices,p=a.faces,d=0,f=p.length;d<f;d++)for(var m=p[d],g=0;g<3;g++)n=m[u[g]],r=m[u[(g+1)%3]],c[0]=Math.min(n,r),c[1]=Math.max(n,r),void 0===l[i=c[0]+","+c[1]]?l[i]={index1:c[0],index2:c[1],face1:d,face2:void 0}:l[i].face2=d;for(i in l){var v=l[i];if(void 0===v.face2||p[v.face1].normal.dot(p[v.face2].normal)<=s){var y=h[v.index1];o.push(y.x,y.y,y.z),y=h[v.index2],o.push(y.x,y.y,y.z)}}this.setAttribute("position",new I(o,3))}function hr(e,t,n,r,i,a,o,s){j.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new pr(e,t,n,r,i,a,o,s)),this.mergeVertices()}function pr(e,n,r,i,a,o,s,l){function u(r){var a,o,u,v=new t,b=new c,w=0,_=1==r?e:n,M=1==r?1:-1;for(o=g,a=1;a<=i;a++)d.push(0,y*M,0),f.push(0,M,0),m.push(.5,.5),g++;for(u=g,a=0;a<=i;a++){var S=a/i*l+s,T=Math.cos(S),E=Math.sin(S);b.x=_*E,b.y=y*M,b.z=_*T,d.push(b.x,b.y,b.z),f.push(0,M,0),v.x=.5*T+.5,v.y=.5*E*M+.5,m.push(v.x,v.y),g++}for(a=0;a<i;a++){var A=o+a,L=u+a;1==r?p.push(L,L+1,A):p.push(L+1,L,A),w+=3}h.addGroup(x,w,1==r?1:2),x+=w}F.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:n,height:r,radialSegments:i,heightSegments:a,openEnded:o,thetaStart:s,thetaLength:l};var h=this;e=void 0!==e?e:1,n=void 0!==n?n:1,r=r||1,i=Math.floor(i)||8,a=Math.floor(a)||1,o=void 0!==o?o:0,s=void 0!==s?s:0,l=void 0!==l?l:2*Math.PI;var p=[],d=[],f=[],m=[],g=0,v=[],y=r/2,x=0;!function(){var t,o,u=new c,b=new c,w=0,_=(n-e)/r;for(o=0;o<=a;o++){var M=[],S=o/a,T=S*(n-e)+e;for(t=0;t<=i;t++){var E=t/i,A=E*l+s,L=Math.sin(A),C=Math.cos(A);b.x=T*L,b.y=-S*r+y,b.z=T*C,d.push(b.x,b.y,b.z),u.set(L,_,C).normalize(),f.push(u.x,u.y,u.z),m.push(E,1-S),M.push(g++)}v.push(M)}for(t=0;t<i;t++)for(o=0;o<a;o++){var R=v[o][t],P=v[o+1][t],O=v[o+1][t+1],N=v[o][t+1];p.push(R,P,N),p.push(P,O,N),w+=6}h.addGroup(x,w,0),x+=w}(),0==o&&(e>0&&u(1),n>0&&u(0)),this.setIndex(p),this.setAttribute("position",new I(d,3)),this.setAttribute("normal",new I(f,3)),this.setAttribute("uv",new I(m,2))}function dr(e,t,n,r,i,a,o){hr.call(this,0,e,t,n,r,i,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function fr(e,t,n,r,i,a,o){pr.call(this,0,e,t,n,r,i,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:a,thetaLength:o}}function mr(e,t,n,r){j.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new gr(e,t,n,r)),this.mergeVertices()}function gr(e,n,r,i){F.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:n,thetaStart:r,thetaLength:i},e=e||1,n=void 0!==n?Math.max(3,n):8,r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI;var a,o,s=[],l=[],u=[],h=[],p=new c,d=new t;for(l.push(0,0,0),u.push(0,0,1),h.push(.5,.5),o=0,a=3;o<=n;o++,a+=3){var f=r+o/n*i;p.x=e*Math.cos(f),p.y=e*Math.sin(f),l.push(p.x,p.y,p.z),u.push(0,0,1),d.x=(l[a]/e+1)/2,d.y=(l[a+1]/e+1)/2,h.push(d.x,d.y)}for(a=1;a<=n;a++)s.push(a,a+1,0);this.setIndex(s),this.setAttribute("position",new I(l,3)),this.setAttribute("normal",new I(u,3)),this.setAttribute("uv",new I(h,2))}function vr(e){T.call(this),this.type="ShadowMaterial",this.color=new b(0),this.transparent=1,this.setValues(e)}function yr(e){q.call(this,e),this.type="RawShaderMaterial"}function xr(e){T.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new b(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new b(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new t(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=0,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=0,this.morphTargets=0,this.morphNormals=0,this.vertexTangents=0,this.setValues(e)}function br(e){xr.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new t(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(e)}function wr(e){T.call(this),this.type="MeshPhongMaterial",this.color=new b(16777215),this.specular=new b(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new b(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new t(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=0,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=0,this.morphTargets=0,this.morphNormals=0,this.setValues(e)}function _r(e){T.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new b(16777215),this.specular=new b(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new b(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new t(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=0,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=0,this.morphTargets=0,this.morphNormals=0,this.setValues(e)}function Mr(e){T.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new t(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=0,this.wireframeLinewidth=1,this.fog=0,this.skinning=0,this.morphTargets=0,this.morphNormals=0,this.setValues(e)}function Sr(e){T.call(this),this.type="MeshLambertMaterial",this.color=new b(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new b(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=0,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=0,this.morphTargets=0,this.morphNormals=0,this.setValues(e)}function Tr(e){T.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new b(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new t(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=0,this.morphTargets=0,this.morphNormals=0,this.setValues(e)}function Er(e){Jt.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}function Ar(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function Lr(e,t,n,r){Ar.call(this,e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Cr(e,t,n,r){Ar.call(this,e,t,n,r)}function Rr(e,t,n,r){Ar.call(this,e,t,n,r)}function Pr(e,t,n,r){if(void 0===e)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Tc.convertArray(t,this.TimeBufferType),this.values=Tc.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}function Or(e,t,n){Pr.call(this,e,t,n)}function Nr(e,t,n,r){Pr.call(this,e,t,n,r)}function Dr(e,t,n,r){Pr.call(this,e,t,n,r)}function Ir(e,t,n,r){Ar.call(this,e,t,n,r)}function zr(e,t,n,r){Pr.call(this,e,t,n,r)}function Br(e,t,n,r){Pr.call(this,e,t,n,r)}function Ur(e,t,n,r){Pr.call(this,e,t,n,r)}function Fr(e,t,n){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.uuid=Na.generateUUID(),this.duration<0&&this.resetDuration()}function Hr(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 Dr;case"vector":case"vector2":case"vector3":case"vector4":return Ur;case"color":return Nr;case"quaternion":return zr;case"bool":case"boolean":return Or;case"string":return Br}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){var n=[],r=[];Tc.flattenJSON(e.keys,n,r,"value"),e.times=n,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}function kr(e,t,n){var r=this,i=0,a=0,o=0,s=void 0,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,0==i&&void 0!==r.onStart&&r.onStart(e,a,o),i=1},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(i=0,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){var t=c.indexOf(e);return-1!==t&&c.splice(t,2),this},this.getHandler=function(e){for(var t=0,n=c.length;t<n;t+=2){var r=c[t],i=c[t+1];if(r.global&&(r.lastIndex=0),r.test(e))return i}return null}}function Gr(e){this.manager=void 0!==e?e:Ac,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}function jr(e){Gr.call(this,e)}function Vr(e){Gr.call(this,e)}function Wr(e){Gr.call(this,e)}function qr(e){Gr.call(this,e)}function Xr(e){Gr.call(this,e)}function Yr(e){Gr.call(this,e)}function Zr(e){Gr.call(this,e)}function Jr(){this.type="Curve",this.arcLengthDivisions=200}function $r(e,t,n,r,i,a,o,s){Jr.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||0,this.aRotation=s||0}function Qr(e,t,n,r,i,a){$r.call(this,e,t,n,n,r,i,a),this.type="ArcCurve"}function Kr(){function e(e,a,o,s){t=e,n=o,r=-3*e+3*a-2*o-s,i=2*e-2*a+o+s}var t=0,n=0,r=0,i=0;return{initCatmullRom:function(t,n,r,i,a){e(n,r,a*(r-t),a*(i-n))},initNonuniformCatmullRom:function(t,n,r,i,a,o,s){var c=(n-t)/a-(r-t)/(a+o)+(r-n)/o,l=(r-n)/o-(i-n)/(o+s)+(i-r)/s;e(n,r,c*=o,l*=o)},calc:function(e){var a=e*e;return t+n*e+r*a+i*(a*e)}}}function ei(e,t,n,r){Jr.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||0,this.curveType=n||"centripetal",this.tension=r||.5}function ti(e,t,n,r,i){var a=.5*(r-t),o=.5*(i-n),s=e*e;return(2*n-2*r+a+o)*(e*s)+(-3*n+3*r-2*a-o)*s+a*e+n}function ni(e,t,n,r){return function(e,t){var n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function ri(e,t,n,r,i){return function(e,t){var n=1-e;return n*n*n*t}(e,t)+function(e,t){var n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}function ii(e,n,r,i){Jr.call(this),this.type="CubicBezierCurve",this.v0=e||new t,this.v1=n||new t,this.v2=r||new t,this.v3=i||new t}function ai(e,t,n,r){Jr.call(this),this.type="CubicBezierCurve3",this.v0=e||new c,this.v1=t||new c,this.v2=n||new c,this.v3=r||new c}function oi(e,n){Jr.call(this),this.type="LineCurve",this.v1=e||new t,this.v2=n||new t}function si(e,t){Jr.call(this),this.type="LineCurve3",this.v1=e||new c,this.v2=t||new c}function ci(e,n,r){Jr.call(this),this.type="QuadraticBezierCurve",this.v0=e||new t,this.v1=n||new t,this.v2=r||new t}function li(e,t,n){Jr.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new c,this.v1=t||new c,this.v2=n||new c}function ui(e){Jr.call(this),this.type="SplineCurve",this.points=e||[]}function hi(){Jr.call(this),this.type="CurvePath",this.curves=[],this.autoClose=0}function pi(e){hi.call(this),this.type="Path",this.currentPoint=new t,e&&this.setFromPoints(e)}function di(e){pi.call(this,e),this.uuid=Na.generateUUID(),this.type="Shape",this.holes=[]}function fi(e,t){p.call(this),this.type="Light",this.color=new b(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function mi(e,t,n){fi.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(p.DefaultUp),this.updateMatrix(),this.groundColor=new b(t)}function gi(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new t(512,512),this.map=null,this.mapPass=null,this.matrix=new l,this._frustum=new Q,this._frameExtents=new t(1,1),this._viewportCount=1,this._viewports=[new i(0,0,1,1)]}function vi(){gi.call(this,new Y(50,1,.5,500))}function yi(e,t,n,r,i,a){fi.call(this,e,t),this.type="SpotLight",this.position.copy(p.DefaultUp),this.updateMatrix(),this.target=new p,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==a?a:1,this.shadow=new vi}function xi(){gi.call(this,new Y(90,1,.5,500)),this._frameExtents=new t(4,2),this._viewportCount=6,this._viewports=[new i(2,1,1,1),new i(0,1,1,1),new i(3,1,1,1),new i(1,1,1,1),new i(3,0,1,1),new i(1,0,1,1)],this._cubeDirections=[new c(1,0,0),new c(-1,0,0),new c(0,0,1),new c(0,0,-1),new c(0,1,0),new c(0,-1,0)],this._cubeUps=[new c(0,1,0),new c(0,1,0),new c(0,1,0),new c(0,1,0),new c(0,0,1),new c(0,0,-1)]}function bi(e,t,n,r){fi.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!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new xi}function wi(e,t,n,r,i,a){X.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!==n?n:1,this.bottom=void 0!==r?r:-1,this.near=void 0!==i?i:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function _i(){gi.call(this,new wi(-5,5,5,-5,.5,500))}function Mi(e,t){fi.call(this,e,t),this.type="DirectionalLight",this.position.copy(p.DefaultUp),this.updateMatrix(),this.target=new p,this.shadow=new _i}function Si(e,t){fi.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function Ti(e,t,n,r){fi.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function Ei(e){Gr.call(this,e),this.textures={}}function Ai(){F.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Li(e,t,n,r){"number"==typeof n&&(r=n,n=0,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),A.call(this,e,t,n),this.meshPerAttribute=r||1}function Ci(e){Gr.call(this,e)}function Ri(e){Gr.call(this,e)}function Pi(e){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),Gr.call(this,e),this.options=void 0}function Oi(){this.type="ShapePath",this.color=new b,this.subPaths=[],this.currentPath=null}function Ni(e){this.type="Font",this.data=e}function Di(e,t,n,r,i){var a=i.glyphs[e]||i.glyphs["?"];if(a){var o,s,c,l,u,h,p,d,f=new Oi;if(a.o)for(var m=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),g=0,v=m.length;g<v;)switch(m[g++]){case"m":o=m[g++]*t+n,s=m[g++]*t+r,f.moveTo(o,s);break;case"l":o=m[g++]*t+n,s=m[g++]*t+r,f.lineTo(o,s);break;case"q":c=m[g++]*t+n,l=m[g++]*t+r,u=m[g++]*t+n,h=m[g++]*t+r,f.quadraticCurveTo(u,h,c,l);break;case"b":c=m[g++]*t+n,l=m[g++]*t+r,u=m[g++]*t+n,h=m[g++]*t+r,p=m[g++]*t+n,d=m[g++]*t+r,f.bezierCurveTo(u,h,p,d,c,l)}return{offsetX:a.ha*t,path:f}}console.error('THREE.Font: character "'+e+'" does not exists in font family '+i.familyName+".")}function Ii(e){Gr.call(this,e)}function zi(e){Gr.call(this,e)}function Bi(){this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new c)}function Ui(e,t){fi.call(this,void 0,t),this.sh=void 0!==e?e:new Bi}function Fi(e,t,n){Ui.call(this,void 0,n);var r=(new b).set(e),i=(new b).set(t),a=new c(r.r,r.g,r.b),o=new c(i.r,i.g,i.b);this.sh.coefficients[0].copy(a).add(o).multiplyScalar(1.7724538509055159),this.sh.coefficients[1].copy(a).sub(o).multiplyScalar(1.5349900619197325)}function Hi(e,t){Ui.call(this,void 0,t);var n=(new b).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(3.5449077018110318)}function ki(e){this.autoStart=void 0!==e?e:1,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=0}function Gi(){p.call(this),this.type="AudioListener",this.context=Hc(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new ki}function ji(e){p.call(this),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=0,this.buffer=null,this.detune=0,this.loop=0,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=0,this.hasPlaybackControl=1,this.sourceType="empty",this._startedAt=0,this._pausedAt=0,this.filters=[]}function Vi(e){ji.call(this,e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function Wi(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 qi(e,t,n){this.binding=e,this.valueSize=n;var r,i=Float64Array;switch(t){case"quaternion":r=this._slerp;break;case"string":case"bool":i=Array,r=this._select;break;default:r=this._lerp}this.buffer=new i(4*n),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function Xi(e,t,n){var r=n||Yi.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function Yi(e,t,n){this.path=t,this.parsedPath=n||Yi.parseTrackName(t),this.node=Yi.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function Zi(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var r=t.tracks,i=r.length,a=Array(i),o={endingStart:2400,endingEnd:2400},s=0;s!==i;++s){var c=r[s].createInterpolant(null);a[s]=c,c.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=0,this.enabled=1,this.clampWhenFinished=0,this.zeroSlopeAtStart=1,this.zeroSlopeAtEnd=1}function Ji(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function $i(e,t){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=t),this.value=e}function Qi(e,t,n){Ht.call(this,e,t),this.meshPerAttribute=n||1}function Ki(e,t,n,r){this.ray=new v(e,t),this.near=n||0,this.far=r||1/0,this.camera=null,this.layers=new h,this.params={Mesh:{},Line:{threshold:1},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 ea(e,t){return e.distance-t.distance}function ta(e,t,n,r){if(e.layers.test(t.layers)&&e.raycast(t,n),1==r)for(var i=e.children,a=0,o=i.length;a<o;a++)ta(i[a],t,n,1)}function na(e,n){this.min=void 0!==e?e:new t(1/0,1/0),this.max=void 0!==n?n:new t(-1/0,-1/0)}function ra(e,t){this.start=void 0!==e?e:new c,this.end=void 0!==t?t:new c}function ia(e){p.call(this),this.material=e,this.render=function(){}}function aa(e,t){p.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=0,this.color=t;for(var n=new F,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,a=1;i<32;i++,a++){var o=a/32*Math.PI*2;r.push(1,0,1,Math.cos(o),Math.sin(o),1)}n.setAttribute("position",new I(r,3));var s=new Jt({fog:0,toneMapped:0});this.cone=new Qt(n,s),this.add(this.cone),this.update()}function oa(e){for(var t=function e(t){var n=[];t&&t.isBone&&n.push(t);for(var r=0;r<t.children.length;r++)n.push.apply(n,e(t.children[r]));return n}(e),n=new F,r=[],i=[],a=new b(0,0,1),o=new b(0,1,0),s=0;s<t.length;s++){var c=t[s];c.parent&&c.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}n.setAttribute("position",new I(r,3)),n.setAttribute("color",new I(i,3));var l=new Jt({vertexColors:1,depthTest:0,depthWrite:0,toneMapped:0,transparent:1});Qt.call(this,n,l),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=0}function sa(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var r=new nr(t,4,2),i=new E({wireframe:1,fog:0,toneMapped:0});H.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=0,this.update()}function ca(e,t,n){p.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=0,this.color=n;var r=new gn(t);r.rotateY(.5*Math.PI),this.material=new E({wireframe:1,fog:0,toneMapped:0}),void 0===this.color&&(this.material.vertexColors=1);var i=r.getAttribute("position"),a=new Float32Array(3*i.count);r.setAttribute("color",new A(a,3)),this.add(new H(r,this.material)),this.update()}function la(e,t,n,r){e=e||10,t=t||10,n=new b(void 0!==n?n:4473924),r=new b(void 0!==r?r:8947848);for(var i=t/2,a=e/t,o=e/2,s=[],c=[],l=0,u=0,h=-o;l<=t;l++,h+=a){s.push(-o,0,h,o,0,h),s.push(h,0,-o,h,0,o);var p=l===i?n:r;p.toArray(c,u),u+=3,p.toArray(c,u),u+=3,p.toArray(c,u),u+=3,p.toArray(c,u),u+=3}var d=new F;d.setAttribute("position",new I(s,3)),d.setAttribute("color",new I(c,3));var f=new Jt({vertexColors:1,toneMapped:0});Qt.call(this,d,f)}function ua(e,t,n,r,i,a){e=e||10,t=t||16,n=n||8,r=r||64,i=new b(void 0!==i?i:4473924),a=new b(void 0!==a?a:8947848);var o,s,c,l,u,h,p,d=[],f=[];for(l=0;l<=t;l++)o=Math.sin(c=l/t*(2*Math.PI))*e,s=Math.cos(c)*e,d.push(0,0,0),d.push(o,0,s),p=1&l?i:a,f.push(p.r,p.g,p.b),f.push(p.r,p.g,p.b);for(l=0;l<=n;l++)for(p=1&l?i:a,h=e-e/n*l,u=0;u<r;u++)o=Math.sin(c=u/r*(2*Math.PI))*h,s=Math.cos(c)*h,d.push(o,0,s),f.push(p.r,p.g,p.b),o=Math.sin(c=(u+1)/r*(2*Math.PI))*h,s=Math.cos(c)*h,d.push(o,0,s),f.push(p.r,p.g,p.b);var m=new F;m.setAttribute("position",new I(d,3)),m.setAttribute("color",new I(f,3));var g=new Jt({vertexColors:1,toneMapped:0});Qt.call(this,m,g)}function ha(e,t,n){p.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=0,this.color=n,void 0===t&&(t=1);var r=new F;r.setAttribute("position",new I([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var i=new Jt({fog:0,toneMapped:0});this.lightPlane=new $t(r,i),this.add(this.lightPlane),(r=new F).setAttribute("position",new I([0,0,0,0,0,1],3)),this.targetLine=new $t(r,i),this.add(this.targetLine),this.update()}function pa(e){function t(e,t,r){n(e,r),n(t,r)}function n(e,t){a.push(0,0,0),o.push(t.r,t.g,t.b),void 0===s[e]&&(s[e]=[]),s[e].push(a.length/3-1)}var r=new F,i=new Jt({color:16777215,vertexColors:1,toneMapped:0}),a=[],o=[],s={},c=new b(16755200),l=new b(16711680),u=new b(43775),h=new b(16777215),p=new b(3355443);t("n1","n2",c),t("n2","n4",c),t("n4","n3",c),t("n3","n1",c),t("f1","f2",c),t("f2","f4",c),t("f4","f3",c),t("f3","f1",c),t("n1","f1",c),t("n2","f2",c),t("n3","f3",c),t("n4","f4",c),t("p","n1",l),t("p","n2",l),t("p","n3",l),t("p","n4",l),t("u1","u2",u),t("u2","u3",u),t("u3","u1",u),t("c","t",h),t("p","c",p),t("cn1","cn2",p),t("cn3","cn4",p),t("cf1","cf2",p),t("cf3","cf4",p),r.setAttribute("position",new I(a,3)),r.setAttribute("color",new I(o,3)),Qt.call(this,r,i),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=0,this.pointMap=s,this.update()}function da(e,t,n,r,i,a,o){vl.set(i,a,o).unproject(r);var s=t[e];if(void 0!==s)for(var c=n.getAttribute("position"),l=0,u=s.length;l<u;l++)c.setXYZ(s[l],vl.x,vl.y,vl.z)}function fa(e,t){this.object=e,void 0===t&&(t=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new F;i.setIndex(new A(n,1)),i.setAttribute("position",new A(r,3)),Qt.call(this,i,new Jt({color:t,toneMapped:0})),this.matrixAutoUpdate=0,this.update()}function ma(e,t){this.type="Box3Helper",this.box=e,t=t||16776960;var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new F;r.setIndex(new A(n,1)),r.setAttribute("position",new I([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),Qt.call(this,r,new Jt({color:t,toneMapped:0})),this.geometry.computeBoundingSphere()}function ga(e,t,n){this.type="PlaneHelper",this.plane=e,this.size=void 0===t?1:t;var r=void 0!==n?n:16776960,i=new F;i.setAttribute("position",new I([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),i.computeBoundingSphere(),$t.call(this,i,new Jt({color:r,toneMapped:0}));var a=new F;a.setAttribute("position",new I([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new H(a,new E({color:r,opacity:.2,transparent:1,depthWrite:0,toneMapped:0})))}function va(e,t,n,r,i,a){p.call(this),void 0===e&&(e=new c(0,0,1)),void 0===t&&(t=new c(0,0,0)),void 0===n&&(n=1),void 0===r&&(r=16776960),void 0===i&&(i=.2*n),void 0===a&&(a=.2*i),void 0===bl&&((bl=new F).setAttribute("position",new I([0,0,0,0,1,0],3)),(wl=new pr(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new $t(bl,new Jt({color:r,toneMapped:0})),this.line.matrixAutoUpdate=0,this.add(this.line),this.cone=new H(wl,new E({color:r,toneMapped:0})),this.cone.matrixAutoUpdate=0,this.add(this.cone),this.setDirection(e),this.setLength(n,i,a)}function ya(e){var t=[0,0,0,e=e||1,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new F;n.setAttribute("position",new I(t,3)),n.setAttribute("color",new I([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var r=new Jt({vertexColors:1,toneMapped:0});Qt.call(this,n,r)}function xa(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),ei.call(this,e),this.type="catmullrom"}function ba(e,t){return e(t={exports:{}},t.exports),t.exports}function wa(e){if(e.isMesh){if(Bl=e.geometry,Bl.isBufferGeometry){var t=Bl.clone(Bl),n=Bl.getAttribute("position");if(void 0!==n){let c=n.count;for(let l=0;l<c;l++)if(Hl.x=n.getX(l),Hl.y=n.getY(l),Hl.z=n.getZ(l),null==Bl.skinIndexNames||0==Bl.skinIndexNames)Hl.applyMatrix4(e.matrixWorld).applyMatrix4(Ul).applyMatrix4(Fl),t.attributes.position.setXYZ(l,Hl.x,Hl.y,Hl.z);else{if(void 0!==Bl.morphTargetInfluences){for(var r=new i(Hl.x,Hl.y,Hl.z),a=new i,o=0;o<Bl.morphAttributes.position.length;o++)if(0!=Bl.morphTargetInfluences[o]&&Bl.morphTargetDictionary.hide!=o){var s=new i(Bl.morphAttributes.position[o].getX(l),Bl.morphAttributes.position[o].getY(l),Bl.morphAttributes.position[o].getZ(l));a.addScaledVector(s.sub(r),Bl.morphTargetInfluences[o])}r.add(a)}let n=new i;void 0!==Bl.morphTargetInfluences&&Bl.morphTargetInfluences.reduce((e,t)=>e+t)>0?console.log(`morphed: ${Bl.name}`):console.log(`not morphed: ${Bl.name}`);for(let t=0;t<Bl.skinIndexNames.length;t++)_a(l,t,e,r,n);t.attributes.position.setXYZ(l,n.x,n.y,n.z)}}}else console.warn("Geometry type unsupported",Bl);return t}console.warn("Mesh type unsupported",e)}function _a(e,t,n,r,i){for(var a=Bl.getAttribute([Bl.skinIndexNames[t]]),o=Bl.getAttribute([Bl.skinWeightNames[t]]),s=[a.getX(e),a.getY(e),a.getZ(e),a.getW(e)],c=[o.getX(e),o.getY(e),o.getZ(e),o.getW(e)],l=[n.skeleton.boneInverses[s[0]],n.skeleton.boneInverses[s[1]],n.skeleton.boneInverses[s[2]],n.skeleton.boneInverses[s[3]]],u=[n.skeleton.bones[s[0]].matrixWorld,n.skeleton.bones[s[1]].matrixWorld,n.skeleton.bones[s[2]].matrixWorld,n.skeleton.bones[s[3]].matrixWorld],h=0;h<4;h++)Ma(r,i,c,l,u,h)}function Ma(e,t,n,r,a,o){var s=void 0!==Bl.morphTargetInfluences&&Bl.morphTargetInfluences.reduce((e,t)=>e+t)>0?e:Hl,c=new i(s.x,s.y,s.z);c.multiplyScalar(n[o]),c.applyMatrix4(r[o]).applyMatrix4(a[o]).applyMatrix4(Ul).applyMatrix4(Fl),t.add(c)}function Sa(){var e=zl("#subdivideSLT").val()>0?zl("#subdivideSLT").val():void 0,t=CK.character.data.mirroredPose,n=Ca(CK.character,e,t),r=(new Pl).parse(n),i=La(),a=new Blob([r],{type:"application/sla;charset=utf-8"});Il(a,i+(e?"-smooth":"")+".stl")}function Ta(){var e=zl("#subdivideSLT").val()>0?zl("#subdivideSLT").val():void 0,t=CK.character.data.mirroredPose,n=Ca(CK.character,e,t),r=(new Ol).parse(n),i=La(),a=new Blob([r],{type:"text/plain;charset=utf-8"});Il(a,i+(e?"-smooth":"")+".obj")}function Ea(){var e=La(),t=new Blob([JSON.stringify(CK.data.getJson())],{type:"text/plain;charset=utf-8"});Il(t,e+".json")}function Aa(e){var t=e.target.files[0],n=new FileReader;n.onload=function(e){e.preventDefault(),CK.change(JSON.parse(e.target.result))},null!=t&&n.readAsText(t)}function La(){var e=CK.character.data.meta.character_name;return""===e?"Hero":e}function Ca(e,t,n){var r=new E,i=new It;return e.traverseVisible((function(e){if(e.isMesh){var a=wa(e);1==n&&(a=function(e){const t=[0,0,0];e.index&&e.copy(e.toNonIndexed());for(let n=0;n<e.attributes.position.array.length/9;n++)t[0]=e.attributes.position.array[9*n],t[1]=e.attributes.position.array[9*n+1],t[2]=e.attributes.position.array[9*n+2],e.attributes.position.array[9*n]=e.attributes.position.array[9*n+6],e.attributes.position.array[9*n+1]=e.attributes.position.array[9*n+7],e.attributes.position.array[9*n+2]=e.attributes.position.array[9*n+8],e.attributes.position.array[9*n+6]=t[0],e.attributes.position.array[9*n+7]=t[1],e.attributes.position.array[9*n+8]=t[2];return e}(a)),t&&"baseRim"!=e.name&&"base"!=e.name&&(a=function(e,t){return new Nl(t).modify(e)}(a,t));var o=new H(a,r);i.add(o)}})),i}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"name"in Function.prototype==0&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}),Object.assign(e.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return 0;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),r=0,i=n.length;r<i;r++)n[r].call(this,e)}}}});for(var Ra=[],Pa=0;Pa<256;Pa++)Ra[Pa]=(Pa<16?"0":"")+Pa.toString(16);var Oa,Na={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(Ra[255&e]+Ra[e>>8&255]+Ra[e>>16&255]+Ra[e>>24&255]+"-"+Ra[255&t]+Ra[t>>8&255]+"-"+Ra[t>>16&15|64]+Ra[t>>24&255]+"-"+Ra[63&n|128]+Ra[n>>8&255]+"-"+Ra[n>>16&255]+Ra[n>>24&255]+Ra[255&r]+Ra[r>>8&255]+Ra[r>>16&255]+Ra[r>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-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*Na.DEG2RAD},radToDeg:function(e){return e*Na.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))},setQuaternionFromProperEuler:function(e,t,n,r,i){var a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((t+r)/2),u=o((t+r)/2),h=a((t-r)/2),p=o((t-r)/2),d=a((r-t)/2),f=o((r-t)/2);"XYX"===i?e.set(s*u,c*h,c*p,s*l):"YZY"===i?e.set(c*p,s*u,c*h,s*l):"ZXZ"===i?e.set(c*h,c*p,s*u,s*l):"XZX"===i?e.set(s*u,c*f,c*d,s*l):"YXY"===i?e.set(c*d,s*u,c*f,s*l):"ZYZ"===i?e.set(c*f,c*d,s*u,s*l):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};Object.defineProperties(t.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(t.prototype,{isVector2:1,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=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,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[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 n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(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(){return Math.atan2(-this.y,-this.x)+Math.PI},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},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,n){return this.subVectors(t,e).multiplyScalar(n).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,n){return void 0!==n&&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 n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}}),Object.assign(n.prototype,{isMatrix3:1,set:function(e,t,n,r,i,a,o,s,c){var l=this.elements;return l[0]=e,l[1]=r,l[2]=o,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=c,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,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this},extractBasis:function(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],c=n[1],l=n[4],u=n[7],h=n[2],p=n[5],d=n[8],f=r[0],m=r[3],g=r[6],v=r[1],y=r[4],x=r[7],b=r[2],w=r[5],_=r[8];return i[0]=a*f+o*v+s*b,i[3]=a*m+o*y+s*w,i[6]=a*g+o*x+s*_,i[1]=c*f+l*v+u*b,i[4]=c*m+l*y+u*w,i[7]=c*g+l*x+u*_,i[2]=h*f+p*v+d*b,i[5]=h*m+p*y+d*w,i[8]=h*g+p*x+d*_,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],c=e[7],l=e[8];return t*a*l-t*o*c-n*i*l+n*o*s+r*i*c-r*a*s},getInverse:function(e,t){void 0!==t&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var n=e.elements,r=this.elements,i=n[0],a=n[1],o=n[2],s=n[3],c=n[4],l=n[5],u=n[6],h=n[7],p=n[8],d=p*c-l*h,f=l*u-p*s,m=h*s-c*u,g=i*d+a*f+o*m;if(0===g)return this.set(0,0,0,0,0,0,0,0,0);var v=1/g;return r[0]=d*v,r[1]=(o*h-p*a)*v,r[2]=(l*a-o*c)*v,r[3]=f*v,r[4]=(p*i-o*u)*v,r[5]=(o*s-l*i)*v,r[6]=m*v,r[7]=(a*u-h*i)*v,r[8]=(c*i-a*s)*v,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},setUvTransform:function(e,t,n,r,i,a,o){var s=Math.cos(i),c=Math.sin(i);this.set(n*s,n*c,-n*(s*a+c*o)+a+e,-r*c,r*s,-r*(-c*a+s*o)+o+t,0,0,1)},scale:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],c=r[4],l=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*c,r[6]=t*o+n*l,r[1]=-n*i+t*s,r[4]=-n*a+t*c,r[7]=-n*o+t*l,this},translate:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return 0;return 1},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}});var Da={getDataURL:function(e){var t;if("undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Oa&&(Oa=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Oa.width=e.width,Oa.height=e.height;var n=Oa.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Oa}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},Ia=0;r.DEFAULT_IMAGE=void 0,r.DEFAULT_MAPPING=300,r.prototype=Object.assign(Object.create(e.prototype),{constructor:r,isTexture:1,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=Na.generateUUID()),!t&&void 0===e.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var a=0,o=r.length;a<o;a++)i.push(Da.getDataURL(r[a]))}else i=Da.getDataURL(r);e.images[r.uuid]={uuid:r.uuid,url:i}}n.image=r.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(r.prototype,"needsUpdate",{set:function(e){1==e&&this.version++}}),Object.defineProperties(i.prototype,{width:{get:function(){return this.z},set:function(e){this.z=e}},height:{get:function(){return this.w},set:function(e){this.w=e}}}),Object.assign(i.prototype,{isVector4:1,set:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=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,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,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 t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,n,r,i=e.elements,a=i[0],o=i[4],s=i[8],c=i[1],l=i[5],u=i[9],h=i[2],p=i[6],d=i[10];if(Math.abs(o-c)<.01&&Math.abs(s-h)<.01&&Math.abs(u-p)<.01){if(Math.abs(o+c)<.1&&Math.abs(s+h)<.1&&Math.abs(u+p)<.1&&Math.abs(a+l+d-3)<.1)return this.set(1,0,0,0),this;var f=(a+1)/2,m=(l+1)/2,g=(d+1)/2,v=(o+c)/4,y=(s+h)/4,x=(u+p)/4;return f>m&&f>g?f<.01?(t=0,n=.707106781,r=.707106781):(n=v/(t=Math.sqrt(f)),r=y/t):m>g?m<.01?(t=.707106781,n=0,r=.707106781):(t=v/(n=Math.sqrt(m)),r=x/n):g<.01?(t=.707106781,n=.707106781,r=0):(t=y/(r=Math.sqrt(g)),n=x/r),this.set(t,n,r,3.141592653589793),this}var b=Math.sqrt((p-u)*(p-u)+(s-h)*(s-h)+(c-o)*(c-o));return Math.abs(b)<.001&&(b=1),this.x=(p-u)/b,this.y=(s-h)/b,this.z=(c-o)/b,this.w=Math.acos((a+l+d-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(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.w=Math.max(e,Math.min(t,this.w)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(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,n){return this.subVectors(t,e).multiplyScalar(n).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,n){return void 0!==n&&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}}),a.prototype=Object.assign(Object.create(e.prototype),{constructor:a,isWebGLRenderTarget:1,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.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"})}}),o.prototype=Object.assign(Object.create(a.prototype),{constructor:o,isWebGLMultisampleRenderTarget:1,copy:function(e){return a.prototype.copy.call(this,e),this.samples=e.samples,this}}),Object.assign(s,{slerp:function(e,t,n,r){return n.copy(e).slerp(t,r)},slerpFlat:function(e,t,n,r,i,a,o){var s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],h=i[a+0],p=i[a+1],d=i[a+2],f=i[a+3];if(u!==f||s!==h||c!==p||l!==d){var m=1-o,g=s*h+c*p+l*d+u*f,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var x=Math.sqrt(y),b=Math.atan2(x,g*v);m=Math.sin(m*b)/x,o=Math.sin(o*b)/x}var w=o*v;if(s=s*m+h*w,c=c*m+p*w,l=l*m+d*w,u=u*m+f*w,m===1-o){var _=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=_,c*=_,l*=_,u*=_}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}}),Object.defineProperties(s.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(s.prototype,{isQuaternion:1,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,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 n=e._x,r=e._y,i=e._z,a=e.order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),h=s(n/2),p=s(r/2),d=s(i/2);return"XYZ"===a?(this._x=h*l*u+c*p*d,this._y=c*p*u-h*l*d,this._z=c*l*d+h*p*u,this._w=c*l*u-h*p*d):"YXZ"===a?(this._x=h*l*u+c*p*d,this._y=c*p*u-h*l*d,this._z=c*l*d-h*p*u,this._w=c*l*u+h*p*d):"ZXY"===a?(this._x=h*l*u-c*p*d,this._y=c*p*u+h*l*d,this._z=c*l*d+h*p*u,this._w=c*l*u-h*p*d):"ZYX"===a?(this._x=h*l*u-c*p*d,this._y=c*p*u+h*l*d,this._z=c*l*d-h*p*u,this._w=c*l*u+h*p*d):"YZX"===a?(this._x=h*l*u+c*p*d,this._y=c*p*u+h*l*d,this._z=c*l*d-h*p*u,this._w=c*l*u-h*p*d):"XZY"===a&&(this._x=h*l*u-c*p*d,this._y=c*p*u-h*l*d,this._z=c*l*d+h*p*u,this._w=c*l*u+h*p*d),0!=t&&this._onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,r=n[0],i=n[4],a=n[8],o=n[1],s=n[5],c=n[9],l=n[2],u=n[6],h=n[10],p=r+s+h;return p>0?(t=.5/Math.sqrt(p+1),this._w=.25/t,this._x=(u-c)*t,this._y=(a-l)*t,this._z=(o-i)*t):r>s&&r>h?(t=2*Math.sqrt(1+r-s-h),this._w=(u-c)/t,this._x=.25*t,this._y=(i+o)/t,this._z=(a+l)/t):s>h?(t=2*Math.sqrt(1+s-r-h),this._w=(a-l)/t,this._x=(i+o)/t,this._y=.25*t,this._z=(c+u)/t):(t=2*Math.sqrt(1+h-r-s),this._w=(o-i)/t,this._x=(a+l)/t,this._y=(c+u)/t,this._z=.25*t),this._onChangeCallback(),this},setFromUnitVectors:function(e,t){var n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(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=n),this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(Na.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),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._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=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 n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,a=this._w,o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;var s=1-o*o;if(s<=Number.EPSILON){var c=1-t;return this._w=c*a+t*this._w,this._x=c*n+t*this._x,this._y=c*r+t*this._y,this._z=c*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var l=Math.sqrt(s),u=Math.atan2(l,o),h=Math.sin((1-t)*u)/l,p=Math.sin(t*u)/l;return this._w=a*h+this._w*p,this._x=n*h+this._x*p,this._y=r*h+this._y*p,this._z=i*h+this._z*p,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},fromBufferAttribute:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});var za=new c,Ba=new s;Object.assign(c.prototype,{isVector3:1,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=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:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Ba.setFromEuler(e))},applyAxisAngle:function(e,t){return this.applyQuaternion(Ba.setFromAxisAngle(e,t))},applyMatrix3:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this},applyNormalMatrix:function(e){return this.applyMatrix3(e).normalize()},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=s*t+a*r-o*n,l=s*n+o*t-i*r,u=s*r+i*n-a*t,h=-i*t-a*n-o*r;return this.x=c*s+h*-i+l*-o-u*-a,this.y=l*s+h*-a+u*-i-c*-o,this.z=u*s+h*-o+c*-a-l*-i,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,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,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 n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(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,n){return this.subVectors(t,e).multiplyScalar(n).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 n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this},projectOnVector:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)},projectOnPlane:function(e){return za.copy(this).projectOnVector(e),this.sub(za)},reflect:function(e){return this.sub(za.copy(e).multiplyScalar(2*this.dot(e)))},angleTo:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(Na.clamp(n,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r},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,n){var r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},setFromMatrix3Column:function(e,t){return this.fromArray(e.elements,3*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,n){return void 0!==n&&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}});var Ua=new c,Fa=new l,Ha=new c(0,0,0),ka=new c(1,1,1),Ga=new c,ja=new c,Va=new c;Object.assign(l.prototype,{isMatrix4:1,set:function(e,t,n,r,i,a,o,s,c,l,u,h,p,d,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=h,g[3]=p,g[7]=d,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 l).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this},copyPosition:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},extractRotation:function(e){var t=this.elements,n=e.elements,r=1/Ua.setFromMatrixColumn(e,0).length(),i=1/Ua.setFromMatrixColumn(e,1).length(),a=1/Ua.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[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,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),c=Math.sin(r),l=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){var h=a*l,p=a*u,d=o*l,f=o*u;t[0]=s*l,t[4]=-s*u,t[8]=c,t[1]=p+d*c,t[5]=h-f*c,t[9]=-o*s,t[2]=f-h*c,t[6]=d+p*c,t[10]=a*s}else if("YXZ"===e.order){var m=s*l,g=s*u,v=c*l,y=c*u;t[0]=m+y*o,t[4]=v*o-g,t[8]=a*c,t[1]=a*u,t[5]=a*l,t[9]=-o,t[2]=g*o-v,t[6]=y+m*o,t[10]=a*s}else if("ZXY"===e.order)m=s*l,g=s*u,v=c*l,y=c*u,t[0]=m-y*o,t[4]=-a*u,t[8]=v+g*o,t[1]=g+v*o,t[5]=a*l,t[9]=y-m*o,t[2]=-a*c,t[6]=o,t[10]=a*s;else if("ZYX"===e.order)h=a*l,p=a*u,d=o*l,f=o*u,t[0]=s*l,t[4]=d*c-p,t[8]=h*c+f,t[1]=s*u,t[5]=f*c+h,t[9]=p*c-d,t[2]=-c,t[6]=o*s,t[10]=a*s;else if("YZX"===e.order){var x=a*s,b=a*c,w=o*s,_=o*c;t[0]=s*l,t[4]=_-x*u,t[8]=w*u+b,t[1]=u,t[5]=a*l,t[9]=-o*l,t[2]=-c*l,t[6]=b*u+w,t[10]=x-_*u}else"XZY"===e.order&&(x=a*s,b=a*c,w=o*s,_=o*c,t[0]=s*l,t[4]=-u,t[8]=c*l,t[1]=x*u+_,t[5]=a*l,t[9]=b*u-w,t[2]=w*u-b,t[6]=o*l,t[10]=_*u+x);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(e){return this.compose(Ha,e,ka)},lookAt:function(e,t,n){var r=this.elements;return Va.subVectors(e,t),0===Va.lengthSq()&&(Va.z=1),Va.normalize(),Ga.crossVectors(n,Va),0===Ga.lengthSq()&&(1===Math.abs(n.z)?Va.x+=1e-4:Va.z+=1e-4,Va.normalize(),Ga.crossVectors(n,Va)),Ga.normalize(),ja.crossVectors(Va,Ga),r[0]=Ga.x,r[4]=ja.x,r[8]=Va.x,r[1]=Ga.y,r[5]=ja.y,r[9]=Va.y,r[2]=Ga.z,r[6]=ja.z,r[10]=Va.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 n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],c=n[12],l=n[1],u=n[5],h=n[9],p=n[13],d=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],b=n[15],w=r[0],_=r[4],M=r[8],S=r[12],T=r[1],E=r[5],A=r[9],L=r[13],C=r[2],R=r[6],P=r[10],O=r[14],N=r[3],D=r[7],I=r[11],z=r[15];return i[0]=a*w+o*T+s*C+c*N,i[4]=a*_+o*E+s*R+c*D,i[8]=a*M+o*A+s*P+c*I,i[12]=a*S+o*L+s*O+c*z,i[1]=l*w+u*T+h*C+p*N,i[5]=l*_+u*E+h*R+p*D,i[9]=l*M+u*A+h*P+p*I,i[13]=l*S+u*L+h*O+p*z,i[2]=d*w+f*T+m*C+g*N,i[6]=d*_+f*E+m*R+g*D,i[10]=d*M+f*A+m*P+g*I,i[14]=d*S+f*L+m*O+g*z,i[3]=v*w+y*T+x*C+b*N,i[7]=v*_+y*E+x*R+b*D,i[11]=v*M+y*A+x*P+b*I,i[15]=v*S+y*L+x*O+b*z,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},determinant:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],h=e[10],p=e[14];return e[3]*(+i*s*u-r*c*u-i*o*h+n*c*h+r*o*p-n*s*p)+e[7]*(+t*s*p-t*c*h+i*a*h-r*a*p+r*c*l-i*s*l)+e[11]*(+t*c*u-t*o*p-i*a*u+n*a*p+i*o*l-n*c*l)+e[15]*(-r*o*l-t*s*u+t*o*h+r*a*u-n*a*h+n*s*l)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e,t,n){var r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this},getInverse:function(e,t){void 0!==t&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var n=this.elements,r=e.elements,i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],u=r[6],h=r[7],p=r[8],d=r[9],f=r[10],m=r[11],g=r[12],v=r[13],y=r[14],x=r[15],b=d*y*h-v*f*h+v*u*m-l*y*m-d*u*x+l*f*x,w=g*f*h-p*y*h-g*u*m+c*y*m+p*u*x-c*f*x,_=p*v*h-g*d*h+g*l*m-c*v*m-p*l*x+c*d*x,M=g*d*u-p*v*u-g*l*f+c*v*f+p*l*y-c*d*y,S=i*b+a*w+o*_+s*M;if(0===S)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var T=1/S;return n[0]=b*T,n[1]=(v*f*s-d*y*s-v*o*m+a*y*m+d*o*x-a*f*x)*T,n[2]=(l*y*s-v*u*s+v*o*h-a*y*h-l*o*x+a*u*x)*T,n[3]=(d*u*s-l*f*s-d*o*h+a*f*h+l*o*m-a*u*m)*T,n[4]=w*T,n[5]=(p*y*s-g*f*s+g*o*m-i*y*m-p*o*x+i*f*x)*T,n[6]=(g*u*s-c*y*s-g*o*h+i*y*h+c*o*x-i*u*x)*T,n[7]=(c*f*s-p*u*s+p*o*h-i*f*h-c*o*m+i*u*m)*T,n[8]=_*T,n[9]=(g*d*s-p*v*s-g*a*m+i*v*m+p*a*x-i*d*x)*T,n[10]=(c*v*s-g*l*s+g*a*h-i*v*h-c*a*x+i*l*x)*T,n[11]=(p*l*s-c*d*s-p*a*h+i*d*h+c*a*m-i*l*m)*T,n[12]=M*T,n[13]=(p*v*o-g*d*o+g*a*f-i*v*f-p*a*y+i*d*y)*T,n[14]=(g*l*o-c*v*o-g*a*u+i*v*u+c*a*y-i*l*y)*T,n[15]=(c*d*o-p*l*o+p*a*u-i*d*u-c*a*f+i*l*f)*T,this},scale:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,c=i*a,l=i*o;return this.set(c*a+n,c*o-r*s,c*s+r*o,0,c*o+r*s,l*o+n,l*s-r*a,0,c*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){var r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,c=i+i,l=a+a,u=o+o,h=i*c,p=i*l,d=i*u,f=a*l,m=a*u,g=o*u,v=s*c,y=s*l,x=s*u,b=n.x,w=n.y,_=n.z;return r[0]=(1-(f+g))*b,r[1]=(p+x)*b,r[2]=(d-y)*b,r[3]=0,r[4]=(p-x)*w,r[5]=(1-(h+g))*w,r[6]=(m+v)*w,r[7]=0,r[8]=(d+y)*_,r[9]=(m-v)*_,r[10]=(1-(h+f))*_,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this},decompose:function(e,t,n){var r=this.elements,i=Ua.set(r[0],r[1],r[2]).length(),a=Ua.set(r[4],r[5],r[6]).length(),o=Ua.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Fa.copy(this);var s=1/i,c=1/a,l=1/o;return Fa.elements[0]*=s,Fa.elements[1]*=s,Fa.elements[2]*=s,Fa.elements[4]*=c,Fa.elements[5]*=c,Fa.elements[6]*=c,Fa.elements[8]*=l,Fa.elements[9]*=l,Fa.elements[10]*=l,t.setFromRotationMatrix(Fa),n.x=i,n.y=a,n.z=o,this},makePerspective:function(e,t,n,r,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*i/(t-e),c=2*i/(n-r),l=(t+e)/(t-e),u=(n+r)/(n-r),h=-(a+i)/(a-i),p=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=c,o[9]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=p,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,n,r,i,a){var o=this.elements,s=1/(t-e),c=1/(n-r),l=1/(a-i),u=(t+e)*s,h=(n+r)*c,p=(a+i)*l;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return 0;return 1},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}});var Wa=new l,qa=new s;u.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],u.DefaultOrder="XYZ",Object.defineProperties(u.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()}},order:{get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}}),Object.assign(u.prototype,{isEuler:1,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var r=Na.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],c=i[1],l=i[5],u=i[9],h=i[2],p=i[6],d=i[10];return"XYZ"===(t=t||this._order)?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(p,l),this._z=0)):"YXZ"===t?(this._x=Math.asin(-r(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-h,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(r(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(c,a))):"ZYX"===t?(this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,d),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,l))):"YZX"===t?(this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(s,d))):"XZY"===t?(this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,l),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-u,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,0!=n&&this._onChangeCallback(),this},setFromQuaternion:function(e,t,n){return Wa.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Wa,t,n)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return qa.setFromEuler(this),this.setFromQuaternion(qa,e)},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 c(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}}),Object.assign(h.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask|=1<<e|0},enableAll:function(){this.mask=-1},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},disableAll:function(){this.mask=0},test:function(e){return 0!=(this.mask&e.mask)}});var Xa=0,Ya=new c,Za=new s,Ja=new l,$a=new c,Qa=new c,Ka=new c,eo=new s,to=new c(1,0,0),no=new c(0,1,0),ro=new c(0,0,1),io={type:"added"},ao={type:"removed"};p.DefaultUp=new c(0,1,0),p.DefaultMatrixAutoUpdate=1,p.prototype=Object.assign(Object.create(e.prototype),{constructor:p,isObject3D:1,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,1)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(e,t){return Za.setFromAxisAngle(e,t),this.quaternion.multiply(Za),this},rotateOnWorldAxis:function(e,t){return Za.setFromAxisAngle(e,t),this.quaternion.premultiply(Za),this},rotateX:function(e){return this.rotateOnAxis(to,e)},rotateY:function(e){return this.rotateOnAxis(no,e)},rotateZ:function(e){return this.rotateOnAxis(ro,e)},translateOnAxis:function(e,t){return Ya.copy(e).applyQuaternion(this.quaternion),this.position.add(Ya.multiplyScalar(t)),this},translateX:function(e){return this.translateOnAxis(to,e)},translateY:function(e){return this.translateOnAxis(no,e)},translateZ:function(e){return this.translateOnAxis(ro,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(Ja.getInverse(this.matrixWorld))},lookAt:function(e,t,n){e.isVector3?$a.copy(e):$a.set(e,t,n);var r=this.parent;this.updateWorldMatrix(1,0),Qa.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ja.lookAt(Qa,$a,this.up):Ja.lookAt($a,Qa,this.up),this.quaternion.setFromRotationMatrix(Ja),r&&(Ja.extractRotation(r.matrixWorld),Za.setFromRotationMatrix(Ja),this.quaternion.premultiply(Za.inverse()))},add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(io)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return-1!==n&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(ao)),this},attach:function(e){return this.updateWorldMatrix(1,0),Ja.getInverse(this.matrixWorld),null!==e.parent&&(e.parent.updateWorldMatrix(1,0),Ja.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ja),e.updateWorldMatrix(0,0),this.add(e),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,r=this.children.length;n<r;n++){var i=this.children[n].getObjectByProperty(e,t);if(void 0!==i)return i}},getWorldPosition:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new c),this.updateMatrixWorld(1),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new s),this.updateMatrixWorld(1),this.matrixWorld.decompose(Qa,e,Ka),e},getWorldScale:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new c),this.updateMatrixWorld(1),this.matrixWorld.decompose(Qa,eo,e),e},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new c),this.updateMatrixWorld(1);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()},raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverse(e)},traverseVisible:function(e){if(0!=this.visible){e(this);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=1},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=0,e=1);for(var t=this.children,n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)},updateWorldMatrix:function(e,t){var n=this.parent;if(1==e&&null!==n&&n.updateWorldMatrix(1,0),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),1==t)for(var r=this.children,i=0,a=r.length;i<a;i++)r[i].updateWorldMatrix(0,1)},toJSON:function(e){function t(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}function n(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}var r=void 0===e||"string"==typeof e,i={};r&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var a={};if(a.uuid=this.uuid,a.type=this.type,""!==this.name&&(a.name=this.name),1==this.castShadow&&(a.castShadow=1),1==this.receiveShadow&&(a.receiveShadow=1),0==this.visible&&(a.visible=0),0==this.frustumCulled&&(a.frustumCulled=0),0!==this.renderOrder&&(a.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(a.userData=this.userData),a.layers=this.layers.mask,a.matrix=this.matrix.toArray(),0==this.matrixAutoUpdate&&(a.matrixAutoUpdate=0),this.isInstancedMesh&&(a.type="InstancedMesh",a.count=this.count,a.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){a.geometry=t(e.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var s=o.shapes;if(Array.isArray(s))for(var c=0,l=s.length;c<l;c++){var u=s[c];t(e.shapes,u)}else t(e.shapes,s)}}if(void 0!==this.material)if(Array.isArray(this.material)){var h=[];for(c=0,l=this.material.length;c<l;c++)h.push(t(e.materials,this.material[c]));a.material=h}else a.material=t(e.materials,this.material);if(this.children.length>0)for(a.children=[],c=0;c<this.children.length;c++)a.children.push(this.children[c].toJSON(e).object);if(r){var p=n(e.geometries),d=n(e.materials),f=n(e.textures),m=n(e.images);s=n(e.shapes),p.length>0&&(i.geometries=p),d.length>0&&(i.materials=d),f.length>0&&(i.textures=f),m.length>0&&(i.images=m),s.length>0&&(i.shapes=s)}return i.object=a,i},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=1),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),1==t)for(var n=0;n<e.children.length;n++){var r=e.children[n];this.add(r.clone())}return this}}),d.prototype=Object.assign(Object.create(p.prototype),{constructor:d,isScene:1,copy:function(e,t){return p.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=p.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.environment&&(t.object.environment=this.environment.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t},dispose:function(){this.dispatchEvent({type:"dispose"})}});var oo=[new c,new c,new c,new c,new c,new c,new c,new c],so=new c,co=new f,lo=new c,uo=new c,ho=new c,po=new c,fo=new c,mo=new c,go=new c,vo=new c,yo=new c,xo=new c;Object.assign(f.prototype,{isBox3:1,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=e.length;s<c;s+=3){var l=e[s],u=e[s+1],h=e[s+2];l<t&&(t=l),u<n&&(n=u),h<r&&(r=h),l>i&&(i=l),u>a&&(a=u),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0,s=0,c=e.count;s<c;s++){var l=e.getX(s),u=e.getY(s),h=e.getZ(s);l<t&&(t=l),u<n&&(n=u),h<r&&(r=h),l>i&&(i=l),u>a&&(a=u),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,a,o),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=so.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new c),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new c),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(e){e.updateWorldMatrix(0,0);var t=e.geometry;void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),co.copy(t.boundingBox),co.applyMatrix4(e.matrixWorld),this.union(co));for(var n=e.children,r=0,i=n.length;r<i;r++)this.expandByObject(n[r]);return this},containsPoint:function(e){return e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z?0:1},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 c),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.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z?0:1},intersectsSphere:function(e){return this.clampPoint(e.center,so),so.distanceToSquared(e.center)<=e.radius*e.radius},intersectsPlane:function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant},intersectsTriangle:function(e){if(this.isEmpty())return 0;this.getCenter(go),vo.subVectors(this.max,go),lo.subVectors(e.a,go),uo.subVectors(e.b,go),ho.subVectors(e.c,go),po.subVectors(uo,lo),fo.subVectors(ho,uo),mo.subVectors(lo,ho);var t=[0,-po.z,po.y,0,-fo.z,fo.y,0,-mo.z,mo.y,po.z,0,-po.x,fo.z,0,-fo.x,mo.z,0,-mo.x,-po.y,po.x,0,-fo.y,fo.x,0,-mo.y,mo.x,0];return m(t,lo,uo,ho,vo)&&m(t=[1,0,0,0,1,0,0,0,1],lo,uo,ho,vo)?(yo.crossVectors(po,fo),m(t=[yo.x,yo.y,yo.z],lo,uo,ho,vo)):0},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new c),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return so.copy(e).clamp(this.min,this.max).sub(e).length()},getBoundingSphere:function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(so).length(),e},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(e){return this.isEmpty()||(oo[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),oo[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),oo[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),oo[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),oo[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),oo[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),oo[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),oo[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(oo)),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)}});var bo=new f;Object.assign(g.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(e,t){var n=this.center;void 0!==t?n.copy(t):bo.setFromPoints(e).getCenter(n);for(var r=0,i=0,a=e.length;i<a;i++)r=Math.max(r,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(r),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},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 n=this.center.distanceToSquared(e);return void 0===t&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new c),t.copy(e),n>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 f),e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=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}});var wo=new c,_o=new c,Mo=new c,So=new c,To=new c,Eo=new c,Ao=new c;Object.assign(v.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new c),t.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(e){return this.origin.copy(this.at(e,wo)),this},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new c),t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(e){var t=wo.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(wo.copy(this.direction).multiplyScalar(t).add(this.origin),wo.distanceToSquared(e))},distanceSqToSegment:function(e,t,n,r){_o.copy(e).add(t).multiplyScalar(.5),Mo.copy(t).sub(e).normalize(),So.copy(this.origin).sub(_o);var i,a,o,s,c=.5*e.distanceTo(t),l=-this.direction.dot(Mo),u=So.dot(this.direction),h=-So.dot(Mo),p=So.lengthSq(),d=Math.abs(1-l*l);if(d>0)if(a=l*u-h,s=c*d,(i=l*h-u)>=0)if(a>=-s)if(a<=s){var f=1/d;o=(i*=f)*(i+l*(a*=f)+2*u)+a*(l*i+a+2*h)+p}else o=-(i=Math.max(0,-(l*(a=c)+u)))*i+a*(a+2*h)+p;else o=-(i=Math.max(0,-(l*(a=-c)+u)))*i+a*(a+2*h)+p;else a<=-s?o=-(i=Math.max(0,-(-l*c+u)))*i+(a=i>0?-c:Math.min(Math.max(-c,-h),c))*(a+2*h)+p:a<=s?(i=0,o=(a=Math.min(Math.max(-c,-h),c))*(a+2*h)+p):o=-(i=Math.max(0,-(l*c+u)))*i+(a=i>0?c:Math.min(Math.max(-c,-h),c))*(a+2*h)+p;else o=-(i=Math.max(0,-(l*(a=l>0?-c:c)+u)))*i+a*(a+2*h)+p;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(Mo).multiplyScalar(a).add(_o),o},intersectSphere:function(e,t){wo.subVectors(e.center,this.origin);var n=wo.dot(this.direction),r=wo.dot(wo)-n*n,i=e.radius*e.radius;if(r>i)return null;var a=Math.sqrt(i-r),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)},intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0?1:0},intersectBox:function(e,t){var n,r,i,a,o,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,h=this.origin;return c>=0?(n=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(n=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),l>=0?(i=(e.min.y-h.y)*l,a=(e.max.y-h.y)*l):(i=(e.max.y-h.y)*l,a=(e.min.y-h.y)*l),n>a||i>r?null:((i>n||n!=n)&&(n=i),(a<r||r!=r)&&(r=a),u>=0?(o=(e.min.z-h.z)*u,s=(e.max.z-h.z)*u):(o=(e.max.z-h.z)*u,s=(e.min.z-h.z)*u),n>s||o>r?null:((o>n||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,t)))},intersectsBox:function(e){return null!==this.intersectBox(e,wo)},intersectTriangle:function(e,t,n,r,i){To.subVectors(t,e),Eo.subVectors(n,e),Ao.crossVectors(To,Eo);var a,o=this.direction.dot(Ao);if(o>0){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}So.subVectors(this.origin,e);var s=a*this.direction.dot(Eo.crossVectors(So,Eo));if(s<0)return null;var c=a*this.direction.dot(To.cross(So));if(c<0)return null;if(s+c>o)return null;var l=-a*So.dot(Ao);return l<0?null:this.at(l/o,i)},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)}});var Lo=new c,Co=new c,Ro=new n;Object.assign(y.prototype,{isPlane:1,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(e,t,n){var r=Lo.subVectors(n,t).cross(Co.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),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 c),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(e,t){void 0===t&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new c);var n=e.delta(Lo),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):void 0;var i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?void 0:t.copy(n).multiplyScalar(i).add(e.start)},intersectsLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new c),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,t){var n=t||Ro.getNormalMatrix(e),r=this.coplanarPoint(Lo).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this},translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}});var Po=new c,Oo=new c,No=new c,Do=new c,Io=new c,zo=new c,Bo=new c,Uo=new c,Fo=new c,Ho=new c;Object.assign(x,{getNormal:function(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new c),r.subVectors(n,t),Po.subVectors(e,t),r.cross(Po);var i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)},getBarycoord:function(e,t,n,r,i){Po.subVectors(r,t),Oo.subVectors(n,t),No.subVectors(e,t);var a=Po.dot(Po),o=Po.dot(Oo),s=Po.dot(No),l=Oo.dot(Oo),u=Oo.dot(No),h=a*l-o*o;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new c),0===h)return i.set(-2,-1,-1);var p=1/h,d=(l*s-o*u)*p,f=(a*u-o*s)*p;return i.set(1-d-f,f,d)},containsPoint:function(e,t,n,r){return x.getBarycoord(e,t,n,r,Do),Do.x>=0&&Do.y>=0&&Do.x+Do.y<=1},getUV:function(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Do),s.set(0,0),s.addScaledVector(i,Do.x),s.addScaledVector(a,Do.y),s.addScaledVector(o,Do.z),s},isFrontFacing:function(e,t,n,r){return Po.subVectors(n,t),Oo.subVectors(e,t),Po.cross(Oo).dot(r)<0?1:0}}),Object.assign(x.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),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(){return Po.subVectors(this.c,this.b),Oo.subVectors(this.a,this.b),.5*Po.cross(Oo).length()},getMidpoint:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new c),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 y),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,n,r,i){return x.getUV(e,this.a,this.b,this.c,t,n,r,i)},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(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new c);var n,r,i=this.a,a=this.b,o=this.c;Io.subVectors(a,i),zo.subVectors(o,i),Uo.subVectors(e,i);var s=Io.dot(Uo),l=zo.dot(Uo);if(s<=0&&l<=0)return t.copy(i);Fo.subVectors(e,a);var u=Io.dot(Fo),h=zo.dot(Fo);if(u>=0&&h<=u)return t.copy(a);var p=s*h-u*l;if(p<=0&&s>=0&&u<=0)return n=s/(s-u),t.copy(i).addScaledVector(Io,n);Ho.subVectors(e,o);var d=Io.dot(Ho),f=zo.dot(Ho);if(f>=0&&d<=f)return t.copy(o);var m=d*l-s*f;if(m<=0&&l>=0&&f<=0)return r=l/(l-f),t.copy(i).addScaledVector(zo,r);var g=u*f-d*h;if(g<=0&&h-u>=0&&d-f>=0)return Bo.subVectors(o,a),r=(h-u)/(h-u+(d-f)),t.copy(a).addScaledVector(Bo,r);var v=1/(g+m+p);return n=m*v,r=p*v,t.copy(i).addScaledVector(Io,n).addScaledVector(zo,r)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}});var ko={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},Go={h:0,s:0,l:0},jo={h:0,s:0,l:0};Object.assign(b.prototype,{isColor:1,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.r=e,this.g=e,this.b=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,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(e,t,n){if(e=Na.euclideanModulo(e,1),t=Na.clamp(t,0,1),n=Na.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=w(i,r,e+1/3),this.g=w(i,r,e),this.b=w(i,r,e-1/3)}return this},setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,i=n[1],a=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(o,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l=n[1],u=l.length;if(3===u)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this},setColorName:function(e){var t=ko[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},copySRGBToLinear:function(e){return this.r=_(e.r),this.g=_(e.g),this.b=_(e.b),this},copyLinearToSRGB:function(e){return this.r=M(e.r),this.g=M(e.g),this.b=M(e.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,n,r=this.r,i=this.g,a=this.b,o=Math.max(r,i,a),s=Math.min(r,i,a),c=(s+o)/2;if(s===o)t=0,n=0;else{var l=o-s;switch(n=c<=.5?l/(o+s):l/(2-o-s),o){case r:t=(i-a)/l+(i<a?6:0);break;case i:t=(a-r)/l+2;break;case a:t=(r-i)/l+4}t/=6}return e.h=t,e.s=n,e.l=c,e},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,n){return this.getHSL(Go),Go.h+=e,Go.s+=t,Go.l+=n,this.setHSL(Go.h,Go.s,Go.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},lerpHSL:function(e,t){this.getHSL(Go),e.getHSL(jo);var n=Na.lerp(Go.h,jo.h,t),r=Na.lerp(Go.s,jo.s,t),i=Na.lerp(Go.l,jo.l,t);return this.setHSL(n,r,i),this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}}),b.NAMES=ko,Object.assign(S.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var Vo=0;T.prototype=Object.assign(Object.create(e.prototype),{constructor:T,isMaterial:1,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n?1:0;else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){function t(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}var n=void 0===e||"string"==typeof e;n&&(e={textures:{},images:{}});var r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(r.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearcoat&&(r.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(e).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,r.reflectivity=this.reflectivity,r.refractionRatio=this.refractionRatio,void 0!==this.combine&&(r.combine=this.combine),void 0!==this.envMapIntensity&&(r.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(r.size=this.size),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(r.blending=this.blending),1==this.flatShading&&(r.flatShading=this.flatShading),0!==this.side&&(r.side=this.side),this.vertexColors&&(r.vertexColors=1),this.opacity<1&&(r.opacity=this.opacity),1==this.transparent&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(r.rotation=this.rotation),1==this.polygonOffset&&(r.polygonOffset=1),0!==this.polygonOffsetFactor&&(r.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(r.linewidth=this.linewidth),void 0!==this.dashSize&&(r.dashSize=this.dashSize),void 0!==this.gapSize&&(r.gapSize=this.gapSize),void 0!==this.scale&&(r.scale=this.scale),1==this.dithering&&(r.dithering=1),this.alphaTest>0&&(r.alphaTest=this.alphaTest),1==this.premultipliedAlpha&&(r.premultipliedAlpha=this.premultipliedAlpha),1==this.wireframe&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),1==this.morphTargets&&(r.morphTargets=1),1==this.morphNormals&&(r.morphNormals=1),1==this.skinning&&(r.skinning=1),0==this.visible&&(r.visible=0),0==this.toneMapped&&(r.toneMapped=0),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),n){var i=t(e.textures),a=t(e.images);i.length>0&&(r.textures=i),a.length>0&&(r.images=a)}return r},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(T.prototype,"needsUpdate",{set:function(e){1==e&&this.version++}}),E.prototype=Object.create(T.prototype),E.prototype.constructor=E,E.prototype.isMeshBasicMaterial=1,E.prototype.copy=function(e){return T.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};var Wo=new c;Object.defineProperty(A.prototype,"needsUpdate",{set:function(e){1==e&&this.version++}}),Object.assign(A.prototype,{isBufferAttribute:1,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),a=new b),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this},copyVector2sArray:function(e){for(var n=this.array,r=0,i=0,a=e.length;i<a;i++){var o=e[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),o=new t),n[r++]=o.x,n[r++]=o.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,r=0,i=e.length;r<i;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),a=new c),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,r=0,a=e.length;r<a;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),o=new i),t[n++]=o.x,t[n++]=o.y,t[n++]=o.z,t[n++]=o.w}return this},applyMatrix3:function(e){for(var t=0,n=this.count;t<n;t++)Wo.x=this.getX(t),Wo.y=this.getY(t),Wo.z=this.getZ(t),Wo.applyMatrix3(e),this.setXYZ(t,Wo.x,Wo.y,Wo.z);return this},applyMatrix4:function(e){for(var t=0,n=this.count;t<n;t++)Wo.x=this.getX(t),Wo.y=this.getY(t),Wo.z=this.getZ(t),Wo.applyMatrix4(e),this.setXYZ(t,Wo.x,Wo.y,Wo.z);return this},applyNormalMatrix:function(e){for(var t=0,n=this.count;t<n;t++)Wo.x=this.getX(t),Wo.y=this.getY(t),Wo.z=this.getZ(t),Wo.applyNormalMatrix(e),this.setXYZ(t,Wo.x,Wo.y,Wo.z);return this},transformDirection:function(e){for(var t=0,n=this.count;t<n;t++)Wo.x=this.getX(t),Wo.y=this.getY(t),Wo.z=this.getZ(t),Wo.transformDirection(e),this.setXYZ(t,Wo.x,Wo.y,Wo.z);return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),L.prototype=Object.create(A.prototype),L.prototype.constructor=L,C.prototype=Object.create(A.prototype),C.prototype.constructor=C,R.prototype=Object.create(A.prototype),R.prototype.constructor=R,P.prototype=Object.create(A.prototype),P.prototype.constructor=P,O.prototype=Object.create(A.prototype),O.prototype.constructor=O,N.prototype=Object.create(A.prototype),N.prototype.constructor=N,D.prototype=Object.create(A.prototype),D.prototype.constructor=D,I.prototype=Object.create(A.prototype),I.prototype.constructor=I,z.prototype=Object.create(A.prototype),z.prototype.constructor=z,Object.assign(B.prototype,{computeGroups:function(e){for(var t,n=[],r=void 0,i=e.faces,a=0;a<i.length;a++){var o=i[a];o.materialIndex!==r&&(r=o.materialIndex,void 0!==t&&(t.count=3*a-t.start,n.push(t)),t={start:3*a,materialIndex:r})}void 0!==t&&(t.count=3*a-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var n,r=e.faces,i=e.vertices,a=e.faceVertexUvs,o=a[0]&&a[0].length>0,s=a[1]&&a[1].length>0,c=e.morphTargets,l=c.length;if(l>0){n=[];for(var u=0;u<l;u++)n[u]={name:c[u].name,data:[]};this.morphTargets.position=n}var h,p=e.morphNormals,d=p.length;if(d>0){for(h=[],u=0;u<d;u++)h[u]={name:p[u].name,data:[]};this.morphTargets.normal=h}var f=e.skinIndices,m=e.skinWeights,g=f.length===i.length,v=m.length===i.length;for(i.length>0&&0===r.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported."),u=0;u<r.length;u++){var y=r[u];this.vertices.push(i[y.a],i[y.b],i[y.c]);var x=y.vertexNormals;if(3===x.length)this.normals.push(x[0],x[1],x[2]);else{var b=y.normal;this.normals.push(b,b,b)}var w,_=y.vertexColors;if(3===_.length)this.colors.push(_[0],_[1],_[2]);else{var M=y.color;this.colors.push(M,M,M)}1==o&&(void 0!==(w=a[0][u])?this.uvs.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",u),this.uvs.push(new t,new t,new t))),1==s&&(void 0!==(w=a[1][u])?this.uvs2.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",u),this.uvs2.push(new t,new t,new t)));for(var S=0;S<l;S++){var T=c[S].vertices;n[S].data.push(T[y.a],T[y.b],T[y.c])}for(S=0;S<d;S++){var E=p[S].vertexNormals[u];h[S].data.push(E.a,E.b,E.c)}g&&this.skinIndices.push(f[y.a],f[y.b],f[y.c]),v&&this.skinWeights.push(m[y.a],m[y.b],m[y.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this}});var qo=1,Xo=new l,Yo=new p,Zo=new c,Jo=new f,$o=new f,Qo=new c;F.prototype=Object.assign(Object.create(e.prototype),{constructor:F,isBufferGeometry:1,getIndex:function(){return this.index},setIndex:function(e){this.index=Array.isArray(e)?new(U(e)>65535?D:O)(e,1):e},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=1);var r=this.attributes.normal;if(void 0!==r){var i=(new n).getNormalMatrix(e);r.applyNormalMatrix(i),r.needsUpdate=1}var a=this.attributes.tangent;return void 0!==a&&(a.transformDirection(e),a.needsUpdate=1),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return Xo.makeRotationX(e),this.applyMatrix4(Xo),this},rotateY:function(e){return Xo.makeRotationY(e),this.applyMatrix4(Xo),this},rotateZ:function(e){return Xo.makeRotationZ(e),this.applyMatrix4(Xo),this},translate:function(e,t,n){return Xo.makeTranslation(e,t,n),this.applyMatrix4(Xo),this},scale:function(e,t,n){return Xo.makeScale(e,t,n),this.applyMatrix4(Xo),this},lookAt:function(e){return Yo.lookAt(e),Yo.updateMatrix(),this.applyMatrix4(Yo.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Zo).negate(),this.translate(Zo.x,Zo.y,Zo.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new I(3*t.vertices.length,3),r=new I(3*t.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(t.vertices)),this.setAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var i=new I(t.lineDistances.length,1);this.setAttribute("lineDistance",i.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];t.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new I(t,3)),this},updateFromObject:function(e){var t,n=e.geometry;if(e.isMesh){var r=n.__directGeometry;if(1==n.elementsNeedUpdate&&(r=void 0,n.elementsNeedUpdate=0),void 0===r)return this.fromGeometry(n);r.verticesNeedUpdate=n.verticesNeedUpdate,r.normalsNeedUpdate=n.normalsNeedUpdate,r.colorsNeedUpdate=n.colorsNeedUpdate,r.uvsNeedUpdate=n.uvsNeedUpdate,r.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=0,n.normalsNeedUpdate=0,n.colorsNeedUpdate=0,n.uvsNeedUpdate=0,n.groupsNeedUpdate=0,n=r}return 1==n.verticesNeedUpdate&&(void 0!==(t=this.attributes.position)&&(t.copyVector3sArray(n.vertices),t.needsUpdate=1),n.verticesNeedUpdate=0),1==n.normalsNeedUpdate&&(void 0!==(t=this.attributes.normal)&&(t.copyVector3sArray(n.normals),t.needsUpdate=1),n.normalsNeedUpdate=0),1==n.colorsNeedUpdate&&(void 0!==(t=this.attributes.color)&&(t.copyColorsArray(n.colors),t.needsUpdate=1),n.colorsNeedUpdate=0),n.uvsNeedUpdate&&(void 0!==(t=this.attributes.uv)&&(t.copyVector2sArray(n.uvs),t.needsUpdate=1),n.uvsNeedUpdate=0),n.lineDistancesNeedUpdate&&(void 0!==(t=this.attributes.lineDistance)&&(t.copyArray(n.lineDistances),t.needsUpdate=1),n.lineDistancesNeedUpdate=0),n.groupsNeedUpdate&&(n.computeGroups(e.geometry),this.groups=n.groups,n.groupsNeedUpdate=0),this},fromGeometry:function(e){return e.__directGeometry=(new B).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.setAttribute("position",new A(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(3*e.normals.length);this.setAttribute("normal",new A(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var r=new Float32Array(3*e.colors.length);this.setAttribute("color",new A(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var i=new Float32Array(2*e.uvs.length);this.setAttribute("uv",new A(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(2*e.uvs2.length);this.setAttribute("uv2",new A(a,2).copyVector2sArray(e.uvs2))}for(var o in this.groups=e.groups,e.morphTargets){for(var s=[],c=e.morphTargets[o],l=0,u=c.length;l<u;l++){var h=c[l],p=new I(3*h.data.length,3);p.name=h.name,s.push(p.copyVector3sArray(h.data))}this.morphAttributes[o]=s}if(e.skinIndices.length>0){var d=new I(4*e.skinIndices.length,4);this.setAttribute("skinIndex",d.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var f=new I(4*e.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new f);var e=this.attributes.position,t=this.morphAttributes.position;if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,r=t.length;n<r;n++){var i=t[n];Jo.setFromBufferAttribute(i),this.morphTargetsRelative?(Qo.addVectors(this.boundingBox.min,Jo.min),this.boundingBox.expandByPoint(Qo),Qo.addVectors(this.boundingBox.max,Jo.max),this.boundingBox.expandByPoint(Qo)):(this.boundingBox.expandByPoint(Jo.min),this.boundingBox.expandByPoint(Jo.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new g);var e=this.attributes.position,t=this.morphAttributes.position;if(e){var n=this.boundingSphere.center;if(Jo.setFromBufferAttribute(e),t)for(var r=0,i=t.length;r<i;r++){var a=t[r];$o.setFromBufferAttribute(a),this.morphTargetsRelative?(Qo.addVectors(Jo.min,$o.min),Jo.expandByPoint(Qo),Qo.addVectors(Jo.max,$o.max),Jo.expandByPoint(Qo)):(Jo.expandByPoint($o.min),Jo.expandByPoint($o.max))}Jo.getCenter(n);var o=0;for(r=0,i=e.count;r<i;r++)Qo.fromBufferAttribute(e,r),o=Math.max(o,n.distanceToSquared(Qo));if(t)for(r=0,i=t.length;r<i;r++){a=t[r];for(var s=this.morphTargetsRelative,c=0,l=a.count;c<l;c++)Qo.fromBufferAttribute(a,c),s&&(Zo.fromBufferAttribute(e,c),Qo.add(Zo)),o=Math.max(o,n.distanceToSquared(Qo))}this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes;if(t.position){var n=t.position.array;if(void 0===t.normal)this.setAttribute("normal",new A(new Float32Array(n.length),3));else for(var r=t.normal.array,i=0,a=r.length;i<a;i++)r[i]=0;var o,s,l,u=t.normal.array,h=new c,p=new c,d=new c,f=new c,m=new c;if(e){var g=e.array;for(i=0,a=e.count;i<a;i+=3)o=3*g[i+0],s=3*g[i+1],l=3*g[i+2],h.fromArray(n,o),p.fromArray(n,s),d.fromArray(n,l),f.subVectors(d,p),m.subVectors(h,p),f.cross(m),u[o]+=f.x,u[o+1]+=f.y,u[o+2]+=f.z,u[s]+=f.x,u[s+1]+=f.y,u[s+2]+=f.z,u[l]+=f.x,u[l+1]+=f.y,u[l+2]+=f.z}else for(i=0,a=n.length;i<a;i+=9)h.fromArray(n,i),p.fromArray(n,i+3),d.fromArray(n,i+6),f.subVectors(d,p),m.subVectors(h,p),f.cross(m),u[i]=f.x,u[i+1]=f.y,u[i+2]=f.z,u[i+3]=f.x,u[i+4]=f.y,u[i+5]=f.z,u[i+6]=f.x,u[i+7]=f.y,u[i+8]=f.z;this.normalizeNormals(),t.normal.needsUpdate=1}},merge:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var r in n)if(void 0!==e.attributes[r])for(var i=n[r].array,a=e.attributes[r],o=a.array,s=a.itemSize*t,c=Math.min(o.length,i.length-s),l=0,u=s;l<c;l++,u++)i[u]=o[l];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)Qo.x=e.getX(t),Qo.y=e.getY(t),Qo.z=e.getZ(t),Qo.normalize(),e.setXYZ(t,Qo.x,Qo.y,Qo.z)},toNonIndexed:function(){function e(e,t){for(var n=e.array,r=e.itemSize,i=new n.constructor(t.length*r),a=0,o=0,s=0,c=t.length;s<c;s++){a=t[s]*r;for(var l=0;l<r;l++)i[o++]=n[a++]}return new A(i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new F,n=this.index.array,r=this.attributes;for(var i in r){var a=e(r[i],n);t.setAttribute(i,a)}var o=this.morphAttributes;for(i in o){for(var s=[],c=o[i],l=0,u=c.length;l<u;l++)a=e(c[l],n),s.push(a);t.morphAttributes[i]=s}t.morphTargetsRelative=this.morphTargetsRelative;for(var h=this.groups,p=(l=0,h.length);l<p;l++){var d=h[l];t.addGroup(d.start,d.count,d.materialIndex)}return t},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;null!==r&&(e.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var n in i){var a=(p=i[n]).toJSON();""!==p.name&&(a.name=p.name),e.data.attributes[n]=a}var o={},s=0;for(var n in this.morphAttributes){for(var c=this.morphAttributes[n],l=[],u=0,h=c.length;u<h;u++){var p;a=(p=c[u]).toJSON(),""!==p.name&&(a.name=p.name),l.push(a)}l.length>0&&(o[n]=l,s=1)}s&&(e.data.morphAttributes=o,e.data.morphTargetsRelative=this.morphTargetsRelative);var d=this.groups;d.length>0&&(e.data.groups=JSON.parse(JSON.stringify(d)));var f=this.boundingSphere;return null!==f&&(e.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),e},clone:function(){return(new F).copy(this)},copy:function(e){var t,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var i=e.index;null!==i&&this.setIndex(i.clone());var a=e.attributes;for(t in a){var o=a[t];this.setAttribute(t,o.clone())}var s=e.morphAttributes;for(t in s){var c=[],l=s[t];for(n=0,r=l.length;n<r;n++)c.push(l[n].clone());this.morphAttributes[t]=c}this.morphTargetsRelative=e.morphTargetsRelative;var u=e.groups;for(n=0,r=u.length;n<r;n++){var h=u[n];this.addGroup(h.start,h.count,h.materialIndex)}var p=e.boundingBox;null!==p&&(this.boundingBox=p.clone());var d=e.boundingSphere;return null!==d&&(this.boundingSphere=d.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Ko=new l,es=new v,ts=new g,ns=new c,rs=new c,is=new c,as=new c,os=new c,ss=new c,cs=new c,ls=new c,us=new c,hs=new t,ps=new t,ds=new t,fs=new c,ms=new c;H.prototype=Object.assign(Object.create(p.prototype),{constructor:H,isMesh:1,copy:function(e){return p.prototype.copy.call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,a=Object.keys(i);if(a.length>0){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||e+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=r.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,n){var r,i=this.geometry,a=this.material,o=this.matrixWorld;if(void 0!==a&&(null===i.boundingSphere&&i.computeBoundingSphere(),ts.copy(i.boundingSphere),ts.applyMatrix4(o),0!=e.ray.intersectsSphere(ts)&&(Ko.getInverse(o),es.copy(e.ray).applyMatrix4(Ko),null===i.boundingBox||0!=es.intersectsBox(i.boundingBox))))if(i.isBufferGeometry){var s,c,l,u,h,p,d,f,m,g=i.index,v=i.attributes.position,y=i.morphAttributes.position,b=i.morphTargetsRelative,w=i.attributes.uv,_=i.attributes.uv2,M=i.groups,S=i.drawRange;if(null!==g)if(Array.isArray(a))for(u=0,p=M.length;u<p;u++)for(m=a[(f=M[u]).materialIndex],h=Math.max(f.start,S.start),d=Math.min(f.start+f.count,S.start+S.count);h<d;h+=3)s=g.getX(h),c=g.getX(h+1),l=g.getX(h+2),(r=G(this,m,e,es,v,y,b,w,_,s,c,l))&&(r.faceIndex=Math.floor(h/3),r.face.materialIndex=f.materialIndex,n.push(r));else for(u=Math.max(0,S.start),p=Math.min(g.count,S.start+S.count);u<p;u+=3)s=g.getX(u),c=g.getX(u+1),l=g.getX(u+2),(r=G(this,a,e,es,v,y,b,w,_,s,c,l))&&(r.faceIndex=Math.floor(u/3),n.push(r));else if(void 0!==v)if(Array.isArray(a))for(u=0,p=M.length;u<p;u++)for(m=a[(f=M[u]).materialIndex],h=Math.max(f.start,S.start),d=Math.min(f.start+f.count,S.start+S.count);h<d;h+=3)(r=G(this,m,e,es,v,y,b,w,_,s=h,c=h+1,l=h+2))&&(r.faceIndex=Math.floor(h/3),r.face.materialIndex=f.materialIndex,n.push(r));else for(u=Math.max(0,S.start),p=Math.min(v.count,S.start+S.count);u<p;u+=3)(r=G(this,a,e,es,v,y,b,w,_,s=u,c=u+1,l=u+2))&&(r.faceIndex=Math.floor(u/3),n.push(r))}else if(i.isGeometry){var T,E,A,L,C=Array.isArray(a),R=i.vertices,P=i.faces,O=i.faceVertexUvs[0];O.length>0&&(L=O);for(var N=0,D=P.length;N<D;N++){var I=P[N],z=C?a[I.materialIndex]:a;if(void 0!==z&&(T=R[I.a],E=R[I.b],A=R[I.c],r=k(this,z,e,es,T,E,A,fs))){if(L&&L[N]){var B=L[N];hs.copy(B[0]),ps.copy(B[1]),ds.copy(B[2]),r.uv=x.getUV(fs,T,E,A,hs,ps,ds,new t)}r.face=I,r.faceIndex=N,n.push(r)}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var gs=0,vs=new l,ys=new p,xs=new c;j.prototype=Object.assign(Object.create(e.prototype),{constructor:j,isGeometry:1,applyMatrix4:function(e){for(var t=(new n).getNormalMatrix(e),r=0,i=this.vertices.length;r<i;r++)this.vertices[r].applyMatrix4(e);for(r=0,i=this.faces.length;r<i;r++){var a=this.faces[r];a.normal.applyMatrix3(t).normalize();for(var o=0,s=a.vertexNormals.length;o<s;o++)a.vertexNormals[o].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=1,this.normalsNeedUpdate=1,this},rotateX:function(e){return vs.makeRotationX(e),this.applyMatrix4(vs),this},rotateY:function(e){return vs.makeRotationY(e),this.applyMatrix4(vs),this},rotateZ:function(e){return vs.makeRotationZ(e),this.applyMatrix4(vs),this},translate:function(e,t,n){return vs.makeTranslation(e,t,n),this.applyMatrix4(vs),this},scale:function(e,t,n){return vs.makeScale(e,t,n),this.applyMatrix4(vs),this},lookAt:function(e){return ys.lookAt(e),ys.updateMatrix(),this.applyMatrix4(ys.matrix),this},fromBufferGeometry:function(e){function n(e,n,i,a){var o=void 0===l?[]:[r.colors[e].clone(),r.colors[n].clone(),r.colors[i].clone()],p=new S(e,n,i,void 0===s?[]:[(new c).fromArray(s,3*e),(new c).fromArray(s,3*n),(new c).fromArray(s,3*i)],o,a);r.faces.push(p),void 0!==u&&r.faceVertexUvs[0].push([(new t).fromArray(u,2*e),(new t).fromArray(u,2*n),(new t).fromArray(u,2*i)]),void 0!==h&&r.faceVertexUvs[1].push([(new t).fromArray(h,2*e),(new t).fromArray(h,2*n),(new t).fromArray(h,2*i)])}var r=this,i=null!==e.index?e.index.array:void 0,a=e.attributes;if(void 0===a.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var o=a.position.array,s=void 0!==a.normal?a.normal.array:void 0,l=void 0!==a.color?a.color.array:void 0,u=void 0!==a.uv?a.uv.array:void 0,h=void 0!==a.uv2?a.uv2.array:void 0;void 0!==h&&(this.faceVertexUvs[1]=[]);for(var p=0;p<o.length;p+=3)r.vertices.push((new c).fromArray(o,p)),void 0!==l&&r.colors.push((new b).fromArray(l,p));var d=e.groups;if(d.length>0)for(p=0;p<d.length;p++)for(var f=d[p],m=f.start,g=m,v=m+f.count;g<v;g+=3)void 0!==i?n(i[g],i[g+1],i[g+2],f.materialIndex):n(g,g+1,g+2,f.materialIndex);else if(void 0!==i)for(p=0;p<i.length;p+=3)n(i[p],i[p+1],i[p+2]);else for(p=0;p<o.length/3;p+=3)n(p,p+1,p+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(xs).negate(),this.translate(xs.x,xs.y,xs.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,r=new l;return r.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix4(r),this},computeFaceNormals:function(){for(var e=new c,t=new c,n=0,r=this.faces.length;n<r;n++){var i=this.faces[n],a=this.vertices[i.a],o=this.vertices[i.b],s=this.vertices[i.c];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),i.normal.copy(e)}},computeVertexNormals:function(e){var t,n,r,i,a,o;for(void 0===e&&(e=1),o=Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)o[t]=new c;if(e){var s,l,u,h=new c,p=new c;for(r=0,i=this.faces.length;r<i;r++)a=this.faces[r],s=this.vertices[a.a],l=this.vertices[a.b],u=this.vertices[a.c],h.subVectors(u,l),p.subVectors(s,l),h.cross(p),o[a.a].add(h),o[a.b].add(h),o[a.c].add(h)}else for(this.computeFaceNormals(),r=0,i=this.faces.length;r<i;r++)o[(a=this.faces[r]).a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(t=0,n=this.vertices.length;t<n;t++)o[t].normalize();for(r=0,i=this.faces.length;r<i;r++){var d=(a=this.faces[r]).vertexNormals;3===d.length?(d[0].copy(o[a.a]),d[1].copy(o[a.b]),d[2].copy(o[a.c])):(d[0]=o[a.a].clone(),d[1]=o[a.b].clone(),d[2]=o[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=1)},computeFlatVertexNormals:function(){var e,t,n;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){var r=(n=this.faces[e]).vertexNormals;3===r.length?(r[0].copy(n.normal),r[1].copy(n.normal),r[2].copy(n.normal)):(r[0]=n.normal.clone(),r[1]=n.normal.clone(),r[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=1)},computeMorphNormals:function(){var e,t,n,r,i;for(n=0,r=this.faces.length;n<r;n++)for((i=this.faces[n]).__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),e=0,t=i.vertexNormals.length;e<t;e++)i.__originalVertexNormals[e]?i.__originalVertexNormals[e].copy(i.vertexNormals[e]):i.__originalVertexNormals[e]=i.vertexNormals[e].clone();var a=new j;for(a.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var o=this.morphNormals[e].faceNormals,s=this.morphNormals[e].vertexNormals;for(n=0,r=this.faces.length;n<r;n++)l=new c,u={a:new c,b:new c,c:new c},o.push(l),s.push(u)}var l,u,h=this.morphNormals[e];for(a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals(),n=0,r=this.faces.length;n<r;n++)i=this.faces[n],l=h.faceNormals[n],u=h.vertexNormals[n],l.copy(i.normal),u.a.copy(i.vertexNormals[0]),u.b.copy(i.vertexNormals[1]),u.c.copy(i.vertexNormals[2])}for(n=0,r=this.faces.length;n<r;n++)(i=this.faces[n]).normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new f),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new g),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,r){if(e&&e.isGeometry){var i,a=this.vertices.length,o=this.vertices,s=e.vertices,c=this.faces,l=e.faces,u=this.colors,h=e.colors;void 0===r&&(r=0),void 0!==t&&(i=(new n).getNormalMatrix(t));for(var p=0,d=s.length;p<d;p++){var f=s[p].clone();void 0!==t&&f.applyMatrix4(t),o.push(f)}for(p=0,d=h.length;p<d;p++)u.push(h[p].clone());for(p=0,d=l.length;p<d;p++){var m,g,v,y=l[p],x=y.vertexNormals,b=y.vertexColors;(m=new S(y.a+a,y.b+a,y.c+a)).normal.copy(y.normal),void 0!==i&&m.normal.applyMatrix3(i).normalize();for(var w=0,_=x.length;w<_;w++)g=x[w].clone(),void 0!==i&&g.applyMatrix3(i).normalize(),m.vertexNormals.push(g);for(m.color.copy(y.color),w=0,_=b.length;w<_;w++)v=b[w],m.vertexColors.push(v.clone());m.materialIndex=y.materialIndex+r,c.push(m)}for(p=0,d=e.faceVertexUvs.length;p<d;p++){var M=e.faceVertexUvs[p];for(void 0===this.faceVertexUvs[p]&&(this.faceVertexUvs[p]=[]),w=0,_=M.length;w<_;w++){for(var T=M[w],E=[],A=0,L=T.length;A<L;A++)E.push(T[A].clone());this.faceVertexUvs[p].push(E)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){var e,t,n,r,i,a,o,s,c={},l=[],u=[];for(n=0,r=this.vertices.length;n<r;n++)e=this.vertices[n],void 0===c[t=Math.round(1e4*e.x)+"_"+Math.round(1e4*e.y)+"_"+Math.round(1e4*e.z)]?(c[t]=n,l.push(this.vertices[n]),u[n]=l.length-1):u[n]=u[c[t]];var h=[];for(n=0,r=this.faces.length;n<r;n++){(i=this.faces[n]).a=u[i.a],i.b=u[i.b],i.c=u[i.c],a=[i.a,i.b,i.c];for(var p=0;p<3;p++)if(a[p]===a[(p+1)%3]){h.push(n);break}}for(n=h.length-1;n>=0;n--){var d=h[n];for(this.faces.splice(d,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(d,1)}var f=this.vertices.length-l.length;return this.vertices=l,f},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var r=e[t];this.vertices.push(new c(r.x,r.y,r.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;e.sort((function(e,t){return e.materialIndex-t.materialIndex}));var r,i,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];for(a&&a.length===t&&(r=[]),o&&o.length===t&&(i=[]),n=0;n<t;n++){var s=e[n]._id;r&&r.push(a[s]),i&&i.push(o[s])}r&&(this.faceVertexUvs[0]=r),i&&(this.faceVertexUvs[1]=i)},toJSON:function(){function e(e,t,n){return n?e|1<<t:e&~(1<<t)}function t(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==p[t]||(p[t]=h.length/3,h.push(e.x,e.y,e.z)),p[t]}function n(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==f[t]||(f[t]=d.length,d.push(e.getHex())),f[t]}function r(e){var t=e.x.toString()+e.y.toString();return void 0!==g[t]||(g[t]=m.length/2,m.push(e.x,e.y)),g[t]}var i={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),void 0!==this.parameters){var a=this.parameters;for(var o in a)void 0!==a[o]&&(i[o]=a[o]);return i}for(var s=[],c=0;c<this.vertices.length;c++){var l=this.vertices[c];s.push(l.x,l.y,l.z)}var u=[],h=[],p={},d=[],f={},m=[],g={};for(c=0;c<this.faces.length;c++){var v=this.faces[c],y=void 0!==this.faceVertexUvs[0][c],x=v.normal.length()>0,b=v.vertexNormals.length>0,w=1!==v.color.r||1!==v.color.g||1!==v.color.b,_=v.vertexColors.length>0,M=0;if(M=e(M,0,0),M=e(M,1,1),M=e(M,2,0),M=e(M,3,y),M=e(M,4,x),M=e(M,5,b),M=e(M,6,w),M=e(M,7,_),u.push(M),u.push(v.a,v.b,v.c),u.push(v.materialIndex),y){var S=this.faceVertexUvs[0][c];u.push(r(S[0]),r(S[1]),r(S[2]))}if(x&&u.push(t(v.normal)),b){var T=v.vertexNormals;u.push(t(T[0]),t(T[1]),t(T[2]))}if(w&&u.push(n(v.color)),_){var E=v.vertexColors;u.push(n(E[0]),n(E[1]),n(E[2]))}}return i.data={},i.data.vertices=s,i.data.normals=h,d.length>0&&(i.data.colors=d),m.length>0&&(i.data.uvs=[m]),i.data.faces=u,i},clone:function(){return(new j).copy(this)},copy:function(e){var t,n,r,i,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var s=e.vertices;for(t=0,n=s.length;t<n;t++)this.vertices.push(s[t].clone());var c=e.colors;for(t=0,n=c.length;t<n;t++)this.colors.push(c[t].clone());var l=e.faces;for(t=0,n=l.length;t<n;t++)this.faces.push(l[t].clone());for(t=0,n=e.faceVertexUvs.length;t<n;t++){var u=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),r=0,i=u.length;r<i;r++){var h=u[r],p=[];for(a=0,o=h.length;a<o;a++){var d=h[a];p.push(d.clone())}this.faceVertexUvs[t].push(p)}}var f=e.morphTargets;for(t=0,n=f.length;t<n;t++){var m={};if(m.name=f[t].name,void 0!==f[t].vertices)for(m.vertices=[],r=0,i=f[t].vertices.length;r<i;r++)m.vertices.push(f[t].vertices[r].clone());if(void 0!==f[t].normals)for(m.normals=[],r=0,i=f[t].normals.length;r<i;r++)m.normals.push(f[t].normals[r].clone());this.morphTargets.push(m)}var g=e.morphNormals;for(t=0,n=g.length;t<n;t++){var v={};if(void 0!==g[t].vertexNormals)for(v.vertexNormals=[],r=0,i=g[t].vertexNormals.length;r<i;r++){var y=g[t].vertexNormals[r],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),v.vertexNormals.push(x)}if(void 0!==g[t].faceNormals)for(v.faceNormals=[],r=0,i=g[t].faceNormals.length;r<i;r++)v.faceNormals.push(g[t].faceNormals[r].clone());this.morphNormals.push(v)}var b=e.skinWeights;for(t=0,n=b.length;t<n;t++)this.skinWeights.push(b[t].clone());var w=e.skinIndices;for(t=0,n=w.length;t<n;t++)this.skinIndices.push(w[t].clone());var _=e.lineDistances;for(t=0,n=_.length;t<n;t++)this.lineDistances.push(_[t]);var M=e.boundingBox;null!==M&&(this.boundingBox=M.clone());var S=e.boundingSphere;return null!==S&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});class bs extends F{constructor(e,t,n,r,i,a){function o(e,t,n,r,i,a,o,m,g,v,y){var x,b,w=a/g,_=o/v,M=a/2,S=o/2,T=m/2,E=g+1,A=v+1,L=0,C=0,R=new c;for(b=0;b<A;b++){var P=b*_-S;for(x=0;x<E;x++){var O=x*w-M;R[e]=O*r,R[t]=P*i,R[n]=T,u.push(R.x,R.y,R.z),R[e]=0,R[t]=0,R[n]=m>0?1:-1,h.push(R.x,R.y,R.z),p.push(x/g),p.push(1-b/v),L+=1}}for(b=0;b<v;b++)for(x=0;x<g;x++){var N=d+x+E*b,D=d+x+E*(b+1),I=d+(x+1)+E*(b+1),z=d+(x+1)+E*b;l.push(N,D,z),l.push(D,I,z),C+=6}s.addGroup(f,C,y),f+=C,d+=L}super(),this.type="BoxBufferGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};var s=this;e=e||1,t=t||1,n=n||1,r=Math.floor(r)||1,i=Math.floor(i)||1;var l=[],u=[],h=[],p=[],d=0,f=0;o("z","y","x",-1,-1,n,t,e,a=Math.floor(a)||1,i,0),o("z","y","x",1,-1,n,t,-e,a,i,1),o("x","z","y",1,1,e,n,t,r,a,2),o("x","z","y",1,-1,e,n,-t,r,a,3),o("x","y","z",1,-1,e,t,n,r,i,4),o("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(l),this.setAttribute("position",new I(u,3)),this.setAttribute("normal",new I(h,3)),this.setAttribute("uv",new I(p,2))}}var ws={clone:V,merge:W};q.prototype=Object.create(T.prototype),q.prototype.constructor=q,q.prototype.isShaderMaterial=1,q.prototype.copy=function(e){return T.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=V(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},q.prototype.toJSON=function(e){var t=T.prototype.toJSON.call(this,e);for(var n in t.uniforms={},this.uniforms){var r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:"m4",value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var i={};for(var a in this.extensions)1==this.extensions[a]&&(i[a]=1);return Object.keys(i).length>0&&(t.extensions=i),t},X.prototype=Object.assign(Object.create(p.prototype),{constructor:X,isCamera:1,copy:function(e,t){return p.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new c),this.updateMatrixWorld(1);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){p.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(e,t){p.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Y.prototype=Object.assign(Object.create(X.prototype),{constructor:Y,isPerspectiveCamera:1,copy:function(e,t){return X.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*Na.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*Na.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*Na.RAD2DEG*Math.atan(Math.tan(.5*Na.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(this.view={enabled:1,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=1,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=0),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*Na.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;i+=a.offsetX*r/o,t-=a.offsetY*n/s,r*=a.width/o,n*=a.height/s}var c=this.filmOffset;0!==c&&(i+=e*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=p.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}),Z.prototype=Object.create(p.prototype),Z.prototype.constructor=Z,J.prototype=Object.create(a.prototype),J.prototype.constructor=J,J.prototype.isWebGLCubeRenderTarget=1,J.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var n=new d,r="varying vec3 vWorldDirection;\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",i="uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\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\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}",a=new q({type:"CubemapFromEquirect",uniforms:V({tEquirect:{value:null}}),vertexShader:r,fragmentShader:i,side:1,blending:0});a.uniforms.tEquirect.value=t;var o=new H(new bs(5,5,5),a);n.add(o);var s=new Z(1,10,1);return s.renderTarget=this,s.renderTarget.texture.name="CubeCameraTexture",s.update(e,n),o.geometry.dispose(),o.material.dispose(),this},$.prototype=Object.create(r.prototype),$.prototype.constructor=$,$.prototype.isDataTexture=1;var _s=new g,Ms=new c;Object.assign(Q.prototype,{set:function(e,t,n,r,i,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this},setFromProjectionMatrix:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7],h=n[8],p=n[9],d=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return t[0].setComponents(o-r,u-s,f-h,y-m).normalize(),t[1].setComponents(o+r,u+s,f+h,y+m).normalize(),t[2].setComponents(o+i,u+c,f+p,y+g).normalize(),t[3].setComponents(o-i,u-c,f-p,y-g).normalize(),t[4].setComponents(o-a,u-l,f-d,y-v).normalize(),t[5].setComponents(o+a,u+l,f+d,y+v).normalize(),this},intersectsObject:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),_s.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(_s)},intersectsSprite:function(e){return _s.center.set(0,0,0),_s.radius=.7071067811865476,_s.applyMatrix4(e.matrixWorld),this.intersectsSphere(_s)},intersectsSphere:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++)if(t[i].distanceToPoint(n)<r)return 0;return 1},intersectsBox:function(e){for(var t=this.planes,n=0;n<6;n++){var r=t[n];if(Ms.x=r.normal.x>0?e.max.x:e.min.x,Ms.y=r.normal.y>0?e.max.y:e.min.y,Ms.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Ms)<0)return 0}return 1},containsPoint:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return 0;return 1}});var Ss={common:{diffuse:{value:new b(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new n},uv2Transform:{value:new n},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new t(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new b(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new b(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new n}},sprite:{diffuse:{value:new b(15658734)},opacity:{value:1},center:{value:new t(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new n}}};te.prototype=Object.create(j.prototype),te.prototype.constructor=te,ne.prototype=Object.create(F.prototype),ne.prototype.constructor=ne;var Ts={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( STANDARD )\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 vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( 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 vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, 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}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",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_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - 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#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(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}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\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#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\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}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x);\n } else if (face == 1.0) {\n uv = vec2(direction.x, -direction.z) / abs(direction.y);\n } else if (face == 2.0) {\n uv = direction.xy / abs(direction.z);\n } else if (face == 3.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x);\n } else if (face == 4.0) {\n uv = direction.xz / abs(direction.y);\n } else {\n uv = vec2(-direction.x, direction.y) / abs(direction.z);\n }\n return 0.5 * (uv + 1.0);\n}\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness); }\n return mip;\n}\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\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, vUv ).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 = clamp( floor( D ) / 255.0, 0.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#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, 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_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\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\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\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_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\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\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\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 )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\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\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 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 roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, 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\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\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#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) { \n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\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 = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\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 USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * 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 = ( isOrthographic ) ? vec3( 0, 0, 1 ) : 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_start\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\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform 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};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\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};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\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};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\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_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\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_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",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\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\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 );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#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#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\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\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 = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\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\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * 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( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, 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, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : 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\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\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\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\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:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\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 *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\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 *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * 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\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\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#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\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}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\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 = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef 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_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\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\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\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( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), 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( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), 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 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\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 ) || defined( SHADOWMAP_TYPE_VSM )\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_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#pragma unroll_loop_end\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_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\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 highp 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#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_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\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\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\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:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",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 <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#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 <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",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 <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",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 <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\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 <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\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 <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\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 <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_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 <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_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 <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\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 <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\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 = isPerspectiveMatrix( projectionMatrix );\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 <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"},Es={basic:{uniforms:W([Ss.common,Ss.specularmap,Ss.envmap,Ss.aomap,Ss.lightmap,Ss.fog]),vertexShader:Ts.meshbasic_vert,fragmentShader:Ts.meshbasic_frag},lambert:{uniforms:W([Ss.common,Ss.specularmap,Ss.envmap,Ss.aomap,Ss.lightmap,Ss.emissivemap,Ss.fog,Ss.lights,{emissive:{value:new b(0)}}]),vertexShader:Ts.meshlambert_vert,fragmentShader:Ts.meshlambert_frag},phong:{uniforms:W([Ss.common,Ss.specularmap,Ss.envmap,Ss.aomap,Ss.lightmap,Ss.emissivemap,Ss.bumpmap,Ss.normalmap,Ss.displacementmap,Ss.fog,Ss.lights,{emissive:{value:new b(0)},specular:{value:new b(1118481)},shininess:{value:30}}]),vertexShader:Ts.meshphong_vert,fragmentShader:Ts.meshphong_frag},standard:{uniforms:W([Ss.common,Ss.envmap,Ss.aomap,Ss.lightmap,Ss.emissivemap,Ss.bumpmap,Ss.normalmap,Ss.displacementmap,Ss.roughnessmap,Ss.metalnessmap,Ss.fog,Ss.lights,{emissive:{value:new b(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Ts.meshphysical_vert,fragmentShader:Ts.meshphysical_frag},toon:{uniforms:W([Ss.common,Ss.specularmap,Ss.aomap,Ss.lightmap,Ss.emissivemap,Ss.bumpmap,Ss.normalmap,Ss.displacementmap,Ss.gradientmap,Ss.fog,Ss.lights,{emissive:{value:new b(0)},specular:{value:new b(1118481)},shininess:{value:30}}]),vertexShader:Ts.meshtoon_vert,fragmentShader:Ts.meshtoon_frag},matcap:{uniforms:W([Ss.common,Ss.bumpmap,Ss.normalmap,Ss.displacementmap,Ss.fog,{matcap:{value:null}}]),vertexShader:Ts.meshmatcap_vert,fragmentShader:Ts.meshmatcap_frag},points:{uniforms:W([Ss.points,Ss.fog]),vertexShader:Ts.points_vert,fragmentShader:Ts.points_frag},dashed:{uniforms:W([Ss.common,Ss.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ts.linedashed_vert,fragmentShader:Ts.linedashed_frag},depth:{uniforms:W([Ss.common,Ss.displacementmap]),vertexShader:Ts.depth_vert,fragmentShader:Ts.depth_frag},normal:{uniforms:W([Ss.common,Ss.bumpmap,Ss.normalmap,Ss.displacementmap,{opacity:{value:1}}]),vertexShader:Ts.normal_vert,fragmentShader:Ts.normal_frag},sprite:{uniforms:W([Ss.sprite,Ss.fog]),vertexShader:Ts.sprite_vert,fragmentShader:Ts.sprite_frag},background:{uniforms:{uvTransform:{value:new n},t2D:{value:null}},vertexShader:Ts.background_vert,fragmentShader:Ts.background_frag},cube:{uniforms:W([Ss.envmap,{opacity:{value:1}}]),vertexShader:Ts.cube_vert,fragmentShader:Ts.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ts.equirect_vert,fragmentShader:Ts.equirect_frag},distanceRGBA:{uniforms:W([Ss.common,Ss.displacementmap,{referencePosition:{value:new c},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ts.distanceRGBA_vert,fragmentShader:Ts.distanceRGBA_frag},shadow:{uniforms:W([Ss.lights,Ss.fog,{color:{value:new b(0)},opacity:{value:1}}]),vertexShader:Ts.shadow_vert,fragmentShader:Ts.shadow_frag}};Es.physical={uniforms:W([Es.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new t(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new b(0)},transparency:{value:0}}]),vertexShader:Ts.meshphysical_vert,fragmentShader:Ts.meshphysical_frag},fe.prototype=Object.create(r.prototype),fe.prototype.constructor=fe,fe.prototype.isCubeTexture=1,Object.defineProperty(fe.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),me.prototype=Object.create(r.prototype),me.prototype.constructor=me,me.prototype.isDataTexture2DArray=1,ge.prototype=Object.create(r.prototype),ge.prototype.constructor=ge,ge.prototype.isDataTexture3D=1;var As=new r,Ls=new me,Cs=new ge,Rs=new fe,Ps=[],Os=[],Ns=new Float32Array(16),Ds=new Float32Array(9),Is=new Float32Array(4);$e.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),xe(t,e)},Qe.prototype.setValue=function(e,t,n){for(var r=this.seq,i=0,a=r.length;i!==a;++i){var o=r[i];o.setValue(e,t[o.id],n)}};var zs=/([\w\d_]+)(\])?(\[|\.)?/g;tt.prototype.setValue=function(e,t,n,r){var i=this.map[t];void 0!==i&&i.setValue(e,n,r)},tt.prototype.setOptional=function(e,t,n){var r=t[n];void 0!==r&&this.setValue(e,n,r)},tt.upload=function(e,t,n,r){for(var i=0,a=t.length;i!==a;++i){var o=t[i],s=n[o.id];0!=s.needsUpdate&&o.setValue(e,s.value,r)}},tt.seqWithValue=function(e,t){for(var n=[],r=0,i=e.length;r!==i;++r){var a=e[r];a.id in t&&n.push(a)}return n};var Bs=0,Us=/^[ \t]*#include +<([\w\d./]+)>/gm,Fs=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Hs=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g,ks=0;Lt.prototype=Object.create(T.prototype),Lt.prototype.constructor=Lt,Lt.prototype.isMeshDepthMaterial=1,Lt.prototype.copy=function(e){return T.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},Ct.prototype=Object.create(T.prototype),Ct.prototype.constructor=Ct,Ct.prototype.isMeshDistanceMaterial=1,Ct.prototype.copy=function(e){return T.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this},Dt.prototype=Object.assign(Object.create(Y.prototype),{constructor:Dt,isArrayCamera:1}),It.prototype=Object.assign(Object.create(p.prototype),{constructor:It,isGroup:1}),Object.assign(zt.prototype,e.prototype),Object.assign(Ut.prototype,{isFogExp2:1,clone:function(){return new Ut(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(Ft.prototype,{isFog:1,clone:function(){return new Ft(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(Ht.prototype,"needsUpdate",{set:function(e){1==e&&this.version++}}),Object.assign(Ht.prototype,{isInterleavedBuffer:1,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}});var Gs,js=new c;Object.defineProperties(kt.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(kt.prototype,{isInterleavedBufferAttribute:1,applyMatrix4:function(e){for(var t=0,n=this.data.count;t<n;t++)js.x=this.getX(t),js.y=this.getY(t),js.z=this.getZ(t),js.applyMatrix4(e),this.setXYZ(t,js.x,js.y,js.z);return this},setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this},setXYZ:function(e,t,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this},setXYZW:function(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}}),Gt.prototype=Object.create(T.prototype),Gt.prototype.constructor=Gt,Gt.prototype.isSpriteMaterial=1,Gt.prototype.copy=function(e){return T.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this};var Vs=new c,Ws=new c,qs=new c,Xs=new t,Ys=new t,Zs=new l,Js=new c,$s=new c,Qs=new c,Ks=new t,ec=new t,tc=new t;jt.prototype=Object.assign(Object.create(p.prototype),{constructor:jt,isSprite:1,raycast:function(e,n){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Ws.setFromMatrixScale(this.matrixWorld),Zs.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),qs.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&0==this.material.sizeAttenuation&&Ws.multiplyScalar(-qs.z);var r,i,a=this.material.rotation;0!==a&&(i=Math.cos(a),r=Math.sin(a));var o=this.center;Vt(Js.set(-.5,-.5,0),qs,o,Ws,r,i),Vt($s.set(.5,-.5,0),qs,o,Ws,r,i),Vt(Qs.set(.5,.5,0),qs,o,Ws,r,i),Ks.set(0,0),ec.set(1,0),tc.set(1,1);var s=e.ray.intersectTriangle(Js,$s,Qs,0,Vs);if(null!==s||(Vt($s.set(-.5,.5,0),qs,o,Ws,r,i),ec.set(0,1),null!==(s=e.ray.intersectTriangle(Js,Qs,$s,0,Vs)))){var c=e.ray.origin.distanceTo(Vs);c<e.near||c>e.far||n.push({distance:c,point:Vs.clone(),uv:x.getUV(Vs,Js,$s,Qs,Ks,ec,tc,new t),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return p.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}});var nc=new c,rc=new c;Wt.prototype=Object.assign(Object.create(p.prototype),{constructor:Wt,isLOD:1,copy:function(e){p.prototype.copy.call(this,e,0);for(var t=e.levels,n=0,r=t.length;n<r;n++){var i=t[n];this.addLevel(i.object.clone(),i.distance)}return this.autoUpdate=e.autoUpdate,this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var n=this.levels,r=0;r<n.length&&!(t<n[r].distance);r++);return n.splice(r,0,{distance:t,object:e}),this.add(e),this},getCurrentLevel:function(){return this._currentLevel},getObjectForDistance:function(e){var t=this.levels;if(t.length>0){for(var n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object}return null},raycast:function(e,t){if(this.levels.length>0){nc.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(nc);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){var t=this.levels;if(t.length>1){nc.setFromMatrixPosition(e.matrixWorld),rc.setFromMatrixPosition(this.matrixWorld);var n=nc.distanceTo(rc)/e.zoom;t[0].object.visible=1;for(var r=1,i=t.length;r<i&&n>=t[r].distance;r++)t[r-1].object.visible=0,t[r].object.visible=1;for(this._currentLevel=r-1;r<i;r++)t[r].object.visible=0}},toJSON:function(e){var t=p.prototype.toJSON.call(this,e);0==this.autoUpdate&&(t.object.autoUpdate=0),t.object.levels=[];for(var n=this.levels,r=0,i=n.length;r<i;r++){var a=n[r];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t}}),qt.prototype=Object.assign(Object.create(H.prototype),{constructor:qt,isSkinnedMesh:1,bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(1),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var e=new i,t=this.geometry.attributes.skinWeight,n=0,r=t.count;n<r;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);var a=1/e.manhattanLength();a!==1/0?e.multiplyScalar(a):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){H.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var ic=new l,ac=new l;Object.assign(Xt.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new l;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},pose:function(){var e,t,n;for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture,i=0,a=e.length;i<a;i++){var o=e[i]?e[i].matrixWorld:ac;ic.multiplyMatrices(o,t[i]),ic.toArray(n,16*i)}void 0!==r&&(r.needsUpdate=1)},clone:function(){return new Xt(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var r=this.bones[t];if(r.name===e)return r}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}}),Yt.prototype=Object.assign(Object.create(p.prototype),{constructor:Yt,isBone:1});var oc=new l,sc=new l,cc=[],lc=new H;Zt.prototype=Object.assign(Object.create(H.prototype),{constructor:Zt,isInstancedMesh:1,getMatrixAt:function(e,t){t.fromArray(this.instanceMatrix.array,16*e)},raycast:function(e,t){var n=this.matrixWorld,r=this.count;if(lc.geometry=this.geometry,lc.material=this.material,void 0!==lc.material)for(var i=0;i<r;i++)this.getMatrixAt(i,oc),sc.multiplyMatrices(n,oc),lc.matrixWorld=sc,lc.raycast(e,cc),cc.length>0&&(cc[0].instanceId=i,cc[0].object=this,t.push(cc[0]),cc.length=0)},setMatrixAt:function(e,t){t.toArray(this.instanceMatrix.array,16*e)},updateMorphTargets:function(){}}),Jt.prototype=Object.create(T.prototype),Jt.prototype.constructor=Jt,Jt.prototype.isLineBasicMaterial=1,Jt.prototype.copy=function(e){return T.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this};var uc=new c,hc=new c,pc=new l,dc=new v,fc=new g;$t.prototype=Object.assign(Object.create(p.prototype),{constructor:$t,isLine:1,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,i=t.count;r<i;r++)uc.fromBufferAttribute(t,r-1),hc.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=uc.distanceTo(hc);e.setAttribute("lineDistance",new I(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;for((n=e.lineDistances)[0]=0,r=1,i=a.length;r<i;r++)n[r]=n[r-1],n[r]+=a[r-1].distanceTo(a[r])}return this},raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),fc.copy(n.boundingSphere),fc.applyMatrix4(r),fc.radius+=i,0!=e.ray.intersectsSphere(fc)){pc.getInverse(r),dc.copy(e.ray).applyMatrix4(pc);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new c,l=new c,u=new c,h=new c,p=this&&this.isLineSegments?2:1;if(n.isBufferGeometry){var d=n.index,f=n.attributes.position.array;if(null!==d)for(var m=d.array,g=0,v=m.length-1;g<v;g+=p){var y=m[g],x=m[g+1];s.fromArray(f,3*y),l.fromArray(f,3*x),dc.distanceSqToSegment(s,l,h,u)>o||(h.applyMatrix4(this.matrixWorld),(_=e.ray.origin.distanceTo(h))<e.near||_>e.far||t.push({distance:_,point:u.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else for(g=0,v=f.length/3-1;g<v;g+=p)s.fromArray(f,3*g),l.fromArray(f,3*g+3),dc.distanceSqToSegment(s,l,h,u)>o||(h.applyMatrix4(this.matrixWorld),(_=e.ray.origin.distanceTo(h))<e.near||_>e.far||t.push({distance:_,point:u.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(n.isGeometry){var b=n.vertices,w=b.length;for(g=0;g<w-1;g+=p){var _;dc.distanceSqToSegment(b[g],b[g+1],h,u)>o||(h.applyMatrix4(this.matrixWorld),(_=e.ray.origin.distanceTo(h))<e.near||_>e.far||t.push({distance:_,point:u.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var mc=new c,gc=new c;Qt.prototype=Object.assign(Object.create($t.prototype),{constructor:Qt,isLineSegments:1,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],r=0,i=t.count;r<i;r+=2)mc.fromBufferAttribute(t,r),gc.fromBufferAttribute(t,r+1),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+mc.distanceTo(gc);e.setAttribute("lineDistance",new I(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;for(n=e.lineDistances,r=0,i=a.length;r<i;r+=2)mc.copy(a[r]),gc.copy(a[r+1]),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+mc.distanceTo(gc)}return this}}),Kt.prototype=Object.assign(Object.create($t.prototype),{constructor:Kt,isLineLoop:1}),en.prototype=Object.create(T.prototype),en.prototype.constructor=en,en.prototype.isPointsMaterial=1,en.prototype.copy=function(e){return T.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this};var vc=new l,yc=new v,xc=new g,bc=new c;tn.prototype=Object.assign(Object.create(p.prototype),{constructor:tn,isPoints:1,raycast:function(e,t){var n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),xc.copy(n.boundingSphere),xc.applyMatrix4(r),xc.radius+=i,0!=e.ray.intersectsSphere(xc)){vc.getInverse(r),yc.copy(e.ray).applyMatrix4(vc);var a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){var s=n.index,c=n.attributes.position.array;if(null!==s)for(var l=s.array,u=0,h=l.length;u<h;u++){var p=l[u];bc.fromArray(c,3*p),nn(bc,p,o,r,e,t,this)}else{u=0;for(var d=c.length/3;u<d;u++)bc.fromArray(c,3*u),nn(bc,u,o,r,e,t,this)}}else{var f=n.vertices;for(u=0,d=f.length;u<d;u++)nn(f[u],u,o,r,e,t,this)}}},updateMorphTargets:function(){var e,t,n,r=this.geometry;if(r.isBufferGeometry){var i=r.morphAttributes,a=Object.keys(i);if(a.length>0){var o=i[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||e+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=r.morphTargets;void 0!==s&&s.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),rn.prototype=Object.assign(Object.create(r.prototype),{constructor:rn,isVideoTexture:1,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=1)}}),an.prototype=Object.create(r.prototype),an.prototype.constructor=an,an.prototype.isCompressedTexture=1,on.prototype=Object.create(r.prototype),on.prototype.constructor=on,on.prototype.isCanvasTexture=1,sn.prototype=Object.create(r.prototype),sn.prototype.constructor=sn,sn.prototype.isDepthTexture=1,cn.prototype=Object.create(F.prototype),cn.prototype.constructor=cn,ln.prototype=Object.create(j.prototype),ln.prototype.constructor=ln,un.prototype=Object.create(F.prototype),un.prototype.constructor=un,hn.prototype=Object.create(j.prototype),hn.prototype.constructor=hn,pn.prototype=Object.create(F.prototype),pn.prototype.constructor=pn,dn.prototype=Object.create(j.prototype),dn.prototype.constructor=dn,fn.prototype=Object.create(pn.prototype),fn.prototype.constructor=fn,mn.prototype=Object.create(j.prototype),mn.prototype.constructor=mn,gn.prototype=Object.create(pn.prototype),gn.prototype.constructor=gn,vn.prototype=Object.create(j.prototype),vn.prototype.constructor=vn,yn.prototype=Object.create(pn.prototype),yn.prototype.constructor=yn,xn.prototype=Object.create(j.prototype),xn.prototype.constructor=xn,bn.prototype=Object.create(pn.prototype),bn.prototype.constructor=bn,wn.prototype=Object.create(j.prototype),wn.prototype.constructor=wn,_n.prototype=Object.create(F.prototype),_n.prototype.constructor=_n,_n.prototype.toJSON=function(){var e=F.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},Mn.prototype=Object.create(j.prototype),Mn.prototype.constructor=Mn,Sn.prototype=Object.create(F.prototype),Sn.prototype.constructor=Sn,Tn.prototype=Object.create(j.prototype),Tn.prototype.constructor=Tn,En.prototype=Object.create(F.prototype),En.prototype.constructor=En;var wc={area:function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n},isClockWise:function(e){return wc.area(e)<0},triangulateShape:function(e,t){var n=[],r=[],i=[];Yn(e),Zn(n,e);var a=e.length;t.forEach(Yn);for(var o=0;o<t.length;o++)r.push(a),a+=t[o].length,Zn(n,t[o]);var s=function(e,t,n){n=n||2;var r,i,a,o,s,c,l,u=t&&t.length,h=u?t[0]*n:e.length,p=An(e,0,h,n,1),d=[];if(!p||p.next===p.prev)return d;if(u&&(p=function(e,t,n,r){var i,a,o,s=[];for(i=0,a=t.length;i<a;i++)(o=An(e,t[i]*r,i<a-1?t[i+1]*r:e.length,r,0))===o.next&&(o.steiner=1),s.push(Bn(o));for(s.sort(Dn),i=0;i<s.length;i++)In(s[i],n),n=Ln(n,n.next);return n}(e,t,p,n)),e.length>80*n){r=a=e[0],i=o=e[1];for(var f=n;f<h;f+=n)(s=e[f])<r&&(r=s),(c=e[f+1])<i&&(i=c),s>a&&(a=s),c>o&&(o=c);l=0!==(l=Math.max(a-r,o-i))?1/l:0}return Cn(p,d,n,r,i,l),d}(n,r);for(o=0;o<s.length;o+=3)i.push(s.slice(o,o+3));return i}};Jn.prototype=Object.create(j.prototype),Jn.prototype.constructor=Jn,Jn.prototype.toJSON=function(){var e=j.prototype.toJSON.call(this);return Qn(this.parameters.shapes,this.parameters.options,e)},$n.prototype=Object.create(F.prototype),$n.prototype.constructor=$n,$n.prototype.toJSON=function(){var e=F.prototype.toJSON.call(this);return Qn(this.parameters.shapes,this.parameters.options,e)};var _c={generateTopUV:function(e,n,r,i,a){var o=n[3*r],s=n[3*r+1],c=n[3*i],l=n[3*i+1],u=n[3*a],h=n[3*a+1];return[new t(o,s),new t(c,l),new t(u,h)]},generateSideWallUV:function(e,n,r,i,a,o){var s=n[3*r],c=n[3*r+1],l=n[3*r+2],u=n[3*i],h=n[3*i+1],p=n[3*i+2],d=n[3*a],f=n[3*a+1],m=n[3*a+2],g=n[3*o],v=n[3*o+1],y=n[3*o+2];return Math.abs(c-h)<.01?[new t(s,1-l),new t(u,1-p),new t(d,1-m),new t(g,1-y)]:[new t(c,1-l),new t(h,1-p),new t(f,1-m),new t(v,1-y)]}};Kn.prototype=Object.create(j.prototype),Kn.prototype.constructor=Kn,er.prototype=Object.create($n.prototype),er.prototype.constructor=er,tr.prototype=Object.create(j.prototype),tr.prototype.constructor=tr,nr.prototype=Object.create(F.prototype),nr.prototype.constructor=nr,rr.prototype=Object.create(j.prototype),rr.prototype.constructor=rr,ir.prototype=Object.create(F.prototype),ir.prototype.constructor=ir,ar.prototype=Object.create(j.prototype),ar.prototype.constructor=ar,or.prototype=Object.create(F.prototype),or.prototype.constructor=or,sr.prototype=Object.create(j.prototype),sr.prototype.constructor=sr,sr.prototype.toJSON=function(){var e=j.prototype.toJSON.call(this);return lr(this.parameters.shapes,e)},cr.prototype=Object.create(F.prototype),cr.prototype.constructor=cr,cr.prototype.toJSON=function(){var e=F.prototype.toJSON.call(this);return lr(this.parameters.shapes,e)},ur.prototype=Object.create(F.prototype),ur.prototype.constructor=ur,hr.prototype=Object.create(j.prototype),hr.prototype.constructor=hr,pr.prototype=Object.create(F.prototype),pr.prototype.constructor=pr,dr.prototype=Object.create(hr.prototype),dr.prototype.constructor=dr,fr.prototype=Object.create(pr.prototype),fr.prototype.constructor=fr,mr.prototype=Object.create(j.prototype),mr.prototype.constructor=mr,gr.prototype=Object.create(F.prototype),gr.prototype.constructor=gr;var Mc=Object.freeze({__proto__:null,WireframeGeometry:cn,ParametricGeometry:ln,ParametricBufferGeometry:un,TetrahedronGeometry:dn,TetrahedronBufferGeometry:fn,OctahedronGeometry:mn,OctahedronBufferGeometry:gn,IcosahedronGeometry:vn,IcosahedronBufferGeometry:yn,DodecahedronGeometry:xn,DodecahedronBufferGeometry:bn,PolyhedronGeometry:hn,PolyhedronBufferGeometry:pn,TubeGeometry:wn,TubeBufferGeometry:_n,TorusKnotGeometry:Mn,TorusKnotBufferGeometry:Sn,TorusGeometry:Tn,TorusBufferGeometry:En,TextGeometry:Kn,TextBufferGeometry:er,SphereGeometry:tr,SphereBufferGeometry:nr,RingGeometry:rr,RingBufferGeometry:ir,PlaneGeometry:te,PlaneBufferGeometry:ne,LatheGeometry:ar,LatheBufferGeometry:or,ShapeGeometry:sr,ShapeBufferGeometry:cr,ExtrudeGeometry:Jn,ExtrudeBufferGeometry:$n,EdgesGeometry:ur,ConeGeometry:dr,ConeBufferGeometry:fr,CylinderGeometry:hr,CylinderBufferGeometry:pr,CircleGeometry:mr,CircleBufferGeometry:gr,BoxGeometry:class extends j{constructor(e,t,n,r,i,a){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:a},this.fromBufferGeometry(new bs(e,t,n,r,i,a)),this.mergeVertices()}},BoxBufferGeometry:bs});vr.prototype=Object.create(T.prototype),vr.prototype.constructor=vr,vr.prototype.isShadowMaterial=1,vr.prototype.copy=function(e){return T.prototype.copy.call(this,e),this.color.copy(e.color),this},yr.prototype=Object.create(q.prototype),yr.prototype.constructor=yr,yr.prototype.isRawShaderMaterial=1,xr.prototype=Object.create(T.prototype),xr.prototype.constructor=xr,xr.prototype.isMeshStandardMaterial=1,xr.prototype.copy=function(e){return T.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.vertexTangents=e.vertexTangents,this},br.prototype=Object.create(xr.prototype),br.prototype.constructor=br,br.prototype.isMeshPhysicalMaterial=1,br.prototype.copy=function(e){return xr.prototype.copy.call(this,e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.reflectivity=e.reflectivity,e.sheen?this.sheen=(this.sheen||new b).copy(e.sheen):this.sheen=null,this.transparency=e.transparency,this},wr.prototype=Object.create(T.prototype),wr.prototype.constructor=wr,wr.prototype.isMeshPhongMaterial=1,wr.prototype.copy=function(e){return T.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},_r.prototype=Object.create(T.prototype),_r.prototype.constructor=_r,_r.prototype.isMeshToonMaterial=1,_r.prototype.copy=function(e){return T.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.gradientMap=e.gradientMap,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.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},Mr.prototype=Object.create(T.prototype),Mr.prototype.constructor=Mr,Mr.prototype.isMeshNormalMaterial=1,Mr.prototype.copy=function(e){return T.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},Sr.prototype=Object.create(T.prototype),Sr.prototype.constructor=Sr,Sr.prototype.isMeshLambertMaterial=1,Sr.prototype.copy=function(e){return T.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},Tr.prototype=Object.create(T.prototype),Tr.prototype.constructor=Tr,Tr.prototype.isMeshMatcapMaterial=1,Tr.prototype.copy=function(e){return T.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},Er.prototype=Object.create(Jt.prototype),Er.prototype.constructor=Er,Er.prototype.isLineDashedMaterial=1,Er.prototype.copy=function(e){return Jt.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var Sc=Object.freeze({__proto__:null,ShadowMaterial:vr,SpriteMaterial:Gt,RawShaderMaterial:yr,ShaderMaterial:q,PointsMaterial:en,MeshPhysicalMaterial:br,MeshStandardMaterial:xr,MeshPhongMaterial:wr,MeshToonMaterial:_r,MeshNormalMaterial:Mr,MeshLambertMaterial:Sr,MeshDepthMaterial:Lt,MeshDistanceMaterial:Ct,MeshBasicMaterial:E,MeshMatcapMaterial:Tr,LineDashedMaterial:Er,LineBasicMaterial:Jt,Material:T}),Tc={arraySlice:function(e,t,n){return Tc.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&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,n=Array(t),r=0;r!==t;++r)n[r]=r;return n.sort((function(t,n){return e[t]-e[n]})),n},sortedArray:function(e,t,n){for(var r=e.length,i=new e.constructor(r),a=0,o=0;o!==r;++a)for(var s=n[a]*t,c=0;c!==t;++c)i[o++]=e[s+c];return i},flattenJSON:function(e,t,n,r){for(var i=1,a=e[0];void 0!==a&&void 0===a[r];)a=e[i++];if(void 0!==a){var o=a[r];if(void 0!==o)if(Array.isArray(o))do{void 0!==(o=a[r])&&(t.push(a.time),n.push.apply(n,o)),a=e[i++]}while(void 0!==a);else if(void 0!==o.toArray)do{void 0!==(o=a[r])&&(t.push(a.time),o.toArray(n,n.length)),a=e[i++]}while(void 0!==a);else do{void 0!==(o=a[r])&&(t.push(a.time),n.push(o)),a=e[i++]}while(void 0!==a)}},subclip:function(e,t,n,r,i){i=i||30;var a=e.clone();a.name=t;for(var o=[],s=0;s<a.tracks.length;++s){for(var c=a.tracks[s],l=c.getValueSize(),u=[],h=[],p=0;p<c.times.length;++p){var d=c.times[p]*i;if(!(d<n||d>=r)){u.push(c.times[p]);for(var f=0;f<l;++f)h.push(c.values[p*l+f])}}0!==u.length&&(c.times=Tc.convertArray(u,c.times.constructor),c.values=Tc.convertArray(h,c.values.constructor),o.push(c))}a.tracks=o;var m=1/0;for(s=0;s<a.tracks.length;++s)m>a.tracks[s].times[0]&&(m=a.tracks[s].times[0]);for(s=0;s<a.tracks.length;++s)a.tracks[s].shift(-1*m);return a.resetDuration(),a}};Object.assign(Ar.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{var a;n:{r:if(!(e<r)){for(var o=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,i)}if(n===o)break;if(i=r,e<(r=t[++n]))break t}a=t.length;break n}if(e>=i)break e;var s=t[1];for(e<s&&(n=2,i=s),o=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===o)break;if(r=i,e>=(i=t[--n-1]))break t}a=n,n=0}for(;n<a;){var c=n+a>>>1;e<t[c]?a=c:n=c+1}if(r=t[n],void 0===(i=t[n-1]))return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,i,e)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r,a=0;a!==r;++a)t[a]=n[i+a];return t},interpolate_:function(){throw Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Ar.prototype,{beforeStart_:Ar.prototype.copySampleValue_,afterEnd_:Ar.prototype.copySampleValue_}),Lr.prototype=Object.assign(Object.create(Ar.prototype),{constructor:Lr,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(e,t,n){var r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case 2401:i=e,o=2*t-n;break;case 2402:o=t+r[i=r.length-2]-r[i+1];break;default:i=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:a=e,s=2*n-t;break;case 2402:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}var c=.5*(n-t),l=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(s-n),this._offsetPrev=i*l,this._offsetNext=a*l},interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,p=this._weightNext,d=(n-t)/(r-t),f=d*d,m=f*d,g=-h*m+2*h*f-h*d,v=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*d+1,y=(-1-p)*m+(1.5+p)*f+.5*d,x=p*m-p*f,b=0;b!==o;++b)i[b]=g*a[l+b]+v*a[c+b]+y*a[s+b]+x*a[u+b];return i}}),Cr.prototype=Object.assign(Object.create(Ar.prototype),{constructor:Cr,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,c=s-o,l=(n-t)/(r-t),u=1-l,h=0;h!==o;++h)i[h]=a[c+h]*u+a[s+h]*l;return i}}),Rr.prototype=Object.assign(Object.create(Ar.prototype),{constructor:Rr,interpolate_:function(e){return this.copySampleValue_(e-1)}}),Object.assign(Pr,{toJSON:function(e){var t,n=e.constructor;if(void 0!==n.toJSON)t=n.toJSON(e);else{t={name:e.name,times:Tc.convertArray(e.times,Array),values:Tc.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t}}),Object.assign(Pr.prototype,{constructor:Pr,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(e){return new Rr(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new Cr(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new Lr(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),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,n=0,r=t.length;n!==r;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,r=n.length,i=0,a=r-1;i!==r&&n[i]<e;)++i;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==i||a!==r){i>=a&&(i=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=Tc.arraySlice(n,i,a),this.values=Tc.arraySlice(this.values,i*o,a*o)}return this},validate:function(){var e=1,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=0);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=0);for(var a=null,o=0;o!==i;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=0;break}if(null!==a&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=0;break}a=s}if(void 0!==r&&Tc.isTypedArray(r)){o=0;for(var c=r.length;o!==c;++o){var l=r[o];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,l),e=0;break}}}return e},optimize:function(){for(var e=Tc.arraySlice(this.times),t=Tc.arraySlice(this.values),n=this.getValueSize(),r=2302===this.getInterpolation(),i=1,a=e.length-1,o=1;o<a;++o){var s=0,c=e[o];if(c!==e[o+1]&&(1!==o||c!==c[0]))if(r)s=1;else for(var l=o*n,u=l-n,h=l+n,p=0;p!==n;++p){var d=t[l+p];if(d!==t[u+p]||d!==t[h+p]){s=1;break}}if(s){if(o!==i){e[i]=e[o];var f=o*n,m=i*n;for(p=0;p!==n;++p)t[m+p]=t[f+p]}++i}}if(a>0){for(e[i]=e[a],f=a*n,m=i*n,p=0;p!==n;++p)t[m+p]=t[f+p];++i}return i!==e.length?(this.times=Tc.arraySlice(e,0,i),this.values=Tc.arraySlice(t,0,i*n)):(this.times=e,this.values=t),this},clone:function(){var e=Tc.arraySlice(this.times,0),t=Tc.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),Or.prototype=Object.assign(Object.create(Pr.prototype),{constructor:Or,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Nr.prototype=Object.assign(Object.create(Pr.prototype),{constructor:Nr,ValueTypeName:"color"}),Dr.prototype=Object.assign(Object.create(Pr.prototype),{constructor:Dr,ValueTypeName:"number"}),Ir.prototype=Object.assign(Object.create(Ar.prototype),{constructor:Ir,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=e*o,l=(n-t)/(r-t),u=c+o;c!==u;c+=4)s.slerpFlat(i,0,a,c-o,a,c,l);return i}}),zr.prototype=Object.assign(Object.create(Pr.prototype),{constructor:zr,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(e){return new Ir(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),Br.prototype=Object.assign(Object.create(Pr.prototype),{constructor:Br,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ur.prototype=Object.assign(Object.create(Pr.prototype),{constructor:Ur,ValueTypeName:"vector"}),Object.assign(Fr,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,a=n.length;i!==a;++i)t.push(Hr(n[i]).scale(r));return new Fr(e.name,e.duration,t)},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid},i=0,a=n.length;i!==a;++i)t.push(Pr.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var i=t.length,a=[],o=0;o<i;o++){var s=[],c=[];s.push((o+i-1)%i,o,(o+1)%i),c.push(0,1,0);var l=Tc.getKeyframeOrder(s);s=Tc.sortedArray(s,1,l),c=Tc.sortedArray(c,1,l),r||0!==s[0]||(s.push(i),c.push(c[0])),a.push(new Dr(".morphTargetInfluences["+t[o].name+"]",s,c).scale(1/n))}return new Fr(e,-1,a)},findByName:function(e,t){var n=e;if(!Array.isArray(e)){var r=e;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],c=s.name.match(i);if(c&&c.length>1){var l=r[h=c[1]];l||(r[h]=l=[]),l.push(s)}}var u=[];for(var h in r)u.push(Fr.CreateFromMorphTargetSequence(h,r[h],t,n));return u},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){if(0!==n.length){var a=[],o=[];Tc.flattenJSON(n,a,o,r),0!==a.length&&i.push(new e(t,a,o))}},r=[],i=e.name||"default",a=e.length||-1,o=e.fps||30,s=e.hierarchy||[],c=0;c<s.length;c++){var l=s[c].keys;if(l&&0!==l.length)if(l[0].morphTargets){for(var u={},h=0;h<l.length;h++)if(l[h].morphTargets)for(var p=0;p<l[h].morphTargets.length;p++)u[l[h].morphTargets[p]]=-1;for(var d in u){var f=[],m=[];for(p=0;p!==l[h].morphTargets.length;++p){var g=l[h];f.push(g.time),m.push(g.morphTarget===d?1:0)}r.push(new Dr(".morphTargetInfluence["+d+"]",f,m))}a=u.length*(o||1)}else{var v=".bones["+t[c].name+"]";n(Ur,v+".position",l,"pos",r),n(zr,v+".quaternion",l,"rot",r),n(Ur,v+".scale",l,"scl",r)}}return 0===r.length?null:new Fr(i,a,r)}}),Object.assign(Fr.prototype,{resetDuration:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var r=this.tracks[t];e=Math.max(e,r.times[r.times.length-1])}return this.duration=e,this},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},validate:function(){for(var e=1,t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this},clone:function(){for(var e=[],t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new Fr(this.name,this.duration,e)}});var Ec={enabled:0,files:{},add:function(e,t){0!=this.enabled&&(this.files[e]=t)},get:function(e){if(0!=this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},Ac=new kr;Object.assign(Gr.prototype,{load:function(){},parse:function(){},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this}});var Lc={};jr.prototype=Object.assign(Object.create(Gr.prototype),{constructor:jr,load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Ec.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;if(void 0===Lc[e]){var o=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(o){var s=o[1],c=!!o[2],l=o[3];l=decodeURIComponent(l),c&&(l=atob(l));try{var u,h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":for(var p=new Uint8Array(l.length),d=0;d<l.length;d++)p[d]=l.charCodeAt(d);u="blob"===h?new Blob([p.buffer],{type:s}):p.buffer;break;case"document":var f=new DOMParser;u=f.parseFromString(l,s);break;case"json":u=JSON.parse(l);break;default:u=l}setTimeout((function(){t&&t(u),i.manager.itemEnd(e)}),0)}catch(t){setTimeout((function(){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}),0)}}else{Lc[e]=[],Lc[e].push({onLoad:t,onProgress:n,onError:r});var m=new XMLHttpRequest;for(var g in m.open("GET",e,1),m.addEventListener("load",(function(t){var n=this.response,r=Lc[e];if(delete Lc[e],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Ec.add(e,n);for(var a=0,o=r.length;a<o;a++)(s=r[a]).onLoad&&s.onLoad(n);i.manager.itemEnd(e)}else{for(a=0,o=r.length;a<o;a++){var s;(s=r[a]).onError&&s.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}}),0),m.addEventListener("progress",(function(t){for(var n=Lc[e],r=0,i=n.length;r<i;r++){var a=n[r];a.onProgress&&a.onProgress(t)}}),0),m.addEventListener("error",(function(t){var n=Lc[e];delete Lc[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}),0),m.addEventListener("abort",(function(t){var n=Lc[e];delete Lc[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}),0),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return i.manager.itemStart(e),m}Lc[e].push({onLoad:t,onProgress:n,onError:r})},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),Vr.prototype=Object.assign(Object.create(Gr.prototype),{constructor:Vr,load:function(e,t,n,r){var i=this,a=new jr(i.manager);a.setPath(i.path),a.load(e,(function(e){t(i.parse(JSON.parse(e)))}),n,r)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var r=Fr.parse(e[n]);t.push(r)}return t}}),Wr.prototype=Object.assign(Object.create(Gr.prototype),{constructor:Wr,load:function(e,t,n,r){function i(i){c.load(e[i],(function(e){var n=a.parse(e,1);o[i]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(l+=1)&&(1===n.mipmapCount&&(s.minFilter=1006),s.format=n.format,s.needsUpdate=1,t&&t(s))}),n,r)}var a=this,o=[],s=new an;s.image=o;var c=new jr(this.manager);if(c.setPath(this.path),c.setResponseType("arraybuffer"),Array.isArray(e))for(var l=0,u=0,h=e.length;u<h;++u)i(u);else c.load(e,(function(e){var n=a.parse(e,1);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,i=0;i<r;i++){o[i]={mipmaps:[]};for(var c=0;c<n.mipmapCount;c++)o[i].mipmaps.push(n.mipmaps[i*n.mipmapCount+c]),o[i].format=n.format,o[i].width=n.width,o[i].height=n.height}else s.image.width=n.width,s.image.height=n.height,s.mipmaps=n.mipmaps;1===n.mipmapCount&&(s.minFilter=1006),s.format=n.format,s.needsUpdate=1,t&&t(s)}),n,r);return s}}),qr.prototype=Object.assign(Object.create(Gr.prototype),{constructor:qr,load:function(e,t,n,r){var i=this,a=new $,o=new jr(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(e,(function(e){var n=i.parse(e);n&&(void 0!==n.image?a.image=n.image:void 0!==n.data&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data),a.wrapS=void 0!==n.wrapS?n.wrapS:1001,a.wrapT=void 0!==n.wrapT?n.wrapT:1001,a.magFilter=void 0!==n.magFilter?n.magFilter:1006,a.minFilter=void 0!==n.minFilter?n.minFilter:1006,a.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(a.format=n.format),void 0!==n.type&&(a.type=n.type),void 0!==n.mipmaps&&(a.mipmaps=n.mipmaps,a.minFilter=1008),1===n.mipmapCount&&(a.minFilter=1006),a.needsUpdate=1,t&&t(a,n))}),n,r),a}}),Xr.prototype=Object.assign(Object.create(Gr.prototype),{constructor:Xr,load:function(e,t,n,r){function i(){c.removeEventListener("load",i,0),c.removeEventListener("error",a,0),Ec.add(e,this),t&&t(this),o.manager.itemEnd(e)}function a(t){c.removeEventListener("load",i,0),c.removeEventListener("error",a,0),r&&r(t),o.manager.itemError(e),o.manager.itemEnd(e)}void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var o=this,s=Ec.get(e);if(void 0!==s)return o.manager.itemStart(e),setTimeout((function(){t&&t(s),o.manager.itemEnd(e)}),0),s;var c=document.createElementNS("http://www.w3.org/1999/xhtml","img");return c.addEventListener("load",i,0),c.addEventListener("error",a,0),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(c.crossOrigin=this.crossOrigin),o.manager.itemStart(e),c.src=e,c}}),Yr.prototype=Object.assign(Object.create(Gr.prototype),{constructor:Yr,load:function(e,t,n,r){function i(n){o.load(e[n],(function(e){a.images[n]=e,6==++s&&(a.needsUpdate=1,t&&t(a))}),void 0,r)}var a=new fe,o=new Xr(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);for(var s=0,c=0;c<e.length;++c)i(c);return a}}),Zr.prototype=Object.assign(Object.create(Gr.prototype),{constructor:Zr,load:function(e,t,n,i){var a=new r,o=new Xr(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,(function(n){a.image=n;var r=e.search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/);a.format=r?1022:1023,a.needsUpdate=1,void 0!==t&&t(a)}),n,i),a}}),Object.assign(Jr.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=0;var t,n,r=[],i=this.getPoint(0),a=0;for(r.push(0),n=1;n<=e;n++)a+=(t=this.getPoint(n/e)).distanceTo(i),r.push(a),i=t;return this.cacheArcLengths=r,r},updateArcLengths:function(){this.needsUpdate=1,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,a=r.length;n=t||e*r[a-1];for(var o,s=0,c=a-1;s<=c;)if((o=r[i=Math.floor(s+(c-s)/2)]-n)<0)s=i+1;else{if(!(o>0)){c=i;break}c=i-1}if(r[i=c]===n)return i/(a-1);var l=r[i];return(i+(n-l)/(r[i+1]-l))/(a-1)},getTangent:function(e){var t=e-1e-4,n=e+1e-4;t<0&&(t=0),n>1&&(n=1);var r=this.getPoint(t);return this.getPoint(n).clone().sub(r).normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var n,r,i,a=new c,o=[],s=[],u=[],h=new c,p=new l;for(n=0;n<=e;n++)r=n/e,o[n]=this.getTangentAt(r),o[n].normalize();s[0]=new c,u[0]=new c;var d=Number.MAX_VALUE,f=Math.abs(o[0].x),m=Math.abs(o[0].y),g=Math.abs(o[0].z);for(f<=d&&(d=f,a.set(1,0,0)),m<=d&&(d=m,a.set(0,1,0)),g<=d&&a.set(0,0,1),h.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],h),u[0].crossVectors(o[0],s[0]),n=1;n<=e;n++)s[n]=s[n-1].clone(),u[n]=u[n-1].clone(),h.crossVectors(o[n-1],o[n]),h.length()>Number.EPSILON&&(h.normalize(),i=Math.acos(Na.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(p.makeRotationAxis(h,i))),u[n].crossVectors(o[n],s[n]);if(1==t)for(i=Math.acos(Na.clamp(s[0].dot(s[e]),-1,1)),i/=e,o[0].dot(h.crossVectors(s[0],s[e]))>0&&(i=-i),n=1;n<=e;n++)s[n].applyMatrix4(p.makeRotationAxis(o[n],i*n)),u[n].crossVectors(o[n],s[n]);return{tangents:o,normals:s,binormals:u}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),$r.prototype=Object.create(Jr.prototype),$r.prototype.constructor=$r,$r.prototype.isEllipseCurve=1,$r.prototype.getPoint=function(e,n){for(var r=n||new t,i=2*Math.PI,a=this.aEndAngle-this.aStartAngle,o=Math.abs(a)<Number.EPSILON;a<0;)a+=i;for(;a>i;)a-=i;a<Number.EPSILON&&(a=o?0:i),1!=this.aClockwise||o||(a===i?a=-i:a-=i);var s=this.aStartAngle+e*a,c=this.aX+this.xRadius*Math.cos(s),l=this.aY+this.yRadius*Math.sin(s);if(0!==this.aRotation){var u=Math.cos(this.aRotation),h=Math.sin(this.aRotation),p=c-this.aX,d=l-this.aY;c=p*u-d*h+this.aX,l=p*h+d*u+this.aY}return r.set(c,l)},$r.prototype.copy=function(e){return Jr.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},$r.prototype.toJSON=function(){var e=Jr.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},$r.prototype.fromJSON=function(e){return Jr.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},Qr.prototype=Object.create($r.prototype),Qr.prototype.constructor=Qr,Qr.prototype.isArcCurve=1;var Cc=new c,Rc=new Kr,Pc=new Kr,Oc=new Kr;ei.prototype=Object.create(Jr.prototype),ei.prototype.constructor=ei,ei.prototype.isCatmullRomCurve3=1,ei.prototype.getPoint=function(e,t){var n,r,i,a,o=t||new c,s=this.points,l=s.length,u=(l-(this.closed?0:1))*e,h=Math.floor(u),p=u-h;if(this.closed?h+=h>0?0:(Math.floor(Math.abs(h)/l)+1)*l:0===p&&h===l-1&&(h=l-2,p=1),this.closed||h>0?n=s[(h-1)%l]:(Cc.subVectors(s[0],s[1]).add(s[0]),n=Cc),r=s[h%l],i=s[(h+1)%l],this.closed||h+2<l?a=s[(h+2)%l]:(Cc.subVectors(s[l-1],s[l-2]).add(s[l-1]),a=Cc),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,f=Math.pow(n.distanceToSquared(r),d),m=Math.pow(r.distanceToSquared(i),d),g=Math.pow(i.distanceToSquared(a),d);m<1e-4&&(m=1),f<1e-4&&(f=m),g<1e-4&&(g=m),Rc.initNonuniformCatmullRom(n.x,r.x,i.x,a.x,f,m,g),Pc.initNonuniformCatmullRom(n.y,r.y,i.y,a.y,f,m,g),Oc.initNonuniformCatmullRom(n.z,r.z,i.z,a.z,f,m,g)}else"catmullrom"===this.curveType&&(Rc.initCatmullRom(n.x,r.x,i.x,a.x,this.tension),Pc.initCatmullRom(n.y,r.y,i.y,a.y,this.tension),Oc.initCatmullRom(n.z,r.z,i.z,a.z,this.tension));return o.set(Rc.calc(p),Pc.calc(p),Oc.calc(p)),o},ei.prototype.copy=function(e){Jr.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},ei.prototype.toJSON=function(){var e=Jr.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},ei.prototype.fromJSON=function(e){Jr.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new c).fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},ii.prototype=Object.create(Jr.prototype),ii.prototype.constructor=ii,ii.prototype.isCubicBezierCurve=1,ii.prototype.getPoint=function(e,n){var r=n||new t,i=this.v0,a=this.v1,o=this.v2,s=this.v3;return r.set(ri(e,i.x,a.x,o.x,s.x),ri(e,i.y,a.y,o.y,s.y)),r},ii.prototype.copy=function(e){return Jr.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},ii.prototype.toJSON=function(){var e=Jr.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},ii.prototype.fromJSON=function(e){return Jr.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},ai.prototype=Object.create(Jr.prototype),ai.prototype.constructor=ai,ai.prototype.isCubicBezierCurve3=1,ai.prototype.getPoint=function(e,t){var n=t||new c,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(ri(e,r.x,i.x,a.x,o.x),ri(e,r.y,i.y,a.y,o.y),ri(e,r.z,i.z,a.z,o.z)),n},ai.prototype.copy=function(e){return Jr.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},ai.prototype.toJSON=function(){var e=Jr.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},ai.prototype.fromJSON=function(e){return Jr.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},oi.prototype=Object.create(Jr.prototype),oi.prototype.constructor=oi,oi.prototype.isLineCurve=1,oi.prototype.getPoint=function(e,n){var r=n||new t;return 1===e?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(e).add(this.v1)),r},oi.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},oi.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},oi.prototype.copy=function(e){return Jr.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},oi.prototype.toJSON=function(){var e=Jr.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},oi.prototype.fromJSON=function(e){return Jr.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},si.prototype=Object.create(Jr.prototype),si.prototype.constructor=si,si.prototype.isLineCurve3=1,si.prototype.getPoint=function(e,t){var n=t||new c;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},si.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},si.prototype.copy=function(e){return Jr.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},si.prototype.toJSON=function(){var e=Jr.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},si.prototype.fromJSON=function(e){return Jr.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},ci.prototype=Object.create(Jr.prototype),ci.prototype.constructor=ci,ci.prototype.isQuadraticBezierCurve=1,ci.prototype.getPoint=function(e,n){var r=n||new t,i=this.v0,a=this.v1,o=this.v2;return r.set(ni(e,i.x,a.x,o.x),ni(e,i.y,a.y,o.y)),r},ci.prototype.copy=function(e){return Jr.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},ci.prototype.toJSON=function(){var e=Jr.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},ci.prototype.fromJSON=function(e){return Jr.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},li.prototype=Object.create(Jr.prototype),li.prototype.constructor=li,li.prototype.isQuadraticBezierCurve3=1,li.prototype.getPoint=function(e,t){var n=t||new c,r=this.v0,i=this.v1,a=this.v2;return n.set(ni(e,r.x,i.x,a.x),ni(e,r.y,i.y,a.y),ni(e,r.z,i.z,a.z)),n},li.prototype.copy=function(e){return Jr.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},li.prototype.toJSON=function(){var e=Jr.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},li.prototype.fromJSON=function(e){return Jr.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},ui.prototype=Object.create(Jr.prototype),ui.prototype.constructor=ui,ui.prototype.isSplineCurve=1,ui.prototype.getPoint=function(e,n){var r=n||new t,i=this.points,a=(i.length-1)*e,o=Math.floor(a),s=a-o,c=i[0===o?o:o-1],l=i[o],u=i[o>i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return r.set(ti(s,c.x,l.x,u.x,h.x),ti(s,c.y,l.y,u.y,h.y)),r},ui.prototype.copy=function(e){Jr.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this},ui.prototype.toJSON=function(){var e=Jr.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e},ui.prototype.fromJSON=function(e){Jr.prototype.fromJSON.call(this,e),this.points=[];for(var n=0,r=e.points.length;n<r;n++){var i=e.points[n];this.points.push((new t).fromArray(i))}return this};var Nc=Object.freeze({__proto__:null,ArcCurve:Qr,CatmullRomCurve3:ei,CubicBezierCurve:ii,CubicBezierCurve3:ai,EllipseCurve:$r,LineCurve:oi,LineCurve3:si,QuadraticBezierCurve:ci,QuadraticBezierCurve3:li,SplineCurve:ui});hi.prototype=Object.assign(Object.create(Jr.prototype),{constructor:hi,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new oi(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=t){var i=n[r]-t,a=this.curves[r],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=1,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],r=0,i=this.curves;r<i.length;r++)for(var a=i[r],o=a&&a.isEllipseCurve?2*e:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?e*a.points.length:e,s=a.getPoints(o),c=0;c<s.length;c++){var l=s[c];t&&t.equals(l)||(n.push(l),t=l)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){Jr.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=Jr.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var r=this.curves[t];e.curves.push(r.toJSON())}return e},fromJSON:function(e){Jr.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push((new Nc[r.type]).fromJSON(r))}return this}}),pi.prototype=Object.assign(Object.create(hi.prototype),{constructor:pi,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this},moveTo:function(e,t){return this.currentPoint.set(e,t),this},lineTo:function(e,n){var r=new oi(this.currentPoint.clone(),new t(e,n));return this.curves.push(r),this.currentPoint.set(e,n),this},quadraticCurveTo:function(e,n,r,i){var a=new ci(this.currentPoint.clone(),new t(e,n),new t(r,i));return this.curves.push(a),this.currentPoint.set(r,i),this},bezierCurveTo:function(e,n,r,i,a,o){var s=new ii(this.currentPoint.clone(),new t(e,n),new t(r,i),new t(a,o));return this.curves.push(s),this.currentPoint.set(a,o),this},splineThru:function(e){var t=new ui([this.currentPoint.clone()].concat(e));return this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this},arc:function(e,t,n,r,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,r,i,a),this},absarc:function(e,t,n,r,i,a){return this.absellipse(e,t,n,n,r,i,a),this},ellipse:function(e,t,n,r,i,a,o,s){var c=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(e+c,t+l,n,r,i,a,o,s),this},absellipse:function(e,t,n,r,i,a,o,s){var c=new $r(e,t,n,r,i,a,o,s);if(this.curves.length>0){var l=c.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(c);var u=c.getPoint(1);return this.currentPoint.copy(u),this},copy:function(e){return hi.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=hi.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return hi.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),di.prototype=Object.assign(Object.create(pi.prototype),{constructor:di,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){pi.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(r.clone())}return this},toJSON:function(){var e=pi.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var r=this.holes[t];e.holes.push(r.toJSON())}return e},fromJSON:function(e){pi.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push((new pi).fromJSON(r))}return this}}),fi.prototype=Object.assign(Object.create(p.prototype),{constructor:fi,isLight:1,copy:function(e){return p.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=p.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),mi.prototype=Object.assign(Object.create(fi.prototype),{constructor:mi,isHemisphereLight:1,copy:function(e){return fi.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(gi.prototype,{_projScreenMatrix:new l,_lightPositionWorld:new c,_lookTarget:new c,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(e){var t=this.camera,n=this.matrix,r=this._projScreenMatrix,i=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(e.matrixWorld),t.position.copy(a),i.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(i),t.updateMatrixWorld(),r.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(r),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)},getViewport:function(e){return this._viewports[e]},getFrameExtents:function(){return this._frameExtents},copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(0).object,delete e.camera.matrix,e}}),vi.prototype=Object.assign(Object.create(gi.prototype),{constructor:vi,isSpotLightShadow:1,updateMatrices:function(e){var t=this.camera,n=2*Na.RAD2DEG*e.angle,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),gi.prototype.updateMatrices.call(this,e)}}),yi.prototype=Object.assign(Object.create(fi.prototype),{constructor:yi,isSpotLight:1,copy:function(e){return fi.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),xi.prototype=Object.assign(Object.create(gi.prototype),{constructor:xi,isPointLightShadow:1,updateMatrices:function(e,t){void 0===t&&(t=0);var n=this.camera,r=this.matrix,i=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;i.setFromMatrixPosition(e.matrixWorld),n.position.copy(i),a.copy(n.position),a.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(a),n.updateMatrixWorld(),r.makeTranslation(-i.x,-i.y,-i.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}}),bi.prototype=Object.assign(Object.create(fi.prototype),{constructor:bi,isPointLight:1,copy:function(e){return fi.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),wi.prototype=Object.assign(Object.create(X.prototype),{constructor:wi,isOrthographicCamera:1,copy:function(e,t){return X.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,r,i,a){null===this.view&&(this.view={enabled:1,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=1,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=0),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(null!==this.view&&this.view.enabled){var c=(this.right-this.left)/this.view.fullWidth/this.zoom,l=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a=(i+=c*this.view.offsetX)+c*this.view.width,s=(o-=l*this.view.offsetY)-l*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=p.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}),_i.prototype=Object.assign(Object.create(gi.prototype),{constructor:_i,isDirectionalLightShadow:1,updateMatrices:function(e){gi.prototype.updateMatrices.call(this,e)}}),Mi.prototype=Object.assign(Object.create(fi.prototype),{constructor:Mi,isDirectionalLight:1,copy:function(e){return fi.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Si.prototype=Object.assign(Object.create(fi.prototype),{constructor:Si,isAmbientLight:1}),Ti.prototype=Object.assign(Object.create(fi.prototype),{constructor:Ti,isRectAreaLight:1,copy:function(e){return fi.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=fi.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),Ei.prototype=Object.assign(Object.create(Gr.prototype),{constructor:Ei,load:function(e,t,n,r){var i=this,a=new jr(i.manager);a.setPath(i.path),a.load(e,(function(e){t(i.parse(JSON.parse(e)))}),n,r)},parse:function(e){function r(e){return void 0===a[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),a[e]}var a=this.textures,o=new Sc[e.type];if(void 0!==e.uuid&&(o.uuid=e.uuid),void 0!==e.name&&(o.name=e.name),void 0!==e.color&&o.color.setHex(e.color),void 0!==e.roughness&&(o.roughness=e.roughness),void 0!==e.metalness&&(o.metalness=e.metalness),void 0!==e.sheen&&(o.sheen=(new b).setHex(e.sheen)),void 0!==e.emissive&&o.emissive.setHex(e.emissive),void 0!==e.specular&&o.specular.setHex(e.specular),void 0!==e.shininess&&(o.shininess=e.shininess),void 0!==e.clearcoat&&(o.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(o.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.fog&&(o.fog=e.fog),void 0!==e.flatShading&&(o.flatShading=e.flatShading),void 0!==e.blending&&(o.blending=e.blending),void 0!==e.combine&&(o.combine=e.combine),void 0!==e.side&&(o.side=e.side),void 0!==e.opacity&&(o.opacity=e.opacity),void 0!==e.transparent&&(o.transparent=e.transparent),void 0!==e.alphaTest&&(o.alphaTest=e.alphaTest),void 0!==e.depthTest&&(o.depthTest=e.depthTest),void 0!==e.depthWrite&&(o.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(o.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(o.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(o.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(o.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(o.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(o.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(o.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(o.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(o.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(o.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(o.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(o.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(o.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(o.rotation=e.rotation),1!==e.linewidth&&(o.linewidth=e.linewidth),void 0!==e.dashSize&&(o.dashSize=e.dashSize),void 0!==e.gapSize&&(o.gapSize=e.gapSize),void 0!==e.scale&&(o.scale=e.scale),void 0!==e.polygonOffset&&(o.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(o.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(o.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(o.skinning=e.skinning),void 0!==e.morphTargets&&(o.morphTargets=e.morphTargets),void 0!==e.morphNormals&&(o.morphNormals=e.morphNormals),void 0!==e.dithering&&(o.dithering=e.dithering),void 0!==e.vertexTangents&&(o.vertexTangents=e.vertexTangents),void 0!==e.visible&&(o.visible=e.visible),void 0!==e.toneMapped&&(o.toneMapped=e.toneMapped),void 0!==e.userData&&(o.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?o.vertexColors=e.vertexColors>0?1:0:o.vertexColors=e.vertexColors),void 0!==e.uniforms)for(var s in e.uniforms){var u=e.uniforms[s];switch(o.uniforms[s]={},u.type){case"t":o.uniforms[s].value=r(u.value);break;case"c":o.uniforms[s].value=(new b).setHex(u.value);break;case"v2":o.uniforms[s].value=(new t).fromArray(u.value);break;case"v3":o.uniforms[s].value=(new c).fromArray(u.value);break;case"v4":o.uniforms[s].value=(new i).fromArray(u.value);break;case"m3":o.uniforms[s].value=(new n).fromArray(u.value);case"m4":o.uniforms[s].value=(new l).fromArray(u.value);break;default:o.uniforms[s].value=u.value}}if(void 0!==e.defines&&(o.defines=e.defines),void 0!==e.vertexShader&&(o.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(o.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var h in e.extensions)o.extensions[h]=e.extensions[h];if(void 0!==e.shading&&(o.flatShading=1===e.shading),void 0!==e.size&&(o.size=e.size),void 0!==e.sizeAttenuation&&(o.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(o.map=r(e.map)),void 0!==e.matcap&&(o.matcap=r(e.matcap)),void 0!==e.alphaMap&&(o.alphaMap=r(e.alphaMap)),void 0!==e.bumpMap&&(o.bumpMap=r(e.bumpMap)),void 0!==e.bumpScale&&(o.bumpScale=e.bumpScale),void 0!==e.normalMap&&(o.normalMap=r(e.normalMap)),void 0!==e.normalMapType&&(o.normalMapType=e.normalMapType),void 0!==e.normalScale){var p=e.normalScale;0==Array.isArray(p)&&(p=[p,p]),o.normalScale=(new t).fromArray(p)}return void 0!==e.displacementMap&&(o.displacementMap=r(e.displacementMap)),void 0!==e.displacementScale&&(o.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(o.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(o.roughnessMap=r(e.roughnessMap)),void 0!==e.metalnessMap&&(o.metalnessMap=r(e.metalnessMap)),void 0!==e.emissiveMap&&(o.emissiveMap=r(e.emissiveMap)),void 0!==e.emissiveIntensity&&(o.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(o.specularMap=r(e.specularMap)),void 0!==e.envMap&&(o.envMap=r(e.envMap)),void 0!==e.envMapIntensity&&(o.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(o.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(o.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(o.lightMap=r(e.lightMap)),void 0!==e.lightMapIntensity&&(o.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(o.aoMap=r(e.aoMap)),void 0!==e.aoMapIntensity&&(o.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(o.gradientMap=r(e.gradientMap)),void 0!==e.clearcoatMap&&(o.clearcoatMap=r(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(o.clearcoatRoughnessMap=r(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(o.clearcoatNormalMap=r(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(o.clearcoatNormalScale=(new t).fromArray(e.clearcoatNormalScale)),o},setTextures:function(e){return this.textures=e,this}});var Dc=function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)};Ai.prototype=Object.assign(Object.create(F.prototype),{constructor:Ai,isInstancedBufferGeometry:1,copy:function(e){return F.prototype.copy.call(this,e),this.maxInstancedCount=e.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e=F.prototype.toJSON.call(this);return e.maxInstancedCount=this.maxInstancedCount,e.isInstancedBufferGeometry=1,e}}),Li.prototype=Object.assign(Object.create(A.prototype),{constructor:Li,isInstancedBufferAttribute:1,copy:function(e){return A.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=A.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=1,e}}),Ci.prototype=Object.assign(Object.create(Gr.prototype),{constructor:Ci,load:function(e,t,n,r){var i=this,a=new jr(i.manager);a.setPath(i.path),a.load(e,(function(e){t(i.parse(JSON.parse(e)))}),n,r)},parse:function(e){var t=e.isInstancedBufferGeometry?new Ai:new F,n=e.data.index;if(void 0!==n){var r=new Ic[n.type](n.array);t.setIndex(new A(r,1))}var i=e.data.attributes;for(var a in i){var o=i[a],s=(r=new Ic[o.type](o.array),new(o.isInstancedBufferAttribute?Li:A)(r,o.itemSize,o.normalized));void 0!==o.name&&(s.name=o.name),t.setAttribute(a,s)}var l=e.data.morphAttributes;if(l)for(var a in l){for(var u=l[a],h=[],p=0,d=u.length;p<d;p++)o=u[p],s=new A(r=new Ic[o.type](o.array),o.itemSize,o.normalized),void 0!==o.name&&(s.name=o.name),h.push(s);t.morphAttributes[a]=h}e.data.morphTargetsRelative&&(t.morphTargetsRelative=1);var f=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==f){p=0;for(var m=f.length;p!==m;++p){var v=f[p];t.addGroup(v.start,v.count,v.materialIndex)}}var y=e.data.boundingSphere;if(void 0!==y){var x=new c;void 0!==y.center&&x.fromArray(y.center),t.boundingSphere=new g(x,y.radius)}return e.name&&(t.name=e.name),e.userData&&(t.userData=e.userData),t}});var Ic={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};Ri.prototype=Object.assign(Object.create(Gr.prototype),{constructor:Ri,load:function(e,t,n,r){var i=this,a=""===this.path?Dc(e):this.path;this.resourcePath=this.resourcePath||a;var o=new jr(i.manager);o.setPath(this.path),o.load(e,(function(n){var a=null;try{a=JSON.parse(n)}catch(t){return void 0!==r&&r(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}var o=a.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?i.parse(a,t):console.error("THREE.ObjectLoader: Can't load "+e)}),n,r)},parse:function(e,t){var n=this.parseShape(e.shapes),r=this.parseGeometries(e.geometries,n),i=this.parseImages(e.images,(function(){void 0!==t&&t(s)})),a=this.parseTextures(e.textures,i),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,r,o);return e.animations&&(s.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},parseShape:function(e){var t={};if(void 0!==e)for(var n=0,r=e.length;n<r;n++){var i=(new di).fromJSON(e[n]);t[i.uuid]=i}return t},parseGeometries:function(e,t){var n={};if(void 0!==e)for(var r=new Ci,i=0,a=e.length;i<a;i++){var o,s=e[i];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new Mc[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new Mc[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new Mc[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new Mc[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new Mc[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new Mc[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":o=new Mc[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new Mc[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new Mc[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new Mc[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new Mc[s.type]((new Nc[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new Mc[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new Mc[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var c=[],l=0,u=s.shapes.length;l<u;l++){var h=t[s.shapes[l]];c.push(h)}o=new Mc[s.type](c,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(c=[],l=0,u=s.shapes.length;l<u;l++)h=t[s.shapes[l]],c.push(h);var p=s.options.extrudePath;void 0!==p&&(s.options.extrudePath=(new Nc[p.type]).fromJSON(p)),o=new Mc[s.type](c,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=r.parse(s);break;case"Geometry":console.error('THREE.ObjectLoader: Loading "Geometry" is not supported anymore.');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),1==o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}return n},parseMaterials:function(e,t){var n={},r={};if(void 0!==e){var i=new Ei;i.setTextures(t);for(var a=0,o=e.length;a<o;a++){var s=e[a];if("MultiMaterial"===s.type){for(var c=[],l=0;l<s.materials.length;l++){var u=s.materials[l];void 0===n[u.uuid]&&(n[u.uuid]=i.parse(u)),c.push(n[u.uuid])}r[s.uuid]=c}else void 0===n[s.uuid]&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=Fr.parse(r);void 0!==r.uuid&&(i.uuid=r.uuid),t.push(i)}return t},parseImages:function(e,t){function n(e){return r.manager.itemStart(e),a.load(e,(function(){r.manager.itemEnd(e)}),void 0,(function(){r.manager.itemError(e),r.manager.itemEnd(e)}))}var r=this,i={};if(void 0!==e&&e.length>0){var a=new Xr(new kr(t));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=e.length;o<s;o++){var c=e[o],l=c.url;if(Array.isArray(l)){i[c.uuid]=[];for(var u=0,h=l.length;u<h;u++){var p=l[u],d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(p)?p:r.resourcePath+p;i[c.uuid].push(n(d))}}else d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:r.resourcePath+c.url,i[c.uuid]=n(d)}}return i},parseTextures:function(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var i={};if(void 0!==e)for(var a=0,o=e.length;a<o;a++){var s,c=e[a];void 0===c.image&&console.warn('THREE.ObjectLoader: No "image" specified for',c.uuid),void 0===t[c.image]&&console.warn("THREE.ObjectLoader: Undefined image",c.image),(s=Array.isArray(t[c.image])?new fe(t[c.image]):new r(t[c.image])).needsUpdate=1,s.uuid=c.uuid,void 0!==c.name&&(s.name=c.name),void 0!==c.mapping&&(s.mapping=n(c.mapping,Bc)),void 0!==c.offset&&s.offset.fromArray(c.offset),void 0!==c.repeat&&s.repeat.fromArray(c.repeat),void 0!==c.center&&s.center.fromArray(c.center),void 0!==c.rotation&&(s.rotation=c.rotation),void 0!==c.wrap&&(s.wrapS=n(c.wrap[0],Uc),s.wrapT=n(c.wrap[1],Uc)),void 0!==c.format&&(s.format=c.format),void 0!==c.type&&(s.type=c.type),void 0!==c.encoding&&(s.encoding=c.encoding),void 0!==c.minFilter&&(s.minFilter=n(c.minFilter,Fc)),void 0!==c.magFilter&&(s.magFilter=n(c.magFilter,Fc)),void 0!==c.anisotropy&&(s.anisotropy=c.anisotropy),void 0!==c.flipY&&(s.flipY=c.flipY),void 0!==c.premultiplyAlpha&&(s.premultiplyAlpha=c.premultiplyAlpha),void 0!==c.unpackAlignment&&(s.unpackAlignment=c.unpackAlignment),i[c.uuid]=s}return i},parseObject:function(e,t,n){function r(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function i(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],r=0,i=e.length;r<i;r++){var a=e[r];void 0===n[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),t.push(n[a])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}var a;switch(e.type){case"Scene":a=new d,void 0!==e.background&&Number.isInteger(e.background)&&(a.background=new b(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?a.fog=new Ft(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(a.fog=new Ut(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":a=new Y(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(a.focus=e.focus),void 0!==e.zoom&&(a.zoom=e.zoom),void 0!==e.filmGauge&&(a.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(a.filmOffset=e.filmOffset),void 0!==e.view&&(a.view=Object.assign({},e.view));break;case"OrthographicCamera":a=new wi(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(a.zoom=e.zoom),void 0!==e.view&&(a.view=Object.assign({},e.view));break;case"AmbientLight":a=new Si(e.color,e.intensity);break;case"DirectionalLight":a=new Mi(e.color,e.intensity);break;case"PointLight":a=new bi(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":a=new Ti(e.color,e.intensity,e.width,e.height);break;case"SpotLight":a=new yi(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":a=new mi(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":a=new H(o=r(e.geometry),s=i(e.material));break;case"InstancedMesh":var o=r(e.geometry),s=i(e.material),c=e.count,l=e.instanceMatrix;(a=new Zt(o,s,c)).instanceMatrix=new A(new Float32Array(l.array),16);break;case"LOD":a=new Wt;break;case"Line":a=new $t(r(e.geometry),i(e.material),e.mode);break;case"LineLoop":a=new Kt(r(e.geometry),i(e.material));break;case"LineSegments":a=new Qt(r(e.geometry),i(e.material));break;case"PointCloud":case"Points":a=new tn(r(e.geometry),i(e.material));break;case"Sprite":a=new jt(i(e.material));break;case"Group":a=new It;break;default:a=new p}if(a.uuid=e.uuid,void 0!==e.name&&(a.name=e.name),void 0!==e.matrix?(a.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(void 0!==e.position&&a.position.fromArray(e.position),void 0!==e.rotation&&a.rotation.fromArray(e.rotation),void 0!==e.quaternion&&a.quaternion.fromArray(e.quaternion),void 0!==e.scale&&a.scale.fromArray(e.scale)),void 0!==e.castShadow&&(a.castShadow=e.castShadow),void 0!==e.receiveShadow&&(a.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(a.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(a.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&a.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(a.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(a.visible=e.visible),void 0!==e.frustumCulled&&(a.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(a.renderOrder=e.renderOrder),void 0!==e.userData&&(a.userData=e.userData),void 0!==e.layers&&(a.layers.mask=e.layers),void 0!==e.children)for(var u=e.children,h=0;h<u.length;h++)a.add(this.parseObject(u[h],t,n));if("LOD"===e.type){void 0!==e.autoUpdate&&(a.autoUpdate=e.autoUpdate);for(var f=e.levels,m=0;m<f.length;m++){var g=f[m],v=a.getObjectByProperty("uuid",g.object);void 0!==v&&a.addLevel(v,g.distance)}}return a}});var zc,Bc={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},Uc={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},Fc={NearestFilter:1003,NearestMipmapNearestFilter:1004,NearestMipmapLinearFilter:1005,LinearFilter:1006,LinearMipmapNearestFilter:1007,LinearMipmapLinearFilter:1008};Pi.prototype=Object.assign(Object.create(Gr.prototype),{constructor:Pi,setOptions:function(e){return this.options=e,this},load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Ec.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;fetch(e).then((function(e){return e.blob()})).then((function(e){return void 0===i.options?createImageBitmap(e):createImageBitmap(e,i.options)})).then((function(n){Ec.add(e,n),t&&t(n),i.manager.itemEnd(e)})).catch((function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)})),i.manager.itemStart(e)}}),Object.assign(Oi.prototype,{moveTo:function(e,t){return this.currentPath=new pi,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this},lineTo:function(e,t){return this.currentPath.lineTo(e,t),this},quadraticCurveTo:function(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this},bezierCurveTo:function(e,t,n,r,i,a){return this.currentPath.bezierCurveTo(e,t,n,r,i,a),this},splineThru:function(e){return this.currentPath.splineThru(e),this},toShapes:function(e,t){function n(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n],a=new di;a.curves=i.curves,t.push(a)}return t}function r(e,t){for(var n=t.length,r=0,i=n-1,a=0;a<n;i=a++){var o=t[i],s=t[a],c=s.x-o.x,l=s.y-o.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(o=t[a],c=-c,s=t[i],l=-l),e.y<o.y||e.y>s.y)continue;if(e.y===o.y){if(e.x===o.x)return 1}else{var u=l*(e.x-o.x)-c*(e.y-o.y);if(0===u)return 1;if(u<0)continue;r=!r}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return 1}}return r}var i=wc.isClockWise,a=this.subPaths;if(0===a.length)return[];if(1==t)return n(a);var o,s,c,l=[];if(1===a.length)return s=a[0],(c=new di).curves=s.curves,l.push(c),l;var u=!i(a[0].getPoints());u=e?!u:u;var h,p,d=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var v=0,y=a.length;v<y;v++)o=i(h=(s=a[v]).getPoints()),(o=e?!o:o)?(!u&&f[g]&&g++,f[g]={s:new di,p:h},f[g].s.curves=s.curves,u&&g++,m[g]=[]):m[g].push({h:s,p:h[0]});if(!f[0])return n(a);if(f.length>1){for(var x=0,b=[],w=0,_=f.length;w<_;w++)d[w]=[];for(w=0,_=f.length;w<_;w++)for(var M=m[w],S=0;S<M.length;S++){for(var T=M[S],E=1,A=0;A<f.length;A++)r(T.p,f[A].p)&&(w!==A&&b.push({froms:w,tos:A,hole:S}),E?(E=0,d[A].push(T)):x=1);E&&d[w].push(T)}b.length>0&&(x||(m=d))}v=0;for(var L=f.length;v<L;v++){c=f[v].s,l.push(c);for(var C=0,R=(p=m[v]).length;C<R;C++)c.holes.push(p[C].h)}return l}}),Object.assign(Ni.prototype,{isFont:1,generateShapes:function(e,t){void 0===t&&(t=100);for(var n=[],r=function(e,t,n){for(var r=Array.from?Array.from(e):(e+"").split(""),i=t/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,o=[],s=0,c=0,l=0;l<r.length;l++){var u=r[l];if("\n"===u)s=0,c-=a;else{var h=Di(u,i,s,c,n);s+=h.offsetX,o.push(h.path)}}return o}(e,t,this.data),i=0,a=r.length;i<a;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}}),Ii.prototype=Object.assign(Object.create(Gr.prototype),{constructor:Ii,load:function(e,t,n,r){var i=this,a=new jr(this.manager);a.setPath(this.path),a.load(e,(function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var r=i.parse(n);t&&t(r)}),n,r)},parse:function(e){return new Ni(e)}});var Hc=function(){return void 0===zc&&(zc=new(window.AudioContext||window.webkitAudioContext)),zc};zi.prototype=Object.assign(Object.create(Gr.prototype),{constructor:zi,load:function(e,t,n,r){var i=new jr(this.manager);i.setResponseType("arraybuffer"),i.setPath(this.path),i.load(e,(function(e){var n=e.slice(0);Hc().decodeAudioData(n,(function(e){t(e)}))}),n,r)}}),Object.assign(Bi.prototype,{isSphericalHarmonics3:1,set:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this},zero:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this},getAt:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*r),t.addScaledVector(a[2],.488603*i),t.addScaledVector(a[3],.488603*n),t.addScaledVector(a[4],n*r*1.092548),t.addScaledVector(a[5],r*i*1.092548),t.addScaledVector(a[6],.315392*(3*i*i-1)),t.addScaledVector(a[7],n*i*1.092548),t.addScaledVector(a[8],.546274*(n*n-r*r)),t},getIrradianceAt:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],1.023328*r),t.addScaledVector(a[2],1.023328*i),t.addScaledVector(a[3],1.023328*n),t.addScaledVector(a[4],.858086*n*r),t.addScaledVector(a[5],.858086*r*i),t.addScaledVector(a[6],.743125*i*i-.247708),t.addScaledVector(a[7],.858086*n*i),t.addScaledVector(a[8],.429043*(n*n-r*r)),t},add:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this},addScaledSH:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this},scale:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this},lerp:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this},equals:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return 0;return 1},copy:function(e){return this.set(e.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(e,t){void 0===t&&(t=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}}),Object.assign(Bi,{getBasisAt:function(e,t){var n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}),Ui.prototype=Object.assign(Object.create(fi.prototype),{constructor:Ui,isLightProbe:1,copy:function(e){return fi.prototype.copy.call(this,e),this.sh.copy(e.sh),this.intensity=e.intensity,this},toJSON:function(e){return fi.prototype.toJSON.call(this,e)}}),Fi.prototype=Object.assign(Object.create(Ui.prototype),{constructor:Fi,isHemisphereLightProbe:1,copy:function(e){return Ui.prototype.copy.call(this,e),this},toJSON:function(e){return Ui.prototype.toJSON.call(this,e)}}),Hi.prototype=Object.assign(Object.create(Ui.prototype),{constructor:Hi,isAmbientLightProbe:1,copy:function(e){return Ui.prototype.copy.call(this,e),this},toJSON:function(e){return Ui.prototype.toJSON.call(this,e)}});var kc=new l,Gc=new l;Object.assign(function(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Y,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=0,this.cameraR=new Y,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=0,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}.prototype,{update:function(e){var t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;var n,r,i=e.projectionMatrix.clone(),a=t.eyeSep/2,o=a*t.near/t.focus,s=t.near*Math.tan(Na.DEG2RAD*t.fov*.5)/t.zoom;Gc.elements[12]=-a,kc.elements[12]=a,n=-s*t.aspect+o,r=s*t.aspect+o,i.elements[0]=2*t.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraL.projectionMatrix.copy(i),n=-s*t.aspect-o,r=s*t.aspect-o,i.elements[0]=2*t.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Gc),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(kc)}}),Object.assign(ki.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=1},stop:function(){this.getElapsedTime(),this.running=0,this.autoStart=0},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}});var jc=new c,Vc=new s,Wc=new c,qc=new c;Gi.prototype=Object.assign(Object.create(p.prototype),{constructor:Gi,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(e){p.prototype.updateMatrixWorld.call(this,e);var t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(jc,Vc,Wc),qc.set(0,0,-1).applyQuaternion(Vc),t.positionX){var r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(jc.x,r),t.positionY.linearRampToValueAtTime(jc.y,r),t.positionZ.linearRampToValueAtTime(jc.z,r),t.forwardX.linearRampToValueAtTime(qc.x,r),t.forwardY.linearRampToValueAtTime(qc.y,r),t.forwardZ.linearRampToValueAtTime(qc.z,r),t.upX.linearRampToValueAtTime(n.x,r),t.upY.linearRampToValueAtTime(n.y,r),t.upZ.linearRampToValueAtTime(n.z,r)}else t.setPosition(jc.x,jc.y,jc.z),t.setOrientation(qc.x,qc.y,qc.z,n.x,n.y,n.z)}}),ji.prototype=Object.assign(Object.create(p.prototype),{constructor:ji,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=0,this.sourceType="audioNode",this.source=e,this.connect(),this},setMediaElementSource:function(e){return this.hasPlaybackControl=0,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this},setMediaStreamSource:function(e){return this.hasPlaybackControl=0,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(e){if(void 0===e&&(e=0),1!=this.isPlaying){if(0!=this.hasPlaybackControl){this._startedAt=this.context.currentTime+e;var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._pausedAt+this.offset,this.duration),this.isPlaying=1,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(0!=this.hasPlaybackControl)return 1==this.isPlaying&&(this._pausedAt+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.source.stop(),this.source.onended=null,this.isPlaying=0),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(0!=this.hasPlaybackControl)return this._pausedAt=0,this.source.stop(),this.source.onended=null,this.isPlaying=0,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e||(e=[]),1==this.isPlaying?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},setDetune:function(e){if(this.detune=e,void 0!==this.source.detune)return 1==this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(0!=this.hasPlaybackControl)return this.playbackRate=e,1==this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=0},getLoop:function(){return 0==this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),0):this.loop},setLoop:function(e){if(0!=this.hasPlaybackControl)return this.loop=e,1==this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},setLoopStart:function(e){return this.loopStart=e,this},setLoopEnd:function(e){return this.loopEnd=e,this},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}});var Xc=new c,Yc=new s,Zc=new c,Jc=new c;Vi.prototype=Object.assign(Object.create(ji.prototype),{constructor:Vi,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){return this.panner.refDistance=e,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){return this.panner.rolloffFactor=e,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){return this.panner.distanceModel=e,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){return this.panner.maxDistance=e,this},setDirectionalCone:function(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(e){if(p.prototype.updateMatrixWorld.call(this,e),1!=this.hasPlaybackControl||0!=this.isPlaying){this.matrixWorld.decompose(Xc,Yc,Zc),Jc.set(0,0,1).applyQuaternion(Yc);var t=this.panner;if(t.positionX){var n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(Xc.x,n),t.positionY.linearRampToValueAtTime(Xc.y,n),t.positionZ.linearRampToValueAtTime(Xc.z,n),t.orientationX.linearRampToValueAtTime(Jc.x,n),t.orientationY.linearRampToValueAtTime(Jc.y,n),t.orientationZ.linearRampToValueAtTime(Jc.z,n)}else t.setPosition(Xc.x,Xc.y,Xc.z),t.setOrientation(Jc.x,Jc.y,Jc.z)}}}),Object.assign(Wi.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),Object.assign(qi.prototype,{accumulate:function(e,t){var n=this.buffer,r=this.valueSize,i=e*r+r,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==r;++o)n[i+o]=n[o];a=t}else{var s=t/(a+=t);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=a},apply:function(e){var t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,i<1){var o=3*t;this._mixBufferRegion(n,r,o,1-i,t)}for(var s=t,c=t+t;s!==c;++s)if(n[s]!==n[s+t]){a.setValue(n,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=3*n;e.getValue(t,r);for(var i=n,a=r;i!==a;++i)t[i]=t[r+i%n];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,n,r,i){if(r>=.5)for(var a=0;a!==i;++a)e[t+a]=e[n+a]},_slerp:function(e,t,n,r){s.slerpFlat(e,t,e,t,e,n,r)},_lerp:function(e,t,n,r,i){for(var a=1-r,o=0;o!==i;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*r}}});var $c=/[\[\]\.:\/]/g,Qc=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Kc=/(WCOD+)?/.source.replace("WCOD","[^\\[\\]:\\/]"),el=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),tl=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),nl=RegExp("^"+Qc+Kc+el+tl+"$"),rl=["material","materials","bones"];Object.assign(Xi.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(Yi,{Composite:Xi,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new Yi.Composite(e,t,n):new Yi(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace($c,"")},parseTrackName:function(e){var t=nl.exec(e);if(!t)throw Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==rl.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var r=function(e){for(var n=0;n<e.length;n++){var i=e[n];if(i.name===t||i.uuid===t)return i;var a=r(i.children);if(a)return a}return null},i=r(e.children);if(i)return i}return null}}),Object.assign(Yi.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)e[t++]=n[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=1},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=1}],[function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=1},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=1}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=1},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=1}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=1},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=1}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=Yi.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var a=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var o=0;o<e.length;o++)if(e[o].name===a){a=o;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==a){if(void 0===e[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[a]}}var s=e[r];if(void 0!==s){var c=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?c=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate);var l=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(e.geometry.morphAttributes.position[o].name===i){i=o;break}}else{if(!e.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(o=0;o<this.node.geometry.morphTargets.length;o++)if(e.geometry.morphTargets[o].name===i){i=o;break}}}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][c]}else{var u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+r+" but it wasn't found.",e)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Yi.prototype,{_getValue_unbound:Yi.prototype.getValue,_setValue_unbound:Yi.prototype.setValue}),Object.assign(function(){this.uuid=Na.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}.prototype,{isAnimationObjectGroup:1,add:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,c=void 0,l=0,u=arguments.length;l!==u;++l){var h=arguments[l],p=h.uuid,d=r[p];if(void 0===d){d=t++,r[p]=d,e.push(h);for(var f=0,m=s;f!==m;++f)o[f].push(new Yi(h,i[f],a[f]))}else if(d<n){c=e[d];var g=--n,v=e[g];for(r[v.uuid]=d,e[d]=v,r[p]=g,e[g]=h,f=0,m=s;f!==m;++f){var y=o[f],x=y[g],b=y[d];y[d]=x,void 0===b&&(b=new Yi(h,i[f],a[f])),y[g]=b}}else e[d]!==c&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var e=this._objects,t=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,i=r.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],c=s.uuid,l=n[c];if(void 0!==l&&l>=t){var u=t++,h=e[u];n[h.uuid]=l,e[l]=h,n[c]=u,e[u]=s;for(var p=0,d=i;p!==d;++p){var f=r[p],m=f[u],g=f[l];f[l]=m,f[u]=g}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,a=i.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o],l=c.uuid,u=r[l];if(void 0!==u)if(delete r[l],u<n){var h=--n,p=e[h],d=e[y=--t];r[p.uuid]=u,e[u]=p,r[d.uuid]=h,e[h]=d,e.pop();for(var f=0,m=a;f!==m;++f){var g=(x=i[f])[h],v=x[y];x[u]=g,x[h]=v,x.pop()}}else{var y;for(r[(d=e[y=--t]).uuid]=u,e[u]=d,e.pop(),f=0,m=a;f!==m;++f){var x;(x=i[f])[u]=x[y],x.pop()}}}this.nCachedObjects_=n},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(void 0!==r)return i[r];var a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,u=Array(c);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(var h=l,p=s.length;h!==p;++h){var d=s[h];u[h]=new Yi(d,e,t)}return u},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}}),Object.assign(Zi.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=0,this.enabled=1,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var r=this._clip.duration,i=e._clip.duration,a=i/r,o=r/i;e.warp(1,a,t),this.warp(o,1,t)}return this},crossFadeTo:function(e,t,n){return e.crossFadeFrom(this,t,n)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,n){var r=this._mixer,i=r.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,c=a.sampleValues;return s[0]=i,s[1]=i+n,c[0]=e/o,c[1]=t/o,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var a=(e-i)*n;if(a<0||0===n)return;this._startTime=null,t=n*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(s>0)for(var c=this._interpolants,l=this._propertyBindings,u=0,h=c.length;u!==h;++u)c[u].evaluate(o),l[u].accumulate(r,s)}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=0))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;null!==n&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=1:this.timeScale=t))}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e,n=this._clip.duration,r=this.loop,i=this._loopCount,a=2202===r;if(0===e)return-1===i?t:a&&1==(1&i)?n-t:t;if(2200===r){-1===i&&(this._loopCount=0,this._setEndings(1,1,0));e:{if(t>=n)t=n;else{if(!(t<0)){this.time=t;break e}t=0}this.clampWhenFinished?this.paused=1:this.enabled=0,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(1,0===this.repetitions,a)):this._setEndings(0===this.repetitions,1,a)),t>=n||t<0){var o=Math.floor(t/n);t-=n*o,i+=Math.abs(o);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=1:this.enabled=0,t=e>0?n:0,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var c=e<0;this._setEndings(c,!c,a)}else this._setEndings(0,0,a);this._loopCount=i,this.time=t,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=t;if(a&&1==(1&i))return n-t}return t},_setEndings:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(e,t,n){var r=this._mixer,i=r.time,a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}}),Ji.prototype=Object.assign(Object.create(e.prototype),{constructor:Ji,_bindAction:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];void 0===l&&(l={},c[s]=l);for(var u=0;u!==i;++u){var h=r[u],p=h.name,d=l[p];if(void 0!==d)a[u]=d;else{if(void 0!==(d=a[u])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=t&&t._propertyBindings[u].binding.parsedPath;++(d=new qi(Yi.create(n,p,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(d,s,p),a[u]=d}o[u].resultBuffer=d.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}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){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var r=this._actions,i=this._actionsByClip,a=i[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=a;else{var o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;var i=e._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,c=s[s.length-1],l=e._byClipCacheIndex;c._byClipCacheIndex=l,s[l]=c,s.pop(),e._byClipCacheIndex=null,delete o.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_addInactiveBinding:function(e,t,n){var r=this._bindingsByRootAndName,i=r[t],a=this._bindings;void 0===i&&(i={},r[t]=i),i[n]=e,e._cacheIndex=a.length,a.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=t[t.length-1],c=e._cacheIndex;s._cacheIndex=c,t[c]=s,t.pop(),delete o[i],0===Object.keys(o).length&&delete a[r]},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&((n=new Cr(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=t,e[t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?Fr.findByName(n,e):e,a=null!==i?i.uuid:e,o=this._actionsByClip[a],s=null;if(void 0!==o){var c=o.actionByRoot[r];if(void 0!==c)return c;s=o.knownActions[0],null===i&&(i=s._clip)}if(null===i)return null;var l=new Zi(this,i,t);return this._bindAction(l,s),this._addInactiveAction(l,a,r),l},existingAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?Fr.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[r]||null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,n=this._bindings,r=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var i=0;i!==t;++i)e[i].reset();for(i=0;i!==r;++i)n[i].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1,o=0;o!==n;++o)t[o]._update(r,e,i,a);var s=this._bindings,c=this._nActiveBindings;for(o=0;o!==c;++o)s[o].apply(a);return this},setTime:function(e){this.time=0;for(var t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var a=i.knownActions,o=0,s=a.length;o!==s;++o){var c=a[o];this._deactivateAction(c);var l=c._cacheIndex,u=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,u._cacheIndex=l,t[l]=u,t.pop(),this._removeInactiveBindingsForAction(c)}delete r[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot[t];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}var a=this._bindingsByRootAndName[t];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),$i.prototype.clone=function(){return new $i(void 0===this.value.clone?this.value:this.value.clone())},Qi.prototype=Object.assign(Object.create(Ht.prototype),{constructor:Qi,isInstancedInterleavedBuffer:1,copy:function(e){return Ht.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Object.assign(Ki.prototype,{set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t,n){var r=n||[];return ta(e,this,r,t),r.sort(ea),r},intersectObjects:function(e,t,n){var r=n||[];if(0==Array.isArray(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,a=e.length;i<a;i++)ta(e[i],this,r,t);return r.sort(ea),r}}),Object.assign(function(e,t,n){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==n?n:0,this}.prototype,{set:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Na.clamp(t/this.radius,-1,1))),this}}),Object.assign(function(e,t,n){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==n?n:0,this}.prototype,{set:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}});var il=new t;Object.assign(na.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=il.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new t),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new t),this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y?0:1},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,n){return void 0===n&&(console.warn("THREE.Box2: .getParameter() target is now required"),n=new t),n.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.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y?0:1},clampPoint:function(e,n){return void 0===n&&(console.warn("THREE.Box2: .clampPoint() target is now required"),n=new t),n.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return il.copy(e).clamp(this.min,this.max).sub(e).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)}});var al=new c,ol=new c;Object.assign(ra.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 c),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 c),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 c),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){al.subVectors(e,this.start),ol.subVectors(this.end,this.start);var n=ol.dot(ol),r=ol.dot(al)/n;return t&&(r=Na.clamp(r,0,1)),r},closestPointToPoint:function(e,t,n){var r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new c),this.delta(n).multiplyScalar(r).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)}}),ia.prototype=Object.create(p.prototype),ia.prototype.constructor=ia,ia.prototype.isImmediateRenderObject=1;var sl=new c;aa.prototype=Object.create(p.prototype),aa.prototype.constructor=aa,aa.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},aa.prototype.update=function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),sl.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(sl),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var cl=new c,ll=new l,ul=new l;oa.prototype=Object.create(Qt.prototype),oa.prototype.constructor=oa,oa.prototype.isSkeletonHelper=1,oa.prototype.updateMatrixWorld=function(e){var t=this.bones,n=this.geometry,r=n.getAttribute("position");ul.getInverse(this.root.matrixWorld);for(var i=0,a=0;i<t.length;i++){var o=t[i];o.parent&&o.parent.isBone&&(ll.multiplyMatrices(ul,o.matrixWorld),cl.setFromMatrixPosition(ll),r.setXYZ(a,cl.x,cl.y,cl.z),ll.multiplyMatrices(ul,o.parent.matrixWorld),cl.setFromMatrixPosition(ll),r.setXYZ(a+1,cl.x,cl.y,cl.z),a+=2)}n.getAttribute("position").needsUpdate=1,p.prototype.updateMatrixWorld.call(this,e)},sa.prototype=Object.create(H.prototype),sa.prototype.constructor=sa,sa.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},sa.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var hl=new c,pl=new b,dl=new b;ca.prototype=Object.create(p.prototype),ca.prototype.constructor=ca,ca.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},ca.prototype.update=function(){var e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var t=e.geometry.getAttribute("color");pl.copy(this.light.color),dl.copy(this.light.groundColor);for(var n=0,r=t.count;n<r;n++){var i=n<r/2?pl:dl;t.setXYZ(n,i.r,i.g,i.b)}t.needsUpdate=1}e.lookAt(hl.setFromMatrixPosition(this.light.matrixWorld).negate())},la.prototype=Object.assign(Object.create(Qt.prototype),{constructor:la,copy:function(e){return Qt.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return(new this.constructor).copy(this)}}),ua.prototype=Object.create(Qt.prototype),ua.prototype.constructor=ua;var fl=new c,ml=new c,gl=new c;ha.prototype=Object.create(p.prototype),ha.prototype.constructor=ha,ha.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},ha.prototype.update=function(){fl.setFromMatrixPosition(this.light.matrixWorld),ml.setFromMatrixPosition(this.light.target.matrixWorld),gl.subVectors(ml,fl),this.lightPlane.lookAt(ml),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(ml),this.targetLine.scale.z=gl.length()};var vl=new c,yl=new X;pa.prototype=Object.create(Qt.prototype),pa.prototype.constructor=pa,pa.prototype.update=function(){var e=this.geometry,t=this.pointMap;yl.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),da("c",t,e,yl,0,0,-1),da("t",t,e,yl,0,0,1),da("n1",t,e,yl,-1,-1,-1),da("n2",t,e,yl,1,-1,-1),da("n3",t,e,yl,-1,1,-1),da("n4",t,e,yl,1,1,-1),da("f1",t,e,yl,-1,-1,1),da("f2",t,e,yl,1,-1,1),da("f3",t,e,yl,-1,1,1),da("f4",t,e,yl,1,1,1),da("u1",t,e,yl,.7,1.1,-1),da("u2",t,e,yl,-.7,1.1,-1),da("u3",t,e,yl,0,2,-1),da("cf1",t,e,yl,-1,0,1),da("cf2",t,e,yl,1,0,1),da("cf3",t,e,yl,0,-1,1),da("cf4",t,e,yl,0,1,1),da("cn1",t,e,yl,-1,0,-1),da("cn2",t,e,yl,1,0,-1),da("cn3",t,e,yl,0,-1,-1),da("cn4",t,e,yl,0,1,-1),e.getAttribute("position").needsUpdate=1};var xl=new f;fa.prototype=Object.create(Qt.prototype),fa.prototype.constructor=fa,fa.prototype.update=function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&xl.setFromObject(this.object),!xl.isEmpty()){var t=xl.min,n=xl.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=1,this.geometry.computeBoundingSphere()}},fa.prototype.setFromObject=function(e){return this.object=e,this.update(),this},fa.prototype.copy=function(e){return Qt.prototype.copy.call(this,e),this.object=e.object,this},fa.prototype.clone=function(){return(new this.constructor).copy(this)},ma.prototype=Object.create(Qt.prototype),ma.prototype.constructor=ma,ma.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),p.prototype.updateMatrixWorld.call(this,e))},ga.prototype=Object.create($t.prototype),ga.prototype.constructor=ga,ga.prototype.updateMatrixWorld=function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?1:0,this.lookAt(this.plane.normal),p.prototype.updateMatrixWorld.call(this,e)};var bl,wl,_l=new c;va.prototype=Object.create(p.prototype),va.prototype.constructor=va,va.prototype.setDirection=function(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{_l.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(_l,t)}},va.prototype.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},va.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},va.prototype.copy=function(e){return p.prototype.copy.call(this,e,0),this.line.copy(e.line),this.cone.copy(e.cone),this},va.prototype.clone=function(){return(new this.constructor).copy(this)},ya.prototype=Object.create(Qt.prototype),ya.prototype.constructor=ya;var Ml=[.125,.215,.35,.446,.526,.582],Sl=5+Ml.length,Tl={3e3:0,3001:1,3002:2,3004:3,3005:4,3006:5,3007:6},{_lodPlanes:El,_sizeLods:Al,_sigmas:Ll}=(new wi,new yr({defines:{n:20},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(20)},latitudinal:{value:0},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new c(0,1,0)},inputEncoding:{value:Tl[3e3]},outputEncoding:{value:Tl[3e3]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t\n\n#define ENVMAP_TYPE_CUBE_UV\n#include <cube_uv_reflection_fragment>\n\nvec3 getSample(float theta, vec3 axis) {\n\tfloat cosTheta = cos(theta);\n\t// Rodrigues' axis-angle rotation\n\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\treturn bilinearCubeUV(envMap, sampleDirection, mipInt);\n}\n\nvoid main() {\n\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\tif (all(equal(axis, vec3(0.0))))\n\t\taxis = vec3(vOutputDirection.z, 0.0, - vOutputDirection.x);\n\taxis = normalize(axis);\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb += weights[0] * getSample(0.0, axis);\n\tfor (int i = 1; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfloat theta = dTheta * float(i);\n\t\tgl_FragColor.rgb += weights[i] * getSample(-1.0 * theta, axis);\n\t\tgl_FragColor.rgb += weights[i] * getSample(theta, axis);\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:0,depthTest:0,depthWrite:0}).type="SphericalGaussianBlur",function(){for(var e=[],t=[],n=[],r=8,i=0;i<Sl;i++){t.push(256);var a=1/256;i>4?a=Ml[i-8+4-1]:0==i&&(a=0),n.push(a);for(var o=-1/255/2,s=1+1/255/2,c=[o,o,s,o,s,s,o,o,s,s,o,s],l=new Float32Array(108),u=new Float32Array(72),h=new Float32Array(36),p=0;p<6;p++){var d=-1,f=[d,-1,0,d+2/3,-1,0,d+2/3,0,0,d,-1,0,d+2/3,0,0,d,0,0];l.set(f,18*p),u.set(c,12*p);var m=[p,p,p,p,p,p];h.set(m,6*p)}var g=new F;g.setAttribute("position",new A(l,3)),g.setAttribute("uv",new A(u,2)),g.setAttribute("faceIndex",new A(h,1)),e.push(g),r>4&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}());Jr.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Jr.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(hi.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new j,n=0,r=e.length;n<r;n++){var i=e[n];t.vertices.push(new c(i.x,i.y,i.z||0))}return t}}),Object.assign(pi.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),xa.prototype=Object.create(ei.prototype),Object.assign(xa.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),la.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},oa.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(Gr.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Dc(e)}}),Gr.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(Ri.prototype,{setTexturePath:function(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}),Object.assign(na.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(f.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Q.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},ra.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(Na,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),Na.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),Na.ceilPowerOfTwo(e)}}),Object.assign(n.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(l.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new c).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,a)}}),y.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},s.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(v.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(x.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(x,{barycoordFromPoint:function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),x.getBarycoord(e,t,n,r,i)},normal:function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),x.getNormal(e,t,n,r)}}),Object.assign(di.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Jn(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new sr(this,e)}}),Object.assign(t.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(c.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(i.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(j.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.assign(p.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(p.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(H.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(H.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(Wt.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Xt.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),qt.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Jr.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),Y.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(fi.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(A.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),35048===this.usage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),Object.assign(A.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(1==e?35048:35044),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(F.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t,n){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new A(t,n)))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(F.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Ki.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(e){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=e}}}),Object.defineProperties(Ht.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),35048===this.usage},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(Ht.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(1==e?35048:35044),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign($n.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties($i.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(T.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new b}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(wr.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),0},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(q.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(Bt.prototype,{clearTarget:function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(Bt.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),0},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),0},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=1==e?3001:3e3}}}),Object.defineProperties(Rt.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(a.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(ji.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new zi).load(e,(function(e){t.setBuffer(e)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Wi.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Z.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},Da.crossOrigin=void 0,Da.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new Zr;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},Da.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new Yr;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},Da.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Da.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"115"}}));var Cl,Rl,Pl=function(){};Pl.prototype={constructor:Pl,parse:(Cl=new c,Rl=new n,function(e,t){void 0===t&&(t={});var n=void 0!==t.binary?t.binary:0,r=[],i=0;if(e.traverse((function(e){if(e.isMesh){var t=e.geometry;t.isBufferGeometry&&(t=(new j).fromBufferGeometry(t)),t.isGeometry&&(i+=t.faces.length,r.push({geometry:t,matrixWorld:e.matrixWorld}))}})),n){var a=80,o=new ArrayBuffer(2*i+3*i*4*4+80+4);(v=new DataView(o)).setUint32(a,i,1),a+=4;for(var s=0,c=r.length;s<c;s++){var l=(y=r[s]).geometry.vertices,u=y.geometry.faces,h=y.matrixWorld;Rl.getNormalMatrix(h);for(var p=0,d=u.length;p<d;p++){var f=u[p];Cl.copy(f.normal).applyMatrix3(Rl).normalize(),v.setFloat32(a,Cl.x,1),a+=4,v.setFloat32(a,Cl.y,1),a+=4,v.setFloat32(a,Cl.z,1),a+=4;for(var m=[f.a,f.b,f.c],g=0;g<3;g++)Cl.copy(l[m[g]]).applyMatrix4(h),v.setFloat32(a,Cl.x,1),a+=4,v.setFloat32(a,Cl.y,1),a+=4,v.setFloat32(a,Cl.z,1),a+=4;v.setUint16(a,0,1),a+=2}}return v}var v="";for(v+="solid exported\n",s=0,c=r.length;s<c;s++){var y;for(l=(y=r[s]).geometry.vertices,u=y.geometry.faces,h=y.matrixWorld,Rl.getNormalMatrix(h),p=0,d=u.length;p<d;p++){for(f=u[p],Cl.copy(f.normal).applyMatrix3(Rl).normalize(),v+="\tfacet normal "+Cl.x+" "+Cl.y+" "+Cl.z+"\n",v+="\t\touter loop\n",m=[f.a,f.b,f.c],g=0;g<3;g++)Cl.copy(l[m[g]]).applyMatrix4(h),v+="\t\t\tvertex "+Cl.x+" "+Cl.y+" "+Cl.z+"\n";v+="\t\tendloop\n",v+="\tendfacet\n"}}return v+"endsolid exported\n"})};var Ol=function(){};Ol.prototype={constructor:Ol,parse:function(e){var r,i,a,o,s,l="",u=0,h=0,p=0,d=new c,f=new c,m=new t,g=[];return e.traverse((function(e){e instanceof H&&function(e){var t=0,a=0,c=0,v=e.geometry,y=new n;if(v.isGeometry&&(v=(new F).setFromObject(e)),v.isBufferGeometry){var x=v.getAttribute("position"),b=v.getAttribute("normal"),w=v.getAttribute("uv"),_=v.getIndex();if(l+="o "+e.name+"\n",e.material&&e.material.name&&(l+="usemtl "+e.material.name+"\n"),void 0!==x)for(r=0,o=x.count;r<o;r++,t++)d.x=x.getX(r),d.y=x.getY(r),d.z=x.getZ(r),d.applyMatrix4(e.matrixWorld),l+="v "+d.x+" "+d.y+" "+d.z+"\n";if(void 0!==w)for(r=0,o=w.count;r<o;r++,c++)m.x=w.getX(r),m.y=w.getY(r),l+="vt "+m.x+" "+m.y+"\n";if(void 0!==b)for(y.getNormalMatrix(e.matrixWorld),r=0,o=b.count;r<o;r++,a++)f.x=b.getX(r),f.y=b.getY(r),f.z=b.getZ(r),f.applyMatrix3(y).normalize(),l+="vn "+f.x+" "+f.y+" "+f.z+"\n";if(null!==_)for(r=0,o=_.count;r<o;r+=3){for(s=0;s<3;s++)i=_.getX(r+s)+1,g[s]=u+i+(b||w?"/"+(w?h+i:"")+(b?"/"+(p+i):""):"");l+="f "+g.join(" ")+"\n"}else for(r=0,o=x.count;r<o;r+=3){for(s=0;s<3;s++)i=r+s+1,g[s]=u+i+(b||w?"/"+(w?h+i:"")+(b?"/"+(p+i):""):"");l+="f "+g.join(" ")+"\n"}}else console.warn("THREE.OBJExporter.parseMesh(): geometry type unsupported",v);u+=t,h+=c,p+=a}(e),e instanceof $t&&function(e){var t=0,n=e.geometry,s=e.type;if(n.isGeometry&&(n=(new F).setFromObject(e)),n.isBufferGeometry){var c=n.getAttribute("position");if(l+="o "+e.name+"\n",void 0!==c)for(r=0,o=c.count;r<o;r++,t++)d.x=c.getX(r),d.y=c.getY(r),d.z=c.getZ(r),d.applyMatrix4(e.matrixWorld),l+="v "+d.x+" "+d.y+" "+d.z+"\n";if("Line"===s){for(l+="l ",i=1,o=c.count;i<=o;i++)l+=u+i+" ";l+="\n"}if("LineSegments"===s)for(a=1+(i=1),o=c.count;i<o;a=(i+=2)+1)l+="l "+(u+i)+" "+(u+a)+"\n"}else console.warn("THREE.OBJExporter.parseLine(): geometry type unsupported",n);u+=t}(e)})),l}};var Nl=function(e){this.subdivisions=void 0===e?1:e};Nl.prototype.modify=function(e){(e=e.isBufferGeometry?(new j).fromBufferGeometry(e):e.clone()).mergeVertices();for(var t=this.subdivisions;t-- >0;)this.smooth(e);return e.computeFaceNormals(),e.computeVertexNormals(),e},function(){function e(e,t,n){return n[Math.min(e,t)+"_"+Math.max(e,t)]}function n(e,t,n,r,i,a){var o,s=Math.min(e,t),c=Math.max(e,t),l=s+"_"+c;l in r?o=r[l]:(o={a:n[s],b:n[c],newEdge:null,faces:[]},r[l]=o),o.faces.push(i),a[e].edges.push(o),a[t].edges.push(o)}function r(e,t,n,r,i){e.push(new S(t,n,r,void 0,void 0,i))}function i(e,t){return Math.abs(t-e)/2+Math.min(e,t)}function a(e,t,n,r){e.push([t.clone(),n.clone(),r.clone()])}var o=["a","b","c"];Nl.prototype.smooth=function(s){var l,u,h,p,d,f,m,g,v,y,x,b,w,_=new c,M=[];l=s.vertices,u=s.faces;var S,T,E,A,L,C,R,P,O,N,D,I,z,B,U=void 0!==(h=s.faceVertexUvs)[0]&&h[0].length>0;if(U)for(var F=0;F<h.length;F++)M.push([]);for(m in function(e,t,r,i){var a,o,s;for(a=0,o=e.length;a<o;a++)r[a]={edges:[]};for(a=0,o=t.length;a<o;a++)n((s=t[a]).a,s.b,e,i,s,r),n(s.b,s.c,e,i,s,r),n(s.c,s.a,e,i,s,r)}(l,u,y=Array(l.length),x={}),b=[],x){for(T=x[m],E=new c,L=3/8,C=1/8,2!=(R=T.faces.length)&&(L=.5,C=0),E.addVectors(T.a,T.b).multiplyScalar(L),_.set(0,0,0),F=0;F<R;F++){for(A=T.faces[F],v=0;v<3&&((S=l[A[o[v]]])===T.a||S===T.b);v++);_.add(S)}_.multiplyScalar(C),E.add(_),T.newEdge=b.length,b.push(E)}for(w=[],m=0,g=l.length;m<g;m++){for(z=l[m],3==(f=(I=y[m].edges).length)?P=3/16:f>3&&(P=3/(8*f)),O=1-f*P,N=P,f<=2&&2==f&&(O=3/4,N=1/8),B=z.clone().multiplyScalar(O),_.set(0,0,0),F=0;F<f;F++)S=(D=I[F]).a!==z?D.a:D.b,_.add(S);_.multiplyScalar(N),B.add(_),w.push(B)}p=w.concat(b);var H,k,G,j,V,W,q,X=w.length;d=[];var Y=new t,Z=new t,J=new t;for(m=0,g=u.length;m<g;m++)if(r(d,H=e((A=u[m]).a,A.b,x).newEdge+X,k=e(A.b,A.c,x).newEdge+X,G=e(A.c,A.a,x).newEdge+X,A.materialIndex),r(d,A.a,H,G,A.materialIndex),r(d,A.b,k,H,A.materialIndex),r(d,A.c,G,k,A.materialIndex),U)for(F=0;F<h.length;F++)V=(j=h[F][m])[0],W=j[1],q=j[2],Y.set(i(V.x,W.x),i(V.y,W.y)),Z.set(i(W.x,q.x),i(W.y,q.y)),J.set(i(V.x,q.x),i(V.y,q.y)),a(M[F],Y,Z,J),a(M[F],V,Y,J),a(M[F],W,Z,Y),a(M[F],q,J,Z);s.vertices=p,s.faces=d,U&&(s.faceVertexUvs=M)}}();var Dl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Il=ba((function(e){!function(){function t(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){a(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function n(e){var t=new XMLHttpRequest;t.open("HEAD",e,0);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function r(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",1,1,window,0,0,0,80,20,0,0,0,0,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof Dl&&Dl.global===Dl?Dl:void 0,a=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype?function(e,a,o){var s=i.URL||i.webkitURL,c=document.createElement("a");a=a||e.name||"download",c.download=a,c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?r(c):n(c.href)?t(e,a,o):r(c,c.target="_blank")):(c.href=s.createObjectURL(e),setTimeout((function(){s.revokeObjectURL(c.href)}),4e4),setTimeout((function(){r(c)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,i,a){if(i=i||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:0}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,a),i);else if(n(e))t(e,i,a);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout((function(){r(o)}))}}:function(e,n,r,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,r);var o="application/octet-stream"===e.type,s=/constructor/i.test(i.HTMLElement)||i.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||o&&s)&&"object"==typeof FileReader){var l=new FileReader;l.onloadend=function(){var e=l.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=e:location=e,a=null},l.readAsDataURL(e)}else{var u=i.URL||i.webkitURL,h=u.createObjectURL(e);a?a.location=h:location.href=h,a=null,setTimeout((function(){u.revokeObjectURL(h)}),4e4)}});i.saveAs=a.saveAs=a,e.exports=a}()})).saveAs,zl=ba((function(e){
/*!
* jQuery JavaScript Library v3.4.1
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2019-05-01T21:04Z
*/
!function(t,n){e.exports=t.document?n(t,1):function(e){if(!e.document)throw Error("jQuery requires a window with a document");return n(e)}}("undefined"!=typeof window?window:Dl,(function(e,t){function n(e,t,n){var r,i,a=(n=n||ee).createElement("script");if(a.text=e,t)for(r in fe)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&a.setAttribute(r,i);n.head.appendChild(a).parentNode.removeChild(a)}function r(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?oe[se.call(e)]||"object":typeof e}function i(e){var t=!!e&&"length"in e&&e.length,n=r(e);return pe(e)||de(e)?0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function a(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}function o(e,t,n){return pe(t)?me.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?me.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?me.grep(e,(function(e){return ae.call(t,e)>-1!==n})):me.filter(t,e,n)}function s(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function c(e){return e}function l(e){throw e}function u(e,t,n,r){var i;try{e&&pe(i=e.promise)?i.call(e).done(t).fail(n):e&&pe(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.call(void 0,e)}}function h(){ee.removeEventListener("DOMContentLoaded",h),e.removeEventListener("load",h),me.ready()}function p(e,t){return t.toUpperCase()}function d(e){return e.replace(Re,"ms-").replace(Pe,p)}function f(){this.expando=me.expando+f.uid++}function m(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ze,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e?1:"false"===e?0:"null"===e?null:e===+e+""?+e:Ie.test(e)?JSON.parse(e):e}(n)}catch(e){}De.set(e,t,n)}else n=void 0;return n}function g(e,t,n,r){var i,a,o=20,s=r?function(){return r.cur()}:function(){return me.css(e,t,"")},c=s(),l=n&&n[3]||(me.cssNumber[t]?"":"px"),u=e.nodeType&&(me.cssNumber[t]||"px"!==l&&+c)&&Ue.exec(me.css(e,t));if(u&&u[3]!==l){for(c/=2,l=l||u[3],u=+c||1;o--;)me.style(e,t,u+l),(1-a)*(1-(a=s()/c||.5))<=0&&(o=0),u/=a;u*=2,me.style(e,t,u+l),n=n||[]}return n&&(u=+u||+c||0,i=n[1]?u+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=u,r.end=i)),i}function v(e){var t,n=e.ownerDocument,r=e.nodeName,i=We[r];return i||(t=n.body.appendChild(n.createElement(r)),i=me.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),We[r]=i,i)}function y(e,t){for(var n,r,i=[],a=0,o=e.length;a<o;a++)(r=e[a]).style&&(n=r.style.display,t?("none"===n&&(i[a]=Ne.get(r,"display")||null,i[a]||(r.style.display="")),""===r.style.display&&je(r)&&(i[a]=v(r))):"none"!==n&&(i[a]="none",Ne.set(r,"display",n)));for(a=0;a<o;a++)null!=i[a]&&(e[a].style.display=i[a]);return e}function x(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&a(e,t)?me.merge([e],n):n}function b(e,t){for(var n=0,r=e.length;n<r;n++)Ne.set(e[n],"globalEval",!t||Ne.get(t[n],"globalEval"))}function w(e,t,n,i,a){for(var o,s,c,l,u,h,p=t.createDocumentFragment(),d=[],f=0,m=e.length;f<m;f++)if((o=e[f])||0===o)if("object"===r(o))me.merge(d,o.nodeType?[o]:o);else if(Qe.test(o)){for(s=s||p.appendChild(t.createElement("div")),c=(Xe.exec(o)||["",""])[1].toLowerCase(),l=Ze[c]||Ze._default,s.innerHTML=l[1]+me.htmlPrefilter(o)+l[2],h=l[0];h--;)s=s.lastChild;me.merge(d,s.childNodes),(s=p.firstChild).textContent=""}else d.push(t.createTextNode(o));for(p.textContent="",f=0;o=d[f++];)if(i&&me.inArray(o,i)>-1)a&&a.push(o);else if(u=ke(o),s=x(p.appendChild(o),"script"),u&&b(s),n)for(h=0;o=s[h++];)Ye.test(o.type||"")&&n.push(o);return p}function _(){return 1}function M(){return 0}function S(e,t){return e===function(){try{return ee.activeElement}catch(e){}}()==("focus"===t)}function T(e,t,n,r,i,a){var o,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)T(e,s,n,r,t[s],a);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),0==i)i=M;else if(!i)return e;return 1===a&&(o=i,(i=function(e){return me().off(e),o.apply(this,arguments)}).guid=o.guid||(o.guid=me.guid++)),e.each((function(){me.event.add(this,t,i,r,n)}))}function E(e,t,n){n?(Ne.set(e,t,0),me.event.add(e,t,{namespace:0,handler:function(e){var r,i,a=Ne.get(this,t);if(1&e.isTrigger&&this[t]){if(a.length)(me.event.special[t]||{}).delegateType&&e.stopPropagation();else if(a=ne.call(arguments),Ne.set(this,t,a),r=n(this,t),this[t](),a!==(i=Ne.get(this,t))||r?Ne.set(this,t,0):i={},a!==i)return e.stopImmediatePropagation(),e.preventDefault(),i.value}else a.length&&(Ne.set(this,t,{value:me.event.trigger(me.extend(a[0],me.Event.prototype),a.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Ne.get(e,t)&&me.event.add(e,t,_)}function A(e,t){return a(e,"table")&&a(11!==t.nodeType?t:t.firstChild,"tr")&&me(e).children("tbody")[0]||e}function L(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function C(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function R(e,t){var n,r,i,a,o,s,c,l;if(1===t.nodeType){if(Ne.hasData(e)&&(a=Ne.access(e),o=Ne.set(t,a),l=a.events))for(i in delete o.handle,o.events={},l)for(n=0,r=l[i].length;n<r;n++)me.event.add(t,i,l[i][n]);De.hasData(e)&&(s=De.access(e),c=me.extend({},s),De.set(t,c))}}function P(e,t){var n=t.nodeName.toLowerCase();"input"===n&&qe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function O(e,t,r,i){t=re.apply([],t);var a,o,s,c,l,u,h=0,p=e.length,d=p-1,f=t[0],m=pe(f);if(m||p>1&&"string"==typeof f&&!he.checkClone&&it.test(f))return e.each((function(n){var a=e.eq(n);m&&(t[0]=f.call(this,n,a.html())),O(a,t,r,i)}));if(p&&(o=(a=w(t,e[0].ownerDocument,0,e,i)).firstChild,1===a.childNodes.length&&(a=o),o||i)){for(c=(s=me.map(x(a,"script"),L)).length;h<p;h++)l=a,h!==d&&(l=me.clone(l,1,1),c&&me.merge(s,x(l,"script"))),r.call(e[h],l,h);if(c)for(u=s[s.length-1].ownerDocument,me.map(s,C),h=0;h<c;h++)l=s[h],Ye.test(l.type||"")&&!Ne.access(l,"globalEval")&&me.contains(u,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?me._evalUrl&&!l.noModule&&me._evalUrl(l.src,{nonce:l.nonce||l.getAttribute("nonce")}):n(l.textContent.replace(at,""),l,u))}return e}function N(e,t,n){for(var r,i=t?me.filter(t,e):e,a=0;null!=(r=i[a]);a++)n||1!==r.nodeType||me.cleanData(x(r)),r.parentNode&&(n&&ke(r)&&b(x(r,"script")),r.parentNode.removeChild(r));return e}function D(e,t,n){var r,i,a,o,s=e.style;return(n=n||st(e))&&(""!==(o=n.getPropertyValue(t)||n[t])||ke(e)||(o=me.style(e,t)),!he.pixelBoxStyles()&&ot.test(o)&&ct.test(t)&&(r=s.width,i=s.minWidth,a=s.maxWidth,s.minWidth=s.maxWidth=s.width=o,o=n.width,s.width=r,s.minWidth=i,s.maxWidth=a)),void 0!==o?o+"":o}function I(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}function z(e){return me.cssProps[e]||ht[e]||(e in ut?e:ht[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=3;n--;)if((e=lt[n]+t)in ut)return e}(e)||e)}function B(e,t,n){var r=Ue.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function U(e,t,n,r,i,a){var o="width"===t?1:0,s=0,c=0;if(n===(r?"border":"content"))return 0;for(;o<4;o+=2)"margin"===n&&(c+=me.css(e,n+Fe[o],1,i)),r?("content"===n&&(c-=me.css(e,"padding"+Fe[o],1,i)),"margin"!==n&&(c-=me.css(e,"border"+Fe[o]+"Width",1,i))):(c+=me.css(e,"padding"+Fe[o],1,i),"padding"!==n?c+=me.css(e,"border"+Fe[o]+"Width",1,i):s+=me.css(e,"border"+Fe[o]+"Width",1,i));return!r&&a>=0&&(c+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-a-c-s-.5))||0),c}function F(e,t,n){var r=st(e),i=(!he.boxSizingReliable()||n)&&"border-box"===me.css(e,"boxSizing",0,r),a=i,o=D(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(ot.test(o)){if(!n)return o;o="auto"}return(!he.boxSizingReliable()&&i||"auto"===o||!parseFloat(o)&&"inline"===me.css(e,"display",0,r))&&e.getClientRects().length&&(i="border-box"===me.css(e,"boxSizing",0,r),(a=s in e)&&(o=e[s])),(o=parseFloat(o)||0)+U(e,t,n||(i?"border":"content"),a,r,o)+"px"}function H(e,t,n,r,i){return new H.prototype.init(e,t,n,r,i)}function k(){vt&&(0==ee.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(k):e.setTimeout(k,me.fx.interval),me.fx.tick())}function G(){return e.setTimeout((function(){gt=void 0})),gt=Date.now()}function j(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=Fe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function V(e,t,n){for(var r,i=(W.tweeners[t]||[]).concat(W.tweeners["*"]),a=0,o=i.length;a<o;a++)if(r=i[a].call(n,t,e))return r}function W(e,t,n){var r,i,a=0,o=W.prefilters.length,s=me.Deferred().always((function(){delete c.elem})),c=function(){if(i)return 0;for(var t=gt||G(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),a=0,o=l.tweens.length;a<o;a++)l.tweens[a].run(r);return s.notifyWith(e,[l,r,n]),r<1&&o?n:(o||s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l]),0)},l=s.promise({elem:e,props:me.extend({},t),opts:me.extend(1,{specialEasing:{},easing:me.easing._default},n),originalProperties:t,originalOptions:n,startTime:gt||G(),duration:n.duration,tweens:[],createTween:function(t,n){var r=me.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=1;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),u=l.props;for(function(e,t){var n,r,i,a,o;for(n in e)if(i=t[r=d(n)],a=e[n],Array.isArray(a)&&(i=a[1],a=e[n]=a[0]),n!==r&&(e[r]=a,delete e[n]),(o=me.cssHooks[r])&&"expand"in o)for(n in a=o.expand(a),delete e[r],a)n in e||(e[n]=a[n],t[n]=i);else t[r]=i}(u,l.opts.specialEasing);a<o;a++)if(r=W.prefilters[a].call(l,e,u,l.opts))return pe(r.stop)&&(me._queueHooks(l.elem,l.opts.queue).stop=r.stop.bind(r)),r;return me.map(u,V,l),pe(l.opts.start)&&l.opts.start.call(e,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),me.fx.timer(me.extend(c,{elem:e,anim:l,queue:l.opts.queue})),l}function q(e){return(e.match(Ee)||[]).join(" ")}function X(e){return e.getAttribute&&e.getAttribute("class")||""}function Y(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(Ee)||[]}function Z(e,t,n,i){var a;if(Array.isArray(t))me.each(t,(function(t,r){n||Rt.test(e)?i(e,r):Z(e+"["+("object"==typeof r&&null!=r?t:"")+"]",r,n,i)}));else if(n||"object"!==r(t))i(e,t);else for(a in t)Z(e+"["+a+"]",t[a],n,i)}function J(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,a=t.toLowerCase().match(Ee)||[];if(pe(n))for(;r=a[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function $(e,t,n,r){function i(s){var c;return a[s]=1,me.each(e[s]||[],(function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||a[l]?o?!(c=l):void 0:(t.dataTypes.unshift(l),i(l),0)})),c}var a={},o=e===kt;return i(t.dataTypes[0])||!a["*"]&&i("*")}function Q(e,t){var n,r,i=me.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&me.extend(1,e,r),e}var K=[],ee=e.document,te=Object.getPrototypeOf,ne=K.slice,re=K.concat,ie=K.push,ae=K.indexOf,oe={},se=oe.toString,ce=oe.hasOwnProperty,le=ce.toString,ue=le.call(Object),he={},pe=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},de=function(e){return null!=e&&e===e.window},fe={type:1,src:1,nonce:1,noModule:1},me=function(e,t){return new me.fn.init(e,t)},ge=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;me.fn=me.prototype={jquery:"3.4.1",constructor:me,length:0,toArray:function(){return ne.call(this)},get:function(e){return null==e?ne.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=me.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return me.each(this,e)},map:function(e){return this.pushStack(me.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(ne.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:ie,sort:K.sort,splice:K.splice},me.extend=me.fn.extend=function(e){var t,n,r,i,a,o,s=e||{},c=1,l=arguments.length,u=0;for("boolean"==typeof s&&(u=s,s=arguments[c]||{},c++),"object"==typeof s||pe(s)||(s={}),c===l&&(s=this,c--);c<l;c++)if(null!=(t=arguments[c]))for(n in t)i=t[n],"__proto__"!==n&&s!==i&&(u&&i&&(me.isPlainObject(i)||(a=Array.isArray(i)))?(r=s[n],o=a&&!Array.isArray(r)?[]:a||me.isPlainObject(r)?r:{},a=0,s[n]=me.extend(u,o,i)):void 0!==i&&(s[n]=i));return s},me.extend({expando:"jQuery"+("3.4.1"+Math.random()).replace(/\D/g,""),isReady:1,error:function(e){throw Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return e&&"[object Object]"===se.call(e)?(t=te(e))?"function"==typeof(n=ce.call(t,"constructor")&&t.constructor)&&le.call(n)===ue:1:0},isEmptyObject:function(e){var t;for(t in e)return 0;return 1},globalEval:function(e,t){n(e,{nonce:t&&t.nonce})},each:function(e,t){var n,r=0;if(i(e))for(n=e.length;r<n&&0!=t.call(e[r],r,e[r]);r++);else for(r in e)if(0==t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(ge,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(i(Object(e))?me.merge(n,"string"==typeof e?[e]:e):ie.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:ae.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,a=e.length,o=!n;i<a;i++)!t(e[i],i)!==o&&r.push(e[i]);return r},map:function(e,t,n){var r,a,o=0,s=[];if(i(e))for(r=e.length;o<r;o++)null!=(a=t(e[o],o,n))&&s.push(a);else for(o in e)null!=(a=t(e[o],o,n))&&s.push(a);return re.apply([],s)},guid:1,support:he}),"function"==typeof Symbol&&(me.fn[Symbol.iterator]=K[Symbol.iterator]),me.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){oe["[object "+t+"]"]=t.toLowerCase()}));var ve=
/*!
* Sizzle CSS Selector Engine v2.3.4
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://js.foundation/
*
* Date: 2019-04-08
*/
function(e){function t(e,t,n,r){var i,a,o,s,c,l,u,p=t&&t.ownerDocument,f=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==f&&9!==f&&11!==f)return n;if(!r&&((t?t.ownerDocument||t:F)!==P&&R(t),t=t||P,N)){if(11!==f&&(c=fe.exec(e)))if(i=c[1]){if(9===f){if(!(o=t.getElementById(i)))return n;if(o.id===i)return n.push(o),n}else if(p&&(o=p.getElementById(i))&&B(t,o)&&o.id===i)return n.push(o),n}else{if(c[2])return $.apply(n,t.getElementsByTagName(e)),n;if((i=c[3])&&b.getElementsByClassName&&t.getElementsByClassName)return $.apply(n,t.getElementsByClassName(i)),n}if(b.qsa&&!W[e+" "]&&(!D||!D.test(e))&&(1!==f||"object"!==t.nodeName.toLowerCase())){if(u=e,p=t,1===f&&oe.test(e)){for((s=t.getAttribute("id"))?s=s.replace(ye,xe):t.setAttribute("id",s=U),a=(l=S(e)).length;a--;)l[a]="#"+s+" "+d(l[a]);u=l.join(","),p=me.test(e)&&h(t.parentNode)||t}try{return $.apply(n,p.querySelectorAll(u)),n}catch(t){W(e,1)}finally{s===U&&t.removeAttribute("id")}}}return E(e.replace(re,"$1"),t,n,r)}function n(){var e=[];return function t(n,r){return e.push(n+" ")>w.cacheLength&&delete t[e.shift()],t[n+" "]=r}}function r(e){return e[U]=1,e}function i(e){var t=P.createElement("fieldset");try{return!!e(t)}catch(e){return 0}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function a(e,t){for(var n=e.split("|"),r=n.length;r--;)w.attrHandle[n[r]]=t}function o(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function c(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return function(t){return"form"in t?t.parentNode&&0==t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&we(t)===e:t.disabled===e:"label"in t?t.disabled===e:0}}function u(e){return r((function(t){return t=+t,r((function(n,r){for(var i,a=e([],n.length,t),o=a.length;o--;)n[i=a[o]]&&(n[i]=!(r[i]=n[i]))}))}))}function h(e){return e&&void 0!==e.getElementsByTagName&&e}function p(){}function d(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function f(e,t,n){var r=t.dir,i=t.next,a=i||r,o=n&&"parentNode"===a,s=k++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||o)return e(t,n,i);return 0}:function(t,n,c){var l,u,h,p=[H,s];if(c){for(;t=t[r];)if((1===t.nodeType||o)&&e(t,n,c))return 1}else for(;t=t[r];)if(1===t.nodeType||o)if(u=(h=t[U]||(t[U]={}))[t.uniqueID]||(h[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((l=u[a])&&l[0]===H&&l[1]===s)return p[2]=l[2];if(u[a]=p,p[2]=e(t,n,c))return 1}return 0}}function m(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return 0;return 1}:e[0]}function g(e,t,n,r,i){for(var a,o=[],s=0,c=e.length,l=null!=t;s<c;s++)(a=e[s])&&(n&&!n(a,r,i)||(o.push(a),l&&t.push(s)));return o}function v(e,n,i,a,o,s){return a&&!a[U]&&(a=v(a)),o&&!o[U]&&(o=v(o,s)),r((function(r,s,c,l){var u,h,p,d=[],f=[],m=s.length,v=r||function(e,n,r){for(var i=0,a=n.length;i<a;i++)t(e,n[i],r);return r}(n||"*",c.nodeType?[c]:c,[]),y=!e||!r&&n?v:g(v,d,e,c,l),x=i?o||(r?e:m||a)?[]:s:y;if(i&&i(y,x,c,l),a)for(u=g(x,f),a(u,[],c,l),h=u.length;h--;)(p=u[h])&&(x[f[h]]=!(y[f[h]]=p));if(r){if(o||e){if(o){for(u=[],h=x.length;h--;)(p=x[h])&&u.push(y[h]=p);o(null,x=[],u,l)}for(h=x.length;h--;)(p=x[h])&&(u=o?K(r,p):d[h])>-1&&(r[u]=!(s[u]=p))}}else x=g(x===s?x.splice(m,x.length):x),o?o(null,s,x,l):$.apply(s,x)}))}function y(e){for(var t,n,r,i=e.length,a=w.relative[e[0].type],o=a||w.relative[" "],s=a?1:0,c=f((function(e){return e===t}),o,1),l=f((function(e){return K(t,e)>-1}),o,1),u=[function(e,n,r){var i=!a&&(r||n!==A)||((t=n).nodeType?c(e,n,r):l(e,n,r));return t=null,i}];s<i;s++)if(n=w.relative[e[s].type])u=[f(m(u),n)];else{if((n=w.filter[e[s].type].apply(null,e[s].matches))[U]){for(r=++s;r<i&&!w.relative[e[r].type];r++);return v(s>1&&m(u),s>1&&d(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(re,"$1"),n,s<r&&y(e.slice(s,r)),r<i&&y(e=e.slice(r)),r<i&&d(e))}u.push(n)}return m(u)}var x,b,w,_,M,S,T,E,A,L,C,R,P,O,N,D,I,z,B,U="sizzle"+1*new Date,F=e.document,H=0,k=0,G=n(),j=n(),V=n(),W=n(),q=function(e,t){return e===t&&(C=1),0},X={}.hasOwnProperty,Y=[],Z=Y.pop,J=Y.push,$=Y.push,Q=Y.slice,K=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},ee="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",te="[\\x20\\t\\r\\n\\f]",ne=/[\x20\t\r\n\f]+/g,re=/^[\x20\t\r\n\f]+|((?:^|[^\\])(?:\\.)*)[\x20\t\r\n\f]+$/g,ie=/^[\x20\t\r\n\f]*,[\x20\t\r\n\f]*/,ae=/^[\x20\t\r\n\f]*([>+~]|[\x20\t\r\n\f])[\x20\t\r\n\f]*/,oe=/[\x20\t\r\n\f]|>/,se=/:((?:\\.|[\w-]|[^-\xa0])+)(?:\((('((?:\\.|[^\\'])*)'|"((?:\\.|[^\\"])*)")|((?:\\.|[^\\()[\]]|\[[\x20\t\r\n\f]*((?:\\.|[\w-]|[^-\xa0])+)(?:[\x20\t\r\n\f]*([*^$|!~]?=)[\x20\t\r\n\f]*(?:'((?:\\.|[^\\'])*)'|"((?:\\.|[^\\"])*)"|((?:\\.|[\w-]|[^-\xa0])+))|)[\x20\t\r\n\f]*\])*)|.*)\)|)/,ce=/^(?:\\.|[\w-]|[^-\xa0])+$/,le={ID:/^#((?:\\.|[\w-]|[^-\xa0])+)/,CLASS:/^\.((?:\\.|[\w-]|[^-\xa0])+)/,TAG:/^((?:\\.|[\w-]|[^-\xa0])+|[*])/,ATTR:/^\[[\x20\t\r\n\f]*((?:\\.|[\w-]|[^-\xa0])+)(?:[\x20\t\r\n\f]*([*^$|!~]?=)[\x20\t\r\n\f]*(?:'((?:\\.|[^\\'])*)'|"((?:\\.|[^\\"])*)"|((?:\\.|[\w-]|[^-\xa0])+))|)[\x20\t\r\n\f]*\]/,PSEUDO:/^:((?:\\.|[\w-]|[^-\xa0])+)(?:\((('((?:\\.|[^\\'])*)'|"((?:\\.|[^\\"])*)")|((?:\\.|[^\\()[\]]|\[[\x20\t\r\n\f]*((?:\\.|[\w-]|[^-\xa0])+)(?:[\x20\t\r\n\f]*([*^$|!~]?=)[\x20\t\r\n\f]*(?:'((?:\\.|[^\\'])*)'|"((?:\\.|[^\\"])*)"|((?:\\.|[\w-]|[^-\xa0])+))|)[\x20\t\r\n\f]*\])*)|.*)\)|)/,CHILD:/^:(only|first|last|nth|nth-last)-(child|of-type)(?:\([\x20\t\r\n\f]*(even|odd|(([+-]|)(\d*)n|)[\x20\t\r\n\f]*(?:([+-]|)[\x20\t\r\n\f]*(\d+)|))[\x20\t\r\n\f]*\)|)/i,bool:/^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i,needsContext:/^[\x20\t\r\n\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\([\x20\t\r\n\f]*((?:-\d)?\d*)[\x20\t\r\n\f]*\)|)(?=[^-]|$)/i},ue=/HTML$/i,he=/^(?:input|select|textarea|button)$/i,pe=/^h\d$/i,de=/^[^{]+\{\s*\[native \w/,fe=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,me=/[+~]/,ge=/\\([\da-f]{1,6}[\x20\t\r\n\f]?|([\x20\t\r\n\f])|.)/gi,ve=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},ye=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,xe=function(e,t){return t?"\0"===e?"<22>":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},be=function(){R()},we=f((function(e){return 1==e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{$.apply(Y=Q.call(F.childNodes),F.childNodes),Y[F.childNodes.length].nodeType}catch(e){$={apply:Y.length?function(e,t){J.apply(e,Q.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}for(x in b=t.support={},M=t.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!ue.test(t||n&&n.nodeName||"HTML")},R=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:F;return r!==P&&9===r.nodeType&&r.documentElement?(O=(P=r).documentElement,N=!M(P),F!==P&&(n=P.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",be,0):n.attachEvent&&n.attachEvent("onunload",be)),b.attributes=i((function(e){return e.className="i",!e.getAttribute("className")})),b.getElementsByTagName=i((function(e){return e.appendChild(P.createComment("")),!e.getElementsByTagName("*").length})),b.getElementsByClassName=de.test(P.getElementsByClassName),b.getById=i((function(e){return O.appendChild(e).id=U,!P.getElementsByName||!P.getElementsByName(U).length})),b.getById?(w.filter.ID=function(e){var t=e.replace(ge,ve);return function(e){return e.getAttribute("id")===t}},w.find.ID=function(e,t){if(void 0!==t.getElementById&&N){var n=t.getElementById(e);return n?[n]:[]}}):(w.filter.ID=function(e){var t=e.replace(ge,ve);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},w.find.ID=function(e,t){if(void 0!==t.getElementById&&N){var n,r,i,a=t.getElementById(e);if(a){if((n=a.getAttributeNode("id"))&&n.value===e)return[a];for(i=t.getElementsByName(e),r=0;a=i[r++];)if((n=a.getAttributeNode("id"))&&n.value===e)return[a]}return[]}}),w.find.TAG=b.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):b.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,a=t.getElementsByTagName(e);if("*"===e){for(;n=a[i++];)1===n.nodeType&&r.push(n);return r}return a},w.find.CLASS=b.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&N)return t.getElementsByClassName(e)},I=[],D=[],(b.qsa=de.test(P.querySelectorAll))&&(i((function(e){O.appendChild(e).innerHTML="<a id='"+U+"'></a><select id='"+U+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&D.push("[*^$]="+te+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||D.push("\\["+te+"*(?:value|"+ee+")"),e.querySelectorAll("[id~="+U+"-]").length||D.push("~="),e.querySelectorAll(":checked").length||D.push(":checked"),e.querySelectorAll("a#"+U+"+*").length||D.push(".#.+[+~]")})),i((function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=P.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&D.push("name"+te+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&D.push(":enabled",":disabled"),O.appendChild(e).disabled=1,2!==e.querySelectorAll(":disabled").length&&D.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),D.push(",.*:")}))),(b.matchesSelector=de.test(z=O.matches||O.webkitMatchesSelector||O.mozMatchesSelector||O.oMatchesSelector||O.msMatchesSelector))&&i((function(e){b.disconnectedMatch=z.call(e,"*"),z.call(e,"[s!='']:x"),I.push("!=",":((?:\\\\.|[\\w-]|[^\0-\\xa0])+)(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[\\w-]|[^\0-\\xa0])+)(?:[\\x20\\t\\r\\n\\f]*([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|((?:\\\\.|[\\w-]|[^\0-\\xa0])+))|)[\\x20\\t\\r\\n\\f]*\\])*)|.*)\\)|)")})),D=D.length&&RegExp(D.join("|")),I=I.length&&RegExp(I.join("|")),t=de.test(O.compareDocumentPosition),B=t||de.test(O.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return 1;return 0},q=t?function(e,t){if(e===t)return C=1,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!b.sortDetached&&t.compareDocumentPosition(e)===n?e===P||e.ownerDocument===F&&B(F,e)?-1:t===P||t.ownerDocument===F&&B(F,t)?1:L?K(L,e)-K(L,t):0:4&n?-1:1)}:function(e,t){if(e===t)return C=1,0;var n,r=0,i=e.parentNode,a=t.parentNode,s=[e],c=[t];if(!i||!a)return e===P?-1:t===P?1:i?-1:a?1:L?K(L,e)-K(L,t):0;if(i===a)return o(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;s[r]===c[r];)r++;return r?o(s[r],c[r]):s[r]===F?-1:c[r]===F?1:0},P):P},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==P&&R(e),b.matchesSelector&&N&&!W[n+" "]&&(!I||!I.test(n))&&(!D||!D.test(n)))try{var r=z.call(e,n);if(r||b.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){W(n,1)}return t(n,P,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==P&&R(e),B(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==P&&R(e);var n=w.attrHandle[t.toLowerCase()],r=n&&X.call(w.attrHandle,t.toLowerCase())?n(e,t,!N):void 0;return void 0!==r?r:b.attributes||!N?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.escape=function(e){return(e+"").replace(ye,xe)},t.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(C=!b.detectDuplicates,L=!b.sortStable&&e.slice(0),e.sort(q),C){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return L=null,e},_=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=_(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=_(t);return n},(w=t.selectors={cacheLength:50,createPseudo:r,match:le,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:1}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:1},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ge,ve),e[3]=(e[3]||e[4]||e[5]||"").replace(ge,ve),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return le.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&se.test(n)&&(t=S(n,1))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ge,ve).toLowerCase();return"*"===e?function(){return 1}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=G[e+" "];return t||(t=RegExp("(^|"+te+")"+e+"("+te+"|$)"))&&G(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,n,r){return function(i){var a=t.attr(i,e);return null==a?"!="===n:n?(a+="","="===n?a===r:"!="===n?a!==r:"^="===n?r&&0===a.indexOf(r):"*="===n?r&&a.indexOf(r)>-1:"$="===n?r&&a.slice(-r.length)===r:"~="===n?(" "+a.replace(ne," ")+" ").indexOf(r)>-1:"|="===n?a===r||a.slice(0,r.length+1)===r+"-":0):1}},CHILD:function(e,t,n,r,i){var a="nth"!==e.slice(0,3),o="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,c){var l,u,h,p,d,f,m=a!==o?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!c&&!s,x=0;if(g){if(a){for(;m;){for(p=t;p=p[m];)if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return 0;f=m="only"===e&&!f&&"nextSibling"}return 1}if(f=[o?g.firstChild:g.lastChild],o&&y){for(x=(d=(l=(u=(h=(p=g)[U]||(p[U]={}))[p.uniqueID]||(h[p.uniqueID]={}))[e]||[])[0]===H&&l[1])&&l[2],p=d&&g.childNodes[d];p=++d&&p&&p[m]||(x=d=0)||f.pop();)if(1===p.nodeType&&++x&&p===t){u[e]=[H,d,x];break}}else if(y&&(x=d=(l=(u=(h=(p=t)[U]||(p[U]={}))[p.uniqueID]||(h[p.uniqueID]={}))[e]||[])[0]===H&&l[1]),0==x)for(;(p=++d&&p&&p[m]||(x=d=0)||f.pop())&&((s?p.nodeName.toLowerCase()!==v:1!==p.nodeType)||!++x||(y&&((u=(h=p[U]||(p[U]={}))[p.uniqueID]||(h[p.uniqueID]={}))[e]=[H,x]),p!==t)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,n){var i,a=w.pseudos[e]||w.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return a[U]?a(n):a.length>1?(i=[e,e,"",n],w.setFilters.hasOwnProperty(e.toLowerCase())?r((function(e,t){for(var r,i=a(e,n),o=i.length;o--;)e[r=K(e,i[o])]=!(t[r]=i[o])})):function(e){return a(e,0,i)}):a}},pseudos:{not:r((function(e){var t=[],n=[],i=T(e.replace(re,"$1"));return i[U]?r((function(e,t,n,r){for(var a,o=i(e,null,r,[]),s=e.length;s--;)(a=o[s])&&(e[s]=!(t[s]=a))})):function(e,r,a){return t[0]=e,i(t,null,a,n),t[0]=null,!n.pop()}})),has:r((function(e){return function(n){return t(e,n).length>0}})),contains:r((function(e){return e=e.replace(ge,ve),function(t){return(t.textContent||_(t)).indexOf(e)>-1}})),lang:r((function(e){return ce.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(ge,ve).toLowerCase(),function(t){var n;do{if(n=N?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return 0}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===O},focus:function(e){return e===P.activeElement&&(!P.hasFocus||P.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:l(0),disabled:l(1),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,1==e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return 0;return 1},parent:function(e){return!w.pseudos.empty(e)},header:function(e){return pe.test(e.nodeName)},input:function(e){return he.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:u((function(){return[0]})),last:u((function(e,t){return[t-1]})),eq:u((function(e,t,n){return[n<0?n+t:n]})),even:u((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:u((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:u((function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e})),gt:u((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}}).pseudos.nth=w.pseudos.eq,{radio:1,checkbox:1,file:1,password:1,image:1})w.pseudos[x]=s(x);for(x in{submit:1,reset:1})w.pseudos[x]=c(x);return p.prototype=w.filters=w.pseudos,w.setFilters=new p,S=t.tokenize=function(e,n){var r,i,a,o,s,c,l,u=j[e+" "];if(u)return n?0:u.slice(0);for(s=e,c=[],l=w.preFilter;s;){for(o in r&&!(i=ie.exec(s))||(i&&(s=s.slice(i[0].length)||s),c.push(a=[])),r=0,(i=ae.exec(s))&&(r=i.shift(),a.push({value:r,type:i[0].replace(re," ")}),s=s.slice(r.length)),w.filter)!(i=le[o].exec(s))||l[o]&&!(i=l[o](i))||(r=i.shift(),a.push({value:r,type:o,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?t.error(e):j(e,c).slice(0)},T=t.compile=function(e,n){var i,a=[],o=[],s=V[e+" "];if(!s){for(n||(n=S(e)),i=n.length;i--;)(s=y(n[i]))[U]?a.push(s):o.push(s);(s=V(e,function(e,n){var i=n.length>0,a=e.length>0,o=function(r,o,s,c,l){var u,h,p,d=0,f="0",m=r&&[],v=[],y=A,x=r||a&&w.find.TAG("*",l),b=H+=null==y?1:Math.random()||.1,_=x.length;for(l&&(A=o===P||o||l);f!==_&&null!=(u=x[f]);f++){if(a&&u){for(h=0,o||u.ownerDocument===P||(R(u),s=!N);p=e[h++];)if(p(u,o||P,s)){c.push(u);break}l&&(H=b)}i&&((u=!p&&u)&&d--,r&&m.push(u))}if(d+=f,i&&f!==d){for(h=0;p=n[h++];)p(m,v,o,s);if(r){if(d>0)for(;f--;)m[f]||v[f]||(v[f]=Z.call(c));v=g(v)}$.apply(c,v),l&&!r&&v.length>0&&d+n.length>1&&t.uniqueSort(c)}return l&&(H=b,A=y),m};return i?r(o):o}(o,a))).selector=e}return s},E=t.select=function(e,t,n,r){var i,a,o,s,c,l="function"==typeof e&&e,u=!r&&S(e=l.selector||e);if(n=n||[],1===u.length){if((a=u[0]=u[0].slice(0)).length>2&&"ID"===(o=a[0]).type&&9===t.nodeType&&N&&w.relative[a[1].type]){if(!(t=(w.find.ID(o.matches[0].replace(ge,ve),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(a.shift().value.length)}for(i=le.needsContext.test(e)?0:a.length;i--&&(o=a[i],!w.relative[s=o.type]);)if((c=w.find[s])&&(r=c(o.matches[0].replace(ge,ve),me.test(a[0].type)&&h(t.parentNode)||t))){if(a.splice(i,1),!(e=r.length&&d(a)))return $.apply(n,r),n;break}}return(l||T(e,u))(r,t,!N,n,!t||me.test(e)&&h(t.parentNode)||t),n},b.sortStable=U.split("").sort(q).join("")===U,b.detectDuplicates=!!C,R(),b.sortDetached=i((function(e){return 1&e.compareDocumentPosition(P.createElement("fieldset"))})),i((function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")}))||a("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),b.attributes&&i((function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||a("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),i((function(e){return null==e.getAttribute("disabled")}))||a(ee,(function(e,t,n){var r;if(!n)return 1==e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null})),t}(e);me.find=ve,me.expr=ve.selectors,me.expr[":"]=me.expr.pseudos,me.uniqueSort=me.unique=ve.uniqueSort,me.text=ve.getText,me.isXMLDoc=ve.isXML,me.contains=ve.contains,me.escapeSelector=ve.escape;var ye=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&me(e).is(n))break;r.push(e)}return r},xe=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},be=me.expr.match.needsContext,we=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;me.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?me.find.matchesSelector(r,e)?[r]:[]:me.find.matches(e,me.grep(t,(function(e){return 1===e.nodeType})))},me.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(me(e).filter((function(){for(t=0;t<r;t++)if(me.contains(i[t],this))return 1})));for(n=this.pushStack([]),t=0;t<r;t++)me.find(e,i[t],n);return r>1?me.uniqueSort(n):n},filter:function(e){return this.pushStack(o(this,e||[],0))},not:function(e){return this.pushStack(o(this,e||[],1))},is:function(e){return!!o(this,"string"==typeof e&&be.test(e)?me(e):e||[],0).length}});var _e,Me=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(me.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||_e,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:Me.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof me?t[0]:t,me.merge(this,me.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:ee,1)),we.test(r[1])&&me.isPlainObject(t))for(r in t)pe(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=ee.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):pe(e)?void 0!==n.ready?n.ready(e):e(me):me.makeArray(e,this)}).prototype=me.fn,_e=me(ee);var Se=/^(?:parents|prev(?:Until|All))/,Te={children:1,contents:1,next:1,prev:1};me.fn.extend({has:function(e){var t=me(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(me.contains(this,t[e]))return 1}))},closest:function(e,t){var n,r=0,i=this.length,a=[],o="string"!=typeof e&&me(e);if(!be.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:1===n.nodeType&&me.find.matchesSelector(n,e))){a.push(n);break}return this.pushStack(a.length>1?me.uniqueSort(a):a)},index:function(e){return e?"string"==typeof e?ae.call(me(e),this[0]):ae.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(me.uniqueSort(me.merge(this.get(),me(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),me.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ye(e,"parentNode")},parentsUntil:function(e,t,n){return ye(e,"parentNode",n)},next:function(e){return s(e,"nextSibling")},prev:function(e){return s(e,"previousSibling")},nextAll:function(e){return ye(e,"nextSibling")},prevAll:function(e){return ye(e,"previousSibling")},nextUntil:function(e,t,n){return ye(e,"nextSibling",n)},prevUntil:function(e,t,n){return ye(e,"previousSibling",n)},siblings:function(e){return xe((e.parentNode||{}).firstChild,e)},children:function(e){return xe(e.firstChild)},contents:function(e){return void 0!==e.contentDocument?e.contentDocument:(a(e,"template")&&(e=e.content||e),me.merge([],e.childNodes))}},(function(e,t){me.fn[e]=function(n,r){var i=me.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=me.filter(r,i)),this.length>1&&(Te[e]||me.uniqueSort(i),Se.test(e)&&i.reverse()),this.pushStack(i)}}));var Ee=/[^\x20\t\r\n\f]+/g;me.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return me.each(e.match(Ee)||[],(function(e,n){t[n]=1})),t}(e):me.extend({},e);var t,n,i,a,o=[],s=[],c=-1,l=function(){for(a=a||e.once,i=t=1;s.length;c=-1)for(n=s.shift();++c<o.length;)0==o[c].apply(n[0],n[1])&&e.stopOnFalse&&(c=o.length,n=0);e.memory||(n=0),t=0,a&&(o=n?[]:"")},u={add:function(){return o&&(n&&!t&&(c=o.length-1,s.push(n)),function t(n){me.each(n,(function(n,i){pe(i)?e.unique&&u.has(i)||o.push(i):i&&i.length&&"string"!==r(i)&&t(i)}))}(arguments),n&&!t&&l()),this},remove:function(){return me.each(arguments,(function(e,t){for(var n;(n=me.inArray(t,o,n))>-1;)o.splice(n,1),n<=c&&c--})),this},has:function(e){return e?me.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return a=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return a=s=[],n||t||(o=n=""),this},locked:function(){return!!a},fireWith:function(e,n){return a||(n=[e,(n=n||[]).slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!i}};return u},me.extend({Deferred:function(t){var n=[["notify","progress",me.Callbacks("memory"),me.Callbacks("memory"),2],["resolve","done",me.Callbacks("once memory"),me.Callbacks("once memory"),0,"resolved"],["reject","fail",me.Callbacks("once memory"),me.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return a.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return me.Deferred((function(t){me.each(n,(function(n,r){var i=pe(e[r[4]])&&e[r[4]];a[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&pe(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(t,r,i){function a(t,n,r,i){return function(){var s=this,u=arguments,h=function(){var e,h;if(!(t<o)){if((e=r.apply(s,u))===n.promise())throw new TypeError("Thenable self-resolution");h=e&&("object"==typeof e||"function"==typeof e)&&e.then,pe(h)?i?h.call(e,a(o,n,c,i),a(o,n,l,i)):(o++,h.call(e,a(o,n,c,i),a(o,n,l,i),a(o,n,c,n.notifyWith))):(r!==c&&(s=void 0,u=[e]),(i||n.resolveWith)(s,u))}},p=i?h:function(){try{h()}catch(e){me.Deferred.exceptionHook&&me.Deferred.exceptionHook(e,p.stackTrace),t+1>=o&&(r!==l&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?p():(me.Deferred.getStackHook&&(p.stackTrace=me.Deferred.getStackHook()),e.setTimeout(p))}}var o=0;return me.Deferred((function(e){n[0][3].add(a(0,e,pe(i)?i:c,e.notifyWith)),n[1][3].add(a(0,e,pe(t)?t:c)),n[2][3].add(a(0,e,pe(r)?r:l))})).promise()},promise:function(e){return null!=e?me.extend(e,i):i}},a={};return me.each(n,(function(e,t){var o=t[2],s=t[5];i[t[1]]=o.add,s&&o.add((function(){r=s}),n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),o.add(t[3].fire),a[t[0]]=function(){return a[t[0]+"With"](this===a?void 0:this,arguments),this},a[t[0]+"With"]=o.fireWith})),i.promise(a),t&&t.call(a,a),a},when:function(e){var t=arguments.length,n=t,r=Array(n),i=ne.call(arguments),a=me.Deferred(),o=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?ne.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&(u(e,a.done(o(n)).resolve,a.reject,!t),"pending"===a.state()||pe(i[n]&&i[n].then)))return a.then();for(;n--;)u(i[n],o(n),a.reject);return a.promise()}});var Ae=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;me.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&Ae.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},me.readyException=function(t){e.setTimeout((function(){throw t}))};var Le=me.Deferred();me.fn.ready=function(e){return Le.then(e).catch((function(e){me.readyException(e)})),this},me.extend({isReady:0,readyWait:1,ready:function(e){(1==e?--me.readyWait:me.isReady)||(me.isReady=1,1!=e&&--me.readyWait>0||Le.resolveWith(ee,[me]))}}),me.ready.then=Le.then,"complete"===ee.readyState||"loading"!==ee.readyState&&!ee.documentElement.doScroll?e.setTimeout(me.ready):(ee.addEventListener("DOMContentLoaded",h),e.addEventListener("load",h));var Ce=function(e,t,n,i,a,o,s){var c=0,l=e.length,u=null==n;if("object"===r(n))for(c in a=1,n)Ce(e,t,c,n[c],1,o,s);else if(void 0!==i&&(a=1,pe(i)||(s=1),u&&(s?(t.call(e,i),t=null):(u=t,t=function(e,t,n){return u.call(me(e),n)})),t))for(;c<l;c++)t(e[c],n,s?i:i.call(e[c],c,t(e[c],n)));return a?e:u?t.call(e):l?t(e[0],n):o},Re=/^-ms-/,Pe=/-([a-z])/g,Oe=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};f.uid=1,f.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Oe(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:1}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[d(t)]=n;else for(r in t)i[d(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][d(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(d):(t=d(t))in r?[t]:t.match(Ee)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||me.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!me.isEmptyObject(t)}};var Ne=new f,De=new f,Ie=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ze=/[A-Z]/g;me.extend({hasData:function(e){return De.hasData(e)||Ne.hasData(e)},data:function(e,t,n){return De.access(e,t,n)},removeData:function(e,t){De.remove(e,t)},_data:function(e,t,n){return Ne.access(e,t,n)},_removeData:function(e,t){Ne.remove(e,t)}}),me.fn.extend({data:function(e,t){var n,r,i,a=this[0],o=a&&a.attributes;if(void 0===e){if(this.length&&(i=De.get(a),1===a.nodeType&&!Ne.get(a,"hasDataAttrs"))){for(n=o.length;n--;)o[n]&&0===(r=o[n].name).indexOf("data-")&&(r=d(r.slice(5)),m(a,r,i[r]));Ne.set(a,"hasDataAttrs",1)}return i}return"object"==typeof e?this.each((function(){De.set(this,e)})):Ce(this,(function(t){var n;if(a&&void 0===t)return void 0!==(n=De.get(a,e))||void 0!==(n=m(a,e))?n:void 0;this.each((function(){De.set(this,e,t)}))}),null,t,arguments.length>1,null,1)},removeData:function(e){return this.each((function(){De.remove(this,e)}))}}),me.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Ne.get(e,t),n&&(!r||Array.isArray(n)?r=Ne.access(e,t,me.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=me.queue(e,t),r=n.length,i=n.shift(),a=me._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete a.stop,i.call(e,(function(){me.dequeue(e,t)}),a)),!r&&a&&a.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Ne.get(e,n)||Ne.access(e,n,{empty:me.Callbacks("once memory").add((function(){Ne.remove(e,[t+"queue",n])}))})}}),me.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?me.queue(this[0],e):void 0===t?this:this.each((function(){var n=me.queue(this,e,t);me._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&me.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){me.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=me.Deferred(),a=this,o=this.length,s=function(){--r||i.resolveWith(a,[a])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";o--;)(n=Ne.get(a[o],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var Be=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Ue=RegExp("^(?:([+-])=|)("+Be+")([a-z%]*)$","i"),Fe=["Top","Right","Bottom","Left"],He=ee.documentElement,ke=function(e){return me.contains(e.ownerDocument,e)},Ge={composed:1};He.getRootNode&&(ke=function(e){return me.contains(e.ownerDocument,e)||e.getRootNode(Ge)===e.ownerDocument});var je=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ke(e)&&"none"===me.css(e,"display")},Ve=function(e,t,n,r){var i,a,o={};for(a in t)o[a]=e.style[a],e.style[a]=t[a];for(a in i=n.apply(e,r||[]),t)e.style[a]=o[a];return i},We={};me.fn.extend({show:function(){return y(this,1)},hide:function(){return y(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){je(this)?me(this).show():me(this).hide()}))}});var qe=/^(?:checkbox|radio)$/i,Xe=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ye=/^$|^module$|\/(?:java|ecma)script/i,Ze={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Ze.optgroup=Ze.option,Ze.tbody=Ze.tfoot=Ze.colgroup=Ze.caption=Ze.thead,Ze.th=Ze.td;var Je,$e,Qe=/<|&#?\w+;/;Je=ee.createDocumentFragment().appendChild(ee.createElement("div")),($e=ee.createElement("input")).setAttribute("type","radio"),$e.setAttribute("checked","checked"),$e.setAttribute("name","t"),Je.appendChild($e),he.checkClone=Je.cloneNode(1).cloneNode(1).lastChild.checked,Je.innerHTML="<textarea>x</textarea>",he.noCloneChecked=!!Je.cloneNode(1).lastChild.defaultValue;var Ke=/^key/,et=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,tt=/^([^.]*)(?:\.(.+)|)/;me.event={global:{},add:function(e,t,n,r,i){var a,o,s,c,l,u,h,p,d,f,m,g=Ne.get(e);if(g)for(n.handler&&(n=(a=n).handler,i=a.selector),i&&me.find.matchesSelector(He,i),n.guid||(n.guid=me.guid++),(c=g.events)||(c=g.events={}),(o=g.handle)||(o=g.handle=function(t){return void 0!==me&&me.event.triggered!==t.type?me.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(Ee)||[""]).length;l--;)d=m=(s=tt.exec(t[l])||[])[1],f=(s[2]||"").split(".").sort(),d&&(h=me.event.special[d]||{},d=(i?h.delegateType:h.bindType)||d,h=me.event.special[d]||{},u=me.extend({type:d,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&me.expr.match.needsContext.test(i),namespace:f.join(".")},a),(p=c[d])||((p=c[d]=[]).delegateCount=0,h.setup&&0!=h.setup.call(e,r,f,o)||e.addEventListener&&e.addEventListener(d,o)),h.add&&(h.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,u):p.push(u),me.event.global[d]=1)},remove:function(e,t,n,r,i){var a,o,s,c,l,u,h,p,d,f,m,g=Ne.hasData(e)&&Ne.get(e);if(g&&(c=g.events)){for(l=(t=(t||"").match(Ee)||[""]).length;l--;)if(d=m=(s=tt.exec(t[l])||[])[1],f=(s[2]||"").split(".").sort(),d){for(h=me.event.special[d]||{},p=c[d=(r?h.delegateType:h.bindType)||d]||[],s=s[2]&&RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=a=p.length;a--;)u=p[a],!i&&m!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(p.splice(a,1),u.selector&&p.delegateCount--,h.remove&&h.remove.call(e,u));o&&!p.length&&(h.teardown&&0!=h.teardown.call(e,f,g.handle)||me.removeEvent(e,d,g.handle),delete c[d])}else for(d in c)me.event.remove(e,d+t[l],n,r,1);me.isEmptyObject(c)&&Ne.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,a,o,s=me.event.fix(e),c=Array(arguments.length),l=(Ne.get(this,"events")||{})[s.type]||[],u=me.event.special[s.type]||{};for(c[0]=s,t=1;t<arguments.length;t++)c[t]=arguments[t];if(s.delegateTarget=this,!u.preDispatch||0!=u.preDispatch.call(this,s)){for(o=me.event.handlers.call(this,s,l),t=0;(i=o[t++])&&!s.isPropagationStopped();)for(s.currentTarget=i.elem,n=0;(a=i.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&0!=a.namespace&&!s.rnamespace.test(a.namespace)||(s.handleObj=a,s.data=a.data,void 0!==(r=((me.event.special[a.origType]||{}).handle||a.handler).apply(i.elem,c))&&0==(s.result=r)&&(s.preventDefault(),s.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,i,a,o,s=[],c=t.delegateCount,l=e.target;if(c&&l.nodeType&&!("click"===e.type&&e.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||1!=l.disabled)){for(a=[],o={},n=0;n<c;n++)void 0===o[i=(r=t[n]).selector+" "]&&(o[i]=r.needsContext?me(i,this).index(l)>-1:me.find(i,this,null,[l]).length),o[i]&&a.push(r);a.length&&s.push({elem:l,handlers:a})}return l=this,c<t.length&&s.push({elem:l,handlers:t.slice(c)}),s},addProp:function(e,t){Object.defineProperty(me.Event.prototype,e,{enumerable:1,configurable:1,get:pe(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:1,configurable:1,writable:1,value:t})}})},fix:function(e){return e[me.expando]?e:new me.Event(e)},special:{load:{noBubble:1},click:{setup:function(e){var t=this||e;return qe.test(t.type)&&t.click&&a(t,"input")&&E(t,"click",_),0},trigger:function(e){var t=this||e;return qe.test(t.type)&&t.click&&a(t,"input")&&E(t,"click"),1},_default:function(e){var t=e.target;return qe.test(t.type)&&t.click&&a(t,"input")&&Ne.get(t,"click")||a(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},me.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},me.Event=function(e,t){if(!(this instanceof me.Event))return new me.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&0==e.returnValue?_:M,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&me.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[me.expando]=1},me.Event.prototype={constructor:me.Event,isDefaultPrevented:M,isPropagationStopped:M,isImmediatePropagationStopped:M,isSimulated:0,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=_,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=_,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=_,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},me.each({altKey:1,bubbles:1,cancelable:1,changedTouches:1,ctrlKey:1,detail:1,eventPhase:1,metaKey:1,pageX:1,pageY:1,shiftKey:1,view:1,char:1,code:1,charCode:1,key:1,keyCode:1,button:1,buttons:1,clientX:1,clientY:1,offsetX:1,offsetY:1,pointerId:1,pointerType:1,screenX:1,screenY:1,targetTouches:1,toElement:1,touches:1,which:function(e){var t=e.button;return null==e.which&&Ke.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&et.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},me.event.addProp),me.each({focus:"focusin",blur:"focusout"},(function(e,t){me.event.special[e]={setup:function(){return E(this,e,S),0},trigger:function(){return E(this,e),1},delegateType:t}})),me.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){me.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,a=e.handleObj;return i&&(i===r||me.contains(r,i))||(e.type=a.origType,n=a.handler.apply(this,arguments),e.type=t),n}}})),me.fn.extend({on:function(e,t,n,r){return T(this,e,t,n,r)},one:function(e,t,n,r){return T(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,me(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return 0!=t&&"function"!=typeof t||(n=t,t=void 0),0==n&&(n=M),this.each((function(){me.event.remove(this,e,n,t)}))}});var nt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,rt=/<script|<style|<link/i,it=/checked\s*(?:[^=]|=\s*.checked.)/i,at=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;me.extend({htmlPrefilter:function(e){return e.replace(nt,"<$1></$2>")},clone:function(e,t,n){var r,i,a,o,s=e.cloneNode(1),c=ke(e);if(!(he.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||me.isXMLDoc(e)))for(o=x(s),r=0,i=(a=x(e)).length;r<i;r++)P(a[r],o[r]);if(t)if(n)for(a=a||x(e),o=o||x(s),r=0,i=a.length;r<i;r++)R(a[r],o[r]);else R(e,s);return(o=x(s,"script")).length>0&&b(o,!c&&x(e,"script")),s},cleanData:function(e){for(var t,n,r,i=me.event.special,a=0;void 0!==(n=e[a]);a++)if(Oe(n)){if(t=n[Ne.expando]){if(t.events)for(r in t.events)i[r]?me.event.remove(n,r):me.removeEvent(n,r,t.handle);n[Ne.expando]=void 0}n[De.expando]&&(n[De.expando]=void 0)}}}),me.fn.extend({detach:function(e){return N(this,e,1)},remove:function(e){return N(this,e)},text:function(e){return Ce(this,(function(e){return void 0===e?me.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return O(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||A(this,e).appendChild(e)}))},prepend:function(){return O(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=A(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return O(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return O(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(me.cleanData(x(e,0)),e.textContent="");return this},clone:function(e,t){return e=null==e?0:e,t=null==t?e:t,this.map((function(){return me.clone(this,e,t)}))},html:function(e){return Ce(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!rt.test(e)&&!Ze[(Xe.exec(e)||["",""])[1].toLowerCase()]){e=me.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(me.cleanData(x(t,0)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return O(this,arguments,(function(t){var n=this.parentNode;me.inArray(this,e)<0&&(me.cleanData(x(this)),n&&n.replaceChild(t,this))}),e)}}),me.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){me.fn[e]=function(e){for(var n,r=[],i=me(e),a=i.length-1,o=0;o<=a;o++)n=o===a?this:this.clone(1),me(i[o])[t](n),ie.apply(r,n.get());return this.pushStack(r)}}));var ot=RegExp("^("+Be+")(?!px)[a-z%]+$","i"),st=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},ct=RegExp(Fe.join("|"),"i");!function(){function t(){if(l){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",He.appendChild(c).appendChild(l);var t=e.getComputedStyle(l);r="1%"!==t.top,s=12===n(t.marginLeft),l.style.right="60%",o=36===n(t.right),i=36===n(t.width),l.style.position="absolute",a=12===n(l.offsetWidth/3),He.removeChild(c),l=null}}function n(e){return Math.round(parseFloat(e))}var r,i,a,o,s,c=ee.createElement("div"),l=ee.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(1).style.backgroundClip="",he.clearCloneStyle="content-box"===l.style.backgroundClip,me.extend(he,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),o},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),s},scrollboxSize:function(){return t(),a}}))}();var lt=["Webkit","Moz","ms"],ut=ee.createElement("div").style,ht={},pt=/^(none|table(?!-c[ea]).+)/,dt=/^--/,ft={position:"absolute",visibility:"hidden",display:"block"},mt={letterSpacing:"0",fontWeight:"400"};me.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=D(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:1,columnCount:1,fillOpacity:1,flexGrow:1,flexShrink:1,fontWeight:1,gridArea:1,gridColumn:1,gridColumnEnd:1,gridColumnStart:1,gridRow:1,gridRowEnd:1,gridRowStart:1,lineHeight:1,opacity:1,order:1,orphans:1,widows:1,zIndex:1,zoom:1},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,a,o,s=d(t),c=dt.test(t),l=e.style;if(c||(t=z(s)),o=me.cssHooks[t]||me.cssHooks[s],void 0===n)return o&&"get"in o&&void 0!==(i=o.get(e,0,r))?i:l[t];"string"==(a=typeof n)&&(i=Ue.exec(n))&&i[1]&&(n=g(e,t,i),a="number"),null!=n&&n==n&&("number"!==a||c||(n+=i&&i[3]||(me.cssNumber[s]?"":"px")),he.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),o&&"set"in o&&void 0===(n=o.set(e,n,r))||(c?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,a,o,s=d(t);return dt.test(t)||(t=z(s)),(o=me.cssHooks[t]||me.cssHooks[s])&&"get"in o&&(i=o.get(e,1,n)),void 0===i&&(i=D(e,t,r)),"normal"===i&&t in mt&&(i=mt[t]),""===n||n?(a=parseFloat(i),1==n||isFinite(a)?a||0:i):i}}),me.each(["height","width"],(function(e,t){me.cssHooks[t]={get:function(e,n,r){if(n)return!pt.test(me.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?F(e,t,r):Ve(e,ft,(function(){return F(e,t,r)}))},set:function(e,n,r){var i,a=st(e),o=!he.scrollboxSize()&&"absolute"===a.position,s=(o||r)&&"border-box"===me.css(e,"boxSizing",0,a),c=r?U(e,t,r,s,a):0;return s&&o&&(c-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(a[t])-U(e,t,"border",0,a)-.5)),c&&(i=Ue.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=me.css(e,t)),B(0,n,c)}}})),me.cssHooks.marginLeft=I(he.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(D(e,"marginLeft"))||e.getBoundingClientRect().left-Ve(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),me.each({margin:"",padding:"",border:"Width"},(function(e,t){me.cssHooks[e+t]={expand:function(n){for(var r=0,i={},a="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+Fe[r]+t]=a[r]||a[r-2]||a[0];return i}},"margin"!==e&&(me.cssHooks[e+t].set=B)})),me.fn.extend({css:function(e,t){return Ce(this,(function(e,t,n){var r,i,a={},o=0;if(Array.isArray(t)){for(r=st(e),i=t.length;o<i;o++)a[t[o]]=me.css(e,t[o],0,r);return a}return void 0!==n?me.style(e,t,n):me.css(e,t)}),e,t,arguments.length>1)}}),me.Tween=H,H.prototype={constructor:H,init:function(e,t,n,r,i,a){this.elem=e,this.prop=n,this.easing=i||me.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=a||(me.cssNumber[n]?"":"px")},cur:function(){var e=H.propHooks[this.prop];return e&&e.get?e.get(this):H.propHooks._default.get(this)},run:function(e){var t,n=H.propHooks[this.prop];return this.options.duration?this.pos=t=me.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):H.propHooks._default.set(this),this}},H.prototype.init.prototype=H.prototype,H.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=me.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){me.fx.step[e.prop]?me.fx.step[e.prop](e):1!==e.elem.nodeType||!me.cssHooks[e.prop]&&null==e.elem.style[z(e.prop)]?e.elem[e.prop]=e.now:me.style(e.elem,e.prop,e.now+e.unit)}}},H.propHooks.scrollTop=H.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},me.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},me.fx=H.prototype.init,me.fx.step={};var gt,vt,yt=/^(?:toggle|show|hide)$/,xt=/queueHooks$/;me.Animation=me.extend(W,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return g(n.elem,e,Ue.exec(t),n),n}]},tweener:function(e,t){pe(e)?(t=e,e=["*"]):e=e.match(Ee);for(var n,r=0,i=e.length;r<i;r++)n=e[r],W.tweeners[n]=W.tweeners[n]||[],W.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,a,o,s,c,l,u,h="width"in t||"height"in t,p=this,d={},f=e.style,m=e.nodeType&&je(e),g=Ne.get(e,"fxshow");for(r in n.queue||(null==(o=me._queueHooks(e,"fx")).unqueued&&(o.unqueued=0,s=o.empty.fire,o.empty.fire=function(){o.unqueued||s()}),o.unqueued++,p.always((function(){p.always((function(){o.unqueued--,me.queue(e,"fx").length||o.empty.fire()}))}))),t)if(i=t[r],yt.test(i)){if(delete t[r],a=a||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;m=1}d[r]=g&&g[r]||me.style(e,r)}if((c=!me.isEmptyObject(t))||!me.isEmptyObject(d))for(r in h&&1===e.nodeType&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],null==(l=g&&g.display)&&(l=Ne.get(e,"display")),"none"===(u=me.css(e,"display"))&&(l?u=l:(y([e],1),l=e.style.display||l,u=me.css(e,"display"),y([e]))),("inline"===u||"inline-block"===u&&null!=l)&&"none"===me.css(e,"float")&&(c||(p.done((function(){f.display=l})),null==l&&(u=f.display,l="none"===u?"":u)),f.display="inline-block")),n.overflow&&(f.overflow="hidden",p.always((function(){f.overflow=n.overflow[0],f.overflowX=n.overflow[1],f.overflowY=n.overflow[2]}))),c=0,d)c||(g?"hidden"in g&&(m=g.hidden):g=Ne.access(e,"fxshow",{display:l}),a&&(g.hidden=!m),m&&y([e],1),p.done((function(){for(r in m||y([e]),Ne.remove(e,"fxshow"),d)me.style(e,r,d[r])}))),c=V(m?g[r]:0,r,p),r in g||(g[r]=c.start,m&&(c.end=c.start,c.start=0))}],prefilter:function(e,t){t?W.prefilters.unshift(e):W.prefilters.push(e)}}),me.speed=function(e,t,n){var r=e&&"object"==typeof e?me.extend({},e):{complete:n||!n&&t||pe(e)&&e,duration:e,easing:n&&t||t&&!pe(t)&&t};return me.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in me.fx.speeds?r.duration=me.fx.speeds[r.duration]:r.duration=me.fx.speeds._default),null!=r.queue&&1!=r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){pe(r.old)&&r.old.call(this),r.queue&&me.dequeue(this,r.queue)},r},me.fn.extend({fadeTo:function(e,t,n,r){return this.filter(je).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=me.isEmptyObject(e),a=me.speed(t,n,r),o=function(){var t=W(this,me.extend({},e),a);(i||Ne.get(this,"finish"))&&t.stop(1)};return o.finish=o,i||0==a.queue?this.each(o):this.queue(a.queue,o)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&0!=e&&this.queue(e||"fx",[]),this.each((function(){var t=1,i=null!=e&&e+"queueHooks",a=me.timers,o=Ne.get(this);if(i)o[i]&&o[i].stop&&r(o[i]);else for(i in o)o[i]&&o[i].stop&&xt.test(i)&&r(o[i]);for(i=a.length;i--;)a[i].elem!==this||null!=e&&a[i].queue!==e||(a[i].anim.stop(n),t=0,a.splice(i,1));!t&&n||me.dequeue(this,e)}))},finish:function(e){return 0!=e&&(e=e||"fx"),this.each((function(){var t,n=Ne.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],a=me.timers,o=r?r.length:0;for(n.finish=1,me.queue(this,e,[]),i&&i.stop&&i.stop.call(this,1),t=a.length;t--;)a[t].elem===this&&a[t].queue===e&&(a[t].anim.stop(1),a.splice(t,1));for(t=0;t<o;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish}))}}),me.each(["toggle","show","hide"],(function(e,t){var n=me.fn[t];me.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(j(t,1),e,r,i)}})),me.each({slideDown:j("show"),slideUp:j("hide"),slideToggle:j("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){me.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}})),me.timers=[],me.fx.tick=function(){var e,t=0,n=me.timers;for(gt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||me.fx.stop(),gt=void 0},me.fx.timer=function(e){me.timers.push(e),me.fx.start()},me.fx.interval=13,me.fx.start=function(){vt||(vt=1,k())},me.fx.stop=function(){vt=null},me.fx.speeds={slow:600,fast:200,_default:400},me.fn.delay=function(t,n){return t=me.fx&&me.fx.speeds[t]||t,n=n||"fx",this.queue(n,(function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}}))},function(){var e=ee.createElement("input"),t=ee.createElement("select").appendChild(ee.createElement("option"));e.type="checkbox",he.checkOn=""!==e.value,he.optSelected=t.selected,(e=ee.createElement("input")).value="t",e.type="radio",he.radioValue="t"===e.value}();var bt,wt=me.expr.attrHandle;me.fn.extend({attr:function(e,t){return Ce(this,me.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){me.removeAttr(this,e)}))}}),me.extend({attr:function(e,t,n){var r,i,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return void 0===e.getAttribute?me.prop(e,t,n):(1===a&&me.isXMLDoc(e)||(i=me.attrHooks[t.toLowerCase()]||(me.expr.match.bool.test(t)?bt:void 0)),void 0!==n?null===n?void me.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=me.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!he.radioValue&&"radio"===t&&a(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(Ee);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),bt={set:function(e,t,n){return 0==t?me.removeAttr(e,n):e.setAttribute(n,n),n}},me.each(me.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=wt[t]||me.find.attr;wt[t]=function(e,t,r){var i,a,o=t.toLowerCase();return r||(a=wt[o],wt[o]=i,i=null!=n(e,t,r)?o:null,wt[o]=a),i}}));var _t=/^(?:input|select|textarea|button)$/i,Mt=/^(?:a|area)$/i;me.fn.extend({prop:function(e,t){return Ce(this,me.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[me.propFix[e]||e]}))}}),me.extend({prop:function(e,t,n){var r,i,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&me.isXMLDoc(e)||(t=me.propFix[t]||t,i=me.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=me.find.attr(e,"tabindex");return t?parseInt(t,10):_t.test(e.nodeName)||Mt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),he.optSelected||(me.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),me.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){me.propFix[this.toLowerCase()]=this})),me.fn.extend({addClass:function(e){var t,n,r,i,a,o,s,c=0;if(pe(e))return this.each((function(t){me(this).addClass(e.call(this,t,X(this)))}));if((t=Y(e)).length)for(;n=this[c++];)if(i=X(n),r=1===n.nodeType&&" "+q(i)+" "){for(o=0;a=t[o++];)r.indexOf(" "+a+" ")<0&&(r+=a+" ");i!==(s=q(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,a,o,s,c=0;if(pe(e))return this.each((function(t){me(this).removeClass(e.call(this,t,X(this)))}));if(!arguments.length)return this.attr("class","");if((t=Y(e)).length)for(;n=this[c++];)if(i=X(n),r=1===n.nodeType&&" "+q(i)+" "){for(o=0;a=t[o++];)for(;r.indexOf(" "+a+" ")>-1;)r=r.replace(" "+a+" "," ");i!==(s=q(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):pe(e)?this.each((function(n){me(this).toggleClass(e.call(this,n,X(this),t),t)})):this.each((function(){var t,i,a,o;if(r)for(i=0,a=me(this),o=Y(e);t=o[i++];)a.hasClass(t)?a.removeClass(t):a.addClass(t);else void 0!==e&&"boolean"!==n||((t=X(this))&&Ne.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||0==e?"":Ne.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+q(X(n))+" ").indexOf(t)>-1)return 1;return 0}});var St=/\r/g;me.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=pe(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,me(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=me.map(i,(function(e){return null==e?"":e+""}))),(t=me.valHooks[this.type]||me.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=me.valHooks[i.type]||me.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(St,""):null==n?"":n:void 0}}),me.extend({valHooks:{option:{get:function(e){var t=me.find.attr(e,"value");return null!=t?t:q(me.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,s="select-one"===e.type,c=s?null:[],l=s?o+1:i.length;for(r=o<0?l:s?o:0;r<l;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!a(n.parentNode,"optgroup"))){if(t=me(n).val(),s)return t;c.push(t)}return c},set:function(e,t){for(var n,r,i=e.options,a=me.makeArray(t),o=i.length;o--;)((r=i[o]).selected=me.inArray(me.valHooks.option.get(r),a)>-1)&&(n=1);return n||(e.selectedIndex=-1),a}}}}),me.each(["radio","checkbox"],(function(){me.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=me.inArray(me(e).val(),t)>-1}},he.checkOn||(me.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),he.focusin="onfocusin"in e;var Tt=/^(?:focusinfocus|focusoutblur)$/,Et=function(e){e.stopPropagation()};me.extend(me.event,{trigger:function(t,n,r,i){var a,o,s,c,l,u,h,p,d=[r||ee],f=ce.call(t,"type")?t.type:t,m=ce.call(t,"namespace")?t.namespace.split("."):[];if(o=p=s=r=r||ee,3!==r.nodeType&&8!==r.nodeType&&!Tt.test(f+me.event.triggered)&&(f.indexOf(".")>-1&&(m=f.split("."),f=m.shift(),m.sort()),l=f.indexOf(":")<0&&"on"+f,(t=t[me.expando]?t:new me.Event(f,"object"==typeof t&&t)).isTrigger=i?2:3,t.namespace=m.join("."),t.rnamespace=t.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:me.makeArray(n,[t]),h=me.event.special[f]||{},i||!h.trigger||0!=h.trigger.apply(r,n))){if(!i&&!h.noBubble&&!de(r)){for(c=h.delegateType||f,Tt.test(c+f)||(o=o.parentNode);o;o=o.parentNode)d.push(o),s=o;s===(r.ownerDocument||ee)&&d.push(s.defaultView||s.parentWindow||e)}for(a=0;(o=d[a++])&&!t.isPropagationStopped();)p=o,t.type=a>1?c:h.bindType||f,(u=(Ne.get(o,"events")||{})[t.type]&&Ne.get(o,"handle"))&&u.apply(o,n),(u=l&&o[l])&&u.apply&&Oe(o)&&(t.result=u.apply(o,n),0==t.result&&t.preventDefault());return t.type=f,i||t.isDefaultPrevented()||h._default&&0!=h._default.apply(d.pop(),n)||!Oe(r)||l&&pe(r[f])&&!de(r)&&((s=r[l])&&(r[l]=null),me.event.triggered=f,t.isPropagationStopped()&&p.addEventListener(f,Et),r[f](),t.isPropagationStopped()&&p.removeEventListener(f,Et),me.event.triggered=void 0,s&&(r[l]=s)),t.result}},simulate:function(e,t,n){var r=me.extend(new me.Event,n,{type:e,isSimulated:1});me.event.trigger(r,null,t)}}),me.fn.extend({trigger:function(e,t){return this.each((function(){me.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return me.event.trigger(e,t,n,1)}}),he.focusin||me.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){me.event.simulate(t,e.target,me.event.fix(e))};me.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=Ne.access(r,t);i||r.addEventListener(e,n,1),Ne.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=Ne.access(r,t)-1;i?Ne.access(r,t,i):(r.removeEventListener(e,n,1),Ne.remove(r,t))}}}));var At=e.location,Lt=Date.now(),Ct=/\?/;me.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||me.error("Invalid XML: "+t),n};var Rt=/\[\]$/,Pt=/\r?\n/g,Ot=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;me.param=function(e,t){var n,r=[],i=function(e,t){var n=pe(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!me.isPlainObject(e))me.each(e,(function(){i(this.name,this.value)}));else for(n in e)Z(n,e[n],t,i);return r.join("&")},me.fn.extend({serialize:function(){return me.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=me.prop(this,"elements");return e?me.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!me(this).is(":disabled")&&Nt.test(this.nodeName)&&!Ot.test(e)&&(this.checked||!qe.test(e))})).map((function(e,t){var n=me(this).val();return null==n?null:Array.isArray(n)?me.map(n,(function(e){return{name:t.name,value:e.replace(Pt,"\r\n")}})):{name:t.name,value:n.replace(Pt,"\r\n")}})).get()}});var Dt=/%20/g,It=/#.*$/,zt=/([?&])_=[^&]*/,Bt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ut=/^(?:GET|HEAD)$/,Ft=/^\/\//,Ht={},kt={},Gt=ee.createElement("a");Gt.href=At.href,me.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:At.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(At.protocol),global:1,processData:1,async:1,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":"*/*",text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":1,"text json":JSON.parse,"text xml":me.parseXML},flatOptions:{url:1,context:1}},ajaxSetup:function(e,t){return t?Q(Q(e,me.ajaxSettings),t):Q(me.ajaxSettings,e)},ajaxPrefilter:J(Ht),ajaxTransport:J(kt),ajax:function(t,n){function r(t,n,r,s){var l,p,d,b,w,_=n;u||(u=1,c&&e.clearTimeout(c),i=void 0,o=s||"",M.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(b=function(e,t,n){for(var r,i,a,o,s=e.contents,c=e.dataTypes;"*"===c[0];)c.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){c.unshift(i);break}if(c[0]in n)a=c[0];else{for(i in n){if(!c[0]||e.converters[i+" "+c[0]]){a=i;break}o||(o=i)}a=a||o}if(a)return a!==c[0]&&c.unshift(a),n[a]}(f,M,r)),b=function(e,t,n,r){var i,a,o,s,c,l={},u=e.dataTypes.slice();if(u[1])for(o in e.converters)l[o.toLowerCase()]=e.converters[o];for(a=u.shift();a;)if(e.responseFields[a]&&(n[e.responseFields[a]]=t),!c&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),c=a,a=u.shift())if("*"===a)a=c;else if("*"!==c&&c!==a){if(!(o=l[c+" "+a]||l["* "+a]))for(i in l)if((s=i.split(" "))[1]===a&&(o=l[c+" "+s[0]]||l["* "+s[0]])){1==o?o=l[i]:1!=l[i]&&(a=s[0],u.unshift(s[1]));break}if(1!=o)if(o&&e.throws)t=o(t);else try{t=o(t)}catch(e){return{state:"parsererror",error:o?e:"No conversion from "+c+" to "+a}}}return{state:"success",data:t}}(f,b,M,l),l?(f.ifModified&&((w=M.getResponseHeader("Last-Modified"))&&(me.lastModified[a]=w),(w=M.getResponseHeader("etag"))&&(me.etag[a]=w)),204===t||"HEAD"===f.type?_="nocontent":304===t?_="notmodified":(_=b.state,p=b.data,l=!(d=b.error))):(d=_,!t&&_||(_="error",t<0&&(t=0))),M.status=t,M.statusText=(n||_)+"",l?v.resolveWith(m,[p,_,M]):v.rejectWith(m,[M,_,d]),M.statusCode(x),x=void 0,h&&g.trigger(l?"ajaxSuccess":"ajaxError",[M,f,l?p:d]),y.fireWith(m,[M,_]),h&&(g.trigger("ajaxComplete",[M,f]),--me.active||me.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,a,o,s,c,l,u,h,p,d,f=me.ajaxSetup({},n),m=f.context||f,g=f.context&&(m.nodeType||m.jquery)?me(m):me.event,v=me.Deferred(),y=me.Callbacks("once memory"),x=f.statusCode||{},b={},w={},_="canceled",M={readyState:0,getResponseHeader:function(e){var t;if(u){if(!s)for(s={};t=Bt.exec(o);)s[t[1].toLowerCase()+" "]=(s[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=s[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(e,t){return null==u&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==u&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)M.always(e[M.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||_;return i&&i.abort(t),r(0,t),this}};if(v.promise(M),f.url=((t||f.url||At.href)+"").replace(Ft,At.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(Ee)||[""],null==f.crossDomain){l=ee.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Gt.protocol+"//"+Gt.host!=l.protocol+"//"+l.host}catch(e){f.crossDomain=1}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=me.param(f.data,f.traditional)),$(Ht,f,n,M),u)return M;for(p in(h=me.event&&f.global)&&0==me.active++&&me.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Ut.test(f.type),a=f.url.replace(It,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Dt,"+")):(d=f.url.slice(a.length),f.data&&(f.processData||"string"==typeof f.data)&&(a+=(Ct.test(a)?"&":"?")+f.data,delete f.data),0==f.cache&&(a=a.replace(zt,"$1"),d=(Ct.test(a)?"&":"?")+"_="+Lt+++d),f.url=a+d),f.ifModified&&(me.lastModified[a]&&M.setRequestHeader("If-Modified-Since",me.lastModified[a]),me.etag[a]&&M.setRequestHeader("If-None-Match",me.etag[a])),(f.data&&f.hasContent&&0!=f.contentType||n.contentType)&&M.setRequestHeader("Content-Type",f.contentType),M.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", */*; q=0.01":""):f.accepts["*"]),f.headers)M.setRequestHeader(p,f.headers[p]);if(f.beforeSend&&(0==f.beforeSend.call(m,M,f)||u))return M.abort();if(_="abort",y.add(f.complete),M.done(f.success),M.fail(f.error),i=$(kt,f,n,M)){if(M.readyState=1,h&&g.trigger("ajaxSend",[M,f]),u)return M;f.async&&f.timeout>0&&(c=e.setTimeout((function(){M.abort("timeout")}),f.timeout));try{u=0,i.send(b,r)}catch(e){if(u)throw e;r(-1,e)}}else r(-1,"No Transport");return M},getJSON:function(e,t,n){return me.get(e,t,n,"json")},getScript:function(e,t){return me.get(e,void 0,t,"script")}}),me.each(["get","post"],(function(e,t){me[t]=function(e,n,r,i){return pe(n)&&(i=i||r,r=n,n=void 0),me.ajax(me.extend({url:e,type:t,dataType:i,data:n,success:r},me.isPlainObject(e)&&e))}})),me._evalUrl=function(e,t){return me.ajax({url:e,type:"GET",dataType:"script",cache:1,async:0,global:0,converters:{"text script":function(){}},dataFilter:function(e){me.globalEval(e,t)}})},me.fn.extend({wrapAll:function(e){var t;return this[0]&&(pe(e)&&(e=e.call(this[0])),t=me(e,this[0].ownerDocument).eq(0).clone(1),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return pe(e)?this.each((function(t){me(this).wrapInner(e.call(this,t))})):this.each((function(){var t=me(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=pe(e);return this.each((function(n){me(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){me(this).replaceWith(this.childNodes)})),this}}),me.expr.pseudos.hidden=function(e){return!me.expr.pseudos.visible(e)},me.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},me.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var jt={0:200,1223:204},Vt=me.ajaxSettings.xhr();he.cors=!!Vt&&"withCredentials"in Vt,he.ajax=Vt=!!Vt,me.ajaxTransport((function(t){var n,r;if(he.cors||Vt&&!t.crossDomain)return{send:function(i,a){var o,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)s[o]=t.xhrFields[o];for(o in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(o,i[o]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?a(0,"error"):a(s.status,s.statusText):a(jt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout((function(){n&&r()}))},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}})),me.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=0)})),me.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return me.globalEval(e),e}}}),me.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=0),e.crossDomain&&(e.type="GET")})),me.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=me("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),ee.head.appendChild(t[0])},abort:function(){n&&n()}}}));var Wt,qt=[],Xt=/(=)\?(?=&|$)|\?\?/;me.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=qt.pop()||me.expando+"_"+Lt++;return this[e]=1,e}}),me.ajaxPrefilter("json jsonp",(function(t,n,r){var i,a,o,s=0!=t.jsonp&&(Xt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Xt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=pe(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Xt,"$1"+i):0!=t.jsonp&&(t.url+=(Ct.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return o||me.error(i+" was not called"),o[0]},t.dataTypes[0]="json",a=e[i],e[i]=function(){o=arguments},r.always((function(){void 0===a?me(e).removeProp(i):e[i]=a,t[i]&&(t.jsonpCallback=n.jsonpCallback,qt.push(i)),o&&pe(a)&&a(o[0]),o=a=void 0})),"script"})),he.createHTMLDocument=((Wt=ee.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Wt.childNodes.length),me.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=0),t||(he.createHTMLDocument?((r=(t=ee.implementation.createHTMLDocument("")).createElement("base")).href=ee.location.href,t.head.appendChild(r)):t=ee),a=!n&&[],(i=we.exec(e))?[t.createElement(i[1])]:(i=w([e],t,a),a&&a.length&&me(a).remove(),me.merge([],i.childNodes)));var r,i,a},me.fn.load=function(e,t,n){var r,i,a,o=this,s=e.indexOf(" ");return s>-1&&(r=q(e.slice(s)),e=e.slice(0,s)),pe(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),o.length>0&&me.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done((function(e){a=arguments,o.html(r?me("<div>").append(me.parseHTML(e)).find(r):e)})).always(n&&function(e,t){o.each((function(){n.apply(this,a||[e.responseText,t,e])}))}),this},me.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){me.fn[t]=function(e){return this.on(t,e)}})),me.expr.pseudos.animated=function(e){return me.grep(me.timers,(function(t){return e===t.elem})).length},me.offset={setOffset:function(e,t,n){var r,i,a,o,s,c,l=me.css(e,"position"),u=me(e),h={};"static"===l&&(e.style.position="relative"),s=u.offset(),a=me.css(e,"top"),c=me.css(e,"left"),("absolute"===l||"fixed"===l)&&(a+c).indexOf("auto")>-1?(o=(r=u.position()).top,i=r.left):(o=parseFloat(a)||0,i=parseFloat(c)||0),pe(t)&&(t=t.call(e,n,me.extend({},s))),null!=t.top&&(h.top=t.top-s.top+o),null!=t.left&&(h.left=t.left-s.left+i),"using"in t?t.using.call(e,h):u.css(h)}},me.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){me.offset.setOffset(this,e,t)}));var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===me.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===me.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=me(e).offset()).top+=me.css(e,"borderTopWidth",1),i.left+=me.css(e,"borderLeftWidth",1))}return{top:t.top-i.top-me.css(r,"marginTop",1),left:t.left-i.left-me.css(r,"marginLeft",1)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===me.css(e,"position");)e=e.offsetParent;return e||He}))}}),me.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;me.fn[e]=function(r){return Ce(this,(function(e,r,i){var a;if(de(e)?a=e:9===e.nodeType&&(a=e.defaultView),void 0===i)return a?a[t]:e[r];a?a.scrollTo(n?a.pageXOffset:i,n?i:a.pageYOffset):e[r]=i}),e,r,arguments.length)}})),me.each(["top","left"],(function(e,t){me.cssHooks[t]=I(he.pixelPosition,(function(e,n){if(n)return n=D(e,t),ot.test(n)?me(e).position()[t]+"px":n}))})),me.each({Height:"height",Width:"width"},(function(e,t){me.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){me.fn[r]=function(i,a){var o=arguments.length&&(n||"boolean"!=typeof i),s=n||(1==i||1==a?"margin":"border");return Ce(this,(function(t,n,i){var a;return de(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(a=t.documentElement,Math.max(t.body["scroll"+e],a["scroll"+e],t.body["offset"+e],a["offset"+e],a["client"+e])):void 0===i?me.css(t,n,s):me.style(t,n,i,s)}),t,o?i:void 0,o)}}))})),me.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){me.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}})),me.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),me.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),me.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),pe(e))return r=ne.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(ne.call(arguments)))}).guid=e.guid=e.guid||me.guid++,i},me.holdReady=function(e){e?me.readyWait++:me.ready(1)},me.isArray=Array.isArray,me.parseJSON=JSON.parse,me.nodeName=a,me.isFunction=pe,me.isWindow=de,me.camelCase=d,me.type=r,me.now=Date.now,me.isNumeric=function(e){var t=me.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))};var Yt=e.jQuery,Zt=e.$;return me.noConflict=function(t){return e.$===me&&(e.$=Zt),t&&e.jQuery===me&&(e.jQuery=Yt),me},t||(e.jQuery=e.$=me),me}))}));!function(e,t){function n(e,t,n){o.addMethod(t,n,e.unbindEvent),o.addMethod(t,n,e.unbindEventWithSelectorOrCallback),o.addMethod(t,n,e.unbindEventWithSelectorAndCallback)}function r(e){e.arrive=l.bindEvent,n(l,e,"unbindArrive"),e.leave=u.bindEvent,n(u,e,"unbindLeave")}if(e.MutationObserver&&"undefined"!=typeof HTMLElement){var i,a=0,o=(i=HTMLElement.prototype.matches||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector,{matchesSelector:function(e,t){return e instanceof HTMLElement&&i.call(e,t)},addMethod:function(e,t,n){var r=e[t];e[t]=function(){return n.length==arguments.length?n.apply(this,arguments):"function"==typeof r?r.apply(this,arguments):void 0}},callCallbacks:function(e,t){t&&t.options.onceOnly&&1==t.firedElems.length&&(e=[e[0]]);for(var n,r=0;n=e[r];r++)n&&n.callback&&n.callback.call(n.elem,n.elem);t&&t.options.onceOnly&&1==t.firedElems.length&&t.me.unbindEventWithSelectorAndCallback.call(t.target,t.selector,t.callback)},checkChildNodesRecursively:function(e,t,n,r){for(var i,a=0;i=e[a];a++)n(i,t,r)&&r.push({callback:t.callback,elem:i}),i.childNodes.length>0&&o.checkChildNodesRecursively(i.childNodes,t,n,r)},mergeArrays:function(e,t){var n,r={};for(n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);for(n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);return r},toElementsArray:function(t){return void 0===t||"number"==typeof t.length&&t!==e||(t=[t]),t}}),s=function(){var e=function(){this._eventsBucket=[],this._beforeAdding=null,this._beforeRemoving=null};return e.prototype.addEvent=function(e,t,n,r){var i={target:e,selector:t,options:n,callback:r,firedElems:[]};return this._beforeAdding&&this._beforeAdding(i),this._eventsBucket.push(i),i},e.prototype.removeEvent=function(e){for(var t,n=this._eventsBucket.length-1;t=this._eventsBucket[n];n--)if(e(t)){this._beforeRemoving&&this._beforeRemoving(t);var r=this._eventsBucket.splice(n,1);r&&r.length&&(r[0].callback=null)}},e.prototype.beforeAdding=function(e){this._beforeAdding=e},e.prototype.beforeRemoving=function(e){this._beforeRemoving=e},e}(),c=function(t,n){var r=new s,i=this,a={fireOnAttributesModification:0};return r.beforeAdding((function(r){var a,o=r.target;o!==e.document&&o!==e||(o=document.getElementsByTagName("html")[0]),a=new MutationObserver((function(e){n.call(this,e,r)}));var s=t(r.options);a.observe(o,s),r.observer=a,r.me=i})),r.beforeRemoving((function(e){e.observer.disconnect()})),this.bindEvent=function(e,t,n){t=o.mergeArrays(a,t);for(var i=o.toElementsArray(this),s=0;s<i.length;s++)r.addEvent(i[s],e,t,n)},this.unbindEvent=function(){var e=o.toElementsArray(this);r.removeEvent((function(t){for(var n=0;n<e.length;n++)if(void 0===this||t.target===e[n])return 1;return 0}))},this.unbindEventWithSelectorOrCallback=function(e){var t,n=o.toElementsArray(this),i=e;t="function"==typeof e?function(e){for(var t=0;t<n.length;t++)if((void 0===this||e.target===n[t])&&e.callback===i)return 1;return 0}:function(t){for(var r=0;r<n.length;r++)if((void 0===this||t.target===n[r])&&t.selector===e)return 1;return 0},r.removeEvent(t)},this.unbindEventWithSelectorAndCallback=function(e,t){var n=o.toElementsArray(this);r.removeEvent((function(r){for(var i=0;i<n.length;i++)if((void 0===this||r.target===n[i])&&r.selector===e&&r.callback===t)return 1;return 0}))},this},l=new function(){function e(e,t){return o.matchesSelector(e,t.selector)&&(void 0===e._id&&(e._id=a++),-1==t.firedElems.indexOf(e._id))?(t.firedElems.push(e._id),1):0}var t={fireOnAttributesModification:0,onceOnly:0,existing:0},n=(l=new c((function(e){var t={attributes:0,childList:1,subtree:1};return e.fireOnAttributesModification&&(t.attributes=1),t}),(function(t,n){t.forEach((function(t){var r=t.addedNodes,i=t.target,a=[];null!==r&&r.length>0?o.checkChildNodesRecursively(r,n,e,a):"attributes"===t.type&&e(i,n)&&a.push({callback:n.callback,elem:i}),o.callCallbacks(a,n)}))}))).bindEvent;return l.bindEvent=function(e,r,i){void 0===i?(i=r,r=t):r=o.mergeArrays(t,r);var a=o.toElementsArray(this);if(r.existing){for(var s=[],c=0;c<a.length;c++)for(var l=a[c].querySelectorAll(e),u=0;u<l.length;u++)s.push({callback:i,elem:l[u]});if(r.onceOnly&&s.length)return i.call(s[0].elem,s[0].elem);setTimeout(o.callCallbacks,1,s)}n.call(this,e,r,i)},l},u=new function(){function e(e,t){return o.matchesSelector(e,t.selector)}var t={},n=(u=new c((function(){return{childList:1,subtree:1}}),(function(t,n){t.forEach((function(t){var r=t.removedNodes,i=[];null!==r&&r.length>0&&o.checkChildNodesRecursively(r,n,e,i),o.callCallbacks(i,n)}))}))).bindEvent;return u.bindEvent=function(e,r,i){void 0===i?(i=r,r=t):r=o.mergeArrays(t,r),n.call(this,e,r,i)},u};t&&r(t.fn),r(HTMLElement.prototype),r(NodeList.prototype),r(HTMLCollection.prototype),r(HTMLDocument.prototype),r(Window.prototype);var h={};n(l,h,"unbindAllArrive"),n(u,h,"unbindAllLeave")}}(window,"undefined"==typeof jQuery?null:jQuery);let Bl,Ul=(new l).makeRotationX(90*Math.PI/180),Fl=(new l).makeScale(10,10,10),Hl=new c;document.body.arrive(".footer",{onceOnly:1,existing:1},(function(){var e={"margin-left":"10px",width:"50px"},t={};zl(".footer").empty(),zl(".content-side > .headerMenu-container").remove(),zl("#subDSltLabel").remove(),zl("#subdivideSLT").remove(),zl("#topSaveStl").remove(),zl("#topSaveObj").remove(),zl("#butSaveStl").remove(),zl("#butSaveObj").remove(),zl("#jsonImport").remove(),zl("#jsonExport").remove();var n=zl(".headerMenu-container").first();n.css({display:"flex","justify-content":"center","align-content":"center","align-items":"center"}),n.append(zl("<label />",{css:e,class:"jss7",id:"subDSltLabel",text:"Quality:",title:"Subdivision Passes",for:"subdivideSLT"})).append(zl("<input />",{css:e,class:"jss7 jss9 jss10",id:"subdivideSLT",name:"subdivideSLT",title:"Subdivision Passes",type:"number",min:"0",max:"2",step:"1",value:"0"})).append(zl("<a />",{css:e,class:"jss7 jss9 jss10",id:"topSaveStl",text:"💾 .stl",title:"Download in STL Format"}).on("click",Sa)).append(zl("<a />",{css:e,class:"jss7 jss9 jss10",id:"topSaveObj",text:"💾 .obj",title:"Download in OBJ Format"}).on("click",Ta)),zl(".editorFooter").prepend(zl("<a />",{css:t,class:"shop-button clickable",id:"butSaveStl",text:"💾 .stl",title:"Download in STL Format"}).on("click",Sa)).prepend(zl("<a />",{css:t,class:"shop-button clickable",id:"butSaveObj",text:"💾 .obj",title:"Download in OBJ Format"}).on("click",Ta)),zl(".headerMenu-nav-scroll:first").append([zl('<label id="jsonImport" for="import" ><span class="headerMenu-nav-item" href="#" target="_self"><input type="file" id="import" name="import" style="display: none;"/><div class="headerMenu-nav-item-img"><span style="width:20px">🡅</span></div><div class="headerMenu-nav-item-text">Import</div></span></label>').on("click",Aa),zl('<a id="jsonExport" class="headerMenu-nav-item" href="#" target="_self"><div class="headerMenu-nav-item-img"><span style="width:20px">🡇</span></div><div class="headerMenu-nav-item-text">Export</div></a>').on("click",Ea),zl().on("change",Aa)])}))},"function"==typeof define&&define.amd?define(e):e();