lkspencer-Herosaver/dist/saver.min.js

27 lines
646 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 t;t=function(){"use strict";function t(){}function e(t,e){this.x=t||0,this.y=e||0}function n(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length}function i(t,r,a,o,s,c,l,u,h,p){Object.defineProperty(this,"id",{value:Oa++}),this.uuid=Pa.generateUUID(),this.name="",this.image=void 0!==t?t:i.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==r?r:i.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 e(0,0),this.repeat=new e(1,1),this.center=new e(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 r(t,e,n,i){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==i?i:1}function a(t,e,n){this.width=t,this.height=e,this.scissor=new r(0,0,t,e),this.scissorTest=0,this.viewport=new r(0,0,t,e),n=n||{},this.texture=new i(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=t,this.texture.image.height=e,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(t,e,n){a.call(this,t,e,n),this.samples=4}function s(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==i?i:1}function c(t,e,n){this.x=t||0,this.y=e||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}function u(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._order=i||u.DefaultOrder}function h(){this.mask=1}function p(){Object.defineProperty(this,"id",{value:Wa++}),this.uuid=Pa.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=p.DefaultUp.clone();var t=new c,e=new u,i=new s,r=new c(1,1,1);e._onChange((function(){i.setFromEuler(e,0)})),i._onChange((function(){e.setFromQuaternion(i,void 0,0)})),Object.defineProperties(this,{position:{configurable:1,enumerable:1,value:t},rotation:{configurable:1,enumerable:1,value:e},quaternion:{configurable:1,enumerable:1,value:i},scale:{configurable:1,enumerable:1,value:r},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(t,e){this.min=void 0!==t?t:new c(1/0,1/0,1/0),this.max=void 0!==e?e:new c(-1/0,-1/0,-1/0)}function m(t,e,n,i,r){var a,o;for(a=0,o=t.length-3;a<=o;a+=3){vo.fromArray(t,a);var s=r.x*Math.abs(vo.x)+r.y*Math.abs(vo.y)+r.z*Math.abs(vo.z),c=e.dot(vo),l=n.dot(vo),u=i.dot(vo);if(Math.max(-Math.max(c,l,u),Math.min(c,l,u))>s)return 0}return 1}function v(t,e){this.center=void 0!==t?t:new c,this.radius=void 0!==e?e:0}function g(t,e){this.origin=void 0!==t?t:new c,this.direction=void 0!==e?e:new c(0,0,-1)}function y(t,e){this.normal=void 0!==t?t:new c(1,0,0),this.constant=void 0!==e?e:0}function x(t,e,n){this.a=void 0!==t?t:new c,this.b=void 0!==e?e:new c,this.c=void 0!==n?n:new c}function _(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}function b(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function M(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function w(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function S(t,e,n,i,r,a){this.a=t,this.b=e,this.c=n,this.normal=i&&i.isVector3?i:new c,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new _,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==a?a:0}function T(){Object.defineProperty(this,"id",{value:jo++}),this.uuid=Pa.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 A(t){T.call(this),this.type="MeshBasicMaterial",this.color=new _(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(t)}function L(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=1==n,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function C(t,e,n){L.call(this,new Int8Array(t),e,n)}function E(t,e,n){L.call(this,new Uint8Array(t),e,n)}function P(t,e,n){L.call(this,new Uint8ClampedArray(t),e,n)}function N(t,e,n){L.call(this,new Int16Array(t),e,n)}function O(t,e,n){L.call(this,new Uint16Array(t),e,n)}function D(t,e,n){L.call(this,new Int32Array(t),e,n)}function I(t,e,n){L.call(this,new Uint32Array(t),e,n)}function z(t,e,n){L.call(this,new Float32Array(t),e,n)}function R(t,e,n){L.call(this,new Float64Array(t),e,n)}function F(){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 k(t){if(0===t.length)return-1/0;for(var e=t[0],n=1,i=t.length;n<i;++n)t[n]>e&&(e=t[n]);return e}function B(){Object.defineProperty(this,"id",{value:Go+=2}),this.uuid=Pa.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 U(t,e){p.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new B,this.material=void 0!==e?e:new A,this.updateMorphTargets()}function j(t,e,n,i,r,a,o,s){if(null===(1===e.side?i.intersectTriangle(o,a,r,1,s):i.intersectTriangle(r,a,o,2!==e.side,s)))return null;ps.copy(s),ps.applyMatrix4(t.matrixWorld);var c=n.ray.origin.distanceTo(ps);return c<n.near||c>n.far?null:{distance:c,point:ps.clone(),object:t}}function V(t,n,i,r,a,o,s,c,l,u,h,p){Ko.fromBufferAttribute(a,u),ts.fromBufferAttribute(a,h),es.fromBufferAttribute(a,p);var d=t.morphTargetInfluences;if(n.morphTargets&&o&&d){as.set(0,0,0),os.set(0,0,0),ss.set(0,0,0);for(var f=0,m=o.length;f<m;f++){var v=d[f],g=o[f];0!==v&&(ns.fromBufferAttribute(g,u),is.fromBufferAttribute(g,h),rs.fromBufferAttribute(g,p),s?(as.addScaledVector(ns,v),os.addScaledVector(is,v),ss.addScaledVector(rs,v)):(as.addScaledVector(ns.sub(Ko),v),os.addScaledVector(is.sub(ts),v),ss.addScaledVector(rs.sub(es),v)))}Ko.add(as),ts.add(os),es.add(ss)}var y=j(t,n,i,r,Ko,ts,es,hs);if(y){c&&(cs.fromBufferAttribute(c,u),ls.fromBufferAttribute(c,h),us.fromBufferAttribute(c,p),y.uv=x.getUV(hs,Ko,ts,es,cs,ls,us,new e)),l&&(cs.fromBufferAttribute(l,u),ls.fromBufferAttribute(l,h),us.fromBufferAttribute(l,p),y.uv2=x.getUV(hs,Ko,ts,es,cs,ls,us,new e));var _=new S(u,h,p);x.getNormal(Ko,ts,es,_.normal),y.face=_}return y}function G(){Object.defineProperty(this,"id",{value:ds+=2}),this.uuid=Pa.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 W(t){var e={};for(var n in t)for(var i in e[n]={},t[n]){var r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?e[n][i]=r.clone():e[n][i]=Array.isArray(r)?r.slice():r}return e}function H(t){for(var e={},n=0;n<t.length;n++){var i=W(t[n]);for(var r in i)e[r]=i[r]}return e}function q(t){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!==t&&(t.attributes,this.setValues(t))}function X(){p.call(this),this.type="Camera",this.matrixWorldInverse=new l,this.projectionMatrix=new l,this.projectionMatrixInverse=new l}function Y(t,e,n,i){X.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function Z(t,e,n,i){p.call(this),this.type="CubeCamera";var r=new Y(90,1,t,e);r.up.set(0,-1,0),r.lookAt(new c(1,0,0)),this.add(r);var a=new Y(90,1,t,e);a.up.set(0,-1,0),a.lookAt(new c(-1,0,0)),this.add(a);var o=new Y(90,1,t,e);o.up.set(0,0,1),o.lookAt(new c(0,1,0)),this.add(o);var s=new Y(90,1,t,e);s.up.set(0,0,-1),s.lookAt(new c(0,-1,0)),this.add(s);var l=new Y(90,1,t,e);l.up.set(0,-1,0),l.lookAt(new c(0,0,1)),this.add(l);var u=new Y(90,1,t,e);u.up.set(0,-1,0),u.lookAt(new c(0,0,-1)),this.add(u),i=i||{format:1022,magFilter:1006,minFilter:1006},this.renderTarget=new J(n,i),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var n=t.getRenderTarget(),i=this.renderTarget,c=i.texture.generateMipmaps;i.texture.generateMipmaps=0,t.setRenderTarget(i,0),t.render(e,r),t.setRenderTarget(i,1),t.render(e,a),t.setRenderTarget(i,2),t.render(e,o),t.setRenderTarget(i,3),t.render(e,s),t.setRenderTarget(i,4),t.render(e,l),i.texture.generateMipmaps=c,t.setRenderTarget(i,5),t.render(e,u),t.setRenderTarget(n)},this.clear=function(t,e,n,i){for(var r=t.getRenderTarget(),a=this.renderTarget,o=0;o<6;o++)t.setRenderTarget(a,o),t.clear(e,n,i);t.setRenderTarget(r)}}function J(t,e,n){Number.isInteger(e)&&(e=n),a.call(this,t,t,e)}function $(t,e,n,r,a,o,s,c,l,u,h,p){i.call(this,null,o,s,c,l,u,r,a,h,p),this.image={data:t||null,width:e||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(t,e,n,i,r,a){this.planes=[void 0!==t?t:new y,void 0!==e?e:new y,void 0!==n?n:new y,void 0!==i?i:new y,void 0!==r?r:new y,void 0!==a?a:new y]}function K(){function t(r,a){0!=n&&(i(r,a),e.requestAnimationFrame(t))}var e=null,n=0,i=null;return{start:function(){1!=n&&null!==i&&(e.requestAnimationFrame(t),n=1)},stop:function(){n=0},setAnimationLoop:function(t){i=t},setContext:function(t){e=t}}}function tt(t,e){var n=e.isWebGL2,i=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);var n=i.get(e);n&&(t.deleteBuffer(n.buffer),i.delete(e))},update:function(e,r){e.isInterleavedBufferAttribute&&(e=e.data);var a=i.get(e);void 0===a?i.set(e,function(e,n){var i=e.array,r=e.usage,a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,i,r),e.onUploadCallback();var o=5126;return i instanceof Float32Array?o=5126:i instanceof Float64Array||(i instanceof Uint16Array?o=5123:i instanceof Int16Array?o=5122:i instanceof Uint32Array?o=5125:i instanceof Int32Array?o=5124:i instanceof Int8Array?o=5120:i instanceof Uint8Array&&(o=5121)),{buffer:a,type:o,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version}}(e,r)):a.version<e.version&&(function(e,i,r){var a=i.array,o=i.updateRange;t.bindBuffer(r,e),-1===o.count?t.bufferSubData(r,0,a):(n?t.bufferSubData(r,o.offset*a.BYTES_PER_ELEMENT,a,o.offset,o.count):t.bufferSubData(r,o.offset*a.BYTES_PER_ELEMENT,a.subarray(o.offset,o.offset+o.count)),o.count=-1)}(a.buffer,e,r),a.version=e.version)}}}function et(t,e,n,i){G.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new nt(t,e,n,i)),this.mergeVertices()}function nt(t,e,n,i){B.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};var r,a,o=(t=t||1)/2,s=(e=e||1)/2,c=Math.floor(n)||1,l=Math.floor(i)||1,u=c+1,h=l+1,p=t/c,d=e/l,f=[],m=[],v=[],g=[];for(a=0;a<h;a++){var y=a*d-s;for(r=0;r<u;r++){var x=r*p-o;m.push(x,-y,0),v.push(0,0,1),g.push(r/c),g.push(1-a/l)}}for(a=0;a<l;a++)for(r=0;r<c;r++){var _=r+u*a,b=r+u*(a+1),M=r+1+u*(a+1),w=r+1+u*a;f.push(_,b,w),f.push(b,M,w)}this.setIndex(f),this.setAttribute("position",new z(m,3)),this.setAttribute("normal",new z(v,3)),this.setAttribute("uv",new z(g,2))}function it(t,e,n,i){function r(t,n){e.buffers.color.setClear(t.r,t.g,t.b,n,i)}var a,o,s=new _(0),c=0,l=null,u=0,h=null;return{getClearColor:function(){return s},setClearColor:function(t,e){s.set(t),r(s,c=void 0!==e?e:1)},getClearAlpha:function(){return c},setClearAlpha:function(t){r(s,c=t)},render:function(e,i,p,d){var f=i.background,m=t.xr,v=m.getSession&&m.getSession();if(v&&"additive"===v.environmentBlendMode&&(f=null),null===f?r(s,c):f&&f.isColor&&(r(f,1),d=1),(t.autoClear||d)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),f&&(f.isCubeTexture||f.isWebGLCubeRenderTarget||306===f.mapping)){void 0===o&&((o=new U(new gs(1,1,1),new q({type:"BackgroundCubeMaterial",uniforms:W(ws.cube.uniforms),vertexShader:ws.cube.vertexShader,fragmentShader:ws.cube.fragmentShader,side:1,depthTest:0,depthWrite:0,fog:0}))).geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(o));var g=f.isWebGLCubeRenderTarget?f.texture:f;o.material.uniforms.envMap.value=g,o.material.uniforms.flipEnvMap.value=g.isCubeTexture?-1:1,l===f&&u===g.version&&h===t.toneMapping||(o.material.needsUpdate=1,l=f,u=g.version,h=t.toneMapping),e.unshift(o,o.geometry,o.material,0,0,null)}else f&&f.isTexture&&(void 0===a&&((a=new U(new nt(2,2),new q({type:"BackgroundMaterial",uniforms:W(ws.background.uniforms),vertexShader:ws.background.vertexShader,fragmentShader:ws.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===t.toneMapping||(a.material.needsUpdate=1,l=f,u=f.version,h=t.toneMapping),e.unshift(a,a.geometry,a.material,0,0,null))}}}function rt(t,e,n,i){var r,a=i.isWebGL2;this.setMode=function(t){r=t},this.render=function(e,i){t.drawArrays(r,e,i),n.update(i,r)},this.renderInstances=function(i,o,s,c){if(0!==c){var l,u;if(a)l=t,u="drawArraysInstanced";else if(u="drawArraysInstancedANGLE",null===(l=e.get("ANGLE_instanced_arrays")))return;l[u](r,o,s,c),n.update(s,r,c)}}}function at(t,e,n){function i(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var r,a="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext,o=void 0!==n.precision?n.precision:"highp",s=i(o);s!==o&&(o=s);var c=1==n.logarithmicDepthBuffer,l=t.getParameter(34930),u=t.getParameter(35660),h=t.getParameter(3379),p=t.getParameter(34076),d=t.getParameter(34921),f=t.getParameter(36347),m=t.getParameter(36348),v=t.getParameter(36349),g=u>0,y=a||!!e.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==r)return r;var n=e.get("EXT_texture_filter_anisotropic");return r=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:c,maxTextures:l,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:p,maxAttributes:d,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y,maxSamples:a?t.getParameter(36183):0}}function ot(){function t(){u.value!==r&&(u.value=r,u.needsUpdate=a>0),i.numPlanes=a,i.numIntersection=0}function e(t,e,n,r){var a=null!==t?t.length:0,o=null;if(0!==a){if(o=u.value,1!=r||null===o){var s=n+4*a,h=e.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(t[p]).applyMatrix4(h,l),c.normal.toArray(o,d),o[d+3]=c.constant}u.value=o,u.needsUpdate=1}return i.numPlanes=a,i.numIntersection=0,o}var i=this,r=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(t,n,i){var s=0!==t.length||n||0!==a||o;return o=n,r=e(t,i,0),a=t.length,s},this.beginShadows=function(){s=1,e(null)},this.endShadows=function(){s=0,t()},this.setState=function(n,i,c,l,h,p){if(!o||null===n||0===n.length||s&&!c)s?e(null):t();else{var d=s?0:a,f=4*d,m=h.clippingState||null;u.value=m,m=e(n,l,f,p);for(var v=0;v!==f;++v)m[v]=r[v];h.clippingState=m,this.numIntersection=i?this.numPlanes:0,this.numPlanes+=d}}}function st(t){var e={};return{get:function(n){if(void 0!==e[n])return e[n];var i;switch(n){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(n)}return e[n]=i,i}}}function ct(t,e,n){function i(t){var r=t.target,s=a.get(r);for(var c in null!==s.index&&e.remove(s.index),s.attributes)e.remove(s.attributes[c]);r.removeEventListener("dispose",i),a.delete(r);var l=o.get(s);l&&(e.remove(l),o.delete(s)),n.memory.geometries--}function r(t){var n=[],i=t.index,r=t.attributes.position,a=0;if(null!==i){var s=i.array;a=i.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=r.array,a=r.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(k(n)>65535?I:O)(n,1);d.version=a,e.update(d,34963);var f=o.get(t);f&&e.remove(f),o.set(t,d)}var a=new WeakMap,o=new WeakMap;return{get:function(t,e){var r=a.get(e);return r||(e.addEventListener("dispose",i),e.isBufferGeometry?r=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new B).setFromObject(t)),r=e._bufferGeometry),a.set(e,r),n.memory.geometries++,r)},update:function(t){var n=t.index,i=t.attributes;for(var r in null!==n&&e.update(n,34963),i)e.update(i[r],34962);var a=t.morphAttributes;for(var r in a)for(var o=a[r],s=0,c=o.length;s<c;s++)e.update(o[s],34962)},getWireframeAttribute:function(t){var e=o.get(t);if(e){var n=t.index;null!==n&&e.version<n.version&&r(t)}else r(t);return o.get(t)}}}function lt(t,e,n,i){var r,a,o,s=i.isWebGL2;this.setMode=function(t){r=t},this.setIndex=function(t){a=t.type,o=t.bytesPerElement},this.render=function(e,i){t.drawElements(r,i,a,e*o),n.update(i,r)},this.renderInstances=function(i,c,l,u){if(0!==u){var h,p;if(s)h=t,p="drawElementsInstanced";else if(p="drawElementsInstancedANGLE",null===(h=e.get("ANGLE_instanced_arrays")))return;h[p](r,l,a,c*o,u),n.update(l,r,u)}}}function ut(){var t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:1,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,n,i){switch(i=i||1,t.calls++,n){case 4:t.triangles+=i*(e/3);break;case 1:t.lines+=i*(e/2);break;case 3:t.lines+=i*(e-1);break;case 2:t.lines+=i*e;break;case 0:t.points+=i*e}}}}function ht(t,e){return Math.abs(e[1])-Math.abs(t[1])}function pt(t){var e={},n=new Float32Array(8);return{update:function(i,r,a,o){var s=i.morphTargetInfluences,c=void 0===s?0:s.length,l=e[r.id];if(void 0===l){l=[];for(var u=0;u<c;u++)l[u]=[u,0];e[r.id]=l}var h=a.morphTargets&&r.morphAttributes.position,p=a.morphNormals&&r.morphAttributes.normal;for(u=0;u<c;u++)0!==(f=l[u])[1]&&(h&&r.deleteAttribute("morphTarget"+u),p&&r.deleteAttribute("morphNormal"+u));for(u=0;u<c;u++)(f=l[u])[0]=u,f[1]=s[u];l.sort(ht);var d=0;for(u=0;u<8;u++){var f;if(f=l[u]){var m=f[0],v=f[1];if(v){h&&r.setAttribute("morphTarget"+u,h[m]),p&&r.setAttribute("morphNormal"+u,p[m]),n[u]=v,d+=v;continue}}n[u]=0}var g=r.morphTargetsRelative?1:1-d;o.getUniforms().setValue(t,"morphTargetBaseInfluence",g),o.getUniforms().setValue(t,"morphTargetInfluences",n)}}}function dt(t,e,n,i){var r=new WeakMap;return{update:function(t){var a=i.render.frame,o=t.geometry,s=e.get(t,o);return r.get(s)!==a&&(o.isGeometry&&s.updateFromObject(t),e.update(s),r.set(s,a)),t.isInstancedMesh&&n.update(t.instanceMatrix,34962),s},dispose:function(){r=new WeakMap}}}function ft(t,e,n,r,a,o,s,c,l,u){t=void 0!==t?t:[],e=void 0!==e?e:301,s=void 0!==s?s:1022,i.call(this,t,e,n,r,a,o,s,c,l,u),this.flipY=0}function mt(t,e,n,r){i.call(this,null),this.image={data:t||null,width:e||1,height:n||1,depth:r||1},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=0,this.flipY=0,this.needsUpdate=1}function vt(t,e,n,r){i.call(this,null),this.image={data:t||null,width:e||1,height:n||1,depth:r||1},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=0,this.flipY=0,this.needsUpdate=1}function gt(t,e,n){var i=t[0];if(i<=0||i>0)return t;var r=e*n,a=Cs[r];if(void 0===a&&(a=new Float32Array(r),Cs[r]=a),0!==e){i.toArray(a,0);for(var o=1,s=0;o!==e;++o)s+=n,t[o].toArray(a,s)}return a}function yt(t,e){if(t.length!==e.length)return 0;for(var n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return 0;return 1}function xt(t,e){for(var n=0,i=e.length;n<i;n++)t[n]=e[n]}function _t(t,e){var n=Es[e];void 0===n&&(n=new Int32Array(e),Es[e]=n);for(var i=0;i!==e;++i)n[i]=t.allocateTextureUnit();return n}function bt(t,e){var n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Mt(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(yt(n,e))return;t.uniform2fv(this.addr,e),xt(n,e)}}function wt(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(yt(n,e))return;t.uniform3fv(this.addr,e),xt(n,e)}}function St(t,e){var n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(yt(n,e))return;t.uniform4fv(this.addr,e),xt(n,e)}}function Tt(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(yt(n,e))return;t.uniformMatrix2fv(this.addr,0,e),xt(n,e)}else{if(yt(n,i))return;Os.set(i),t.uniformMatrix2fv(this.addr,0,Os),xt(n,i)}}function At(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(yt(n,e))return;t.uniformMatrix3fv(this.addr,0,e),xt(n,e)}else{if(yt(n,i))return;Ns.set(i),t.uniformMatrix3fv(this.addr,0,Ns),xt(n,i)}}function Lt(t,e){var n=this.cache,i=e.elements;if(void 0===i){if(yt(n,e))return;t.uniformMatrix4fv(this.addr,0,e),xt(n,e)}else{if(yt(n,i))return;Ps.set(i),t.uniformMatrix4fv(this.addr,0,Ps),xt(n,i)}}function Ct(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.safeSetTexture2D(e||Ss,r)}function Et(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(e||Ts,r)}function Pt(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||As,r)}function Nt(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.safeSetTextureCube(e||Ls,r)}function Ot(t,e){var n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function Dt(t,e){var n=this.cache;yt(n,e)||(t.uniform2iv(this.addr,e),xt(n,e))}function It(t,e){var n=this.cache;yt(n,e)||(t.uniform3iv(this.addr,e),xt(n,e))}function zt(t,e){var n=this.cache;yt(n,e)||(t.uniform4iv(this.addr,e),xt(n,e))}function Rt(t,e){var n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function Ft(t,e){t.uniform1fv(this.addr,e)}function kt(t,e){t.uniform1iv(this.addr,e)}function Bt(t,e){t.uniform2iv(this.addr,e)}function Ut(t,e){t.uniform3iv(this.addr,e)}function jt(t,e){t.uniform4iv(this.addr,e)}function Vt(t,e){var n=gt(e,this.size,2);t.uniform2fv(this.addr,n)}function Gt(t,e){var n=gt(e,this.size,3);t.uniform3fv(this.addr,n)}function Wt(t,e){var n=gt(e,this.size,4);t.uniform4fv(this.addr,n)}function Ht(t,e){var n=gt(e,this.size,4);t.uniformMatrix2fv(this.addr,0,n)}function qt(t,e){var n=gt(e,this.size,9);t.uniformMatrix3fv(this.addr,0,n)}function Xt(t,e){var n=gt(e,this.size,16);t.uniformMatrix4fv(this.addr,0,n)}function Yt(t,e,n){var i=e.length,r=_t(n,i);t.uniform1iv(this.addr,r);for(var a=0;a!==i;++a)n.safeSetTexture2D(e[a]||Ss,r[a])}function Zt(t,e,n){var i=e.length,r=_t(n,i);t.uniform1iv(this.addr,r);for(var a=0;a!==i;++a)n.safeSetTextureCube(e[a]||Ls,r[a])}function Jt(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=function(t){switch(t){case 5126:return bt;case 35664:return Mt;case 35665:return wt;case 35666:return St;case 35674:return Tt;case 35675:return At;case 35676:return Lt;case 5124:case 35670:return Ot;case 35667:case 35671:return Dt;case 35668:case 35672:return It;case 35669:case 35673:return zt;case 5125:return Rt;case 35678:case 36198:case 36298:case 36306:case 35682:return Ct;case 35679:case 36299:case 36307:return Pt;case 35680:case 36300:case 36308:case 36293:return Nt;case 36289:case 36303:case 36311:case 36292:return Et}}(e.type)}function $t(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Ft;case 35664:return Vt;case 35665:return Gt;case 35666:return Wt;case 35674:return Ht;case 35675:return qt;case 35676:return Xt;case 5124:case 35670:return kt;case 35667:case 35671:return Bt;case 35668:case 35672:return Ut;case 35669:case 35673:return jt;case 35678:case 36198:case 36298:case 36306:case 35682:return Yt;case 35680:case 36300:case 36308:case 36293:return Zt}}(e.type)}function Qt(t){this.id=t,this.seq=[],this.map={}}function Kt(t,e){t.seq.push(e),t.map[e.id]=e}function te(t,e,n){var i=t.name,r=i.length;for(Ds.lastIndex=0;;){var a=Ds.exec(i),o=Ds.lastIndex,s=a[1],c="]"===a[2],l=a[3];if(c&&(s|=0),void 0===l||"["===l&&o+2===r){Kt(n,void 0===l?new Jt(s,t,e):new $t(s,t,e));break}var u=n.map[s];void 0===u&&Kt(n,u=new Qt(s)),n=u}}function ee(t,e){this.seq=[],this.map={};for(var n=t.getProgramParameter(e,35718),i=0;i<n;++i){var r=t.getActiveUniform(e,i);te(r,t.getUniformLocation(e,r.name),this)}}function ne(t,e,n){var i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}function ie(t){switch(t){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: "+t)}}function re(t,e,n){var i=t.getShaderParameter(e,35713),r=t.getShaderInfoLog(e).trim();return i&&""===r?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+r+function(t){for(var e=t.split("\n"),n=0;n<e.length;n++)e[n]=n+1+": "+e[n];return e.join("\n")}(t.getShaderSource(e))}function ae(t,e){var n=ie(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function oe(t,e){var n;switch(e){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: "+e)}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function se(t){return""!==t}function ce(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function le(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}function ue(t){return t.replace(zs,he)}function he(t,e){var n=Ms[e];if(void 0===n)throw Error("Can not resolve #include <"+e+">");return ue(n)}function pe(t){return t.replace(Fs,fe).replace(Rs,de)}function de(t,e,n,i){return fe(0,e,n,i)}function fe(t,e,n,i){for(var r="",a=parseInt(e);a<parseInt(n);a++)r+=i.replace(/\[ i \]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return r}function me(t){var e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function ve(t,e,n){var i,r,a,o,s=t.getContext(),c=n.defines,l=n.vertexShader,u=n.fragmentShader,h=function(t){var e="SHADOWMAP_TYPE_BASIC";return 1===t.shadowMapType?e="SHADOWMAP_TYPE_PCF":2===t.shadowMapType?e="SHADOWMAP_TYPE_PCF_SOFT":3===t.shadowMapType&&(e="SHADOWMAP_TYPE_VSM"),e}(n),p=function(t){var e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case 301:case 302:e="ENVMAP_TYPE_CUBE";break;case 306:case 307:e="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:e="ENVMAP_TYPE_EQUIREC";break;case 305:e="ENVMAP_TYPE_SPHERE"}return e}(n),d=function(t){var e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case 302:case 304:e="ENVMAP_MODE_REFRACTION"}return e}(n),f=function(t){var e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case 0:e="ENVMAP_BLENDING_MULTIPLY";break;case 1:e="ENVMAP_BLENDING_MIX";break;case 2:e="ENVMAP_BLENDING_ADD"}return e}(n),m=t.gammaFactor>0?t.gammaFactor:1,v=n.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(se).join("\n")}(n),g=function(t){var e=[];for(var n in t){var i=t[n];0!=i&&e.push("#define "+n+" "+i)}return e.join("\n")}(c),y=s.createProgram();if(n.isRawShaderMaterial?((i=[g].filter(se).join("\n")).length>0&&(i+="\n"),(r=[v,g].filter(se).join("\n")).length>0&&(r+="\n")):(i=[me(n),"#define SHADER_NAME "+n.shaderName,g,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(se).join("\n"),r=[v,me(n),"#define SHADER_NAME "+n.shaderName,g,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?Ms.tonemapping_pars_fragment:"",0!==n.toneMapping?oe("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.outputEncoding||n.mapEncoding||n.matcapEncoding||n.envMapEncoding||n.emissiveMapEncoding||n.lightMapEncoding?Ms.encodings_pars_fragment:"",n.mapEncoding?ae("mapTexelToLinear",n.mapEncoding):"",n.matcapEncoding?ae("matcapTexelToLinear",n.matcapEncoding):"",n.envMapEncoding?ae("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?ae("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMapEncoding?ae("lightMapTexelToLinear",n.lightMapEncoding):"",n.outputEncoding?("linearToOutputTexel",a=n.outputEncoding,o=ie(a),"vec4 linearToOutputTexel( vec4 value ) { return LinearTo"+o[0]+o[1]+"; }"):"",n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(se).join("\n")),l=le(l=ce(l=ue(l),n),n),u=le(u=ce(u=ue(u),n),n),l=pe(l),u=pe(u),n.isWebGL2&&!n.isRawShaderMaterial){var x=0,_=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&null!==l.match(_)&&null!==u.match(_)&&(x=1,l=l.replace(_,""),u=u.replace(_,"")),i="#version 300 es\n\n#define attribute in\n#define varying out\n#define texture2D texture\n"+i,r=["#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"+r}var b,M,w=r+u,S=ne(s,35633,i+l),T=ne(s,35632,w);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),t.debug.checkShaderErrors){var A=s.getProgramInfoLog(y).trim(),L=s.getShaderInfoLog(S).trim(),C=s.getShaderInfoLog(T).trim(),E=1,P=1;0==s.getProgramParameter(y,35714)?(E=0,re(s,S,"vertex"),re(s,T,"fragment")):""!==A||""!==L&&""!==C||(P=0),P&&(this.diagnostics={runnable:E,programLog:A,vertexShader:{log:L,prefix:i},fragmentShader:{log:C,prefix:r}})}return s.detachShader(y,S),s.detachShader(y,T),s.deleteShader(S),s.deleteShader(T),this.getUniforms=function(){return void 0===b&&(b=new ee(s,y)),b},this.getAttributes=function(){return void 0===M&&(M=function(t,e){for(var n={},i=t.getProgramParameter(e,35721),r=0;r<i;r++){var a=t.getActiveAttrib(e,r).name;n[a]=t.getAttribLocation(e,a)}return n}(s,y)),M},this.destroy=function(){s.deleteProgram(y),this.program=void 0},this.name=n.shaderName,this.id=Is++,this.cacheKey=e,this.usedTimes=1,this.program=y,this.vertexShader=S,this.fragmentShader=T,this}function ge(t,e,n){function i(t){var e;return t?t.isTexture?e=t.encoding:t.isWebGLRenderTarget&&(e=t.texture.encoding):e=3e3,e}var r=[],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(r,p,d,f,m,v,g){var y=f.fog,x=r.isMeshStandardMaterial?f.environment:null,_=r.envMap||x,b=h[r.type],M=g.isSkinnedMesh?function(t){var e=t.skeleton.bones;if(s)return 1024;var n=Math.min(Math.floor((l-20)/4),e.length);return n<e.length?0:n}(g):0;null!==r.precision&&(c=n.getMaxPrecision(r.precision),r.precision);var w=function(t,e){var n;if(e){var i=ws[e];n={name:t.type,uniforms:ys.clone(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader}}else n={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};return n}(r,b);r.onBeforeCompile(w,t);var S=t.getRenderTarget();return{isWebGL2:a,shaderID:b,shaderName:w.name,uniforms:w.uniforms,vertexShader:w.vertexShader,fragmentShader:w.fragmentShader,defines:r.defines,isRawShaderMaterial:r.isRawShaderMaterial,isShaderMaterial:r.isShaderMaterial,precision:c,instancing:1==g.isInstancedMesh,supportsVertexTextures:u,outputEncoding:null!==S?i(S.texture):t.outputEncoding,map:!!r.map,mapEncoding:i(r.map),matcap:!!r.matcap,matcapEncoding:i(r.matcap),envMap:!!_,envMapMode:_&&_.mapping,envMapEncoding:i(_),envMapCubeUV:!!_&&(306===_.mapping||307===_.mapping),lightMap:!!r.lightMap,lightMapEncoding:i(r.lightMap),aoMap:!!r.aoMap,emissiveMap:!!r.emissiveMap,emissiveMapEncoding:i(r.emissiveMap),bumpMap:!!r.bumpMap,normalMap:!!r.normalMap,objectSpaceNormalMap:1===r.normalMapType,tangentSpaceNormalMap:0===r.normalMapType,clearcoatMap:!!r.clearcoatMap,clearcoatRoughnessMap:!!r.clearcoatRoughnessMap,clearcoatNormalMap:!!r.clearcoatNormalMap,displacementMap:!!r.displacementMap,roughnessMap:!!r.roughnessMap,metalnessMap:!!r.metalnessMap,specularMap:!!r.specularMap,alphaMap:!!r.alphaMap,gradientMap:!!r.gradientMap,sheen:!!r.sheen,combine:r.combine,vertexTangents:r.normalMap&&r.vertexTangents,vertexColors:r.vertexColors,vertexUvs:!!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatMap||r.clearcoatRoughnessMap||r.clearcoatNormalMap||r.displacementMap),uvsVertexOnly:!(r.map||r.bumpMap||r.normalMap||r.specularMap||r.alphaMap||r.emissiveMap||r.roughnessMap||r.metalnessMap||r.clearcoatNormalMap||!r.displacementMap),fog:!!y,useFog:r.fog,fogExp2:y&&y.isFogExp2,flatShading:r.flatShading,sizeAttenuation:r.sizeAttenuation,logarithmicDepthBuffer:o,skinning:r.skinning&&M>0,maxBones:M,useVertexTexture:s,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.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:v,dithering:r.dithering,shadowMapEnabled:t.shadowMap.enabled&&d.length>0,shadowMapType:t.shadowMap.type,toneMapping:r.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:2===r.side,flipSided:1===r.side,depthPacking:void 0!==r.depthPacking?r.depthPacking:0,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.fragDepth,extensionDrawBuffers:r.extensions&&r.extensions.drawBuffers,extensionShaderTextureLOD:r.extensions&&r.extensions.shaderTextureLOD,rendererExtensionFragDepth:a||null!==e.get("EXT_frag_depth"),rendererExtensionDrawBuffers:a||null!==e.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:a||null!==e.get("EXT_shader_texture_lod"),onBeforeCompile:r.onBeforeCompile}},this.getProgramCacheKey=function(e){var n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(var i in e.defines)n.push(i),n.push(e.defines[i]);if(void 0===e.isRawShaderMaterial){for(var r=0;r<70;r++)n.push(e[p[r]]);n.push(t.outputEncoding),n.push(t.gammaFactor)}return n.push(e.onBeforeCompile.toString()),n.join()},this.acquireProgram=function(e,n){for(var i,a=0,o=r.length;a<o;a++){var s=r[a];if(s.cacheKey===n){++(i=s).usedTimes;break}}return void 0===i&&(i=new ve(t,n,e),r.push(i)),i},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=r.indexOf(t);r[e]=r[r.length-1],r.pop(),t.destroy()}},this.programs=r}function ye(){var t=new WeakMap;return{get:function(e){var n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,i){t.get(e)[n]=i},dispose:function(){t=new WeakMap}}}function xe(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function _e(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function be(){function t(t,i,r,o,s,c){var l=e[n];return void 0===l?(l={id:t.id,object:t,geometry:i,material:r,program:r.program||a,groupOrder:o,renderOrder:t.renderOrder,z:s,group:c},e[n]=l):(l.id=t.id,l.object=t,l.geometry=i,l.material=r,l.program=r.program||a,l.groupOrder=o,l.renderOrder=t.renderOrder,l.z=s,l.group=c),n++,l}var e=[],n=0,i=[],r=[],a={id:-1};return{opaque:i,transparent:r,init:function(){n=0,i.length=0,r.length=0},push:function(e,n,a,o,s,c){var l=t(e,n,a,o,s,c);(1==a.transparent?r:i).push(l)},unshift:function(e,n,a,o,s,c){var l=t(e,n,a,o,s,c);(1==a.transparent?r:i).unshift(l)},finish:function(){for(var t=n,i=e.length;t<i;t++){var r=e[t];if(null===r.id)break;r.id=null,r.object=null,r.geometry=null,r.material=null,r.program=null,r.group=null}},sort:function(t,e){i.length>1&&i.sort(t||xe),r.length>1&&r.sort(e||_e)}}}function Me(){function t(n){var i=n.target;i.removeEventListener("dispose",t),e.delete(i)}var e=new WeakMap;return{get:function(n,i){var r,a=e.get(n);return void 0===a?(r=new be,e.set(n,new WeakMap),e.get(n).set(i,r),n.addEventListener("dispose",t)):void 0===(r=a.get(i))&&(r=new be,a.set(i,r)),r},dispose:function(){e=new WeakMap}}}function we(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new c,color:new _};break;case"SpotLight":n={position:new c,direction:new c,color:new _,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new c,color:new _,distance:0,decay:0};break;case"HemisphereLight":n={direction:new c,skyColor:new _,groundColor:new _};break;case"RectAreaLight":n={color:new _,position:new c,halfWidth:new c,halfHeight:new c}}return t[e.id]=n,n}}}function Se(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Te(){for(var t,n=new we,i=(t={},{get:function(n){if(void 0!==t[n.id])return t[n.id];var i;switch(n.type){case"DirectionalLight":case"SpotLight":i={shadowBias:0,shadowRadius:1,shadowMapSize:new e};break;case"PointLight":i={shadowBias:0,shadowRadius:1,shadowMapSize:new e,shadowCameraNear:1,shadowCameraFar:1e3}}return t[n.id]=i,i}}),r={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++)r.probe.push(new c);var o=new c,s=new l,u=new l;return{setup:function(t,e,a){for(var c=0,l=0,h=0,p=0;p<9;p++)r.probe[p].set(0,0,0);var d=0,f=0,m=0,v=0,g=0,y=0,x=0,_=0,b=a.matrixWorldInverse;t.sort(Se),p=0;for(var M=t.length;p<M;p++){var w=t[p],S=w.color,T=w.intensity,A=w.distance,L=w.shadow&&w.shadow.map?w.shadow.map.texture:null;if(w.isAmbientLight)c+=S.r*T,l+=S.g*T,h+=S.b*T;else if(w.isLightProbe)for(var C=0;C<9;C++)r.probe[C].addScaledVector(w.sh.coefficients[C],T);else if(w.isDirectionalLight){if((N=n.get(w)).color.copy(w.color).multiplyScalar(w.intensity),N.direction.setFromMatrixPosition(w.matrixWorld),o.setFromMatrixPosition(w.target.matrixWorld),N.direction.sub(o),N.direction.transformDirection(b),w.castShadow){var E=w.shadow;(P=i.get(w)).shadowBias=E.bias,P.shadowRadius=E.radius,P.shadowMapSize=E.mapSize,r.directionalShadow[d]=P,r.directionalShadowMap[d]=L,r.directionalShadowMatrix[d]=w.shadow.matrix,y++}r.directional[d]=N,d++}else if(w.isSpotLight)(N=n.get(w)).position.setFromMatrixPosition(w.matrixWorld),N.position.applyMatrix4(b),N.color.copy(S).multiplyScalar(T),N.distance=A,N.direction.setFromMatrixPosition(w.matrixWorld),o.setFromMatrixPosition(w.target.matrixWorld),N.direction.sub(o),N.direction.transformDirection(b),N.coneCos=Math.cos(w.angle),N.penumbraCos=Math.cos(w.angle*(1-w.penumbra)),N.decay=w.decay,w.castShadow&&(E=w.shadow,(P=i.get(w)).shadowBias=E.bias,P.shadowRadius=E.radius,P.shadowMapSize=E.mapSize,r.spotShadow[m]=P,r.spotShadowMap[m]=L,r.spotShadowMatrix[m]=w.shadow.matrix,_++),r.spot[m]=N,m++;else if(w.isRectAreaLight)(N=n.get(w)).color.copy(S).multiplyScalar(T),N.position.setFromMatrixPosition(w.matrixWorld),N.position.applyMatrix4(b),u.identity(),s.copy(w.matrixWorld),s.premultiply(b),u.extractRotation(s),N.halfWidth.set(.5*w.width,0,0),N.halfHeight.set(0,.5*w.height,0),N.halfWidth.applyMatrix4(u),N.halfHeight.applyMatrix4(u),r.rectArea[v]=N,v++;else if(w.isPointLight){var P;(N=n.get(w)).position.setFromMatrixPosition(w.matrixWorld),N.position.applyMatrix4(b),N.color.copy(w.color).multiplyScalar(w.intensity),N.distance=w.distance,N.decay=w.decay,w.castShadow&&(E=w.shadow,(P=i.get(w)).shadowBias=E.bias,P.shadowRadius=E.radius,P.shadowMapSize=E.mapSize,P.shadowCameraNear=E.camera.near,P.shadowCameraFar=E.camera.far,r.pointShadow[f]=P,r.pointShadowMap[f]=L,r.pointShadowMatrix[f]=w.shadow.matrix,x++),r.point[f]=N,f++}else if(w.isHemisphereLight){var N;(N=n.get(w)).direction.setFromMatrixPosition(w.matrixWorld),N.direction.transformDirection(b),N.direction.normalize(),N.skyColor.copy(w.color).multiplyScalar(T),N.groundColor.copy(w.groundColor).multiplyScalar(T),r.hemi[g]=N,g++}}r.ambient[0]=c,r.ambient[1]=l,r.ambient[2]=h;var O=r.hash;O.directionalLength===d&&O.pointLength===f&&O.spotLength===m&&O.rectAreaLength===v&&O.hemiLength===g&&O.numDirectionalShadows===y&&O.numPointShadows===x&&O.numSpotShadows===_||(r.directional.length=d,r.spot.length=m,r.rectArea.length=v,r.point.length=f,r.hemi.length=g,r.directionalShadow.length=y,r.directionalShadowMap.length=y,r.pointShadow.length=x,r.pointShadowMap.length=x,r.spotShadow.length=_,r.spotShadowMap.length=_,r.directionalShadowMatrix.length=y,r.pointShadowMatrix.length=x,r.spotShadowMatrix.length=_,O.directionalLength=d,O.pointLength=f,O.spotLength=m,O.rectAreaLength=v,O.hemiLength=g,O.numDirectionalShadows=y,O.numPointShadows=x,O.numSpotShadows=_,r.version=ks++)},state:r}}function Ae(){var t=new Te,e=[],n=[];return{init:function(){e.length=0,n.length=0},state:{lightsArray:e,shadowsArray:n,lights:t},setupLights:function(i){t.setup(e,n,i)},pushLight:function(t){e.push(t)},pushShadow:function(t){n.push(t)}}}function Le(){function t(n){var i=n.target;i.removeEventListener("dispose",t),e.delete(i)}var e=new WeakMap;return{get:function(n,i){var r;return 0==e.has(n)?(r=new Ae,e.set(n,new WeakMap),e.get(n).set(i,r),n.addEventListener("dispose",t)):0==e.get(n).has(i)?(r=new Ae,e.get(n).set(i,r)):r=e.get(n).get(i),r},dispose:function(){e=new WeakMap}}}function Ce(t){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(t)}function Ee(t){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(t)}function Pe(t,n,i){function o(e,i){var r=n.update(M);x.uniforms.shadow_pass.value=e.map.texture,x.uniforms.resolution.value=e.mapSize,x.uniforms.radius.value=e.radius,t.setRenderTarget(e.mapPass),t.clear(),t.renderBufferDirect(i,null,r,x,M,null),_.uniforms.shadow_pass.value=e.mapPass.texture,_.uniforms.resolution.value=e.mapSize,_.uniforms.radius.value=e.radius,t.setRenderTarget(e.map),t.clear(),t.renderBufferDirect(i,null,r,_,M,null)}function s(t,e,n){var i=t<<0|e<<1|n<<2,r=m[i];return void 0===r&&(r=new Ce({depthPacking:3201,morphTargets:t,skinning:e}),m[i]=r),r}function c(t,e,n){var i=t<<0|e<<1|n<<2,r=v[i];return void 0===r&&(r=new Ee({morphTargets:t,skinning:e}),v[i]=r),r}function l(e,n,i,r,a,o){var l=e.geometry,u=null,h=s,p=e.customDepthMaterial;if(1==i.isPointLight&&(h=c,p=e.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==e.isSkinnedMesh&&1==n.skinning&&(f=1),u=h(d,f,1==e.isInstancedMesh)}else u=p;if(t.localClippingEnabled&&1==n.clipShadows&&0!==n.clippingPlanes.length){var m=u.uuid,v=n.uuid,x=g[m];void 0===x&&(x={},g[m]=x);var _=x[v];void 0===_&&(_=u.clone(),x[v]=_),u=_}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==i.isPointLight&&1==u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(i.matrixWorld),u.nearDistance=r,u.farDistance=a),u}function u(e,i,r,a,o){if(0!=e.visible){if(e.layers.test(i.layers)&&(e.isMesh||e.isLine||e.isPoints)&&(e.castShadow||e.receiveShadow&&3===o)&&(!e.frustumCulled||h.intersectsObject(e))){e.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,e.matrixWorld);var s=n.update(e),c=e.material;if(Array.isArray(c))for(var p=s.groups,d=0,f=p.length;d<f;d++){var m=p[d],v=c[m.materialIndex];if(v&&v.visible){var g=l(e,v,a,r.near,r.far,o);t.renderBufferDirect(r,null,s,g,e,m)}}else c.visible&&(g=l(e,c,a,r.near,r.far,o),t.renderBufferDirect(r,null,s,g,e,null))}for(var y=e.children,x=0,_=y.length;x<_;x++)u(y[x],i,r,a,o)}}var h=new Q,p=new e,d=new e,f=new r,m=[],v=[],g={},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 e},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}"}),_=x.clone();_.defines.HORIZONAL_PASS=1;var b=new B;b.setAttribute("position",new L(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var M=new U(b,x),w=this;this.enabled=0,this.autoUpdate=1,this.needsUpdate=0,this.type=1,this.render=function(e,n,r){if(0!=w.enabled&&(0!=w.autoUpdate||0!=w.needsUpdate)&&0!==e.length){var s=t.getRenderTarget(),c=t.getActiveCubeFace(),l=t.getActiveMipmapLevel(),m=t.state;m.setBlending(0),m.buffers.color.setClear(1,1,1,1),m.buffers.depth.setTest(1),m.setScissorTest(0);for(var v=0,g=e.length;v<g;v++){var y=e[v],x=y.shadow;if(void 0!==x){p.copy(x.mapSize);var _=x.getFrameExtents();if(p.multiply(_),d.copy(x.mapSize),(p.x>i||p.y>i)&&(p.x>i&&(d.x=Math.floor(i/_.x),p.x=d.x*_.x,x.mapSize.x=d.x),p.y>i&&(d.y=Math.floor(i/_.y),p.y=d.y*_.y,x.mapSize.y=d.y)),null===x.map&&!x.isPointLightShadow&&3===this.type){var b={minFilter:1006,magFilter:1006,format:1023};x.map=new a(p.x,p.y,b),x.map.texture.name=y.name+".shadowMap",x.mapPass=new a(p.x,p.y,b),x.camera.updateProjectionMatrix()}null===x.map&&(b={minFilter:1003,magFilter:1003,format:1023},x.map=new a(p.x,p.y,b),x.map.texture.name=y.name+".shadowMap",x.camera.updateProjectionMatrix()),t.setRenderTarget(x.map),t.clear();for(var M=x.getViewportCount(),S=0;S<M;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,r,x.camera,y,this.type)}x.isPointLightShadow||3!==this.type||o(x,r)}}w.needsUpdate=0,t.setRenderTarget(s,c,l)}}}function Ne(t,e,n){function i(e,n,i){var r=new Uint8Array(4),a=t.createTexture();t.bindTexture(e,a),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var o=0;o<i;o++)t.texImage2D(n+o,0,6408,1,1,0,6408,5121,r);return a}function a(n,i){y[n]=1,0===x[n]&&(t.enableVertexAttribArray(n),x[n]=1),_[n]!==i&&((d?t:e.get("ANGLE_instanced_arrays"))[d?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),_[n]=i)}function o(e){1!=b[e]&&(t.enable(e),b[e]=1)}function s(e){0!=b[e]&&(t.disable(e),b[e]=0)}function c(e,n,i,r,a,c,l,u){if(0!==e){if(w||(o(3042),w=1),5===e)a=a||n,c=c||i,l=l||r,n===T&&a===C||(t.blendEquationSeparate(q[n],q[a]),T=n,C=a),i===A&&r===L&&c===E&&l===P||(t.blendFuncSeparate(Y[i],Y[r],Y[c],Y[l]),A=i,L=r,E=c,P=l),S=e,N=null;else if(e!==S||u!==N){if(100===T&&100===C||(t.blendEquation(32774),T=100,C=100),u)switch(e){case 1:t.blendFuncSeparate(1,771,1,771);break;case 2:t.blendFunc(1,1);break;case 3:t.blendFuncSeparate(0,0,769,771);break;case 4:t.blendFuncSeparate(0,768,0,770)}else switch(e){case 1:t.blendFuncSeparate(770,771,1,771);break;case 2:t.blendFunc(770,1);break;case 3:t.blendFunc(0,769);break;case 4:t.blendFunc(0,768)}A=null,L=null,E=null,P=null,S=e,N=u}}else w&&(s(3042),w=0)}function l(e){O!==e&&(e?t.frontFace(2304):t.frontFace(2305),O=e)}function u(e){0!==e?(o(2884),e!==D&&(1===e?t.cullFace(1029):2===e?t.cullFace(1028):t.cullFace(1032))):s(2884),D=e}function h(e,n,i){e?(o(32823),z===n&&R===i||(t.polygonOffset(n,i),z=n,R=i)):s(32823)}function p(e){void 0===e&&(e=33984+F-1),j!==e&&(t.activeTexture(e),j=e)}var d=n.isWebGL2,f=new function(){var e=0,n=new r,i=null,a=new r(0,0,0,0);return{setMask:function(n){i===n||e||(t.colorMask(n,n,n,n),i=n)},setLocked:function(t){e=t},setClear:function(e,i,r,o,s){1==s&&(e*=o,i*=o,r*=o),n.set(e,i,r,o),0==a.equals(n)&&(t.clearColor(e,i,r,o),a.copy(n))},reset:function(){e=0,i=null,a.set(-1,0,0,0)}}},m=new function(){var e=0,n=null,i=null,r=null;return{setTest:function(t){t?o(2929):s(2929)},setMask:function(i){n===i||e||(t.depthMask(i),n=i)},setFunc:function(e){if(i!==e){if(e)switch(e){case 0:t.depthFunc(512);break;case 1:t.depthFunc(519);break;case 2:t.depthFunc(513);break;case 3:t.depthFunc(515);break;case 4:t.depthFunc(514);break;case 5:t.depthFunc(518);break;case 6:t.depthFunc(516);break;case 7:t.depthFunc(517);break;default:t.depthFunc(515)}else t.depthFunc(515);i=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=0,n=null,i=null,r=null}}},v=new function(){var e=0,n=null,i=null,r=null,a=null,c=null,l=null,u=null,h=null;return{setTest:function(t){e||(t?o(2960):s(2960))},setMask:function(i){n===i||e||(t.stencilMask(i),n=i)},setFunc:function(e,n,o){i===e&&r===n&&a===o||(t.stencilFunc(e,n,o),i=e,r=n,a=o)},setOp:function(e,n,i){c===e&&l===n&&u===i||(t.stencilOp(e,n,i),c=e,l=n,u=i)},setLocked:function(t){e=t},setClear:function(e){h!==e&&(t.clearStencil(e),h=e)},reset:function(){e=0,n=null,i=null,r=null,a=null,c=null,l=null,u=null,h=null}}},g=t.getParameter(34921),y=new Uint8Array(g),x=new Uint8Array(g),_=new Uint8Array(g),b={},M=null,w=null,S=null,T=null,A=null,L=null,C=null,E=null,P=null,N=0,O=null,D=null,I=null,z=null,R=null,F=t.getParameter(35661),k=0,B=0,U=t.getParameter(7938);-1!==U.indexOf("WebGL")?(B=parseFloat(/^WebGL\ ([0-9])/.exec(U)[1]),k=B>=1):-1!==U.indexOf("OpenGL ES")&&(B=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(U)[1]),k=B>=2);var j=null,V={},G=new r,W=new r,H={};H[3553]=i(3553,3553,1),H[34067]=i(34067,34069,6),f.setClear(0,0,0,1),m.setClear(1),v.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=e.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:v},initAttributes:function(){for(var t=0,e=y.length;t<e;t++)y[t]=0},enableAttribute:function(t){a(t,0)},enableAttributeAndDivisor:a,disableUnusedAttributes:function(){for(var e=0,n=x.length;e!==n;++e)x[e]!==y[e]&&(t.disableVertexAttribArray(e),x[e]=0)},enable:o,disable:s,useProgram:function(e){return M!==e?(t.useProgram(e),M=e,1):0},setBlending:c,setMaterial:function(t,e){2===t.side?s(2884):o(2884);var n=1===t.side;e&&(n=!n),l(n),1===t.blending&&0==t.transparent?c(0):c(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),m.setFunc(t.depthFunc),m.setTest(t.depthTest),m.setMask(t.depthWrite),f.setMask(t.colorWrite);var i=t.stencilWrite;v.setTest(i),i&&(v.setMask(t.stencilWriteMask),v.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),v.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),h(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:l,setCullFace:u,setLineWidth:function(e){e!==I&&(k&&t.lineWidth(e),I=e)},setPolygonOffset:h,setScissorTest:function(t){t?o(3089):s(3089)},activeTexture:p,bindTexture:function(e,n){null===j&&p();var i=V[j];void 0===i&&(i={type:void 0,texture:void 0},V[j]=i),i.type===e&&i.texture===n||(t.bindTexture(e,n||H[e]),i.type=e,i.texture=n)},unbindTexture:function(){var e=V[j];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){}},scissor:function(e){0==G.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),G.copy(e))},viewport:function(e){0==W.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),W.copy(e))},reset:function(){for(var e=0;e<x.length;e++)1===x[e]&&(t.disableVertexAttribArray(e),x[e]=0);b={},j=null,V={},M=null,S=null,O=null,D=null,f.reset(),m.reset(),v.reset()}}}function Oe(t,e,n,i,r,a,o){function s(t,e){return N?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function c(t,e,n,i){var r=1;if((t.width>i||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||1==e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){var a=e?Pa.floorPowerOfTwo:Math.floor,o=a(r*t.width),c=a(r*t.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(t,0,0,o,c),l}return t}return t}function l(t){return Pa.isPowerOfTwo(t.width)&&Pa.isPowerOfTwo(t.height)}function u(t,e){return t.generateMipmaps&&e&&1003!==t.minFilter&&1006!==t.minFilter}function h(e,n,r,a){t.generateMipmap(e),i.get(n).__maxMipLevel=Math.log(Math.max(r,a))*Math.LOG2E}function p(n,i,r){if(0==A)return i;if(null!==n&&void 0!==t[n])return t[n];var a=i;return 6403===i&&(5126===r&&(a=33326),5131===r&&(a=33325),5121===r&&(a=33321)),6407===i&&(5126===r&&(a=34837),5131===r&&(a=34843),5121===r&&(a=32849)),6408===i&&(5126===r&&(a=34836),5131===r&&(a=34842),5121===r&&(a=32856)),33325!==a&&33326!==a&&34842!==a&&34836!==a||e.get("EXT_color_buffer_float"),a}function d(t){return 1003===t||1004===t||1005===t?9728:9729}function f(e){var n=e.target;n.removeEventListener("dispose",f),function(e){var n=i.get(e);void 0!==n.__webglInit&&(t.deleteTexture(n.__webglTexture),i.remove(e))}(n),n.isVideoTexture&&P.delete(n),o.memory.textures--}function m(e){var n=e.target;n.removeEventListener("dispose",m),function(e){var n=i.get(e),r=i.get(e.texture);if(e){if(void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(var a=0;a<6;a++)t.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[a]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&t.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&t.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&t.deleteRenderbuffer(n.__webglDepthRenderbuffer);i.remove(e.texture),i.remove(e)}}(n),o.memory.textures--}function v(t,e){var r=i.get(t);if(t.isVideoTexture&&function(t){var e=o.render.frame;P.get(t)!==e&&(P.set(t,e),t.update())}(t),t.version>0&&r.__version!==t.version){var a=t.image;if(void 0===a);else if(0!=a.complete)return void b(r,t,e)}n.activeTexture(33984+e),n.bindTexture(3553,r.__webglTexture)}function g(e,r){if(6===e.image.length){var o=i.get(e);if(e.version>0&&o.__version!==e.version){_(o,e),n.activeTexture(33984+r),n.bindTexture(34067,o.__webglTexture),t.pixelStorei(37440,e.flipY);for(var s=e&&(e.isCompressedTexture||e.image[0].isCompressedTexture),d=e.image[0]&&e.image[0].isDataTexture,f=[],m=0;m<6;m++)f[m]=s||d?d?e.image[m].image:e.image[m]:c(e.image[m],0,1,L);var v,g=f[0],y=l(g)||A,b=a.convert(e.format),M=a.convert(e.type),w=p(e.internalFormat,b,M);if(x(34067,e,y),s){for(m=0;m<6;m++){v=f[m].mipmaps;for(var S=0;S<v.length;S++){var T=v[S];1023!==e.format&&1022!==e.format?null!==b&&n.compressedTexImage2D(34069+m,S,w,T.width,T.height,0,T.data):n.texImage2D(34069+m,S,w,T.width,T.height,0,b,M,T.data)}}o.__maxMipLevel=v.length-1}else{for(v=e.mipmaps,m=0;m<6;m++)if(d)for(n.texImage2D(34069+m,0,w,f[m].width,f[m].height,0,b,M,f[m].data),S=0;S<v.length;S++){var C=(T=v[S]).image[m].image;n.texImage2D(34069+m,S+1,w,C.width,C.height,0,b,M,C.data)}else for(n.texImage2D(34069+m,0,w,b,M,f[m]),S=0;S<v.length;S++)T=v[S],n.texImage2D(34069+m,S+1,w,b,M,T.image[m]);o.__maxMipLevel=v.length}u(e,y)&&h(34067,e,g.width,g.height),o.__version=e.version,e.onUpdate&&e.onUpdate(e)}else n.activeTexture(33984+r),n.bindTexture(34067,o.__webglTexture)}}function y(t,e){n.activeTexture(33984+e),n.bindTexture(34067,i.get(t).__webglTexture)}function x(n,a,o){o?(t.texParameteri(n,10242,D[a.wrapS]),t.texParameteri(n,10243,D[a.wrapT]),32879!==n&&35866!==n||t.texParameteri(n,32882,D[a.wrapR]),t.texParameteri(n,10240,I[a.magFilter]),t.texParameteri(n,10241,I[a.minFilter])):(t.texParameteri(n,10242,33071),t.texParameteri(n,10243,33071),32879!==n&&35866!==n||t.texParameteri(n,32882,33071),1001!==a.wrapS||a.wrapT,t.texParameteri(n,10240,d(a.magFilter)),t.texParameteri(n,10241,d(a.minFilter)),1003!==a.minFilter&&a.minFilter);var s=e.get("EXT_texture_filter_anisotropic");if(s){if(1015===a.type&&null===e.get("OES_texture_float_linear"))return;if(1016===a.type&&null===(A||e.get("OES_texture_half_float_linear")))return;(a.anisotropy>1||i.get(a).__currentAnisotropy)&&(t.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),i.get(a).__currentAnisotropy=a.anisotropy)}}function _(e,n){void 0===e.__webglInit&&(e.__webglInit=1,n.addEventListener("dispose",f),e.__webglTexture=t.createTexture(),o.memory.textures++)}function b(e,i,r){var o=3553;i.isDataTexture2DArray&&(o=35866),i.isDataTexture3D&&(o=32879),_(e,i),n.activeTexture(33984+r),n.bindTexture(o,e.__webglTexture),t.pixelStorei(37440,i.flipY),t.pixelStorei(37441,i.premultiplyAlpha),t.pixelStorei(3317,i.unpackAlignment);var s=function(t){return A?0:1001!==t.wrapS||1001!==t.wrapT||1003!==t.minFilter&&1006!==t.minFilter}(i)&&0==l(i.image),d=c(i.image,s,0,C),f=l(d)||A,m=a.convert(i.format),v=a.convert(i.type),g=p(i.internalFormat,m,v);x(o,i,f);var y,b=i.mipmaps;if(i.isDepthTexture)g=6402,A?g=1015===i.type?36012:1014===i.type?33190:1020===i.type?35056:33189:i.type,1026===i.format&&6402===g&&1012!==i.type&&1014!==i.type&&(i.type=1012,v=a.convert(i.type)),1027===i.format&&6402===g&&(g=34041,1020!==i.type&&(i.type=1020,v=a.convert(i.type))),n.texImage2D(3553,0,g,d.width,d.height,0,m,v,null);else if(i.isDataTexture)if(b.length>0&&f){for(var M=0,w=b.length;M<w;M++)y=b[M],n.texImage2D(3553,M,g,y.width,y.height,0,m,v,y.data);i.generateMipmaps=0,e.__maxMipLevel=b.length-1}else n.texImage2D(3553,0,g,d.width,d.height,0,m,v,d.data),e.__maxMipLevel=0;else if(i.isCompressedTexture){for(M=0,w=b.length;M<w;M++)y=b[M],1023!==i.format&&1022!==i.format?null!==m&&n.compressedTexImage2D(3553,M,g,y.width,y.height,0,y.data):n.texImage2D(3553,M,g,y.width,y.height,0,m,v,y.data);e.__maxMipLevel=b.length-1}else if(i.isDataTexture2DArray)n.texImage3D(35866,0,g,d.width,d.height,d.depth,0,m,v,d.data),e.__maxMipLevel=0;else if(i.isDataTexture3D)n.texImage3D(32879,0,g,d.width,d.height,d.depth,0,m,v,d.data),e.__maxMipLevel=0;else if(b.length>0&&f){for(M=0,w=b.length;M<w;M++)y=b[M],n.texImage2D(3553,M,g,m,v,y);i.generateMipmaps=0,e.__maxMipLevel=b.length-1}else n.texImage2D(3553,0,g,m,v,d),e.__maxMipLevel=0;u(i,f)&&h(o,i,d.width,d.height),e.__version=i.version,i.onUpdate&&i.onUpdate(i)}function M(e,r,o,s){var c=a.convert(r.texture.format),l=a.convert(r.texture.type),u=p(r.texture.internalFormat,c,l);n.texImage2D(s,0,u,r.width,r.height,0,c,l,null),t.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,o,s,i.get(r.texture).__webglTexture,0),t.bindFramebuffer(36160,null)}function w(e,n,i){if(t.bindRenderbuffer(36161,e),n.depthBuffer&&!n.stencilBuffer){var r=33189;if(i){var o=n.depthTexture;o&&o.isDepthTexture&&(1015===o.type?r=36012:1014===o.type&&(r=33190));var s=S(n);t.renderbufferStorageMultisample(36161,s,r,n.width,n.height)}else t.renderbufferStorage(36161,r,n.width,n.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(n.depthBuffer&&n.stencilBuffer)i?(s=S(n),t.renderbufferStorageMultisample(36161,s,35056,n.width,n.height)):t.renderbufferStorage(36161,34041,n.width,n.height),t.framebufferRenderbuffer(36160,33306,36161,e);else{var c=a.convert(n.texture.format),l=a.convert(n.texture.type);r=p(n.texture.internalFormat,c,l),i?(s=S(n),t.renderbufferStorageMultisample(36161,s,r,n.width,n.height)):t.renderbufferStorage(36161,r,n.width,n.height)}t.bindRenderbuffer(36161,null)}function S(t){return A&&t.isWebGLMultisampleRenderTarget?Math.min(E,t.samples):0}var T,A=r.isWebGL2,L=(r.maxTextures,r.maxCubemapSize),C=r.maxTextureSize,E=r.maxSamples,P=new WeakMap,N=0;try{N="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}var O=0,D={1e3:10497,1001:33071,1002:33648},I={1003:9728,1004:9984,1005:9986,1006:9729,1007:9985,1008:9987},z=0,R=0;this.allocateTextureUnit=function(){var t=O;return O+=1,t},this.resetTextureUnits=function(){O=0},this.setTexture2D=v,this.setTexture2DArray=function(t,e){var r=i.get(t);t.version>0&&r.__version!==t.version?b(r,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(t,e){var r=i.get(t);t.version>0&&r.__version!==t.version?b(r,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,r.__webglTexture))},this.setTextureCube=g,this.setTextureCubeDynamic=y,this.setupRenderTarget=function(e){var r=i.get(e),s=i.get(e.texture);e.addEventListener("dispose",m),s.__webglTexture=t.createTexture(),o.memory.textures++;var c=1==e.isWebGLCubeRenderTarget,d=1==e.isWebGLMultisampleRenderTarget,f=l(e)||A;if(!A||1022!==e.texture.format||1015!==e.texture.type&&1016!==e.texture.type||(e.texture.format=1023),c){r.__webglFramebuffer=[];for(var g=0;g<6;g++)r.__webglFramebuffer[g]=t.createFramebuffer()}else if(r.__webglFramebuffer=t.createFramebuffer(),d&&A){r.__webglMultisampledFramebuffer=t.createFramebuffer(),r.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,r.__webglColorRenderbuffer);var y=a.convert(e.texture.format),_=a.convert(e.texture.type),b=p(e.texture.internalFormat,y,_),T=S(e);t.renderbufferStorageMultisample(36161,T,b,e.width,e.height),t.bindFramebuffer(36160,r.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,r.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(r.__webglDepthRenderbuffer=t.createRenderbuffer(),w(r.__webglDepthRenderbuffer,e,1)),t.bindFramebuffer(36160,null)}if(c){for(n.bindTexture(34067,s.__webglTexture),x(34067,e.texture,f),g=0;g<6;g++)M(r.__webglFramebuffer[g],e,36064,34069+g);u(e.texture,f)&&h(34067,e.texture,e.width,e.height),n.bindTexture(34067,null)}else n.bindTexture(3553,s.__webglTexture),x(3553,e.texture,f),M(r.__webglFramebuffer,e,36064,3553),u(e.texture,f)&&h(3553,e.texture,e.width,e.height),n.bindTexture(3553,null);e.depthBuffer&&function(e){var n=i.get(e),r=1==e.isWebGLCubeRenderTarget;if(e.depthTexture){if(r)throw Error("target.depthTexture not supported in Cube render targets");!function(e,n){if(n&&n.isWebGLCubeRenderTarget)throw Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!n.depthTexture||!n.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.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),v(n.depthTexture,0);var r=i.get(n.depthTexture).__webglTexture;if(1026===n.depthTexture.format)t.framebufferTexture2D(36160,36096,3553,r,0);else{if(1027!==n.depthTexture.format)throw Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,r,0)}}(n.__webglFramebuffer,e)}else if(r){n.__webglDepthbuffer=[];for(var a=0;a<6;a++)t.bindFramebuffer(36160,n.__webglFramebuffer[a]),n.__webglDepthbuffer[a]=t.createRenderbuffer(),w(n.__webglDepthbuffer[a],e,0)}else t.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=t.createRenderbuffer(),w(n.__webglDepthbuffer,e,0);t.bindFramebuffer(36160,null)}(e)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(u(e,l(t)||A)){var r=t.isWebGLCubeRenderTarget?34067:3553,a=i.get(e).__webglTexture;n.bindTexture(r,a),h(r,e,t.width,t.height),n.bindTexture(r,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget&&A){var n=i.get(e);t.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,n.__webglFramebuffer);var r=e.width,a=e.height,o=16384;e.depthBuffer&&(o|=256),e.stencilBuffer&&(o|=1024),t.blitFramebuffer(0,0,r,a,0,0,r,a,o,9728),t.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(0==z&&(z=1),t=t.texture),v(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(0==R&&(R=1),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?g(t,e):y(t,e)}}function De(t,e,n){var i=n.isWebGL2;return{convert:function(t){var n;if(1009===t)return 5121;if(1017===t)return 32819;if(1018===t)return 32820;if(1019===t)return 33635;if(1010===t)return 5120;if(1011===t)return 5122;if(1012===t)return 5123;if(1013===t)return 5124;if(1014===t)return 5125;if(1015===t)return 5126;if(1016===t)return i?5131:null!==(n=e.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(1021===t)return 6406;if(1022===t)return 6407;if(1023===t)return 6408;if(1024===t)return 6409;if(1025===t)return 6410;if(1026===t)return 6402;if(1027===t)return 34041;if(1028===t)return 6403;if(1029===t)return 36244;if(1030===t)return 33319;if(1031===t)return 33320;if(1032===t)return 36248;if(1033===t)return 36249;if(33776===t||33777===t||33778===t||33779===t){if(null===(n=e.get("WEBGL_compressed_texture_s3tc")))return null;if(33776===t)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===t)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===t)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===t)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===t||35841===t||35842===t||35843===t){if(null===(n=e.get("WEBGL_compressed_texture_pvrtc")))return null;if(35840===t)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===t)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===t)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===t)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===t)return null!==(n=e.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===t||37496===t)&&null!==(n=e.get("WEBGL_compressed_texture_etc"))){if(37492===t)return n.COMPRESSED_RGB8_ETC2;if(37496===t)return n.COMPRESSED_RGBA8_ETC2_EAC}return 37808===t||37809===t||37810===t||37811===t||37812===t||37813===t||37814===t||37815===t||37816===t||37817===t||37818===t||37819===t||37820===t||37821===t||37840===t||37841===t||37842===t||37843===t||37844===t||37845===t||37846===t||37847===t||37848===t||37849===t||37850===t||37851===t||37852===t||37853===t?null!==(n=e.get("WEBGL_compressed_texture_astc"))?t:null:36492===t?null!==(n=e.get("EXT_texture_compression_bptc"))?t:null:1020===t?i?34042:null!==(n=e.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function Ie(t){Y.call(this),this.cameras=t||[]}function ze(){p.call(this),this.type="Group"}function Re(t,e){function n(t){var e=v.get(t.inputSource);e&&(e.targetRay&&e.targetRay.dispatchEvent({type:t.type}),e.grip&&e.grip.dispatchEvent({type:t.type}))}function i(){v.forEach((function(t,e){t.targetRay&&(t.targetRay.dispatchEvent({type:"disconnected",data:e}),t.targetRay.visible=0),t.grip&&(t.grip.dispatchEvent({type:"disconnected",data:e}),t.grip.visible=0)})),v.clear(),t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),T.stop(),l.isPresenting=0,l.dispatchEvent({type:"sessionend"})}function a(t){p=t,T.setContext(u),T.start(),l.isPresenting=1,l.dispatchEvent({type:"sessionstart"})}function o(t){for(var e=u.inputSources,n=0;n<m.length;n++)v.set(e[n],m[n]);for(n=0;n<t.removed.length;n++){var i=t.removed[n];(r=v.get(i))&&(r.targetRay&&r.targetRay.dispatchEvent({type:"disconnected",data:i}),r.grip&&r.grip.dispatchEvent({type:"disconnected",data:i}),v.delete(i))}for(n=0;n<t.added.length;n++){var r;i=t.added[n],(r=v.get(i))&&(r.targetRay&&r.targetRay.dispatchEvent({type:"connected",data:i}),r.grip&&r.grip.dispatchEvent({type:"connected",data:i}))}}function s(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}var l=this,u=null,h=1,p=null,d="local-floor",f=null,m=[],v=new Map,g=new Y;g.layers.enable(1),g.viewport=new r;var y=new Y;y.layers.enable(2),y.viewport=new r;var x=new Ie([g,y]);x.layers.enable(1),x.layers.enable(2);var _=null,b=null;this.enabled=0,this.isPresenting=0,this.getController=function(t){var e=m[t];return void 0===e&&(e={},m[t]=e),void 0===e.targetRay&&(e.targetRay=new ze,e.targetRay.matrixAutoUpdate=0,e.targetRay.visible=0),e.targetRay},this.getControllerGrip=function(t){var e=m[t];return void 0===e&&(e={},m[t]=e),void 0===e.grip&&(e.grip=new ze,e.grip.matrixAutoUpdate=0,e.grip.visible=0),e.grip},this.setFramebufferScaleFactor=function(t){h=t,l.isPresenting},this.setReferenceSpaceType=function(t){d=t},this.getReferenceSpace=function(){return p},this.getSession=function(){return u},this.setSession=function(t){if(null!==(u=t)){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",i);var r=e.getContextAttributes(),s={antialias:r.antialias,alpha:r.alpha,depth:r.depth,stencil:r.stencil,framebufferScaleFactor:h},c=new XRWebGLLayer(u,e,s);u.updateRenderState({baseLayer:c}),u.requestReferenceSpace(d).then(a),u.addEventListener("inputsourceschange",o)}};var M=new c,w=new c;this.getCamera=function(t){x.near=y.near=g.near=t.near,x.far=y.far=g.far=t.far,_===x.near&&b===x.far||(u.updateRenderState({depthNear:x.near,depthFar:x.far}),_=x.near,b=x.far);var e=t.parent,n=x.cameras;s(x,e);for(var i=0;i<n.length;i++)s(n[i],e);t.matrixWorld.copy(x.matrixWorld);for(var r=t.children,a=(i=0,r.length);i<a;i++)r[i].updateMatrixWorld(1);return function(t,e,n){M.setFromMatrixPosition(e.matrixWorld),w.setFromMatrixPosition(n.matrixWorld);var i=M.distanceTo(w),r=e.projectionMatrix.elements,a=n.projectionMatrix.elements,o=r[14]/(r[10]-1),s=r[14]/(r[10]+1),c=(r[9]+1)/r[5],l=(r[9]-1)/r[5],u=(r[8]-1)/r[0],h=(a[8]+1)/a[0],p=o*u,d=o*h,f=i/(-u+h),m=f*-u;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var v=o+f,g=s+f,y=p-m,x=d+(i-m),_=c*s/g*v,b=l*s/g*v;t.projectionMatrix.makePerspective(y,x,_,b,v,g)}(x,g,y),x};var S=null,T=new K;T.setAnimationLoop((function(e,n){if(null!==(f=n.getViewerPose(p))){var i=f.views,r=u.renderState.baseLayer;t.setFramebuffer(r.framebuffer);for(var a=0;a<i.length;a++){var o=i[a],s=r.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],v=null,g=null;d&&(h.targetRay&&null!==(v=n.getPose(d.targetRaySpace,p))&&(h.targetRay.matrix.fromArray(v.transform.matrix),h.targetRay.matrix.decompose(h.targetRay.position,h.targetRay.rotation,h.targetRay.scale)),h.grip&&d.gripSpace&&null!==(g=n.getPose(d.gripSpace,p))&&(h.grip.matrix.fromArray(g.transform.matrix),h.grip.matrix.decompose(h.grip.position,h.grip.rotation,h.grip.scale))),h.targetRay&&(h.targetRay.visible=null!==v),h.grip&&(h.grip.visible=null!==g)}S&&S(e,n)})),this.setAnimationLoop=function(t){S=t},this.dispose=function(){}}function Fe(t){function n(){return null===ht?St:1}function i(){N=new st(P),0==(O=new at(P,N,t)).isWebGL2&&(N.get("WEBGL_depth_texture"),N.get("OES_texture_float"),N.get("OES_texture_half_float"),N.get("OES_texture_half_float_linear"),N.get("OES_standard_derivatives"),N.get("OES_element_index_uint"),N.get("ANGLE_instanced_arrays")),N.get("OES_texture_float_linear"),X=new De(P,N,O),(D=new Ne(P,N,O)).scissor(_t.copy(Ct).multiplyScalar(St).floor()),D.viewport(xt.copy(Lt).multiplyScalar(St).floor()),I=new ut(P),z=new ye,R=new Oe(P,N,D,z,O,X,I),F=new tt(P,O),k=new ct(P,F,I),B=new dt(P,k,F,I),W=new pt(P),U=new ge(Y,N,O),j=new Me,V=new Le,G=new it(Y,D,B,S),H=new rt(P,N,I,O),q=new lt(P,N,I,O),I.programs=U.programs,Y.capabilities=O,Y.extensions=N,Y.properties=z,Y.renderLists=j,Y.state=D,Y.info=I}function a(t){t.preventDefault(),Z=1}function o(){Z=0,i()}function s(t){var e=t.target;e.removeEventListener("dispose",s),function(t){u(t),z.remove(t)}(e)}function u(t){var e=z.get(t).program;t.program=void 0,void 0!==e&&U.releaseProgram(e)}function h(t,e,n,i){for(var r=0,a=t.length;r<a;r++){var o=t[r],s=o.object,c=o.geometry,l=void 0===i?o.material:i,u=o.group;if(n.isArrayCamera){yt=n;for(var h=n.cameras,d=0,f=h.length;d<f;d++){var m=h[d];s.layers.test(m.layers)&&(D.viewport(xt.copy(m.viewport)),E.setupLights(m),p(s,e,m,c,l,u))}}else yt=null,p(s,e,n,c,l,u)}}function p(t,e,n,i,r,a){if(t.onBeforeRender(Y,e,n,i,r,a),E=V.get(e,yt||n),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){var o=m(n,e,r,t);D.setMaterial(r),vt.geometry=null,vt.program=null,vt.wireframe=0,function(t,e){t.render((function(t){Y.renderBufferImmediate(t,e)}))}(t,o)}else Y.renderBufferDirect(n,e,i,r,t,a);t.onAfterRender(Y,e,n,i,r,a),E=V.get(e,yt||n)}function f(t,e,n){var i=z.get(t),r=E.state.lights,a=E.state.shadowsArray,o=r.state.version,c=U.getParameters(t,r.state,a,e,Nt.numPlanes,Nt.numIntersection,n),l=U.getProgramCacheKey(c),h=i.program,p=1;if(void 0===h)t.addEventListener("dispose",s);else if(h.cacheKey!==l)u(t);else if(i.lightsStateVersion!==o)i.lightsStateVersion=o,p=0;else{if(void 0!==c.shaderID)return;p=0}p&&(h=U.acquireProgram(c,l),i.program=h,i.uniforms=c.uniforms,i.environment=t.isMeshStandardMaterial?e.environment:null,i.outputEncoding=Y.outputEncoding,t.program=h);var d=h.getAttributes();if(t.morphTargets){t.numSupportedMorphTargets=0;for(var f=0;f<Y.maxMorphTargets;f++)d["morphTarget"+f]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals)for(t.numSupportedMorphNormals=0,f=0;f<Y.maxMorphNormals;f++)d["morphNormal"+f]>=0&&t.numSupportedMorphNormals++;var m=i.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&1!=t.clipping||(i.numClippingPlanes=Nt.numPlanes,i.numIntersection=Nt.numIntersection,m.clippingPlanes=Nt.uniform),i.fog=e.fog,i.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&1==t.lights}(t),i.lightsStateVersion=o,i.needsLights&&(m.ambientLightColor.value=r.state.ambient,m.lightProbe.value=r.state.probe,m.directionalLights.value=r.state.directional,m.directionalLightShadows.value=r.state.directionalShadow,m.spotLights.value=r.state.spot,m.spotLightShadows.value=r.state.spotShadow,m.rectAreaLights.value=r.state.rectArea,m.pointLights.value=r.state.point,m.pointLightShadows.value=r.state.pointShadow,m.hemisphereLights.value=r.state.hemi,m.directionalShadowMap.value=r.state.directionalShadowMap,m.directionalShadowMatrix.value=r.state.directionalShadowMatrix,m.spotShadowMap.value=r.state.spotShadowMap,m.spotShadowMatrix.value=r.state.spotShadowMatrix,m.pointShadowMap.value=r.state.pointShadowMap,m.pointShadowMatrix.value=r.state.pointShadowMatrix);var v=i.program.getUniforms(),g=ee.seqWithValue(v.seq,m);i.uniformsList=g}function m(t,e,n,i){R.resetTextureUnits();var r=e.fog,a=n.isMeshStandardMaterial?e.environment:null,o=z.get(n),s=E.state.lights;if(Ot&&(Dt||t!==gt)){var c=t===gt&&n.id===mt;Nt.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,o,c)}n.version===o.__version?void 0===o.program||n.fog&&o.fog!==r||o.environment!==a||o.needsLights&&o.lightsStateVersion!==s.state.version?f(n,e,i):void 0===o.numClippingPlanes||o.numClippingPlanes===Nt.numPlanes&&o.numIntersection===Nt.numIntersection?o.outputEncoding!==Y.outputEncoding&&f(n,e,i):f(n,e,i):(f(n,e,i),o.__version=n.version);var l,u,h=0,p=0,d=0,m=o.program,y=m.getUniforms(),x=o.uniforms;if(D.useProgram(m.program)&&(h=1,p=1,d=1),n.id!==mt&&(mt=n.id,p=1),h||gt!==t){if(y.setValue(P,"projectionMatrix",t.projectionMatrix),O.logarithmicDepthBuffer&&y.setValue(P,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),gt!==t&&(gt=t,p=1,d=1),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var _=y.map.cameraPosition;void 0!==_&&_.setValue(P,zt.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&y.setValue(P,"isOrthographic",1==t.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&y.setValue(P,"viewMatrix",t.matrixWorldInverse)}if(n.skinning){y.setOptional(P,i,"bindMatrix"),y.setOptional(P,i,"bindMatrixInverse");var b=i.skeleton;if(b){var M=b.bones;if(O.floatVertexTextures){if(void 0===b.boneTexture){var w=Math.sqrt(4*M.length);w=Pa.ceilPowerOfTwo(w),w=Math.max(w,4);var S=new Float32Array(w*w*4);S.set(b.boneMatrices);var T=new $(S,w,w,1023,1015);b.boneMatrices=S,b.boneTexture=T,b.boneTextureSize=w}y.setValue(P,"boneTexture",b.boneTexture,R),y.setValue(P,"boneTextureSize",b.boneTextureSize)}else y.setOptional(P,b,"boneMatrices")}}return(p||o.receiveShadow!==i.receiveShadow)&&(o.receiveShadow=i.receiveShadow,y.setValue(P,"receiveShadow",i.receiveShadow)),p&&(y.setValue(P,"toneMappingExposure",Y.toneMappingExposure),y.setValue(P,"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),r&&n.fog&&function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}(x,r),n.isMeshBasicMaterial?v(x,n):n.isMeshLambertMaterial?(v(x,n),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(x,n)):n.isMeshToonMaterial?(v(x,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.gradientMap&&(t.gradientMap.value=e.gradientMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(x,n)):n.isMeshPhongMaterial?(v(x,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(x,n)):n.isMeshStandardMaterial?(v(x,n,a),n.isMeshPhysicalMaterial?function(t,e,n){g(t,e,n),t.reflectivity.value=e.reflectivity,t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.sheen&&t.sheen.value.copy(e.sheen),e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap),e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,1===e.side&&t.clearcoatNormalScale.value.negate()),t.transparency.value=e.transparency}(x,n,a):g(x,n,a)):n.isMeshMatcapMaterial?(v(x,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(x,n)):n.isMeshDepthMaterial?(v(x,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(x,n)):n.isMeshDistanceMaterial?(v(x,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(x,n)):n.isMeshNormalMaterial?(v(x,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(x,n)):n.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(x,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(x,n)):n.isPointsMaterial?function(t,e){var n;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*St,t.scale.value=.5*wt,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.map?n=e.map:e.alphaMap&&(n=e.alphaMap),void 0!==n&&(1==n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(x,n):n.isSpriteMaterial?function(t,e){var n;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.map?n=e.map:e.alphaMap&&(n=e.alphaMap),void 0!==n&&(1==n.matrixAutoUpdate&&n.updateMatrix(),t.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=bs.LTC_1),void 0!==x.ltc_2&&(x.ltc_2.value=bs.LTC_2),ee.upload(P,o.uniformsList,x,R),n.isShaderMaterial&&(n.uniformsNeedUpdate=0)),n.isShaderMaterial&&1==n.uniformsNeedUpdate&&(ee.upload(P,o.uniformsList,x,R),n.uniformsNeedUpdate=0),n.isSpriteMaterial&&y.setValue(P,"center",i.center),y.setValue(P,"modelViewMatrix",i.modelViewMatrix),y.setValue(P,"normalMatrix",i.normalMatrix),y.setValue(P,"modelMatrix",i.matrixWorld),m}function v(t,e,n){t.opacity.value=e.opacity,e.color&&t.diffuse.value.copy(e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap);var i,r,a=e.envMap||n;a&&(t.envMap.value=a,t.flipEnvMap.value=a.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio,t.maxMipLevel.value=z.get(a).__maxMipLevel),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity),e.map?i=e.map:e.specularMap?i=e.specularMap:e.displacementMap?i=e.displacementMap:e.normalMap?i=e.normalMap:e.bumpMap?i=e.bumpMap:e.roughnessMap?i=e.roughnessMap:e.metalnessMap?i=e.metalnessMap:e.alphaMap?i=e.alphaMap:e.emissiveMap&&(i=e.emissiveMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),1==i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix)),e.aoMap?r=e.aoMap:e.lightMap&&(r=e.lightMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),1==r.matrixAutoUpdate&&r.updateMatrix(),t.uv2Transform.value.copy(r.matrix))}function g(t,e,n){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,1===e.side&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),1===e.side&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),(e.envMap||n)&&(t.envMapIntensity.value=e.envMapIntensity)}var y=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),x=void 0!==t.context?t.context:null,_=void 0!==t.alpha?t.alpha:0,b=void 0!==t.depth?t.depth:1,M=void 0!==t.stencil?t.stencil:1,w=void 0!==t.antialias?t.antialias:0,S=void 0!==t.premultipliedAlpha?t.premultipliedAlpha:1,T=void 0!==t.preserveDrawingBuffer?t.preserveDrawingBuffer:0,A=void 0!==t.powerPreference?t.powerPreference:"default",L=void 0!==t.failIfMajorPerformanceCaveat?t.failIfMajorPerformanceCaveat:0,C=null,E=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 P,N,O,D,I,z,R,F,k,B,U,j,V,G,W,H,q,X,Y=this,Z=0,J=null,et=0,nt=0,ht=null,ft=null,mt=-1,vt={geometry:null,program:null,wireframe:0},gt=null,yt=null,xt=new r,_t=new r,bt=null,Mt=y.width,wt=y.height,St=1,Tt=null,At=null,Lt=new r(0,0,Mt,wt),Ct=new r(0,0,Mt,wt),Et=0,Pt=new Q,Nt=new ot,Ot=0,Dt=0,It=new l,zt=new c;try{var Rt={alpha:_,depth:b,stencil:M,antialias:w,premultipliedAlpha:S,preserveDrawingBuffer:T,powerPreference:A,failIfMajorPerformanceCaveat:L,xrCompatible:1};if(y.addEventListener("webglcontextlost",a,0),y.addEventListener("webglcontextrestored",o,0),null===(P=x||y.getContext("webgl",Rt)||y.getContext("experimental-webgl",Rt)))throw null!==y.getContext("webgl")?Error("Error creating WebGL context with your selected attributes."):Error("Error creating WebGL context.");void 0===P.getShaderPrecisionFormat&&(P.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw t}i();var Ft=new Re(Y,P);this.xr=Ft;var kt=new Pe(Y,B,O.maxTextureSize);this.shadowMap=kt,this.getContext=function(){return P},this.getContextAttributes=function(){return P.getContextAttributes()},this.forceContextLoss=function(){var t=N.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=N.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return St},this.setPixelRatio=function(t){void 0!==t&&(St=t,this.setSize(Mt,wt,0))},this.getSize=function(t){return void 0===t&&(t=new e),t.set(Mt,wt)},this.setSize=function(t,e,n){Ft.isPresenting||(Mt=t,wt=e,y.width=Math.floor(t*St),y.height=Math.floor(e*St),0!=n&&(y.style.width=t+"px",y.style.height=e+"px"),this.setViewport(0,0,t,e))},this.getDrawingBufferSize=function(t){return void 0===t&&(t=new e),t.set(Mt*St,wt*St).floor()},this.setDrawingBufferSize=function(t,e,n){Mt=t,wt=e,St=n,y.width=Math.floor(t*n),y.height=Math.floor(e*n),this.setViewport(0,0,t,e)},this.getCurrentViewport=function(t){return void 0===t&&(t=new r),t.copy(xt)},this.getViewport=function(t){return t.copy(Lt)},this.setViewport=function(t,e,n,i){t.isVector4?Lt.set(t.x,t.y,t.z,t.w):Lt.set(t,e,n,i),D.viewport(xt.copy(Lt).multiplyScalar(St).floor())},this.getScissor=function(t){return t.copy(Ct)},this.setScissor=function(t,e,n,i){t.isVector4?Ct.set(t.x,t.y,t.z,t.w):Ct.set(t,e,n,i),D.scissor(_t.copy(Ct).multiplyScalar(St).floor())},this.getScissorTest=function(){return Et},this.setScissorTest=function(t){D.setScissorTest(Et=t)},this.setOpaqueSort=function(t){Tt=t},this.setTransparentSort=function(t){At=t},this.getClearColor=function(){return G.getClearColor()},this.setClearColor=function(){G.setClearColor.apply(G,arguments)},this.getClearAlpha=function(){return G.getClearAlpha()},this.setClearAlpha=function(){G.setClearAlpha.apply(G,arguments)},this.clear=function(t,e,n){var i=0;(void 0===t||t)&&(i|=16384),(void 0===e||e)&&(i|=256),(void 0===n||n)&&(i|=1024),P.clear(i)},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),j.dispose(),V.dispose(),z.dispose(),B.dispose(),Ft.dispose(),jt.stop(),this.forceContextLoss()},this.renderBufferImmediate=function(t,e){D.initAttributes();var n=z.get(t);t.hasPositions&&!n.position&&(n.position=P.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=P.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=P.createBuffer()),t.hasColors&&!n.color&&(n.color=P.createBuffer());var i=e.getAttributes();t.hasPositions&&(P.bindBuffer(34962,n.position),P.bufferData(34962,t.positionArray,35048),D.enableAttribute(i.position),P.vertexAttribPointer(i.position,3,5126,0,0,0)),t.hasNormals&&(P.bindBuffer(34962,n.normal),P.bufferData(34962,t.normalArray,35048),D.enableAttribute(i.normal),P.vertexAttribPointer(i.normal,3,5126,0,0,0)),t.hasUvs&&(P.bindBuffer(34962,n.uv),P.bufferData(34962,t.uvArray,35048),D.enableAttribute(i.uv),P.vertexAttribPointer(i.uv,2,5126,0,0,0)),t.hasColors&&(P.bindBuffer(34962,n.color),P.bufferData(34962,t.colorArray,35048),D.enableAttribute(i.color),P.vertexAttribPointer(i.color,3,5126,0,0,0)),D.disableUnusedAttributes(),P.drawArrays(4,0,t.count),t.count=0};var Bt=new d;this.renderBufferDirect=function(t,e,i,r,a,o){null===e&&(e=Bt);var s=a.isMesh&&a.matrixWorld.determinant()<0,c=m(t,e,r,a);D.setMaterial(r,s);var l=0;vt.geometry===i.id&&vt.program===c.id&&vt.wireframe===(1==r.wireframe)||(vt.geometry=i.id,vt.program=c.id,vt.wireframe=1==r.wireframe,l=1),(r.morphTargets||r.morphNormals)&&(W.update(a,i,r,c),l=1);var u=i.index,h=i.attributes.position;if(null===u){if(void 0===h||0===h.count)return}else if(0===u.count)return;var p,d=1;1==r.wireframe&&(u=k.getWireframeAttribute(i),d=2);var f=H;null!==u&&(p=F.get(u),(f=q).setIndex(p)),l&&(function(t,e,n,i){if(0!=O.isWebGL2||!t.isInstancedMesh&&!e.isInstancedBufferGeometry||null!==N.get("ANGLE_instanced_arrays")){D.initAttributes();var r=e.attributes,a=i.getAttributes(),o=n.defaultAttributeValues;for(var s in a){var c=a[s];if(c>=0){var l=r[s];if(void 0!==l){var u=l.normalized,h=l.itemSize;if(void 0===(y=F.get(l)))continue;var p=y.buffer,d=y.type,f=y.bytesPerElement;if(l.isInterleavedBufferAttribute){var m=l.data,v=m.stride,g=l.offset;m&&m.isInstancedInterleavedBuffer?(D.enableAttributeAndDivisor(c,m.meshPerAttribute),void 0===e.maxInstancedCount&&(e.maxInstancedCount=m.meshPerAttribute*m.count)):D.enableAttribute(c),P.bindBuffer(34962,p),P.vertexAttribPointer(c,h,d,u,v*f,g*f)}else l.isInstancedBufferAttribute?(D.enableAttributeAndDivisor(c,l.meshPerAttribute),void 0===e.maxInstancedCount&&(e.maxInstancedCount=l.meshPerAttribute*l.count)):D.enableAttribute(c),P.bindBuffer(34962,p),P.vertexAttribPointer(c,h,d,u,0,0)}else if("instanceMatrix"===s){var y;if(void 0===(y=F.get(t.instanceMatrix)))continue;p=y.buffer,d=y.type,D.enableAttributeAndDivisor(c+0,1),D.enableAttributeAndDivisor(c+1,1),D.enableAttributeAndDivisor(c+2,1),D.enableAttributeAndDivisor(c+3,1),P.bindBuffer(34962,p),P.vertexAttribPointer(c+0,4,d,0,64,0),P.vertexAttribPointer(c+1,4,d,0,64,16),P.vertexAttribPointer(c+2,4,d,0,64,32),P.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:P.vertexAttrib2fv(c,x);break;case 3:P.vertexAttrib3fv(c,x);break;case 4:P.vertexAttrib4fv(c,x);break;default:P.vertexAttrib1fv(c,x)}}}}D.disableUnusedAttributes()}}(a,i,r,c),null!==u&&P.bindBuffer(34963,p.buffer));var v=null!==u?u.count:h.count,g=i.drawRange.start*d,y=i.drawRange.count*d,x=null!==o?o.start*d:0,_=null!==o?o.count*d:1/0,b=Math.max(g,x),M=Math.max(0,Math.min(v,g+y,x+_)-1-b+1);if(0!==M){if(a.isMesh)1==r.wireframe?(D.setLineWidth(r.wireframeLinewidth*n()),f.setMode(1)):f.setMode(4);else if(a.isLine){var w=r.linewidth;void 0===w&&(w=1),D.setLineWidth(w*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(i,b,M,a.count):i.isInstancedBufferGeometry?f.renderInstances(i,b,M,i.maxInstancedCount):f.render(b,M)}},this.compile=function(t,e){(E=V.get(t,e)).init(),t.traverse((function(t){t.isLight&&(E.pushLight(t),t.castShadow&&E.pushShadow(t))})),E.setupLights(e);var n={};t.traverse((function(e){if(e.material)if(Array.isArray(e.material))for(var i=0;i<e.material.length;i++)e.material[i].uuid in n==0&&(f(e.material[i],t,e),n[e.material[i].uuid]=1);else e.material.uuid in n==0&&(f(e.material,t,e),n[e.material.uuid]=1)}))};var Ut=null,jt=new K;jt.setAnimationLoop((function(t){Ft.isPresenting||Ut&&Ut(t)})),"undefined"!=typeof window&&jt.setContext(window),this.setAnimationLoop=function(t){Ut=t,Ft.setAnimationLoop(t),jt.start()},this.render=function(t,e,n,i){var r,a;if(void 0!==n&&(r=n),void 0!==i&&(a=i),e&&e.isCamera&&!Z){vt.geometry=null,vt.program=null,vt.wireframe=0,mt=-1,gt=null,1==t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),Ft.enabled&&Ft.isPresenting&&(e=Ft.getCamera(e)),(E=V.get(t,e)).init(),t.onBeforeRender(Y,t,e,r||ht),It.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),Pt.setFromProjectionMatrix(It),Dt=this.localClippingEnabled,Ot=Nt.init(this.clippingPlanes,Dt,e),(C=j.get(t,e)).init(),function t(e,n,i,r){if(0!=e.visible){if(e.layers.test(n.layers))if(e.isGroup)i=e.renderOrder;else if(e.isLOD)1==e.autoUpdate&&e.update(n);else if(e.isLight)E.pushLight(e),e.castShadow&&E.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||Pt.intersectsSprite(e)){r&&zt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(It);var a=B.update(e);(o=e.material).visible&&C.push(e,a,o,i,zt.z,null)}}else if(e.isImmediateRenderObject)r&&zt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(It),C.push(e,null,e.material,i,zt.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==I.render.frame&&(e.skeleton.update(),e.skeleton.frame=I.render.frame),!e.frustumCulled||Pt.intersectsObject(e))){r&&zt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(It),a=B.update(e);var o=e.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&&C.push(e,a,h,i,zt.z,u)}else o.visible&&C.push(e,a,o,i,zt.z,null)}var p=e.children;for(c=0,l=p.length;c<l;c++)t(p[c],n,i,r)}}(t,e,0,Y.sortObjects),C.finish(),1==Y.sortObjects&&C.sort(Tt,At),Ot&&Nt.beginShadows();var o=E.state.shadowsArray;kt.render(o,t,e),E.setupLights(e),Ot&&Nt.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==r&&this.setRenderTarget(r),G.render(C,t,e,a);var s=C.opaque,c=C.transparent;if(t.overrideMaterial){var l=t.overrideMaterial;s.length&&h(s,t,e,l),c.length&&h(c,t,e,l)}else s.length&&h(s,t,e),c.length&&h(c,t,e);t.onAfterRender(Y,t,e),null!==ht&&(R.updateRenderTargetMipmap(ht),R.updateMultisampleRenderTarget(ht)),D.buffers.depth.setTest(1),D.buffers.depth.setMask(1),D.buffers.color.setMask(1),D.setPolygonOffset(0),C=null,E=null}},this.setFramebuffer=function(t){J!==t&&null===ht&&P.bindFramebuffer(36160,t),J=t},this.getActiveCubeFace=function(){return et},this.getActiveMipmapLevel=function(){return nt},this.getRenderTarget=function(){return ht},this.setRenderTarget=function(t,e,n){ht=t,et=e,nt=n,t&&void 0===z.get(t).__webglFramebuffer&&R.setupRenderTarget(t);var i=J,r=0;if(t){var a=z.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(i=a[e||0],r=1):i=t.isWebGLMultisampleRenderTarget?z.get(t).__webglMultisampledFramebuffer:a,xt.copy(t.viewport),_t.copy(t.scissor),bt=t.scissorTest}else xt.copy(Lt).multiplyScalar(St).floor(),_t.copy(Ct).multiplyScalar(St).floor(),bt=Et;if(ft!==i&&(P.bindFramebuffer(36160,i),ft=i),D.viewport(xt),D.scissor(_t),D.setScissorTest(bt),r){var o=z.get(t.texture);P.framebufferTexture2D(36160,36064,34069+(e||0),o.__webglTexture,n||0)}},this.readRenderTargetPixels=function(t,e,n,i,r,a,o){if(t&&t.isWebGLRenderTarget){var s=z.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){var c=0;s!==ft&&(P.bindFramebuffer(36160,s),c=1);try{var l=t.texture,u=l.format,h=l.type;if(1023!==u&&X.convert(u)!==P.getParameter(35739))return;if(!(1009===h||X.convert(h)===P.getParameter(35738)||1015===h&&(O.isWebGL2||N.get("OES_texture_float")||N.get("WEBGL_color_buffer_float"))||1016===h&&(O.isWebGL2?N.get("EXT_color_buffer_float"):N.get("EXT_color_buffer_half_float"))))return;36053===P.checkFramebufferStatus(36160)&&e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&P.readPixels(e,n,i,r,X.convert(u),X.convert(h),a)}finally{c&&P.bindFramebuffer(36160,ft)}}}},this.copyFramebufferToTexture=function(t,e,n){void 0===n&&(n=0);var i=Math.pow(2,-n),r=Math.floor(e.image.width*i),a=Math.floor(e.image.height*i),o=X.convert(e.format);R.setTexture2D(e,0),P.copyTexImage2D(3553,n,o,t.x,t.y,r,a,0),D.unbindTexture()},this.copyTextureToTexture=function(t,e,n,i){var r=e.image.width,a=e.image.height,o=X.convert(n.format),s=X.convert(n.type);R.setTexture2D(n,0),e.isDataTexture?P.texSubImage2D(3553,i||0,t.x,t.y,r,a,o,s,e.image.data):P.texSubImage2D(3553,i||0,t.x,t.y,o,s,e.image),D.unbindTexture()},this.initTexture=function(t){R.setTexture2D(t,0),D.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function ke(t,e){this.name="",this.color=new _(t),this.density=void 0!==e?e:25e-5}function Be(t,e,n){this.name="",this.color=new _(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function Ue(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function je(t,e,n,i){this.data=t,this.itemSize=e,this.offset=n,this.normalized=1==i}function Ve(t){T.call(this),this.type="SpriteMaterial",this.color=new _(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=1,this.transparent=1,this.setValues(t)}function Ge(t){if(p.call(this),this.type="Sprite",void 0===Bs){Bs=new B;var n=new Ue(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);Bs.setIndex([0,1,2,0,2,3]),Bs.setAttribute("position",new je(n,3,0,0)),Bs.setAttribute("uv",new je(n,2,3,0))}this.geometry=Bs,this.material=void 0!==t?t:new Ve,this.center=new e(.5,.5)}function We(t,e,n,i,r,a){Ws.subVectors(t,n).addScalar(.5).multiply(i),void 0!==r?(Hs.x=a*Ws.x-r*Ws.y,Hs.y=r*Ws.x+a*Ws.y):Hs.copy(Ws),t.copy(e),t.x+=Hs.x,t.y+=Hs.y,t.applyMatrix4(qs)}function He(){p.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:1,value:[]}}),this.autoUpdate=1}function qe(t,e){t&&t.isGeometry,U.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new l,this.bindMatrixInverse=new l}function Xe(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{this.boneInverses=[];for(var n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new l)}}function Ye(){p.call(this),this.type="Bone"}function Ze(t,e,n){U.call(this,t,e),this.instanceMatrix=new L(new Float32Array(16*n),16),this.count=n,this.frustumCulled=0}function Je(t){T.call(this),this.type="LineBasicMaterial",this.color=new _(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(t)}function $e(t,e){p.call(this),this.type="Line",this.geometry=void 0!==t?t:new B,this.material=void 0!==e?e:new Je}function Qe(t,e){$e.call(this,t,e),this.type="LineSegments"}function Ke(t,e){$e.call(this,t,e),this.type="LineLoop"}function tn(t){T.call(this),this.type="PointsMaterial",this.color=new _(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=1,this.morphTargets=0,this.setValues(t)}function en(t,e){p.call(this),this.type="Points",this.geometry=void 0!==t?t:new B,this.material=void 0!==e?e:new tn,this.updateMorphTargets()}function nn(t,e,n,i,r,a,o){var s=mc.distanceSqToPoint(t);if(s<n){var l=new c;mc.closestPointToPoint(t,l),l.applyMatrix4(i);var u=r.ray.origin.distanceTo(l);if(u<r.near||u>r.far)return;a.push({distance:u,distanceToRay:Math.sqrt(s),point:l,index:e,face:null,object:o})}}function rn(t,e,n,r,a,o,s,c,l){i.call(this,t,e,n,r,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(t,e,n,r,a,o,s,c,l,u,h,p){i.call(this,null,o,s,c,l,u,r,a,h,p),this.image={width:e,height:n},this.mipmaps=t,this.flipY=0,this.generateMipmaps=0}function on(t,e,n,r,a,o,s,c,l){i.call(this,t,e,n,r,a,o,s,c,l),this.needsUpdate=1}function sn(t,e,n,r,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),i.call(this,null,r,a,o,s,c,u,n,l),this.image={width:t,height:e},this.magFilter=void 0!==s?s:1003,this.minFilter=void 0!==c?c:1003,this.flipY=0,this.generateMipmaps=0}function cn(t){B.call(this),this.type="WireframeGeometry";var e,n,i,r,a,o,s,l,u,h,p=[],d=[0,0],f={},m=["a","b","c"];if(t&&t.isGeometry){var v=t.faces;for(e=0,i=v.length;e<i;e++){var g=v[e];for(n=0;n<3;n++)s=g[m[n]],l=g[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=t.vertices[o.index1],p.push(h.x,h.y,h.z),h=t.vertices[o.index2],p.push(h.x,h.y,h.z)}else if(t&&t.isBufferGeometry){var y,x,_,b,M,w,S;if(h=new c,null!==t.index){for(y=t.attributes.position,x=t.index,0===(_=t.groups).length&&(_=[{start:0,count:x.count,materialIndex:0}]),r=0,a=_.length;r<a;++r)for(e=M=(b=_[r]).start,i=M+b.count;e<i;e+=3)for(n=0;n<3;n++)s=x.getX(e+n),l=x.getX(e+(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(e=0,i=(y=t.attributes.position).count/3;e<i;e++)for(n=0;n<3;n++)w=3*e+n,h.fromBufferAttribute(y,w),p.push(h.x,h.y,h.z),S=3*e+(n+1)%3,h.fromBufferAttribute(y,S),p.push(h.x,h.y,h.z)}this.setAttribute("position",new z(p,3))}function ln(t,e,n){G.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n},this.fromBufferGeometry(new un(t,e,n)),this.mergeVertices()}function un(t,e,n){B.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:n};var i,r,a=[],o=[],s=[],l=[],u=1e-5,h=new c,p=new c,d=new c,f=new c,m=new c;t.length;var v=e+1;for(i=0;i<=n;i++){var g=i/n;for(r=0;r<=e;r++){var y=r/e;t(y,g,p),o.push(p.x,p.y,p.z),y-u>=0?(t(y-u,g,d),f.subVectors(p,d)):(t(y+u,g,d),f.subVectors(d,p)),g-u>=0?(t(y,g-u,d),m.subVectors(p,d)):(t(y,g+u,d),m.subVectors(d,p)),h.crossVectors(f,m).normalize(),s.push(h.x,h.y,h.z),l.push(y,g)}}for(i=0;i<n;i++)for(r=0;r<e;r++){var x=i*v+r,_=i*v+r+1,b=(i+1)*v+r+1,M=(i+1)*v+r;a.push(x,_,M),a.push(_,b,M)}this.setIndex(a),this.setAttribute("position",new z(o,3)),this.setAttribute("normal",new z(s,3)),this.setAttribute("uv",new z(l,2))}function hn(t,e,n,i){G.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i},this.fromBufferGeometry(new pn(t,e,n,i)),this.mergeVertices()}function pn(t,n,i,r){function a(t,e,n,i){var r,a,s=Math.pow(2,i),c=[];for(r=0;r<=s;r++){c[r]=[];var l=t.clone().lerp(n,r/s),u=e.clone().lerp(n,r/s),h=s-r;for(a=0;a<=h;a++)c[r][a]=0===a&&r===s?l:l.clone().lerp(u,a/h)}for(r=0;r<s;r++)for(a=0;a<2*(s-r)-1;a++){var p=Math.floor(a/2);a%2==0?(o(c[r][p+1]),o(c[r+1][p]),o(c[r][p])):(o(c[r][p+1]),o(c[r+1][p+1]),o(c[r+1][p]))}}function o(t){h.push(t.x,t.y,t.z)}function s(e,n){var i=3*e;n.x=t[i+0],n.y=t[i+1],n.z=t[i+2]}function l(t,e,n,i){i<0&&1===t.x&&(p[e]=t.x-1),0===n.x&&0===n.z&&(p[e]=i/2/Math.PI+.5)}function u(t){return Math.atan2(t.z,-t.x)}B.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:n,radius:i,detail:r},i=i||1;var h=[],p=[];!function(t){for(var e=new c,i=new c,r=new c,o=0;o<n.length;o+=3)s(n[o+0],e),s(n[o+1],i),s(n[o+2],r),a(e,i,r,t)}(r=r||0),function(t){for(var e=new c,n=0;n<h.length;n+=3)e.x=h[n+0],e.y=h[n+1],e.z=h[n+2],e.normalize().multiplyScalar(t),h[n+0]=e.x,h[n+1]=e.y,h[n+2]=e.z}(i),function(){for(var t,n=new c,i=0;i<h.length;i+=3){n.x=h[i+0],n.y=h[i+1],n.z=h[i+2];var r=u(n)/2/Math.PI+.5,a=Math.atan2(-(t=n).y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5;p.push(r,1-a)}!function(){for(var t=new c,n=new c,i=new c,r=new c,a=new e,o=new e,s=new e,d=0,f=0;d<h.length;d+=9,f+=6){t.set(h[d+0],h[d+1],h[d+2]),n.set(h[d+3],h[d+4],h[d+5]),i.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]),r.copy(t).add(n).add(i).divideScalar(3);var m=u(r);l(a,f+0,t,m),l(o,f+2,n,m),l(s,f+4,i,m)}}(),function(){for(var t=0;t<p.length;t+=6){var e=p[t+0],n=p[t+2],i=p[t+4];Math.max(e,n,i)>.9&&Math.min(e,n,i)<.1&&(e<.2&&(p[t+0]+=1),n<.2&&(p[t+2]+=1),i<.2&&(p[t+4]+=1))}}()}(),this.setAttribute("position",new z(h,3)),this.setAttribute("normal",new z(h.slice(),3)),this.setAttribute("uv",new z(p,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function dn(t,e){G.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new fn(t,e)),this.mergeVertices()}function fn(t,e){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],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function mn(t,e){G.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new vn(t,e)),this.mergeVertices()}function vn(t,e){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],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function gn(t,e){G.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new yn(t,e)),this.mergeVertices()}function yn(t,e){var n=1.618033988749895,i=[-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,i,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function xn(t,e){G.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new _n(t,e)),this.mergeVertices()}function _n(t,e){var n=1.618033988749895,i=1/n,r=[-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,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i];pn.call(this,r,[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],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function bn(t,e,n,i,r){G.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r};var a=new Mn(t,e,n,i,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function Mn(t,n,i,r,a){function o(e){f=t.getPointAt(e/n,f);var a=s.normals[e],o=s.binormals[e];for(u=0;u<=r;u++){var c=u/r*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(),v.push(p.x,p.y,p.z),h.x=f.x+i*p.x,h.y=f.y+i*p.y,h.z=f.z+i*p.z,m.push(h.x,h.y,h.z)}}B.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:n,radius:i,radialSegments:r,closed:a},n=n||64,i=i||1,r=r||8,a=a||0;var s=t.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 e,f=new c,m=[],v=[],g=[],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<=r;u++)d.x=l/n,d.y=u/r,g.push(d.x,d.y)}(),function(){for(u=1;u<=n;u++)for(l=1;l<=r;l++){var t=(r+1)*(u-1)+(l-1),e=(r+1)*u+(l-1),i=(r+1)*u+l,a=(r+1)*(u-1)+l;y.push(t,e,a),y.push(e,i,a)}}()}(),this.setIndex(y),this.setAttribute("position",new z(m,3)),this.setAttribute("normal",new z(v,3)),this.setAttribute("uv",new z(g,2))}function wn(t,e,n,i,r,a){G.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:a},this.fromBufferGeometry(new Sn(t,e,n,i,r,a)),this.mergeVertices()}function Sn(t,e,n,i,r,a){function o(t,e,n,i,r){var a=Math.cos(t),o=Math.sin(t),s=n/e*t,c=Math.cos(s);r.x=i*(2+c)*.5*a,r.y=i*(2+c)*o*.5,r.z=i*Math.sin(s)*.5}B.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:a},t=t||1,e=e||.4,n=Math.floor(n)||64,i=Math.floor(i)||8,r=r||2,a=a||3;var s,l,u=[],h=[],p=[],d=[],f=new c,m=new c,v=new c,g=new c,y=new c,x=new c,_=new c;for(s=0;s<=n;++s){var b=s/n*r*Math.PI*2;for(o(b,r,a,t,v),o(b+.01,r,a,t,g),x.subVectors(g,v),_.addVectors(g,v),y.crossVectors(x,_),_.crossVectors(y,x),y.normalize(),_.normalize(),l=0;l<=i;++l){var M=l/i*Math.PI*2,w=-e*Math.cos(M),S=e*Math.sin(M);f.x=v.x+(w*_.x+S*y.x),f.y=v.y+(w*_.y+S*y.y),f.z=v.z+(w*_.z+S*y.z),h.push(f.x,f.y,f.z),m.subVectors(f,v).normalize(),p.push(m.x,m.y,m.z),d.push(s/n),d.push(l/i)}}for(l=1;l<=n;l++)for(s=1;s<=i;s++){var T=(i+1)*(l-1)+(s-1),A=(i+1)*l+(s-1),L=(i+1)*l+s,C=(i+1)*(l-1)+s;u.push(T,A,C),u.push(A,L,C)}this.setIndex(u),this.setAttribute("position",new z(h,3)),this.setAttribute("normal",new z(p,3)),this.setAttribute("uv",new z(d,2))}function Tn(t,e,n,i,r){G.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},this.fromBufferGeometry(new An(t,e,n,i,r)),this.mergeVertices()}function An(t,e,n,i,r){B.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},t=t||1,e=e||.4,n=Math.floor(n)||8,i=Math.floor(i)||6,r=r||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<=i;o++){var m=o/i*r,v=a/n*Math.PI*2;d.x=(t+e*Math.cos(v))*Math.cos(m),d.y=(t+e*Math.cos(v))*Math.sin(m),d.z=e*Math.sin(v),l.push(d.x,d.y,d.z),p.x=t*Math.cos(m),p.y=t*Math.sin(m),f.subVectors(d,p).normalize(),u.push(f.x,f.y,f.z),h.push(o/i),h.push(a/n)}for(a=1;a<=n;a++)for(o=1;o<=i;o++){var g=(i+1)*a+o-1,y=(i+1)*(a-1)+o-1,x=(i+1)*(a-1)+o,_=(i+1)*a+o;s.push(g,y,_),s.push(y,x,_)}this.setIndex(s),this.setAttribute("position",new z(l,3)),this.setAttribute("normal",new z(u,3)),this.setAttribute("uv",new z(h,2))}function Ln(t,e,n,i,r){var a,o;if(r===function(t,e,n,i){for(var r=0,a=e,o=n-i;a<n;a+=i)r+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return r}(t,e,n,i)>0)for(a=e;a<n;a+=i)o=Hn(a,t[a],t[a+1],o);else for(a=n-i;a>=e;a-=i)o=Hn(a,t[a],t[a+1],o);return o&&jn(o,o.next)&&(qn(o),o=o.next),o}function Cn(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=0,i.steiner||!jn(i,i.next)&&0!==Un(i.prev,i,i.next))i=i.next;else{if(qn(i),(i=e=i.prev)===i.next)break;n=1}}while(n||i!==e);return e}function En(t,e,n,i,r,a,o){if(t){!o&&a&&function(t,e,n,i){var r=t;do{null===r.z&&(r.z=Rn(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,n,i,r,a,o,s,c,l=1;do{for(n=t,t=null,a=null,o=0;n;){for(o++,i=n,s=0,e=0;e<l&&(s++,i=i.nextZ);e++);for(c=l;s>0||c>0&&i;)0!==s&&(0===c||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,c--),a?a.nextZ=r:t=r,r.prevZ=a,a=r;n=i}a.nextZ=null,l*=2}while(o>1)}(r)}(t,i,r,a);for(var s,c,l=t;t.prev!==t.next;)if(s=t.prev,c=t.next,a?Nn(t,i,r,a):Pn(t))e.push(s.i/n),e.push(t.i/n),e.push(c.i/n),qn(t),t=c.next,l=c.next;else if((t=c)===l){o?1===o?En(t=On(t,e,n),e,n,i,r,a,2):2===o&&Dn(t,e,n,i,r,a):En(Cn(t),e,n,i,r,a,1);break}}}function Pn(t){var e=t.prev,n=t,i=t.next;if(Un(e,n,i)>=0)return 0;for(var r=t.next.next;r!==t.prev;){if(kn(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&Un(r.prev,r,r.next)>=0)return 0;r=r.next}return 1}function Nn(t,e,n,i){var r=t.prev,a=t,o=t.next;if(Un(r,a,o)>=0)return 0;for(var s=r.x<a.x?r.x<o.x?r.x:o.x:a.x<o.x?a.x:o.x,c=r.y<a.y?r.y<o.y?r.y:o.y:a.y<o.y?a.y:o.y,l=r.x>a.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,u=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,h=Rn(s,c,e,n,i),p=Rn(l,u,e,n,i),d=t.prevZ,f=t.nextZ;d&&d.z>=h&&f&&f.z<=p;){if(d!==t.prev&&d!==t.next&&kn(r.x,r.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Un(d.prev,d,d.next)>=0)return 0;if(d=d.prevZ,f!==t.prev&&f!==t.next&&kn(r.x,r.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Un(f.prev,f,f.next)>=0)return 0;f=f.nextZ}for(;d&&d.z>=h;){if(d!==t.prev&&d!==t.next&&kn(r.x,r.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Un(d.prev,d,d.next)>=0)return 0;d=d.prevZ}for(;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&kn(r.x,r.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Un(f.prev,f,f.next)>=0)return 0;f=f.nextZ}return 1}function On(t,e,n){var i=t;do{var r=i.prev,a=i.next.next;!jn(r,a)&&Vn(r,i,i.next,a)&&Gn(r,a)&&Gn(a,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(a.i/n),qn(i),qn(i.next),i=t=a),i=i.next}while(i!==t);return i}function Dn(t,e,n,i,r,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Bn(o,s)){var c=Wn(o,s);return o=Cn(o,o.next),c=Cn(c,c.next),En(o,e,n,i,r,a),void En(c,e,n,i,r,a)}s=s.next}o=o.next}while(o!==t)}function In(t,e){return t.x-e.x}function zn(t,e){if(e=function(t,e){var n,i=e,r=t.x,a=t.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(r===o)return n.prev;var c,l=n,u=n.x,h=n.y,p=1/0;for(i=n.next;i!==l;)r>=i.x&&i.x>=u&&r!==i.x&&kn(a<h?r:o,a,u,h,a<h?o:r,a,i.x,i.y)&&((c=Math.abs(a-i.y)/(r-i.x))<p||c===p&&i.x>n.x)&&Gn(i,t)&&(n=i,p=c),i=i.next;return n}(t,e)){var n=Wn(e,t);Cn(n,n.next)}}function Rn(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Fn(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function kn(t,e,n,i,r,a,o,s){return(r-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(i-s)-(n-o)*(e-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function Bn(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Vn(n,n.next,t,e))return 1;n=n.next}while(n!==t);return 0}(t,e)&&Gn(t,e)&&Gn(e,t)&&function(t,e){var n=t,i=0,r=(t.x+e.x)/2,a=(t.y+e.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)}function Un(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function jn(t,e){return t.x===e.x&&t.y===e.y}function Vn(t,e,n,i){return jn(t,n)&&jn(e,i)||jn(t,i)&&jn(n,e)?1:Un(t,e,n)>0!=Un(t,e,i)>0&&Un(n,i,t)>0!=Un(n,i,e)>0}function Gn(t,e){return Un(t.prev,t,t.next)<0?Un(t,e,t.next)>=0&&Un(t,t.prev,e)>=0:Un(t,e,t.prev)<0||Un(t,t.next,e)<0}function Wn(t,e){var n=new Xn(t.i,t.x,t.y),i=new Xn(e.i,e.x,e.y),r=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function Hn(t,e,n,i){var r=new Xn(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function qn(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Xn(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=0}function Yn(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function Zn(t,e){for(var n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}function Jn(t,e){G.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new $n(t,e)),this.mergeVertices()}function $n(t,n){function i(t){function i(t,e,n){return e.clone().multiplyScalar(n).add(t)}function s(t,n,i){var r,a,o,s=t.x-n.x,c=t.y-n.y,l=i.x-t.x,u=i.y-t.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,v=((i.x-u/d-f)*u-(i.y+l/d-m)*l)/(s*u-c*l),g=(r=f+s*v-t.x)*r+(a=m+c*v-t.y)*a;if(g<=2)return new e(r,a);o=Math.sqrt(g/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?(r=-c,a=s,o=Math.sqrt(h)):(r=s,a=c,o=Math.sqrt(h/2))}return new e(r/o,a/o)}function l(t,e){var n,i;for(Z=t.length;--Z>=0;){n=Z,(i=Z-1)<0&&(i=t.length-1);var r=0,a=g+2*w;for(r=0;r<a;r++){var o=q*r,s=q*(r+1);p(e+n+o,e+i+o,e+i+s,e+n+s)}}}function u(t,e,n){m.push(t),m.push(e),m.push(n)}function h(t,e,n){d(t),d(e),d(n);var i=a.length/3,o=T.generateTopUV(r,a,i-3,i-2,i-1);f(o[0]),f(o[1]),f(o[2])}function p(t,e,n,i){d(t),d(e),d(i),d(e),d(n),d(i);var o=a.length/3,s=T.generateSideWallUV(r,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(t){a.push(m[3*t+0]),a.push(m[3*t+1]),a.push(m[3*t+2])}function f(t){o.push(t.x),o.push(t.y)}var m=[],v=void 0!==n.curveSegments?n.curveSegments:12,g=void 0!==n.steps?n.steps:1,y=void 0!==n.depth?n.depth:100,x=void 0!==n.bevelEnabled?n.bevelEnabled:1,_=void 0!==n.bevelThickness?n.bevelThickness:6,b=void 0!==n.bevelSize?n.bevelSize:_-2,M=void 0!==n.bevelOffset?n.bevelOffset:0,w=void 0!==n.bevelSegments?n.bevelSegments:3,S=n.extrudePath,T=void 0!==n.UVGenerator?n.UVGenerator:xc;void 0!==n.amount&&(y=n.amount);var A,L,C,E,P,N,O,D,I=0;S&&(A=S.getSpacedPoints(g),I=1,x=0,L=S.computeFrenetFrames(g,0),C=new c,E=new c,P=new c),x||(w=0,_=0,b=0,M=0);var z=t.extractPoints(v),R=z.shape,F=z.holes;if(!yc.isClockWise(R))for(R=R.reverse(),O=0,D=F.length;O<D;O++)N=F[O],yc.isClockWise(N)&&(F[O]=N.reverse());var k=yc.triangulateShape(R,F),B=R;for(O=0,D=F.length;O<D;O++)N=F[O],R=R.concat(N);for(var U,j,V,G,W,H,q=R.length,X=k.length,Y=[],Z=0,J=B.length,$=J-1,Q=Z+1;Z<J;Z++,$++,Q++)$===J&&($=0),Q===J&&(Q=0),Y[Z]=s(B[Z],B[$],B[Q]);var K,tt,et=[],nt=Y.concat();for(O=0,D=F.length;O<D;O++){for(N=F[O],K=[],Z=0,$=(J=N.length)-1,Q=Z+1;Z<J;Z++,$++,Q++)$===J&&($=0),Q===J&&(Q=0),K[Z]=s(N[Z],N[$],N[Q]);et.push(K),nt=nt.concat(K)}for(U=0;U<w;U++){for(G=_*Math.cos((V=U/w)*Math.PI/2),j=b*Math.sin(V*Math.PI/2)+M,Z=0,J=B.length;Z<J;Z++)u((W=i(B[Z],Y[Z],j)).x,W.y,-G);for(O=0,D=F.length;O<D;O++)for(N=F[O],K=et[O],Z=0,J=N.length;Z<J;Z++)u((W=i(N[Z],K[Z],j)).x,W.y,-G)}for(j=b+M,Z=0;Z<q;Z++)W=x?i(R[Z],nt[Z],j):R[Z],I?(E.copy(L.normals[0]).multiplyScalar(W.x),C.copy(L.binormals[0]).multiplyScalar(W.y),P.copy(A[0]).add(E).add(C),u(P.x,P.y,P.z)):u(W.x,W.y,0);for(tt=1;tt<=g;tt++)for(Z=0;Z<q;Z++)W=x?i(R[Z],nt[Z],j):R[Z],I?(E.copy(L.normals[tt]).multiplyScalar(W.x),C.copy(L.binormals[tt]).multiplyScalar(W.y),P.copy(A[tt]).add(E).add(C),u(P.x,P.y,P.z)):u(W.x,W.y,y/g*tt);for(U=w-1;U>=0;U--){for(G=_*Math.cos((V=U/w)*Math.PI/2),j=b*Math.sin(V*Math.PI/2)+M,Z=0,J=B.length;Z<J;Z++)u((W=i(B[Z],Y[Z],j)).x,W.y,y+G);for(O=0,D=F.length;O<D;O++)for(N=F[O],K=et[O],Z=0,J=N.length;Z<J;Z++)W=i(N[Z],K[Z],j),I?u(W.x,W.y+A[g-1].y,A[g-1].x+G):u(W.x,W.y,y+G)}!function(){var t=a.length/3;if(x){var e=0,n=q*e;for(Z=0;Z<X;Z++)h((H=k[Z])[2]+n,H[1]+n,H[0]+n);for(n=q*(e=g+2*w),Z=0;Z<X;Z++)h((H=k[Z])[0]+n,H[1]+n,H[2]+n)}else{for(Z=0;Z<X;Z++)h((H=k[Z])[2],H[1],H[0]);for(Z=0;Z<X;Z++)h((H=k[Z])[0]+q*g,H[1]+q*g,H[2]+q*g)}r.addGroup(t,a.length/3-t,0)}(),function(){var t=a.length/3,e=0;for(l(B,e),e+=B.length,O=0,D=F.length;O<D;O++)l(N=F[O],e),e+=N.length;r.addGroup(t,a.length/3-t,1)}()}B.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:n};for(var r=this,a=[],o=[],s=0,l=(t=Array.isArray(t)?t:[t]).length;s<l;s++)i(t[s]);this.setAttribute("position",new z(a,3)),this.setAttribute("uv",new z(o,2)),this.computeVertexNormals()}function Qn(t,e,n){if(n.shapes=[],Array.isArray(t))for(var i=0,r=t.length;i<r;i++){var a=t[i];n.shapes.push(a.uuid)}else n.shapes.push(t.uuid);return void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON()),n}function Kn(t,e){G.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new ti(t,e)),this.mergeVertices()}function ti(t,e){var n=(e=e||{}).font;if(!n||!n.isFont)return new G;var i=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=0),$n.call(this,i,e),this.type="TextBufferGeometry"}function ei(t,e,n,i,r,a,o){G.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new ni(t,e,n,i,r,a,o)),this.mergeVertices()}function ni(t,e,n,i,r,a,o){B.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},t=t||1,e=Math.max(3,Math.floor(e)||8),n=Math.max(2,Math.floor(n)||6),i=void 0!==i?i:0,r=void 0!==r?r: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=[],v=[],g=[],y=[];for(l=0;l<=n;l++){var x=[],_=l/n,b=0;for(0==l&&0==a?b=.5/e:l==n&&u==Math.PI&&(b=-.5/e),s=0;s<=e;s++){var M=s/e;d.x=-t*Math.cos(i+M*r)*Math.sin(a+_*o),d.y=t*Math.cos(a+_*o),d.z=t*Math.sin(i+M*r)*Math.sin(a+_*o),v.push(d.x,d.y,d.z),f.copy(d).normalize(),g.push(f.x,f.y,f.z),y.push(M+b,1-_),x.push(h++)}p.push(x)}for(l=0;l<n;l++)for(s=0;s<e;s++){var w=p[l][s+1],S=p[l][s],T=p[l+1][s],A=p[l+1][s+1];(0!==l||a>0)&&m.push(w,S,A),(l!==n-1||u<Math.PI)&&m.push(S,T,A)}this.setIndex(m),this.setAttribute("position",new z(v,3)),this.setAttribute("normal",new z(g,3)),this.setAttribute("uv",new z(y,2))}function ii(t,e,n,i,r,a){G.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:a},this.fromBufferGeometry(new ri(t,e,n,i,r,a)),this.mergeVertices()}function ri(t,n,i,r,a,o){B.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:n,thetaSegments:i,phiSegments:r,thetaStart:a,thetaLength:o},t=t||.5,n=n||1,a=void 0!==a?a:0,o=void 0!==o?o:2*Math.PI,i=void 0!==i?Math.max(3,i):8;var s,l,u,h=[],p=[],d=[],f=[],m=t,v=(n-t)/(r=void 0!==r?Math.max(1,r):1),g=new c,y=new e;for(l=0;l<=r;l++){for(u=0;u<=i;u++)s=a+u/i*o,g.x=m*Math.cos(s),g.y=m*Math.sin(s),p.push(g.x,g.y,g.z),d.push(0,0,1),y.x=(g.x/n+1)/2,y.y=(g.y/n+1)/2,f.push(y.x,y.y);m+=v}for(l=0;l<r;l++){var x=l*(i+1);for(u=0;u<i;u++){var _=s=u+x,b=s+i+1,M=s+i+2,w=s+1;h.push(_,b,w),h.push(b,M,w)}}this.setIndex(h),this.setAttribute("position",new z(p,3)),this.setAttribute("normal",new z(d,3)),this.setAttribute("uv",new z(f,2))}function ai(t,e,n,i){G.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},this.fromBufferGeometry(new oi(t,e,n,i)),this.mergeVertices()}function oi(t,n,i,r){B.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:n,phiStart:i,phiLength:r},n=Math.floor(n)||12,i=i||0,r=r||2*Math.PI,r=Pa.clamp(r,0,2*Math.PI);var a,o,s,l=[],u=[],h=[],p=1/n,d=new c,f=new e;for(o=0;o<=n;o++){var m=i+o*p*r,v=Math.sin(m),g=Math.cos(m);for(s=0;s<=t.length-1;s++)d.x=t[s].x*v,d.y=t[s].y,d.z=t[s].x*g,u.push(d.x,d.y,d.z),f.x=o/n,f.y=s/(t.length-1),h.push(f.x,f.y)}for(o=0;o<n;o++)for(s=0;s<t.length-1;s++){var y=a=s+o*t.length,x=a+t.length,_=a+t.length+1,b=a+1;l.push(y,x,b),l.push(x,_,b)}if(this.setIndex(l),this.setAttribute("position",new z(u,3)),this.setAttribute("uv",new z(h,2)),this.computeVertexNormals(),r===2*Math.PI){var M=this.attributes.normal.array,w=new c,S=new c,T=new c;for(a=n*t.length*3,o=0,s=0;o<t.length;o++,s+=3)w.x=M[s+0],w.y=M[s+1],w.z=M[s+2],S.x=M[a+s+0],S.y=M[a+s+1],S.z=M[a+s+2],T.addVectors(w,S).normalize(),M[s+0]=M[a+s+0]=T.x,M[s+1]=M[a+s+1]=T.y,M[s+2]=M[a+s+2]=T.z}}function si(t,e){G.call(this),this.type="ShapeGeometry","object"==typeof e&&(e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new ci(t,e)),this.mergeVertices()}function ci(t,e){function n(t){var n,s,l,u=r.length/3,h=t.extractPoints(e),p=h.shape,d=h.holes;for(0==yc.isClockWise(p)&&(p=p.reverse()),n=0,s=d.length;n<s;n++)l=d[n],1==yc.isClockWise(l)&&(d[n]=l.reverse());var f=yc.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];r.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 v=f[n],g=v[0]+u,y=v[1]+u,x=v[2]+u;i.push(g,y,x),c+=3}}B.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;var i=[],r=[],a=[],o=[],s=0,c=0;if(0==Array.isArray(t))n(t);else for(var l=0;l<t.length;l++)n(t[l]),this.addGroup(s,c,l),s+=c,c=0;this.setIndex(i),this.setAttribute("position",new z(r,3)),this.setAttribute("normal",new z(a,3)),this.setAttribute("uv",new z(o,2))}function li(t,e){if(e.shapes=[],Array.isArray(t))for(var n=0,i=t.length;n<i;n++){var r=t[n];e.shapes.push(r.uuid)}else e.shapes.push(t.uuid);return e}function ui(t,e){B.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var n,i,r,a,o=[],s=Math.cos(Pa.DEG2RAD*e),c=[0,0],l={},u=["a","b","c"];t.isBufferGeometry?(a=new G).fromBufferGeometry(t):a=t.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],v=0;v<3;v++)n=m[u[v]],i=m[u[(v+1)%3]],c[0]=Math.min(n,i),c[1]=Math.max(n,i),void 0===l[r=c[0]+","+c[1]]?l[r]={index1:c[0],index2:c[1],face1:d,face2:void 0}:l[r].face2=d;for(r in l){var g=l[r];if(void 0===g.face2||p[g.face1].normal.dot(p[g.face2].normal)<=s){var y=h[g.index1];o.push(y.x,y.y,y.z),y=h[g.index2],o.push(y.x,y.y,y.z)}}this.setAttribute("position",new z(o,3))}function hi(t,e,n,i,r,a,o,s){G.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new pi(t,e,n,i,r,a,o,s)),this.mergeVertices()}function pi(t,n,i,r,a,o,s,l){function u(i){var a,o,u,g=new e,_=new c,b=0,M=1==i?t:n,w=1==i?1:-1;for(o=v,a=1;a<=r;a++)d.push(0,y*w,0),f.push(0,w,0),m.push(.5,.5),v++;for(u=v,a=0;a<=r;a++){var S=a/r*l+s,T=Math.cos(S),A=Math.sin(S);_.x=M*A,_.y=y*w,_.z=M*T,d.push(_.x,_.y,_.z),f.push(0,w,0),g.x=.5*T+.5,g.y=.5*A*w+.5,m.push(g.x,g.y),v++}for(a=0;a<r;a++){var L=o+a,C=u+a;1==i?p.push(C,C+1,L):p.push(C+1,C,L),b+=3}h.addGroup(x,b,1==i?1:2),x+=b}B.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:n,height:i,radialSegments:r,heightSegments:a,openEnded:o,thetaStart:s,thetaLength:l};var h=this;t=void 0!==t?t:1,n=void 0!==n?n:1,i=i||1,r=Math.floor(r)||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=[],v=0,g=[],y=i/2,x=0;!function(){var e,o,u=new c,_=new c,b=0,M=(n-t)/i;for(o=0;o<=a;o++){var w=[],S=o/a,T=S*(n-t)+t;for(e=0;e<=r;e++){var A=e/r,L=A*l+s,C=Math.sin(L),E=Math.cos(L);_.x=T*C,_.y=-S*i+y,_.z=T*E,d.push(_.x,_.y,_.z),u.set(C,M,E).normalize(),f.push(u.x,u.y,u.z),m.push(A,1-S),w.push(v++)}g.push(w)}for(e=0;e<r;e++)for(o=0;o<a;o++){var P=g[o][e],N=g[o+1][e],O=g[o+1][e+1],D=g[o][e+1];p.push(P,N,D),p.push(N,O,D),b+=6}h.addGroup(x,b,0),x+=b}(),0==o&&(t>0&&u(1),n>0&&u(0)),this.setIndex(p),this.setAttribute("position",new z(d,3)),this.setAttribute("normal",new z(f,3)),this.setAttribute("uv",new z(m,2))}function di(t,e,n,i,r,a,o){hi.call(this,0,t,e,n,i,r,a,o),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:o}}function fi(t,e,n,i,r,a,o){pi.call(this,0,t,e,n,i,r,a,o),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:o}}function mi(t,e,n,i){G.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},this.fromBufferGeometry(new vi(t,e,n,i)),this.mergeVertices()}function vi(t,n,i,r){B.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:n,thetaStart:i,thetaLength:r},t=t||1,n=void 0!==n?Math.max(3,n):8,i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI;var a,o,s=[],l=[],u=[],h=[],p=new c,d=new e;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=i+o/n*r;p.x=t*Math.cos(f),p.y=t*Math.sin(f),l.push(p.x,p.y,p.z),u.push(0,0,1),d.x=(l[a]/t+1)/2,d.y=(l[a+1]/t+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 z(l,3)),this.setAttribute("normal",new z(u,3)),this.setAttribute("uv",new z(h,2))}function gi(t){T.call(this),this.type="ShadowMaterial",this.color=new _(0),this.transparent=1,this.setValues(t)}function yi(t){q.call(this,t),this.type="RawShaderMaterial"}function xi(t){T.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new _(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 _(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new e(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(t)}function _i(t){xi.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new e(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(t)}function bi(t){T.call(this),this.type="MeshPhongMaterial",this.color=new _(16777215),this.specular=new _(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new e(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(t)}function Mi(t){T.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new _(16777215),this.specular=new _(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 _(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new e(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(t)}function wi(t){T.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new e(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(t)}function Si(t){T.call(this),this.type="MeshLambertMaterial",this.color=new _(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _(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(t)}function Ti(t){T.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new _(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new e(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(t)}function Ai(t){Je.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}function Li(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function Ci(t,e,n,i){Li.call(this,t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Ei(t,e,n,i){Li.call(this,t,e,n,i)}function Pi(t,e,n,i){Li.call(this,t,e,n,i)}function Ni(t,e,n,i){if(void 0===t)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Mc.convertArray(e,this.TimeBufferType),this.values=Mc.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function Oi(t,e,n){Ni.call(this,t,e,n)}function Di(t,e,n,i){Ni.call(this,t,e,n,i)}function Ii(t,e,n,i){Ni.call(this,t,e,n,i)}function zi(t,e,n,i){Li.call(this,t,e,n,i)}function Ri(t,e,n,i){Ni.call(this,t,e,n,i)}function Fi(t,e,n,i){Ni.call(this,t,e,n,i)}function ki(t,e,n,i){Ni.call(this,t,e,n,i)}function Bi(t,e,n){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.uuid=Pa.generateUUID(),this.duration<0&&this.resetDuration()}function Ui(t){if(void 0===t.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ii;case"vector":case"vector2":case"vector3":case"vector4":return ki;case"color":return Di;case"quaternion":return Ri;case"bool":case"boolean":return Oi;case"string":return Fi}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){var n=[],i=[];Mc.flattenJSON(t.keys,n,i,"value"),t.times=n,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}function ji(t,e,n){var i=this,r=0,a=0,o=0,s=void 0,c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){o++,0==r&&void 0!==i.onStart&&i.onStart(t,a,o),r=1},this.itemEnd=function(t){a++,void 0!==i.onProgress&&i.onProgress(t,a,o),a===o&&(r=0,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this},this.addHandler=function(t,e){return c.push(t,e),this},this.removeHandler=function(t){var e=c.indexOf(t);return-1!==e&&c.splice(e,2),this},this.getHandler=function(t){for(var e=0,n=c.length;e<n;e+=2){var i=c[e],r=c[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return r}return null}}function Vi(t){this.manager=void 0!==t?t:Sc,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}function Gi(t){Vi.call(this,t)}function Wi(t){Vi.call(this,t)}function Hi(t){Vi.call(this,t)}function qi(t){Vi.call(this,t)}function Xi(t){Vi.call(this,t)}function Yi(t){Vi.call(this,t)}function Zi(t){Vi.call(this,t)}function Ji(){this.type="Curve",this.arcLengthDivisions=200}function $i(t,e,n,i,r,a,o,s){Ji.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=n||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||0,this.aRotation=s||0}function Qi(t,e,n,i,r,a){$i.call(this,t,e,n,n,i,r,a),this.type="ArcCurve"}function Ki(){function t(t,a,o,s){e=t,n=o,i=-3*t+3*a-2*o-s,r=2*t-2*a+o+s}var e=0,n=0,i=0,r=0;return{initCatmullRom:function(e,n,i,r,a){t(n,i,a*(i-e),a*(r-n))},initNonuniformCatmullRom:function(e,n,i,r,a,o,s){var c=(n-e)/a-(i-e)/(a+o)+(i-n)/o,l=(i-n)/o-(r-n)/(o+s)+(r-i)/s;t(n,i,c*=o,l*=o)},calc:function(t){var a=t*t;return e+n*t+i*a+r*(a*t)}}}function tr(t,e,n,i){Ji.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||0,this.curveType=n||"centripetal",this.tension=i||.5}function er(t,e,n,i,r){var a=.5*(i-e),o=.5*(r-n),s=t*t;return(2*n-2*i+a+o)*(t*s)+(-3*n+3*i-2*a-o)*s+a*t+n}function nr(t,e,n,i){return function(t,e){var n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,i)}function ir(t,e,n,i,r){return function(t,e){var n=1-t;return n*n*n*e}(t,e)+function(t,e){var n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,i)+function(t,e){return t*t*t*e}(t,r)}function rr(t,n,i,r){Ji.call(this),this.type="CubicBezierCurve",this.v0=t||new e,this.v1=n||new e,this.v2=i||new e,this.v3=r||new e}function ar(t,e,n,i){Ji.call(this),this.type="CubicBezierCurve3",this.v0=t||new c,this.v1=e||new c,this.v2=n||new c,this.v3=i||new c}function or(t,n){Ji.call(this),this.type="LineCurve",this.v1=t||new e,this.v2=n||new e}function sr(t,e){Ji.call(this),this.type="LineCurve3",this.v1=t||new c,this.v2=e||new c}function cr(t,n,i){Ji.call(this),this.type="QuadraticBezierCurve",this.v0=t||new e,this.v1=n||new e,this.v2=i||new e}function lr(t,e,n){Ji.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new c,this.v1=e||new c,this.v2=n||new c}function ur(t){Ji.call(this),this.type="SplineCurve",this.points=t||[]}function hr(){Ji.call(this),this.type="CurvePath",this.curves=[],this.autoClose=0}function pr(t){hr.call(this),this.type="Path",this.currentPoint=new e,t&&this.setFromPoints(t)}function dr(t){pr.call(this,t),this.uuid=Pa.generateUUID(),this.type="Shape",this.holes=[]}function fr(t,e){p.call(this),this.type="Light",this.color=new _(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function mr(t,e,n){fr.call(this,t,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(p.DefaultUp),this.updateMatrix(),this.groundColor=new _(e)}function vr(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new e(512,512),this.map=null,this.mapPass=null,this.matrix=new l,this._frustum=new Q,this._frameExtents=new e(1,1),this._viewportCount=1,this._viewports=[new r(0,0,1,1)]}function gr(){vr.call(this,new Y(50,1,.5,500))}function yr(t,e,n,i,r,a){fr.call(this,t,e),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(t){this.intensity=t/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==a?a:1,this.shadow=new gr}function xr(){vr.call(this,new Y(90,1,.5,500)),this._frameExtents=new e(4,2),this._viewportCount=6,this._viewports=[new r(2,1,1,1),new r(0,1,1,1),new r(3,1,1,1),new r(1,1,1,1),new r(3,0,1,1),new r(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 _r(t,e,n,i){fr.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==i?i:1,this.shadow=new xr}function br(t,e,n,i,r,a){X.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==e?e:1,this.top=void 0!==n?n:1,this.bottom=void 0!==i?i:-1,this.near=void 0!==r?r:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function Mr(){vr.call(this,new br(-5,5,5,-5,.5,500))}function wr(t,e){fr.call(this,t,e),this.type="DirectionalLight",this.position.copy(p.DefaultUp),this.updateMatrix(),this.target=new p,this.shadow=new Mr}function Sr(t,e){fr.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function Tr(t,e,n,i){fr.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==i?i:10}function Ar(t){Vi.call(this,t),this.textures={}}function Lr(){B.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Cr(t,e,n,i){"number"==typeof n&&(i=n,n=0),L.call(this,t,e,n),this.meshPerAttribute=i||1}function Er(t){Vi.call(this,t)}function Pr(t){Vi.call(this,t)}function Nr(t){Vi.call(this,t),this.options=void 0}function Or(){this.type="ShapePath",this.color=new _,this.subPaths=[],this.currentPath=null}function Dr(t){this.type="Font",this.data=t}function Ir(t,e,n,i,r){var a=r.glyphs[t]||r.glyphs["?"];if(a){var o,s,c,l,u,h,p,d,f=new Or;if(a.o)for(var m=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),v=0,g=m.length;v<g;)switch(m[v++]){case"m":o=m[v++]*e+n,s=m[v++]*e+i,f.moveTo(o,s);break;case"l":o=m[v++]*e+n,s=m[v++]*e+i,f.lineTo(o,s);break;case"q":c=m[v++]*e+n,l=m[v++]*e+i,u=m[v++]*e+n,h=m[v++]*e+i,f.quadraticCurveTo(u,h,c,l);break;case"b":c=m[v++]*e+n,l=m[v++]*e+i,u=m[v++]*e+n,h=m[v++]*e+i,p=m[v++]*e+n,d=m[v++]*e+i,f.bezierCurveTo(u,h,p,d,c,l)}return{offsetX:a.ha*e,path:f}}}function zr(t){Vi.call(this,t)}function Rr(t){Vi.call(this,t)}function Fr(){this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new c)}function kr(t,e){fr.call(this,void 0,e),this.sh=void 0!==t?t:new Fr}function Br(t,e,n){kr.call(this,void 0,n);var i=(new _).set(t),r=(new _).set(e),a=new c(i.r,i.g,i.b),o=new c(r.r,r.g,r.b);this.sh.coefficients[0].copy(a).add(o).multiplyScalar(1.7724538509055159),this.sh.coefficients[1].copy(a).sub(o).multiplyScalar(1.5349900619197325)}function Ur(t,e){kr.call(this,void 0,e);var n=(new _).set(t);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(3.5449077018110318)}function jr(t){this.autoStart=void 0!==t?t:1,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=0}function Vr(){p.call(this),this.type="AudioListener",this.context=Fc(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new jr}function Gr(t){p.call(this),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.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 Wr(t){Gr.call(this,t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function Hr(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function qr(t,e,n){this.binding=t,this.valueSize=n;var i,r=Float64Array;switch(e){case"quaternion":i=this._slerp;break;case"string":case"bool":r=Array,i=this._select;break;default:i=this._lerp}this.buffer=new r(4*n),this._mixBufferRegion=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function Xr(t,e,n){var i=n||Yr.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}function Yr(t,e,n){this.path=e,this.parsedPath=n||Yr.parseTrackName(e),this.node=Yr.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Zr(t,e,n){this._mixer=t,this._clip=e,this._localRoot=n||null;for(var i=e.tracks,r=i.length,a=Array(r),o={endingStart:2400,endingEnd:2400},s=0;s!==r;++s){var c=i[s].createInterpolant(null);a[s]=c,c.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=Array(r),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 Jr(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function $r(t,e){"string"==typeof t&&(t=e),this.value=t}function Qr(t,e,n){Ue.call(this,t,e),this.meshPerAttribute=n||1}function Kr(t,e,n,i){this.ray=new g(t,e),this.near=n||0,this.far=i||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 this.Points}}})}function ta(t,e){return t.distance-e.distance}function ea(t,e,n,i){if(t.layers.test(e.layers)&&t.raycast(e,n),1==i)for(var r=t.children,a=0,o=r.length;a<o;a++)ea(r[a],e,n,1)}function na(t,n){this.min=void 0!==t?t:new e(1/0,1/0),this.max=void 0!==n?n:new e(-1/0,-1/0)}function ia(t,e){this.start=void 0!==t?t:new c,this.end=void 0!==e?e:new c}function ra(t){p.call(this),this.material=t,this.render=function(){}}function aa(t,e){p.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=0,this.color=e;for(var n=new B,i=[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],r=0,a=1;r<32;r++,a++){var o=a/32*Math.PI*2;i.push(1,0,1,Math.cos(o),Math.sin(o),1)}n.setAttribute("position",new z(i,3));var s=new Je({fog:0,toneMapped:0});this.cone=new Qe(n,s),this.add(this.cone),this.update()}function oa(t){for(var e=function t(e){var n=[];e&&e.isBone&&n.push(e);for(var i=0;i<e.children.length;i++)n.push.apply(n,t(e.children[i]));return n}(t),n=new B,i=[],r=[],a=new _(0,0,1),o=new _(0,1,0),s=0;s<e.length;s++){var c=e[s];c.parent&&c.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(a.r,a.g,a.b),r.push(o.r,o.g,o.b))}n.setAttribute("position",new z(i,3)),n.setAttribute("color",new z(r,3));var l=new Je({vertexColors:1,depthTest:0,depthWrite:0,toneMapped:0,transparent:1});Qe.call(this,n,l),this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=0}function sa(t,e,n){this.light=t,this.light.updateMatrixWorld(),this.color=n;var i=new ni(e,4,2),r=new A({wireframe:1,fog:0,toneMapped:0});U.call(this,i,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=0,this.update()}function ca(t,e,n){p.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=0,this.color=n;var i=new vn(e);i.rotateY(.5*Math.PI),this.material=new A({wireframe:1,fog:0,toneMapped:0}),void 0===this.color&&(this.material.vertexColors=1);var r=i.getAttribute("position"),a=new Float32Array(3*r.count);i.setAttribute("color",new L(a,3)),this.add(new U(i,this.material)),this.update()}function la(t,e,n,i){t=t||10,e=e||10,n=new _(void 0!==n?n:4473924),i=new _(void 0!==i?i:8947848);for(var r=e/2,a=t/e,o=t/2,s=[],c=[],l=0,u=0,h=-o;l<=e;l++,h+=a){s.push(-o,0,h,o,0,h),s.push(h,0,-o,h,0,o);var p=l===r?n:i;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 B;d.setAttribute("position",new z(s,3)),d.setAttribute("color",new z(c,3));var f=new Je({vertexColors:1,toneMapped:0});Qe.call(this,d,f)}function ua(t,e,n,i,r,a){t=t||10,e=e||16,n=n||8,i=i||64,r=new _(void 0!==r?r:4473924),a=new _(void 0!==a?a:8947848);var o,s,c,l,u,h,p,d=[],f=[];for(l=0;l<=e;l++)o=Math.sin(c=l/e*(2*Math.PI))*t,s=Math.cos(c)*t,d.push(0,0,0),d.push(o,0,s),p=1&l?r: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?r:a,h=t-t/n*l,u=0;u<i;u++)o=Math.sin(c=u/i*(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)/i*(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 B;m.setAttribute("position",new z(d,3)),m.setAttribute("color",new z(f,3));var v=new Je({vertexColors:1,toneMapped:0});Qe.call(this,m,v)}function ha(t,e,n){p.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=0,this.color=n,void 0===e&&(e=1);var i=new B;i.setAttribute("position",new z([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var r=new Je({fog:0,toneMapped:0});this.lightPlane=new $e(i,r),this.add(this.lightPlane),(i=new B).setAttribute("position",new z([0,0,0,0,0,1],3)),this.targetLine=new $e(i,r),this.add(this.targetLine),this.update()}function pa(t){function e(t,e,i){n(t,i),n(e,i)}function n(t,e){a.push(0,0,0),o.push(e.r,e.g,e.b),void 0===s[t]&&(s[t]=[]),s[t].push(a.length/3-1)}var i=new B,r=new Je({color:16777215,vertexColors:1,toneMapped:0}),a=[],o=[],s={},c=new _(16755200),l=new _(16711680),u=new _(43775),h=new _(16777215),p=new _(3355443);e("n1","n2",c),e("n2","n4",c),e("n4","n3",c),e("n3","n1",c),e("f1","f2",c),e("f2","f4",c),e("f4","f3",c),e("f3","f1",c),e("n1","f1",c),e("n2","f2",c),e("n3","f3",c),e("n4","f4",c),e("p","n1",l),e("p","n2",l),e("p","n3",l),e("p","n4",l),e("u1","u2",u),e("u2","u3",u),e("u3","u1",u),e("c","t",h),e("p","c",p),e("cn1","cn2",p),e("cn3","cn4",p),e("cf1","cf2",p),e("cf3","cf4",p),i.setAttribute("position",new z(a,3)),i.setAttribute("color",new z(o,3)),Qe.call(this,i,r),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=0,this.pointMap=s,this.update()}function da(t,e,n,i,r,a,o){fl.set(r,a,o).unproject(i);var s=e[t];if(void 0!==s)for(var c=n.getAttribute("position"),l=0,u=s.length;l<u;l++)c.setXYZ(s[l],fl.x,fl.y,fl.z)}function fa(t,e){this.object=t,void 0===e&&(e=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]),i=new Float32Array(24),r=new B;r.setIndex(new L(n,1)),r.setAttribute("position",new L(i,3)),Qe.call(this,r,new Je({color:e,toneMapped:0})),this.matrixAutoUpdate=0,this.update()}function ma(t,e){this.type="Box3Helper",this.box=t,e=e||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]),i=new B;i.setIndex(new L(n,1)),i.setAttribute("position",new z([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)),Qe.call(this,i,new Je({color:e,toneMapped:0})),this.geometry.computeBoundingSphere()}function va(t,e,n){this.type="PlaneHelper",this.plane=t,this.size=void 0===e?1:e;var i=void 0!==n?n:16776960,r=new B;r.setAttribute("position",new z([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)),r.computeBoundingSphere(),$e.call(this,r,new Je({color:i,toneMapped:0}));var a=new B;a.setAttribute("position",new z([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new U(a,new A({color:i,opacity:.2,transparent:1,depthWrite:0,toneMapped:0})))}function ga(t,e,n,i,r,a){p.call(this),void 0===t&&(t=new c(0,0,1)),void 0===e&&(e=new c(0,0,0)),void 0===n&&(n=1),void 0===i&&(i=16776960),void 0===r&&(r=.2*n),void 0===a&&(a=.2*r),void 0===gl&&((gl=new B).setAttribute("position",new z([0,0,0,0,1,0],3)),(yl=new pi(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new $e(gl,new Je({color:i,toneMapped:0})),this.line.matrixAutoUpdate=0,this.add(this.line),this.cone=new U(yl,new A({color:i,toneMapped:0})),this.cone.matrixAutoUpdate=0,this.add(this.cone),this.setDirection(t),this.setLength(n,r,a)}function ya(t){var e=[0,0,0,t=t||1,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=new B;n.setAttribute("position",new z(e,3)),n.setAttribute("color",new z([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var i=new Je({vertexColors:1,toneMapped:0});Qe.call(this,n,i)}function xa(t){tr.call(this,t),this.type="catmullrom"}function _a(t,e){return t(e={exports:{}},e.exports),e.exports}function ba(){var t=Dl("#subdivideSLT").val()>0?Dl("#subdivideSLT").val():void 0,e=CK.character.data.mirroredPose,n=Aa(CK.character,t,e),i=(new Cl).parse(n),r=Ta(),a=new Blob([i],{type:"application/sla;charset=utf-8"});Ol(a,r+(t?"-smooth":"")+".stl")}function Ma(){var t=Dl("#subdivideSLT").val()>0?Dl("#subdivideSLT").val():void 0,e=CK.character.data.mirroredPose,n=Aa(CK.character,t,e),i=(new El).parse(n),r=Ta(),a=new Blob([i],{type:"text/plain;charset=utf-8"});Ol(a,r+(t?"-smooth":"")+".obj")}function wa(){var t=Ta(),e=new Blob([JSON.stringify(CK.data.getJson())],{type:"text/plain;charset=utf-8"});Ol(e,t+".json")}function Sa(t){var e=t.target.files[0],n=new FileReader;n.onload=function(t){t.preventDefault(),CK.change(JSON.parse(t.target.result))},null!=e&&n.readAsText(e)}function Ta(){var t=CK.character.data.meta.character_name;return""===t?"Hero":t}function Aa(t,e,n){var i=new A,r=new ze;return t.traverseVisible((function(t){if(t.isMesh){var a=(new Il).parse(t);1==n&&(a=function(t){const e=[0,0,0];t.index&&t.copy(t.toNonIndexed());for(let n=0;n<t.attributes.position.array.length/9;n++)e[0]=t.attributes.position.array[9*n],e[1]=t.attributes.position.array[9*n+1],e[2]=t.attributes.position.array[9*n+2],t.attributes.position.array[9*n]=t.attributes.position.array[9*n+6],t.attributes.position.array[9*n+1]=t.attributes.position.array[9*n+7],t.attributes.position.array[9*n+2]=t.attributes.position.array[9*n+8],t.attributes.position.array[9*n+6]=e[0],t.attributes.position.array[9*n+7]=e[1],t.attributes.position.array[9*n+8]=e[2];return t}(a)),e&&"baseRim"!=t.name&&"base"!=t.name&&(a=function(t,e){return new Pl(e).modify(t)}(a,e));var o=new U(a,i);r.add(o)}})),r}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),"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(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}),Object.assign(t.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return 0;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var n=this._listeners[t];if(void 0!==n){var i=n.indexOf(e);-1!==i&&n.splice(i,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var n=e.slice(0),i=0,r=n.length;i<r;i++)n[i].call(this,t)}}}});for(var La=[],Ca=0;Ca<256;Ca++)La[Ca]=(Ca<16?"0":"")+Ca.toString(16);var Ea,Pa={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(La[255&t]+La[t>>8&255]+La[t>>16&255]+La[t>>24&255]+"-"+La[255&e]+La[e>>8&255]+"-"+La[e>>16&15|64]+La[e>>24&255]+"-"+La[63&n|128]+La[n>>8&255]+"-"+La[n>>16&255]+La[n>>24&255]+La[255&i]+La[i>>8&255]+La[i>>16&255]+La[i>>24&255]).toUpperCase()},clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*Pa.DEG2RAD},radToDeg:function(t){return t*Pa.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,i,r){var a=Math.cos,o=Math.sin,s=a(n/2),c=o(n/2),l=a((e+i)/2),u=o((e+i)/2),h=a((e-i)/2),p=o((e-i)/2),d=a((i-e)/2),f=o((i-e)/2);"XYX"===r?t.set(s*u,c*h,c*p,s*l):"YZY"===r?t.set(c*p,s*u,c*h,s*l):"ZXZ"===r?t.set(c*h,c*p,s*u,s*l):"XZX"===r?t.set(s*u,c*f,c*d,s*l):"YXY"===r?t.set(c*d,s*u,c*f,s*l):"ZYZ"===r&&t.set(c*f,c*d,s*u,s*l)}};Object.defineProperties(e.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(e.prototype,{isVector2:1,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?this.addVectors(t,e):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?this.subVectors(t,e):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,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(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.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(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e){return this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*n-a*i+t.x,this.y=r*i+a*n+t.y,this}}),Object.assign(n.prototype,{isMatrix3:1,set:function(t,e,n,i,r,a,o,s,c){var l=this.elements;return l[0]=t,l[1]=i,l[2]=o,l[3]=e,l[4]=r,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(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},extractBasis:function(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,i=e.elements,r=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=i[0],m=i[3],v=i[6],g=i[1],y=i[4],x=i[7],_=i[2],b=i[5],M=i[8];return r[0]=a*f+o*g+s*_,r[3]=a*m+o*y+s*b,r[6]=a*v+o*x+s*M,r[1]=c*f+l*g+u*_,r[4]=c*m+l*y+u*b,r[7]=c*v+l*x+u*M,r[2]=h*f+p*g+d*_,r[5]=h*m+p*y+d*b,r[8]=h*v+p*x+d*M,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8];return e*a*l-e*o*c-n*r*l+n*o*s+i*r*c-i*a*s},getInverse:function(t){var e=t.elements,n=this.elements,i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],h=e[8],p=h*s-c*u,d=c*l-h*o,f=u*o-s*l,m=i*p+r*d+a*f;if(0===m)return this.set(0,0,0,0,0,0,0,0,0);var v=1/m;return n[0]=p*v,n[1]=(a*u-h*r)*v,n[2]=(c*r-a*s)*v,n[3]=d*v,n[4]=(h*i-a*l)*v,n[5]=(a*o-c*i)*v,n[6]=f*v,n[7]=(r*l-u*i)*v,n[8]=(s*i-r*o)*v,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,n,i,r,a,o){var s=Math.cos(r),c=Math.sin(r);this.set(n*s,n*c,-n*(s*a+c*o)+a+t,-i*c,i*s,-i*(-c*a+s*o)+o+e,0,0,1)},scale:function(t,e){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this},rotate:function(t){var e=Math.cos(t),n=Math.sin(t),i=this.elements,r=i[0],a=i[3],o=i[6],s=i[1],c=i[4],l=i[7];return i[0]=e*r+n*s,i[3]=e*a+n*c,i[6]=e*o+n*l,i[1]=-n*r+e*s,i[4]=-n*a+e*c,i[7]=-n*o+e*l,this},translate:function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},equals:function(t){for(var e=this.elements,n=t.elements,i=0;i<9;i++)if(e[i]!==n[i])return 0;return 1},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<9;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}});var Na={getDataURL:function(t){var e;if("undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===Ea&&(Ea=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Ea.width=t.width,Ea.height=t.height;var n=Ea.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Ea}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},Oa=0;i.DEFAULT_IMAGE=void 0,i.DEFAULT_MAPPING=300,i.prototype=Object.assign(Object.create(t.prototype),{constructor:i,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(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.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 i=this.image;if(void 0===i.uuid&&(i.uuid=Pa.generateUUID()),!e&&void 0===t.images[i.uuid]){var r;if(Array.isArray(i)){r=[];for(var a=0,o=i.length;a<o;a++)r.push(Na.getDataURL(i[a]))}else r=Na.getDataURL(i);t.images[i.uuid]={uuid:i.uuid,url:r}}n.image=i.uuid}return e||(t.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(i.prototype,"needsUpdate",{set:function(t){1==t&&this.version++}}),Object.defineProperties(r.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(r.prototype,{isVector4:1,set:function(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?this.addVectors(t,e):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?this.subVectors(t,e):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*e+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*e+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*e+a[7]*n+a[11]*i+a[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,n,i,r=t.elements,a=r[0],o=r[4],s=r[8],c=r[1],l=r[5],u=r[9],h=r[2],p=r[6],d=r[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,v=(d+1)/2,g=(o+c)/4,y=(s+h)/4,x=(u+p)/4;return f>m&&f>v?f<.01?(e=0,n=.707106781,i=.707106781):(n=g/(e=Math.sqrt(f)),i=y/e):m>v?m<.01?(e=.707106781,n=0,i=.707106781):(e=g/(n=Math.sqrt(m)),i=x/n):v<.01?(e=.707106781,n=.707106781,i=0):(e=y/(i=Math.sqrt(v)),n=x/i),this.set(e,n,i,3.141592653589793),this}var _=Math.sqrt((p-u)*(p-u)+(s-h)*(s-h)+(c-o)*(c-o));return Math.abs(_)<.001&&(_=1),this.x=(p-u)/_,this.y=(s-h)/_,this.z=(c-o)/_,this.w=Math.acos((a+l+d-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,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(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},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(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),a.prototype=Object.assign(Object.create(t.prototype),{constructor:a,isWebGLRenderTarget:1,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),o.prototype=Object.assign(Object.create(a.prototype),{constructor:o,isWebGLMultisampleRenderTarget:1,copy:function(t){return a.prototype.copy.call(this,t),this.samples=t.samples,this}}),Object.assign(s,{slerp:function(t,e,n,i){return n.copy(t).slerp(e,i)},slerpFlat:function(t,e,n,i,r,a,o){var s=n[i+0],c=n[i+1],l=n[i+2],u=n[i+3],h=r[a+0],p=r[a+1],d=r[a+2],f=r[a+3];if(u!==f||s!==h||c!==p||l!==d){var m=1-o,v=s*h+c*p+l*d+u*f,g=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var x=Math.sqrt(y),_=Math.atan2(x,v*g);m=Math.sin(m*_)/x,o=Math.sin(o*_)/x}var b=o*g;if(s=s*m+h*b,c=c*m+p*b,l=l*m+d*b,u=u*m+f*b,m===1-o){var M=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=M,c*=M,l*=M,u*=M}}t[e]=s,t[e+1]=c,t[e+2]=l,t[e+3]=u}}),Object.defineProperties(s.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}}),Object.assign(s.prototype,{isQuaternion:1,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,i=t._y,r=t._z,a=t.order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(i/2),u=o(r/2),h=s(n/2),p=s(i/2),d=s(r/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!=e&&this._onChangeCallback(),this},setFromAxisAngle:function(t,e){var n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(t){var e,n=t.elements,i=n[0],r=n[4],a=n[8],o=n[1],s=n[5],c=n[9],l=n[2],u=n[6],h=n[10],p=i+s+h;return p>0?(e=.5/Math.sqrt(p+1),this._w=.25/e,this._x=(u-c)*e,this._y=(a-l)*e,this._z=(o-r)*e):i>s&&i>h?(e=2*Math.sqrt(1+i-s-h),this._w=(u-c)/e,this._x=.25*e,this._y=(r+o)/e,this._z=(a+l)/e):s>h?(e=2*Math.sqrt(1+s-i-h),this._w=(a-l)/e,this._x=(r+o)/e,this._y=.25*e,this._z=(c+u)/e):(e=2*Math.sqrt(1+h-i-s),this._w=(o-r)/e,this._x=(a+l)/e,this._y=(c+u)/e,this._z=.25*e),this._onChangeCallback(),this},setFromUnitVectors:function(t,e){var n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(Pa.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var n=this.angleTo(t);if(0===n)return this;var i=Math.min(1,e/n);return this.slerp(t,i),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},multiply:function(t,e){return void 0!==e?this.multiplyQuaternions(t,e):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var n=t._x,i=t._y,r=t._z,a=t._w,o=e._x,s=e._y,c=e._z,l=e._w;return this._x=n*l+a*o+i*c-r*s,this._y=i*l+a*s+r*o-n*c,this._z=r*l+a*c+n*s-i*o,this._w=a*l-n*o-i*s-r*c,this._onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,i=this._y,r=this._z,a=this._w,o=a*t._w+n*t._x+i*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=i,this._z=r,this;var s=1-o*o;if(s<=Number.EPSILON){var c=1-e;return this._w=c*a+e*this._w,this._x=c*n+e*this._x,this._y=c*i+e*this._y,this._z=c*r+e*this._z,this.normalize(),this._onChangeCallback(),this}var l=Math.sqrt(s),u=Math.atan2(l,o),h=Math.sin((1-e)*u)/l,p=Math.sin(e*u)/l;return this._w=a*h+this._w*p,this._x=n*h+this._x*p,this._y=i*h+this._y*p,this._z=r*h+this._z*p,this._onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},fromBufferAttribute:function(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}});var Da=new c,Ia=new s;Object.assign(c.prototype,{isVector3:1,set:function(t,e,n){return this.x=t,this.y=e,this.z=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?this.addVectors(t,e):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?this.subVectors(t,e):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?this.multiplyVectors(t,e):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(t){return!t||t.isEuler,this.applyQuaternion(Ia.setFromEuler(t))},applyAxisAngle:function(t,e){return this.applyQuaternion(Ia.setFromAxisAngle(t,e))},applyMatrix3:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements,a=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*a,this},applyQuaternion:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,a=t.y,o=t.z,s=t.w,c=s*e+a*i-o*n,l=s*n+o*e-r*i,u=s*i+r*n-a*e,h=-r*e-a*n-o*i;return this.x=c*s+h*-r+l*-o-u*-a,this.y=l*s+h*-a+u*-r-c*-o,this.z=u*s+h*-o+c*-a-l*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,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(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},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(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},cross:function(t,e){return void 0!==e?this.crossVectors(t,e):this.crossVectors(this,t)},crossVectors:function(t,e){var n=t.x,i=t.y,r=t.z,a=e.x,o=e.y,s=e.z;return this.x=i*s-r*o,this.y=r*a-n*s,this.z=n*o-i*a,this},projectOnVector:function(t){var e=t.lengthSq();if(0===e)return this.set(0,0,0);var n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)},projectOnPlane:function(t){return Da.copy(this).projectOnVector(t),this.sub(Da)},reflect:function(t){return this.sub(Da.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var n=this.dot(t)/e;return Math.acos(Pa.clamp(n,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,n){var i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},setFromMatrix3Column:function(t,e){return this.fromArray(t.elements,3*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}});var za=new c,Ra=new l,Fa=new c(0,0,0),ka=new c(1,1,1),Ba=new c,Ua=new c,ja=new c;Object.assign(l.prototype,{isMatrix4:1,set:function(t,e,n,i,r,a,o,s,c,l,u,h,p,d,f,m){var v=this.elements;return v[0]=t,v[4]=e,v[8]=n,v[12]=i,v[1]=r,v[5]=a,v[9]=o,v[13]=s,v[2]=c,v[6]=l,v[10]=u,v[14]=h,v[3]=p,v[7]=d,v[11]=f,v[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new l).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},copyPosition:function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},extractBasis:function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},extractRotation:function(t){var e=this.elements,n=t.elements,i=1/za.setFromMatrixColumn(t,0).length(),r=1/za.setFromMatrixColumn(t,1).length(),a=1/za.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromEuler:function(t){!t||t.isEuler;var e=this.elements,n=t.x,i=t.y,r=t.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(i),c=Math.sin(i),l=Math.cos(r),u=Math.sin(r);if("XYZ"===t.order){var h=a*l,p=a*u,d=o*l,f=o*u;e[0]=s*l,e[4]=-s*u,e[8]=c,e[1]=p+d*c,e[5]=h-f*c,e[9]=-o*s,e[2]=f-h*c,e[6]=d+p*c,e[10]=a*s}else if("YXZ"===t.order){var m=s*l,v=s*u,g=c*l,y=c*u;e[0]=m+y*o,e[4]=g*o-v,e[8]=a*c,e[1]=a*u,e[5]=a*l,e[9]=-o,e[2]=v*o-g,e[6]=y+m*o,e[10]=a*s}else if("ZXY"===t.order)m=s*l,v=s*u,g=c*l,y=c*u,e[0]=m-y*o,e[4]=-a*u,e[8]=g+v*o,e[1]=v+g*o,e[5]=a*l,e[9]=y-m*o,e[2]=-a*c,e[6]=o,e[10]=a*s;else if("ZYX"===t.order)h=a*l,p=a*u,d=o*l,f=o*u,e[0]=s*l,e[4]=d*c-p,e[8]=h*c+f,e[1]=s*u,e[5]=f*c+h,e[9]=p*c-d,e[2]=-c,e[6]=o*s,e[10]=a*s;else if("YZX"===t.order){var x=a*s,_=a*c,b=o*s,M=o*c;e[0]=s*l,e[4]=M-x*u,e[8]=b*u+_,e[1]=u,e[5]=a*l,e[9]=-o*l,e[2]=-c*l,e[6]=_*u+b,e[10]=x-M*u}else"XZY"===t.order&&(x=a*s,_=a*c,b=o*s,M=o*c,e[0]=s*l,e[4]=-u,e[8]=c*l,e[1]=x*u+M,e[5]=a*l,e[9]=_*u-b,e[2]=b*u-_,e[6]=o*l,e[10]=M*u+x);return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(Fa,t,ka)},lookAt:function(t,e,n){var i=this.elements;return ja.subVectors(t,e),0===ja.lengthSq()&&(ja.z=1),ja.normalize(),Ba.crossVectors(n,ja),0===Ba.lengthSq()&&(1===Math.abs(n.z)?ja.x+=1e-4:ja.z+=1e-4,ja.normalize(),Ba.crossVectors(n,ja)),Ba.normalize(),Ua.crossVectors(ja,Ba),i[0]=Ba.x,i[4]=Ua.x,i[8]=ja.x,i[1]=Ba.y,i[5]=Ua.y,i[9]=ja.y,i[2]=Ba.z,i[6]=Ua.z,i[10]=ja.z,this},multiply:function(t,e){return void 0!==e?this.multiplyMatrices(t,e):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,i=e.elements,r=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],v=n[14],g=n[3],y=n[7],x=n[11],_=n[15],b=i[0],M=i[4],w=i[8],S=i[12],T=i[1],A=i[5],L=i[9],C=i[13],E=i[2],P=i[6],N=i[10],O=i[14],D=i[3],I=i[7],z=i[11],R=i[15];return r[0]=a*b+o*T+s*E+c*D,r[4]=a*M+o*A+s*P+c*I,r[8]=a*w+o*L+s*N+c*z,r[12]=a*S+o*C+s*O+c*R,r[1]=l*b+u*T+h*E+p*D,r[5]=l*M+u*A+h*P+p*I,r[9]=l*w+u*L+h*N+p*z,r[13]=l*S+u*C+h*O+p*R,r[2]=d*b+f*T+m*E+v*D,r[6]=d*M+f*A+m*P+v*I,r[10]=d*w+f*L+m*N+v*z,r[14]=d*S+f*C+m*O+v*R,r[3]=g*b+y*T+x*E+_*D,r[7]=g*M+y*A+x*P+_*I,r[11]=g*w+y*L+x*N+_*z,r[15]=g*S+y*C+x*O+_*R,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],a=t[1],o=t[5],s=t[9],c=t[13],l=t[2],u=t[6],h=t[10],p=t[14];return t[3]*(+r*s*u-i*c*u-r*o*h+n*c*h+i*o*p-n*s*p)+t[7]*(+e*s*p-e*c*h+r*a*h-i*a*p+i*c*l-r*s*l)+t[11]*(+e*c*u-e*o*p-r*a*u+n*a*p+r*o*l-n*c*l)+t[15]*(-i*o*l-e*s*u+e*o*h+i*a*u-n*a*h+n*s*l)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t,e,n){var i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this},getInverse:function(t){var e=this.elements,n=t.elements,i=n[0],r=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],v=n[13],g=n[14],y=n[15],x=p*g*u-v*d*u+v*l*f-c*g*f-p*l*y+c*d*y,_=m*d*u-h*g*u-m*l*f+s*g*f+h*l*y-s*d*y,b=h*v*u-m*p*u+m*c*f-s*v*f-h*c*y+s*p*y,M=m*p*l-h*v*l-m*c*d+s*v*d+h*c*g-s*p*g,w=i*x+r*_+a*b+o*M;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var S=1/w;return e[0]=x*S,e[1]=(v*d*o-p*g*o-v*a*f+r*g*f+p*a*y-r*d*y)*S,e[2]=(c*g*o-v*l*o+v*a*u-r*g*u-c*a*y+r*l*y)*S,e[3]=(p*l*o-c*d*o-p*a*u+r*d*u+c*a*f-r*l*f)*S,e[4]=_*S,e[5]=(h*g*o-m*d*o+m*a*f-i*g*f-h*a*y+i*d*y)*S,e[6]=(m*l*o-s*g*o-m*a*u+i*g*u+s*a*y-i*l*y)*S,e[7]=(s*d*o-h*l*o+h*a*u-i*d*u-s*a*f+i*l*f)*S,e[8]=b*S,e[9]=(m*p*o-h*v*o-m*r*f+i*v*f+h*r*y-i*p*y)*S,e[10]=(s*v*o-m*c*o+m*r*u-i*v*u-s*r*y+i*c*y)*S,e[11]=(h*c*o-s*p*o-h*r*u+i*p*u+s*r*f-i*c*f)*S,e[12]=M*S,e[13]=(h*v*a-m*p*a+m*r*d-i*v*d-h*r*g+i*p*g)*S,e[14]=(m*c*a-s*v*a-m*r*l+i*v*l+s*r*g-i*c*g)*S,e[15]=(s*p*a-h*c*a+h*r*l-i*p*l-s*r*d+i*c*d)*S,this},scale:function(t){var e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))},makeTranslation:function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=1-n,a=t.x,o=t.y,s=t.z,c=r*a,l=r*o;return this.set(c*a+n,c*o-i*s,c*s+i*o,0,c*o+i*s,l*o+n,l*s-i*a,0,c*s-i*o,l*s+i*a,r*s*s+n,0,0,0,0,1),this},makeScale:function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,n){var i=this.elements,r=e._x,a=e._y,o=e._z,s=e._w,c=r+r,l=a+a,u=o+o,h=r*c,p=r*l,d=r*u,f=a*l,m=a*u,v=o*u,g=s*c,y=s*l,x=s*u,_=n.x,b=n.y,M=n.z;return i[0]=(1-(f+v))*_,i[1]=(p+x)*_,i[2]=(d-y)*_,i[3]=0,i[4]=(p-x)*b,i[5]=(1-(h+v))*b,i[6]=(m+g)*b,i[7]=0,i[8]=(d+y)*M,i[9]=(m-g)*M,i[10]=(1-(h+f))*M,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this},decompose:function(t,e,n){var i=this.elements,r=za.set(i[0],i[1],i[2]).length(),a=za.set(i[4],i[5],i[6]).length(),o=za.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],Ra.copy(this);var s=1/r,c=1/a,l=1/o;return Ra.elements[0]*=s,Ra.elements[1]*=s,Ra.elements[2]*=s,Ra.elements[4]*=c,Ra.elements[5]*=c,Ra.elements[6]*=c,Ra.elements[8]*=l,Ra.elements[9]*=l,Ra.elements[10]*=l,e.setFromRotationMatrix(Ra),n.x=r,n.y=a,n.z=o,this},makePerspective:function(t,e,n,i,r,a){var o=this.elements,s=2*r/(e-t),c=2*r/(n-i),l=(e+t)/(e-t),u=(n+i)/(n-i),h=-(a+r)/(a-r),p=-2*a*r/(a-r);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(t,e,n,i,r,a){var o=this.elements,s=1/(e-t),c=1/(n-i),l=1/(a-r),u=(e+t)*s,h=(n+i)*c,p=(a+r)*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(t){for(var e=this.elements,n=t.elements,i=0;i<16;i++)if(e[i]!==n[i])return 0;return 1},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<16;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}});var Va=new l,Ga=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(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}}}),Object.assign(u.prototype,{isEuler:1,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._order=i||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this},setFromRotationMatrix:function(t,e,n){var i=Pa.clamp,r=t.elements,a=r[0],o=r[4],s=r[8],c=r[1],l=r[5],u=r[9],h=r[2],p=r[6],d=r[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(i(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"===e?(this._x=Math.asin(-i(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"===e?(this._x=Math.asin(i(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"===e?(this._y=Math.asin(-i(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"===e?(this._z=Math.asin(i(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"===e&&(this._z=Math.asin(-i(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)),this._order=e,0!=n&&this._onChangeCallback(),this},setFromQuaternion:function(t,e,n){return Va.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Va,e,n)},setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(t){return Ga.setFromEuler(this),this.setFromQuaternion(Ga,t)},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new c(this._x,this._y,this._z)},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}}),Object.assign(h.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},enableAll:function(){this.mask=-1},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},disableAll:function(){this.mask=0},test:function(t){return 0!=(this.mask&t.mask)}});var Wa=0,Ha=new c,qa=new s,Xa=new l,Ya=new c,Za=new c,Ja=new c,$a=new s,Qa=new c(1,0,0),Ka=new c(0,1,0),to=new c(0,0,1),eo={type:"added"},no={type:"removed"};p.DefaultUp=new c(0,1,0),p.DefaultMatrixAutoUpdate=1,p.prototype=Object.assign(Object.create(t.prototype),{constructor:p,isObject3D:1,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,1)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(t,e){return qa.setFromAxisAngle(t,e),this.quaternion.multiply(qa),this},rotateOnWorldAxis:function(t,e){return qa.setFromAxisAngle(t,e),this.quaternion.premultiply(qa),this},rotateX:function(t){return this.rotateOnAxis(Qa,t)},rotateY:function(t){return this.rotateOnAxis(Ka,t)},rotateZ:function(t){return this.rotateOnAxis(to,t)},translateOnAxis:function(t,e){return Ha.copy(t).applyQuaternion(this.quaternion),this.position.add(Ha.multiplyScalar(e)),this},translateX:function(t){return this.translateOnAxis(Qa,t)},translateY:function(t){return this.translateOnAxis(Ka,t)},translateZ:function(t){return this.translateOnAxis(to,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4(Xa.getInverse(this.matrixWorld))},lookAt:function(t,e,n){t.isVector3?Ya.copy(t):Ya.set(t,e,n);var i=this.parent;this.updateWorldMatrix(1,0),Za.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Xa.lookAt(Za,Ya,this.up):Xa.lookAt(Ya,Za,this.up),this.quaternion.setFromRotationMatrix(Xa),i&&(Xa.extractRotation(i.matrixWorld),qa.setFromRotationMatrix(Xa),this.quaternion.premultiply(qa.inverse()))},add:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this||t&&t.isObject3D&&(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(eo)),this},remove:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var n=this.children.indexOf(t);return-1!==n&&(t.parent=null,this.children.splice(n,1),t.dispatchEvent(no)),this},attach:function(t){return this.updateWorldMatrix(1,0),Xa.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(1,0),Xa.multiply(t.parent.matrixWorld)),t.applyMatrix4(Xa),t.updateWorldMatrix(0,0),this.add(t),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var n=0,i=this.children.length;n<i;n++){var r=this.children[n].getObjectByProperty(t,e);if(void 0!==r)return r}},getWorldPosition:function(t){return void 0===t&&(t=new c),this.updateMatrixWorld(1),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(t){return void 0===t&&(t=new s),this.updateMatrixWorld(1),this.matrixWorld.decompose(Za,t,Ja),t},getWorldScale:function(t){return void 0===t&&(t=new c),this.updateMatrixWorld(1),this.matrixWorld.decompose(Za,$a,t),t},getWorldDirection:function(t){void 0===t&&(t=new c),this.updateMatrixWorld(1);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].traverse(t)},traverseVisible:function(t){if(0!=this.visible){t(this);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=1},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=0,t=1);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){var n=this.parent;if(1==t&&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==e)for(var i=this.children,r=0,a=i.length;r<a;r++)i[r].updateWorldMatrix(0,1)},toJSON:function(t){function e(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}function n(t){var e=[];for(var n in t){var i=t[n];delete i.metadata,e.push(i)}return e}var i=void 0===t||"string"==typeof t,r={};i&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{}},r.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=e(t.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];e(t.shapes,u)}else e(t.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(e(t.materials,this.material[c]));a.material=h}else a.material=e(t.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(t).object);if(i){var p=n(t.geometries),d=n(t.materials),f=n(t.textures),m=n(t.images);s=n(t.shapes),p.length>0&&(r.geometries=p),d.length>0&&(r.materials=d),f.length>0&&(r.textures=f),m.length>0&&(r.images=m),s.length>0&&(r.shapes=s)}return r.object=a,r},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=1),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),1==e)for(var n=0;n<t.children.length;n++){var i=t.children[n];this.add(i.clone())}return this}}),d.prototype=Object.assign(Object.create(p.prototype),{constructor:d,isScene:1,copy:function(t,e){return p.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=p.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},dispose:function(){this.dispatchEvent({type:"dispose"})}});var io=[new c,new c,new c,new c,new c,new c,new c,new c],ro=new c,ao=new f,oo=new c,so=new c,co=new c,lo=new c,uo=new c,ho=new c,po=new c,fo=new c,mo=new c,vo=new c;Object.assign(f.prototype,{isBox3:1,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=t.length;s<c;s+=3){var l=t[s],u=t[s+1],h=t[s+2];l<e&&(e=l),u<n&&(n=u),h<i&&(i=h),l>r&&(r=l),u>a&&(a=u),h>o&&(o=h)}return this.min.set(e,n,i),this.max.set(r,a,o),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=t.count;s<c;s++){var l=t.getX(s),u=t.getY(s),h=t.getZ(s);l<e&&(e=l),u<n&&(n=u),h<i&&(i=h),l>r&&(r=l),u>a&&(a=u),h>o&&(o=h)}return this.min.set(e,n,i),this.max.set(r,a,o),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(t,e){var n=ro.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){return void 0===t&&(t=new c),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(t=new c),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(t){t.updateWorldMatrix(0,0);var e=t.geometry;void 0!==e&&(null===e.boundingBox&&e.computeBoundingBox(),ao.copy(e.boundingBox),ao.applyMatrix4(t.matrixWorld),this.union(ao));for(var n=t.children,i=0,r=n.length;i<r;i++)this.expandByObject(n[i]);return this},containsPoint:function(t){return t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z?0:1},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(e=new c),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z?0:1},intersectsSphere:function(t){return this.clampPoint(t.center,ro),ro.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){var e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant},intersectsTriangle:function(t){if(this.isEmpty())return 0;this.getCenter(po),fo.subVectors(this.max,po),oo.subVectors(t.a,po),so.subVectors(t.b,po),co.subVectors(t.c,po),lo.subVectors(so,oo),uo.subVectors(co,so),ho.subVectors(oo,co);var e=[0,-lo.z,lo.y,0,-uo.z,uo.y,0,-ho.z,ho.y,lo.z,0,-lo.x,uo.z,0,-uo.x,ho.z,0,-ho.x,-lo.y,lo.x,0,-uo.y,uo.x,0,-ho.y,ho.x,0];return m(e,oo,so,co,fo)&&m(e=[1,0,0,0,1,0,0,0,1],oo,so,co,fo)?(mo.crossVectors(lo,uo),m(e=[mo.x,mo.y,mo.z],oo,so,co,fo)):0},clampPoint:function(t,e){return void 0===e&&(e=new c),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return ro.copy(t).clamp(this.min,this.max).sub(t).length()},getBoundingSphere:function(t){return this.getCenter(t.center),t.radius=.5*this.getSize(ro).length(),t},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(t){return this.isEmpty()||(io[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),io[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),io[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),io[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),io[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),io[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),io[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),io[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(io)),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var go=new f;Object.assign(v.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(t,e){var n=this.center;void 0!==e?n.copy(e):go.setFromPoints(t).getCenter(n);for(var i=0,r=0,a=t.length;r<a;r++)i=Math.max(i,n.distanceToSquared(t[r]));return this.radius=Math.sqrt(i),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var n=this.center.distanceToSquared(t);return void 0===e&&(e=new c),e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(t=new f),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}});var yo=new c,xo=new c,_o=new c,bo=new c,Mo=new c,wo=new c,So=new c;Object.assign(g.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(e=new c),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(t){return this.origin.copy(this.at(t,yo)),this},closestPointToPoint:function(t,e){void 0===e&&(e=new c),e.subVectors(t,this.origin);var n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(t){var e=yo.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(yo.copy(this.direction).multiplyScalar(e).add(this.origin),yo.distanceToSquared(t))},distanceSqToSegment:function(t,e,n,i){xo.copy(t).add(e).multiplyScalar(.5),_o.copy(e).sub(t).normalize(),bo.copy(this.origin).sub(xo);var r,a,o,s,c=.5*t.distanceTo(e),l=-this.direction.dot(_o),u=bo.dot(this.direction),h=-bo.dot(_o),p=bo.lengthSq(),d=Math.abs(1-l*l);if(d>0)if(a=l*u-h,s=c*d,(r=l*h-u)>=0)if(a>=-s)if(a<=s){var f=1/d;o=(r*=f)*(r+l*(a*=f)+2*u)+a*(l*r+a+2*h)+p}else o=-(r=Math.max(0,-(l*(a=c)+u)))*r+a*(a+2*h)+p;else o=-(r=Math.max(0,-(l*(a=-c)+u)))*r+a*(a+2*h)+p;else a<=-s?o=-(r=Math.max(0,-(-l*c+u)))*r+(a=r>0?-c:Math.min(Math.max(-c,-h),c))*(a+2*h)+p:a<=s?(r=0,o=(a=Math.min(Math.max(-c,-h),c))*(a+2*h)+p):o=-(r=Math.max(0,-(l*c+u)))*r+(a=r>0?c:Math.min(Math.max(-c,-h),c))*(a+2*h)+p;else o=-(r=Math.max(0,-(l*(a=l>0?-c:c)+u)))*r+a*(a+2*h)+p;return n&&n.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(_o).multiplyScalar(a).add(xo),o},intersectSphere:function(t,e){yo.subVectors(t.center,this.origin);var n=yo.dot(this.direction),i=yo.dot(yo)-n*n,r=t.radius*t.radius;if(i>r)return null;var a=Math.sqrt(r-i),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,e):this.at(o,e)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null},intersectPlane:function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0?1:0},intersectBox:function(t,e){var n,i,r,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=(t.min.x-h.x)*c,i=(t.max.x-h.x)*c):(n=(t.max.x-h.x)*c,i=(t.min.x-h.x)*c),l>=0?(r=(t.min.y-h.y)*l,a=(t.max.y-h.y)*l):(r=(t.max.y-h.y)*l,a=(t.min.y-h.y)*l),n>a||r>i?null:((r>n||n!=n)&&(n=r),(a<i||i!=i)&&(i=a),u>=0?(o=(t.min.z-h.z)*u,s=(t.max.z-h.z)*u):(o=(t.max.z-h.z)*u,s=(t.min.z-h.z)*u),n>s||o>i?null:((o>n||n!=n)&&(n=o),(s<i||i!=i)&&(i=s),i<0?null:this.at(n>=0?n:i,e)))},intersectsBox:function(t){return null!==this.intersectBox(t,yo)},intersectTriangle:function(t,e,n,i,r){Mo.subVectors(e,t),wo.subVectors(n,t),So.crossVectors(Mo,wo);var a,o=this.direction.dot(So);if(o>0){if(i)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}bo.subVectors(this.origin,t);var s=a*this.direction.dot(wo.crossVectors(bo,wo));if(s<0)return null;var c=a*this.direction.dot(Mo.cross(bo));if(c<0)return null;if(s+c>o)return null;var l=-a*bo.dot(So);return l<0?null:this.at(l/o,r)},applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}});var To=new c,Ao=new c,Lo=new n;Object.assign(y.prototype,{isPlane:1,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(t,e,n){var i=To.subVectors(n,e).cross(Ao.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(e=new c),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,e){void 0===e&&(e=new c);var n=t.delta(To),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;var r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||r>1?void 0:e.copy(n).multiplyScalar(r).add(t.start)},intersectsLine:function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(t=new c),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,e){var n=e||Lo.getNormalMatrix(t),i=this.coplanarPoint(To).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this},translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}});var Co=new c,Eo=new c,Po=new c,No=new c,Oo=new c,Do=new c,Io=new c,zo=new c,Ro=new c,Fo=new c;Object.assign(x,{getNormal:function(t,e,n,i){void 0===i&&(i=new c),i.subVectors(n,e),Co.subVectors(t,e),i.cross(Co);var r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)},getBarycoord:function(t,e,n,i,r){Co.subVectors(i,e),Eo.subVectors(n,e),Po.subVectors(t,e);var a=Co.dot(Co),o=Co.dot(Eo),s=Co.dot(Po),l=Eo.dot(Eo),u=Eo.dot(Po),h=a*l-o*o;if(void 0===r&&(r=new c),0===h)return r.set(-2,-1,-1);var p=1/h,d=(l*s-o*u)*p,f=(a*u-o*s)*p;return r.set(1-d-f,f,d)},containsPoint:function(t,e,n,i){return x.getBarycoord(t,e,n,i,No),No.x>=0&&No.y>=0&&No.x+No.y<=1},getUV:function(t,e,n,i,r,a,o,s){return this.getBarycoord(t,e,n,i,No),s.set(0,0),s.addScaledVector(r,No.x),s.addScaledVector(a,No.y),s.addScaledVector(o,No.z),s},isFrontFacing:function(t,e,n,i){return Co.subVectors(n,e),Eo.subVectors(t,e),Co.cross(Eo).dot(i)<0?1:0}}),Object.assign(x.prototype,{set:function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},setFromPointsAndIndices:function(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){return Co.subVectors(this.c,this.b),Eo.subVectors(this.a,this.b),.5*Co.cross(Eo).length()},getMidpoint:function(t){return void 0===t&&(t=new c),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return x.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(t=new y),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return x.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,n,i,r){return x.getUV(t,this.a,this.b,this.c,e,n,i,r)},containsPoint:function(t){return x.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return x.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,e){void 0===e&&(e=new c);var n,i,r=this.a,a=this.b,o=this.c;Oo.subVectors(a,r),Do.subVectors(o,r),zo.subVectors(t,r);var s=Oo.dot(zo),l=Do.dot(zo);if(s<=0&&l<=0)return e.copy(r);Ro.subVectors(t,a);var u=Oo.dot(Ro),h=Do.dot(Ro);if(u>=0&&h<=u)return e.copy(a);var p=s*h-u*l;if(p<=0&&s>=0&&u<=0)return n=s/(s-u),e.copy(r).addScaledVector(Oo,n);Fo.subVectors(t,o);var d=Oo.dot(Fo),f=Do.dot(Fo);if(f>=0&&d<=f)return e.copy(o);var m=d*l-s*f;if(m<=0&&l>=0&&f<=0)return i=l/(l-f),e.copy(r).addScaledVector(Do,i);var v=u*f-d*h;if(v<=0&&h-u>=0&&d-f>=0)return Io.subVectors(o,a),i=(h-u)/(h-u+(d-f)),e.copy(a).addScaledVector(Io,i);var g=1/(v+m+p);return n=m*g,i=p*g,e.copy(r).addScaledVector(Oo,n).addScaledVector(Do,i)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.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},Bo={h:0,s:0,l:0},Uo={h:0,s:0,l:0};Object.assign(_.prototype,{isColor:1,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,n){return this.r=t,this.g=e,this.b=n,this},setHSL:function(t,e,n){if(t=Pa.euclideanModulo(t,1),e=Pa.clamp(e,0,1),n=Pa.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{var i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=b(r,i,t+1/3),this.g=b(r,i,t),this.b=b(r,i,t-1/3)}return this},setStyle:function(t){var e;if(e=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var n,i=e[1],r=e[2];switch(i){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,n[5],this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,n[5],this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r)){var a=parseFloat(n[1])/360,o=parseInt(n[2],10)/100,s=parseInt(n[3],10)/100;return n[5],this.setHSL(a,o,s)}}}else if(e=/^\#([A-Fa-f0-9]+)$/.exec(t)){var c=e[1],l=c.length;if(3===l)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this},setColorName:function(t){var e=ko[t];return void 0!==e&&this.setHex(e),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=M(t.r),this.g=M(t.g),this.b=M(t.b),this},copyLinearToSRGB:function(t){return this.r=w(t.r),this.g=w(t.g),this.b=w(t.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(t={h:0,s:0,l:0});var e,n,i=this.r,r=this.g,a=this.b,o=Math.max(i,r,a),s=Math.min(i,r,a),c=(s+o)/2;if(s===o)e=0,n=0;else{var l=o-s;switch(n=c<=.5?l/(o+s):l/(2-o-s),o){case i:e=(r-a)/l+(r<a?6:0);break;case r:e=(a-i)/l+2;break;case a:e=(i-r)/l+4}e/=6}return t.h=e,t.s=n,t.l=c,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,n){return this.getHSL(Bo),Bo.h+=t,Bo.s+=e,Bo.l+=n,this.setHSL(Bo.h,Bo.s,Bo.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},lerpHSL:function(t,e){this.getHSL(Bo),t.getHSL(Uo);var n=Pa.lerp(Bo.h,Uo.h,e),i=Pa.lerp(Bo.s,Uo.s,e),r=Pa.lerp(Bo.l,Uo.l,e);return this.setHSL(n,i,r),this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}}),_.NAMES=ko,Object.assign(S.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,n=t.vertexNormals.length;e<n;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,n=t.vertexColors.length;e<n;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}});var jo=0;T.prototype=Object.assign(Object.create(t.prototype),{constructor:T,isMaterial:1,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var n=t[e];if(void 0!==n)if("shading"!==e){var i=this[e];void 0!==i&&(i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n)}else this.flatShading=1===n?1:0}},toJSON:function(t){function e(t){var e=[];for(var n in t){var i=t[n];delete i.metadata,e.push(i)}return e}var n=void 0===t||"string"==typeof t;n&&(t={textures:{},images:{}});var i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(i.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,i.reflectivity=this.reflectivity,i.refractionRatio=this.refractionRatio,void 0!==this.combine&&(i.combine=this.combine),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(i.size=this.size),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),1==this.flatShading&&(i.flatShading=this.flatShading),0!==this.side&&(i.side=this.side),this.vertexColors&&(i.vertexColors=1),this.opacity<1&&(i.opacity=this.opacity),1==this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),1==this.polygonOffset&&(i.polygonOffset=1),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),1==this.dithering&&(i.dithering=1),this.alphaTest>0&&(i.alphaTest=this.alphaTest),1==this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),1==this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),1==this.morphTargets&&(i.morphTargets=1),1==this.morphNormals&&(i.morphNormals=1),1==this.skinning&&(i.skinning=1),0==this.visible&&(i.visible=0),0==this.toneMapped&&(i.toneMapped=0),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),n){var r=e(t.textures),a=e(t.images);r.length>0&&(i.textures=r),a.length>0&&(i.images=a)}return i},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var e=t.clippingPlanes,n=null;if(null!==e){var i=e.length;n=Array(i);for(var r=0;r!==i;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(T.prototype,"needsUpdate",{set:function(t){1==t&&this.version++}}),A.prototype=Object.create(T.prototype),A.prototype.constructor=A,A.prototype.isMeshBasicMaterial=1,A.prototype.copy=function(t){return T.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};var Vo=new c;Object.defineProperty(L.prototype,"needsUpdate",{set:function(t){1==t&&this.version++}}),Object.assign(L.prototype,{isBufferAttribute:1,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var a=t[i];void 0===a&&(a=new _),e[n++]=a.r,e[n++]=a.g,e[n++]=a.b}return this},copyVector2sArray:function(t){for(var n=this.array,i=0,r=0,a=t.length;r<a;r++){var o=t[r];void 0===o&&(o=new e),n[i++]=o.x,n[i++]=o.y}return this},copyVector3sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var a=t[i];void 0===a&&(a=new c),e[n++]=a.x,e[n++]=a.y,e[n++]=a.z}return this},copyVector4sArray:function(t){for(var e=this.array,n=0,i=0,a=t.length;i<a;i++){var o=t[i];void 0===o&&(o=new r),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z,e[n++]=o.w}return this},applyMatrix3:function(t){for(var e=0,n=this.count;e<n;e++)Vo.x=this.getX(e),Vo.y=this.getY(e),Vo.z=this.getZ(e),Vo.applyMatrix3(t),this.setXYZ(e,Vo.x,Vo.y,Vo.z);return this},applyMatrix4:function(t){for(var e=0,n=this.count;e<n;e++)Vo.x=this.getX(e),Vo.y=this.getY(e),Vo.z=this.getZ(e),Vo.applyMatrix4(t),this.setXYZ(e,Vo.x,Vo.y,Vo.z);return this},applyNormalMatrix:function(t){for(var e=0,n=this.count;e<n;e++)Vo.x=this.getX(e),Vo.y=this.getY(e),Vo.z=this.getZ(e),Vo.applyNormalMatrix(t),this.setXYZ(e,Vo.x,Vo.y,Vo.z);return this},transformDirection:function(t){for(var e=0,n=this.count;e<n;e++)Vo.x=this.getX(e),Vo.y=this.getY(e),Vo.z=this.getZ(e),Vo.transformDirection(t),this.setXYZ(e,Vo.x,Vo.y,Vo.z);return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,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}}}),C.prototype=Object.create(L.prototype),C.prototype.constructor=C,E.prototype=Object.create(L.prototype),E.prototype.constructor=E,P.prototype=Object.create(L.prototype),P.prototype.constructor=P,N.prototype=Object.create(L.prototype),N.prototype.constructor=N,O.prototype=Object.create(L.prototype),O.prototype.constructor=O,D.prototype=Object.create(L.prototype),D.prototype.constructor=D,I.prototype=Object.create(L.prototype),I.prototype.constructor=I,z.prototype=Object.create(L.prototype),z.prototype.constructor=z,R.prototype=Object.create(L.prototype),R.prototype.constructor=R,Object.assign(F.prototype,{computeGroups:function(t){for(var e,n=[],i=void 0,r=t.faces,a=0;a<r.length;a++){var o=r[a];o.materialIndex!==i&&(i=o.materialIndex,void 0!==e&&(e.count=3*a-e.start,n.push(e)),e={start:3*a,materialIndex:i})}void 0!==e&&(e.count=3*a-e.start,n.push(e)),this.groups=n},fromGeometry:function(t){var n,i=t.faces,r=t.vertices,a=t.faceVertexUvs,o=a[0]&&a[0].length>0,s=a[1]&&a[1].length>0,c=t.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=t.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=t.skinIndices,m=t.skinWeights,v=f.length===r.length,g=m.length===r.length;for(r.length>0&&i.length,u=0;u<i.length;u++){var y=i[u];this.vertices.push(r[y.a],r[y.b],r[y.c]);var x=y.vertexNormals;if(3===x.length)this.normals.push(x[0],x[1],x[2]);else{var _=y.normal;this.normals.push(_,_,_)}var b,M=y.vertexColors;if(3===M.length)this.colors.push(M[0],M[1],M[2]);else{var w=y.color;this.colors.push(w,w,w)}1==o&&(void 0!==(b=a[0][u])?this.uvs.push(b[0],b[1],b[2]):this.uvs.push(new e,new e,new e)),1==s&&(void 0!==(b=a[1][u])?this.uvs2.push(b[0],b[1],b[2]):this.uvs2.push(new e,new e,new e));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 A=p[S].vertexNormals[u];h[S].data.push(A.a,A.b,A.c)}v&&this.skinIndices.push(f[y.a],f[y.b],f[y.c]),g&&this.skinWeights.push(m[y.a],m[y.b],m[y.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this}});var Go=1,Wo=new l,Ho=new p,qo=new c,Xo=new f,Yo=new f,Zo=new c;B.prototype=Object.assign(Object.create(t.prototype),{constructor:B,isBufferGeometry:1,getIndex:function(){return this.index},setIndex:function(t){this.index=Array.isArray(t)?new(k(t)>65535?I:O)(t,1):t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){var e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=1);var i=this.attributes.normal;if(void 0!==i){var r=(new n).getNormalMatrix(t);i.applyNormalMatrix(r),i.needsUpdate=1}var a=this.attributes.tangent;return void 0!==a&&(a.transformDirection(t),a.needsUpdate=1),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return Wo.makeRotationX(t),this.applyMatrix4(Wo),this},rotateY:function(t){return Wo.makeRotationY(t),this.applyMatrix4(Wo),this},rotateZ:function(t){return Wo.makeRotationZ(t),this.applyMatrix4(Wo),this},translate:function(t,e,n){return Wo.makeTranslation(t,e,n),this.applyMatrix4(Wo),this},scale:function(t,e,n){return Wo.makeScale(t,e,n),this.applyMatrix4(Wo),this},lookAt:function(t){return Ho.lookAt(t),Ho.updateMatrix(),this.applyMatrix4(Ho.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(qo).negate(),this.translate(qo.x,qo.y,qo.z),this},setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new z(3*e.vertices.length,3),i=new z(3*e.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(e.vertices)),this.setAttribute("color",i.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var r=new z(e.lineDistances.length,1);this.setAttribute("lineDistance",r.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n];e.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new z(e,3)),this},updateFromObject:function(t){var e,n=t.geometry;if(t.isMesh){var i=n.__directGeometry;if(1==n.elementsNeedUpdate&&(i=void 0,n.elementsNeedUpdate=0),void 0===i)return this.fromGeometry(n);i.verticesNeedUpdate=n.verticesNeedUpdate,i.normalsNeedUpdate=n.normalsNeedUpdate,i.colorsNeedUpdate=n.colorsNeedUpdate,i.uvsNeedUpdate=n.uvsNeedUpdate,i.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=0,n.normalsNeedUpdate=0,n.colorsNeedUpdate=0,n.uvsNeedUpdate=0,n.groupsNeedUpdate=0,n=i}return 1==n.verticesNeedUpdate&&(void 0!==(e=this.attributes.position)&&(e.copyVector3sArray(n.vertices),e.needsUpdate=1),n.verticesNeedUpdate=0),1==n.normalsNeedUpdate&&(void 0!==(e=this.attributes.normal)&&(e.copyVector3sArray(n.normals),e.needsUpdate=1),n.normalsNeedUpdate=0),1==n.colorsNeedUpdate&&(void 0!==(e=this.attributes.color)&&(e.copyColorsArray(n.colors),e.needsUpdate=1),n.colorsNeedUpdate=0),n.uvsNeedUpdate&&(void 0!==(e=this.attributes.uv)&&(e.copyVector2sArray(n.uvs),e.needsUpdate=1),n.uvsNeedUpdate=0),n.lineDistancesNeedUpdate&&(void 0!==(e=this.attributes.lineDistance)&&(e.copyArray(n.lineDistances),e.needsUpdate=1),n.lineDistancesNeedUpdate=0),n.groupsNeedUpdate&&(n.computeGroups(t.geometry),this.groups=n.groups,n.groupsNeedUpdate=0),this},fromGeometry:function(t){return t.__directGeometry=(new F).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.setAttribute("position",new L(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){var n=new Float32Array(3*t.normals.length);this.setAttribute("normal",new L(n,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var i=new Float32Array(3*t.colors.length);this.setAttribute("color",new L(i,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var r=new Float32Array(2*t.uvs.length);this.setAttribute("uv",new L(r,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var a=new Float32Array(2*t.uvs2.length);this.setAttribute("uv2",new L(a,2).copyVector2sArray(t.uvs2))}for(var o in this.groups=t.groups,t.morphTargets){for(var s=[],c=t.morphTargets[o],l=0,u=c.length;l<u;l++){var h=c[l],p=new z(3*h.data.length,3);p.name=h.name,s.push(p.copyVector3sArray(h.data))}this.morphAttributes[o]=s}if(t.skinIndices.length>0){var d=new z(4*t.skinIndices.length,4);this.setAttribute("skinIndex",d.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var f=new z(4*t.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new f);var t=this.attributes.position,e=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(var n=0,i=e.length;n<i;n++){var r=e[n];Xo.setFromBufferAttribute(r),this.morphTargetsRelative?(Zo.addVectors(this.boundingBox.min,Xo.min),this.boundingBox.expandByPoint(Zo),Zo.addVectors(this.boundingBox.max,Xo.max),this.boundingBox.expandByPoint(Zo)):(this.boundingBox.expandByPoint(Xo.min),this.boundingBox.expandByPoint(Xo.max))}}else this.boundingBox.makeEmpty();isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||this.boundingBox.min.z},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new v);var t=this.attributes.position,e=this.morphAttributes.position;if(t){var n=this.boundingSphere.center;if(Xo.setFromBufferAttribute(t),e)for(var i=0,r=e.length;i<r;i++){var a=e[i];Yo.setFromBufferAttribute(a),this.morphTargetsRelative?(Zo.addVectors(Xo.min,Yo.min),Xo.expandByPoint(Zo),Zo.addVectors(Xo.max,Yo.max),Xo.expandByPoint(Zo)):(Xo.expandByPoint(Yo.min),Xo.expandByPoint(Yo.max))}Xo.getCenter(n);var o=0;for(i=0,r=t.count;i<r;i++)Zo.fromBufferAttribute(t,i),o=Math.max(o,n.distanceToSquared(Zo));if(e)for(i=0,r=e.length;i<r;i++){a=e[i];for(var s=this.morphTargetsRelative,c=0,l=a.count;c<l;c++)Zo.fromBufferAttribute(a,c),s&&(qo.fromBufferAttribute(t,c),Zo.add(qo)),o=Math.max(o,n.distanceToSquared(Zo))}this.boundingSphere.radius=Math.sqrt(o),this.boundingSphere.radius}},computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes;if(e.position){var n=e.position.array;if(void 0===e.normal)this.setAttribute("normal",new L(new Float32Array(n.length),3));else for(var i=e.normal.array,r=0,a=i.length;r<a;r++)i[r]=0;var o,s,l,u=e.normal.array,h=new c,p=new c,d=new c,f=new c,m=new c;if(t){var v=t.array;for(r=0,a=t.count;r<a;r+=3)o=3*v[r+0],s=3*v[r+1],l=3*v[r+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(r=0,a=n.length;r<a;r+=9)h.fromArray(n,r),p.fromArray(n,r+3),d.fromArray(n,r+6),f.subVectors(d,p),m.subVectors(h,p),f.cross(m),u[r]=f.x,u[r+1]=f.y,u[r+2]=f.z,u[r+3]=f.x,u[r+4]=f.y,u[r+5]=f.z,u[r+6]=f.x,u[r+7]=f.y,u[r+8]=f.z;this.normalizeNormals(),e.normal.needsUpdate=1}},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=0);var n=this.attributes;for(var i in n)if(void 0!==t.attributes[i])for(var r=n[i].array,a=t.attributes[i],o=a.array,s=a.itemSize*e,c=Math.min(o.length,r.length-s),l=0,u=s;l<c;l++,u++)r[u]=o[l];return this}},normalizeNormals:function(){for(var t=this.attributes.normal,e=0,n=t.count;e<n;e++)Zo.x=t.getX(e),Zo.y=t.getY(e),Zo.z=t.getZ(e),Zo.normalize(),t.setXYZ(e,Zo.x,Zo.y,Zo.z)},toNonIndexed:function(){function t(t,e){for(var n=t.array,i=t.itemSize,r=new n.constructor(e.length*i),a=0,o=0,s=0,c=e.length;s<c;s++){a=e[s]*i;for(var l=0;l<i;l++)r[o++]=n[a++]}return new L(r,i)}if(null===this.index)return this;var e=new B,n=this.index.array,i=this.attributes;for(var r in i){var a=t(i[r],n);e.setAttribute(r,a)}var o=this.morphAttributes;for(r in o){for(var s=[],c=o[r],l=0,u=c.length;l<u;l++)a=t(c[l],n),s.push(a);e.morphAttributes[r]=s}e.morphTargetsRelative=this.morphTargetsRelative;for(var h=this.groups,p=(l=0,h.length);l<p;l++){var d=h[l];e.addGroup(d.start,d.count,d.materialIndex)}return e},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};var i=this.index;null!==i&&(t.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});var r=this.attributes;for(var n in r){var a=(p=r[n]).toJSON();""!==p.name&&(a.name=p.name),t.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&&(t.data.morphAttributes=o,t.data.morphTargetsRelative=this.morphTargetsRelative);var d=this.groups;d.length>0&&(t.data.groups=JSON.parse(JSON.stringify(d)));var f=this.boundingSphere;return null!==f&&(t.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),t},clone:function(){return(new B).copy(this)},copy:function(t){var e,n,i;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var r=t.index;null!==r&&this.setIndex(r.clone());var a=t.attributes;for(e in a){var o=a[e];this.setAttribute(e,o.clone())}var s=t.morphAttributes;for(e in s){var c=[],l=s[e];for(n=0,i=l.length;n<i;n++)c.push(l[n].clone());this.morphAttributes[e]=c}this.morphTargetsRelative=t.morphTargetsRelative;var u=t.groups;for(n=0,i=u.length;n<i;n++){var h=u[n];this.addGroup(h.start,h.count,h.materialIndex)}var p=t.boundingBox;null!==p&&(this.boundingBox=p.clone());var d=t.boundingSphere;return null!==d&&(this.boundingSphere=d.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Jo=new l,$o=new g,Qo=new v,Ko=new c,ts=new c,es=new c,ns=new c,is=new c,rs=new c,as=new c,os=new c,ss=new c,cs=new e,ls=new e,us=new e,hs=new c,ps=new c;U.prototype=Object.assign(Object.create(p.prototype),{constructor:U,isMesh:1,copy:function(t){return p.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,e,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,a=Object.keys(r);if(a.length>0){var o=r[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=o.length;t<e;t++)n=o[t].name||t+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=i.morphTargets;void 0!==s&&s.length}},raycast:function(t,n){var i,r=this.geometry,a=this.material,o=this.matrixWorld;if(void 0!==a&&(null===r.boundingSphere&&r.computeBoundingSphere(),Qo.copy(r.boundingSphere),Qo.applyMatrix4(o),0!=t.ray.intersectsSphere(Qo)&&(Jo.getInverse(o),$o.copy(t.ray).applyMatrix4(Jo),null===r.boundingBox||0!=$o.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var s,c,l,u,h,p,d,f,m,v=r.index,g=r.attributes.position,y=r.morphAttributes.position,_=r.morphTargetsRelative,b=r.attributes.uv,M=r.attributes.uv2,w=r.groups,S=r.drawRange;if(null!==v)if(Array.isArray(a))for(u=0,p=w.length;u<p;u++)for(m=a[(f=w[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=v.getX(h),c=v.getX(h+1),l=v.getX(h+2),(i=V(this,m,t,$o,g,y,_,b,M,s,c,l))&&(i.faceIndex=Math.floor(h/3),i.face.materialIndex=f.materialIndex,n.push(i));else for(u=Math.max(0,S.start),p=Math.min(v.count,S.start+S.count);u<p;u+=3)s=v.getX(u),c=v.getX(u+1),l=v.getX(u+2),(i=V(this,a,t,$o,g,y,_,b,M,s,c,l))&&(i.faceIndex=Math.floor(u/3),n.push(i));else if(void 0!==g)if(Array.isArray(a))for(u=0,p=w.length;u<p;u++)for(m=a[(f=w[u]).materialIndex],h=Math.max(f.start,S.start),d=Math.min(f.start+f.count,S.start+S.count);h<d;h+=3)(i=V(this,m,t,$o,g,y,_,b,M,s=h,c=h+1,l=h+2))&&(i.faceIndex=Math.floor(h/3),i.face.materialIndex=f.materialIndex,n.push(i));else for(u=Math.max(0,S.start),p=Math.min(g.count,S.start+S.count);u<p;u+=3)(i=V(this,a,t,$o,g,y,_,b,M,s=u,c=u+1,l=u+2))&&(i.faceIndex=Math.floor(u/3),n.push(i))}else if(r.isGeometry){var T,A,L,C,E=Array.isArray(a),P=r.vertices,N=r.faces,O=r.faceVertexUvs[0];O.length>0&&(C=O);for(var D=0,I=N.length;D<I;D++){var z=N[D],R=E?a[z.materialIndex]:a;if(void 0!==R&&(T=P[z.a],A=P[z.b],L=P[z.c],i=j(this,R,t,$o,T,A,L,hs))){if(C&&C[D]){var F=C[D];cs.copy(F[0]),ls.copy(F[1]),us.copy(F[2]),i.uv=x.getUV(hs,T,A,L,cs,ls,us,new e)}i.face=z,i.faceIndex=D,n.push(i)}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var ds=0,fs=new l,ms=new p,vs=new c;G.prototype=Object.assign(Object.create(t.prototype),{constructor:G,isGeometry:1,applyMatrix4:function(t){for(var e=(new n).getNormalMatrix(t),i=0,r=this.vertices.length;i<r;i++)this.vertices[i].applyMatrix4(t);for(i=0,r=this.faces.length;i<r;i++){var a=this.faces[i];a.normal.applyMatrix3(e).normalize();for(var o=0,s=a.vertexNormals.length;o<s;o++)a.vertexNormals[o].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=1,this.normalsNeedUpdate=1,this},rotateX:function(t){return fs.makeRotationX(t),this.applyMatrix4(fs),this},rotateY:function(t){return fs.makeRotationY(t),this.applyMatrix4(fs),this},rotateZ:function(t){return fs.makeRotationZ(t),this.applyMatrix4(fs),this},translate:function(t,e,n){return fs.makeTranslation(t,e,n),this.applyMatrix4(fs),this},scale:function(t,e,n){return fs.makeScale(t,e,n),this.applyMatrix4(fs),this},lookAt:function(t){return ms.lookAt(t),ms.updateMatrix(),this.applyMatrix4(ms.matrix),this},fromBufferGeometry:function(t){function n(t,n,r,a){var o=void 0===l?[]:[i.colors[t].clone(),i.colors[n].clone(),i.colors[r].clone()],p=new S(t,n,r,void 0===s?[]:[(new c).fromArray(s,3*t),(new c).fromArray(s,3*n),(new c).fromArray(s,3*r)],o,a);i.faces.push(p),void 0!==u&&i.faceVertexUvs[0].push([(new e).fromArray(u,2*t),(new e).fromArray(u,2*n),(new e).fromArray(u,2*r)]),void 0!==h&&i.faceVertexUvs[1].push([(new e).fromArray(h,2*t),(new e).fromArray(h,2*n),(new e).fromArray(h,2*r)])}var i=this,r=null!==t.index?t.index.array:void 0,a=t.attributes;if(void 0===a.position)return 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)i.vertices.push((new c).fromArray(o,p)),void 0!==l&&i.colors.push((new _).fromArray(l,p));var d=t.groups;if(d.length>0)for(p=0;p<d.length;p++)for(var f=d[p],m=f.start,v=m,g=m+f.count;v<g;v+=3)void 0!==r?n(r[v],r[v+1],r[v+2],f.materialIndex):n(v,v+1,v+2,f.materialIndex);else if(void 0!==r)for(p=0;p<r.length;p+=3)n(r[p],r[p+1],r[p+2]);else for(p=0;p<o.length/3;p+=3)n(p,p+1,p+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(vs).negate(),this.translate(vs.x,vs.y,vs.z),this},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,i=new l;return i.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix4(i),this},computeFaceNormals:function(){for(var t=new c,e=new c,n=0,i=this.faces.length;n<i;n++){var r=this.faces[n],a=this.vertices[r.a],o=this.vertices[r.b],s=this.vertices[r.c];t.subVectors(s,o),e.subVectors(a,o),t.cross(e),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){var e,n,i,r,a,o;for(void 0===t&&(t=1),o=Array(this.vertices.length),e=0,n=this.vertices.length;e<n;e++)o[e]=new c;if(t){var s,l,u,h=new c,p=new c;for(i=0,r=this.faces.length;i<r;i++)a=this.faces[i],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(),i=0,r=this.faces.length;i<r;i++)o[(a=this.faces[i]).a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(e=0,n=this.vertices.length;e<n;e++)o[e].normalize();for(i=0,r=this.faces.length;i<r;i++){var d=(a=this.faces[i]).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 t,e,n;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){var i=(n=this.faces[t]).vertexNormals;3===i.length?(i[0].copy(n.normal),i[1].copy(n.normal),i[2].copy(n.normal)):(i[0]=n.normal.clone(),i[1]=n.normal.clone(),i[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=1)},computeMorphNormals:function(){var t,e,n,i,r;for(n=0,i=this.faces.length;n<i;n++)for((r=this.faces[n]).__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),t=0,e=r.vertexNormals.length;t<e;t++)r.__originalVertexNormals[t]?r.__originalVertexNormals[t].copy(r.vertexNormals[t]):r.__originalVertexNormals[t]=r.vertexNormals[t].clone();var a=new G;for(a.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var o=this.morphNormals[t].faceNormals,s=this.morphNormals[t].vertexNormals;for(n=0,i=this.faces.length;n<i;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[t];for(a.vertices=this.morphTargets[t].vertices,a.computeFaceNormals(),a.computeVertexNormals(),n=0,i=this.faces.length;n<i;n++)r=this.faces[n],l=h.faceNormals[n],u=h.vertexNormals[n],l.copy(r.normal),u.a.copy(r.vertexNormals[0]),u.b.copy(r.vertexNormals[1]),u.c.copy(r.vertexNormals[2])}for(n=0,i=this.faces.length;n<i;n++)(r=this.faces[n]).normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new f),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new v),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,i){if(t&&t.isGeometry){var r,a=this.vertices.length,o=this.vertices,s=t.vertices,c=this.faces,l=t.faces,u=this.colors,h=t.colors;void 0===i&&(i=0),void 0!==e&&(r=(new n).getNormalMatrix(e));for(var p=0,d=s.length;p<d;p++){var f=s[p].clone();void 0!==e&&f.applyMatrix4(e),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,v,g,y=l[p],x=y.vertexNormals,_=y.vertexColors;(m=new S(y.a+a,y.b+a,y.c+a)).normal.copy(y.normal),void 0!==r&&m.normal.applyMatrix3(r).normalize();for(var b=0,M=x.length;b<M;b++)v=x[b].clone(),void 0!==r&&v.applyMatrix3(r).normalize(),m.vertexNormals.push(v);for(m.color.copy(y.color),b=0,M=_.length;b<M;b++)g=_[b],m.vertexColors.push(g.clone());m.materialIndex=y.materialIndex+i,c.push(m)}for(p=0,d=t.faceVertexUvs.length;p<d;p++){var w=t.faceVertexUvs[p];for(void 0===this.faceVertexUvs[p]&&(this.faceVertexUvs[p]=[]),b=0,M=w.length;b<M;b++){for(var T=w[b],A=[],L=0,C=T.length;L<C;L++)A.push(T[L].clone());this.faceVertexUvs[p].push(A)}}}},mergeMesh:function(t){t&&t.isMesh&&(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix))},mergeVertices:function(){var t,e,n,i,r,a,o,s,c={},l=[],u=[];for(n=0,i=this.vertices.length;n<i;n++)t=this.vertices[n],void 0===c[e=Math.round(1e4*t.x)+"_"+Math.round(1e4*t.y)+"_"+Math.round(1e4*t.z)]?(c[e]=n,l.push(this.vertices[n]),u[n]=l.length-1):u[n]=u[c[e]];var h=[];for(n=0,i=this.faces.length;n<i;n++){(r=this.faces[n]).a=u[r.a],r.b=u[r.b],r.c=u[r.c],a=[r.a,r.b,r.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(t){this.vertices=[];for(var e=0,n=t.length;e<n;e++){var i=t[e];this.vertices.push(new c(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,n=0;n<e;n++)t[n]._id=n;t.sort((function(t,e){return t.materialIndex-e.materialIndex}));var i,r,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];for(a&&a.length===e&&(i=[]),o&&o.length===e&&(r=[]),n=0;n<e;n++){var s=t[n]._id;i&&i.push(a[s]),r&&r.push(o[s])}i&&(this.faceVertexUvs[0]=i),r&&(this.faceVertexUvs[1]=r)},toJSON:function(){function t(t,e,n){return n?t|1<<e:t&~(1<<e)}function e(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==p[e]||(p[e]=h.length/3,h.push(t.x,t.y,t.z)),p[e]}function n(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==f[e]||(f[e]=d.length,d.push(t.getHex())),f[e]}function i(t){var e=t.x.toString()+t.y.toString();return void 0!==v[e]||(v[e]=m.length/2,m.push(t.x,t.y)),v[e]}var r={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),void 0!==this.parameters){var a=this.parameters;for(var o in a)void 0!==a[o]&&(r[o]=a[o]);return r}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=[],v={};for(c=0;c<this.faces.length;c++){var g=this.faces[c],y=void 0!==this.faceVertexUvs[0][c],x=g.normal.length()>0,_=g.vertexNormals.length>0,b=1!==g.color.r||1!==g.color.g||1!==g.color.b,M=g.vertexColors.length>0,w=0;if(w=t(w,0,0),w=t(w,1,1),w=t(w,2,0),w=t(w,3,y),w=t(w,4,x),w=t(w,5,_),w=t(w,6,b),w=t(w,7,M),u.push(w),u.push(g.a,g.b,g.c),u.push(g.materialIndex),y){var S=this.faceVertexUvs[0][c];u.push(i(S[0]),i(S[1]),i(S[2]))}if(x&&u.push(e(g.normal)),_){var T=g.vertexNormals;u.push(e(T[0]),e(T[1]),e(T[2]))}if(b&&u.push(n(g.color)),M){var A=g.vertexColors;u.push(n(A[0]),n(A[1]),n(A[2]))}}return r.data={},r.data.vertices=s,r.data.normals=h,d.length>0&&(r.data.colors=d),m.length>0&&(r.data.uvs=[m]),r.data.faces=u,r},clone:function(){return(new G).copy(this)},copy:function(t){var e,n,i,r,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,n=s.length;e<n;e++)this.vertices.push(s[e].clone());var c=t.colors;for(e=0,n=c.length;e<n;e++)this.colors.push(c[e].clone());var l=t.faces;for(e=0,n=l.length;e<n;e++)this.faces.push(l[e].clone());for(e=0,n=t.faceVertexUvs.length;e<n;e++){var u=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),i=0,r=u.length;i<r;i++){var h=u[i],p=[];for(a=0,o=h.length;a<o;a++){var d=h[a];p.push(d.clone())}this.faceVertexUvs[e].push(p)}}var f=t.morphTargets;for(e=0,n=f.length;e<n;e++){var m={};if(m.name=f[e].name,void 0!==f[e].vertices)for(m.vertices=[],i=0,r=f[e].vertices.length;i<r;i++)m.vertices.push(f[e].vertices[i].clone());if(void 0!==f[e].normals)for(m.normals=[],i=0,r=f[e].normals.length;i<r;i++)m.normals.push(f[e].normals[i].clone());this.morphTargets.push(m)}var v=t.morphNormals;for(e=0,n=v.length;e<n;e++){var g={};if(void 0!==v[e].vertexNormals)for(g.vertexNormals=[],i=0,r=v[e].vertexNormals.length;i<r;i++){var y=v[e].vertexNormals[i],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),g.vertexNormals.push(x)}if(void 0!==v[e].faceNormals)for(g.faceNormals=[],i=0,r=v[e].faceNormals.length;i<r;i++)g.faceNormals.push(v[e].faceNormals[i].clone());this.morphNormals.push(g)}var _=t.skinWeights;for(e=0,n=_.length;e<n;e++)this.skinWeights.push(_[e].clone());var b=t.skinIndices;for(e=0,n=b.length;e<n;e++)this.skinIndices.push(b[e].clone());var M=t.lineDistances;for(e=0,n=M.length;e<n;e++)this.lineDistances.push(M[e]);var w=t.boundingBox;null!==w&&(this.boundingBox=w.clone());var S=t.boundingSphere;return null!==S&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});class gs extends B{constructor(t,e,n,i,r,a){function o(t,e,n,i,r,a,o,m,v,g,y){var x,_,b=a/v,M=o/g,w=a/2,S=o/2,T=m/2,A=v+1,L=g+1,C=0,E=0,P=new c;for(_=0;_<L;_++){var N=_*M-S;for(x=0;x<A;x++){var O=x*b-w;P[t]=O*i,P[e]=N*r,P[n]=T,u.push(P.x,P.y,P.z),P[t]=0,P[e]=0,P[n]=m>0?1:-1,h.push(P.x,P.y,P.z),p.push(x/v),p.push(1-_/g),C+=1}}for(_=0;_<g;_++)for(x=0;x<v;x++){var D=d+x+A*_,I=d+x+A*(_+1),z=d+(x+1)+A*(_+1),R=d+(x+1)+A*_;l.push(D,I,R),l.push(I,z,R),E+=6}s.addGroup(f,E,y),f+=E,d+=C}super(),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};var s=this;t=t||1,e=e||1,n=n||1,i=Math.floor(i)||1,r=Math.floor(r)||1;var l=[],u=[],h=[],p=[],d=0,f=0;o("z","y","x",-1,-1,n,e,t,a=Math.floor(a)||1,r,0),o("z","y","x",1,-1,n,e,-t,a,r,1),o("x","z","y",1,1,t,n,e,i,a,2),o("x","z","y",1,-1,t,n,-e,i,a,3),o("x","y","z",1,-1,t,e,n,i,r,4),o("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(l),this.setAttribute("position",new z(u,3)),this.setAttribute("normal",new z(h,3)),this.setAttribute("uv",new z(p,2))}}var ys={clone:W,merge:H};q.prototype=Object.create(T.prototype),q.prototype.constructor=q,q.prototype.isShaderMaterial=1,q.prototype.copy=function(t){return T.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=W(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},q.prototype.toJSON=function(t){var e=T.prototype.toJSON.call(this,t);for(var n in e.uniforms={},this.uniforms){var i=this.uniforms[n].value;i&&i.isTexture?e.uniforms[n]={type:"t",value:i.toJSON(t).uuid}:i&&i.isColor?e.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?e.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?e.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?e.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?e.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?e.uniforms[n]={type:"m4",value:i.toArray()}:e.uniforms[n]={value:i}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var r={};for(var a in this.extensions)1==this.extensions[a]&&(r[a]=1);return Object.keys(r).length>0&&(e.extensions=r),e},X.prototype=Object.assign(Object.create(p.prototype),{constructor:X,isCamera:1,copy:function(t,e){return p.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(t=new c),this.updateMatrixWorld(1);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){p.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,e){p.prototype.updateWorldMatrix.call(this,t,e),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(t,e){return X.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*Pa.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*Pa.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Pa.RAD2DEG*Math.atan(Math.tan(.5*Pa.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,i,r,a){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=0),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*Pa.DEG2RAD*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;r+=a.offsetX*i/o,e-=a.offsetY*n/s,i*=a.width/o,n*=a.height/s}var c=this.filmOffset;0!==c&&(r+=t*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=p.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),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(t,e){this.texture.type=e.type,this.texture.format=e.format,this.texture.encoding=e.encoding;var n=new d,i="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}",r="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:W({tEquirect:{value:null}}),vertexShader:i,fragmentShader:r,side:1,blending:0});a.uniforms.tEquirect.value=e;var o=new U(new gs(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(t,n),o.geometry.dispose(),o.material.dispose(),this},$.prototype=Object.create(i.prototype),$.prototype.constructor=$,$.prototype.isDataTexture=1;var xs=new v,_s=new c;Object.assign(Q.prototype,{set:function(t,e,n,i,r,a){var o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},setFromProjectionMatrix:function(t){var e=this.planes,n=t.elements,i=n[0],r=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],v=n[13],g=n[14],y=n[15];return e[0].setComponents(o-i,u-s,f-h,y-m).normalize(),e[1].setComponents(o+i,u+s,f+h,y+m).normalize(),e[2].setComponents(o+r,u+c,f+p,y+v).normalize(),e[3].setComponents(o-r,u-c,f-p,y-v).normalize(),e[4].setComponents(o-a,u-l,f-d,y-g).normalize(),e[5].setComponents(o+a,u+l,f+d,y+g).normalize(),this},intersectsObject:function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),xs.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(xs)},intersectsSprite:function(t){return xs.center.set(0,0,0),xs.radius=.7071067811865476,xs.applyMatrix4(t.matrixWorld),this.intersectsSphere(xs)},intersectsSphere:function(t){for(var e=this.planes,n=t.center,i=-t.radius,r=0;r<6;r++)if(e[r].distanceToPoint(n)<i)return 0;return 1},intersectsBox:function(t){for(var e=this.planes,n=0;n<6;n++){var i=e[n];if(_s.x=i.normal.x>0?t.max.x:t.min.x,_s.y=i.normal.y>0?t.max.y:t.min.y,_s.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(_s)<0)return 0}return 1},containsPoint:function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return 0;return 1}});var bs={common:{diffuse:{value:new _(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 e(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 _(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 _(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new n}},sprite:{diffuse:{value:new _(15658734)},opacity:{value:1},center:{value:new e(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new n}}};et.prototype=Object.create(G.prototype),et.prototype.constructor=et,nt.prototype=Object.create(B.prototype),nt.prototype.constructor=nt;var Ms={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}"},ws={basic:{uniforms:H([bs.common,bs.specularmap,bs.envmap,bs.aomap,bs.lightmap,bs.fog]),vertexShader:Ms.meshbasic_vert,fragmentShader:Ms.meshbasic_frag},lambert:{uniforms:H([bs.common,bs.specularmap,bs.envmap,bs.aomap,bs.lightmap,bs.emissivemap,bs.fog,bs.lights,{emissive:{value:new _(0)}}]),vertexShader:Ms.meshlambert_vert,fragmentShader:Ms.meshlambert_frag},phong:{uniforms:H([bs.common,bs.specularmap,bs.envmap,bs.aomap,bs.lightmap,bs.emissivemap,bs.bumpmap,bs.normalmap,bs.displacementmap,bs.fog,bs.lights,{emissive:{value:new _(0)},specular:{value:new _(1118481)},shininess:{value:30}}]),vertexShader:Ms.meshphong_vert,fragmentShader:Ms.meshphong_frag},standard:{uniforms:H([bs.common,bs.envmap,bs.aomap,bs.lightmap,bs.emissivemap,bs.bumpmap,bs.normalmap,bs.displacementmap,bs.roughnessmap,bs.metalnessmap,bs.fog,bs.lights,{emissive:{value:new _(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Ms.meshphysical_vert,fragmentShader:Ms.meshphysical_frag},toon:{uniforms:H([bs.common,bs.specularmap,bs.aomap,bs.lightmap,bs.emissivemap,bs.bumpmap,bs.normalmap,bs.displacementmap,bs.gradientmap,bs.fog,bs.lights,{emissive:{value:new _(0)},specular:{value:new _(1118481)},shininess:{value:30}}]),vertexShader:Ms.meshtoon_vert,fragmentShader:Ms.meshtoon_frag},matcap:{uniforms:H([bs.common,bs.bumpmap,bs.normalmap,bs.displacementmap,bs.fog,{matcap:{value:null}}]),vertexShader:Ms.meshmatcap_vert,fragmentShader:Ms.meshmatcap_frag},points:{uniforms:H([bs.points,bs.fog]),vertexShader:Ms.points_vert,fragmentShader:Ms.points_frag},dashed:{uniforms:H([bs.common,bs.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ms.linedashed_vert,fragmentShader:Ms.linedashed_frag},depth:{uniforms:H([bs.common,bs.displacementmap]),vertexShader:Ms.depth_vert,fragmentShader:Ms.depth_frag},normal:{uniforms:H([bs.common,bs.bumpmap,bs.normalmap,bs.displacementmap,{opacity:{value:1}}]),vertexShader:Ms.normal_vert,fragmentShader:Ms.normal_frag},sprite:{uniforms:H([bs.sprite,bs.fog]),vertexShader:Ms.sprite_vert,fragmentShader:Ms.sprite_frag},background:{uniforms:{uvTransform:{value:new n},t2D:{value:null}},vertexShader:Ms.background_vert,fragmentShader:Ms.background_frag},cube:{uniforms:H([bs.envmap,{opacity:{value:1}}]),vertexShader:Ms.cube_vert,fragmentShader:Ms.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ms.equirect_vert,fragmentShader:Ms.equirect_frag},distanceRGBA:{uniforms:H([bs.common,bs.displacementmap,{referencePosition:{value:new c},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ms.distanceRGBA_vert,fragmentShader:Ms.distanceRGBA_frag},shadow:{uniforms:H([bs.lights,bs.fog,{color:{value:new _(0)},opacity:{value:1}}]),vertexShader:Ms.shadow_vert,fragmentShader:Ms.shadow_frag}};ws.physical={uniforms:H([ws.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new e(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new _(0)},transparency:{value:0}}]),vertexShader:Ms.meshphysical_vert,fragmentShader:Ms.meshphysical_frag},ft.prototype=Object.create(i.prototype),ft.prototype.constructor=ft,ft.prototype.isCubeTexture=1,Object.defineProperty(ft.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),mt.prototype=Object.create(i.prototype),mt.prototype.constructor=mt,mt.prototype.isDataTexture2DArray=1,vt.prototype=Object.create(i.prototype),vt.prototype.constructor=vt,vt.prototype.isDataTexture3D=1;var Ss=new i,Ts=new mt,As=new vt,Ls=new ft,Cs=[],Es=[],Ps=new Float32Array(16),Ns=new Float32Array(9),Os=new Float32Array(4);$t.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),xt(e,t)},Qt.prototype.setValue=function(t,e,n){for(var i=this.seq,r=0,a=i.length;r!==a;++r){var o=i[r];o.setValue(t,e[o.id],n)}};var Ds=/([\w\d_]+)(\])?(\[|\.)?/g;ee.prototype.setValue=function(t,e,n,i){var r=this.map[e];void 0!==r&&r.setValue(t,n,i)},ee.prototype.setOptional=function(t,e,n){var i=e[n];void 0!==i&&this.setValue(t,n,i)},ee.upload=function(t,e,n,i){for(var r=0,a=e.length;r!==a;++r){var o=e[r],s=n[o.id];0!=s.needsUpdate&&o.setValue(t,s.value,i)}},ee.seqWithValue=function(t,e){for(var n=[],i=0,r=t.length;i!==r;++i){var a=t[i];a.id in e&&n.push(a)}return n};var Is=0,zs=/^[ \t]*#include +<([\w\d./]+)>/gm,Rs=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Fs=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g,ks=0;Ce.prototype=Object.create(T.prototype),Ce.prototype.constructor=Ce,Ce.prototype.isMeshDepthMaterial=1,Ce.prototype.copy=function(t){return T.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},Ee.prototype=Object.create(T.prototype),Ee.prototype.constructor=Ee,Ee.prototype.isMeshDistanceMaterial=1,Ee.prototype.copy=function(t){return T.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this},Ie.prototype=Object.assign(Object.create(Y.prototype),{constructor:Ie,isArrayCamera:1}),ze.prototype=Object.assign(Object.create(p.prototype),{constructor:ze,isGroup:1}),Object.assign(Re.prototype,t.prototype),Object.assign(ke.prototype,{isFogExp2:1,clone:function(){return new ke(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(Be.prototype,{isFog:1,clone:function(){return new Be(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(Ue.prototype,"needsUpdate",{set:function(t){1==t&&this.version++}}),Object.assign(Ue.prototype,{isInterleavedBuffer:1,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(var i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}});var Bs,Us=new c;Object.defineProperties(je.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(je.prototype,{isInterleavedBufferAttribute:1,applyMatrix4:function(t){for(var e=0,n=this.data.count;e<n;e++)Us.x=this.getX(e),Us.y=this.getY(e),Us.z=this.getZ(e),Us.applyMatrix4(t),this.setXYZ(e,Us.x,Us.y,Us.z);return this},setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this.data.array[t+3]=r,this}}),Ve.prototype=Object.create(T.prototype),Ve.prototype.constructor=Ve,Ve.prototype.isSpriteMaterial=1,Ve.prototype.copy=function(t){return T.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this};var js=new c,Vs=new c,Gs=new c,Ws=new e,Hs=new e,qs=new l,Xs=new c,Ys=new c,Zs=new c,Js=new e,$s=new e,Qs=new e;Ge.prototype=Object.assign(Object.create(p.prototype),{constructor:Ge,isSprite:1,raycast:function(t,n){t.camera,Vs.setFromMatrixScale(this.matrixWorld),qs.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Gs.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&0==this.material.sizeAttenuation&&Vs.multiplyScalar(-Gs.z);var i,r,a=this.material.rotation;0!==a&&(r=Math.cos(a),i=Math.sin(a));var o=this.center;We(Xs.set(-.5,-.5,0),Gs,o,Vs,i,r),We(Ys.set(.5,-.5,0),Gs,o,Vs,i,r),We(Zs.set(.5,.5,0),Gs,o,Vs,i,r),Js.set(0,0),$s.set(1,0),Qs.set(1,1);var s=t.ray.intersectTriangle(Xs,Ys,Zs,0,js);if(null!==s||(We(Ys.set(-.5,.5,0),Gs,o,Vs,i,r),$s.set(0,1),null!==(s=t.ray.intersectTriangle(Xs,Zs,Ys,0,js)))){var c=t.ray.origin.distanceTo(js);c<t.near||c>t.far||n.push({distance:c,point:js.clone(),uv:x.getUV(js,Xs,Ys,Zs,Js,$s,Qs,new e),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return p.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}});var Ks=new c,tc=new c;He.prototype=Object.assign(Object.create(p.prototype),{constructor:He,isLOD:1,copy:function(t){p.prototype.copy.call(this,t,0);for(var e=t.levels,n=0,i=e.length;n<i;n++){var r=e[n];this.addLevel(r.object.clone(),r.distance)}return this.autoUpdate=t.autoUpdate,this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var n=this.levels,i=0;i<n.length&&!(e<n[i].distance);i++);return n.splice(i,0,{distance:e,object:t}),this.add(t),this},getCurrentLevel:function(){return this._currentLevel},getObjectForDistance:function(t){var e=this.levels;if(e.length>0){for(var n=1,i=e.length;n<i&&!(t<e[n].distance);n++);return e[n-1].object}return null},raycast:function(t,e){if(this.levels.length>0){Ks.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(Ks);this.getObjectForDistance(n).raycast(t,e)}},update:function(t){var e=this.levels;if(e.length>1){Ks.setFromMatrixPosition(t.matrixWorld),tc.setFromMatrixPosition(this.matrixWorld);var n=Ks.distanceTo(tc)/t.zoom;e[0].object.visible=1;for(var i=1,r=e.length;i<r&&n>=e[i].distance;i++)e[i-1].object.visible=0,e[i].object.visible=1;for(this._currentLevel=i-1;i<r;i++)e[i].object.visible=0}},toJSON:function(t){var e=p.prototype.toJSON.call(this,t);0==this.autoUpdate&&(e.object.autoUpdate=0),e.object.levels=[];for(var n=this.levels,i=0,r=n.length;i<r;i++){var a=n[i];e.object.levels.push({object:a.object.uuid,distance:a.distance})}return e}}),qe.prototype=Object.assign(Object.create(U.prototype),{constructor:qe,isSkinnedMesh:1,bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(1),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new r,e=this.geometry.attributes.skinWeight,n=0,i=e.count;n<i;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);var a=1/t.manhattanLength();a!==1/0?t.multiplyScalar(a):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){U.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode&&this.bindMatrixInverse.getInverse(this.bindMatrix)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var ec=new l,nc=new l;Object.assign(Xe.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var n=new l;this.bones[t]&&n.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(n)}},pose:function(){var t,e,n;for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:function(){for(var t=this.bones,e=this.boneInverses,n=this.boneMatrices,i=this.boneTexture,r=0,a=t.length;r<a;r++){var o=t[r]?t[r].matrixWorld:nc;ec.multiplyMatrices(o,e[r]),ec.toArray(n,16*r)}void 0!==i&&(i.needsUpdate=1)},clone:function(){return new Xe(this.bones,this.boneInverses)},getBoneByName:function(t){for(var e=0,n=this.bones.length;e<n;e++){var i=this.bones[e];if(i.name===t)return i}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}}),Ye.prototype=Object.assign(Object.create(p.prototype),{constructor:Ye,isBone:1});var ic=new l,rc=new l,ac=[],oc=new U;Ze.prototype=Object.assign(Object.create(U.prototype),{constructor:Ze,isInstancedMesh:1,getMatrixAt:function(t,e){e.fromArray(this.instanceMatrix.array,16*t)},raycast:function(t,e){var n=this.matrixWorld,i=this.count;if(oc.geometry=this.geometry,oc.material=this.material,void 0!==oc.material)for(var r=0;r<i;r++)this.getMatrixAt(r,ic),rc.multiplyMatrices(n,ic),oc.matrixWorld=rc,oc.raycast(t,ac),ac.length>0&&(ac[0].instanceId=r,ac[0].object=this,e.push(ac[0]),ac.length=0)},setMatrixAt:function(t,e){e.toArray(this.instanceMatrix.array,16*t)},updateMorphTargets:function(){}}),Je.prototype=Object.create(T.prototype),Je.prototype.constructor=Je,Je.prototype.isLineBasicMaterial=1,Je.prototype.copy=function(t){return T.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this};var sc=new c,cc=new c,lc=new l,uc=new g,hc=new v;$e.prototype=Object.assign(Object.create(p.prototype),{constructor:$e,isLine:1,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry){if(null===t.index){for(var e=t.attributes.position,n=[0],i=1,r=e.count;i<r;i++)sc.fromBufferAttribute(e,i-1),cc.fromBufferAttribute(e,i),n[i]=n[i-1],n[i]+=sc.distanceTo(cc);t.setAttribute("lineDistance",new z(n,1))}}else if(t.isGeometry){var a=t.vertices;for((n=t.lineDistances)[0]=0,i=1,r=a.length;i<r;i++)n[i]=n[i-1],n[i]+=a[i-1].distanceTo(a[i])}return this},raycast:function(t,e){var n=this.geometry,i=this.matrixWorld,r=t.params.Line.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),hc.copy(n.boundingSphere),hc.applyMatrix4(i),hc.radius+=r,0!=t.ray.intersectsSphere(hc)){lc.getInverse(i),uc.copy(t.ray).applyMatrix4(lc);var a=r/((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,v=0,g=m.length-1;v<g;v+=p){var y=m[v],x=m[v+1];s.fromArray(f,3*y),l.fromArray(f,3*x),uc.distanceSqToSegment(s,l,h,u)>o||(h.applyMatrix4(this.matrixWorld),(M=t.ray.origin.distanceTo(h))<t.near||M>t.far||e.push({distance:M,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}))}else for(v=0,g=f.length/3-1;v<g;v+=p)s.fromArray(f,3*v),l.fromArray(f,3*v+3),uc.distanceSqToSegment(s,l,h,u)>o||(h.applyMatrix4(this.matrixWorld),(M=t.ray.origin.distanceTo(h))<t.near||M>t.far||e.push({distance:M,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}))}else if(n.isGeometry){var _=n.vertices,b=_.length;for(v=0;v<b-1;v+=p){var M;uc.distanceSqToSegment(_[v],_[v+1],h,u)>o||(h.applyMatrix4(this.matrixWorld),(M=t.ray.origin.distanceTo(h))<t.near||M>t.far||e.push({distance:M,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this}))}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var pc=new c,dc=new c;Qe.prototype=Object.assign(Object.create($e.prototype),{constructor:Qe,isLineSegments:1,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry){if(null===t.index){for(var e=t.attributes.position,n=[],i=0,r=e.count;i<r;i+=2)pc.fromBufferAttribute(e,i),dc.fromBufferAttribute(e,i+1),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+pc.distanceTo(dc);t.setAttribute("lineDistance",new z(n,1))}}else if(t.isGeometry){var a=t.vertices;for(n=t.lineDistances,i=0,r=a.length;i<r;i+=2)pc.copy(a[i]),dc.copy(a[i+1]),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+pc.distanceTo(dc)}return this}}),Ke.prototype=Object.assign(Object.create($e.prototype),{constructor:Ke,isLineLoop:1}),tn.prototype=Object.create(T.prototype),tn.prototype.constructor=tn,tn.prototype.isPointsMaterial=1,tn.prototype.copy=function(t){return T.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this};var fc=new l,mc=new g,vc=new v,gc=new c;en.prototype=Object.assign(Object.create(p.prototype),{constructor:en,isPoints:1,raycast:function(t,e){var n=this.geometry,i=this.matrixWorld,r=t.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),vc.copy(n.boundingSphere),vc.applyMatrix4(i),vc.radius+=r,0!=t.ray.intersectsSphere(vc)){fc.getInverse(i),mc.copy(t.ray).applyMatrix4(fc);var a=r/((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];gc.fromArray(c,3*p),nn(gc,p,o,i,t,e,this)}else{u=0;for(var d=c.length/3;u<d;u++)gc.fromArray(c,3*u),nn(gc,u,o,i,t,e,this)}}else{var f=n.vertices;for(u=0,d=f.length;u<d;u++)nn(f[u],u,o,i,t,e,this)}}},updateMorphTargets:function(){var t,e,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,a=Object.keys(r);if(a.length>0){var o=r[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=o.length;t<e;t++)n=o[t].name||t+"",this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{var s=i.morphTargets;void 0!==s&&s.length}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),rn.prototype=Object.assign(Object.create(i.prototype),{constructor:rn,isVideoTexture:1,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=1)}}),an.prototype=Object.create(i.prototype),an.prototype.constructor=an,an.prototype.isCompressedTexture=1,on.prototype=Object.create(i.prototype),on.prototype.constructor=on,on.prototype.isCanvasTexture=1,sn.prototype=Object.create(i.prototype),sn.prototype.constructor=sn,sn.prototype.isDepthTexture=1,cn.prototype=Object.create(B.prototype),cn.prototype.constructor=cn,ln.prototype=Object.create(G.prototype),ln.prototype.constructor=ln,un.prototype=Object.create(B.prototype),un.prototype.constructor=un,hn.prototype=Object.create(G.prototype),hn.prototype.constructor=hn,pn.prototype=Object.create(B.prototype),pn.prototype.constructor=pn,dn.prototype=Object.create(G.prototype),dn.prototype.constructor=dn,fn.prototype=Object.create(pn.prototype),fn.prototype.constructor=fn,mn.prototype=Object.create(G.prototype),mn.prototype.constructor=mn,vn.prototype=Object.create(pn.prototype),vn.prototype.constructor=vn,gn.prototype=Object.create(G.prototype),gn.prototype.constructor=gn,yn.prototype=Object.create(pn.prototype),yn.prototype.constructor=yn,xn.prototype=Object.create(G.prototype),xn.prototype.constructor=xn,_n.prototype=Object.create(pn.prototype),_n.prototype.constructor=_n,bn.prototype=Object.create(G.prototype),bn.prototype.constructor=bn,Mn.prototype=Object.create(B.prototype),Mn.prototype.constructor=Mn,Mn.prototype.toJSON=function(){var t=B.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},wn.prototype=Object.create(G.prototype),wn.prototype.constructor=wn,Sn.prototype=Object.create(B.prototype),Sn.prototype.constructor=Sn,Tn.prototype=Object.create(G.prototype),Tn.prototype.constructor=Tn,An.prototype=Object.create(B.prototype),An.prototype.constructor=An;var yc={area:function(t){for(var e=t.length,n=0,i=e-1,r=0;r<e;i=r++)n+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*n},isClockWise:function(t){return yc.area(t)<0},triangulateShape:function(t,e){var n=[],i=[],r=[];Yn(t),Zn(n,t);var a=t.length;e.forEach(Yn);for(var o=0;o<e.length;o++)i.push(a),a+=e[o].length,Zn(n,e[o]);var s=function(t,e,n){n=n||2;var i,r,a,o,s,c,l,u=e&&e.length,h=u?e[0]*n:t.length,p=Ln(t,0,h,n,1),d=[];if(!p||p.next===p.prev)return d;if(u&&(p=function(t,e,n,i){var r,a,o,s=[];for(r=0,a=e.length;r<a;r++)(o=Ln(t,e[r]*i,r<a-1?e[r+1]*i:t.length,i,0))===o.next&&(o.steiner=1),s.push(Fn(o));for(s.sort(In),r=0;r<s.length;r++)zn(s[r],n),n=Cn(n,n.next);return n}(t,e,p,n)),t.length>80*n){i=a=t[0],r=o=t[1];for(var f=n;f<h;f+=n)(s=t[f])<i&&(i=s),(c=t[f+1])<r&&(r=c),s>a&&(a=s),c>o&&(o=c);l=0!==(l=Math.max(a-i,o-r))?1/l:0}return En(p,d,n,i,r,l),d}(n,i);for(o=0;o<s.length;o+=3)r.push(s.slice(o,o+3));return r}};Jn.prototype=Object.create(G.prototype),Jn.prototype.constructor=Jn,Jn.prototype.toJSON=function(){var t=G.prototype.toJSON.call(this);return Qn(this.parameters.shapes,this.parameters.options,t)},$n.prototype=Object.create(B.prototype),$n.prototype.constructor=$n,$n.prototype.toJSON=function(){var t=B.prototype.toJSON.call(this);return Qn(this.parameters.shapes,this.parameters.options,t)};var xc={generateTopUV:function(t,n,i,r,a){var o=n[3*i],s=n[3*i+1],c=n[3*r],l=n[3*r+1],u=n[3*a],h=n[3*a+1];return[new e(o,s),new e(c,l),new e(u,h)]},generateSideWallUV:function(t,n,i,r,a,o){var s=n[3*i],c=n[3*i+1],l=n[3*i+2],u=n[3*r],h=n[3*r+1],p=n[3*r+2],d=n[3*a],f=n[3*a+1],m=n[3*a+2],v=n[3*o],g=n[3*o+1],y=n[3*o+2];return Math.abs(c-h)<.01?[new e(s,1-l),new e(u,1-p),new e(d,1-m),new e(v,1-y)]:[new e(c,1-l),new e(h,1-p),new e(f,1-m),new e(g,1-y)]}};Kn.prototype=Object.create(G.prototype),Kn.prototype.constructor=Kn,ti.prototype=Object.create($n.prototype),ti.prototype.constructor=ti,ei.prototype=Object.create(G.prototype),ei.prototype.constructor=ei,ni.prototype=Object.create(B.prototype),ni.prototype.constructor=ni,ii.prototype=Object.create(G.prototype),ii.prototype.constructor=ii,ri.prototype=Object.create(B.prototype),ri.prototype.constructor=ri,ai.prototype=Object.create(G.prototype),ai.prototype.constructor=ai,oi.prototype=Object.create(B.prototype),oi.prototype.constructor=oi,si.prototype=Object.create(G.prototype),si.prototype.constructor=si,si.prototype.toJSON=function(){var t=G.prototype.toJSON.call(this);return li(this.parameters.shapes,t)},ci.prototype=Object.create(B.prototype),ci.prototype.constructor=ci,ci.prototype.toJSON=function(){var t=B.prototype.toJSON.call(this);return li(this.parameters.shapes,t)},ui.prototype=Object.create(B.prototype),ui.prototype.constructor=ui,hi.prototype=Object.create(G.prototype),hi.prototype.constructor=hi,pi.prototype=Object.create(B.prototype),pi.prototype.constructor=pi,di.prototype=Object.create(hi.prototype),di.prototype.constructor=di,fi.prototype=Object.create(pi.prototype),fi.prototype.constructor=fi,mi.prototype=Object.create(G.prototype),mi.prototype.constructor=mi,vi.prototype=Object.create(B.prototype),vi.prototype.constructor=vi;var _c=Object.freeze({__proto__:null,WireframeGeometry:cn,ParametricGeometry:ln,ParametricBufferGeometry:un,TetrahedronGeometry:dn,TetrahedronBufferGeometry:fn,OctahedronGeometry:mn,OctahedronBufferGeometry:vn,IcosahedronGeometry:gn,IcosahedronBufferGeometry:yn,DodecahedronGeometry:xn,DodecahedronBufferGeometry:_n,PolyhedronGeometry:hn,PolyhedronBufferGeometry:pn,TubeGeometry:bn,TubeBufferGeometry:Mn,TorusKnotGeometry:wn,TorusKnotBufferGeometry:Sn,TorusGeometry:Tn,TorusBufferGeometry:An,TextGeometry:Kn,TextBufferGeometry:ti,SphereGeometry:ei,SphereBufferGeometry:ni,RingGeometry:ii,RingBufferGeometry:ri,PlaneGeometry:et,PlaneBufferGeometry:nt,LatheGeometry:ai,LatheBufferGeometry:oi,ShapeGeometry:si,ShapeBufferGeometry:ci,ExtrudeGeometry:Jn,ExtrudeBufferGeometry:$n,EdgesGeometry:ui,ConeGeometry:di,ConeBufferGeometry:fi,CylinderGeometry:hi,CylinderBufferGeometry:pi,CircleGeometry:mi,CircleBufferGeometry:vi,BoxGeometry:class extends G{constructor(t,e,n,i,r,a){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:a},this.fromBufferGeometry(new gs(t,e,n,i,r,a)),this.mergeVertices()}},BoxBufferGeometry:gs});gi.prototype=Object.create(T.prototype),gi.prototype.constructor=gi,gi.prototype.isShadowMaterial=1,gi.prototype.copy=function(t){return T.prototype.copy.call(this,t),this.color.copy(t.color),this},yi.prototype=Object.create(q.prototype),yi.prototype.constructor=yi,yi.prototype.isRawShaderMaterial=1,xi.prototype=Object.create(T.prototype),xi.prototype.constructor=xi,xi.prototype.isMeshStandardMaterial=1,xi.prototype.copy=function(t){return T.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.vertexTangents=t.vertexTangents,this},_i.prototype=Object.create(xi.prototype),_i.prototype.constructor=_i,_i.prototype.isMeshPhysicalMaterial=1,_i.prototype.copy=function(t){return xi.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new _).copy(t.sheen):this.sheen=null,this.transparency=t.transparency,this},bi.prototype=Object.create(T.prototype),bi.prototype.constructor=bi,bi.prototype.isMeshPhongMaterial=1,bi.prototype.copy=function(t){return T.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Mi.prototype=Object.create(T.prototype),Mi.prototype.constructor=Mi,Mi.prototype.isMeshToonMaterial=1,Mi.prototype.copy=function(t){return T.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},wi.prototype=Object.create(T.prototype),wi.prototype.constructor=wi,wi.prototype.isMeshNormalMaterial=1,wi.prototype.copy=function(t){return T.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Si.prototype=Object.create(T.prototype),Si.prototype.constructor=Si,Si.prototype.isMeshLambertMaterial=1,Si.prototype.copy=function(t){return T.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Ti.prototype=Object.create(T.prototype),Ti.prototype.constructor=Ti,Ti.prototype.isMeshMatcapMaterial=1,Ti.prototype.copy=function(t){return T.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Ai.prototype=Object.create(Je.prototype),Ai.prototype.constructor=Ai,Ai.prototype.isLineDashedMaterial=1,Ai.prototype.copy=function(t){return Je.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var bc=Object.freeze({__proto__:null,ShadowMaterial:gi,SpriteMaterial:Ve,RawShaderMaterial:yi,ShaderMaterial:q,PointsMaterial:tn,MeshPhysicalMaterial:_i,MeshStandardMaterial:xi,MeshPhongMaterial:bi,MeshToonMaterial:Mi,MeshNormalMaterial:wi,MeshLambertMaterial:Si,MeshDepthMaterial:Ce,MeshDistanceMaterial:Ee,MeshBasicMaterial:A,MeshMatcapMaterial:Ti,LineDashedMaterial:Ai,LineBasicMaterial:Je,Material:T}),Mc={arraySlice:function(t,e,n){return Mc.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,n=Array(e),i=0;i!==e;++i)n[i]=i;return n.sort((function(e,n){return t[e]-t[n]})),n},sortedArray:function(t,e,n){for(var i=t.length,r=new t.constructor(i),a=0,o=0;o!==i;++a)for(var s=n[a]*e,c=0;c!==e;++c)r[o++]=t[s+c];return r},flattenJSON:function(t,e,n,i){for(var r=1,a=t[0];void 0!==a&&void 0===a[i];)a=t[r++];if(void 0!==a){var o=a[i];if(void 0!==o)if(Array.isArray(o))do{void 0!==(o=a[i])&&(e.push(a.time),n.push.apply(n,o)),a=t[r++]}while(void 0!==a);else if(void 0!==o.toArray)do{void 0!==(o=a[i])&&(e.push(a.time),o.toArray(n,n.length)),a=t[r++]}while(void 0!==a);else do{void 0!==(o=a[i])&&(e.push(a.time),n.push(o)),a=t[r++]}while(void 0!==a)}},subclip:function(t,e,n,i,r){r=r||30;var a=t.clone();a.name=e;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]*r;if(!(d<n||d>=i)){u.push(c.times[p]);for(var f=0;f<l;++f)h.push(c.values[p*l+f])}}0!==u.length&&(c.times=Mc.convertArray(u,c.times.constructor),c.values=Mc.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(Li.prototype,{evaluate:function(t){var e=this.parameterPositions,n=this._cachedIndex,i=e[n],r=e[n-1];t:{e:{var a;n:{i:if(!(t<i)){for(var o=n+2;;){if(void 0===i){if(t<r)break i;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,r)}if(n===o)break;if(r=i,t<(i=e[++n]))break e}a=e.length;break n}if(t>=r)break t;var s=e[1];for(t<s&&(n=2,r=s),o=n-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,i);if(n===o)break;if(i=r,t>=(r=e[--n-1]))break e}a=n,n=0}for(;n<a;){var c=n+a>>>1;t<e[c]?a=c:n=c+1}if(i=e[n],void 0===(r=e[n-1]))return this._cachedIndex=0,this.beforeStart_(0,t,i);if(void 0===i)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,r,t)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,t,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i,a=0;a!==i;++a)e[a]=n[r+a];return e},interpolate_:function(){throw Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Li.prototype,{beforeStart_:Li.prototype.copySampleValue_,afterEnd_:Li.prototype.copySampleValue_}),Ci.prototype=Object.assign(Object.create(Li.prototype),{constructor:Ci,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(t,e,n){var i=this.parameterPositions,r=t-2,a=t+1,o=i[r],s=i[a];if(void 0===o)switch(this.getSettings_().endingStart){case 2401:r=t,o=2*e-n;break;case 2402:o=e+i[r=i.length-2]-i[r+1];break;default:r=t,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:a=t,s=2*n-e;break;case 2402:a=1,s=n+i[1]-i[0];break;default:a=t-1,s=e}var c=.5*(n-e),l=this.valueSize;this._weightPrev=c/(e-o),this._weightNext=c/(s-n),this._offsetPrev=r*l,this._offsetNext=a*l},interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,c=s-o,l=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,p=this._weightNext,d=(n-e)/(i-e),f=d*d,m=f*d,v=-h*m+2*h*f-h*d,g=(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,_=0;_!==o;++_)r[_]=v*a[l+_]+g*a[c+_]+y*a[s+_]+x*a[u+_];return r}}),Ei.prototype=Object.assign(Object.create(Li.prototype),{constructor:Ei,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,c=s-o,l=(n-e)/(i-e),u=1-l,h=0;h!==o;++h)r[h]=a[c+h]*u+a[s+h]*l;return r}}),Pi.prototype=Object.assign(Object.create(Li.prototype),{constructor:Pi,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(Ni,{toJSON:function(t){var e,n=t.constructor;if(void 0!==n.toJSON)e=n.toJSON(t);else{e={name:t.name,times:Mc.convertArray(t.times,Array),values:Mc.convertArray(t.values,Array)};var i=t.getInterpolation();i!==t.DefaultInterpolation&&(e.interpolation=i)}return e.type=t.ValueTypeName,e}}),Object.assign(Ni.prototype,{constructor:Ni,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(t){return new Pi(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new Ei(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new Ci(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw Error(n);this.setInterpolation(this.DefaultInterpolation)}return this}return this.createInterpolant=e,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(t){if(0!==t)for(var e=this.times,n=0,i=e.length;n!==i;++n)e[n]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,n=0,i=e.length;n!==i;++n)e[n]*=t;return this},trim:function(t,e){for(var n=this.times,i=n.length,r=0,a=i-1;r!==i&&n[r]<t;)++r;for(;-1!==a&&n[a]>e;)--a;if(++a,0!==r||a!==i){r>=a&&(r=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=Mc.arraySlice(n,r,a),this.values=Mc.arraySlice(this.values,r*o,a*o)}return this},validate:function(){var t=1,e=this.getValueSize();e-Math.floor(e)!=0&&(t=0);var n=this.times,i=this.values,r=n.length;0===r&&(t=0);for(var a=null,o=0;o!==r;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){t=0;break}if(null!==a&&a>s){t=0;break}a=s}if(void 0!==i&&Mc.isTypedArray(i)){o=0;for(var c=i.length;o!==c;++o){var l=i[o];if(isNaN(l)){t=0;break}}}return t},optimize:function(){for(var t=Mc.arraySlice(this.times),e=Mc.arraySlice(this.values),n=this.getValueSize(),i=2302===this.getInterpolation(),r=1,a=t.length-1,o=1;o<a;++o){var s=0,c=t[o];if(c!==t[o+1]&&(1!==o||c!==c[0]))if(i)s=1;else for(var l=o*n,u=l-n,h=l+n,p=0;p!==n;++p){var d=e[l+p];if(d!==e[u+p]||d!==e[h+p]){s=1;break}}if(s){if(o!==r){t[r]=t[o];var f=o*n,m=r*n;for(p=0;p!==n;++p)e[m+p]=e[f+p]}++r}}if(a>0){for(t[r]=t[a],f=a*n,m=r*n,p=0;p!==n;++p)e[m+p]=e[f+p];++r}return r!==t.length?(this.times=Mc.arraySlice(t,0,r),this.values=Mc.arraySlice(e,0,r*n)):(this.times=t,this.values=e),this},clone:function(){var t=Mc.arraySlice(this.times,0),e=Mc.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}),Oi.prototype=Object.assign(Object.create(Ni.prototype),{constructor:Oi,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Di.prototype=Object.assign(Object.create(Ni.prototype),{constructor:Di,ValueTypeName:"color"}),Ii.prototype=Object.assign(Object.create(Ni.prototype),{constructor:Ii,ValueTypeName:"number"}),zi.prototype=Object.assign(Object.create(Li.prototype),{constructor:zi,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,c=t*o,l=(n-e)/(i-e),u=c+o;c!==u;c+=4)s.slerpFlat(r,0,a,c-o,a,c,l);return r}}),Ri.prototype=Object.assign(Object.create(Ni.prototype),{constructor:Ri,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(t){return new zi(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Fi.prototype=Object.assign(Object.create(Ni.prototype),{constructor:Fi,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ki.prototype=Object.assign(Object.create(Ni.prototype),{constructor:ki,ValueTypeName:"vector"}),Object.assign(Bi,{parse:function(t){for(var e=[],n=t.tracks,i=1/(t.fps||1),r=0,a=n.length;r!==a;++r)e.push(Ui(n[r]).scale(i));return new Bi(t.name,t.duration,e)},toJSON:function(t){for(var e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid},r=0,a=n.length;r!==a;++r)e.push(Ni.toJSON(n[r]));return i},CreateFromMorphTargetSequence:function(t,e,n,i){for(var r=e.length,a=[],o=0;o<r;o++){var s=[],c=[];s.push((o+r-1)%r,o,(o+1)%r),c.push(0,1,0);var l=Mc.getKeyframeOrder(s);s=Mc.sortedArray(s,1,l),c=Mc.sortedArray(c,1,l),i||0!==s[0]||(s.push(r),c.push(c[0])),a.push(new Ii(".morphTargetInfluences["+e[o].name+"]",s,c).scale(1/n))}return new Bi(t,-1,a)},findByName:function(t,e){var n=t;if(!Array.isArray(t)){var i=t;n=i.geometry&&i.geometry.animations||i.animations}for(var r=0;r<n.length;r++)if(n[r].name===e)return n[r];return null},CreateClipsFromMorphTargetSequences:function(t,e,n){for(var i={},r=/^([\w-]*?)([\d]+)$/,a=0,o=t.length;a<o;a++){var s=t[a],c=s.name.match(r);if(c&&c.length>1){var l=i[h=c[1]];l||(i[h]=l=[]),l.push(s)}}var u=[];for(var h in i)u.push(Bi.CreateFromMorphTargetSequence(h,i[h],e,n));return u},parseAnimation:function(t,e){if(!t)return null;for(var n=function(t,e,n,i,r){if(0!==n.length){var a=[],o=[];Mc.flattenJSON(n,a,o,i),0!==a.length&&r.push(new t(e,a,o))}},i=[],r=t.name||"default",a=t.length||-1,o=t.fps||30,s=t.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 v=l[h];f.push(v.time),m.push(v.morphTarget===d?1:0)}i.push(new Ii(".morphTargetInfluence["+d+"]",f,m))}a=u.length*(o||1)}else{var g=".bones["+e[c].name+"]";n(ki,g+".position",l,"pos",i),n(Ri,g+".quaternion",l,"rot",i),n(ki,g+".scale",l,"scl",i)}}return 0===i.length?null:new Bi(r,a,i)}}),Object.assign(Bi.prototype,{resetDuration:function(){for(var t=0,e=0,n=this.tracks.length;e!==n;++e){var i=this.tracks[e];t=Math.max(t,i.times[i.times.length-1])}return this.duration=t,this},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){for(var t=1,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},clone:function(){for(var t=[],e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new Bi(this.name,this.duration,t)}});var wc={enabled:0,files:{},add:function(t,e){0!=this.enabled&&(this.files[t]=e)},get:function(t){if(0!=this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}},Sc=new ji;Object.assign(Vi.prototype,{load:function(){},parse:function(){},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this}});var Tc={};Gi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Gi,load:function(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,a=wc.get(t);if(void 0!==a)return r.manager.itemStart(t),setTimeout((function(){e&&e(a),r.manager.itemEnd(t)}),0),a;if(void 0===Tc[t]){var o=t.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(){e&&e(u),r.manager.itemEnd(t)}),0)}catch(e){setTimeout((function(){i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}),0)}}else{Tc[t]=[],Tc[t].push({onLoad:e,onProgress:n,onError:i});var m=new XMLHttpRequest;for(var v in m.open("GET",t,1),m.addEventListener("load",(function(e){var n=this.response,i=Tc[t];if(delete Tc[t],200===this.status||0===this.status){this.status,wc.add(t,n);for(var a=0,o=i.length;a<o;a++)(s=i[a]).onLoad&&s.onLoad(n);r.manager.itemEnd(t)}else{for(a=0,o=i.length;a<o;a++){var s;(s=i[a]).onError&&s.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}}),0),m.addEventListener("progress",(function(e){for(var n=Tc[t],i=0,r=n.length;i<r;i++){var a=n[i];a.onProgress&&a.onProgress(e)}}),0),m.addEventListener("error",(function(e){var n=Tc[t];delete Tc[t];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onError&&o.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}),0),m.addEventListener("abort",(function(e){var n=Tc[t];delete Tc[t];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onError&&o.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}),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(v,this.requestHeader[v]);m.send(null)}return r.manager.itemStart(t),m}Tc[t].push({onLoad:e,onProgress:n,onError:i})},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}}),Wi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Wi,load:function(t,e,n,i){var r=this,a=new Gi(r.manager);a.setPath(r.path),a.load(t,(function(t){e(r.parse(JSON.parse(t)))}),n,i)},parse:function(t){for(var e=[],n=0;n<t.length;n++){var i=Bi.parse(t[n]);e.push(i)}return e}}),Hi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Hi,load:function(t,e,n,i){function r(r){c.load(t[r],(function(t){var n=a.parse(t,1);o[r]={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,e&&e(s))}),n,i)}var a=this,o=[],s=new an;s.image=o;var c=new Gi(this.manager);if(c.setPath(this.path),c.setResponseType("arraybuffer"),Array.isArray(t))for(var l=0,u=0,h=t.length;u<h;++u)r(u);else c.load(t,(function(t){var n=a.parse(t,1);if(n.isCubemap)for(var i=n.mipmaps.length/n.mipmapCount,r=0;r<i;r++){o[r]={mipmaps:[]};for(var c=0;c<n.mipmapCount;c++)o[r].mipmaps.push(n.mipmaps[r*n.mipmapCount+c]),o[r].format=n.format,o[r].width=n.width,o[r].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,e&&e(s)}),n,i);return s}}),qi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:qi,load:function(t,e,n,i){var r=this,a=new $,o=new Gi(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(t,(function(t){var n=r.parse(t);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,e&&e(a,n))}),n,i),a}}),Xi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Xi,load:function(t,e,n,i){function r(){c.removeEventListener("load",r,0),c.removeEventListener("error",a,0),wc.add(t,this),e&&e(this),o.manager.itemEnd(t)}function a(e){c.removeEventListener("load",r,0),c.removeEventListener("error",a,0),i&&i(e),o.manager.itemError(t),o.manager.itemEnd(t)}void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var o=this,s=wc.get(t);if(void 0!==s)return o.manager.itemStart(t),setTimeout((function(){e&&e(s),o.manager.itemEnd(t)}),0),s;var c=document.createElementNS("http://www.w3.org/1999/xhtml","img");return c.addEventListener("load",r,0),c.addEventListener("error",a,0),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(c.crossOrigin=this.crossOrigin),o.manager.itemStart(t),c.src=t,c}}),Yi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Yi,load:function(t,e,n,i){function r(n){o.load(t[n],(function(t){a.images[n]=t,6==++s&&(a.needsUpdate=1,e&&e(a))}),void 0,i)}var a=new ft,o=new Xi(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);for(var s=0,c=0;c<t.length;++c)r(c);return a}}),Zi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Zi,load:function(t,e,n,r){var a=new i,o=new Xi(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,(function(n){a.image=n;var i=t.search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/);a.format=i?1022:1023,a.needsUpdate=1,void 0!==e&&e(a)}),n,r),a}}),Object.assign(Ji.prototype,{getPoint:function(){return null},getPointAt:function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=0;var e,n,i=[],r=this.getPoint(0),a=0;for(i.push(0),n=1;n<=t;n++)a+=(e=this.getPoint(n/t)).distanceTo(r),i.push(a),r=e;return this.cacheArcLengths=i,i},updateArcLengths:function(){this.needsUpdate=1,this.getLengths()},getUtoTmapping:function(t,e){var n,i=this.getLengths(),r=0,a=i.length;n=e||t*i[a-1];for(var o,s=0,c=a-1;s<=c;)if((o=i[r=Math.floor(s+(c-s)/2)]-n)<0)s=r+1;else{if(!(o>0)){c=r;break}c=r-1}if(i[r=c]===n)return r/(a-1);var l=i[r];return(r+(n-l)/(i[r+1]-l))/(a-1)},getTangent:function(t){var e=t-1e-4,n=t+1e-4;e<0&&(e=0),n>1&&(n=1);var i=this.getPoint(e);return this.getPoint(n).clone().sub(i).normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var n,i,r,a=new c,o=[],s=[],u=[],h=new c,p=new l;for(n=0;n<=t;n++)i=n/t,o[n]=this.getTangentAt(i),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),v=Math.abs(o[0].z);for(f<=d&&(d=f,a.set(1,0,0)),m<=d&&(d=m,a.set(0,1,0)),v<=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<=t;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(),r=Math.acos(Pa.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(p.makeRotationAxis(h,r))),u[n].crossVectors(o[n],s[n]);if(1==e)for(r=Math.acos(Pa.clamp(s[0].dot(s[t]),-1,1)),r/=t,o[0].dot(h.crossVectors(s[0],s[t]))>0&&(r=-r),n=1;n<=t;n++)s[n].applyMatrix4(p.makeRotationAxis(o[n],r*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(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),$i.prototype=Object.create(Ji.prototype),$i.prototype.constructor=$i,$i.prototype.isEllipseCurve=1,$i.prototype.getPoint=function(t,n){for(var i=n||new e,r=2*Math.PI,a=this.aEndAngle-this.aStartAngle,o=Math.abs(a)<Number.EPSILON;a<0;)a+=r;for(;a>r;)a-=r;a<Number.EPSILON&&(a=o?0:r),1!=this.aClockwise||o||(a===r?a=-r:a-=r);var s=this.aStartAngle+t*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 i.set(c,l)},$i.prototype.copy=function(t){return Ji.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},$i.prototype.toJSON=function(){var t=Ji.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},$i.prototype.fromJSON=function(t){return Ji.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},Qi.prototype=Object.create($i.prototype),Qi.prototype.constructor=Qi,Qi.prototype.isArcCurve=1;var Ac=new c,Lc=new Ki,Cc=new Ki,Ec=new Ki;tr.prototype=Object.create(Ji.prototype),tr.prototype.constructor=tr,tr.prototype.isCatmullRomCurve3=1,tr.prototype.getPoint=function(t,e){var n,i,r,a,o=e||new c,s=this.points,l=s.length,u=(l-(this.closed?0:1))*t,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]:(Ac.subVectors(s[0],s[1]).add(s[0]),n=Ac),i=s[h%l],r=s[(h+1)%l],this.closed||h+2<l?a=s[(h+2)%l]:(Ac.subVectors(s[l-1],s[l-2]).add(s[l-1]),a=Ac),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,f=Math.pow(n.distanceToSquared(i),d),m=Math.pow(i.distanceToSquared(r),d),v=Math.pow(r.distanceToSquared(a),d);m<1e-4&&(m=1),f<1e-4&&(f=m),v<1e-4&&(v=m),Lc.initNonuniformCatmullRom(n.x,i.x,r.x,a.x,f,m,v),Cc.initNonuniformCatmullRom(n.y,i.y,r.y,a.y,f,m,v),Ec.initNonuniformCatmullRom(n.z,i.z,r.z,a.z,f,m,v)}else"catmullrom"===this.curveType&&(Lc.initCatmullRom(n.x,i.x,r.x,a.x,this.tension),Cc.initCatmullRom(n.y,i.y,r.y,a.y,this.tension),Ec.initCatmullRom(n.z,i.z,r.z,a.z,this.tension));return o.set(Lc.calc(p),Cc.calc(p),Ec.calc(p)),o},tr.prototype.copy=function(t){Ji.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},tr.prototype.toJSON=function(){var t=Ji.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},tr.prototype.fromJSON=function(t){Ji.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push((new c).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},rr.prototype=Object.create(Ji.prototype),rr.prototype.constructor=rr,rr.prototype.isCubicBezierCurve=1,rr.prototype.getPoint=function(t,n){var i=n||new e,r=this.v0,a=this.v1,o=this.v2,s=this.v3;return i.set(ir(t,r.x,a.x,o.x,s.x),ir(t,r.y,a.y,o.y,s.y)),i},rr.prototype.copy=function(t){return Ji.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},rr.prototype.toJSON=function(){var t=Ji.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},rr.prototype.fromJSON=function(t){return Ji.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},ar.prototype=Object.create(Ji.prototype),ar.prototype.constructor=ar,ar.prototype.isCubicBezierCurve3=1,ar.prototype.getPoint=function(t,e){var n=e||new c,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(ir(t,i.x,r.x,a.x,o.x),ir(t,i.y,r.y,a.y,o.y),ir(t,i.z,r.z,a.z,o.z)),n},ar.prototype.copy=function(t){return Ji.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},ar.prototype.toJSON=function(){var t=Ji.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},ar.prototype.fromJSON=function(t){return Ji.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},or.prototype=Object.create(Ji.prototype),or.prototype.constructor=or,or.prototype.isLineCurve=1,or.prototype.getPoint=function(t,n){var i=n||new e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i},or.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},or.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},or.prototype.copy=function(t){return Ji.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},or.prototype.toJSON=function(){var t=Ji.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},or.prototype.fromJSON=function(t){return Ji.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},sr.prototype=Object.create(Ji.prototype),sr.prototype.constructor=sr,sr.prototype.isLineCurve3=1,sr.prototype.getPoint=function(t,e){var n=e||new c;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},sr.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},sr.prototype.copy=function(t){return Ji.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},sr.prototype.toJSON=function(){var t=Ji.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},sr.prototype.fromJSON=function(t){return Ji.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},cr.prototype=Object.create(Ji.prototype),cr.prototype.constructor=cr,cr.prototype.isQuadraticBezierCurve=1,cr.prototype.getPoint=function(t,n){var i=n||new e,r=this.v0,a=this.v1,o=this.v2;return i.set(nr(t,r.x,a.x,o.x),nr(t,r.y,a.y,o.y)),i},cr.prototype.copy=function(t){return Ji.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},cr.prototype.toJSON=function(){var t=Ji.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},cr.prototype.fromJSON=function(t){return Ji.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},lr.prototype=Object.create(Ji.prototype),lr.prototype.constructor=lr,lr.prototype.isQuadraticBezierCurve3=1,lr.prototype.getPoint=function(t,e){var n=e||new c,i=this.v0,r=this.v1,a=this.v2;return n.set(nr(t,i.x,r.x,a.x),nr(t,i.y,r.y,a.y),nr(t,i.z,r.z,a.z)),n},lr.prototype.copy=function(t){return Ji.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},lr.prototype.toJSON=function(){var t=Ji.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},lr.prototype.fromJSON=function(t){return Ji.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},ur.prototype=Object.create(Ji.prototype),ur.prototype.constructor=ur,ur.prototype.isSplineCurve=1,ur.prototype.getPoint=function(t,n){var i=n||new e,r=this.points,a=(r.length-1)*t,o=Math.floor(a),s=a-o,c=r[0===o?o:o-1],l=r[o],u=r[o>r.length-2?r.length-1:o+1],h=r[o>r.length-3?r.length-1:o+2];return i.set(er(s,c.x,l.x,u.x,h.x),er(s,c.y,l.y,u.y,h.y)),i},ur.prototype.copy=function(t){Ji.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push(i.clone())}return this},ur.prototype.toJSON=function(){var t=Ji.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var i=this.points[e];t.points.push(i.toArray())}return t},ur.prototype.fromJSON=function(t){Ji.prototype.fromJSON.call(this,t),this.points=[];for(var n=0,i=t.points.length;n<i;n++){var r=t.points[n];this.points.push((new e).fromArray(r))}return this};var Pc=Object.freeze({__proto__:null,ArcCurve:Qi,CatmullRomCurve3:tr,CubicBezierCurve:rr,CubicBezierCurve3:ar,EllipseCurve:$i,LineCurve:or,LineCurve3:sr,QuadraticBezierCurve:cr,QuadraticBezierCurve3:lr,SplineCurve:ur});hr.prototype=Object.assign(Object.create(Ji.prototype),{constructor:hr,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new or(e,t))},getPoint:function(t){for(var e=t*this.getLength(),n=this.getCurveLengths(),i=0;i<n.length;){if(n[i]>=e){var r=n[i]-e,a=this.curves[i],o=a.getLength(),s=0===o?0:1-r/o;return a.getPointAt(s)}i++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.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 t=[],e=0,n=0,i=this.curves.length;n<i;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,n=[],i=0,r=this.curves;i<r.length;i++)for(var a=r[i],o=a&&a.isEllipseCurve?2*t:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?t*a.points.length:t,s=a.getPoints(o),c=0;c<s.length;c++){var l=s[c];e&&e.equals(l)||(n.push(l),e=l)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(t){Ji.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=Ji.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,n=this.curves.length;e<n;e++){var i=this.curves[e];t.curves.push(i.toJSON())}return t},fromJSON:function(t){Ji.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var i=t.curves[e];this.curves.push((new Pc[i.type]).fromJSON(i))}return this}}),pr.prototype=Object.assign(Object.create(hr.prototype),{constructor:pr,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this},moveTo:function(t,e){return this.currentPoint.set(t,e),this},lineTo:function(t,n){var i=new or(this.currentPoint.clone(),new e(t,n));return this.curves.push(i),this.currentPoint.set(t,n),this},quadraticCurveTo:function(t,n,i,r){var a=new cr(this.currentPoint.clone(),new e(t,n),new e(i,r));return this.curves.push(a),this.currentPoint.set(i,r),this},bezierCurveTo:function(t,n,i,r,a,o){var s=new rr(this.currentPoint.clone(),new e(t,n),new e(i,r),new e(a,o));return this.curves.push(s),this.currentPoint.set(a,o),this},splineThru:function(t){var e=new ur([this.currentPoint.clone()].concat(t));return this.curves.push(e),this.currentPoint.copy(t[t.length-1]),this},arc:function(t,e,n,i,r,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(t+o,e+s,n,i,r,a),this},absarc:function(t,e,n,i,r,a){return this.absellipse(t,e,n,n,i,r,a),this},ellipse:function(t,e,n,i,r,a,o,s){var c=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(t+c,e+l,n,i,r,a,o,s),this},absellipse:function(t,e,n,i,r,a,o,s){var c=new $i(t,e,n,i,r,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(t){return hr.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=hr.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return hr.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),dr.prototype=Object.assign(Object.create(pr.prototype),{constructor:dr,getPointsHoles:function(t){for(var e=[],n=0,i=this.holes.length;n<i;n++)e[n]=this.holes[n].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){pr.prototype.copy.call(this,t),this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var i=t.holes[e];this.holes.push(i.clone())}return this},toJSON:function(){var t=pr.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,n=this.holes.length;e<n;e++){var i=this.holes[e];t.holes.push(i.toJSON())}return t},fromJSON:function(t){pr.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var i=t.holes[e];this.holes.push((new pr).fromJSON(i))}return this}}),fr.prototype=Object.assign(Object.create(p.prototype),{constructor:fr,isLight:1,copy:function(t){return p.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=p.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),mr.prototype=Object.assign(Object.create(fr.prototype),{constructor:mr,isHemisphereLight:1,copy:function(t){return fr.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(vr.prototype,{_projScreenMatrix:new l,_lightPositionWorld:new c,_lookTarget:new c,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(t){var e=this.camera,n=this.matrix,i=this._projScreenMatrix,r=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(t.matrixWorld),e.position.copy(a),r.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(r),e.updateMatrixWorld(),i.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(i),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(e.projectionMatrix),n.multiply(e.matrixWorldInverse)},getViewport:function(t){return this._viewports[t]},getFrameExtents:function(){return this._frameExtents},copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(0).object,delete t.camera.matrix,t}}),gr.prototype=Object.assign(Object.create(vr.prototype),{constructor:gr,isSpotLightShadow:1,updateMatrices:function(t){var e=this.camera,n=2*Pa.RAD2DEG*t.angle,i=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;n===e.fov&&i===e.aspect&&r===e.far||(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix()),vr.prototype.updateMatrices.call(this,t)}}),yr.prototype=Object.assign(Object.create(fr.prototype),{constructor:yr,isSpotLight:1,copy:function(t){return fr.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),xr.prototype=Object.assign(Object.create(vr.prototype),{constructor:xr,isPointLightShadow:1,updateMatrices:function(t,e){void 0===e&&(e=0);var n=this.camera,i=this.matrix,r=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;r.setFromMatrixPosition(t.matrixWorld),n.position.copy(r),a.copy(n.position),a.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(a),n.updateMatrixWorld(),i.makeTranslation(-r.x,-r.y,-r.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}}),_r.prototype=Object.assign(Object.create(fr.prototype),{constructor:_r,isPointLight:1,copy:function(t){return fr.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),br.prototype=Object.assign(Object.create(X.prototype),{constructor:br,isOrthographicCamera:1,copy:function(t,e){return X.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,n,i,r,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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=0),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=n-t,a=n+t,o=i+e,s=i-e;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=(r+=c*this.view.offsetX)+c*this.view.width,s=(o-=l*this.view.offsetY)-l*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=p.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),Mr.prototype=Object.assign(Object.create(vr.prototype),{constructor:Mr,isDirectionalLightShadow:1,updateMatrices:function(t){vr.prototype.updateMatrices.call(this,t)}}),wr.prototype=Object.assign(Object.create(fr.prototype),{constructor:wr,isDirectionalLight:1,copy:function(t){return fr.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Sr.prototype=Object.assign(Object.create(fr.prototype),{constructor:Sr,isAmbientLight:1}),Tr.prototype=Object.assign(Object.create(fr.prototype),{constructor:Tr,isRectAreaLight:1,copy:function(t){return fr.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=fr.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),Ar.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Ar,load:function(t,e,n,i){var r=this,a=new Gi(r.manager);a.setPath(r.path),a.load(t,(function(t){e(r.parse(JSON.parse(t)))}),n,i)},parse:function(t){function i(t){return a[t],a[t]}var a=this.textures,o=new bc[t.type];if(void 0!==t.uuid&&(o.uuid=t.uuid),void 0!==t.name&&(o.name=t.name),void 0!==t.color&&o.color.setHex(t.color),void 0!==t.roughness&&(o.roughness=t.roughness),void 0!==t.metalness&&(o.metalness=t.metalness),void 0!==t.sheen&&(o.sheen=(new _).setHex(t.sheen)),void 0!==t.emissive&&o.emissive.setHex(t.emissive),void 0!==t.specular&&o.specular.setHex(t.specular),void 0!==t.shininess&&(o.shininess=t.shininess),void 0!==t.clearcoat&&(o.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(o.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.fog&&(o.fog=t.fog),void 0!==t.flatShading&&(o.flatShading=t.flatShading),void 0!==t.blending&&(o.blending=t.blending),void 0!==t.combine&&(o.combine=t.combine),void 0!==t.side&&(o.side=t.side),void 0!==t.opacity&&(o.opacity=t.opacity),void 0!==t.transparent&&(o.transparent=t.transparent),void 0!==t.alphaTest&&(o.alphaTest=t.alphaTest),void 0!==t.depthTest&&(o.depthTest=t.depthTest),void 0!==t.depthWrite&&(o.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(o.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(o.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(o.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(o.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(o.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(o.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(o.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(o.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(o.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(o.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(o.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(o.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(o.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(o.rotation=t.rotation),1!==t.linewidth&&(o.linewidth=t.linewidth),void 0!==t.dashSize&&(o.dashSize=t.dashSize),void 0!==t.gapSize&&(o.gapSize=t.gapSize),void 0!==t.scale&&(o.scale=t.scale),void 0!==t.polygonOffset&&(o.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(o.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(o.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(o.skinning=t.skinning),void 0!==t.morphTargets&&(o.morphTargets=t.morphTargets),void 0!==t.morphNormals&&(o.morphNormals=t.morphNormals),void 0!==t.dithering&&(o.dithering=t.dithering),void 0!==t.vertexTangents&&(o.vertexTangents=t.vertexTangents),void 0!==t.visible&&(o.visible=t.visible),void 0!==t.toneMapped&&(o.toneMapped=t.toneMapped),void 0!==t.userData&&(o.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?o.vertexColors=t.vertexColors>0?1:0:o.vertexColors=t.vertexColors),void 0!==t.uniforms)for(var s in t.uniforms){var u=t.uniforms[s];switch(o.uniforms[s]={},u.type){case"t":o.uniforms[s].value=i(u.value);break;case"c":o.uniforms[s].value=(new _).setHex(u.value);break;case"v2":o.uniforms[s].value=(new e).fromArray(u.value);break;case"v3":o.uniforms[s].value=(new c).fromArray(u.value);break;case"v4":o.uniforms[s].value=(new r).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!==t.defines&&(o.defines=t.defines),void 0!==t.vertexShader&&(o.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(o.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var h in t.extensions)o.extensions[h]=t.extensions[h];if(void 0!==t.shading&&(o.flatShading=1===t.shading),void 0!==t.size&&(o.size=t.size),void 0!==t.sizeAttenuation&&(o.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(o.map=i(t.map)),void 0!==t.matcap&&(o.matcap=i(t.matcap)),void 0!==t.alphaMap&&(o.alphaMap=i(t.alphaMap)),void 0!==t.bumpMap&&(o.bumpMap=i(t.bumpMap)),void 0!==t.bumpScale&&(o.bumpScale=t.bumpScale),void 0!==t.normalMap&&(o.normalMap=i(t.normalMap)),void 0!==t.normalMapType&&(o.normalMapType=t.normalMapType),void 0!==t.normalScale){var p=t.normalScale;0==Array.isArray(p)&&(p=[p,p]),o.normalScale=(new e).fromArray(p)}return void 0!==t.displacementMap&&(o.displacementMap=i(t.displacementMap)),void 0!==t.displacementScale&&(o.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(o.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(o.roughnessMap=i(t.roughnessMap)),void 0!==t.metalnessMap&&(o.metalnessMap=i(t.metalnessMap)),void 0!==t.emissiveMap&&(o.emissiveMap=i(t.emissiveMap)),void 0!==t.emissiveIntensity&&(o.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(o.specularMap=i(t.specularMap)),void 0!==t.envMap&&(o.envMap=i(t.envMap)),void 0!==t.envMapIntensity&&(o.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(o.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(o.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(o.lightMap=i(t.lightMap)),void 0!==t.lightMapIntensity&&(o.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(o.aoMap=i(t.aoMap)),void 0!==t.aoMapIntensity&&(o.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(o.gradientMap=i(t.gradientMap)),void 0!==t.clearcoatMap&&(o.clearcoatMap=i(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(o.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(o.clearcoatNormalMap=i(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(o.clearcoatNormalScale=(new e).fromArray(t.clearcoatNormalScale)),o},setTextures:function(t){return this.textures=t,this}});var Nc=function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)};Lr.prototype=Object.assign(Object.create(B.prototype),{constructor:Lr,isInstancedBufferGeometry:1,copy:function(t){return B.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t=B.prototype.toJSON.call(this);return t.maxInstancedCount=this.maxInstancedCount,t.isInstancedBufferGeometry=1,t}}),Cr.prototype=Object.assign(Object.create(L.prototype),{constructor:Cr,isInstancedBufferAttribute:1,copy:function(t){return L.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},toJSON:function(){var t=L.prototype.toJSON.call(this);return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=1,t}}),Er.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Er,load:function(t,e,n,i){var r=this,a=new Gi(r.manager);a.setPath(r.path),a.load(t,(function(t){e(r.parse(JSON.parse(t)))}),n,i)},parse:function(t){var e=t.isInstancedBufferGeometry?new Lr:new B,n=t.data.index;if(void 0!==n){var i=new Oc[n.type](n.array);e.setIndex(new L(i,1))}var r=t.data.attributes;for(var a in r){var o=r[a],s=(i=new Oc[o.type](o.array),new(o.isInstancedBufferAttribute?Cr:L)(i,o.itemSize,o.normalized));void 0!==o.name&&(s.name=o.name),e.setAttribute(a,s)}var l=t.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 L(i=new Oc[o.type](o.array),o.itemSize,o.normalized),void 0!==o.name&&(s.name=o.name),h.push(s);e.morphAttributes[a]=h}t.data.morphTargetsRelative&&(e.morphTargetsRelative=1);var f=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==f){p=0;for(var m=f.length;p!==m;++p){var g=f[p];e.addGroup(g.start,g.count,g.materialIndex)}}var y=t.data.boundingSphere;if(void 0!==y){var x=new c;void 0!==y.center&&x.fromArray(y.center),e.boundingSphere=new v(x,y.radius)}return t.name&&(e.name=t.name),t.userData&&(e.userData=t.userData),e}});var Oc={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};Pr.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Pr,load:function(t,e,n,i){var r=this,a=""===this.path?Nc(t):this.path;this.resourcePath=this.resourcePath||a;var o=new Gi(r.manager);o.setPath(this.path),o.load(t,(function(t){var n=null;try{n=JSON.parse(t)}catch(t){return void(void 0!==i&&i(t))}var a=n.metadata;void 0!==a&&void 0!==a.type&&"geometry"!==a.type.toLowerCase()&&r.parse(n,e)}),n,i)},parse:function(t,e){var n=this.parseShape(t.shapes),i=this.parseGeometries(t.geometries,n),r=this.parseImages(t.images,(function(){void 0!==e&&e(s)})),a=this.parseTextures(t.textures,r),o=this.parseMaterials(t.materials,a),s=this.parseObject(t.object,i,o);return t.animations&&(s.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(s),s},parseShape:function(t){var e={};if(void 0!==t)for(var n=0,i=t.length;n<i;n++){var r=(new dr).fromJSON(t[n]);e[r.uuid]=r}return e},parseGeometries:function(t,e){var n={};if(void 0!==t)for(var i=new Er,r=0,a=t.length;r<a;r++){var o,s=t[r];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new _c[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new _c[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new _c[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new _c[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 _c[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new _c[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 _c[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new _c[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new _c[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new _c[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new _c[s.type]((new Pc[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new _c[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new _c[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=e[s.shapes[l]];c.push(h)}o=new _c[s.type](c,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(c=[],l=0,u=s.shapes.length;l<u;l++)h=e[s.shapes[l]],c.push(h);var p=s.options.extrudePath;void 0!==p&&(s.options.extrudePath=(new Pc[p.type]).fromJSON(p)),o=new _c[s.type](c,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=i.parse(s);break;case"Geometry":break;default: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(t,e){var n={},i={};if(void 0!==t){var r=new Ar;r.setTextures(e);for(var a=0,o=t.length;a<o;a++){var s=t[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]=r.parse(u)),c.push(n[u.uuid])}i[s.uuid]=c}else void 0===n[s.uuid]&&(n[s.uuid]=r.parse(s)),i[s.uuid]=n[s.uuid]}}return i},parseAnimations:function(t){for(var e=[],n=0;n<t.length;n++){var i=t[n],r=Bi.parse(i);void 0!==i.uuid&&(r.uuid=i.uuid),e.push(r)}return e},parseImages:function(t,e){function n(t){return i.manager.itemStart(t),a.load(t,(function(){i.manager.itemEnd(t)}),void 0,(function(){i.manager.itemError(t),i.manager.itemEnd(t)}))}var i=this,r={};if(void 0!==t&&t.length>0){var a=new Xi(new ji(e));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=t.length;o<s;o++){var c=t[o],l=c.url;if(Array.isArray(l)){r[c.uuid]=[];for(var u=0,h=l.length;u<h;u++){var p=l[u],d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(p)?p:i.resourcePath+p;r[c.uuid].push(n(d))}}else d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:i.resourcePath+c.url,r[c.uuid]=n(d)}}return r},parseTextures:function(t,e){function n(t,e){return"number"==typeof t?t:e[t]}var r={};if(void 0!==t)for(var a=0,o=t.length;a<o;a++){var s,c=t[a];c.image,e[c.image],(s=Array.isArray(e[c.image])?new ft(e[c.image]):new i(e[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,Ic)),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],zc),s.wrapT=n(c.wrap[1],zc)),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,Rc)),void 0!==c.magFilter&&(s.magFilter=n(c.magFilter,Rc)),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),r[c.uuid]=s}return r},parseObject:function(t,e,n){function i(t){return e[t],e[t]}function r(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],i=0,r=t.length;i<r;i++){var a=t[i];n[a],e.push(n[a])}return e}return n[t],n[t]}}var a;switch(t.type){case"Scene":a=new d,void 0!==t.background&&Number.isInteger(t.background)&&(a.background=new _(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?a.fog=new Be(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(a.fog=new ke(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":a=new Y(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(a.focus=t.focus),void 0!==t.zoom&&(a.zoom=t.zoom),void 0!==t.filmGauge&&(a.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(a.filmOffset=t.filmOffset),void 0!==t.view&&(a.view=Object.assign({},t.view));break;case"OrthographicCamera":a=new br(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(a.zoom=t.zoom),void 0!==t.view&&(a.view=Object.assign({},t.view));break;case"AmbientLight":a=new Sr(t.color,t.intensity);break;case"DirectionalLight":a=new wr(t.color,t.intensity);break;case"PointLight":a=new _r(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":a=new Tr(t.color,t.intensity,t.width,t.height);break;case"SpotLight":a=new yr(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":a=new mr(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":case"Mesh":a=new U(o=i(t.geometry),s=r(t.material));break;case"InstancedMesh":var o=i(t.geometry),s=r(t.material),c=t.count,l=t.instanceMatrix;(a=new Ze(o,s,c)).instanceMatrix=new L(new Float32Array(l.array),16);break;case"LOD":a=new He;break;case"Line":a=new $e(i(t.geometry),r(t.material),t.mode);break;case"LineLoop":a=new Ke(i(t.geometry),r(t.material));break;case"LineSegments":a=new Qe(i(t.geometry),r(t.material));break;case"PointCloud":case"Points":a=new en(i(t.geometry),r(t.material));break;case"Sprite":a=new Ge(r(t.material));break;case"Group":a=new ze;break;default:a=new p}if(a.uuid=t.uuid,void 0!==t.name&&(a.name=t.name),void 0!==t.matrix?(a.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(a.matrixAutoUpdate=t.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(void 0!==t.position&&a.position.fromArray(t.position),void 0!==t.rotation&&a.rotation.fromArray(t.rotation),void 0!==t.quaternion&&a.quaternion.fromArray(t.quaternion),void 0!==t.scale&&a.scale.fromArray(t.scale)),void 0!==t.castShadow&&(a.castShadow=t.castShadow),void 0!==t.receiveShadow&&(a.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(a.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(a.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&a.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(a.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(a.visible=t.visible),void 0!==t.frustumCulled&&(a.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(a.renderOrder=t.renderOrder),void 0!==t.userData&&(a.userData=t.userData),void 0!==t.layers&&(a.layers.mask=t.layers),void 0!==t.children)for(var u=t.children,h=0;h<u.length;h++)a.add(this.parseObject(u[h],e,n));if("LOD"===t.type){void 0!==t.autoUpdate&&(a.autoUpdate=t.autoUpdate);for(var f=t.levels,m=0;m<f.length;m++){var v=f[m],g=a.getObjectByProperty("uuid",v.object);void 0!==g&&a.addLevel(g,v.distance)}}return a}});var Dc,Ic={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},zc={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},Rc={NearestFilter:1003,NearestMipmapNearestFilter:1004,NearestMipmapLinearFilter:1005,LinearFilter:1006,LinearMipmapNearestFilter:1007,LinearMipmapLinearFilter:1008};Nr.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Nr,setOptions:function(t){return this.options=t,this},load:function(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,a=wc.get(t);if(void 0!==a)return r.manager.itemStart(t),setTimeout((function(){e&&e(a),r.manager.itemEnd(t)}),0),a;fetch(t).then((function(t){return t.blob()})).then((function(t){return void 0===r.options?createImageBitmap(t):createImageBitmap(t,r.options)})).then((function(n){wc.add(t,n),e&&e(n),r.manager.itemEnd(t)})).catch((function(e){i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)})),r.manager.itemStart(t)}}),Object.assign(Or.prototype,{moveTo:function(t,e){return this.currentPath=new pr,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this},lineTo:function(t,e){return this.currentPath.lineTo(t,e),this},quadraticCurveTo:function(t,e,n,i){return this.currentPath.quadraticCurveTo(t,e,n,i),this},bezierCurveTo:function(t,e,n,i,r,a){return this.currentPath.bezierCurveTo(t,e,n,i,r,a),this},splineThru:function(t){return this.currentPath.splineThru(t),this},toShapes:function(t,e){function n(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n],a=new dr;a.curves=r.curves,e.push(a)}return e}function i(t,e){for(var n=e.length,i=0,r=n-1,a=0;a<n;r=a++){var o=e[r],s=e[a],c=s.x-o.x,l=s.y-o.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(o=e[a],c=-c,s=e[r],l=-l),t.y<o.y||t.y>s.y)continue;if(t.y===o.y){if(t.x===o.x)return 1}else{var u=l*(t.x-o.x)-c*(t.y-o.y);if(0===u)return 1;if(u<0)continue;i=!i}}else{if(t.y!==o.y)continue;if(s.x<=t.x&&t.x<=o.x||o.x<=t.x&&t.x<=s.x)return 1}}return i}var r=yc.isClockWise,a=this.subPaths;if(0===a.length)return[];if(1==e)return n(a);var o,s,c,l=[];if(1===a.length)return s=a[0],(c=new dr).curves=s.curves,l.push(c),l;var u=!r(a[0].getPoints());u=t?!u:u;var h,p,d=[],f=[],m=[],v=0;f[v]=void 0,m[v]=[];for(var g=0,y=a.length;g<y;g++)o=r(h=(s=a[g]).getPoints()),(o=t?!o:o)?(!u&&f[v]&&v++,f[v]={s:new dr,p:h},f[v].s.curves=s.curves,u&&v++,m[v]=[]):m[v].push({h:s,p:h[0]});if(!f[0])return n(a);if(f.length>1){for(var x=0,_=[],b=0,M=f.length;b<M;b++)d[b]=[];for(b=0,M=f.length;b<M;b++)for(var w=m[b],S=0;S<w.length;S++){for(var T=w[S],A=1,L=0;L<f.length;L++)i(T.p,f[L].p)&&(b!==L&&_.push({froms:b,tos:L,hole:S}),A?(A=0,d[L].push(T)):x=1);A&&d[b].push(T)}_.length>0&&(x||(m=d))}g=0;for(var C=f.length;g<C;g++){c=f[g].s,l.push(c);for(var E=0,P=(p=m[g]).length;E<P;E++)c.holes.push(p[E].h)}return l}}),Object.assign(Dr.prototype,{isFont:1,generateShapes:function(t,e){void 0===e&&(e=100);for(var n=[],i=function(t,e,n){for(var i=Array.from?Array.from(t):(t+"").split(""),r=e/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*r,o=[],s=0,c=0,l=0;l<i.length;l++){var u=i[l];if("\n"===u)s=0,c-=a;else{var h=Ir(u,r,s,c,n);s+=h.offsetX,o.push(h.path)}}return o}(t,e,this.data),r=0,a=i.length;r<a;r++)Array.prototype.push.apply(n,i[r].toShapes());return n}}),zr.prototype=Object.assign(Object.create(Vi.prototype),{constructor:zr,load:function(t,e,n,i){var r=this,a=new Gi(this.manager);a.setPath(this.path),a.load(t,(function(t){var n;try{n=JSON.parse(t)}catch(e){n=JSON.parse(t.substring(65,t.length-2))}var i=r.parse(n);e&&e(i)}),n,i)},parse:function(t){return new Dr(t)}});var Fc=function(){return void 0===Dc&&(Dc=new(window.AudioContext||window.webkitAudioContext)),Dc};Rr.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Rr,load:function(t,e,n,i){var r=new Gi(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.load(t,(function(t){var n=t.slice(0);Fc().decodeAudioData(n,(function(t){e(t)}))}),n,i)}}),Object.assign(Fr.prototype,{isSphericalHarmonics3:1,set:function(t){for(var e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this},zero:function(){for(var t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this},getAt:function(t,e){var n=t.x,i=t.y,r=t.z,a=this.coefficients;return e.copy(a[0]).multiplyScalar(.282095),e.addScaledVector(a[1],.488603*i),e.addScaledVector(a[2],.488603*r),e.addScaledVector(a[3],.488603*n),e.addScaledVector(a[4],n*i*1.092548),e.addScaledVector(a[5],i*r*1.092548),e.addScaledVector(a[6],.315392*(3*r*r-1)),e.addScaledVector(a[7],n*r*1.092548),e.addScaledVector(a[8],.546274*(n*n-i*i)),e},getIrradianceAt:function(t,e){var n=t.x,i=t.y,r=t.z,a=this.coefficients;return e.copy(a[0]).multiplyScalar(.886227),e.addScaledVector(a[1],1.023328*i),e.addScaledVector(a[2],1.023328*r),e.addScaledVector(a[3],1.023328*n),e.addScaledVector(a[4],.858086*n*i),e.addScaledVector(a[5],.858086*i*r),e.addScaledVector(a[6],.743125*r*r-.247708),e.addScaledVector(a[7],.858086*n*r),e.addScaledVector(a[8],.429043*(n*n-i*i)),e},add:function(t){for(var e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this},addScaledSH:function(t,e){for(var n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this},scale:function(t){for(var e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this},lerp:function(t,e){for(var n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this},equals:function(t){for(var e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return 0;return 1},copy:function(t){return this.set(t.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(t,e){void 0===e&&(e=0);for(var n=this.coefficients,i=0;i<9;i++)n[i].fromArray(t,e+3*i);return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);for(var n=this.coefficients,i=0;i<9;i++)n[i].toArray(t,e+3*i);return t}}),Object.assign(Fr,{getBasisAt:function(t,e){var n=t.x,i=t.y,r=t.z;e[0]=.282095,e[1]=.488603*i,e[2]=.488603*r,e[3]=.488603*n,e[4]=1.092548*n*i,e[5]=1.092548*i*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*n*r,e[8]=.546274*(n*n-i*i)}}),kr.prototype=Object.assign(Object.create(fr.prototype),{constructor:kr,isLightProbe:1,copy:function(t){return fr.prototype.copy.call(this,t),this.sh.copy(t.sh),this.intensity=t.intensity,this},toJSON:function(t){return fr.prototype.toJSON.call(this,t)}}),Br.prototype=Object.assign(Object.create(kr.prototype),{constructor:Br,isHemisphereLightProbe:1,copy:function(t){return kr.prototype.copy.call(this,t),this},toJSON:function(t){return kr.prototype.toJSON.call(this,t)}}),Ur.prototype=Object.assign(Object.create(kr.prototype),{constructor:Ur,isAmbientLightProbe:1,copy:function(t){return kr.prototype.copy.call(this,t),this},toJSON:function(t){return kr.prototype.toJSON.call(this,t)}});var kc=new l,Bc=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(t){var e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep;var n,i,r=t.projectionMatrix.clone(),a=e.eyeSep/2,o=a*e.near/e.focus,s=e.near*Math.tan(Pa.DEG2RAD*e.fov*.5)/e.zoom;Bc.elements[12]=-a,kc.elements[12]=a,n=-s*e.aspect+o,i=s*e.aspect+o,r.elements[0]=2*e.near/(i-n),r.elements[8]=(i+n)/(i-n),this.cameraL.projectionMatrix.copy(r),n=-s*e.aspect-o,i=s*e.aspect-o,r.elements[0]=2*e.near/(i-n),r.elements[8]=(i+n)/(i-n),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(Bc),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(kc)}}),Object.assign(jr.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 t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}});var Uc=new c,jc=new s,Vc=new c,Gc=new c;Vr.prototype=Object.assign(Object.create(p.prototype),{constructor:Vr,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(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:function(t){p.prototype.updateMatrixWorld.call(this,t);var e=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Uc,jc,Vc),Gc.set(0,0,-1).applyQuaternion(jc),e.positionX){var i=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(Uc.x,i),e.positionY.linearRampToValueAtTime(Uc.y,i),e.positionZ.linearRampToValueAtTime(Uc.z,i),e.forwardX.linearRampToValueAtTime(Gc.x,i),e.forwardY.linearRampToValueAtTime(Gc.y,i),e.forwardZ.linearRampToValueAtTime(Gc.z,i),e.upX.linearRampToValueAtTime(n.x,i),e.upY.linearRampToValueAtTime(n.y,i),e.upZ.linearRampToValueAtTime(n.z,i)}else e.setPosition(Uc.x,Uc.y,Uc.z),e.setOrientation(Gc.x,Gc.y,Gc.z,n.x,n.y,n.z)}}),Gr.prototype=Object.assign(Object.create(p.prototype),{constructor:Gr,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=0,this.sourceType="audioNode",this.source=t,this.connect(),this},setMediaElementSource:function(t){return this.hasPlaybackControl=0,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},setMediaStreamSource:function(t){return this.hasPlaybackControl=0,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(t){if(void 0===t&&(t=0),1!=this.isPlaying&&0!=this.hasPlaybackControl){this._startedAt=this.context.currentTime+t;var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._pausedAt+this.offset,this.duration),this.isPlaying=1,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}},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},stop:function(){if(0!=this.hasPlaybackControl)return this._pausedAt=0,this.source.stop(),this.source.onended=null,this.isPlaying=0,this},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t||(t=[]),1==this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},setDetune:function(t){if(this.detune=t,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(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){if(0!=this.hasPlaybackControl)return this.playbackRate=t,1==this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=0},getLoop:function(){return 0==this.hasPlaybackControl?0:this.loop},setLoop:function(t){if(0!=this.hasPlaybackControl)return this.loop=t,1==this.isPlaying&&(this.source.loop=this.loop),this},setLoopStart:function(t){return this.loopStart=t,this},setLoopEnd:function(t){return this.loopEnd=t,this},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}});var Wc=new c,Hc=new s,qc=new c,Xc=new c;Wr.prototype=Object.assign(Object.create(Gr.prototype),{constructor:Wr,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){return this.panner.refDistance=t,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){return this.panner.rolloffFactor=t,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){return this.panner.distanceModel=t,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){return this.panner.maxDistance=t,this},setDirectionalCone:function(t,e,n){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(t){if(p.prototype.updateMatrixWorld.call(this,t),1!=this.hasPlaybackControl||0!=this.isPlaying){this.matrixWorld.decompose(Wc,Hc,qc),Xc.set(0,0,1).applyQuaternion(Hc);var e=this.panner;if(e.positionX){var n=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(Wc.x,n),e.positionY.linearRampToValueAtTime(Wc.y,n),e.positionZ.linearRampToValueAtTime(Wc.z,n),e.orientationX.linearRampToValueAtTime(Xc.x,n),e.orientationY.linearRampToValueAtTime(Xc.y,n),e.orientationZ.linearRampToValueAtTime(Xc.z,n)}else e.setPosition(Wc.x,Wc.y,Wc.z),e.setOrientation(Xc.x,Xc.y,Xc.z)}}}),Object.assign(Hr.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),n=0;n<e.length;n++)t+=e[n];return t/e.length}}),Object.assign(qr.prototype,{accumulate:function(t,e){var n=this.buffer,i=this.valueSize,r=t*i+i,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==i;++o)n[r+o]=n[o];a=e}else{var s=e/(a+=e);this._mixBufferRegion(n,r,0,s,i)}this.cumulativeWeight=a},apply:function(t){var e=this.valueSize,n=this.buffer,i=t*e+e,r=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,r<1){var o=3*e;this._mixBufferRegion(n,i,o,1-r,e)}for(var s=e,c=e+e;s!==c;++s)if(n[s]!==n[s+e]){a.setValue(n,i);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,n=this.valueSize,i=3*n;t.getValue(e,i);for(var r=n,a=i;r!==a;++r)e[r]=e[i+r%n];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,n,i,r){if(i>=.5)for(var a=0;a!==r;++a)t[e+a]=t[n+a]},_slerp:function(t,e,n,i){s.slerpFlat(t,e,t,e,t,n,i)},_lerp:function(t,e,n,i,r){for(var a=1-i,o=0;o!==r;++o){var s=e+o;t[s]=t[s]*a+t[n+o]*i}}});var Yc=/[\[\]\.:\/]/g,Zc=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Jc=/(WCOD+)?/.source.replace("WCOD","[^\\[\\]:\\/]"),$c=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Qc=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Kc=RegExp("^"+Zc+Jc+$c+Qc+"$"),tl=["material","materials","bones"];Object.assign(Xr.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(Yr,{Composite:Xr,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new Yr.Composite(t,e,n):new Yr(t,e,n)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(Yc,"")},parseTrackName:function(t){var e=Kc.exec(t);if(!e)throw Error("PropertyBinding: Cannot parse trackName: "+t);var n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){var r=n.nodeName.substring(i+1);-1!==tl.indexOf(r)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(null===n.propertyName||0===n.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n},findNode:function(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){var i=function(t){for(var n=0;n<t.length;n++){var r=t[n];if(r.name===e||r.uuid===e)return r;var a=i(r.children);if(a)return a}return null},r=i(t.children);if(r)return r}return null}}),Object.assign(Yr.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)t[e++]=n[i]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=1},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=1}],[function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++]},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.needsUpdate=1},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=1}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=1},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=1}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=1},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=1}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,n=e.objectName,i=e.propertyName,r=e.propertyIndex;if(t||(t=Yr.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var a=e.objectIndex;switch(n){case"materials":if(!t.material)return;if(!t.material.materials)return;t=t.material.materials;break;case"bones":if(!t.skeleton)return;t=t.skeleton.bones;for(var o=0;o<t.length;o++)if(t[o].name===a){a=o;break}break;default:if(void 0===t[n])return;t=t[n]}if(void 0!==a){if(void 0===t[a])return;t=t[a]}}var s=t[i];if(void 0!==s){var c=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?c=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate);var l=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!t.geometry)return;if(t.geometry.isBufferGeometry){if(!t.geometry.morphAttributes)return;for(o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(t.geometry.morphAttributes.position[o].name===r){r=o;break}}else{if(!t.geometry.morphTargets)return;for(o=0;o<this.node.geometry.morphTargets.length;o++)if(t.geometry.morphTargets[o].name===r){r=o;break}}}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}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=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][c]}else e.nodeName}},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Yr.prototype,{_getValue_unbound:Yr.prototype.getValue,_setValue_unbound:Yr.prototype.setValue}),Object.assign(function(){this.uuid=Pa.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}.prototype,{isAnimationObjectGroup:1,add:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,c=0,l=arguments.length;c!==l;++c){var u=arguments[c],h=u.uuid,p=i[h];if(void 0===p){p=e++,i[h]=p,t.push(u);for(var d=0,f=s;d!==f;++d)o[d].push(new Yr(u,r[d],a[d]))}else if(p<n){t[p];var m=--n,v=t[m];for(i[v.uuid]=p,t[p]=v,i[h]=m,t[m]=u,d=0,f=s;d!==f;++d){var g=o[d],y=g[m],x=g[p];g[p]=y,void 0===x&&(x=new Yr(u,r[d],a[d])),g[m]=x}}else t[p]}this.nCachedObjects_=n},remove:function(){for(var t=this._objects,e=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,r=i.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],c=s.uuid,l=n[c];if(void 0!==l&&l>=e){var u=e++,h=t[u];n[h.uuid]=l,t[l]=h,n[c]=u,t[u]=s;for(var p=0,d=r;p!==d;++p){var f=i[p],m=f[u],v=f[l];f[l]=m,f[u]=v}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._bindings,a=r.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o],l=c.uuid,u=i[l];if(void 0!==u)if(delete i[l],u<n){var h=--n,p=t[h],d=t[y=--e];i[p.uuid]=u,t[u]=p,i[d.uuid]=h,t[h]=d,t.pop();for(var f=0,m=a;f!==m;++f){var v=(x=r[f])[h],g=x[y];x[u]=v,x[h]=g,x.pop()}}else{var y;for(i[(d=t[y=--e]).uuid]=u,t[u]=d,t.pop(),f=0,m=a;f!==m;++f){var x;(x=r[f])[u]=x[y],x.pop()}}}this.nCachedObjects_=n},subscribe_:function(t,e){var n=this._bindingsIndicesByPath,i=n[t],r=this._bindings;if(void 0!==i)return r[i];var a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,l=this.nCachedObjects_,u=Array(c);i=r.length,n[t]=i,a.push(t),o.push(e),r.push(u);for(var h=l,p=s.length;h!==p;++h){var d=s[h];u[h]=new Yr(d,t,e)}return u},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){var i=this._paths,r=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];e[t[o]]=n,a[n]=s,a.pop(),r[n]=r[o],r.pop(),i[n]=i[o],i.pop()}}}),Object.assign(Zr.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(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){var i=this._clip.duration,r=t._clip.duration,a=r/i,o=i/r;t.warp(1,a,e),this.warp(o,1,e)}return this},crossFadeTo:function(t,e,n){return t.crossFadeFrom(this,e,n)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,n){var i=this._mixer,r=i.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,c=a.sampleValues;return s[0]=r,s[1]=r+n,c[0]=t/o,c[1]=e/o,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,n,i){if(this.enabled){var r=this._startTime;if(null!==r){var a=(t-r)*n;if(a<0||0===n)return;this._startTime=null,e=n*a}e*=this._updateTimeScale(t);var o=this._updateTime(e),s=this._updateWeight(t);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(i,s)}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=0))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;null!==n&&(e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=1:this.timeScale=e))}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t,n=this._clip.duration,i=this.loop,r=this._loopCount,a=2202===i;if(0===t)return-1===r?e:a&&1==(1&r)?n-e:e;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(1,1,0));t:{if(e>=n)e=n;else{if(!(e<0)){this.time=e;break t}e=0}this.clampWhenFinished?this.paused=1:this.enabled=0,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(1,0===this.repetitions,a)):this._setEndings(0===this.repetitions,1,a)),e>=n||e<0){var o=Math.floor(e/n);e-=n*o,r+=Math.abs(o);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=1:this.enabled=0,e=t>0?n:0,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){var c=t<0;this._setEndings(c,!c,a)}else this._setEndings(0,0,a);this._loopCount=r,this.time=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=e;if(a&&1==(1&r))return n-e}return e},_setEndings:function(t,e,n){var i=this._interpolantSettings;n?(i.endingStart=2401,i.endingEnd=2401):(i.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,i.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(t,e,n){var i=this._mixer,r=i.time,a=this._weightInterpolant;null===a&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=r,s[0]=e,o[1]=r+t,s[1]=n,this}}),Jr.prototype=Object.assign(Object.create(t.prototype),{constructor:Jr,_bindAction:function(t,e){var n=t._localRoot||this._root,i=t._clip.tracks,r=i.length,a=t._propertyBindings,o=t._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];void 0===l&&(l={},c[s]=l);for(var u=0;u!==r;++u){var h=i[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=e&&e._propertyBindings[u].binding.parsedPath;++(d=new qr(Yr.create(n,p,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(d,s,p),a[u]=d}o[u].resultBuffer=d.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,i=this._actionsByClip[n];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,n,e)}for(var r=t._propertyBindings,a=0,o=r.length;a!==o;++a){var s=r[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,n){var i=this._actions,r=this._actionsByClip,a=r[e];if(void 0===a)a={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=a;else{var o=a.knownActions;t._byClipCacheIndex=o.length,o.push(t)}t._cacheIndex=i.length,i.push(t),a.actionByRoot[n]=t},_removeInactiveAction:function(t){var e=this._actions,n=e[e.length-1],i=t._cacheIndex;n._cacheIndex=i,e[i]=n,e.pop(),t._cacheIndex=null;var r=t._clip.uuid,a=this._actionsByClip,o=a[r],s=o.knownActions,c=s[s.length-1],l=t._byClipCacheIndex;c._byClipCacheIndex=l,s[l]=c,s.pop(),t._byClipCacheIndex=null,delete o.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete a[r],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0==--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(t){var e=this._actions,n=t._cacheIndex,i=this._nActiveActions++,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_takeBackAction:function(t){var e=this._actions,n=t._cacheIndex,i=--this._nActiveActions,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_addInactiveBinding:function(t,e,n){var i=this._bindingsByRootAndName,r=i[e],a=this._bindings;void 0===r&&(r={},i[e]=r),r[n]=t,t._cacheIndex=a.length,a.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,n=t.binding,i=n.rootNode.uuid,r=n.path,a=this._bindingsByRootAndName,o=a[i],s=e[e.length-1],c=t._cacheIndex;s._cacheIndex=c,e[c]=s,e.pop(),delete o[r],0===Object.keys(o).length&&delete a[i]},_lendBinding:function(t){var e=this._bindings,n=t._cacheIndex,i=this._nActiveBindings++,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_takeBackBinding:function(t){var e=this._bindings,n=t._cacheIndex,i=--this._nActiveBindings,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,n=t[e];return void 0===n&&((n=new Ei(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e,t[e]=n),n},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,n=t.__cacheIndex,i=--this._nActiveControlInterpolants,r=e[i];t.__cacheIndex=i,e[i]=t,r.__cacheIndex=n,e[n]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e){var n=e||this._root,i=n.uuid,r="string"==typeof t?Bi.findByName(n,t):t,a=null!==r?r.uuid:t,o=this._actionsByClip[a],s=null;if(void 0!==o){var c=o.actionByRoot[i];if(void 0!==c)return c;s=o.knownActions[0],null===r&&(r=s._clip)}if(null===r)return null;var l=new Zr(this,r,e);return this._bindAction(l,s),this._addInactiveAction(l,a,i),l},existingAction:function(t,e){var n=e||this._root,i=n.uuid,r="string"==typeof t?Bi.findByName(n,t):t,a=r?r.uuid:t,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[i]||null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,n=this._bindings,i=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var r=0;r!==e;++r)t[r].reset();for(r=0;r!==i;++r)n[r].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),a=this._accuIndex^=1,o=0;o!==n;++o)e[o]._update(i,t,r,a);var s=this._bindings,c=this._nActiveBindings;for(o=0;o!==c;++o)s[o].apply(a);return this},setTime:function(t){this.time=0;for(var e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(t)},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,n=t.uuid,i=this._actionsByClip,r=i[n];if(void 0!==r){for(var a=r.knownActions,o=0,s=a.length;o!==s;++o){var c=a[o];this._deactivateAction(c);var l=c._cacheIndex,u=e[e.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,u._cacheIndex=l,e[l]=u,e.pop(),this._removeInactiveBindingsForAction(c)}delete i[n]}},uncacheRoot:function(t){var e=t.uuid,n=this._actionsByClip;for(var i in n){var r=n[i].actionByRoot[e];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}var a=this._bindingsByRootAndName[e];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(t,e){var n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),$r.prototype.clone=function(){return new $r(void 0===this.value.clone?this.value:this.value.clone())},Qr.prototype=Object.assign(Object.create(Ue.prototype),{constructor:Qr,isInstancedInterleavedBuffer:1,copy:function(t){return Ue.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(Kr.prototype,{set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e&&e.isOrthographicCamera&&(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e)},intersectObject:function(t,e,n){var i=n||[];return ea(t,this,i,e),i.sort(ta),i},intersectObjects:function(t,e,n){var i=n||[];if(0==Array.isArray(t))return i;for(var r=0,a=t.length;r<a;r++)ea(t[r],this,i,e);return i.sort(ta),i}}),Object.assign(function(t,e,n){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==n?n:0,this}.prototype,{set:function(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(Pa.clamp(e/this.radius,-1,1))),this}}),Object.assign(function(t,e,n){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==n?n:0,this}.prototype,{set:function(t,e,n){return this.radius=t,this.theta=e,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+n*n),this.theta=Math.atan2(t,n),this.y=e,this}});var el=new e;Object.assign(na.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(t,e){var n=el.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){return void 0===t&&(t=new e),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(t=new e),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y?0:1},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,n){return void 0===n&&(n=new e),n.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y?0:1},clampPoint:function(t,n){return void 0===n&&(n=new e),n.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return el.copy(t).clamp(this.min,this.max).sub(t).length()},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var nl=new c,il=new c;Object.assign(ia.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(t=new c),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(t=new c),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(e=new c),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,e){nl.subVectors(t,this.start),il.subVectors(this.end,this.start);var n=il.dot(il),i=il.dot(nl)/n;return e&&(i=Pa.clamp(i,0,1)),i},closestPointToPoint:function(t,e,n){var i=this.closestPointToPointParameter(t,e);return void 0===n&&(n=new c),this.delta(n).multiplyScalar(i).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),ra.prototype=Object.create(p.prototype),ra.prototype.constructor=ra,ra.prototype.isImmediateRenderObject=1;var rl=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 t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),rl.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(rl),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var al=new c,ol=new l,sl=new l;oa.prototype=Object.create(Qe.prototype),oa.prototype.constructor=oa,oa.prototype.isSkeletonHelper=1,oa.prototype.updateMatrixWorld=function(t){var e=this.bones,n=this.geometry,i=n.getAttribute("position");sl.getInverse(this.root.matrixWorld);for(var r=0,a=0;r<e.length;r++){var o=e[r];o.parent&&o.parent.isBone&&(ol.multiplyMatrices(sl,o.matrixWorld),al.setFromMatrixPosition(ol),i.setXYZ(a,al.x,al.y,al.z),ol.multiplyMatrices(sl,o.parent.matrixWorld),al.setFromMatrixPosition(ol),i.setXYZ(a+1,al.x,al.y,al.z),a+=2)}n.getAttribute("position").needsUpdate=1,p.prototype.updateMatrixWorld.call(this,t)},sa.prototype=Object.create(U.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 cl=new c,ll=new _,ul=new _;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 t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var e=t.geometry.getAttribute("color");ll.copy(this.light.color),ul.copy(this.light.groundColor);for(var n=0,i=e.count;n<i;n++){var r=n<i/2?ll:ul;e.setXYZ(n,r.r,r.g,r.b)}e.needsUpdate=1}t.lookAt(cl.setFromMatrixPosition(this.light.matrixWorld).negate())},la.prototype=Object.assign(Object.create(Qe.prototype),{constructor:la,copy:function(t){return Qe.prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}}),ua.prototype=Object.create(Qe.prototype),ua.prototype.constructor=ua;var hl=new c,pl=new c,dl=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(){hl.setFromMatrixPosition(this.light.matrixWorld),pl.setFromMatrixPosition(this.light.target.matrixWorld),dl.subVectors(pl,hl),this.lightPlane.lookAt(pl),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(pl),this.targetLine.scale.z=dl.length()};var fl=new c,ml=new X;pa.prototype=Object.create(Qe.prototype),pa.prototype.constructor=pa,pa.prototype.update=function(){var t=this.geometry,e=this.pointMap;ml.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),da("c",e,t,ml,0,0,-1),da("t",e,t,ml,0,0,1),da("n1",e,t,ml,-1,-1,-1),da("n2",e,t,ml,1,-1,-1),da("n3",e,t,ml,-1,1,-1),da("n4",e,t,ml,1,1,-1),da("f1",e,t,ml,-1,-1,1),da("f2",e,t,ml,1,-1,1),da("f3",e,t,ml,-1,1,1),da("f4",e,t,ml,1,1,1),da("u1",e,t,ml,.7,1.1,-1),da("u2",e,t,ml,-.7,1.1,-1),da("u3",e,t,ml,0,2,-1),da("cf1",e,t,ml,-1,0,1),da("cf2",e,t,ml,1,0,1),da("cf3",e,t,ml,0,-1,1),da("cf4",e,t,ml,0,1,1),da("cn1",e,t,ml,-1,0,-1),da("cn2",e,t,ml,1,0,-1),da("cn3",e,t,ml,0,-1,-1),da("cn4",e,t,ml,0,1,-1),t.getAttribute("position").needsUpdate=1};var vl=new f;fa.prototype=Object.create(Qe.prototype),fa.prototype.constructor=fa,fa.prototype.update=function(){if(void 0!==this.object&&vl.setFromObject(this.object),!vl.isEmpty()){var t=vl.min,e=vl.max,n=this.geometry.attributes.position,i=n.array;i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=t.x,i[4]=e.y,i[5]=e.z,i[6]=t.x,i[7]=t.y,i[8]=e.z,i[9]=e.x,i[10]=t.y,i[11]=e.z,i[12]=e.x,i[13]=e.y,i[14]=t.z,i[15]=t.x,i[16]=e.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=e.x,i[22]=t.y,i[23]=t.z,n.needsUpdate=1,this.geometry.computeBoundingSphere()}},fa.prototype.setFromObject=function(t){return this.object=t,this.update(),this},fa.prototype.copy=function(t){return Qe.prototype.copy.call(this,t),this.object=t.object,this},fa.prototype.clone=function(){return(new this.constructor).copy(this)},ma.prototype=Object.create(Qe.prototype),ma.prototype.constructor=ma,ma.prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),p.prototype.updateMatrixWorld.call(this,t))},va.prototype=Object.create($e.prototype),va.prototype.constructor=va,va.prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?1:0,this.lookAt(this.plane.normal),p.prototype.updateMatrixWorld.call(this,t)};var gl,yl,xl=new c;ga.prototype=Object.create(p.prototype),ga.prototype.constructor=ga,ga.prototype.setDirection=function(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{xl.set(t.z,0,-t.x).normalize();var e=Math.acos(t.y);this.quaternion.setFromAxisAngle(xl,e)}},ga.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},ga.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},ga.prototype.copy=function(t){return p.prototype.copy.call(this,t,0),this.line.copy(t.line),this.cone.copy(t.cone),this},ga.prototype.clone=function(){return(new this.constructor).copy(this)},ya.prototype=Object.create(Qe.prototype),ya.prototype.constructor=ya;var _l=[.125,.215,.35,.446,.526,.582],bl=5+_l.length,Ml={3e3:0,3001:1,3002:2,3004:3,3005:4,3006:5,3007:6},{_lodPlanes:wl,_sizeLods:Sl,_sigmas:Tl}=(new br,new yi({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:Ml[3e3]},outputEncoding:{value:Ml[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 t=[],e=[],n=[],i=8,r=0;r<bl;r++){e.push(256);var a=1/256;r>4?a=_l[r-8+4-1]:0==r&&(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 v=new B;v.setAttribute("position",new L(l,3)),v.setAttribute("uv",new L(u,2)),v.setAttribute("faceIndex",new L(h,1)),t.push(v),i>4&&i--}return{_lodPlanes:t,_sizeLods:e,_sigmas:n}}());Ji.create=function(t,e){return t.prototype=Object.create(Ji.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(hr.prototype,{createPointsGeometry:function(t){var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){for(var e=new G,n=0,i=t.length;n<i;n++){var r=t[n];e.vertices.push(new c(r.x,r.y,r.z||0))}return e}}),Object.assign(pr.prototype,{fromPoints:function(t){return this.setFromPoints(t)}}),xa.prototype=Object.create(tr.prototype),Object.assign(xa.prototype,{initFromArray:function(){},getControlPointsArray:function(){},reparametrizeByArcLength:function(){}}),la.prototype.setColors=function(){},oa.prototype.update=function(){},Object.assign(Vi.prototype,{extractUrlBase:function(t){return Nc(t)}}),Vi.Handlers={add:function(){},get:function(){}},Object.assign(Pr.prototype,{setTexturePath:function(t){return this.setResourcePath(t)}}),Object.assign(na.prototype,{center:function(t){return this.getCenter(t)},empty:function(){return this.isEmpty()},isIntersectionBox:function(t){return this.intersectsBox(t)},size:function(t){return this.getSize(t)}}),Object.assign(f.prototype,{center:function(t){return this.getCenter(t)},empty:function(){return this.isEmpty()},isIntersectionBox:function(t){return this.intersectsBox(t)},isIntersectionSphere:function(t){return this.intersectsSphere(t)},size:function(t){return this.getSize(t)}}),Q.prototype.setFromMatrix=function(t){return this.setFromProjectionMatrix(t)},ia.prototype.center=function(t){return this.getCenter(t)},Object.assign(Pa,{random16:function(){return Math.random()},nearestPowerOfTwo:function(t){return Pa.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return Pa.ceilPowerOfTwo(t)}}),Object.assign(n.prototype,{flattenToArrayOffset:function(t,e){return this.toArray(t,e)},multiplyVector3:function(t){return t.applyMatrix3(this)},multiplyVector3Array:function(){},applyToBufferAttribute:function(t){return t.applyMatrix3(this)},applyToVector3Array:function(){}}),Object.assign(l.prototype,{extractPosition:function(t){return this.copyPosition(t)},flattenToArrayOffset:function(t,e){return this.toArray(t,e)},getPosition:function(){return(new c).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return this.makeRotationFromQuaternion(t)},multiplyToArray:function(){},multiplyVector3:function(t){return t.applyMatrix4(this)},multiplyVector4:function(t){return t.applyMatrix4(this)},multiplyVector3Array:function(){},rotateAxis:function(t){t.transformDirection(this)},crossVector:function(t){return t.applyMatrix4(this)},translate:function(){},rotateX:function(){},rotateY:function(){},rotateZ:function(){},rotateByAxis:function(){},applyToBufferAttribute:function(t){return t.applyMatrix4(this)},applyToVector3Array:function(){},makeFrustum:function(t,e,n,i,r,a){return this.makePerspective(t,e,i,n,r,a)}}),y.prototype.isIntersectionLine=function(t){return this.intersectsLine(t)},s.prototype.multiplyVector3=function(t){return t.applyQuaternion(this)},Object.assign(g.prototype,{isIntersectionBox:function(t){return this.intersectsBox(t)},isIntersectionPlane:function(t){return this.intersectsPlane(t)},isIntersectionSphere:function(t){return this.intersectsSphere(t)}}),Object.assign(x.prototype,{area:function(){return this.getArea()},barycoordFromPoint:function(t,e){return this.getBarycoord(t,e)},midpoint:function(t){return this.getMidpoint(t)},normal:function(t){return this.getNormal(t)},plane:function(t){return this.getPlane(t)}}),Object.assign(x,{barycoordFromPoint:function(t,e,n,i,r){return x.getBarycoord(t,e,n,i,r)},normal:function(t,e,n,i){return x.getNormal(t,e,n,i)}}),Object.assign(dr.prototype,{extractAllPoints:function(t){return this.extractPoints(t)},extrude:function(t){return new Jn(this,t)},makeGeometry:function(t){return new si(this,t)}}),Object.assign(e.prototype,{fromAttribute:function(t,e,n){return this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return this.manhattanDistanceTo(t)},lengthManhattan:function(){return this.manhattanLength()}}),Object.assign(c.prototype,{setEulerFromRotationMatrix:function(){},setEulerFromQuaternion:function(){},getPositionFromMatrix:function(t){return this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return this.setFromMatrixColumn(e,t)},applyProjection:function(t){return this.applyMatrix4(t)},fromAttribute:function(t,e,n){return this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return this.manhattanDistanceTo(t)},lengthManhattan:function(){return this.manhattanLength()}}),Object.assign(r.prototype,{fromAttribute:function(t,e,n){return this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return this.manhattanLength()}}),Object.assign(G.prototype,{computeTangents:function(){},computeLineDistances:function(){},applyMatrix:function(t){return this.applyMatrix4(t)}}),Object.assign(p.prototype,{getChildByName:function(t){return this.getObjectByName(t)},renderDepth:function(){},translate:function(t,e){return this.translateOnAxis(e,t)},getWorldRotation:function(){},applyMatrix:function(t){return this.applyMatrix4(t)}}),Object.defineProperties(p.prototype,{eulerOrder:{get:function(){return this.rotation.order},set:function(t){this.rotation.order=t}},useQuaternion:{get:function(){},set:function(){}}}),Object.assign(U.prototype,{setDrawMode:function(){}}),Object.defineProperties(U.prototype,{drawMode:{get:function(){return 0},set:function(){}}}),Object.defineProperties(He.prototype,{objects:{get:function(){return this.levels}}}),Object.defineProperty(Xe.prototype,"useVertexTexture",{get:function(){},set:function(){}}),qe.prototype.initBones=function(){},Object.defineProperty(Ji.prototype,"__arcLengthDivisions",{get:function(){return this.arcLengthDivisions},set:function(t){this.arcLengthDivisions=t}}),Y.prototype.setLens=function(t,e){void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(fr.prototype,{onlyShadow:{set:function(){}},shadowCameraFov:{set:function(t){this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){}},shadowBias:{set:function(t){this.shadow.bias=t}},shadowDarkness:{set:function(){}},shadowMapWidth:{set:function(t){this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){this.shadow.mapSize.height=t}}}),Object.defineProperties(L.prototype,{length:{get:function(){return this.array.length}},dynamic:{get:function(){return 35048===this.usage},set:function(){this.setUsage(35048)}}}),Object.assign(L.prototype,{setDynamic:function(t){return this.setUsage(1==t?35048:35044),this},copyIndicesArray:function(){},setArray:function(){}}),Object.assign(B.prototype,{addIndex:function(t){this.setIndex(t)},addAttribute:function(t,e,n){return e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(this.setIndex(e),this):this.setAttribute(t,e):this.setAttribute(t,new L(e,n))},addDrawCall:function(t,e){this.addGroup(t,e)},clearDrawCalls:function(){this.clearGroups()},computeTangents:function(){},computeOffsets:function(){},removeAttribute:function(t){return this.deleteAttribute(t)},applyMatrix:function(t){return this.applyMatrix4(t)}}),Object.defineProperties(B.prototype,{drawcalls:{get:function(){return this.groups}},offsets:{get:function(){return this.groups}}}),Object.defineProperties(Kr.prototype,{linePrecision:{get:function(){return this.params.Line.threshold},set:function(t){this.params.Line.threshold=t}}}),Object.defineProperties(Ue.prototype,{dynamic:{get:function(){return 35048===this.usage},set:function(t){this.setUsage(t)}}}),Object.assign(Ue.prototype,{setDynamic:function(t){return this.setUsage(1==t?35048:35044),this},setArray:function(){}}),Object.assign($n.prototype,{getArrays:function(){},addShapeList:function(){},addShape:function(){}}),Object.defineProperties($r.prototype,{dynamic:{set:function(){}},onUpdate:{value:function(){return this}}}),Object.defineProperties(T.prototype,{wrapAround:{get:function(){},set:function(){}},overdraw:{get:function(){},set:function(){}},wrapRGB:{get:function(){return new _}},shading:{get:function(){},set:function(t){this.flatShading=1===t}},stencilMask:{get:function(){return this.stencilFuncMask},set:function(t){this.stencilFuncMask=t}}}),Object.defineProperties(bi.prototype,{metal:{get:function(){return 0},set:function(){}}}),Object.defineProperties(q.prototype,{derivatives:{get:function(){return this.extensions.derivatives},set:function(t){this.extensions.derivatives=t}}}),Object.assign(Fe.prototype,{clearTarget:function(t,e,n,i){this.setRenderTarget(t),this.clear(e,n,i)},animate:function(t){this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return this.getRenderTarget()},getMaxAnisotropy:function(){return this.capabilities.getMaxAnisotropy()},getPrecision:function(){return this.capabilities.precision},resetGLState:function(){return this.state.reset()},supportsFloatTextures:function(){return this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return this.capabilities.vertexTextures},supportsInstancedArrays:function(){return this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){this.setScissorTest(t)},initMaterial:function(){},addPrePlugin:function(){},addPostPlugin:function(){},updateShadowMap:function(){},setFaceCulling:function(){},allocTextureUnit:function(){},setTexture:function(){},setTexture2D:function(){},setTextureCube:function(){},getActiveMipMapLevel:function(){return this.getActiveMipmapLevel()}}),Object.defineProperties(Fe.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){this.shadowMap.type=t}},shadowMapCullFace:{get:function(){},set:function(){}},context:{get:function(){return this.getContext()}},vr:{get:function(){return this.xr}},gammaInput:{get:function(){return 0},set:function(){}},gammaOutput:{get:function(){return 0},set:function(t){this.outputEncoding=1==t?3001:3e3}}}),Object.defineProperties(Pe.prototype,{cullFace:{get:function(){},set:function(){}},renderReverseSided:{get:function(){},set:function(){}},renderSingleSided:{get:function(){},set:function(){}}}),Object.defineProperties(a.prototype,{wrapS:{get:function(){return this.texture.wrapS},set:function(t){this.texture.wrapS=t}},wrapT:{get:function(){return this.texture.wrapT},set:function(t){this.texture.wrapT=t}},magFilter:{get:function(){return this.texture.magFilter},set:function(t){this.texture.magFilter=t}},minFilter:{get:function(){return this.texture.minFilter},set:function(t){this.texture.minFilter=t}},anisotropy:{get:function(){return this.texture.anisotropy},set:function(t){this.texture.anisotropy=t}},offset:{get:function(){return this.texture.offset},set:function(t){this.texture.offset=t}},repeat:{get:function(){return this.texture.repeat},set:function(t){this.texture.repeat=t}},format:{get:function(){return this.texture.format},set:function(t){this.texture.format=t}},type:{get:function(){return this.texture.type},set:function(t){this.texture.type=t}},generateMipmaps:{get:function(){return this.texture.generateMipmaps},set:function(t){this.texture.generateMipmaps=t}}}),Object.defineProperties(Gr.prototype,{load:{value:function(t){var e=this;return(new Rr).load(t,(function(t){e.setBuffer(t)})),this}},startTime:{set:function(){}}}),Hr.prototype.getData=function(){return this.getFrequencyData()},Z.prototype.updateCubeMap=function(t,e){return this.update(t,e)},Na.crossOrigin=void 0,Na.loadTexture=function(t,e,n,i){var r=new Zi;r.setCrossOrigin(this.crossOrigin);var a=r.load(t,n,void 0,i);return e&&(a.mapping=e),a},Na.loadTextureCube=function(t,e,n,i){var r=new Yi;r.setCrossOrigin(this.crossOrigin);var a=r.load(t,n,void 0,i);return e&&(a.mapping=e),a},Na.loadCompressedTexture=function(){},Na.loadCompressedTextureCube=function(){},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"115"}}));var Al,Ll,Cl=function(){};Cl.prototype={constructor:Cl,parse:(Al=new c,Ll=new n,function(t,e){void 0===e&&(e={});var n=void 0!==e.binary?e.binary:0,i=[],r=0;if(t.traverse((function(t){if(t.isMesh){var e=t.geometry;e.isBufferGeometry&&(e=(new G).fromBufferGeometry(e)),e.isGeometry&&(r+=e.faces.length,i.push({geometry:e,matrixWorld:t.matrixWorld}))}})),n){var a=80,o=new ArrayBuffer(2*r+3*r*4*4+80+4);(g=new DataView(o)).setUint32(a,r,1),a+=4;for(var s=0,c=i.length;s<c;s++){var l=(y=i[s]).geometry.vertices,u=y.geometry.faces,h=y.matrixWorld;Ll.getNormalMatrix(h);for(var p=0,d=u.length;p<d;p++){var f=u[p];Al.copy(f.normal).applyMatrix3(Ll).normalize(),g.setFloat32(a,Al.x,1),a+=4,g.setFloat32(a,Al.y,1),a+=4,g.setFloat32(a,Al.z,1),a+=4;for(var m=[f.a,f.b,f.c],v=0;v<3;v++)Al.copy(l[m[v]]).applyMatrix4(h),g.setFloat32(a,Al.x,1),a+=4,g.setFloat32(a,Al.y,1),a+=4,g.setFloat32(a,Al.z,1),a+=4;g.setUint16(a,0,1),a+=2}}return g}var g="";for(g+="solid exported\n",s=0,c=i.length;s<c;s++){var y;for(l=(y=i[s]).geometry.vertices,u=y.geometry.faces,h=y.matrixWorld,Ll.getNormalMatrix(h),p=0,d=u.length;p<d;p++){for(f=u[p],Al.copy(f.normal).applyMatrix3(Ll).normalize(),g+="\tfacet normal "+Al.x+" "+Al.y+" "+Al.z+"\n",g+="\t\touter loop\n",m=[f.a,f.b,f.c],v=0;v<3;v++)Al.copy(l[m[v]]).applyMatrix4(h),g+="\t\t\tvertex "+Al.x+" "+Al.y+" "+Al.z+"\n";g+="\t\tendloop\n",g+="\tendfacet\n"}}return g+"endsolid exported\n"})};var El=function(){};El.prototype={constructor:El,parse:function(t){var i,r,a,o,s,l="",u=0,h=0,p=0,d=new c,f=new c,m=new e,v=[];return t.traverse((function(t){t instanceof U&&function(t){var e=0,a=0,c=0,g=t.geometry,y=new n;if(g.isGeometry&&(g=(new B).setFromObject(t)),g.isBufferGeometry){var x=g.getAttribute("position"),_=g.getAttribute("normal"),b=g.getAttribute("uv"),M=g.getIndex();if(l+="o "+t.name+"\n",t.material&&t.material.name&&(l+="usemtl "+t.material.name+"\n"),void 0!==x)for(i=0,o=x.count;i<o;i++,e++)d.x=x.getX(i),d.y=x.getY(i),d.z=x.getZ(i),d.applyMatrix4(t.matrixWorld),l+="v "+d.x+" "+d.y+" "+d.z+"\n";if(void 0!==b)for(i=0,o=b.count;i<o;i++,c++)m.x=b.getX(i),m.y=b.getY(i),l+="vt "+m.x+" "+m.y+"\n";if(void 0!==_)for(y.getNormalMatrix(t.matrixWorld),i=0,o=_.count;i<o;i++,a++)f.x=_.getX(i),f.y=_.getY(i),f.z=_.getZ(i),f.applyMatrix3(y).normalize(),l+="vn "+f.x+" "+f.y+" "+f.z+"\n";if(null!==M)for(i=0,o=M.count;i<o;i+=3){for(s=0;s<3;s++)r=M.getX(i+s)+1,v[s]=u+r+(_||b?"/"+(b?h+r:"")+(_?"/"+(p+r):""):"");l+="f "+v.join(" ")+"\n"}else for(i=0,o=x.count;i<o;i+=3){for(s=0;s<3;s++)r=i+s+1,v[s]=u+r+(_||b?"/"+(b?h+r:"")+(_?"/"+(p+r):""):"");l+="f "+v.join(" ")+"\n"}}u+=e,h+=c,p+=a}(t),t instanceof $e&&function(t){var e=0,n=t.geometry,s=t.type;if(n.isGeometry&&(n=(new B).setFromObject(t)),n.isBufferGeometry){var c=n.getAttribute("position");if(l+="o "+t.name+"\n",void 0!==c)for(i=0,o=c.count;i<o;i++,e++)d.x=c.getX(i),d.y=c.getY(i),d.z=c.getZ(i),d.applyMatrix4(t.matrixWorld),l+="v "+d.x+" "+d.y+" "+d.z+"\n";if("Line"===s){for(l+="l ",r=1,o=c.count;r<=o;r++)l+=u+r+" ";l+="\n"}if("LineSegments"===s)for(a=1+(r=1),o=c.count;r<o;a=(r+=2)+1)l+="l "+(u+r)+" "+(u+a)+"\n"}u+=e}(t)})),l}};var Pl=function(t){this.subdivisions=void 0===t?1:t};Pl.prototype.modify=function(t){(t=t.isBufferGeometry?(new G).fromBufferGeometry(t):t.clone()).mergeVertices();for(var e=this.subdivisions;e-- >0;)this.smooth(t);return t.computeFaceNormals(),t.computeVertexNormals(),t},function(){function t(t,e,n){return n[Math.min(t,e)+"_"+Math.max(t,e)]}function n(t,e,n,i,r,a){var o,s=Math.min(t,e),c=Math.max(t,e),l=s+"_"+c;l in i?o=i[l]:(o={a:n[s],b:n[c],newEdge:null,faces:[]},i[l]=o),o.faces.push(r),a[t].edges.push(o),a[e].edges.push(o)}function i(t,e,n,i,r){t.push(new S(e,n,i,void 0,void 0,r))}function r(t,e){return Math.abs(e-t)/2+Math.min(t,e)}function a(t,e,n,i){t.push([e.clone(),n.clone(),i.clone()])}var o=["a","b","c"];Pl.prototype.smooth=function(s){var l,u,h,p,d,f,m,v,g,y,x,_,b,M=new c,w=[];l=s.vertices,u=s.faces;var S,T,A,L,C,E,P,N,O,D,I,z,R,F,k=void 0!==(h=s.faceVertexUvs)[0]&&h[0].length>0;if(k)for(var B=0;B<h.length;B++)w.push([]);for(m in function(t,e,i,r){var a,o,s;for(a=0,o=t.length;a<o;a++)i[a]={edges:[]};for(a=0,o=e.length;a<o;a++)n((s=e[a]).a,s.b,t,r,s,i),n(s.b,s.c,t,r,s,i),n(s.c,s.a,t,r,s,i)}(l,u,y=Array(l.length),x={}),_=[],x){for(T=x[m],A=new c,C=3/8,E=1/8,2!=(P=T.faces.length)&&(C=.5,E=0),A.addVectors(T.a,T.b).multiplyScalar(C),M.set(0,0,0),B=0;B<P;B++){for(L=T.faces[B],g=0;g<3&&((S=l[L[o[g]]])===T.a||S===T.b);g++);M.add(S)}M.multiplyScalar(E),A.add(M),T.newEdge=_.length,_.push(A)}for(b=[],m=0,v=l.length;m<v;m++){for(R=l[m],3==(f=(z=y[m].edges).length)?N=3/16:f>3&&(N=3/(8*f)),O=1-f*N,D=N,f<=2&&2==f&&(O=3/4,D=1/8),F=R.clone().multiplyScalar(O),M.set(0,0,0),B=0;B<f;B++)S=(I=z[B]).a!==R?I.a:I.b,M.add(S);M.multiplyScalar(D),F.add(M),b.push(F)}p=b.concat(_);var U,j,V,G,W,H,q,X=b.length;d=[];var Y=new e,Z=new e,J=new e;for(m=0,v=u.length;m<v;m++)if(i(d,U=t((L=u[m]).a,L.b,x).newEdge+X,j=t(L.b,L.c,x).newEdge+X,V=t(L.c,L.a,x).newEdge+X,L.materialIndex),i(d,L.a,U,V,L.materialIndex),i(d,L.b,j,U,L.materialIndex),i(d,L.c,V,j,L.materialIndex),k)for(B=0;B<h.length;B++)W=(G=h[B][m])[0],H=G[1],q=G[2],Y.set(r(W.x,H.x),r(W.y,H.y)),Z.set(r(H.x,q.x),r(H.y,q.y)),J.set(r(W.x,q.x),r(W.y,q.y)),a(w[B],Y,Z,J),a(w[B],W,Y,J),a(w[B],H,Z,Y),a(w[B],q,J,Z);s.vertices=p,s.faces=d,k&&(s.faceVertexUvs=w)}}();var Nl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ol=_a((function(t){!function(){function e(t,e,n){var i=new XMLHttpRequest;i.open("GET",t),i.responseType="blob",i.onload=function(){a(i.response,e,n)},i.onerror=function(){},i.send()}function n(t){var e=new XMLHttpRequest;e.open("HEAD",t,0);try{e.send()}catch(t){}return 200<=e.status&&299>=e.status}function i(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",1,1,window,0,0,0,80,20,0,0,0,0,0,null),t.dispatchEvent(e)}}var r="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof Nl&&Nl.global===Nl?Nl:void 0,a=r.saveAs||("object"!=typeof window||window!==r?function(){}:"download"in HTMLAnchorElement.prototype?function(t,a,o){var s=r.URL||r.webkitURL,c=document.createElement("a");a=a||t.name||"download",c.download=a,c.rel="noopener","string"==typeof t?(c.href=t,c.origin===location.origin?i(c):n(c.href)?e(t,a,o):i(c,c.target="_blank")):(c.href=s.createObjectURL(t),setTimeout((function(){s.revokeObjectURL(c.href)}),4e4),setTimeout((function(){i(c)}),0))}:"msSaveOrOpenBlob"in navigator?function(t,r,a){if(r=r||t.name||"download","string"!=typeof t)navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:0}:"object"!=typeof e&&(e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\ufeff",t],{type:t.type}):t}(t,a),r);else if(n(t))e(t,r,a);else{var o=document.createElement("a");o.href=t,o.target="_blank",setTimeout((function(){i(o)}))}}:function(t,n,i,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof t)return e(t,n,i);var o="application/octet-stream"===t.type,s=/constructor/i.test(r.HTMLElement)||r.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||o&&s)&&"object"==typeof FileReader){var l=new FileReader;l.onloadend=function(){var t=l.result;t=c?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=t:location=t,a=null},l.readAsDataURL(t)}else{var u=r.URL||r.webkitURL,h=u.createObjectURL(t);a?a.location=h:location.href=h,a=null,setTimeout((function(){u.revokeObjectURL(h)}),4e4)}});r.saveAs=a.saveAs=a,t.exports=a}()})).saveAs,Dl=_a((function(t){
/*!
* 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(e,n){t.exports=e.document?n(e,1):function(t){if(!t.document)throw Error("jQuery requires a window with a document");return n(t)}}("undefined"!=typeof window?window:Nl,(function(t,e){function n(t,e,n){var i,r,a=(n=n||tt).createElement("script");if(a.text=t,e)for(i in ft)(r=e[i]||e.getAttribute&&e.getAttribute(i))&&a.setAttribute(i,r);n.head.appendChild(a).parentNode.removeChild(a)}function i(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?ot[st.call(t)]||"object":typeof t}function r(t){var e=!!t&&"length"in t&&t.length,n=i(t);return pt(t)||dt(t)?0:"array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t}function a(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}function o(t,e,n){return pt(e)?mt.grep(t,(function(t,i){return!!e.call(t,i,t)!==n})):e.nodeType?mt.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?mt.grep(t,(function(t){return at.call(e,t)>-1!==n})):mt.filter(e,t,n)}function s(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function c(t){return t}function l(t){throw t}function u(t,e,n,i){var r;try{t&&pt(r=t.promise)?r.call(t).done(e).fail(n):t&&pt(r=t.then)?r.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.call(void 0,t)}}function h(){tt.removeEventListener("DOMContentLoaded",h),t.removeEventListener("load",h),mt.ready()}function p(t,e){return e.toUpperCase()}function d(t){return t.replace(Pt,"ms-").replace(Nt,p)}function f(){this.expando=mt.expando+f.uid++}function m(t,e,n){var i;if(void 0===n&&1===t.nodeType)if(i="data-"+e.replace(Rt,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(i))){try{n=function(t){return"true"===t?1:"false"===t?0:"null"===t?null:t===+t+""?+t:zt.test(t)?JSON.parse(t):t}(n)}catch(t){}It.set(t,e,n)}else n=void 0;return n}function v(t,e,n,i){var r,a,o=20,s=i?function(){return i.cur()}:function(){return mt.css(t,e,"")},c=s(),l=n&&n[3]||(mt.cssNumber[e]?"":"px"),u=t.nodeType&&(mt.cssNumber[e]||"px"!==l&&+c)&&kt.exec(mt.css(t,e));if(u&&u[3]!==l){for(c/=2,l=l||u[3],u=+c||1;o--;)mt.style(t,e,u+l),(1-a)*(1-(a=s()/c||.5))<=0&&(o=0),u/=a;u*=2,mt.style(t,e,u+l),n=n||[]}return n&&(u=+u||+c||0,r=n[1]?u+(n[1]+1)*n[2]:+n[2],i&&(i.unit=l,i.start=u,i.end=r)),r}function g(t){var e,n=t.ownerDocument,i=t.nodeName,r=Ht[i];return r||(e=n.body.appendChild(n.createElement(i)),r=mt.css(e,"display"),e.parentNode.removeChild(e),"none"===r&&(r="block"),Ht[i]=r,r)}function y(t,e){for(var n,i,r=[],a=0,o=t.length;a<o;a++)(i=t[a]).style&&(n=i.style.display,e?("none"===n&&(r[a]=Dt.get(i,"display")||null,r[a]||(i.style.display="")),""===i.style.display&&Gt(i)&&(r[a]=g(i))):"none"!==n&&(r[a]="none",Dt.set(i,"display",n)));for(a=0;a<o;a++)null!=r[a]&&(t[a].style.display=r[a]);return t}function x(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&a(t,e)?mt.merge([t],n):n}function _(t,e){for(var n=0,i=t.length;n<i;n++)Dt.set(t[n],"globalEval",!e||Dt.get(e[n],"globalEval"))}function b(t,e,n,r,a){for(var o,s,c,l,u,h,p=e.createDocumentFragment(),d=[],f=0,m=t.length;f<m;f++)if((o=t[f])||0===o)if("object"===i(o))mt.merge(d,o.nodeType?[o]:o);else if(Qt.test(o)){for(s=s||p.appendChild(e.createElement("div")),c=(Xt.exec(o)||["",""])[1].toLowerCase(),l=Zt[c]||Zt._default,s.innerHTML=l[1]+mt.htmlPrefilter(o)+l[2],h=l[0];h--;)s=s.lastChild;mt.merge(d,s.childNodes),(s=p.firstChild).textContent=""}else d.push(e.createTextNode(o));for(p.textContent="",f=0;o=d[f++];)if(r&&mt.inArray(o,r)>-1)a&&a.push(o);else if(u=jt(o),s=x(p.appendChild(o),"script"),u&&_(s),n)for(h=0;o=s[h++];)Yt.test(o.type||"")&&n.push(o);return p}function M(){return 1}function w(){return 0}function S(t,e){return t===function(){try{return tt.activeElement}catch(t){}}()==("focus"===e)}function T(t,e,n,i,r,a){var o,s;if("object"==typeof e){for(s in"string"!=typeof n&&(i=i||n,n=void 0),e)T(t,s,n,i,e[s],a);return t}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),0==r)r=w;else if(!r)return t;return 1===a&&(o=r,(r=function(t){return mt().off(t),o.apply(this,arguments)}).guid=o.guid||(o.guid=mt.guid++)),t.each((function(){mt.event.add(this,e,r,i,n)}))}function A(t,e,n){n?(Dt.set(t,e,0),mt.event.add(t,e,{namespace:0,handler:function(t){var i,r,a=Dt.get(this,e);if(1&t.isTrigger&&this[e]){if(a.length)(mt.event.special[e]||{}).delegateType&&t.stopPropagation();else if(a=nt.call(arguments),Dt.set(this,e,a),i=n(this,e),this[e](),a!==(r=Dt.get(this,e))||i?Dt.set(this,e,0):r={},a!==r)return t.stopImmediatePropagation(),t.preventDefault(),r.value}else a.length&&(Dt.set(this,e,{value:mt.event.trigger(mt.extend(a[0],mt.Event.prototype),a.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===Dt.get(t,e)&&mt.event.add(t,e,M)}function L(t,e){return a(t,"table")&&a(11!==e.nodeType?e:e.firstChild,"tr")&&mt(t).children("tbody")[0]||t}function C(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function E(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function P(t,e){var n,i,r,a,o,s,c,l;if(1===e.nodeType){if(Dt.hasData(t)&&(a=Dt.access(t),o=Dt.set(e,a),l=a.events))for(r in delete o.handle,o.events={},l)for(n=0,i=l[r].length;n<i;n++)mt.event.add(e,r,l[r][n]);It.hasData(t)&&(s=It.access(t),c=mt.extend({},s),It.set(e,c))}}function N(t,e){var n=e.nodeName.toLowerCase();"input"===n&&qt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function O(t,e,i,r){e=it.apply([],e);var a,o,s,c,l,u,h=0,p=t.length,d=p-1,f=e[0],m=pt(f);if(m||p>1&&"string"==typeof f&&!ht.checkClone&&re.test(f))return t.each((function(n){var a=t.eq(n);m&&(e[0]=f.call(this,n,a.html())),O(a,e,i,r)}));if(p&&(o=(a=b(e,t[0].ownerDocument,0,t,r)).firstChild,1===a.childNodes.length&&(a=o),o||r)){for(c=(s=mt.map(x(a,"script"),C)).length;h<p;h++)l=a,h!==d&&(l=mt.clone(l,1,1),c&&mt.merge(s,x(l,"script"))),i.call(t[h],l,h);if(c)for(u=s[s.length-1].ownerDocument,mt.map(s,E),h=0;h<c;h++)l=s[h],Yt.test(l.type||"")&&!Dt.access(l,"globalEval")&&mt.contains(u,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?mt._evalUrl&&!l.noModule&&mt._evalUrl(l.src,{nonce:l.nonce||l.getAttribute("nonce")}):n(l.textContent.replace(ae,""),l,u))}return t}function D(t,e,n){for(var i,r=e?mt.filter(e,t):t,a=0;null!=(i=r[a]);a++)n||1!==i.nodeType||mt.cleanData(x(i)),i.parentNode&&(n&&jt(i)&&_(x(i,"script")),i.parentNode.removeChild(i));return t}function I(t,e,n){var i,r,a,o,s=t.style;return(n=n||se(t))&&(""!==(o=n.getPropertyValue(e)||n[e])||jt(t)||(o=mt.style(t,e)),!ht.pixelBoxStyles()&&oe.test(o)&&ce.test(e)&&(i=s.width,r=s.minWidth,a=s.maxWidth,s.minWidth=s.maxWidth=s.width=o,o=n.width,s.width=i,s.minWidth=r,s.maxWidth=a)),void 0!==o?o+"":o}function z(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}function R(t){return mt.cssProps[t]||he[t]||(t in ue?t:he[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=3;n--;)if((t=le[n]+e)in ue)return t}(t)||t)}function F(t,e,n){var i=kt.exec(e);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):e}function k(t,e,n,i,r,a){var o="width"===e?1:0,s=0,c=0;if(n===(i?"border":"content"))return 0;for(;o<4;o+=2)"margin"===n&&(c+=mt.css(t,n+Bt[o],1,r)),i?("content"===n&&(c-=mt.css(t,"padding"+Bt[o],1,r)),"margin"!==n&&(c-=mt.css(t,"border"+Bt[o]+"Width",1,r))):(c+=mt.css(t,"padding"+Bt[o],1,r),"padding"!==n?c+=mt.css(t,"border"+Bt[o]+"Width",1,r):s+=mt.css(t,"border"+Bt[o]+"Width",1,r));return!i&&a>=0&&(c+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-a-c-s-.5))||0),c}function B(t,e,n){var i=se(t),r=(!ht.boxSizingReliable()||n)&&"border-box"===mt.css(t,"boxSizing",0,i),a=r,o=I(t,e,i),s="offset"+e[0].toUpperCase()+e.slice(1);if(oe.test(o)){if(!n)return o;o="auto"}return(!ht.boxSizingReliable()&&r||"auto"===o||!parseFloat(o)&&"inline"===mt.css(t,"display",0,i))&&t.getClientRects().length&&(r="border-box"===mt.css(t,"boxSizing",0,i),(a=s in t)&&(o=t[s])),(o=parseFloat(o)||0)+k(t,e,n||(r?"border":"content"),a,i,o)+"px"}function U(t,e,n,i,r){return new U.prototype.init(t,e,n,i,r)}function j(){ge&&(0==tt.hidden&&t.requestAnimationFrame?t.requestAnimationFrame(j):t.setTimeout(j,mt.fx.interval),mt.fx.tick())}function V(){return t.setTimeout((function(){ve=void 0})),ve=Date.now()}function G(t,e){var n,i=0,r={height:t};for(e=e?1:0;i<4;i+=2-e)r["margin"+(n=Bt[i])]=r["padding"+n]=t;return e&&(r.opacity=r.width=t),r}function W(t,e,n){for(var i,r=(H.tweeners[e]||[]).concat(H.tweeners["*"]),a=0,o=r.length;a<o;a++)if(i=r[a].call(n,e,t))return i}function H(t,e,n){var i,r,a=0,o=H.prefilters.length,s=mt.Deferred().always((function(){delete c.elem})),c=function(){if(r)return 0;for(var e=ve||V(),n=Math.max(0,l.startTime+l.duration-e),i=1-(n/l.duration||0),a=0,o=l.tweens.length;a<o;a++)l.tweens[a].run(i);return s.notifyWith(t,[l,i,n]),i<1&&o?n:(o||s.notifyWith(t,[l,1,0]),s.resolveWith(t,[l]),0)},l=s.promise({elem:t,props:mt.extend({},e),opts:mt.extend(1,{specialEasing:{},easing:mt.easing._default},n),originalProperties:e,originalOptions:n,startTime:ve||V(),duration:n.duration,tweens:[],createTween:function(e,n){var i=mt.Tween(t,l.opts,e,n,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(i),i},stop:function(e){var n=0,i=e?l.tweens.length:0;if(r)return this;for(r=1;n<i;n++)l.tweens[n].run(1);return e?(s.notifyWith(t,[l,1,0]),s.resolveWith(t,[l,e])):s.rejectWith(t,[l,e]),this}}),u=l.props;for(function(t,e){var n,i,r,a,o;for(n in t)if(r=e[i=d(n)],a=t[n],Array.isArray(a)&&(r=a[1],a=t[n]=a[0]),n!==i&&(t[i]=a,delete t[n]),(o=mt.cssHooks[i])&&"expand"in o)for(n in a=o.expand(a),delete t[i],a)n in t||(t[n]=a[n],e[n]=r);else e[i]=r}(u,l.opts.specialEasing);a<o;a++)if(i=H.prefilters[a].call(l,t,u,l.opts))return pt(i.stop)&&(mt._queueHooks(l.elem,l.opts.queue).stop=i.stop.bind(i)),i;return mt.map(u,W,l),pt(l.opts.start)&&l.opts.start.call(t,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),mt.fx.timer(mt.extend(c,{elem:t,anim:l,queue:l.opts.queue})),l}function q(t){return(t.match(At)||[]).join(" ")}function X(t){return t.getAttribute&&t.getAttribute("class")||""}function Y(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(At)||[]}function Z(t,e,n,r){var a;if(Array.isArray(e))mt.each(e,(function(e,i){n||Pe.test(t)?r(t,i):Z(t+"["+("object"==typeof i&&null!=i?e:"")+"]",i,n,r)}));else if(n||"object"!==i(e))r(t,e);else for(a in e)Z(t+"["+a+"]",e[a],n,r)}function J(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,r=0,a=e.toLowerCase().match(At)||[];if(pt(n))for(;i=a[r++];)"+"===i[0]?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function $(t,e,n,i){function r(s){var c;return a[s]=1,mt.each(t[s]||[],(function(t,s){var l=s(e,n,i);return"string"!=typeof l||o||a[l]?o?!(c=l):void 0:(e.dataTypes.unshift(l),r(l),0)})),c}var a={},o=t===je;return r(e.dataTypes[0])||!a["*"]&&r("*")}function Q(t,e){var n,i,r=mt.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((r[n]?t:i||(i={}))[n]=e[n]);return i&&mt.extend(1,t,i),t}var K=[],tt=t.document,et=Object.getPrototypeOf,nt=K.slice,it=K.concat,rt=K.push,at=K.indexOf,ot={},st=ot.toString,ct=ot.hasOwnProperty,lt=ct.toString,ut=lt.call(Object),ht={},pt=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType},dt=function(t){return null!=t&&t===t.window},ft={type:1,src:1,nonce:1,noModule:1},mt=function(t,e){return new mt.fn.init(t,e)},vt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;mt.fn=mt.prototype={jquery:"3.4.1",constructor:mt,length:0,toArray:function(){return nt.call(this)},get:function(t){return null==t?nt.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=mt.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return mt.each(this,t)},map:function(t){return this.pushStack(mt.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(nt.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:rt,sort:K.sort,splice:K.splice},mt.extend=mt.fn.extend=function(t){var e,n,i,r,a,o,s=t||{},c=1,l=arguments.length,u=0;for("boolean"==typeof s&&(u=s,s=arguments[c]||{},c++),"object"==typeof s||pt(s)||(s={}),c===l&&(s=this,c--);c<l;c++)if(null!=(e=arguments[c]))for(n in e)r=e[n],"__proto__"!==n&&s!==r&&(u&&r&&(mt.isPlainObject(r)||(a=Array.isArray(r)))?(i=s[n],o=a&&!Array.isArray(i)?[]:a||mt.isPlainObject(i)?i:{},a=0,s[n]=mt.extend(u,o,r)):void 0!==r&&(s[n]=r));return s},mt.extend({expando:"jQuery"+("3.4.1"+Math.random()).replace(/\D/g,""),isReady:1,error:function(t){throw Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return t&&"[object Object]"===st.call(t)?(e=et(t))?"function"==typeof(n=ct.call(e,"constructor")&&e.constructor)&&lt.call(n)===ut:1:0},isEmptyObject:function(t){var e;for(e in t)return 0;return 1},globalEval:function(t,e){n(t,{nonce:e&&e.nonce})},each:function(t,e){var n,i=0;if(r(t))for(n=t.length;i<n&&0!=e.call(t[i],i,t[i]);i++);else for(i in t)if(0==e.call(t[i],i,t[i]))break;return t},trim:function(t){return null==t?"":(t+"").replace(vt,"")},makeArray:function(t,e){var n=e||[];return null!=t&&(r(Object(t))?mt.merge(n,"string"==typeof t?[t]:t):rt.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:at.call(e,t,n)},merge:function(t,e){for(var n=+e.length,i=0,r=t.length;i<n;i++)t[r++]=e[i];return t.length=r,t},grep:function(t,e,n){for(var i=[],r=0,a=t.length,o=!n;r<a;r++)!e(t[r],r)!==o&&i.push(t[r]);return i},map:function(t,e,n){var i,a,o=0,s=[];if(r(t))for(i=t.length;o<i;o++)null!=(a=e(t[o],o,n))&&s.push(a);else for(o in t)null!=(a=e(t[o],o,n))&&s.push(a);return it.apply([],s)},guid:1,support:ht}),"function"==typeof Symbol&&(mt.fn[Symbol.iterator]=K[Symbol.iterator]),mt.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){ot["[object "+e+"]"]=e.toLowerCase()}));var gt=
/*!
* 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(t){function e(t,e,n,i){var r,a,o,s,c,l,u,p=e&&e.ownerDocument,f=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==f&&9!==f&&11!==f)return n;if(!i&&((e?e.ownerDocument||e:B)!==N&&P(e),e=e||N,D)){if(11!==f&&(c=ft.exec(t)))if(r=c[1]){if(9===f){if(!(o=e.getElementById(r)))return n;if(o.id===r)return n.push(o),n}else if(p&&(o=p.getElementById(r))&&F(e,o)&&o.id===r)return n.push(o),n}else{if(c[2])return $.apply(n,e.getElementsByTagName(t)),n;if((r=c[3])&&_.getElementsByClassName&&e.getElementsByClassName)return $.apply(n,e.getElementsByClassName(r)),n}if(_.qsa&&!H[t+" "]&&(!I||!I.test(t))&&(1!==f||"object"!==e.nodeName.toLowerCase())){if(u=t,p=e,1===f&&ot.test(t)){for((s=e.getAttribute("id"))?s=s.replace(yt,xt):e.setAttribute("id",s=k),a=(l=S(t)).length;a--;)l[a]="#"+s+" "+d(l[a]);u=l.join(","),p=mt.test(t)&&h(e.parentNode)||e}try{return $.apply(n,p.querySelectorAll(u)),n}catch(e){H(t,1)}finally{s===k&&e.removeAttribute("id")}}}return A(t.replace(it,"$1"),e,n,i)}function n(){var t=[];return function e(n,i){return t.push(n+" ")>b.cacheLength&&delete e[t.shift()],e[n+" "]=i}}function i(t){return t[k]=1,t}function r(t){var e=N.createElement("fieldset");try{return!!t(e)}catch(t){return 0}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function a(t,e){for(var n=t.split("|"),i=n.length;i--;)b.attrHandle[n[i]]=e}function o(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function s(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function c(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function l(t){return function(e){return"form"in e?e.parentNode&&0==e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&bt(e)===t:e.disabled===t:"label"in e?e.disabled===t:0}}function u(t){return i((function(e){return e=+e,i((function(n,i){for(var r,a=t([],n.length,e),o=a.length;o--;)n[r=a[o]]&&(n[r]=!(i[r]=n[r]))}))}))}function h(t){return t&&void 0!==t.getElementsByTagName&&t}function p(){}function d(t){for(var e=0,n=t.length,i="";e<n;e++)i+=t[e].value;return i}function f(t,e,n){var i=e.dir,r=e.next,a=r||i,o=n&&"parentNode"===a,s=j++;return e.first?function(e,n,r){for(;e=e[i];)if(1===e.nodeType||o)return t(e,n,r);return 0}:function(e,n,c){var l,u,h,p=[U,s];if(c){for(;e=e[i];)if((1===e.nodeType||o)&&t(e,n,c))return 1}else for(;e=e[i];)if(1===e.nodeType||o)if(u=(h=e[k]||(e[k]={}))[e.uniqueID]||(h[e.uniqueID]={}),r&&r===e.nodeName.toLowerCase())e=e[i]||e;else{if((l=u[a])&&l[0]===U&&l[1]===s)return p[2]=l[2];if(u[a]=p,p[2]=t(e,n,c))return 1}return 0}}function m(t){return t.length>1?function(e,n,i){for(var r=t.length;r--;)if(!t[r](e,n,i))return 0;return 1}:t[0]}function v(t,e,n,i,r){for(var a,o=[],s=0,c=t.length,l=null!=e;s<c;s++)(a=t[s])&&(n&&!n(a,i,r)||(o.push(a),l&&e.push(s)));return o}function g(t,n,r,a,o,s){return a&&!a[k]&&(a=g(a)),o&&!o[k]&&(o=g(o,s)),i((function(i,s,c,l){var u,h,p,d=[],f=[],m=s.length,g=i||function(t,n,i){for(var r=0,a=n.length;r<a;r++)e(t,n[r],i);return i}(n||"*",c.nodeType?[c]:c,[]),y=!t||!i&&n?g:v(g,d,t,c,l),x=r?o||(i?t:m||a)?[]:s:y;if(r&&r(y,x,c,l),a)for(u=v(x,f),a(u,[],c,l),h=u.length;h--;)(p=u[h])&&(x[f[h]]=!(y[f[h]]=p));if(i){if(o||t){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(i,p):d[h])>-1&&(i[u]=!(s[u]=p))}}else x=v(x===s?x.splice(m,x.length):x),o?o(null,s,x,l):$.apply(s,x)}))}function y(t){for(var e,n,i,r=t.length,a=b.relative[t[0].type],o=a||b.relative[" "],s=a?1:0,c=f((function(t){return t===e}),o,1),l=f((function(t){return K(e,t)>-1}),o,1),u=[function(t,n,i){var r=!a&&(i||n!==L)||((e=n).nodeType?c(t,n,i):l(t,n,i));return e=null,r}];s<r;s++)if(n=b.relative[t[s].type])u=[f(m(u),n)];else{if((n=b.filter[t[s].type].apply(null,t[s].matches))[k]){for(i=++s;i<r&&!b.relative[t[i].type];i++);return g(s>1&&m(u),s>1&&d(t.slice(0,s-1).concat({value:" "===t[s-2].type?"*":""})).replace(it,"$1"),n,s<i&&y(t.slice(s,i)),i<r&&y(t=t.slice(i)),i<r&&d(t))}u.push(n)}return m(u)}var x,_,b,M,w,S,T,A,L,C,E,P,N,O,D,I,z,R,F,k="sizzle"+1*new Date,B=t.document,U=0,j=0,V=n(),G=n(),W=n(),H=n(),q=function(t,e){return t===e&&(E=1),0},X={}.hasOwnProperty,Y=[],Z=Y.pop,J=Y.push,$=Y.push,Q=Y.slice,K=function(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1},tt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",et="[\\x20\\t\\r\\n\\f]",nt=/[\x20\t\r\n\f]+/g,it=/^[\x20\t\r\n\f]+|((?:^|[^\\])(?:\\.)*)[\x20\t\r\n\f]+$/g,rt=/^[\x20\t\r\n\f]*,[\x20\t\r\n\f]*/,at=/^[\x20\t\r\n\f]*([>+~]|[\x20\t\r\n\f])[\x20\t\r\n\f]*/,ot=/[\x20\t\r\n\f]|>/,st=/:((?:\\.|[\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]*\])*)|.*)\)|)/,ct=/^(?:\\.|[\w-]|[^-\xa0])+$/,lt={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},ut=/HTML$/i,ht=/^(?:input|select|textarea|button)$/i,pt=/^h\d$/i,dt=/^[^{]+\{\s*\[native \w/,ft=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,mt=/[+~]/,vt=/\\([\da-f]{1,6}[\x20\t\r\n\f]?|([\x20\t\r\n\f])|.)/gi,gt=function(t,e,n){var i="0x"+e-65536;return i!=i||n?e:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},yt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,xt=function(t,e){return e?"\0"===t?"<22>":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},_t=function(){P()},bt=f((function(t){return 1==t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{$.apply(Y=Q.call(B.childNodes),B.childNodes),Y[B.childNodes.length].nodeType}catch(t){$={apply:Y.length?function(t,e){J.apply(t,Q.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}for(x in _=e.support={},w=e.isXML=function(t){var e=t.namespaceURI,n=(t.ownerDocument||t).documentElement;return!ut.test(e||n&&n.nodeName||"HTML")},P=e.setDocument=function(t){var e,n,i=t?t.ownerDocument||t:B;return i!==N&&9===i.nodeType&&i.documentElement?(O=(N=i).documentElement,D=!w(N),B!==N&&(n=N.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",_t,0):n.attachEvent&&n.attachEvent("onunload",_t)),_.attributes=r((function(t){return t.className="i",!t.getAttribute("className")})),_.getElementsByTagName=r((function(t){return t.appendChild(N.createComment("")),!t.getElementsByTagName("*").length})),_.getElementsByClassName=dt.test(N.getElementsByClassName),_.getById=r((function(t){return O.appendChild(t).id=k,!N.getElementsByName||!N.getElementsByName(k).length})),_.getById?(b.filter.ID=function(t){var e=t.replace(vt,gt);return function(t){return t.getAttribute("id")===e}},b.find.ID=function(t,e){if(void 0!==e.getElementById&&D){var n=e.getElementById(t);return n?[n]:[]}}):(b.filter.ID=function(t){var e=t.replace(vt,gt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},b.find.ID=function(t,e){if(void 0!==e.getElementById&&D){var n,i,r,a=e.getElementById(t);if(a){if((n=a.getAttributeNode("id"))&&n.value===t)return[a];for(r=e.getElementsByName(t),i=0;a=r[i++];)if((n=a.getAttributeNode("id"))&&n.value===t)return[a]}return[]}}),b.find.TAG=_.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):_.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],r=0,a=e.getElementsByTagName(t);if("*"===t){for(;n=a[r++];)1===n.nodeType&&i.push(n);return i}return a},b.find.CLASS=_.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&D)return e.getElementsByClassName(t)},z=[],I=[],(_.qsa=dt.test(N.querySelectorAll))&&(r((function(t){O.appendChild(t).innerHTML="<a id='"+k+"'></a><select id='"+k+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&I.push("[*^$]="+et+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||I.push("\\["+et+"*(?:value|"+tt+")"),t.querySelectorAll("[id~="+k+"-]").length||I.push("~="),t.querySelectorAll(":checked").length||I.push(":checked"),t.querySelectorAll("a#"+k+"+*").length||I.push(".#.+[+~]")})),r((function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=N.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&I.push("name"+et+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&I.push(":enabled",":disabled"),O.appendChild(t).disabled=1,2!==t.querySelectorAll(":disabled").length&&I.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),I.push(",.*:")}))),(_.matchesSelector=dt.test(R=O.matches||O.webkitMatchesSelector||O.mozMatchesSelector||O.oMatchesSelector||O.msMatchesSelector))&&r((function(t){_.disconnectedMatch=R.call(t,"*"),R.call(t,"[s!='']:x"),z.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]*\\])*)|.*)\\)|)")})),I=I.length&&RegExp(I.join("|")),z=z.length&&RegExp(z.join("|")),e=dt.test(O.compareDocumentPosition),F=e||dt.test(O.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return 1;return 0},q=e?function(t,e){if(t===e)return E=1,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(1&(n=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!_.sortDetached&&e.compareDocumentPosition(t)===n?t===N||t.ownerDocument===B&&F(B,t)?-1:e===N||e.ownerDocument===B&&F(B,e)?1:C?K(C,t)-K(C,e):0:4&n?-1:1)}:function(t,e){if(t===e)return E=1,0;var n,i=0,r=t.parentNode,a=e.parentNode,s=[t],c=[e];if(!r||!a)return t===N?-1:e===N?1:r?-1:a?1:C?K(C,t)-K(C,e):0;if(r===a)return o(t,e);for(n=t;n=n.parentNode;)s.unshift(n);for(n=e;n=n.parentNode;)c.unshift(n);for(;s[i]===c[i];)i++;return i?o(s[i],c[i]):s[i]===B?-1:c[i]===B?1:0},N):N},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==N&&P(t),_.matchesSelector&&D&&!H[n+" "]&&(!z||!z.test(n))&&(!I||!I.test(n)))try{var i=R.call(t,n);if(i||_.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){H(n,1)}return e(n,N,null,[t]).length>0},e.contains=function(t,e){return(t.ownerDocument||t)!==N&&P(t),F(t,e)},e.attr=function(t,e){(t.ownerDocument||t)!==N&&P(t);var n=b.attrHandle[e.toLowerCase()],i=n&&X.call(b.attrHandle,e.toLowerCase())?n(t,e,!D):void 0;return void 0!==i?i:_.attributes||!D?t.getAttribute(e):(i=t.getAttributeNode(e))&&i.specified?i.value:null},e.escape=function(t){return(t+"").replace(yt,xt)},e.error=function(t){throw Error("Syntax error, unrecognized expression: "+t)},e.uniqueSort=function(t){var e,n=[],i=0,r=0;if(E=!_.detectDuplicates,C=!_.sortStable&&t.slice(0),t.sort(q),E){for(;e=t[r++];)e===t[r]&&(i=n.push(r));for(;i--;)t.splice(n[i],1)}return C=null,t},M=e.getText=function(t){var e,n="",i=0,r=t.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=M(t)}else if(3===r||4===r)return t.nodeValue}else for(;e=t[i++];)n+=M(e);return n},(b=e.selectors={cacheLength:50,createPseudo:i,match:lt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:1}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:1},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(vt,gt),t[3]=(t[3]||t[4]||t[5]||"").replace(vt,gt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return lt.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&st.test(n)&&(e=S(n,1))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(vt,gt).toLowerCase();return"*"===t?function(){return 1}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=V[t+" "];return e||(e=RegExp("(^|"+et+")"+t+"("+et+"|$)"))&&V(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,n,i){return function(r){var a=e.attr(r,t);return null==a?"!="===n:n?(a+="","="===n?a===i:"!="===n?a!==i:"^="===n?i&&0===a.indexOf(i):"*="===n?i&&a.indexOf(i)>-1:"$="===n?i&&a.slice(-i.length)===i:"~="===n?(" "+a.replace(nt," ")+" ").indexOf(i)>-1:"|="===n?a===i||a.slice(0,i.length+1)===i+"-":0):1}},CHILD:function(t,e,n,i,r){var a="nth"!==t.slice(0,3),o="last"!==t.slice(-4),s="of-type"===e;return 1===i&&0===r?function(t){return!!t.parentNode}:function(e,n,c){var l,u,h,p,d,f,m=a!==o?"nextSibling":"previousSibling",v=e.parentNode,g=s&&e.nodeName.toLowerCase(),y=!c&&!s,x=0;if(v){if(a){for(;m;){for(p=e;p=p[m];)if(s?p.nodeName.toLowerCase()===g:1===p.nodeType)return 0;f=m="only"===t&&!f&&"nextSibling"}return 1}if(f=[o?v.firstChild:v.lastChild],o&&y){for(x=(d=(l=(u=(h=(p=v)[k]||(p[k]={}))[p.uniqueID]||(h[p.uniqueID]={}))[t]||[])[0]===U&&l[1])&&l[2],p=d&&v.childNodes[d];p=++d&&p&&p[m]||(x=d=0)||f.pop();)if(1===p.nodeType&&++x&&p===e){u[t]=[U,d,x];break}}else if(y&&(x=d=(l=(u=(h=(p=e)[k]||(p[k]={}))[p.uniqueID]||(h[p.uniqueID]={}))[t]||[])[0]===U&&l[1]),0==x)for(;(p=++d&&p&&p[m]||(x=d=0)||f.pop())&&((s?p.nodeName.toLowerCase()!==g:1!==p.nodeType)||!++x||(y&&((u=(h=p[k]||(p[k]={}))[p.uniqueID]||(h[p.uniqueID]={}))[t]=[U,x]),p!==e)););return(x-=r)===i||x%i==0&&x/i>=0}}},PSEUDO:function(t,n){var r,a=b.pseudos[t]||b.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return a[k]?a(n):a.length>1?(r=[t,t,"",n],b.setFilters.hasOwnProperty(t.toLowerCase())?i((function(t,e){for(var i,r=a(t,n),o=r.length;o--;)t[i=K(t,r[o])]=!(e[i]=r[o])})):function(t){return a(t,0,r)}):a}},pseudos:{not:i((function(t){var e=[],n=[],r=T(t.replace(it,"$1"));return r[k]?i((function(t,e,n,i){for(var a,o=r(t,null,i,[]),s=t.length;s--;)(a=o[s])&&(t[s]=!(e[s]=a))})):function(t,i,a){return e[0]=t,r(e,null,a,n),e[0]=null,!n.pop()}})),has:i((function(t){return function(n){return e(t,n).length>0}})),contains:i((function(t){return t=t.replace(vt,gt),function(e){return(e.textContent||M(e)).indexOf(t)>-1}})),lang:i((function(t){return ct.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(vt,gt).toLowerCase(),function(e){var n;do{if(n=D?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return 0}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===O},focus:function(t){return t===N.activeElement&&(!N.hasFocus||N.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:l(0),disabled:l(1),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,1==t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return 0;return 1},parent:function(t){return!b.pseudos.empty(t)},header:function(t){return pt.test(t.nodeName)},input:function(t){return ht.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:u((function(){return[0]})),last:u((function(t,e){return[e-1]})),eq:u((function(t,e,n){return[n<0?n+e:n]})),even:u((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:u((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:u((function(t,e,n){for(var i=n<0?n+e:n>e?e:n;--i>=0;)t.push(i);return t})),gt:u((function(t,e,n){for(var i=n<0?n+e:n;++i<e;)t.push(i);return t}))}}).pseudos.nth=b.pseudos.eq,{radio:1,checkbox:1,file:1,password:1,image:1})b.pseudos[x]=s(x);for(x in{submit:1,reset:1})b.pseudos[x]=c(x);return p.prototype=b.filters=b.pseudos,b.setFilters=new p,S=e.tokenize=function(t,n){var i,r,a,o,s,c,l,u=G[t+" "];if(u)return n?0:u.slice(0);for(s=t,c=[],l=b.preFilter;s;){for(o in i&&!(r=rt.exec(s))||(r&&(s=s.slice(r[0].length)||s),c.push(a=[])),i=0,(r=at.exec(s))&&(i=r.shift(),a.push({value:i,type:r[0].replace(it," ")}),s=s.slice(i.length)),b.filter)!(r=lt[o].exec(s))||l[o]&&!(r=l[o](r))||(i=r.shift(),a.push({value:i,type:o,matches:r}),s=s.slice(i.length));if(!i)break}return n?s.length:s?e.error(t):G(t,c).slice(0)},T=e.compile=function(t,n){var r,a=[],o=[],s=W[t+" "];if(!s){for(n||(n=S(t)),r=n.length;r--;)(s=y(n[r]))[k]?a.push(s):o.push(s);(s=W(t,function(t,n){var r=n.length>0,a=t.length>0,o=function(i,o,s,c,l){var u,h,p,d=0,f="0",m=i&&[],g=[],y=L,x=i||a&&b.find.TAG("*",l),_=U+=null==y?1:Math.random()||.1,M=x.length;for(l&&(L=o===N||o||l);f!==M&&null!=(u=x[f]);f++){if(a&&u){for(h=0,o||u.ownerDocument===N||(P(u),s=!D);p=t[h++];)if(p(u,o||N,s)){c.push(u);break}l&&(U=_)}r&&((u=!p&&u)&&d--,i&&m.push(u))}if(d+=f,r&&f!==d){for(h=0;p=n[h++];)p(m,g,o,s);if(i){if(d>0)for(;f--;)m[f]||g[f]||(g[f]=Z.call(c));g=v(g)}$.apply(c,g),l&&!i&&g.length>0&&d+n.length>1&&e.uniqueSort(c)}return l&&(U=_,L=y),m};return r?i(o):o}(o,a))).selector=t}return s},A=e.select=function(t,e,n,i){var r,a,o,s,c,l="function"==typeof t&&t,u=!i&&S(t=l.selector||t);if(n=n||[],1===u.length){if((a=u[0]=u[0].slice(0)).length>2&&"ID"===(o=a[0]).type&&9===e.nodeType&&D&&b.relative[a[1].type]){if(!(e=(b.find.ID(o.matches[0].replace(vt,gt),e)||[])[0]))return n;l&&(e=e.parentNode),t=t.slice(a.shift().value.length)}for(r=lt.needsContext.test(t)?0:a.length;r--&&(o=a[r],!b.relative[s=o.type]);)if((c=b.find[s])&&(i=c(o.matches[0].replace(vt,gt),mt.test(a[0].type)&&h(e.parentNode)||e))){if(a.splice(r,1),!(t=i.length&&d(a)))return $.apply(n,i),n;break}}return(l||T(t,u))(i,e,!D,n,!e||mt.test(t)&&h(e.parentNode)||e),n},_.sortStable=k.split("").sort(q).join("")===k,_.detectDuplicates=!!E,P(),_.sortDetached=r((function(t){return 1&t.compareDocumentPosition(N.createElement("fieldset"))})),r((function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")}))||a("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),_.attributes&&r((function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||a("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),r((function(t){return null==t.getAttribute("disabled")}))||a(tt,(function(t,e,n){var i;if(!n)return 1==t[e]?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null})),e}(t);mt.find=gt,mt.expr=gt.selectors,mt.expr[":"]=mt.expr.pseudos,mt.uniqueSort=mt.unique=gt.uniqueSort,mt.text=gt.getText,mt.isXMLDoc=gt.isXML,mt.contains=gt.contains,mt.escapeSelector=gt.escape;var yt=function(t,e,n){for(var i=[],r=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&mt(t).is(n))break;i.push(t)}return i},xt=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},_t=mt.expr.match.needsContext,bt=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;mt.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?mt.find.matchesSelector(i,t)?[i]:[]:mt.find.matches(t,mt.grep(e,(function(t){return 1===t.nodeType})))},mt.fn.extend({find:function(t){var e,n,i=this.length,r=this;if("string"!=typeof t)return this.pushStack(mt(t).filter((function(){for(e=0;e<i;e++)if(mt.contains(r[e],this))return 1})));for(n=this.pushStack([]),e=0;e<i;e++)mt.find(t,r[e],n);return i>1?mt.uniqueSort(n):n},filter:function(t){return this.pushStack(o(this,t||[],0))},not:function(t){return this.pushStack(o(this,t||[],1))},is:function(t){return!!o(this,"string"==typeof t&&_t.test(t)?mt(t):t||[],0).length}});var Mt,wt=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(mt.fn.init=function(t,e,n){var i,r;if(!t)return this;if(n=n||Mt,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:wt.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof mt?e[0]:e,mt.merge(this,mt.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:tt,1)),bt.test(i[1])&&mt.isPlainObject(e))for(i in e)pt(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(r=tt.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):pt(t)?void 0!==n.ready?n.ready(t):t(mt):mt.makeArray(t,this)}).prototype=mt.fn,Mt=mt(tt);var St=/^(?:parents|prev(?:Until|All))/,Tt={children:1,contents:1,next:1,prev:1};mt.fn.extend({has:function(t){var e=mt(t,this),n=e.length;return this.filter((function(){for(var t=0;t<n;t++)if(mt.contains(this,e[t]))return 1}))},closest:function(t,e){var n,i=0,r=this.length,a=[],o="string"!=typeof t&&mt(t);if(!_t.test(t))for(;i<r;i++)for(n=this[i];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:1===n.nodeType&&mt.find.matchesSelector(n,t))){a.push(n);break}return this.pushStack(a.length>1?mt.uniqueSort(a):a)},index:function(t){return t?"string"==typeof t?at.call(mt(t),this[0]):at.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(mt.uniqueSort(mt.merge(this.get(),mt(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),mt.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return yt(t,"parentNode")},parentsUntil:function(t,e,n){return yt(t,"parentNode",n)},next:function(t){return s(t,"nextSibling")},prev:function(t){return s(t,"previousSibling")},nextAll:function(t){return yt(t,"nextSibling")},prevAll:function(t){return yt(t,"previousSibling")},nextUntil:function(t,e,n){return yt(t,"nextSibling",n)},prevUntil:function(t,e,n){return yt(t,"previousSibling",n)},siblings:function(t){return xt((t.parentNode||{}).firstChild,t)},children:function(t){return xt(t.firstChild)},contents:function(t){return void 0!==t.contentDocument?t.contentDocument:(a(t,"template")&&(t=t.content||t),mt.merge([],t.childNodes))}},(function(t,e){mt.fn[t]=function(n,i){var r=mt.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=mt.filter(i,r)),this.length>1&&(Tt[t]||mt.uniqueSort(r),St.test(t)&&r.reverse()),this.pushStack(r)}}));var At=/[^\x20\t\r\n\f]+/g;mt.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return mt.each(t.match(At)||[],(function(t,n){e[n]=1})),e}(t):mt.extend({},t);var e,n,r,a,o=[],s=[],c=-1,l=function(){for(a=a||t.once,r=e=1;s.length;c=-1)for(n=s.shift();++c<o.length;)0==o[c].apply(n[0],n[1])&&t.stopOnFalse&&(c=o.length,n=0);t.memory||(n=0),e=0,a&&(o=n?[]:"")},u={add:function(){return o&&(n&&!e&&(c=o.length-1,s.push(n)),function e(n){mt.each(n,(function(n,r){pt(r)?t.unique&&u.has(r)||o.push(r):r&&r.length&&"string"!==i(r)&&e(r)}))}(arguments),n&&!e&&l()),this},remove:function(){return mt.each(arguments,(function(t,e){for(var n;(n=mt.inArray(e,o,n))>-1;)o.splice(n,1),n<=c&&c--})),this},has:function(t){return t?mt.inArray(t,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||e||(o=n=""),this},locked:function(){return!!a},fireWith:function(t,n){return a||(n=[t,(n=n||[]).slice?n.slice():n],s.push(n),e||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},mt.extend({Deferred:function(e){var n=[["notify","progress",mt.Callbacks("memory"),mt.Callbacks("memory"),2],["resolve","done",mt.Callbacks("once memory"),mt.Callbacks("once memory"),0,"resolved"],["reject","fail",mt.Callbacks("once memory"),mt.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return a.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return mt.Deferred((function(e){mt.each(n,(function(n,i){var r=pt(t[i[4]])&&t[i[4]];a[i[1]]((function(){var t=r&&r.apply(this,arguments);t&&pt(t.promise)?t.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[i[0]+"With"](this,r?[t]:arguments)}))})),t=null})).promise()},then:function(e,i,r){function a(e,n,i,r){return function(){var s=this,u=arguments,h=function(){var t,h;if(!(e<o)){if((t=i.apply(s,u))===n.promise())throw new TypeError("Thenable self-resolution");h=t&&("object"==typeof t||"function"==typeof t)&&t.then,pt(h)?r?h.call(t,a(o,n,c,r),a(o,n,l,r)):(o++,h.call(t,a(o,n,c,r),a(o,n,l,r),a(o,n,c,n.notifyWith))):(i!==c&&(s=void 0,u=[t]),(r||n.resolveWith)(s,u))}},p=r?h:function(){try{h()}catch(t){mt.Deferred.exceptionHook&&mt.Deferred.exceptionHook(t,p.stackTrace),e+1>=o&&(i!==l&&(s=void 0,u=[t]),n.rejectWith(s,u))}};e?p():(mt.Deferred.getStackHook&&(p.stackTrace=mt.Deferred.getStackHook()),t.setTimeout(p))}}var o=0;return mt.Deferred((function(t){n[0][3].add(a(0,t,pt(r)?r:c,t.notifyWith)),n[1][3].add(a(0,t,pt(e)?e:c)),n[2][3].add(a(0,t,pt(i)?i:l))})).promise()},promise:function(t){return null!=t?mt.extend(t,r):r}},a={};return mt.each(n,(function(t,e){var o=e[2],s=e[5];r[e[1]]=o.add,s&&o.add((function(){i=s}),n[3-t][2].disable,n[3-t][3].disable,n[0][2].lock,n[0][3].lock),o.add(e[3].fire),a[e[0]]=function(){return a[e[0]+"With"](this===a?void 0:this,arguments),this},a[e[0]+"With"]=o.fireWith})),r.promise(a),e&&e.call(a,a),a},when:function(t){var e=arguments.length,n=e,i=Array(n),r=nt.call(arguments),a=mt.Deferred(),o=function(t){return function(n){i[t]=this,r[t]=arguments.length>1?nt.call(arguments):n,--e||a.resolveWith(i,r)}};if(e<=1&&(u(t,a.done(o(n)).resolve,a.reject,!e),"pending"===a.state()||pt(r[n]&&r[n].then)))return a.then();for(;n--;)u(r[n],o(n),a.reject);return a.promise()}});var Lt=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;mt.Deferred.exceptionHook=function(e,n){t.console&&t.console.warn&&e&&Lt.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,n)},mt.readyException=function(e){t.setTimeout((function(){throw e}))};var Ct=mt.Deferred();mt.fn.ready=function(t){return Ct.then(t).catch((function(t){mt.readyException(t)})),this},mt.extend({isReady:0,readyWait:1,ready:function(t){(1==t?--mt.readyWait:mt.isReady)||(mt.isReady=1,1!=t&&--mt.readyWait>0||Ct.resolveWith(tt,[mt]))}}),mt.ready.then=Ct.then,"complete"===tt.readyState||"loading"!==tt.readyState&&!tt.documentElement.doScroll?t.setTimeout(mt.ready):(tt.addEventListener("DOMContentLoaded",h),t.addEventListener("load",h));var Et=function(t,e,n,r,a,o,s){var c=0,l=t.length,u=null==n;if("object"===i(n))for(c in a=1,n)Et(t,e,c,n[c],1,o,s);else if(void 0!==r&&(a=1,pt(r)||(s=1),u&&(s?(e.call(t,r),e=null):(u=e,e=function(t,e,n){return u.call(mt(t),n)})),e))for(;c<l;c++)e(t[c],n,s?r:r.call(t[c],c,e(t[c],n)));return a?t:u?e.call(t):l?e(t[0],n):o},Pt=/^-ms-/,Nt=/-([a-z])/g,Ot=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};f.uid=1,f.prototype={cache:function(t){var e=t[this.expando];return e||(e={},Ot(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:1}))),e},set:function(t,e,n){var i,r=this.cache(t);if("string"==typeof e)r[d(e)]=n;else for(i in e)r[d(i)]=e[i];return r},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][d(e)]},access:function(t,e,n){return void 0===e||e&&"string"==typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,i=t[this.expando];if(void 0!==i){if(void 0!==e){n=(e=Array.isArray(e)?e.map(d):(e=d(e))in i?[e]:e.match(At)||[]).length;for(;n--;)delete i[e[n]]}(void 0===e||mt.isEmptyObject(i))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!mt.isEmptyObject(e)}};var Dt=new f,It=new f,zt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Rt=/[A-Z]/g;mt.extend({hasData:function(t){return It.hasData(t)||Dt.hasData(t)},data:function(t,e,n){return It.access(t,e,n)},removeData:function(t,e){It.remove(t,e)},_data:function(t,e,n){return Dt.access(t,e,n)},_removeData:function(t,e){Dt.remove(t,e)}}),mt.fn.extend({data:function(t,e){var n,i,r,a=this[0],o=a&&a.attributes;if(void 0===t){if(this.length&&(r=It.get(a),1===a.nodeType&&!Dt.get(a,"hasDataAttrs"))){for(n=o.length;n--;)o[n]&&0===(i=o[n].name).indexOf("data-")&&(i=d(i.slice(5)),m(a,i,r[i]));Dt.set(a,"hasDataAttrs",1)}return r}return"object"==typeof t?this.each((function(){It.set(this,t)})):Et(this,(function(e){var n;if(a&&void 0===e)return void 0!==(n=It.get(a,t))||void 0!==(n=m(a,t))?n:void 0;this.each((function(){It.set(this,t,e)}))}),null,e,arguments.length>1,null,1)},removeData:function(t){return this.each((function(){It.remove(this,t)}))}}),mt.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=Dt.get(t,e),n&&(!i||Array.isArray(n)?i=Dt.access(t,e,mt.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=mt.queue(t,e),i=n.length,r=n.shift(),a=mt._queueHooks(t,e);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete a.stop,r.call(t,(function(){mt.dequeue(t,e)}),a)),!i&&a&&a.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return Dt.get(t,n)||Dt.access(t,n,{empty:mt.Callbacks("once memory").add((function(){Dt.remove(t,[e+"queue",n])}))})}}),mt.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?mt.queue(this[0],t):void 0===e?this:this.each((function(){var n=mt.queue(this,t,e);mt._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&mt.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){mt.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,i=1,r=mt.Deferred(),a=this,o=this.length,s=function(){--i||r.resolveWith(a,[a])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";o--;)(n=Dt.get(a[o],t+"queueHooks"))&&n.empty&&(i++,n.empty.add(s));return s(),r.promise(e)}});var Ft=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,kt=RegExp("^(?:([+-])=|)("+Ft+")([a-z%]*)$","i"),Bt=["Top","Right","Bottom","Left"],Ut=tt.documentElement,jt=function(t){return mt.contains(t.ownerDocument,t)},Vt={composed:1};Ut.getRootNode&&(jt=function(t){return mt.contains(t.ownerDocument,t)||t.getRootNode(Vt)===t.ownerDocument});var Gt=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&jt(t)&&"none"===mt.css(t,"display")},Wt=function(t,e,n,i){var r,a,o={};for(a in e)o[a]=t.style[a],t.style[a]=e[a];for(a in r=n.apply(t,i||[]),e)t.style[a]=o[a];return r},Ht={};mt.fn.extend({show:function(){return y(this,1)},hide:function(){return y(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each((function(){Gt(this)?mt(this).show():mt(this).hide()}))}});var qt=/^(?:checkbox|radio)$/i,Xt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Yt=/^$|^module$|\/(?:java|ecma)script/i,Zt={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,"",""]};Zt.optgroup=Zt.option,Zt.tbody=Zt.tfoot=Zt.colgroup=Zt.caption=Zt.thead,Zt.th=Zt.td;var Jt,$t,Qt=/<|&#?\w+;/;Jt=tt.createDocumentFragment().appendChild(tt.createElement("div")),($t=tt.createElement("input")).setAttribute("type","radio"),$t.setAttribute("checked","checked"),$t.setAttribute("name","t"),Jt.appendChild($t),ht.checkClone=Jt.cloneNode(1).cloneNode(1).lastChild.checked,Jt.innerHTML="<textarea>x</textarea>",ht.noCloneChecked=!!Jt.cloneNode(1).lastChild.defaultValue;var Kt=/^key/,te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ee=/^([^.]*)(?:\.(.+)|)/;mt.event={global:{},add:function(t,e,n,i,r){var a,o,s,c,l,u,h,p,d,f,m,v=Dt.get(t);if(v)for(n.handler&&(n=(a=n).handler,r=a.selector),r&&mt.find.matchesSelector(Ut,r),n.guid||(n.guid=mt.guid++),(c=v.events)||(c=v.events={}),(o=v.handle)||(o=v.handle=function(e){return void 0!==mt&&mt.event.triggered!==e.type?mt.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(At)||[""]).length;l--;)d=m=(s=ee.exec(e[l])||[])[1],f=(s[2]||"").split(".").sort(),d&&(h=mt.event.special[d]||{},d=(r?h.delegateType:h.bindType)||d,h=mt.event.special[d]||{},u=mt.extend({type:d,origType:m,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&mt.expr.match.needsContext.test(r),namespace:f.join(".")},a),(p=c[d])||((p=c[d]=[]).delegateCount=0,h.setup&&0!=h.setup.call(t,i,f,o)||t.addEventListener&&t.addEventListener(d,o)),h.add&&(h.add.call(t,u),u.handler.guid||(u.handler.guid=n.guid)),r?p.splice(p.delegateCount++,0,u):p.push(u),mt.event.global[d]=1)},remove:function(t,e,n,i,r){var a,o,s,c,l,u,h,p,d,f,m,v=Dt.hasData(t)&&Dt.get(t);if(v&&(c=v.events)){for(l=(e=(e||"").match(At)||[""]).length;l--;)if(d=m=(s=ee.exec(e[l])||[])[1],f=(s[2]||"").split(".").sort(),d){for(h=mt.event.special[d]||{},p=c[d=(i?h.delegateType:h.bindType)||d]||[],s=s[2]&&RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=a=p.length;a--;)u=p[a],!r&&m!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||i&&i!==u.selector&&("**"!==i||!u.selector)||(p.splice(a,1),u.selector&&p.delegateCount--,h.remove&&h.remove.call(t,u));o&&!p.length&&(h.teardown&&0!=h.teardown.call(t,f,v.handle)||mt.removeEvent(t,d,v.handle),delete c[d])}else for(d in c)mt.event.remove(t,d+e[l],n,i,1);mt.isEmptyObject(c)&&Dt.remove(t,"handle events")}},dispatch:function(t){var e,n,i,r,a,o,s=mt.event.fix(t),c=Array(arguments.length),l=(Dt.get(this,"events")||{})[s.type]||[],u=mt.event.special[s.type]||{};for(c[0]=s,e=1;e<arguments.length;e++)c[e]=arguments[e];if(s.delegateTarget=this,!u.preDispatch||0!=u.preDispatch.call(this,s)){for(o=mt.event.handlers.call(this,s,l),e=0;(r=o[e++])&&!s.isPropagationStopped();)for(s.currentTarget=r.elem,n=0;(a=r.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&0!=a.namespace&&!s.rnamespace.test(a.namespace)||(s.handleObj=a,s.data=a.data,void 0!==(i=((mt.event.special[a.origType]||{}).handle||a.handler).apply(r.elem,c))&&0==(s.result=i)&&(s.preventDefault(),s.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,s),s.result}},handlers:function(t,e){var n,i,r,a,o,s=[],c=e.delegateCount,l=t.target;if(c&&l.nodeType&&!("click"===t.type&&t.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==t.type||1!=l.disabled)){for(a=[],o={},n=0;n<c;n++)void 0===o[r=(i=e[n]).selector+" "]&&(o[r]=i.needsContext?mt(r,this).index(l)>-1:mt.find(r,this,null,[l]).length),o[r]&&a.push(i);a.length&&s.push({elem:l,handlers:a})}return l=this,c<e.length&&s.push({elem:l,handlers:e.slice(c)}),s},addProp:function(t,e){Object.defineProperty(mt.Event.prototype,t,{enumerable:1,configurable:1,get:pt(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:1,configurable:1,writable:1,value:e})}})},fix:function(t){return t[mt.expando]?t:new mt.Event(t)},special:{load:{noBubble:1},click:{setup:function(t){var e=this||t;return qt.test(e.type)&&e.click&&a(e,"input")&&A(e,"click",M),0},trigger:function(t){var e=this||t;return qt.test(e.type)&&e.click&&a(e,"input")&&A(e,"click"),1},_default:function(t){var e=t.target;return qt.test(e.type)&&e.click&&a(e,"input")&&Dt.get(e,"click")||a(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},mt.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},mt.Event=function(t,e){if(!(this instanceof mt.Event))return new mt.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&0==t.returnValue?M:w,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&mt.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[mt.expando]=1},mt.Event.prototype={constructor:mt.Event,isDefaultPrevented:w,isPropagationStopped:w,isImmediatePropagationStopped:w,isSimulated:0,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=M,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=M,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=M,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},mt.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(t){var e=t.button;return null==t.which&&Kt.test(t.type)?null!=t.charCode?t.charCode:t.keyCode:!t.which&&void 0!==e&&te.test(t.type)?1&e?1:2&e?3:4&e?2:0:t.which}},mt.event.addProp),mt.each({focus:"focusin",blur:"focusout"},(function(t,e){mt.event.special[t]={setup:function(){return A(this,t,S),0},trigger:function(){return A(this,t),1},delegateType:e}})),mt.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){mt.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,i=this,r=t.relatedTarget,a=t.handleObj;return r&&(r===i||mt.contains(i,r))||(t.type=a.origType,n=a.handler.apply(this,arguments),t.type=e),n}}})),mt.fn.extend({on:function(t,e,n,i){return T(this,t,e,n,i)},one:function(t,e,n,i){return T(this,t,e,n,i,1)},off:function(t,e,n){var i,r;if(t&&t.preventDefault&&t.handleObj)return i=t.handleObj,mt(t.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof t){for(r in t)this.off(r,e,t[r]);return this}return 0!=e&&"function"!=typeof e||(n=e,e=void 0),0==n&&(n=w),this.each((function(){mt.event.remove(this,t,n,e)}))}});var ne=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,ie=/<script|<style|<link/i,re=/checked\s*(?:[^=]|=\s*.checked.)/i,ae=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;mt.extend({htmlPrefilter:function(t){return t.replace(ne,"<$1></$2>")},clone:function(t,e,n){var i,r,a,o,s=t.cloneNode(1),c=jt(t);if(!(ht.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||mt.isXMLDoc(t)))for(o=x(s),i=0,r=(a=x(t)).length;i<r;i++)N(a[i],o[i]);if(e)if(n)for(a=a||x(t),o=o||x(s),i=0,r=a.length;i<r;i++)P(a[i],o[i]);else P(t,s);return(o=x(s,"script")).length>0&&_(o,!c&&x(t,"script")),s},cleanData:function(t){for(var e,n,i,r=mt.event.special,a=0;void 0!==(n=t[a]);a++)if(Ot(n)){if(e=n[Dt.expando]){if(e.events)for(i in e.events)r[i]?mt.event.remove(n,i):mt.removeEvent(n,i,e.handle);n[Dt.expando]=void 0}n[It.expando]&&(n[It.expando]=void 0)}}}),mt.fn.extend({detach:function(t){return D(this,t,1)},remove:function(t){return D(this,t)},text:function(t){return Et(this,(function(t){return void 0===t?mt.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return O(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||L(this,t).appendChild(t)}))},prepend:function(){return O(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=L(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return O(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return O(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(mt.cleanData(x(t,0)),t.textContent="");return this},clone:function(t,e){return t=null==t?0:t,e=null==e?t:e,this.map((function(){return mt.clone(this,t,e)}))},html:function(t){return Et(this,(function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!ie.test(t)&&!Zt[(Xt.exec(t)||["",""])[1].toLowerCase()]){t=mt.htmlPrefilter(t);try{for(;n<i;n++)1===(e=this[n]||{}).nodeType&&(mt.cleanData(x(e,0)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return O(this,arguments,(function(e){var n=this.parentNode;mt.inArray(this,t)<0&&(mt.cleanData(x(this)),n&&n.replaceChild(e,this))}),t)}}),mt.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){mt.fn[t]=function(t){for(var n,i=[],r=mt(t),a=r.length-1,o=0;o<=a;o++)n=o===a?this:this.clone(1),mt(r[o])[e](n),rt.apply(i,n.get());return this.pushStack(i)}}));var oe=RegExp("^("+Ft+")(?!px)[a-z%]+$","i"),se=function(e){var n=e.ownerDocument.defaultView;return n&&n.opener||(n=t),n.getComputedStyle(e)},ce=RegExp(Bt.join("|"),"i");!function(){function e(){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%",Ut.appendChild(c).appendChild(l);var e=t.getComputedStyle(l);i="1%"!==e.top,s=12===n(e.marginLeft),l.style.right="60%",o=36===n(e.right),r=36===n(e.width),l.style.position="absolute",a=12===n(l.offsetWidth/3),Ut.removeChild(c),l=null}}function n(t){return Math.round(parseFloat(t))}var i,r,a,o,s,c=tt.createElement("div"),l=tt.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(1).style.backgroundClip="",ht.clearCloneStyle="content-box"===l.style.backgroundClip,mt.extend(ht,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),i},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),a}}))}();var le=["Webkit","Moz","ms"],ue=tt.createElement("div").style,he={},pe=/^(none|table(?!-c[ea]).+)/,de=/^--/,fe={position:"absolute",visibility:"hidden",display:"block"},me={letterSpacing:"0",fontWeight:"400"};mt.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=I(t,"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(t,e,n,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,a,o,s=d(e),c=de.test(e),l=t.style;if(c||(e=R(s)),o=mt.cssHooks[e]||mt.cssHooks[s],void 0===n)return o&&"get"in o&&void 0!==(r=o.get(t,0,i))?r:l[e];"string"==(a=typeof n)&&(r=kt.exec(n))&&r[1]&&(n=v(t,e,r),a="number"),null!=n&&n==n&&("number"!==a||c||(n+=r&&r[3]||(mt.cssNumber[s]?"":"px")),ht.clearCloneStyle||""!==n||0!==e.indexOf("background")||(l[e]="inherit"),o&&"set"in o&&void 0===(n=o.set(t,n,i))||(c?l.setProperty(e,n):l[e]=n))}},css:function(t,e,n,i){var r,a,o,s=d(e);return de.test(e)||(e=R(s)),(o=mt.cssHooks[e]||mt.cssHooks[s])&&"get"in o&&(r=o.get(t,1,n)),void 0===r&&(r=I(t,e,i)),"normal"===r&&e in me&&(r=me[e]),""===n||n?(a=parseFloat(r),1==n||isFinite(a)?a||0:r):r}}),mt.each(["height","width"],(function(t,e){mt.cssHooks[e]={get:function(t,n,i){if(n)return!pe.test(mt.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?B(t,e,i):Wt(t,fe,(function(){return B(t,e,i)}))},set:function(t,n,i){var r,a=se(t),o=!ht.scrollboxSize()&&"absolute"===a.position,s=(o||i)&&"border-box"===mt.css(t,"boxSizing",0,a),c=i?k(t,e,i,s,a):0;return s&&o&&(c-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(a[e])-k(t,e,"border",0,a)-.5)),c&&(r=kt.exec(n))&&"px"!==(r[3]||"px")&&(t.style[e]=n,n=mt.css(t,e)),F(0,n,c)}}})),mt.cssHooks.marginLeft=z(ht.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(I(t,"marginLeft"))||t.getBoundingClientRect().left-Wt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),mt.each({margin:"",padding:"",border:"Width"},(function(t,e){mt.cssHooks[t+e]={expand:function(n){for(var i=0,r={},a="string"==typeof n?n.split(" "):[n];i<4;i++)r[t+Bt[i]+e]=a[i]||a[i-2]||a[0];return r}},"margin"!==t&&(mt.cssHooks[t+e].set=F)})),mt.fn.extend({css:function(t,e){return Et(this,(function(t,e,n){var i,r,a={},o=0;if(Array.isArray(e)){for(i=se(t),r=e.length;o<r;o++)a[e[o]]=mt.css(t,e[o],0,i);return a}return void 0!==n?mt.style(t,e,n):mt.css(t,e)}),t,e,arguments.length>1)}}),mt.Tween=U,U.prototype={constructor:U,init:function(t,e,n,i,r,a){this.elem=t,this.prop=n,this.easing=r||mt.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=a||(mt.cssNumber[n]?"":"px")},cur:function(){var t=U.propHooks[this.prop];return t&&t.get?t.get(this):U.propHooks._default.get(this)},run:function(t){var e,n=U.propHooks[this.prop];return this.options.duration?this.pos=e=mt.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):U.propHooks._default.set(this),this}},U.prototype.init.prototype=U.prototype,U.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=mt.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){mt.fx.step[t.prop]?mt.fx.step[t.prop](t):1!==t.elem.nodeType||!mt.cssHooks[t.prop]&&null==t.elem.style[R(t.prop)]?t.elem[t.prop]=t.now:mt.style(t.elem,t.prop,t.now+t.unit)}}},U.propHooks.scrollTop=U.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},mt.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},mt.fx=U.prototype.init,mt.fx.step={};var ve,ge,ye=/^(?:toggle|show|hide)$/,xe=/queueHooks$/;mt.Animation=mt.extend(H,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return v(n.elem,t,kt.exec(e),n),n}]},tweener:function(t,e){pt(t)?(e=t,t=["*"]):t=t.match(At);for(var n,i=0,r=t.length;i<r;i++)n=t[i],H.tweeners[n]=H.tweeners[n]||[],H.tweeners[n].unshift(e)},prefilters:[function(t,e,n){var i,r,a,o,s,c,l,u,h="width"in e||"height"in e,p=this,d={},f=t.style,m=t.nodeType&&Gt(t),v=Dt.get(t,"fxshow");for(i in n.queue||(null==(o=mt._queueHooks(t,"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--,mt.queue(t,"fx").length||o.empty.fire()}))}))),e)if(r=e[i],ye.test(r)){if(delete e[i],a=a||"toggle"===r,r===(m?"hide":"show")){if("show"!==r||!v||void 0===v[i])continue;m=1}d[i]=v&&v[i]||mt.style(t,i)}if((c=!mt.isEmptyObject(e))||!mt.isEmptyObject(d))for(i in h&&1===t.nodeType&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],null==(l=v&&v.display)&&(l=Dt.get(t,"display")),"none"===(u=mt.css(t,"display"))&&(l?u=l:(y([t],1),l=t.style.display||l,u=mt.css(t,"display"),y([t]))),("inline"===u||"inline-block"===u&&null!=l)&&"none"===mt.css(t,"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||(v?"hidden"in v&&(m=v.hidden):v=Dt.access(t,"fxshow",{display:l}),a&&(v.hidden=!m),m&&y([t],1),p.done((function(){for(i in m||y([t]),Dt.remove(t,"fxshow"),d)mt.style(t,i,d[i])}))),c=W(m?v[i]:0,i,p),i in v||(v[i]=c.start,m&&(c.end=c.start,c.start=0))}],prefilter:function(t,e){e?H.prefilters.unshift(t):H.prefilters.push(t)}}),mt.speed=function(t,e,n){var i=t&&"object"==typeof t?mt.extend({},t):{complete:n||!n&&e||pt(t)&&t,duration:t,easing:n&&e||e&&!pt(e)&&e};return mt.fx.off?i.duration=0:"number"!=typeof i.duration&&(i.duration in mt.fx.speeds?i.duration=mt.fx.speeds[i.duration]:i.duration=mt.fx.speeds._default),null!=i.queue&&1!=i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){pt(i.old)&&i.old.call(this),i.queue&&mt.dequeue(this,i.queue)},i},mt.fn.extend({fadeTo:function(t,e,n,i){return this.filter(Gt).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){var r=mt.isEmptyObject(t),a=mt.speed(e,n,i),o=function(){var e=H(this,mt.extend({},t),a);(r||Dt.get(this,"finish"))&&e.stop(1)};return o.finish=o,r||0==a.queue?this.each(o):this.queue(a.queue,o)},stop:function(t,e,n){var i=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&0!=t&&this.queue(t||"fx",[]),this.each((function(){var e=1,r=null!=t&&t+"queueHooks",a=mt.timers,o=Dt.get(this);if(r)o[r]&&o[r].stop&&i(o[r]);else for(r in o)o[r]&&o[r].stop&&xe.test(r)&&i(o[r]);for(r=a.length;r--;)a[r].elem!==this||null!=t&&a[r].queue!==t||(a[r].anim.stop(n),e=0,a.splice(r,1));!e&&n||mt.dequeue(this,t)}))},finish:function(t){return 0!=t&&(t=t||"fx"),this.each((function(){var e,n=Dt.get(this),i=n[t+"queue"],r=n[t+"queueHooks"],a=mt.timers,o=i?i.length:0;for(n.finish=1,mt.queue(this,t,[]),r&&r.stop&&r.stop.call(this,1),e=a.length;e--;)a[e].elem===this&&a[e].queue===t&&(a[e].anim.stop(1),a.splice(e,1));for(e=0;e<o;e++)i[e]&&i[e].finish&&i[e].finish.call(this);delete n.finish}))}}),mt.each(["toggle","show","hide"],(function(t,e){var n=mt.fn[e];mt.fn[e]=function(t,i,r){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(G(e,1),t,i,r)}})),mt.each({slideDown:G("show"),slideUp:G("hide"),slideToggle:G("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){mt.fn[t]=function(t,n,i){return this.animate(e,t,n,i)}})),mt.timers=[],mt.fx.tick=function(){var t,e=0,n=mt.timers;for(ve=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||mt.fx.stop(),ve=void 0},mt.fx.timer=function(t){mt.timers.push(t),mt.fx.start()},mt.fx.interval=13,mt.fx.start=function(){ge||(ge=1,j())},mt.fx.stop=function(){ge=null},mt.fx.speeds={slow:600,fast:200,_default:400},mt.fn.delay=function(e,n){return e=mt.fx&&mt.fx.speeds[e]||e,n=n||"fx",this.queue(n,(function(n,i){var r=t.setTimeout(n,e);i.stop=function(){t.clearTimeout(r)}}))},function(){var t=tt.createElement("input"),e=tt.createElement("select").appendChild(tt.createElement("option"));t.type="checkbox",ht.checkOn=""!==t.value,ht.optSelected=e.selected,(t=tt.createElement("input")).value="t",t.type="radio",ht.radioValue="t"===t.value}();var _e,be=mt.expr.attrHandle;mt.fn.extend({attr:function(t,e){return Et(this,mt.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){mt.removeAttr(this,t)}))}}),mt.extend({attr:function(t,e,n){var i,r,a=t.nodeType;if(3!==a&&8!==a&&2!==a)return void 0===t.getAttribute?mt.prop(t,e,n):(1===a&&mt.isXMLDoc(t)||(r=mt.attrHooks[e.toLowerCase()]||(mt.expr.match.bool.test(e)?_e:void 0)),void 0!==n?null===n?void mt.removeAttr(t,e):r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):r&&"get"in r&&null!==(i=r.get(t,e))?i:null==(i=mt.find.attr(t,e))?void 0:i)},attrHooks:{type:{set:function(t,e){if(!ht.radioValue&&"radio"===e&&a(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,r=e&&e.match(At);if(r&&1===t.nodeType)for(;n=r[i++];)t.removeAttribute(n)}}),_e={set:function(t,e,n){return 0==e?mt.removeAttr(t,n):t.setAttribute(n,n),n}},mt.each(mt.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=be[e]||mt.find.attr;be[e]=function(t,e,i){var r,a,o=e.toLowerCase();return i||(a=be[o],be[o]=r,r=null!=n(t,e,i)?o:null,be[o]=a),r}}));var Me=/^(?:input|select|textarea|button)$/i,we=/^(?:a|area)$/i;mt.fn.extend({prop:function(t,e){return Et(this,mt.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[mt.propFix[t]||t]}))}}),mt.extend({prop:function(t,e,n){var i,r,a=t.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&mt.isXMLDoc(t)||(e=mt.propFix[e]||e,r=mt.propHooks[e]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:t[e]=n:r&&"get"in r&&null!==(i=r.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=mt.find.attr(t,"tabindex");return e?parseInt(e,10):Me.test(t.nodeName)||we.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),ht.optSelected||(mt.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),mt.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){mt.propFix[this.toLowerCase()]=this})),mt.fn.extend({addClass:function(t){var e,n,i,r,a,o,s,c=0;if(pt(t))return this.each((function(e){mt(this).addClass(t.call(this,e,X(this)))}));if((e=Y(t)).length)for(;n=this[c++];)if(r=X(n),i=1===n.nodeType&&" "+q(r)+" "){for(o=0;a=e[o++];)i.indexOf(" "+a+" ")<0&&(i+=a+" ");r!==(s=q(i))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,i,r,a,o,s,c=0;if(pt(t))return this.each((function(e){mt(this).removeClass(t.call(this,e,X(this)))}));if(!arguments.length)return this.attr("class","");if((e=Y(t)).length)for(;n=this[c++];)if(r=X(n),i=1===n.nodeType&&" "+q(r)+" "){for(o=0;a=e[o++];)for(;i.indexOf(" "+a+" ")>-1;)i=i.replace(" "+a+" "," ");r!==(s=q(i))&&n.setAttribute("class",s)}return this},toggleClass:function(t,e){var n=typeof t,i="string"===n||Array.isArray(t);return"boolean"==typeof e&&i?e?this.addClass(t):this.removeClass(t):pt(t)?this.each((function(n){mt(this).toggleClass(t.call(this,n,X(this),e),e)})):this.each((function(){var e,r,a,o;if(i)for(r=0,a=mt(this),o=Y(t);e=o[r++];)a.hasClass(e)?a.removeClass(e):a.addClass(e);else void 0!==t&&"boolean"!==n||((e=X(this))&&Dt.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||0==t?"":Dt.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,i=0;for(e=" "+t+" ";n=this[i++];)if(1===n.nodeType&&(" "+q(X(n))+" ").indexOf(e)>-1)return 1;return 0}});var Se=/\r/g;mt.fn.extend({val:function(t){var e,n,i,r=this[0];return arguments.length?(i=pt(t),this.each((function(n){var r;1===this.nodeType&&(null==(r=i?t.call(this,n,mt(this).val()):t)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=mt.map(r,(function(t){return null==t?"":t+""}))),(e=mt.valHooks[this.type]||mt.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))}))):r?(e=mt.valHooks[r.type]||mt.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(Se,""):null==n?"":n:void 0}}),mt.extend({valHooks:{option:{get:function(t){var e=mt.find.attr(t,"value");return null!=e?e:q(mt.text(t))}},select:{get:function(t){var e,n,i,r=t.options,o=t.selectedIndex,s="select-one"===t.type,c=s?null:[],l=s?o+1:r.length;for(i=o<0?l:s?o:0;i<l;i++)if(((n=r[i]).selected||i===o)&&!n.disabled&&(!n.parentNode.disabled||!a(n.parentNode,"optgroup"))){if(e=mt(n).val(),s)return e;c.push(e)}return c},set:function(t,e){for(var n,i,r=t.options,a=mt.makeArray(e),o=r.length;o--;)((i=r[o]).selected=mt.inArray(mt.valHooks.option.get(i),a)>-1)&&(n=1);return n||(t.selectedIndex=-1),a}}}}),mt.each(["radio","checkbox"],(function(){mt.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=mt.inArray(mt(t).val(),e)>-1}},ht.checkOn||(mt.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),ht.focusin="onfocusin"in t;var Te=/^(?:focusinfocus|focusoutblur)$/,Ae=function(t){t.stopPropagation()};mt.extend(mt.event,{trigger:function(e,n,i,r){var a,o,s,c,l,u,h,p,d=[i||tt],f=ct.call(e,"type")?e.type:e,m=ct.call(e,"namespace")?e.namespace.split("."):[];if(o=p=s=i=i||tt,3!==i.nodeType&&8!==i.nodeType&&!Te.test(f+mt.event.triggered)&&(f.indexOf(".")>-1&&(m=f.split("."),f=m.shift(),m.sort()),l=f.indexOf(":")<0&&"on"+f,(e=e[mt.expando]?e:new mt.Event(f,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=m.join("."),e.rnamespace=e.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=i),n=null==n?[e]:mt.makeArray(n,[e]),h=mt.event.special[f]||{},r||!h.trigger||0!=h.trigger.apply(i,n))){if(!r&&!h.noBubble&&!dt(i)){for(c=h.delegateType||f,Te.test(c+f)||(o=o.parentNode);o;o=o.parentNode)d.push(o),s=o;s===(i.ownerDocument||tt)&&d.push(s.defaultView||s.parentWindow||t)}for(a=0;(o=d[a++])&&!e.isPropagationStopped();)p=o,e.type=a>1?c:h.bindType||f,(u=(Dt.get(o,"events")||{})[e.type]&&Dt.get(o,"handle"))&&u.apply(o,n),(u=l&&o[l])&&u.apply&&Ot(o)&&(e.result=u.apply(o,n),0==e.result&&e.preventDefault());return e.type=f,r||e.isDefaultPrevented()||h._default&&0!=h._default.apply(d.pop(),n)||!Ot(i)||l&&pt(i[f])&&!dt(i)&&((s=i[l])&&(i[l]=null),mt.event.triggered=f,e.isPropagationStopped()&&p.addEventListener(f,Ae),i[f](),e.isPropagationStopped()&&p.removeEventListener(f,Ae),mt.event.triggered=void 0,s&&(i[l]=s)),e.result}},simulate:function(t,e,n){var i=mt.extend(new mt.Event,n,{type:t,isSimulated:1});mt.event.trigger(i,null,e)}}),mt.fn.extend({trigger:function(t,e){return this.each((function(){mt.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return mt.event.trigger(t,e,n,1)}}),ht.focusin||mt.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){mt.event.simulate(e,t.target,mt.event.fix(t))};mt.event.special[e]={setup:function(){var i=this.ownerDocument||this,r=Dt.access(i,e);r||i.addEventListener(t,n,1),Dt.access(i,e,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this,r=Dt.access(i,e)-1;r?Dt.access(i,e,r):(i.removeEventListener(t,n,1),Dt.remove(i,e))}}}));var Le=t.location,Ce=Date.now(),Ee=/\?/;mt.parseXML=function(e){var n;if(!e||"string"!=typeof e)return null;try{n=(new t.DOMParser).parseFromString(e,"text/xml")}catch(t){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||mt.error("Invalid XML: "+e),n};var Pe=/\[\]$/,Ne=/\r?\n/g,Oe=/^(?:submit|button|image|reset|file)$/i,De=/^(?:input|select|textarea|keygen)/i;mt.param=function(t,e){var n,i=[],r=function(t,e){var n=pt(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!mt.isPlainObject(t))mt.each(t,(function(){r(this.name,this.value)}));else for(n in t)Z(n,t[n],e,r);return i.join("&")},mt.fn.extend({serialize:function(){return mt.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=mt.prop(this,"elements");return t?mt.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!mt(this).is(":disabled")&&De.test(this.nodeName)&&!Oe.test(t)&&(this.checked||!qt.test(t))})).map((function(t,e){var n=mt(this).val();return null==n?null:Array.isArray(n)?mt.map(n,(function(t){return{name:e.name,value:t.replace(Ne,"\r\n")}})):{name:e.name,value:n.replace(Ne,"\r\n")}})).get()}});var Ie=/%20/g,ze=/#.*$/,Re=/([?&])_=[^&]*/,Fe=/^(.*?):[ \t]*([^\r\n]*)$/gm,ke=/^(?:GET|HEAD)$/,Be=/^\/\//,Ue={},je={},Ve=tt.createElement("a");Ve.href=Le.href,mt.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Le.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Le.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":mt.parseXML},flatOptions:{url:1,context:1}},ajaxSetup:function(t,e){return e?Q(Q(t,mt.ajaxSettings),e):Q(mt.ajaxSettings,t)},ajaxPrefilter:J(Ue),ajaxTransport:J(je),ajax:function(e,n){function i(e,n,i,s){var l,p,d,_,b,M=n;u||(u=1,c&&t.clearTimeout(c),r=void 0,o=s||"",w.readyState=e>0?4:0,l=e>=200&&e<300||304===e,i&&(_=function(t,e,n){for(var i,r,a,o,s=t.contents,c=t.dataTypes;"*"===c[0];)c.shift(),void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(r in s)if(s[r]&&s[r].test(i)){c.unshift(r);break}if(c[0]in n)a=c[0];else{for(r in n){if(!c[0]||t.converters[r+" "+c[0]]){a=r;break}o||(o=r)}a=a||o}if(a)return a!==c[0]&&c.unshift(a),n[a]}(f,w,i)),_=function(t,e,n,i){var r,a,o,s,c,l={},u=t.dataTypes.slice();if(u[1])for(o in t.converters)l[o.toLowerCase()]=t.converters[o];for(a=u.shift();a;)if(t.responseFields[a]&&(n[t.responseFields[a]]=e),!c&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),c=a,a=u.shift())if("*"===a)a=c;else if("*"!==c&&c!==a){if(!(o=l[c+" "+a]||l["* "+a]))for(r in l)if((s=r.split(" "))[1]===a&&(o=l[c+" "+s[0]]||l["* "+s[0]])){1==o?o=l[r]:1!=l[r]&&(a=s[0],u.unshift(s[1]));break}if(1!=o)if(o&&t.throws)e=o(e);else try{e=o(e)}catch(t){return{state:"parsererror",error:o?t:"No conversion from "+c+" to "+a}}}return{state:"success",data:e}}(f,_,w,l),l?(f.ifModified&&((b=w.getResponseHeader("Last-Modified"))&&(mt.lastModified[a]=b),(b=w.getResponseHeader("etag"))&&(mt.etag[a]=b)),204===e||"HEAD"===f.type?M="nocontent":304===e?M="notmodified":(M=_.state,p=_.data,l=!(d=_.error))):(d=M,!e&&M||(M="error",e<0&&(e=0))),w.status=e,w.statusText=(n||M)+"",l?g.resolveWith(m,[p,M,w]):g.rejectWith(m,[w,M,d]),w.statusCode(x),x=void 0,h&&v.trigger(l?"ajaxSuccess":"ajaxError",[w,f,l?p:d]),y.fireWith(m,[w,M]),h&&(v.trigger("ajaxComplete",[w,f]),--mt.active||mt.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=void 0),n=n||{};var r,a,o,s,c,l,u,h,p,d,f=mt.ajaxSetup({},n),m=f.context||f,v=f.context&&(m.nodeType||m.jquery)?mt(m):mt.event,g=mt.Deferred(),y=mt.Callbacks("once memory"),x=f.statusCode||{},_={},b={},M="canceled",w={readyState:0,getResponseHeader:function(t){var e;if(u){if(!s)for(s={};e=Fe.exec(o);)s[e[1].toLowerCase()+" "]=(s[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=s[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(t,e){return null==u&&(t=b[t.toLowerCase()]=b[t.toLowerCase()]||t,_[t]=e),this},overrideMimeType:function(t){return null==u&&(f.mimeType=t),this},statusCode:function(t){var e;if(t)if(u)w.always(t[w.status]);else for(e in t)x[e]=[x[e],t[e]];return this},abort:function(t){var e=t||M;return r&&r.abort(e),i(0,e),this}};if(g.promise(w),f.url=((e||f.url||Le.href)+"").replace(Be,Le.protocol+"//"),f.type=n.method||n.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(At)||[""],null==f.crossDomain){l=tt.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Ve.protocol+"//"+Ve.host!=l.protocol+"//"+l.host}catch(t){f.crossDomain=1}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=mt.param(f.data,f.traditional)),$(Ue,f,n,w),u)return w;for(p in(h=mt.event&&f.global)&&0==mt.active++&&mt.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!ke.test(f.type),a=f.url.replace(ze,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Ie,"+")):(d=f.url.slice(a.length),f.data&&(f.processData||"string"==typeof f.data)&&(a+=(Ee.test(a)?"&":"?")+f.data,delete f.data),0==f.cache&&(a=a.replace(Re,"$1"),d=(Ee.test(a)?"&":"?")+"_="+Ce+++d),f.url=a+d),f.ifModified&&(mt.lastModified[a]&&w.setRequestHeader("If-Modified-Since",mt.lastModified[a]),mt.etag[a]&&w.setRequestHeader("If-None-Match",mt.etag[a])),(f.data&&f.hasContent&&0!=f.contentType||n.contentType)&&w.setRequestHeader("Content-Type",f.contentType),w.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)w.setRequestHeader(p,f.headers[p]);if(f.beforeSend&&(0==f.beforeSend.call(m,w,f)||u))return w.abort();if(M="abort",y.add(f.complete),w.done(f.success),w.fail(f.error),r=$(je,f,n,w)){if(w.readyState=1,h&&v.trigger("ajaxSend",[w,f]),u)return w;f.async&&f.timeout>0&&(c=t.setTimeout((function(){w.abort("timeout")}),f.timeout));try{u=0,r.send(_,i)}catch(t){if(u)throw t;i(-1,t)}}else i(-1,"No Transport");return w},getJSON:function(t,e,n){return mt.get(t,e,n,"json")},getScript:function(t,e){return mt.get(t,void 0,e,"script")}}),mt.each(["get","post"],(function(t,e){mt[e]=function(t,n,i,r){return pt(n)&&(r=r||i,i=n,n=void 0),mt.ajax(mt.extend({url:t,type:e,dataType:r,data:n,success:i},mt.isPlainObject(t)&&t))}})),mt._evalUrl=function(t,e){return mt.ajax({url:t,type:"GET",dataType:"script",cache:1,async:0,global:0,converters:{"text script":function(){}},dataFilter:function(t){mt.globalEval(t,e)}})},mt.fn.extend({wrapAll:function(t){var e;return this[0]&&(pt(t)&&(t=t.call(this[0])),e=mt(t,this[0].ownerDocument).eq(0).clone(1),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return pt(t)?this.each((function(e){mt(this).wrapInner(t.call(this,e))})):this.each((function(){var e=mt(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=pt(t);return this.each((function(n){mt(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){mt(this).replaceWith(this.childNodes)})),this}}),mt.expr.pseudos.hidden=function(t){return!mt.expr.pseudos.visible(t)},mt.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},mt.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var Ge={0:200,1223:204},We=mt.ajaxSettings.xhr();ht.cors=!!We&&"withCredentials"in We,ht.ajax=We=!!We,mt.ajaxTransport((function(e){var n,i;if(ht.cors||We&&!e.crossDomain)return{send:function(r,a){var o,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)s[o]=e.xhrFields[o];for(o in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)s.setRequestHeader(o,r[o]);n=function(t){return function(){n&&(n=i=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===t?s.abort():"error"===t?"number"!=typeof s.status?a(0,"error"):a(s.status,s.statusText):a(Ge[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(),i=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=i:s.onreadystatechange=function(){4===s.readyState&&t.setTimeout((function(){n&&i()}))},n=n("abort");try{s.send(e.hasContent&&e.data||null)}catch(t){if(n)throw t}},abort:function(){n&&n()}}})),mt.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=0)})),mt.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return mt.globalEval(t),t}}}),mt.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=0),t.crossDomain&&(t.type="GET")})),mt.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(i,r){e=mt("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&r("error"===t.type?404:200,t.type)}),tt.head.appendChild(e[0])},abort:function(){n&&n()}}}));var He,qe=[],Xe=/(=)\?(?=&|$)|\?\?/;mt.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=qe.pop()||mt.expando+"_"+Ce++;return this[t]=1,t}}),mt.ajaxPrefilter("json jsonp",(function(e,n,i){var r,a,o,s=0!=e.jsonp&&(Xe.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Xe.test(e.data)&&"data");if(s||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=pt(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Xe,"$1"+r):0!=e.jsonp&&(e.url+=(Ee.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||mt.error(r+" was not called"),o[0]},e.dataTypes[0]="json",a=t[r],t[r]=function(){o=arguments},i.always((function(){void 0===a?mt(t).removeProp(r):t[r]=a,e[r]&&(e.jsonpCallback=n.jsonpCallback,qe.push(r)),o&&pt(a)&&a(o[0]),o=a=void 0})),"script"})),ht.createHTMLDocument=((He=tt.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===He.childNodes.length),mt.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=0),e||(ht.createHTMLDocument?((i=(e=tt.implementation.createHTMLDocument("")).createElement("base")).href=tt.location.href,e.head.appendChild(i)):e=tt),a=!n&&[],(r=bt.exec(t))?[e.createElement(r[1])]:(r=b([t],e,a),a&&a.length&&mt(a).remove(),mt.merge([],r.childNodes)));var i,r,a},mt.fn.load=function(t,e,n){var i,r,a,o=this,s=t.indexOf(" ");return s>-1&&(i=q(t.slice(s)),t=t.slice(0,s)),pt(e)?(n=e,e=void 0):e&&"object"==typeof e&&(r="POST"),o.length>0&&mt.ajax({url:t,type:r||"GET",dataType:"html",data:e}).done((function(t){a=arguments,o.html(i?mt("<div>").append(mt.parseHTML(t)).find(i):t)})).always(n&&function(t,e){o.each((function(){n.apply(this,a||[t.responseText,e,t])}))}),this},mt.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){mt.fn[e]=function(t){return this.on(e,t)}})),mt.expr.pseudos.animated=function(t){return mt.grep(mt.timers,(function(e){return t===e.elem})).length},mt.offset={setOffset:function(t,e,n){var i,r,a,o,s,c,l=mt.css(t,"position"),u=mt(t),h={};"static"===l&&(t.style.position="relative"),s=u.offset(),a=mt.css(t,"top"),c=mt.css(t,"left"),("absolute"===l||"fixed"===l)&&(a+c).indexOf("auto")>-1?(o=(i=u.position()).top,r=i.left):(o=parseFloat(a)||0,r=parseFloat(c)||0),pt(e)&&(e=e.call(t,n,mt.extend({},s))),null!=e.top&&(h.top=e.top-s.top+o),null!=e.left&&(h.left=e.left-s.left+r),"using"in e?e.using.call(t,h):u.css(h)}},mt.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){mt.offset.setOffset(this,t,e)}));var e,n,i=this[0];return i?i.getClientRects().length?(e=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,i=this[0],r={top:0,left:0};if("fixed"===mt.css(i,"position"))e=i.getBoundingClientRect();else{for(e=this.offset(),n=i.ownerDocument,t=i.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===mt.css(t,"position");)t=t.parentNode;t&&t!==i&&1===t.nodeType&&((r=mt(t).offset()).top+=mt.css(t,"borderTopWidth",1),r.left+=mt.css(t,"borderLeftWidth",1))}return{top:e.top-r.top-mt.css(i,"marginTop",1),left:e.left-r.left-mt.css(i,"marginLeft",1)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===mt.css(t,"position");)t=t.offsetParent;return t||Ut}))}}),mt.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;mt.fn[t]=function(i){return Et(this,(function(t,i,r){var a;if(dt(t)?a=t:9===t.nodeType&&(a=t.defaultView),void 0===r)return a?a[e]:t[i];a?a.scrollTo(n?a.pageXOffset:r,n?r:a.pageYOffset):t[i]=r}),t,i,arguments.length)}})),mt.each(["top","left"],(function(t,e){mt.cssHooks[e]=z(ht.pixelPosition,(function(t,n){if(n)return n=I(t,e),oe.test(n)?mt(t).position()[e]+"px":n}))})),mt.each({Height:"height",Width:"width"},(function(t,e){mt.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,i){mt.fn[i]=function(r,a){var o=arguments.length&&(n||"boolean"!=typeof r),s=n||(1==r||1==a?"margin":"border");return Et(this,(function(e,n,r){var a;return dt(e)?0===i.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(a=e.documentElement,Math.max(e.body["scroll"+t],a["scroll"+t],e.body["offset"+t],a["offset"+t],a["client"+t])):void 0===r?mt.css(e,n,s):mt.style(e,n,r,s)}),e,o?r:void 0,o)}}))})),mt.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(t,e){mt.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}})),mt.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),mt.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)}}),mt.proxy=function(t,e){var n,i,r;if("string"==typeof e&&(n=t[e],e=t,t=n),pt(t))return i=nt.call(arguments,2),(r=function(){return t.apply(e||this,i.concat(nt.call(arguments)))}).guid=t.guid=t.guid||mt.guid++,r},mt.holdReady=function(t){t?mt.readyWait++:mt.ready(1)},mt.isArray=Array.isArray,mt.parseJSON=JSON.parse,mt.nodeName=a,mt.isFunction=pt,mt.isWindow=dt,mt.camelCase=d,mt.type=i,mt.now=Date.now,mt.isNumeric=function(t){var e=mt.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))};var Ye=t.jQuery,Ze=t.$;return mt.noConflict=function(e){return t.$===mt&&(t.$=Ze),e&&t.jQuery===mt&&(t.jQuery=Ye),mt},e||(t.jQuery=t.$=mt),mt}))})),Il=(function(t,e){function n(t,e,n){o.addMethod(e,n,t.unbindEvent),o.addMethod(e,n,t.unbindEventWithSelectorOrCallback),o.addMethod(e,n,t.unbindEventWithSelectorAndCallback)}function i(t){t.arrive=l.bindEvent,n(l,t,"unbindArrive"),t.leave=u.bindEvent,n(u,t,"unbindLeave")}if(t.MutationObserver&&"undefined"!=typeof HTMLElement){var r,a=0,o=(r=HTMLElement.prototype.matches||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector,{matchesSelector:function(t,e){return t instanceof HTMLElement&&r.call(t,e)},addMethod:function(t,e,n){var i=t[e];t[e]=function(){return n.length==arguments.length?n.apply(this,arguments):"function"==typeof i?i.apply(this,arguments):void 0}},callCallbacks:function(t,e){e&&e.options.onceOnly&&1==e.firedElems.length&&(t=[t[0]]);for(var n,i=0;n=t[i];i++)n&&n.callback&&n.callback.call(n.elem,n.elem);e&&e.options.onceOnly&&1==e.firedElems.length&&e.me.unbindEventWithSelectorAndCallback.call(e.target,e.selector,e.callback)},checkChildNodesRecursively:function(t,e,n,i){for(var r,a=0;r=t[a];a++)n(r,e,i)&&i.push({callback:e.callback,elem:r}),r.childNodes.length>0&&o.checkChildNodesRecursively(r.childNodes,e,n,i)},mergeArrays:function(t,e){var n,i={};for(n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);for(n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);return i},toElementsArray:function(e){return void 0===e||"number"==typeof e.length&&e!==t||(e=[e]),e}}),s=function(){var t=function(){this._eventsBucket=[],this._beforeAdding=null,this._beforeRemoving=null};return t.prototype.addEvent=function(t,e,n,i){var r={target:t,selector:e,options:n,callback:i,firedElems:[]};return this._beforeAdding&&this._beforeAdding(r),this._eventsBucket.push(r),r},t.prototype.removeEvent=function(t){for(var e,n=this._eventsBucket.length-1;e=this._eventsBucket[n];n--)if(t(e)){this._beforeRemoving&&this._beforeRemoving(e);var i=this._eventsBucket.splice(n,1);i&&i.length&&(i[0].callback=null)}},t.prototype.beforeAdding=function(t){this._beforeAdding=t},t.prototype.beforeRemoving=function(t){this._beforeRemoving=t},t}(),c=function(e,n){var i=new s,r=this,a={fireOnAttributesModification:0};return i.beforeAdding((function(i){var a,o=i.target;o!==t.document&&o!==t||(o=document.getElementsByTagName("html")[0]),a=new MutationObserver((function(t){n.call(this,t,i)}));var s=e(i.options);a.observe(o,s),i.observer=a,i.me=r})),i.beforeRemoving((function(t){t.observer.disconnect()})),this.bindEvent=function(t,e,n){e=o.mergeArrays(a,e);for(var r=o.toElementsArray(this),s=0;s<r.length;s++)i.addEvent(r[s],t,e,n)},this.unbindEvent=function(){var t=o.toElementsArray(this);i.removeEvent((function(e){for(var n=0;n<t.length;n++)if(void 0===this||e.target===t[n])return 1;return 0}))},this.unbindEventWithSelectorOrCallback=function(t){var e,n=o.toElementsArray(this),r=t;e="function"==typeof t?function(t){for(var e=0;e<n.length;e++)if((void 0===this||t.target===n[e])&&t.callback===r)return 1;return 0}:function(e){for(var i=0;i<n.length;i++)if((void 0===this||e.target===n[i])&&e.selector===t)return 1;return 0},i.removeEvent(e)},this.unbindEventWithSelectorAndCallback=function(t,e){var n=o.toElementsArray(this);i.removeEvent((function(i){for(var r=0;r<n.length;r++)if((void 0===this||i.target===n[r])&&i.selector===t&&i.callback===e)return 1;return 0}))},this},l=new function(){function t(t,e){return o.matchesSelector(t,e.selector)&&(void 0===t._id&&(t._id=a++),-1==e.firedElems.indexOf(t._id))?(e.firedElems.push(t._id),1):0}var e={fireOnAttributesModification:0,onceOnly:0,existing:0},n=(l=new c((function(t){var e={attributes:0,childList:1,subtree:1};return t.fireOnAttributesModification&&(e.attributes=1),e}),(function(e,n){e.forEach((function(e){var i=e.addedNodes,r=e.target,a=[];null!==i&&i.length>0?o.checkChildNodesRecursively(i,n,t,a):"attributes"===e.type&&t(r,n)&&a.push({callback:n.callback,elem:r}),o.callCallbacks(a,n)}))}))).bindEvent;return l.bindEvent=function(t,i,r){void 0===r?(r=i,i=e):i=o.mergeArrays(e,i);var a=o.toElementsArray(this);if(i.existing){for(var s=[],c=0;c<a.length;c++)for(var l=a[c].querySelectorAll(t),u=0;u<l.length;u++)s.push({callback:r,elem:l[u]});if(i.onceOnly&&s.length)return r.call(s[0].elem,s[0].elem);setTimeout(o.callCallbacks,1,s)}n.call(this,t,i,r)},l},u=new function(){function t(t,e){return o.matchesSelector(t,e.selector)}var e={},n=(u=new c((function(){return{childList:1,subtree:1}}),(function(e,n){e.forEach((function(e){var i=e.removedNodes,r=[];null!==i&&i.length>0&&o.checkChildNodesRecursively(i,n,t,r),o.callCallbacks(r,n)}))}))).bindEvent;return u.bindEvent=function(t,i,r){void 0===r?(r=i,i=e):i=o.mergeArrays(e,i),n.call(this,t,i,r)},u};e&&i(e.fn),i(HTMLElement.prototype),i(NodeList.prototype),i(HTMLCollection.prototype),i(HTMLDocument.prototype),i(Window.prototype);var h={};n(l,h,"unbindAllArrive"),n(u,h,"unbindAllLeave")}}(window,"undefined"==typeof jQuery?null:jQuery),function(){});Il.prototype={constructor:Il,parse:function(t){if(t.isMesh){var e,n=new c,i=[],a=0,o=t.geometry,s=(new l).makeRotationX(90*Math.PI/180),u=(new l).makeScale(10,10,10);if(o.isBufferGeometry){var h=o.clone(o),p=o.getAttribute("position");if(void 0!==p)for(e=0,i=p.count;e<i;e++,a++)if(n.x=p.getX(e),n.y=p.getY(e),n.z=p.getZ(e),null==o.skinIndexNames||0==o.skinIndexNames)n.applyMatrix4(t.matrixWorld).applyMatrix4(s).applyMatrix4(u),h.attributes.position.setXYZ(e,n.x,n.y,n.z);else{var d=new r;if(void 0!==o.morphTargetInfluences){for(var f=new r(n.x,n.y,n.z),m=new r,v=0;v<o.morphAttributes.position.length;v++)if(0!=o.morphTargetInfluences[v]&&o.morphTargetDictionary.hide!=v){var g=new r(o.morphAttributes.position[v].getX(e),o.morphAttributes.position[v].getY(e),o.morphAttributes.position[v].getZ(e));m.addScaledVector(g.sub(f),o.morphTargetInfluences[v])}f.add(m)}for(var y=0;y<o.skinIndexNames.length;y++){var x=o.getAttribute([o.skinIndexNames[y]]),_=o.getAttribute([o.skinWeightNames[y]]),b=[];b[0]=x.getX(e),b[1]=x.getY(e),b[2]=x.getZ(e),b[3]=x.getW(e);var M=[];M[0]=_.getX(e),M[1]=_.getY(e),M[2]=_.getZ(e),M[3]=_.getW(e);var w=[];w[0]=t.skeleton.boneInverses[b[0]],w[1]=t.skeleton.boneInverses[b[1]],w[2]=t.skeleton.boneInverses[b[2]],w[3]=t.skeleton.boneInverses[b[3]];var S=[];S[0]=t.skeleton.bones[b[0]].matrixWorld,S[1]=t.skeleton.bones[b[1]].matrixWorld,S[2]=t.skeleton.bones[b[2]].matrixWorld,S[3]=t.skeleton.bones[b[3]].matrixWorld;for(var T=0;T<4;T++){if(void 0!==o.morphTargetInfluences)var A=new r(f.x,f.y,f.z);else A=new r(n.x,n.y,n.z);A.multiplyScalar(M[T]),A.applyMatrix4(w[T]).applyMatrix4(S[T]).applyMatrix4(s).applyMatrix4(u),d.add(A)}}h.attributes.position.setXYZ(e,d.x,d.y,d.z)}}return h}}},document.body.arrive(".footer",{onceOnly:1,existing:1},(function(){var t={"margin-left":"10px",width:"50px"},e={};Dl(".footer").empty(),Dl(".content-side > .headerMenu-container").remove(),Dl("#subDSltLabel").remove(),Dl("#subdivideSLT").remove(),Dl("#topSaveStl").remove(),Dl("#topSaveObj").remove(),Dl("#butSaveStl").remove(),Dl("#butSaveObj").remove(),Dl("#jsonImport").remove(),Dl("#jsonExport").remove();var n=Dl(".headerMenu-container").first();n.css({display:"flex","justify-content":"center","align-content":"center","align-items":"center"}),n.append(Dl("<label />",{css:t,class:"jss7",id:"subDSltLabel",text:"Quality:",title:"Subdivision Passes",for:"subdivideSLT"})).append(Dl("<input />",{css:t,class:"jss7 jss9 jss10",id:"subdivideSLT",name:"subdivideSLT",title:"Subdivision Passes",type:"number",min:"0",max:"2",step:"1",value:"0"})).append(Dl("<a />",{css:t,class:"jss7 jss9 jss10",id:"topSaveStl",text:"💾 .stl",title:"Download in STL Format"}).on("click",ba)).append(Dl("<a />",{css:t,class:"jss7 jss9 jss10",id:"topSaveObj",text:"💾 .obj",title:"Download in OBJ Format"}).on("click",Ma)),Dl(".editorFooter").prepend(Dl("<a />",{css:e,class:"shop-button clickable",id:"butSaveStl",text:"💾 .stl",title:"Download in STL Format"}).on("click",ba)).prepend(Dl("<a />",{css:e,class:"shop-button clickable",id:"butSaveObj",text:"💾 .obj",title:"Download in OBJ Format"}).on("click",Ma)),Dl(".headerMenu-nav-scroll:first").append([Dl('<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",Sa),Dl('<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",wa),Dl().on("change",Sa)])}))},"function"==typeof define&&define.amd?define(t):t();