(window.webpackJsonp=window.webpackJsonp||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(147)},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t0?1:+e}),"name"in Function.prototype===!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n>8&255]+On[e>>16&255]+On[e>>24&255]+"-"+On[255&t]+On[t>>8&255]+"-"+On[t>>16&15|64]+On[t>>24&255]+"-"+On[63&n|128]+On[n>>8&255]+"-"+On[n>>16&255]+On[n>>24&255]+On[255&r]+On[r>>8&255]+On[r>>16&255]+On[r>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*An.DEG2RAD},radToDeg:function(e){return e*An.RAD2DEG},isPowerOfTwo:function(e){return 0===(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){var o=Math.cos,a=Math.sin,s=o(n/2),l=a(n/2),c=o((t+r)/2),u=a((t+r)/2),h=o((t-r)/2),p=a((t-r)/2),d=o((r-t)/2),f=a((r-t)/2);"XYX"===i?e.set(s*u,l*h,l*p,s*c):"YZY"===i?e.set(l*p,s*u,l*h,s*c):"ZXZ"===i?e.set(l*h,l*p,s*u,s*c):"XZX"===i?e.set(s*u,l*f,l*d,s*c):"YXY"===i?e.set(l*d,s*u,l*f,s*c):"ZYZ"===i?e.set(l*f,l*d,s*u,s*c):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};function Rn(e,t){this.x=e||0,this.y=t||0}function In(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(Rn.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(Rn.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*n-o*r+e.x,this.y=i*r+o*n+e.y,this}}),Object.assign(In.prototype,{isMatrix3:!0,set:function(e,t,n,r,i,o,a,s,l){var c=this.elements;return c[0]=e,c[1]=r,c[2]=a,c[3]=t,c[4]=i,c[5]=s,c[6]=n,c[7]=o,c[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[3],s=n[6],l=n[1],c=n[4],u=n[7],h=n[2],p=n[5],d=n[8],f=r[0],m=r[3],g=r[6],v=r[1],b=r[4],y=r[7],_=r[2],x=r[5],w=r[8];return i[0]=o*f+a*v+s*_,i[3]=o*m+a*b+s*x,i[6]=o*g+a*y+s*w,i[1]=l*f+c*v+u*_,i[4]=l*m+c*b+u*x,i[7]=l*g+c*y+u*w,i[2]=h*f+p*v+d*_,i[5]=h*m+p*b+d*x,i[8]=h*g+p*y+d*w,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],c=e[8];return t*o*c-t*a*l-n*i*c+n*a*s+r*i*l-r*o*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=e.elements,r=this.elements,i=n[0],o=n[1],a=n[2],s=n[3],l=n[4],c=n[5],u=n[6],h=n[7],p=n[8],d=p*l-c*h,f=c*u-p*s,m=h*s-l*u,g=i*d+o*f+a*m;if(0===g){var v="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(v);return console.warn(v),this.identity()}var b=1/g;return r[0]=d*b,r[1]=(a*h-p*o)*b,r[2]=(c*o-a*l)*b,r[3]=f*b,r[4]=(p*i-a*u)*b,r[5]=(a*s-c*i)*b,r[6]=m*b,r[7]=(o*u-h*i)*b,r[8]=(l*i-o*s)*b,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},setUvTransform:function(e,t,n,r,i,o,a){var s=Math.cos(i),l=Math.sin(i);this.set(n*s,n*l,-n*(s*o+l*a)+o+e,-r*l,r*s,-r*(-l*o+s*a)+a+t,0,0,1)},scale:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],o=r[3],a=r[6],s=r[1],l=r[4],c=r[7];return r[0]=t*i+n*s,r[3]=t*o+n*l,r[6]=t*a+n*c,r[1]=-n*i+t*s,r[4]=-n*o+t*l,r[7]=-n*a+t*c,this},translate:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}});var Ln={getDataURL:function(e){var t;if("undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Pn&&(Pn=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Pn.width=e.width,Pn.height=e.height;var n=Pn.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Pn}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},Dn=0;function Nn(e,t,n,r,i,o,a,s,l,c){Object.defineProperty(this,"id",{value:Dn++}),this.uuid=An.generateUUID(),this.name="",this.image=void 0!==e?e:Nn.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:Nn.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:Ce,this.wrapT=void 0!==r?r:Ce,this.magFilter=void 0!==i?i:Ae,this.minFilter=void 0!==o?o:Le,this.anisotropy=void 0!==l?l:1,this.format=void 0!==a?a:$e,this.internalFormat=null,this.type=void 0!==s?s:Ne,this.offset=new Rn(0,0),this.repeat=new Rn(1,1),this.center=new Rn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new In,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:Gt,this.version=0,this.onUpdate=null}function Fn(e,t,n,r){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==r?r:1}function Bn(e,t,n){this.width=e,this.height=t,this.scissor=new Fn(0,0,e,t),this.scissorTest=!1,this.viewport=new Fn(0,0,e,t),n=n||{},this.texture=new Nn(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:Ae,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function zn(e,t,n){Bn.call(this,e,t,n),this.samples=4}function Un(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==r?r:1}Nn.DEFAULT_IMAGE=void 0,Nn.DEFAULT_MAPPING=ge,Nn.prototype=Object.assign(Object.create(jn.prototype),{constructor:Nn,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"===typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var r=this.image;if(void 0===r.uuid&&(r.uuid=An.generateUUID()),!t&&void 0===e.images[r.uuid]){var i;if(Array.isArray(r)){i=[];for(var o=0,a=r.length;o1)switch(this.wrapS){case Ee:e.x=e.x-Math.floor(e.x);break;case Ce:e.x=e.x<0?0:1;break;case Te:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case Ee:e.y=e.y-Math.floor(e.y);break;case Ce:e.y=e.y<0?0:1;break;case Te:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(Nn.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.defineProperties(Fn.prototype,{width:{get:function(){return this.z},set:function(e){this.z=e}},height:{get:function(){return this.w},set:function(e){this.w=e}}}),Object.assign(Fn.prototype,{isVector4:!0,set:function(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*r+o[12]*i,this.y=o[1]*t+o[5]*n+o[9]*r+o[13]*i,this.z=o[2]*t+o[6]*n+o[10]*r+o[14]*i,this.w=o[3]*t+o[7]*n+o[11]*r+o[15]*i,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,n,r,i,o=e.elements,a=o[0],s=o[4],l=o[8],c=o[1],u=o[5],h=o[9],p=o[2],d=o[6],f=o[10];if(Math.abs(s-c)<.01&&Math.abs(l-p)<.01&&Math.abs(h-d)<.01){if(Math.abs(s+c)<.1&&Math.abs(l+p)<.1&&Math.abs(h+d)<.1&&Math.abs(a+u+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var m=(a+1)/2,g=(u+1)/2,v=(f+1)/2,b=(s+c)/4,y=(l+p)/4,_=(h+d)/4;return m>g&&m>v?m<.01?(n=0,r=.707106781,i=.707106781):(r=b/(n=Math.sqrt(m)),i=y/n):g>v?g<.01?(n=.707106781,r=0,i=.707106781):(n=b/(r=Math.sqrt(g)),i=_/r):v<.01?(n=.707106781,r=.707106781,i=0):(n=y/(i=Math.sqrt(v)),r=_/i),this.set(n,r,i,t),this}var x=Math.sqrt((d-h)*(d-h)+(l-p)*(l-p)+(c-s)*(c-s));return Math.abs(x)<.001&&(x=1),this.x=(d-h)/x,this.y=(l-p)/x,this.z=(c-s)/x,this.w=Math.acos((a+u+f-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),Bn.prototype=Object.assign(Object.create(jn.prototype),{constructor:Bn,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),zn.prototype=Object.assign(Object.create(Bn.prototype),{constructor:zn,isWebGLMultisampleRenderTarget:!0,copy:function(e){return Bn.prototype.copy.call(this,e),this.samples=e.samples,this}}),Object.assign(Un,{slerp:function(e,t,n,r){return n.copy(e).slerp(t,r)},slerpFlat:function(e,t,n,r,i,o,a){var s=n[r+0],l=n[r+1],c=n[r+2],u=n[r+3],h=i[o+0],p=i[o+1],d=i[o+2],f=i[o+3];if(u!==f||s!==h||l!==p||c!==d){var m=1-a,g=s*h+l*p+c*d+u*f,v=g>=0?1:-1,b=1-g*g;if(b>Number.EPSILON){var y=Math.sqrt(b),_=Math.atan2(y,g*v);m=Math.sin(m*_)/y,a=Math.sin(a*_)/y}var x=a*v;if(s=s*m+h*x,l=l*m+p*x,c=c*m+d*x,u=u*m+f*x,m===1-a){var w=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=w,l*=w,c*=w,u*=w}}e[t]=s,e[t+1]=l,e[t+2]=c,e[t+3]=u}}),Object.defineProperties(Un.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}}),Object.assign(Un.prototype,{isQuaternion:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,r=e._y,i=e._z,o=e.order,a=Math.cos,s=Math.sin,l=a(n/2),c=a(r/2),u=a(i/2),h=s(n/2),p=s(r/2),d=s(i/2);return"XYZ"===o?(this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d):"YXZ"===o?(this._x=h*c*u+l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d):"ZXY"===o?(this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u-h*p*d):"ZYX"===o?(this._x=h*c*u-l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u+h*p*d):"YZX"===o?(this._x=h*c*u+l*p*d,this._y=l*p*u+h*c*d,this._z=l*c*d-h*p*u,this._w=l*c*u-h*p*d):"XZY"===o&&(this._x=h*c*u-l*p*d,this._y=l*p*u-h*c*d,this._z=l*c*d+h*p*u,this._w=l*c*u+h*p*d),!1!==t&&this._onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,r=n[0],i=n[4],o=n[8],a=n[1],s=n[5],l=n[9],c=n[2],u=n[6],h=n[10],p=r+s+h;return p>0?(t=.5/Math.sqrt(p+1),this._w=.25/t,this._x=(u-l)*t,this._y=(o-c)*t,this._z=(a-i)*t):r>s&&r>h?(t=2*Math.sqrt(1+r-s-h),this._w=(u-l)/t,this._x=.25*t,this._y=(i+a)/t,this._z=(o+c)/t):s>h?(t=2*Math.sqrt(1+s-r-h),this._w=(o-c)/t,this._x=(i+a)/t,this._y=.25*t,this._z=(l+u)/t):(t=2*Math.sqrt(1+h-r-s),this._w=(a-i)/t,this._x=(o+c)/t,this._y=(l+u)/t,this._z=.25*t),this._onChangeCallback(),this},setFromUnitVectors:function(e,t){var n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(An.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);if(0===n)return this;var r=Math.min(1,t/n);return this.slerp(e,r),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,r=e._y,i=e._z,o=e._w,a=t._x,s=t._y,l=t._z,c=t._w;return this._x=n*c+o*a+r*l-i*s,this._y=r*c+o*s+i*a-n*l,this._z=i*c+o*l+n*s-r*a,this._w=o*c-n*a-r*s-i*l,this._onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,r=this._y,i=this._z,o=this._w,a=o*e._w+n*e._x+r*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;var s=1-a*a;if(s<=Number.EPSILON){var l=1-t;return this._w=l*o+t*this._w,this._x=l*n+t*this._x,this._y=l*r+t*this._y,this._z=l*i+t*this._z,this.normalize(),this._onChangeCallback(),this}var c=Math.sqrt(s),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,p=Math.sin(t*u)/c;return this._w=o*h+this._w*p,this._x=n*h+this._x*p,this._y=r*h+this._y*p,this._z=i*h+this._z*p,this._onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});var Hn=new Gn,qn=new Un;function Gn(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}Object.assign(Gn.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(qn.setFromEuler(e))},applyAxisAngle:function(e,t){return this.applyQuaternion(qn.setFromAxisAngle(e,t))},applyMatrix3:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this},applyNormalMatrix:function(e){return this.applyMatrix3(e).normalize()},applyMatrix4:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements,o=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*o,this},applyQuaternion:function(e){var t=this.x,n=this.y,r=this.z,i=e.x,o=e.y,a=e.z,s=e.w,l=s*t+o*r-a*n,c=s*n+a*t-i*r,u=s*r+i*n-o*t,h=-i*t-o*n-a*r;return this.x=l*s+h*-i+c*-a-u*-o,this.y=c*s+h*-o+u*-i-l*-a,this.z=u*s+h*-a+l*-o-c*-i,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,r=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=r*s-i*a,this.y=i*o-n*s,this.z=n*a-r*o,this},projectOnVector:function(e){var t=e.lengthSq();if(0===t)return this.set(0,0,0);var n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)},projectOnPlane:function(e){return Hn.copy(this).projectOnVector(e),this.sub(Hn)},reflect:function(e){return this.sub(Hn.copy(e).multiplyScalar(2*this.dot(e)))},angleTo:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;var n=this.dot(e)/t;return Math.acos(An.clamp(n,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,t,n){var r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},setFromMatrix3Column:function(e,t){return this.fromArray(e.elements,3*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}});var Vn=new Gn,Wn=new Zn,Xn=new Gn(0,0,0),Yn=new Gn(1,1,1),Jn=new Gn,Kn=new Gn,$n=new Gn;function Zn(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(Zn.prototype,{isMatrix4:!0,set:function(e,t,n,r,i,o,a,s,l,c,u,h,p,d,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=o,g[9]=a,g[13]=s,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=p,g[7]=d,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new Zn).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this},copyPosition:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},extractRotation:function(e){var t=this.elements,n=e.elements,r=1/Vn.setFromMatrixColumn(e,0).length(),i=1/Vn.setFromMatrixColumn(e,1).length(),o=1/Vn.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,r=e.y,i=e.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),l=Math.sin(r),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){var h=o*c,p=o*u,d=a*c,f=a*u;t[0]=s*c,t[4]=-s*u,t[8]=l,t[1]=p+d*l,t[5]=h-f*l,t[9]=-a*s,t[2]=f-h*l,t[6]=d+p*l,t[10]=o*s}else if("YXZ"===e.order){var m=s*c,g=s*u,v=l*c,b=l*u;t[0]=m+b*a,t[4]=v*a-g,t[8]=o*l,t[1]=o*u,t[5]=o*c,t[9]=-a,t[2]=g*a-v,t[6]=b+m*a,t[10]=o*s}else if("ZXY"===e.order){m=s*c,g=s*u,v=l*c,b=l*u;t[0]=m-b*a,t[4]=-o*u,t[8]=v+g*a,t[1]=g+v*a,t[5]=o*c,t[9]=b-m*a,t[2]=-o*l,t[6]=a,t[10]=o*s}else if("ZYX"===e.order){h=o*c,p=o*u,d=a*c,f=a*u;t[0]=s*c,t[4]=d*l-p,t[8]=h*l+f,t[1]=s*u,t[5]=f*l+h,t[9]=p*l-d,t[2]=-l,t[6]=a*s,t[10]=o*s}else if("YZX"===e.order){var y=o*s,_=o*l,x=a*s,w=a*l;t[0]=s*c,t[4]=w-y*u,t[8]=x*u+_,t[1]=u,t[5]=o*c,t[9]=-a*c,t[2]=-l*c,t[6]=_*u+x,t[10]=y-w*u}else if("XZY"===e.order){y=o*s,_=o*l,x=a*s,w=a*l;t[0]=s*c,t[4]=-u,t[8]=l*c,t[1]=y*u+w,t[5]=o*c,t[9]=_*u-x,t[2]=x*u-_,t[6]=a*c,t[10]=w*u+y}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){return this.compose(Xn,e,Yn)},lookAt:function(e,t,n){var r=this.elements;return $n.subVectors(e,t),0===$n.lengthSq()&&($n.z=1),$n.normalize(),Jn.crossVectors(n,$n),0===Jn.lengthSq()&&(1===Math.abs(n.z)?$n.x+=1e-4:$n.z+=1e-4,$n.normalize(),Jn.crossVectors(n,$n)),Jn.normalize(),Kn.crossVectors($n,Jn),r[0]=Jn.x,r[4]=Kn.x,r[8]=$n.x,r[1]=Jn.y,r[5]=Kn.y,r[9]=$n.y,r[2]=Jn.z,r[6]=Kn.z,r[10]=$n.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[4],s=n[8],l=n[12],c=n[1],u=n[5],h=n[9],p=n[13],d=n[2],f=n[6],m=n[10],g=n[14],v=n[3],b=n[7],y=n[11],_=n[15],x=r[0],w=r[4],S=r[8],E=r[12],C=r[1],T=r[5],k=r[9],j=r[13],O=r[2],M=r[6],P=r[10],A=r[14],R=r[3],I=r[7],L=r[11],D=r[15];return i[0]=o*x+a*C+s*O+l*R,i[4]=o*w+a*T+s*M+l*I,i[8]=o*S+a*k+s*P+l*L,i[12]=o*E+a*j+s*A+l*D,i[1]=c*x+u*C+h*O+p*R,i[5]=c*w+u*T+h*M+p*I,i[9]=c*S+u*k+h*P+p*L,i[13]=c*E+u*j+h*A+p*D,i[2]=d*x+f*C+m*O+g*R,i[6]=d*w+f*T+m*M+g*I,i[10]=d*S+f*k+m*P+g*L,i[14]=d*E+f*j+m*A+g*D,i[3]=v*x+b*C+y*O+_*R,i[7]=v*w+b*T+y*M+_*I,i[11]=v*S+b*k+y*P+_*L,i[15]=v*E+b*j+y*A+_*D,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],o=e[1],a=e[5],s=e[9],l=e[13],c=e[2],u=e[6],h=e[10],p=e[14];return e[3]*(+i*s*u-r*l*u-i*a*h+n*l*h+r*a*p-n*s*p)+e[7]*(+t*s*p-t*l*h+i*o*h-r*o*p+r*l*c-i*s*c)+e[11]*(+t*l*u-t*a*p-i*o*u+n*o*p+i*a*c-n*l*c)+e[15]*(-r*a*c-t*s*u+t*a*h+r*o*u-n*o*h+n*s*c)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e,t,n){var r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this},getInverse:function(e,t){var n=this.elements,r=e.elements,i=r[0],o=r[1],a=r[2],s=r[3],l=r[4],c=r[5],u=r[6],h=r[7],p=r[8],d=r[9],f=r[10],m=r[11],g=r[12],v=r[13],b=r[14],y=r[15],_=d*b*h-v*f*h+v*u*m-c*b*m-d*u*y+c*f*y,x=g*f*h-p*b*h-g*u*m+l*b*m+p*u*y-l*f*y,w=p*v*h-g*d*h+g*c*m-l*v*m-p*c*y+l*d*y,S=g*d*u-p*v*u-g*c*f+l*v*f+p*c*b-l*d*b,E=i*_+o*x+a*w+s*S;if(0===E){var C="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(C);return console.warn(C),this.identity()}var T=1/E;return n[0]=_*T,n[1]=(v*f*s-d*b*s-v*a*m+o*b*m+d*a*y-o*f*y)*T,n[2]=(c*b*s-v*u*s+v*a*h-o*b*h-c*a*y+o*u*y)*T,n[3]=(d*u*s-c*f*s-d*a*h+o*f*h+c*a*m-o*u*m)*T,n[4]=x*T,n[5]=(p*b*s-g*f*s+g*a*m-i*b*m-p*a*y+i*f*y)*T,n[6]=(g*u*s-l*b*s-g*a*h+i*b*h+l*a*y-i*u*y)*T,n[7]=(l*f*s-p*u*s+p*a*h-i*f*h-l*a*m+i*u*m)*T,n[8]=w*T,n[9]=(g*d*s-p*v*s-g*o*m+i*v*m+p*o*y-i*d*y)*T,n[10]=(l*v*s-g*c*s+g*o*h-i*v*h-l*o*y+i*c*y)*T,n[11]=(p*c*s-l*d*s-p*o*h+i*d*h+l*o*m-i*c*m)*T,n[12]=S*T,n[13]=(p*v*a-g*d*a+g*o*f-i*v*f-p*o*b+i*d*b)*T,n[14]=(g*c*a-l*v*a-g*o*u+i*v*u+l*o*b-i*c*b)*T,n[15]=(l*d*a-p*c*a+p*o*u-i*d*u-l*o*f+i*c*f)*T,this},scale:function(e){var t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var n=Math.cos(t),r=Math.sin(t),i=1-n,o=e.x,a=e.y,s=e.z,l=i*o,c=i*a;return this.set(l*o+n,l*a-r*s,l*s+r*a,0,l*a+r*s,c*a+n,c*s-r*o,0,l*s-r*a,c*s+r*o,i*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){var r=this.elements,i=t._x,o=t._y,a=t._z,s=t._w,l=i+i,c=o+o,u=a+a,h=i*l,p=i*c,d=i*u,f=o*c,m=o*u,g=a*u,v=s*l,b=s*c,y=s*u,_=n.x,x=n.y,w=n.z;return r[0]=(1-(f+g))*_,r[1]=(p+y)*_,r[2]=(d-b)*_,r[3]=0,r[4]=(p-y)*x,r[5]=(1-(h+g))*x,r[6]=(m+v)*x,r[7]=0,r[8]=(d+b)*w,r[9]=(m-v)*w,r[10]=(1-(h+f))*w,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this},decompose:function(e,t,n){var r=this.elements,i=Vn.set(r[0],r[1],r[2]).length(),o=Vn.set(r[4],r[5],r[6]).length(),a=Vn.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Wn.copy(this);var s=1/i,l=1/o,c=1/a;return Wn.elements[0]*=s,Wn.elements[1]*=s,Wn.elements[2]*=s,Wn.elements[4]*=l,Wn.elements[5]*=l,Wn.elements[6]*=l,Wn.elements[8]*=c,Wn.elements[9]*=c,Wn.elements[10]*=c,t.setFromRotationMatrix(Wn),n.x=i,n.y=o,n.z=a,this},makePerspective:function(e,t,n,r,i,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*i/(t-e),l=2*i/(n-r),c=(t+e)/(t-e),u=(n+r)/(n-r),h=-(o+i)/(o-i),p=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=p,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makeOrthographic:function(e,t,n,r,i,o){var a=this.elements,s=1/(t-e),l=1/(n-r),c=1/(o-i),u=(t+e)*s,h=(n+r)*l,p=(o+i)*c;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-p,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}});var Qn=new Zn,er=new Un;function tr(e,t,n,r){this._x=e||0,this._y=t||0,this._z=n||0,this._order=r||tr.DefaultOrder}function nr(){this.mask=1}tr.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],tr.DefaultOrder="XYZ",Object.defineProperties(tr.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}}),Object.assign(tr.prototype,{isEuler:!0,set:function(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var r=An.clamp,i=e.elements,o=i[0],a=i[4],s=i[8],l=i[1],c=i[5],u=i[9],h=i[2],p=i[6],d=i[10];return"XYZ"===(t=t||this._order)?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,d),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(p,c),this._z=0)):"YXZ"===t?(this._x=Math.asin(-r(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,o),this._z=0)):"ZXY"===t?(this._x=Math.asin(r(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,o))):"ZYX"===t?(this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,d),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,c))):"YZX"===t?(this._z=Math.asin(r(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,d))):"XZY"===t?(this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(e,t,n){return Qn.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Qn,t,n)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return er.setFromEuler(this),this.setFromQuaternion(er,e)},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new Gn(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}}),Object.assign(nr.prototype,{set:function(e){this.mask=1<1){for(var t=0;t1){for(var t=0;t0){r.children=[];for(s=0;s0&&(n.geometries=h),p.length>0&&(n.materials=p),d.length>0&&(n.textures=d),f.length>0&&(n.images=f),a.length>0&&(n.shapes=a)}return n.object=r,n;function m(e){var t=[];for(var n in e){var r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var n=0;ns)return!1}return!0}Object.assign(Pr.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,l=e.length;si&&(i=c),u>o&&(o=u),h>a&&(a=h)}return this.min.set(t,n,r),this.max.set(i,o,a),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,l=e.count;si&&(i=c),u>o&&(o=u),h>a&&(a=h)}return this.min.set(t,n,r),this.max.set(i,o,a),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new Gn),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)},intersectsSphere:function(e){return this.clampPoint(e.center,yr),yr.distanceToSquared(e.center)<=e.radius*e.radius},intersectsPlane:function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant},intersectsTriangle:function(e){if(this.isEmpty())return!1;this.getCenter(kr),jr.subVectors(this.max,kr),xr.subVectors(e.a,kr),wr.subVectors(e.b,kr),Sr.subVectors(e.c,kr),Er.subVectors(wr,xr),Cr.subVectors(Sr,wr),Tr.subVectors(xr,Sr);var t=[0,-Er.z,Er.y,0,-Cr.z,Cr.y,0,-Tr.z,Tr.y,Er.z,0,-Er.x,Cr.z,0,-Cr.x,Tr.z,0,-Tr.x,-Er.y,Er.x,0,-Cr.y,Cr.x,0,-Tr.y,Tr.x,0];return!!Ar(t,xr,wr,Sr,jr)&&(!!Ar(t=[1,0,0,0,1,0,0,0,1],xr,wr,Sr,jr)&&(Or.crossVectors(Er,Cr),Ar(t=[Or.x,Or.y,Or.z],xr,wr,Sr,jr)))},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new Gn),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return yr.copy(e).clamp(this.min,this.max).sub(e).length()},getBoundingSphere:function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(yr).length(),e},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(e){return this.isEmpty()?this:(br[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),br[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),br[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),br[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),br[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),br[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),br[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),br[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(br),this)},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var Rr=new Pr;function Ir(e,t){this.center=void 0!==e?e:new Gn,this.radius=void 0!==t?t:0}Object.assign(Ir.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(e,t){var n=this.center;void 0!==t?n.copy(t):Rr.setFromPoints(e).getCenter(n);for(var r=0,i=0,o=e.length;ithis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},getBoundingBox:function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new Pr),e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}});var Lr=new Gn,Dr=new Gn,Nr=new Gn,Fr=new Gn,Br=new Gn,zr=new Gn,Ur=new Gn;function Hr(e,t){this.origin=void 0!==e?e:new Gn,this.direction=void 0!==t?t:new Gn(0,0,-1)}Object.assign(Hr.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new Gn),t.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(e){return this.origin.copy(this.at(e,Lr)),this},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new Gn),t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(e){var t=Lr.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Lr.copy(this.direction).multiplyScalar(t).add(this.origin),Lr.distanceToSquared(e))},distanceSqToSegment:function(e,t,n,r){Dr.copy(e).add(t).multiplyScalar(.5),Nr.copy(t).sub(e).normalize(),Fr.copy(this.origin).sub(Dr);var i,o,a,s,l=.5*e.distanceTo(t),c=-this.direction.dot(Nr),u=Fr.dot(this.direction),h=-Fr.dot(Nr),p=Fr.lengthSq(),d=Math.abs(1-c*c);if(d>0)if(o=c*u-h,s=l*d,(i=c*h-u)>=0)if(o>=-s)if(o<=s){var f=1/d;a=(i*=f)*(i+c*(o*=f)+2*u)+o*(c*i+o+2*h)+p}else o=l,a=-(i=Math.max(0,-(c*o+u)))*i+o*(o+2*h)+p;else o=-l,a=-(i=Math.max(0,-(c*o+u)))*i+o*(o+2*h)+p;else o<=-s?a=-(i=Math.max(0,-(-c*l+u)))*i+(o=i>0?-l:Math.min(Math.max(-l,-h),l))*(o+2*h)+p:o<=s?(i=0,a=(o=Math.min(Math.max(-l,-h),l))*(o+2*h)+p):a=-(i=Math.max(0,-(c*l+u)))*i+(o=i>0?l:Math.min(Math.max(-l,-h),l))*(o+2*h)+p;else o=c>0?-l:l,a=-(i=Math.max(0,-(c*o+u)))*i+o*(o+2*h)+p;return n&&n.copy(this.direction).multiplyScalar(i).add(this.origin),r&&r.copy(Nr).multiplyScalar(o).add(Dr),a},intersectSphere:function(e,t){Lr.subVectors(e.center,this.origin);var n=Lr.dot(this.direction),r=Lr.dot(Lr)-n*n,i=e.radius*e.radius;if(r>i)return null;var o=Math.sqrt(i-r),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,t):this.at(a,t)},intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},intersectBox:function(e,t){var n,r,i,o,a,s,l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,h=this.origin;return l>=0?(n=(e.min.x-h.x)*l,r=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,r=(e.min.x-h.x)*l),c>=0?(i=(e.min.y-h.y)*c,o=(e.max.y-h.y)*c):(i=(e.max.y-h.y)*c,o=(e.min.y-h.y)*c),n>o||i>r?null:((i>n||n!==n)&&(n=i),(o=0?(a=(e.min.z-h.z)*u,s=(e.max.z-h.z)*u):(a=(e.max.z-h.z)*u,s=(e.min.z-h.z)*u),n>s||a>r?null:((a>n||n!==n)&&(n=a),(s=0?n:r,t)))},intersectsBox:function(e){return null!==this.intersectBox(e,Lr)},intersectTriangle:function(e,t,n,r,i){Br.subVectors(t,e),zr.subVectors(n,e),Ur.crossVectors(Br,zr);var o,a=this.direction.dot(Ur);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}Fr.subVectors(this.origin,e);var s=o*this.direction.dot(zr.crossVectors(Fr,zr));if(s<0)return null;var l=o*this.direction.dot(Br.cross(Fr));if(l<0)return null;if(s+l>a)return null;var c=-o*Fr.dot(Ur);return c<0?null:this.at(c/a,i)},applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}});var qr=new Gn,Gr=new Gn,Vr=new In;function Wr(e,t){this.normal=void 0!==e?e:new Gn(1,0,0),this.constant=void 0!==t?t:0}Object.assign(Wr.prototype,{isPlane:!0,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(e,t,n){var r=qr.subVectors(n,t).cross(Gr.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return void 0===t&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new Gn),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(e,t){void 0===t&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new Gn);var n=e.delta(qr),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):void 0;var i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?void 0:t.copy(n).multiplyScalar(i).add(e.start)},intersectsLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new Gn),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,t){var n=t||Vr.getNormalMatrix(e),r=this.coplanarPoint(qr).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this},translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}});var Xr=new Gn,Yr=new Gn,Jr=new Gn,Kr=new Gn,$r=new Gn,Zr=new Gn,Qr=new Gn,ei=new Gn,ti=new Gn,ni=new Gn;function ri(e,t,n){this.a=void 0!==e?e:new Gn,this.b=void 0!==t?t:new Gn,this.c=void 0!==n?n:new Gn}Object.assign(ri,{getNormal:function(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new Gn),r.subVectors(n,t),Xr.subVectors(e,t),r.cross(Xr);var i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)},getBarycoord:function(e,t,n,r,i){Xr.subVectors(r,t),Yr.subVectors(n,t),Jr.subVectors(e,t);var o=Xr.dot(Xr),a=Xr.dot(Yr),s=Xr.dot(Jr),l=Yr.dot(Yr),c=Yr.dot(Jr),u=o*l-a*a;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new Gn),0===u)return i.set(-2,-1,-1);var h=1/u,p=(l*s-a*c)*h,d=(o*c-a*s)*h;return i.set(1-p-d,d,p)},containsPoint:function(e,t,n,r){return ri.getBarycoord(e,t,n,r,Kr),Kr.x>=0&&Kr.y>=0&&Kr.x+Kr.y<=1},getUV:function(e,t,n,r,i,o,a,s){return this.getBarycoord(e,t,n,r,Kr),s.set(0,0),s.addScaledVector(i,Kr.x),s.addScaledVector(o,Kr.y),s.addScaledVector(a,Kr.z),s},isFrontFacing:function(e,t,n,r){return Xr.subVectors(n,t),Yr.subVectors(e,t),Xr.cross(Yr).dot(r)<0}}),Object.assign(ri.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:function(){return Xr.subVectors(this.c,this.b),Yr.subVectors(this.a,this.b),.5*Xr.cross(Yr).length()},getMidpoint:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new Gn),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return ri.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Wr),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return ri.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,n,r,i){return ri.getUV(e,this.a,this.b,this.c,t,n,r,i)},containsPoint:function(e){return ri.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return ri.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new Gn);var n,r,i=this.a,o=this.b,a=this.c;$r.subVectors(o,i),Zr.subVectors(a,i),ei.subVectors(e,i);var s=$r.dot(ei),l=Zr.dot(ei);if(s<=0&&l<=0)return t.copy(i);ti.subVectors(e,o);var c=$r.dot(ti),u=Zr.dot(ti);if(c>=0&&u<=c)return t.copy(o);var h=s*u-c*l;if(h<=0&&s>=0&&c<=0)return n=s/(s-c),t.copy(i).addScaledVector($r,n);ni.subVectors(e,a);var p=$r.dot(ni),d=Zr.dot(ni);if(d>=0&&p<=d)return t.copy(a);var f=p*l-s*d;if(f<=0&&l>=0&&d<=0)return r=l/(l-d),t.copy(i).addScaledVector(Zr,r);var m=c*d-p*u;if(m<=0&&u-c>=0&&p-d>=0)return Qr.subVectors(a,o),r=(u-c)/(u-c+(p-d)),t.copy(o).addScaledVector(Qr,r);var g=1/(m+f+h);return n=f*g,r=h*g,t.copy(i).addScaledVector($r,n).addScaledVector(Zr,r)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}});var ii={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},oi={h:0,s:0,l:0},ai={h:0,s:0,l:0};function si(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}function li(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function ci(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function ui(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}function hi(e,t,n,r,i,o){this.a=e,this.b=t,this.c=n,this.normal=r&&r.isVector3?r:new Gn,this.vertexNormals=Array.isArray(r)?r:[],this.color=i&&i.isColor?i:new si,this.vertexColors=Array.isArray(i)?i:[],this.materialIndex=void 0!==o?o:0}Object.assign(si.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"===typeof e?this.setHex(e):"string"===typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(e,t,n){if(e=An.euclideanModulo(e,1),t=An.clamp(t,0,1),n=An.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=li(i,r,e+1/3),this.g=li(i,r,e),this.b=li(i,r,e-1/3)}return this},setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,i=n[1],o=n[2];switch(i){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,l=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(a,s,l)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var c=n[1],u=c.length;if(3===u)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===u)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 e&&e.length>0?this.setColorName(e):this},setColorName:function(e){var t=ii[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},copySRGBToLinear:function(e){return this.r=ci(e.r),this.g=ci(e.g),this.b=ci(e.b),this},copyLinearToSRGB:function(e){return this.r=ui(e.r),this.g=ui(e.g),this.b=ui(e.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,n,r=this.r,i=this.g,o=this.b,a=Math.max(r,i,o),s=Math.min(r,i,o),l=(s+a)/2;if(s===a)t=0,n=0;else{var c=a-s;switch(n=l<=.5?c/(a+s):c/(2-a-s),a){case r:t=(i-o)/c+(i0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){var i=r(e.textures),o=r(e.images);i.length>0&&(n.textures=i),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(null!==t){var r=t.length;n=new Array(r);for(var i=0;i!==r;++i)n[i]=t[i].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(di.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),fi.prototype=Object.create(di.prototype),fi.prototype.constructor=fi,fi.prototype.isMeshBasicMaterial=!0,fi.prototype.copy=function(e){return di.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};var mi=new Gn;function gi(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=yn,this.updateRange={offset:0,count:-1},this.version=0}function vi(e,t,n){gi.call(this,new Int8Array(e),t,n)}function bi(e,t,n){gi.call(this,new Uint8Array(e),t,n)}function yi(e,t,n){gi.call(this,new Uint8ClampedArray(e),t,n)}function _i(e,t,n){gi.call(this,new Int16Array(e),t,n)}function xi(e,t,n){gi.call(this,new Uint16Array(e),t,n)}function wi(e,t,n){gi.call(this,new Int32Array(e),t,n)}function Si(e,t,n){gi.call(this,new Uint32Array(e),t,n)}function Ei(e,t,n){gi.call(this,new Float32Array(e),t,n)}function Ci(e,t,n){gi.call(this,new Float64Array(e),t,n)}function Ti(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function ki(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,r=e.length;nt&&(t=e[n]);return t}Object.defineProperty(gi.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(gi.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var r=0,i=this.itemSize;r0,a=i[1]&&i[1].length>0,s=e.morphTargets,l=s.length;if(l>0){t=[];for(var c=0;c0){u=[];for(c=0;c0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(c=0;c65535?Si:xi)(e,1):this.index=e},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){var t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var r=(new In).getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}var i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(e),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return Oi.makeRotationX(e),this.applyMatrix4(Oi),this},rotateY:function(e){return Oi.makeRotationY(e),this.applyMatrix4(Oi),this},rotateZ:function(e){return Oi.makeRotationZ(e),this.applyMatrix4(Oi),this},translate:function(e,t,n){return Oi.makeTranslation(e,t,n),this.applyMatrix4(Oi),this},scale:function(e,t,n){return Oi.makeScale(e,t,n),this.applyMatrix4(Oi),this},lookAt:function(e){return Mi.lookAt(e),Mi.updateMatrix(),this.applyMatrix4(Mi.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Pi).negate(),this.translate(Pi.x,Pi.y,Pi.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new Ei(3*t.vertices.length,3),r=new Ei(3*t.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(t.vertices)),this.setAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var i=new Ei(t.lineDistances.length,1);this.setAttribute("lineDistance",i.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,r=e.length;n0){var n=new Float32Array(3*e.normals.length);this.setAttribute("normal",new gi(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var r=new Float32Array(3*e.colors.length);this.setAttribute("color",new gi(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var i=new Float32Array(2*e.uvs.length);this.setAttribute("uv",new gi(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var o=new Float32Array(2*e.uvs2.length);this.setAttribute("uv2",new gi(o,2).copyVector2sArray(e.uvs2))}for(var a in this.groups=e.groups,e.morphTargets){for(var s=[],l=e.morphTargets[a],c=0,u=l.length;c0){var d=new Ei(4*e.skinIndices.length,4);this.setAttribute("skinIndex",d.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var f=new Ei(4*e.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Pr);var e=this.attributes.position,t=this.morphAttributes.position;if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,r=t.length;n0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var r=this.index;null!==r&&(e.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});var i=this.attributes;for(var n in i){var o=(p=i[n]).toJSON();""!==p.name&&(o.name=p.name),e.data.attributes[n]=o}var a={},s=!1;for(var n in this.morphAttributes){for(var l=this.morphAttributes[n],c=[],u=0,h=l.length;u0&&(a[n]=c,s=!0)}s&&(e.data.morphAttributes=a,e.data.morphTargetsRelative=this.morphTargetsRelative);var d=this.groups;d.length>0&&(e.data.groups=JSON.parse(JSON.stringify(d)));var f=this.boundingSphere;return null!==f&&(e.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),e},clone:function(){return(new Li).copy(this)},copy:function(e){var t,n,r;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var i=e.index;null!==i&&this.setIndex(i.clone());var o=e.attributes;for(t in o){var a=o[t];this.setAttribute(t,a.clone())}var s=e.morphAttributes;for(t in s){var l=[],c=s[t];for(n=0,r=c.length;nn.far?null:{distance:l,point:Zi.clone(),object:e}}function to(e,t,n,r,i,o,a,s,l,c,u,h){Bi.fromBufferAttribute(i,c),zi.fromBufferAttribute(i,u),Ui.fromBufferAttribute(i,h);var p=e.morphTargetInfluences;if(t.morphTargets&&o&&p){Vi.set(0,0,0),Wi.set(0,0,0),Xi.set(0,0,0);for(var d=0,f=o.length;d0){var a=i[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=a.length;e0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){var n,r=this.geometry,i=this.material,o=this.matrixWorld;if(void 0!==i&&(null===r.boundingSphere&&r.computeBoundingSphere(),Fi.copy(r.boundingSphere),Fi.applyMatrix4(o),!1!==e.ray.intersectsSphere(Fi)&&(Di.getInverse(o),Ni.copy(e.ray).applyMatrix4(Di),null===r.boundingBox||!1!==Ni.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var a,s,l,c,u,h,p,d,f,m=r.index,g=r.attributes.position,v=r.morphAttributes.position,b=r.morphTargetsRelative,y=r.attributes.uv,_=r.attributes.uv2,x=r.groups,w=r.drawRange;if(null!==m)if(Array.isArray(i))for(c=0,h=x.length;c0&&(T=M);for(var P=0,A=O.length;P0)for(c=0;c0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,n;for(this.computeFaceNormals(),e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,r,i;for(n=0,r=this.faces.length;n=0;n--){var f=p[n];for(this.faces.splice(f,1),a=0,s=this.faceVertexUvs.length;a0,g=d.vertexNormals.length>0,v=1!==d.color.r||1!==d.color.g||1!==d.color.b,b=d.vertexColors.length>0,y=0;if(y=S(y,0,0),y=S(y,1,!0),y=S(y,2,!1),y=S(y,3,f),y=S(y,4,m),y=S(y,5,g),y=S(y,6,v),y=S(y,7,b),a.push(y),a.push(d.a,d.b,d.c),a.push(d.materialIndex),f){var _=this.faceVertexUvs[0][i];a.push(T(_[0]),T(_[1]),T(_[2]))}if(m&&a.push(E(d.normal)),g){var x=d.vertexNormals;a.push(E(x[0]),E(x[1]),E(x[2]))}if(v&&a.push(C(d.color)),b){var w=d.vertexColors;a.push(C(w[0]),C(w[1]),C(w[2]))}}function S(e,t,n){return n?e|1<0&&(e.data.colors=c),h.length>0&&(e.data.uvs=[h]),e.data.faces=a,e},clone:function(){return(new ao).copy(this)},copy:function(e){var t,n,r,i,o,a;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var s=e.vertices;for(t=0,n=s.length;t0?1:-1,m.push(O.x,O.y,O.z),g.push(h/l),g.push(1-y/c),k+=1}}for(y=0;y0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var i={};for(var o in this.extensions)!0===this.extensions[o]&&(i[o]=!0);return Object.keys(i).length>0&&(t.extensions=i),t},go.prototype=Object.assign(Object.create(gr.prototype),{constructor:go,isCamera:!0,copy:function(e,t){return gr.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new Gn),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){gr.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(e,t){gr.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),vo.prototype=Object.assign(Object.create(go.prototype),{constructor:vo,isPerspectiveCamera:!0,copy:function(e,t){return go.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*An.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*An.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*An.RAD2DEG*Math.atan(Math.tan(.5*An.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,o){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*An.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;i+=o.offsetX*r/a,t-=o.offsetY*n/s,r*=o.width/a,n*=o.height/s}var l=this.filmOffset;0!==l&&(i+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=gr.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});var bo=90,yo=1;function _o(e,t,n,r){gr.call(this),this.type="CubeCamera";var i=new vo(bo,yo,e,t);i.up.set(0,-1,0),i.lookAt(new Gn(1,0,0)),this.add(i);var o=new vo(bo,yo,e,t);o.up.set(0,-1,0),o.lookAt(new Gn(-1,0,0)),this.add(o);var a=new vo(bo,yo,e,t);a.up.set(0,0,1),a.lookAt(new Gn(0,1,0)),this.add(a);var s=new vo(bo,yo,e,t);s.up.set(0,0,-1),s.lookAt(new Gn(0,-1,0)),this.add(s);var l=new vo(bo,yo,e,t);l.up.set(0,-1,0),l.lookAt(new Gn(0,0,1)),this.add(l);var c=new vo(bo,yo,e,t);c.up.set(0,-1,0),c.lookAt(new Gn(0,0,-1)),this.add(c),r=r||{format:Ke,magFilter:Ae,minFilter:Ae},this.renderTarget=new xo(n,r),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var n=e.getRenderTarget(),r=this.renderTarget,u=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,e.setRenderTarget(r,0),e.render(t,i),e.setRenderTarget(r,1),e.render(t,o),e.setRenderTarget(r,2),e.render(t,a),e.setRenderTarget(r,3),e.render(t,s),e.setRenderTarget(r,4),e.render(t,l),r.texture.generateMipmaps=u,e.setRenderTarget(r,5),e.render(t,c),e.setRenderTarget(n)},this.clear=function(e,t,n,r){for(var i=e.getRenderTarget(),o=this.renderTarget,a=0;a<6;a++)e.setRenderTarget(o,a),e.clear(t,n,r);e.setRenderTarget(i)}}function xo(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),Bn.call(this,e,e,t)}function wo(e,t,n,r,i,o,a,s,l,c,u,h){Nn.call(this,null,o,a,s,l,c,r,i,u,h),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==l?l:ke,this.minFilter=void 0!==c?c:ke,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}_o.prototype=Object.create(gr.prototype),_o.prototype.constructor=_o,xo.prototype=Object.create(Bn.prototype),xo.prototype.constructor=xo,xo.prototype.isWebGLCubeRenderTarget=!0,xo.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var n=new vr,r={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include ","\t#include ","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#define RECIPROCAL_PI 0.31830988618","#define RECIPROCAL_PI2 0.15915494","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV;","\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;","\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},i=new mo({type:"CubemapFromEquirect",uniforms:co(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:E,blending:P});i.uniforms.tEquirect.value=t;var o=new Qi(new lo(5,5,5),i);n.add(o);var a=new _o(1,10,1);return a.renderTarget=this,a.renderTarget.texture.name="CubeCameraTexture",a.update(e,n),o.geometry.dispose(),o.material.dispose(),this},wo.prototype=Object.create(Nn.prototype),wo.prototype.constructor=wo,wo.prototype.isDataTexture=!0;var So=new Ir,Eo=new Gn;function Co(e,t,n,r,i,o){this.planes=[void 0!==e?e:new Wr,void 0!==t?t:new Wr,void 0!==n?n:new Wr,void 0!==r?r:new Wr,void 0!==i?i:new Wr,void 0!==o?o:new Wr]}Object.assign(Co.prototype,{set:function(e,t,n,r,i,o){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this},setFromProjectionMatrix:function(e){var t=this.planes,n=e.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],c=n[6],u=n[7],h=n[8],p=n[9],d=n[10],f=n[11],m=n[12],g=n[13],v=n[14],b=n[15];return t[0].setComponents(a-r,u-s,f-h,b-m).normalize(),t[1].setComponents(a+r,u+s,f+h,b+m).normalize(),t[2].setComponents(a+i,u+l,f+p,b+g).normalize(),t[3].setComponents(a-i,u-l,f-p,b-g).normalize(),t[4].setComponents(a-o,u-c,f-d,b-v).normalize(),t[5].setComponents(a+o,u+c,f+d,b+v).normalize(),this},intersectsObject:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),So.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(So)},intersectsSprite:function(e){return So.center.set(0,0,0),So.radius=.7071067811865476,So.applyMatrix4(e.matrixWorld),this.intersectsSphere(So)},intersectsSphere:function(e){for(var t=this.planes,n=e.center,r=-e.radius,i=0;i<6;i++){if(t[i].distanceToPoint(n)0?e.max.x:e.min.x,Eo.y=r.normal.y>0?e.max.y:e.min.y,Eo.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Eo)<0)return!1}return!0},containsPoint:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}});var To={common:{diffuse:{value:new si(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new In},uv2Transform:{value:new In},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 Rn(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 si(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new si(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new In}},sprite:{diffuse:{value:new si(15658734)},opacity:{value:1},center:{value:new Rn(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new In}}};function ko(){var e=null,t=!1,n=null;function r(i,o){!1!==t&&(n(i,o),e.requestAnimationFrame(r))}return{start:function(){!0!==t&&null!==n&&(e.requestAnimationFrame(r),t=!0)},stop:function(){t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function jo(e,t){var n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){t.isInterleavedBufferAttribute&&(t=t.data);var o=r.get(t);void 0===o?r.set(t,function(t,n){var r=t.array,i=t.usage,o=e.createBuffer();e.bindBuffer(n,o),e.bufferData(n,r,i),t.onUploadCallback();var a=5126;return r instanceof Float32Array?a=5126:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?a=5123:r instanceof Int16Array?a=5122:r instanceof Uint32Array?a=5125:r instanceof Int32Array?a=5124:r instanceof Int8Array?a=5120:r instanceof Uint8Array&&(a=5121),{buffer:o,type:a,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version}}(t,i)):o.version 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\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#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\ttransformedNormal = mat3( instanceMatrix ) * 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\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",lights_pars_begin:"uniform 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\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_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 = saturate( clearcoat );\tmaterial.clearcoatRoughness = max( 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#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( pointLight.shadow, directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( spotLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( directionalLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 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\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\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_normalmap_pars_fragment:"#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\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= all( bvec2( directionalLight.shadow, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= all( bvec2( spotLight.shadow, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= all( bvec2( pointLight.shadow, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform 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 \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\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 \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define 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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( 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 \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_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 \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#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 \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = 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 \n\t#include \n\t#include \n}"},Ao={basic:{uniforms:uo([To.common,To.specularmap,To.envmap,To.aomap,To.lightmap,To.fog]),vertexShader:Po.meshbasic_vert,fragmentShader:Po.meshbasic_frag},lambert:{uniforms:uo([To.common,To.specularmap,To.envmap,To.aomap,To.lightmap,To.emissivemap,To.fog,To.lights,{emissive:{value:new si(0)}}]),vertexShader:Po.meshlambert_vert,fragmentShader:Po.meshlambert_frag},phong:{uniforms:uo([To.common,To.specularmap,To.envmap,To.aomap,To.lightmap,To.emissivemap,To.bumpmap,To.normalmap,To.displacementmap,To.fog,To.lights,{emissive:{value:new si(0)},specular:{value:new si(1118481)},shininess:{value:30}}]),vertexShader:Po.meshphong_vert,fragmentShader:Po.meshphong_frag},standard:{uniforms:uo([To.common,To.envmap,To.aomap,To.lightmap,To.emissivemap,To.bumpmap,To.normalmap,To.displacementmap,To.roughnessmap,To.metalnessmap,To.fog,To.lights,{emissive:{value:new si(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Po.meshphysical_vert,fragmentShader:Po.meshphysical_frag},toon:{uniforms:uo([To.common,To.specularmap,To.aomap,To.lightmap,To.emissivemap,To.bumpmap,To.normalmap,To.displacementmap,To.gradientmap,To.fog,To.lights,{emissive:{value:new si(0)},specular:{value:new si(1118481)},shininess:{value:30}}]),vertexShader:Po.meshtoon_vert,fragmentShader:Po.meshtoon_frag},matcap:{uniforms:uo([To.common,To.bumpmap,To.normalmap,To.displacementmap,To.fog,{matcap:{value:null}}]),vertexShader:Po.meshmatcap_vert,fragmentShader:Po.meshmatcap_frag},points:{uniforms:uo([To.points,To.fog]),vertexShader:Po.points_vert,fragmentShader:Po.points_frag},dashed:{uniforms:uo([To.common,To.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Po.linedashed_vert,fragmentShader:Po.linedashed_frag},depth:{uniforms:uo([To.common,To.displacementmap]),vertexShader:Po.depth_vert,fragmentShader:Po.depth_frag},normal:{uniforms:uo([To.common,To.bumpmap,To.normalmap,To.displacementmap,{opacity:{value:1}}]),vertexShader:Po.normal_vert,fragmentShader:Po.normal_frag},sprite:{uniforms:uo([To.sprite,To.fog]),vertexShader:Po.sprite_vert,fragmentShader:Po.sprite_frag},background:{uniforms:{uvTransform:{value:new In},t2D:{value:null}},vertexShader:Po.background_vert,fragmentShader:Po.background_frag},cube:{uniforms:uo([To.envmap,{opacity:{value:1}}]),vertexShader:Po.cube_vert,fragmentShader:Po.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Po.equirect_vert,fragmentShader:Po.equirect_frag},distanceRGBA:{uniforms:uo([To.common,To.displacementmap,{referencePosition:{value:new Gn},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Po.distanceRGBA_vert,fragmentShader:Po.distanceRGBA_frag},shadow:{uniforms:uo([To.lights,To.fog,{color:{value:new si(0)},opacity:{value:1}}]),vertexShader:Po.shadow_vert,fragmentShader:Po.shadow_frag}};function Ro(e,t,n,r){var i,o,a=new si(0),s=0,l=null,c=0,u=null;function h(e,n){t.buffers.color.setClear(e.r,e.g,e.b,n,r)}return{getClearColor:function(){return a},setClearColor:function(e,t){a.set(e),h(a,s=void 0!==t?t:1)},getClearAlpha:function(){return s},setClearAlpha:function(e){h(a,s=e)},render:function(t,r,p,d){var f=r.background,m=e.xr,g=m.getSession&&m.getSession();if(g&&"additive"===g.environmentBlendMode&&(f=null),null===f?h(a,s):f&&f.isColor&&(h(f,1),d=!0),(e.autoClear||d)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),f&&(f.isCubeTexture||f.isWebGLCubeRenderTarget||f.mapping===we)){void 0===o&&((o=new Qi(new lo(1,1,1),new mo({type:"BackgroundCubeMaterial",uniforms:co(Ao.cube.uniforms),vertexShader:Ao.cube.vertexShader,fragmentShader:Ao.cube.fragmentShader,side:E,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(o));var v=f.isWebGLCubeRenderTarget?f.texture:f;o.material.uniforms.envMap.value=v,o.material.uniforms.flipEnvMap.value=v.isCubeTexture?-1:1,l===f&&c===v.version&&u===e.toneMapping||(o.material.needsUpdate=!0,l=f,c=v.version,u=e.toneMapping),t.unshift(o,o.geometry,o.material,0,0,null)}else f&&f.isTexture&&(void 0===i&&((i=new Qi(new Mo(2,2),new mo({type:"BackgroundMaterial",uniforms:co(Ao.background.uniforms),vertexShader:Ao.background.vertexShader,fragmentShader:Ao.background.fragmentShader,side:S,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(i.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(i)),i.material.uniforms.t2D.value=f,!0===f.matrixAutoUpdate&&f.updateMatrix(),i.material.uniforms.uvTransform.value.copy(f.matrix),l===f&&c===f.version&&u===e.toneMapping||(i.material.needsUpdate=!0,l=f,c=f.version,u=e.toneMapping),t.unshift(i,i.geometry,i.material,0,0,null))}}}function Io(e,t,n,r){var i,o=r.isWebGL2;this.setMode=function(e){i=e},this.render=function(t,r){e.drawArrays(i,t,r),n.update(r,i)},this.renderInstances=function(r,a,s,l){if(0!==l){var c,u;if(o)c=e,u="drawArraysInstanced";else if(u="drawArraysInstancedANGLE",null===(c=t.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[u](i,a,s,l),n.update(s,i,l)}}}function Lo(e,t,n){var r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o="undefined"!==typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!==typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,a=void 0!==n.precision?n.precision:"highp",s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var l=!0===n.logarithmicDepthBuffer,c=e.getParameter(34930),u=e.getParameter(35660),h=e.getParameter(3379),p=e.getParameter(34076),d=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),g=e.getParameter(36349),v=u>0,b=o||!!t.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==r)return r;var n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:p,maxAttributes:d,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:b,floatVertexTextures:v&&b,maxSamples:o?e.getParameter(36183):0}}function Do(){var e=this,t=null,n=0,r=!1,i=!1,o=new Wr,a=new In,s={value:null,needsUpdate:!1};function l(){s.value!==t&&(s.value=t,s.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function c(t,n,r,i){var l=null!==t?t.length:0,c=null;if(0!==l){if(c=s.value,!0!==i||null===c){var u=r+4*l,h=n.matrixWorldInverse;a.getNormalMatrix(h),(null===c||c.length65535?Si:xi)(n,1);d.version=a,t.update(d,34963);var f=i.get(e);f&&t.remove(f),i.set(e,d)}return{get:function(e,t){var i=r.get(t);return i||(t.addEventListener("dispose",o),t.isBufferGeometry?i=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new Li).setFromObject(e)),i=t._bufferGeometry),r.set(t,i),n.memory.geometries++,i)},update:function(e){var n=e.index,r=e.attributes;for(var i in null!==n&&t.update(n,34963),r)t.update(r[i],34962);var o=e.morphAttributes;for(var i in o)for(var a=o[i],s=0,l=a.length;s0)return e;var i=t*n,o=$o[i];if(void 0===o&&(o=new Float32Array(i),$o[i]=o),0!==t){r.toArray(o,0);for(var a=1,s=0;a!==t;++a)s+=n,e[a].toArray(o,s)}return o}function ra(e,t){if(e.length!==t.length)return!1;for(var n=0,r=e.length;n/gm;function Qa(e){return e.replace(Za,es)}function es(e,t){var n=Po[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Qa(n)}var ts=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function ns(e){return e.replace(ts,rs)}function rs(e,t,n,r){for(var i="",o=parseInt(t);o0?e.gammaFactor:1,f=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Ja).join("\n")}(n),m=function(e){var t=[];for(var n in e){var r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(a),g=o.createProgram(),v=n.numMultiviewViews;if(n.isRawShaderMaterial?((r=[m].filter(Ja).join("\n")).length>0&&(r+="\n"),(i=[f,m].filter(Ja).join("\n")).length>0&&(i+="\n")):(r=[is(n),"#define SHADER_NAME "+n.shaderName,m,n.instancing?"#define USE_INSTANCING":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#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 "+h:"",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.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&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",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(Ja).join("\n"),i=[f,is(n),"#define SHADER_NAME "+n.shaderName,m,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,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 "+u:"",n.envMap?"#define "+h:"",n.envMap?"#define "+p:"",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.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 "+c:"",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;",n.toneMapping!==ue?"#define TONE_MAPPING":"",n.toneMapping!==ue?Po.tonemapping_pars_fragment:"",n.toneMapping!==ue?Ya("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.outputEncoding||n.mapEncoding||n.matcapEncoding||n.envMapEncoding||n.emissiveMapEncoding||n.lightMapEncoding?Po.encodings_pars_fragment:"",n.mapEncoding?Wa("mapTexelToLinear",n.mapEncoding):"",n.matcapEncoding?Wa("matcapTexelToLinear",n.matcapEncoding):"",n.envMapEncoding?Wa("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?Wa("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMapEncoding?Wa("lightMapTexelToLinear",n.lightMapEncoding):"",n.outputEncoding?Xa("linearToOutputTexel",n.outputEncoding):"",n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Ja).join("\n")),s=$a(s=Ka(s=Qa(s),n),n),l=$a(l=Ka(l=Qa(l),n),n),s=ns(s),l=ns(l),n.isWebGL2&&!n.isRawShaderMaterial){var b=!1,y=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&null!==s.match(y)&&null!==l.match(y)&&(b=!0,s=s.replace(y,""),l=l.replace(y,"")),r=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+r,i=["#version 300 es\n","#define varying in",b?"":"out highp vec4 pc_fragColor;",b?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+i,v>0&&(r=(r=r.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","layout(num_views = "+v+") in;","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace(["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;"].join("\n"),["uniform mat4 modelViewMatrices["+v+"];","uniform mat4 projectionMatrices["+v+"];","uniform mat4 viewMatrices["+v+"];","uniform mat3 normalMatrices["+v+"];","#define modelViewMatrix modelViewMatrices[VIEW_ID]","#define projectionMatrix projectionMatrices[VIEW_ID]","#define viewMatrix viewMatrices[VIEW_ID]","#define normalMatrix normalMatrices[VIEW_ID]"].join("\n")),i=(i=i.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace("uniform mat4 viewMatrix;",["uniform mat4 viewMatrices["+v+"];","#define viewMatrix viewMatrices[VIEW_ID]"].join("\n")))}var S,E,C=i+l,T=Ha(o,35633,r+s),k=Ha(o,35632,C);if(o.attachShader(g,T),o.attachShader(g,k),void 0!==n.index0AttributeName?o.bindAttribLocation(g,0,n.index0AttributeName):!0===n.morphTargets&&o.bindAttribLocation(g,0,"position"),o.linkProgram(g),e.debug.checkShaderErrors){var j=o.getProgramInfoLog(g).trim(),O=o.getShaderInfoLog(T).trim(),M=o.getShaderInfoLog(k).trim(),P=!0,A=!0;if(!1===o.getProgramParameter(g,35714)){P=!1;var R=Va(o,T,"vertex"),I=Va(o,k,"fragment");console.error("THREE.WebGLProgram: shader error: ",o.getError(),"35715",o.getProgramParameter(g,35715),"gl.getProgramInfoLog",j,R,I)}else""!==j?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",j):""!==O&&""!==M||(A=!1);A&&(this.diagnostics={runnable:P,programLog:j,vertexShader:{log:O,prefix:r},fragmentShader:{log:M,prefix:i}})}return o.deleteShader(T),o.deleteShader(k),this.getUniforms=function(){return void 0===S&&(S=new Ua(o,g)),S},this.getAttributes=function(){return void 0===E&&(E=function(e,t){for(var n={},r=e.getProgramParameter(t,35721),i=0;i0,maxBones:w,useVertexTexture:a,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:h.directional.length,numPointLights:h.point.length,numSpotLights:h.spot.length,numRectAreaLights:h.rectArea.length,numHemiLights:h.hemi.length,numDirLightShadows:h.directionalShadowMap.length,numPointLightShadows:h.pointShadowMap.length,numSpotLightShadows:h.spotShadowMap.length,numClippingPlanes:m,numClipIntersection:g,dithering:r.dithering,shadowMapEnabled:e.shadowMap.enabled&&d.length>0,shadowMapType:e.shadowMap.type,toneMapping:r.toneMapped?e.toneMapping:ue,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:r.side===C,flipSided:r.side===E,depthPacking:void 0!==r.depthPacking&&r.depthPacking,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.frawbuffers,extensionDrawbuffers:r.extensions&&r.extensions.drawbuffers,extensionShaderTextureLOD:r.extensions&&r.extensions.shaderTextureLOD,rendererExtensionFragDepth:i||null!==t.get("EXT_frag_depth"),rendererExtensionDrawBuffers:i||null!==t.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:i||null!==t.get("EXT_shader_texture_lod"),onBeforeCompile:r.onBeforeCompile}},this.getProgramCacheKey=function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var r in t.defines)n.push(r),n.push(t.defines[r]);if(void 0===t.isRawShaderMaterial){for(var i=0;i1&&n.sort(e||ls),r.length>1&&r.sort(t||cs)}}}function hs(){var e=new WeakMap;function t(n){var r=n.target;r.removeEventListener("dispose",t),e.delete(r)}return{get:function(n,r){var i,o=e.get(n);return void 0===o?(i=new us,e.set(n,new WeakMap),e.get(n).set(r,i),n.addEventListener("dispose",t)):void 0===(i=o.get(r))&&(i=new us,o.set(r,i)),i},dispose:function(){e=new WeakMap}}}function ps(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new Gn,color:new si,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Rn};break;case"SpotLight":n={position:new Gn,direction:new Gn,color:new si,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Rn};break;case"PointLight":n={position:new Gn,color:new si,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Rn,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new Gn,skyColor:new si,groundColor:new si};break;case"RectAreaLight":n={color:new si,position:new Gn,halfWidth:new Gn,halfHeight:new Gn}}return e[t.id]=n,n}}}var ds=0;function fs(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function ms(){for(var e=new ps,t={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:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},n=0;n<9;n++)t.probe.push(new Gn);var r=new Gn,i=new Zn,o=new Zn;return{setup:function(n,a,s){for(var l=0,c=0,u=0,h=0;h<9;h++)t.probe[h].set(0,0,0);var p=0,d=0,f=0,m=0,g=0,v=0,b=0,y=0,_=s.matrixWorldInverse;n.sort(fs),h=0;for(var x=n.length;h0:!0===s.isGeometry&&(d=s.morphTargets&&s.morphTargets.length>0));var f=!1;!0===t.isSkinnedMesh&&(!0===n.skinning?f=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),l=h(d,f,!0===t.isInstancedMesh)}else l=p;if(e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var m=l.uuid,g=n.uuid,y=c[m];void 0===y&&(y={},c[m]=y);var _=y[g];void 0===_&&(_=l.clone(),y[g]=_),l=_}return l.visible=n.visible,l.wireframe=n.wireframe,l.side=a===w?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:u[n.side],l.clipShadows=n.clipShadows,l.clippingPlanes=n.clippingPlanes,l.clipIntersection=n.clipIntersection,l.wireframeLinewidth=n.wireframeLinewidth,l.linewidth=n.linewidth,!0===r.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(r.matrixWorld),l.nearDistance=i,l.farDistance=o),l}function x(n,i,o,a,s){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===w)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);var l=t.update(n),c=n.material;if(Array.isArray(c))for(var u=l.groups,h=0,p=u.length;hn||i.y>n)&&(console.warn("THREE.WebGLShadowMap:",v,"has shadow exceeding max texture size, reducing"),i.x>n&&(o.x=Math.floor(n/y.x),i.x=o.x*y.x,b.mapSize.x=o.x),i.y>n&&(o.y=Math.floor(n/y.y),i.y=o.y*y.y,b.mapSize.y=o.y)),null===b.map&&!b.isPointLightShadow&&this.type===w){var _={minFilter:Ae,magFilter:Ae,format:$e};b.map=new Bn(i.x,i.y,_),b.map.texture.name=v.name+".shadowMap",b.mapPass=new Bn(i.x,i.y,_),b.camera.updateProjectionMatrix()}if(null===b.map){_={minFilter:ke,magFilter:ke,format:$e};b.map=new Bn(i.x,i.y,_),b.map.texture.name=v.name+".shadowMap",b.camera.updateProjectionMatrix()}e.setRenderTarget(b.map),e.clear();for(var S=b.getViewportCount(),E=0;E=1):-1!==fe.indexOf("OpenGL ES")&&(de=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(fe)[1]),pe=de>=2);var me=null,ge={},ve=new Fn,be=new Fn;function ye(t,n,r){var i=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(var a=0;ar||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!==typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&e instanceof ImageBitmap){var o=t?An.floorPowerOfTwo:Math.floor,a=o(i*e.width),s=o(i*e.height);void 0===u&&(u=b(a,s));var l=n?b(a,s):u;return l.width=a,l.height=s,l.getContext("2d").drawImage(e,0,0,a,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+a+"x"+s+")."),l}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function _(e){return An.isPowerOfTwo(e.width)&&An.isPowerOfTwo(e.height)}function x(e,t){return e.generateMipmaps&&t&&e.minFilter!==ke&&e.minFilter!==Ae}function w(t,n,i,o){e.generateMipmap(t),r.get(n).__maxMipLevel=Math.log(Math.max(i,o))*Math.LOG2E}function S(n,r,i){if(!1===h)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var o=r;return 6403===r&&(5126===i&&(o=33326),5131===i&&(o=33325),5121===i&&(o=33321)),6407===r&&(5126===i&&(o=34837),5131===i&&(o=34843),5121===i&&(o=32849)),6408===r&&(5126===i&&(o=34836),5131===i&&(o=34842),5121===i&&(o=32856)),33325===o||33326===o||34842===o||34836===o?t.get("EXT_color_buffer_float"):34843!==o&&34837!==o||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),o}function E(e){return e===ke||e===je||e===Me?9728:9729}function C(t){var n=t.target;n.removeEventListener("dispose",C),function(t){var n=r.get(t);if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture),r.remove(t)}(n),n.isVideoTexture&&g.delete(n),s.memory.textures--}function T(t){var n=t.target;n.removeEventListener("dispose",T),function(t){var n=r.get(t),i=r.get(t.texture);if(!t)return;void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(var o=0;o<6;o++)e.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[o]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer);if(t.isWebGLMultiviewRenderTarget){e.deleteTexture(n.__webglColorTexture),e.deleteTexture(n.__webglDepthStencilTexture),s.memory.textures-=2;for(var o=0,a=n.__webglViewFramebuffers.length;o0&&i.__version!==e.version){var o=e.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==o.complete)return void L(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,i.__webglTexture)}function O(t,i){if(6===t.image.length){var o=r.get(t);if(t.version>0&&o.__version!==t.version){I(o,t),n.activeTexture(33984+i),n.bindTexture(34067,o.__webglTexture),e.pixelStorei(37440,t.flipY);for(var s=t&&(t.isCompressedTexture||t.image[0].isCompressedTexture),l=t.image[0]&&t.image[0].isDataTexture,c=[],u=0;u<6;u++)c[u]=s||l?l?t.image[u].image:t.image[u]:y(t.image[u],!1,!0,d);var p,f=c[0],m=_(f)||h,g=a.convert(t.format),v=a.convert(t.type),b=S(t.internalFormat,g,v);if(R(34067,t,m),s){for(u=0;u<6;u++){p=c[u].mipmaps;for(var E=0;E1||r.get(i).__currentAnisotropy)&&(e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(i.anisotropy,o.getMaxAnisotropy())),r.get(i).__currentAnisotropy=i.anisotropy)}}function I(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",C),t.__webglTexture=e.createTexture(),s.memory.textures++)}function L(t,r,i){var o=3553;r.isDataTexture2DArray&&(o=35866),r.isDataTexture3D&&(o=32879),I(t,r),n.activeTexture(33984+i),n.bindTexture(o,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);var s=function(e){return!h&&(e.wrapS!==Ce||e.wrapT!==Ce||e.minFilter!==ke&&e.minFilter!==Ae)}(r)&&!1===_(r.image),l=y(r.image,s,!1,f),c=_(l)||h,u=a.convert(r.format),p=a.convert(r.type),d=S(r.internalFormat,u,p);R(o,r,c);var m,g=r.mipmaps;if(r.isDepthTexture){if(d=6402,r.type===qe){if(!1===h)throw new Error("Float Depth Texture only supported in WebGL2.0");d=36012}else h&&(d=33189);r.format===tt&&6402===d&&r.type!==ze&&r.type!==He&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=ze,p=a.convert(r.type)),r.format===nt&&(d=34041,r.type!==Ye&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=Ye,p=a.convert(r.type))),n.texImage2D(3553,0,d,l.width,l.height,0,u,p,null)}else if(r.isDataTexture)if(g.length>0&&c){for(var v=0,b=g.length;v0&&c){for(v=0,b=g.length;v=p&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+p),k+=1,e},this.resetTextureUnits=function(){k=0},this.setTexture2D=j,this.setTexture2DArray=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?L(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){var i=r.get(e);e.version>0&&i.__version!==e.version?L(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=O,this.setTextureCubeDynamic=M,this.setupRenderTarget=function(i){var o=r.get(i),l=r.get(i.texture);i.addEventListener("dispose",T),l.__webglTexture=e.createTexture(),s.memory.textures++;var c=!0===i.isWebGLCubeRenderTarget,u=!0===i.isWebGLMultisampleRenderTarget,p=!0===i.isWebGLMultiviewRenderTarget,d=_(i)||h;if(c){o.__webglFramebuffer=[];for(var f=0;f<6;f++)o.__webglFramebuffer[f]=e.createFramebuffer()}else if(o.__webglFramebuffer=e.createFramebuffer(),u)if(h){o.__webglMultisampledFramebuffer=e.createFramebuffer(),o.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,o.__webglColorRenderbuffer);var m=a.convert(i.texture.format),g=a.convert(i.texture.type),v=S(i.texture.internalFormat,m,g),b=B(i);e.renderbufferStorageMultisample(36161,b,v,i.width,i.height),e.bindFramebuffer(36160,o.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,o.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),i.depthBuffer&&(o.__webglDepthRenderbuffer=e.createRenderbuffer(),N(o.__webglDepthRenderbuffer,i,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(p){var y=i.width,E=i.height,C=i.numViews;e.bindFramebuffer(36160,o.__webglFramebuffer);var k=t.get("OVR_multiview2");s.memory.textures+=2;var j=e.createTexture();e.bindTexture(35866,j),e.texParameteri(35866,10240,9728),e.texParameteri(35866,10241,9728),e.texImage3D(35866,0,32856,y,E,C,0,6408,5121,null),k.framebufferTextureMultiviewOVR(36160,36064,j,0,0,C);var O=e.createTexture();e.bindTexture(35866,O),e.texParameteri(35866,10240,9728),e.texParameteri(35866,10241,9728),e.texImage3D(35866,0,35056,y,E,C,0,34041,34042,null),k.framebufferTextureMultiviewOVR(36160,33306,O,0,0,C);var M=new Array(C);for(f=0;fp)return!1;for(var n=1,r=t.length;n=0){var c=i[s];if(void 0!==c){var u=c.normalized,h=c.itemSize,p=_.get(c);if(void 0===p)continue;var v=p.buffer,b=p.type,y=p.bytesPerElement;if(c.isInterleavedBufferAttribute){var x=c.data,w=x.stride,S=c.offset;x&&x.isInstancedInterleavedBuffer?(g.enableAttributeAndDivisor(l,x.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=x.meshPerAttribute*x.count)):g.enableAttribute(l),d.bindBuffer(34962,v),d.vertexAttribPointer(l,h,b,u,w*y,S*y)}else c.isInstancedBufferAttribute?(g.enableAttributeAndDivisor(l,c.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=c.meshPerAttribute*c.count)):g.enableAttribute(l),d.bindBuffer(34962,v),d.vertexAttribPointer(l,h,b,u,0,0)}else if("instanceMatrix"===s){var p=_.get(e.instanceMatrix);if(void 0===p)continue;var v=p.buffer,b=p.type;g.enableAttributeAndDivisor(l+0,1),g.enableAttributeAndDivisor(l+1,1),g.enableAttributeAndDivisor(l+2,1),g.enableAttributeAndDivisor(l+3,1),d.bindBuffer(34962,v),d.vertexAttribPointer(l+0,4,b,!1,64,0),d.vertexAttribPointer(l+1,4,b,!1,64,16),d.vertexAttribPointer(l+2,4,b,!1,64,32),d.vertexAttribPointer(l+3,4,b,!1,64,48)}else if(void 0!==a){var E=a[s];if(void 0!==E)switch(E.length){case 2:d.vertexAttrib2fv(l,E);break;case 3:d.vertexAttrib3fv(l,E);break;case 4:d.vertexAttrib4fv(l,E);break;default:d.vertexAttrib1fv(l,E)}}}}g.disableUnusedAttributes()}(i,n,r,s),null!==c&&d.bindBuffer(34963,h.buffer));var b=null!==c?c.count:u.count,y=n.drawRange.start*p,w=n.drawRange.count*p,S=null!==o?o.start*p:0,E=null!==o?o.count*p:1/0,C=Math.max(y,S),T=Math.min(b,y+w,S+E)-1,k=Math.max(0,T-C+1);if(0!==k){if(i.isMesh)!0===r.wireframe?(g.setLineWidth(r.wireframeLinewidth*ae()),v.setMode(1)):v.setMode(4);else if(i.isLine){var P=r.linewidth;void 0===P&&(P=1),g.setLineWidth(P*ae()),i.isLineSegments?v.setMode(1):i.isLineLoop?v.setMode(2):v.setMode(3)}else i.isPoints?v.setMode(0):i.isSprite&&v.setMode(4);i.isInstancedMesh?v.renderInstances(n,C,k,i.count):n.isInstancedBufferGeometry?v.renderInstances(n,C,k,n.maxInstancedCount):v.render(C,k)}},this.compile=function(e,t){(p=T.get(e,t)).init(),e.traverse(function(e){e.isLight&&(p.pushLight(e),e.castShadow&&p.pushShadow(e))}),p.setupLights(t);var n={};e.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var r=0;r=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(d=0;d=0&&e.numSupportedMorphNormals++}var f=r.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(r.numClippingPlanes=te.numPlanes,r.numIntersection=te.numIntersection,f.clippingPlanes=te.uniform),r.fog=t.fog,r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),r.lightsStateVersion=a,r.needsLights&&(f.ambientLightColor.value=i.state.ambient,f.lightProbe.value=i.state.probe,f.directionalLights.value=i.state.directional,f.spotLights.value=i.state.spot,f.rectAreaLights.value=i.state.rectArea,f.pointLights.value=i.state.point,f.hemisphereLights.value=i.state.hemi,f.directionalShadowMap.value=i.state.directionalShadowMap,f.directionalShadowMatrix.value=i.state.directionalShadowMatrix,f.spotShadowMap.value=i.state.spotShadowMap,f.spotShadowMatrix.value=i.state.spotShadowMatrix,f.pointShadowMap.value=i.state.pointShadowMap,f.pointShadowMatrix.value=i.state.pointShadowMatrix);var m=r.program.getUniforms(),g=Ua.seqWithValue(m.seq,f);r.uniformsList=g}function Se(e,t,n,r){y.resetTextureUnits();var i=t.fog,o=n.isMeshStandardMaterial?t.environment:null,a=b.get(n),s=p.state.lights;if(ne&&(re||e!==U)){var l=e===U&&n.id===B;te.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,a,l)}n.version===a.__version?void 0===a.program?we(n,t,r):n.fog&&a.fog!==i?we(n,t,r):a.environment!==o?we(n,t,r):a.needsLights&&a.lightsStateVersion!==s.state.version?we(n,t,r):void 0===a.numClippingPlanes||a.numClippingPlanes===te.numPlanes&&a.numIntersection===te.numIntersection?a.outputEncoding!==A.outputEncoding&&we(n,t,r):we(n,t,r):(we(n,t,r),a.__version=n.version);var c,u,h=!1,f=!1,v=!1,_=a.program,x=_.getUniforms(),w=a.uniforms;if(g.useProgram(_.program)&&(h=!0,f=!0,v=!0),n.id!==B&&(B=n.id,f=!0),h||U!==e){if(_.numMultiviewViews>0?ue.updateCameraProjectionMatricesUniform(e,x):x.setValue(d,"projectionMatrix",e.projectionMatrix),m.logarithmicDepthBuffer&&x.setValue(d,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),U!==e&&(U=e,f=!0,v=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var S=x.map.cameraPosition;void 0!==S&&S.setValue(d,oe.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&x.setValue(d,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&(_.numMultiviewViews>0?ue.updateCameraViewMatricesUniform(e,x):x.setValue(d,"viewMatrix",e.matrixWorldInverse))}if(n.skinning){x.setOptional(d,r,"bindMatrix"),x.setOptional(d,r,"bindMatrixInverse");var C=r.skeleton;if(C){var T=C.bones;if(m.floatVertexTextures){if(void 0===C.boneTexture){var k=Math.sqrt(4*T.length);k=An.ceilPowerOfTwo(k),k=Math.max(k,4);var j=new Float32Array(k*k*4);j.set(C.boneMatrices);var O=new wo(j,k,k,$e,qe);C.boneMatrices=j,C.boneTexture=O,C.boneTextureSize=k}x.setValue(d,"boneTexture",C.boneTexture,y),x.setValue(d,"boneTextureSize",C.boneTextureSize)}else x.setOptional(d,C,"boneMatrices")}}return(f||a.receiveShadow!==r.receiveShadow)&&(a.receiveShadow=r.receiveShadow,x.setValue(d,"receiveShadow",r.receiveShadow)),f&&(x.setValue(d,"toneMappingExposure",A.toneMappingExposure),x.setValue(d,"toneMappingWhitePoint",A.toneMappingWhitePoint),a.needsLights&&(u=v,(c=w).ambientLightColor.needsUpdate=u,c.lightProbe.needsUpdate=u,c.directionalLights.needsUpdate=u,c.pointLights.needsUpdate=u,c.spotLights.needsUpdate=u,c.rectAreaLights.needsUpdate=u,c.hemisphereLights.needsUpdate=u),i&&n.fog&&function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}(w,i),n.isMeshBasicMaterial?Ee(w,n):n.isMeshLambertMaterial?(Ee(w,n),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(w,n)):n.isMeshToonMaterial?(Ee(w,n),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.gradientMap&&(e.gradientMap.value=t.gradientMap);t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===E&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===E&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isMeshPhongMaterial?(Ee(w,n),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===E&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===E&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isMeshStandardMaterial?(Ee(w,n,o),n.isMeshPhysicalMaterial?function(e,t,n){Ce(e,t,n),e.reflectivity.value=t.reflectivity,e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.sheen&&e.sheen.value.copy(t.sheen);t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,t.side===E&&e.clearcoatNormalScale.value.negate());e.transparency.value=t.transparency}(w,n,o):Ce(w,n,o)):n.isMeshMatcapMaterial?(Ee(w,n),function(e,t){t.matcap&&(e.matcap.value=t.matcap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===E&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===E&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isMeshDepthMaterial?(Ee(w,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isMeshDistanceMaterial?(Ee(w,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias);e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(w,n)):n.isMeshNormalMaterial?(Ee(w,n),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===E&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===E&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(w,n),n.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(w,n)):n.isPointsMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*Y,e.scale.value=.5*X,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);var n;t.map?n=t.map:t.alphaMap&&(n=t.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(w,n):n.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);var n;t.map?n=t.map:t.alphaMap&&(n=t.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(w,n):n.isShadowMaterial&&(w.color.value.copy(n.color),w.opacity.value=n.opacity),void 0!==w.ltc_1&&(w.ltc_1.value=To.LTC_1),void 0!==w.ltc_2&&(w.ltc_2.value=To.LTC_2),Ua.upload(d,a.uniformsList,w,y),n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Ua.upload(d,a.uniformsList,w,y),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&x.setValue(d,"center",r.center),_.numMultiviewViews>0?ue.updateObjectMatricesUniforms(r,e,x):(x.setValue(d,"modelViewMatrix",r.modelViewMatrix),x.setValue(d,"normalMatrix",r.normalMatrix)),x.setValue(d,"modelMatrix",r.matrixWorld),_}function Ee(e,t,n){e.opacity.value=t.opacity,t.color&&e.diffuse.value.copy(t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap);var r,i,o=t.envMap||n;o&&(e.envMap.value=o,e.flipEnvMap.value=o.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio,e.maxMipLevel.value=b.get(o).__maxMipLevel),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),t.map?r=t.map:t.specularMap?r=t.specularMap:t.displacementMap?r=t.displacementMap:t.normalMap?r=t.normalMap:t.bumpMap?r=t.bumpMap:t.roughnessMap?r=t.roughnessMap:t.metalnessMap?r=t.metalnessMap:t.alphaMap?r=t.alphaMap:t.emissiveMap&&(r=t.emissiveMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix)),t.aoMap?i=t.aoMap:t.lightMap&&(i=t.lightMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uv2Transform.value.copy(i.matrix))}function Ce(e,t,n){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===E&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===E&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),(t.envMap||n)&&(e.envMapIntensity.value=t.envMapIntensity)}ye.setAnimationLoop(function(e){ce.isPresenting||be&&be(e)}),"undefined"!==typeof window&&ye.setContext(window),this.setAnimationLoop=function(e){be=e,ce.setAnimationLoop(e),ye.start()},this.render=function(e,t){var n,r;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),t&&t.isCamera){if(!R){z.geometry=null,z.program=null,z.wireframe=!1,B=-1,U=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),ce.enabled&&ce.isPresenting&&(t=ce.getCamera(t)),(p=T.get(e,t)).init(),e.onBeforeRender(A,e,t,n||N),ie.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),ee.setFromProjectionMatrix(ie),re=this.localClippingEnabled,ne=te.init(this.clippingPlanes,re,t),(h=C.get(e,t)).init(),function e(t,n,r,i){if(!1===t.visible)return;var o=t.layers.test(n.layers);if(o)if(t.isGroup)r=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(n);else if(t.isLight)p.pushLight(t),t.castShadow&&p.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||ee.intersectsSprite(t)){i&&oe.setFromMatrixPosition(t.matrixWorld).applyMatrix4(ie);var a=w.update(t),s=t.material;s.visible&&h.push(t,a,s,r,oe.z,null)}}else if(t.isImmediateRenderObject)i&&oe.setFromMatrixPosition(t.matrixWorld).applyMatrix4(ie),h.push(t,null,t.material,r,oe.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==v.render.frame&&(t.skeleton.update(),t.skeleton.frame=v.render.frame),!t.frustumCulled||ee.intersectsObject(t))){i&&oe.setFromMatrixPosition(t.matrixWorld).applyMatrix4(ie);var a=w.update(t),s=t.material;if(Array.isArray(s))for(var l=a.groups,c=0,u=l.length;c=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&d.readPixels(t,n,r,i,P.convert(u),P.convert(h),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{l&&d.bindFramebuffer(36160,F)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){void 0===n&&(n=0);var r=Math.pow(2,-n),i=Math.floor(t.image.width*r),o=Math.floor(t.image.height*r),a=P.convert(t.format);y.setTexture2D(t,0),d.copyTexImage2D(3553,n,a,e.x,e.y,i,o,0),g.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r){var i=t.image.width,o=t.image.height,a=P.convert(n.format),s=P.convert(n.type);y.setTexture2D(n,0),t.isDataTexture?d.texSubImage2D(3553,r||0,e.x,e.y,i,o,a,s,t.image.data):d.texSubImage2D(3553,r||0,e.x,e.y,a,s,t.image),g.unbindTexture()},this.initTexture=function(e){y.setTexture2D(e,0),g.unbindTexture()},"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function As(e,t){this.name="",this.color=new si(e),this.density=void 0!==t?t:25e-5}function Rs(e,t,n){this.name="",this.color=new si(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}function Is(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=yn,this.updateRange={offset:0,count:-1},this.version=0}Ts.prototype=Object.assign(Object.create(Bn.prototype),{constructor:Ts,isWebGLMultiviewRenderTarget:!0,copy:function(e){return Bn.prototype.copy.call(this,e),this.numViews=e.numViews,this},setNumViews:function(e){return this.numViews!==e&&(this.numViews=e,this.dispose()),this}}),js.prototype=Object.assign(Object.create(vo.prototype),{constructor:js,isArrayCamera:!0}),Os.prototype=Object.assign(Object.create(gr.prototype),{constructor:Os,isGroup:!0}),Object.assign(Ms.prototype,jn.prototype),Object.assign(As.prototype,{isFogExp2:!0,clone:function(){return new As(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(Rs.prototype,{isFog:!0,clone:function(){return new Rs(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(Is.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Is.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var r=0,i=this.stride;re.far||t.push({distance:s,point:Bs.clone(),uv:ri.getUV(Bs,Vs,Ws,Xs,Ys,Js,Ks,new Rn),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return gr.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}});var Qs=new Gn,el=new Gn;function tl(){gr.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function nl(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Qi.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Zn,this.bindMatrixInverse=new Zn}tl.prototype=Object.assign(Object.create(gr.prototype),{constructor:tl,isLOD:!0,copy:function(e){gr.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,r=t.length;n0){for(var n=1,r=t.length;n0){Qs.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(Qs);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){var t=this.levels;if(t.length>1){Qs.setFromMatrixPosition(e.matrixWorld),el.setFromMatrixPosition(this.matrixWorld);var n=Qs.distanceTo(el);t[0].object.visible=!0;for(var r=1,i=t.length;r=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(;r0&&(cl[0].instanceId=i,cl[0].object=this,t.push(cl[0]),cl.length=0)},setMatrixAt:function(e,t){t.toArray(this.instanceMatrix.array,16*e)},updateMorphTargets:function(){}}),pl.prototype=Object.create(di.prototype),pl.prototype.constructor=pl,pl.prototype.isLineBasicMaterial=!0,pl.prototype.copy=function(e){return di.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this};var dl=new Gn,fl=new Gn,ml=new Zn,gl=new Hr,vl=new Ir;function bl(e,t,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),gr.call(this),this.type="Line",this.geometry=void 0!==e?e:new Li,this.material=void 0!==t?t:new pl}bl.prototype=Object.assign(Object.create(gr.prototype),{constructor:bl,isLine:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],r=1,i=t.count;ra))u.applyMatrix4(this.matrixWorld),(x=e.ray.origin.distanceTo(u))e.far||t.push({distance:x,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}else for(m=0,g=d.length/3-1;ma))u.applyMatrix4(this.matrixWorld),(x=e.ray.origin.distanceTo(u))e.far||t.push({distance:x,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}else if(r.isGeometry){var y=r.vertices,_=y.length;for(m=0;m<_-1;m+=h){var x;if(!(gl.distanceSqToSegment(y[m],y[m+1],u,c)>a))u.applyMatrix4(this.matrixWorld),(x=e.ray.origin.distanceTo(u))e.far||t.push({distance:x,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var yl=new Gn,_l=new Gn;function xl(e,t){bl.call(this,e,t),this.type="LineSegments"}function wl(e,t){bl.call(this,e,t),this.type="LineLoop"}function Sl(e){di.call(this),this.type="PointsMaterial",this.color=new si(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}xl.prototype=Object.assign(Object.create(bl.prototype),{constructor:xl,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],r=0,i=t.count;ri.far)return;o.push({distance:c,distanceToRay:Math.sqrt(s),point:l,index:t,face:null,object:a})}}function Ml(e,t,n,r,i,o,a,s,l){Nn.call(this,e,t,n,r,i,o,a,s,l),this.format=void 0!==a?a:Ke,this.minFilter=void 0!==o?o:Ae,this.magFilter=void 0!==i?i:Ae,this.generateMipmaps=!1}function Pl(e,t,n,r,i,o,a,s,l,c,u,h){Nn.call(this,null,o,a,s,l,c,r,i,u,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Al(e,t,n,r,i,o,a,s,l){Nn.call(this,e,t,n,r,i,o,a,s,l),this.needsUpdate=!0}function Rl(e,t,n,r,i,o,a,s,l,c){if((c=void 0!==c?c:tt)!==tt&&c!==nt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===tt&&(n=ze),void 0===n&&c===nt&&(n=Ye),Nn.call(this,null,r,i,o,a,s,c,n,l),this.image={width:e,height:t},this.magFilter=void 0!==a?a:ke,this.minFilter=void 0!==s?s:ke,this.flipY=!1,this.generateMipmaps=!1}function Il(e){Li.call(this),this.type="WireframeGeometry";var t,n,r,i,o,a,s,l,c,u,h=[],p=[0,0],d={},f=["a","b","c"];if(e&&e.isGeometry){var m=e.faces;for(t=0,r=m.length;t=0?(e(g-1e-5,m,h),p.subVectors(u,h)):(e(g+1e-5,m,h),p.subVectors(h,u)),m-1e-5>=0?(e(g,m-1e-5,h),d.subVectors(u,h)):(e(g,m+1e-5,h),d.subVectors(h,u)),c.crossVectors(p,d).normalize(),s.push(c.x,c.y,c.z),l.push(g,m)}}for(r=0;r.9&&a<.1&&(t<.2&&(o[e+0]+=1),n<.2&&(o[e+2]+=1),r<.2&&(o[e+4]+=1))}}()}(),this.setAttribute("position",new Ei(i,3)),this.setAttribute("normal",new Ei(i.slice(),3)),this.setAttribute("uv",new Ei(o,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function Bl(e,t){ao.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new zl(e,t)),this.mergeVertices()}function zl(e,t){Fl.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Ul(e,t){ao.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Hl(e,t)),this.mergeVertices()}function Hl(e,t){Fl.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function ql(e,t){ao.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Gl(e,t)),this.mergeVertices()}function Gl(e,t){var n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];Fl.call(this,r,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Vl(e,t){ao.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Wl(e,t)),this.mergeVertices()}function Wl(e,t){var n=(1+Math.sqrt(5))/2,r=1/n,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r];Fl.call(this,i,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Xl(e,t,n,r,i,o){ao.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var a=new Yl(e,t,n,r,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function Yl(e,t,n,r,i){Li.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i},t=t||64,n=n||1,r=r||8,i=i||!1;var o=e.computeFrenetFrames(t,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var a,s,l=new Gn,c=new Gn,u=new Rn,h=new Gn,p=[],d=[],f=[],m=[];function g(i){h=e.getPointAt(i/t,h);var a=o.normals[i],u=o.binormals[i];for(s=0;s<=r;s++){var f=s/r*Math.PI*2,m=Math.sin(f),g=-Math.cos(f);c.x=g*a.x+m*u.x,c.y=g*a.y+m*u.y,c.z=g*a.z+m*u.z,c.normalize(),d.push(c.x,c.y,c.z),l.x=h.x+n*c.x,l.y=h.y+n*c.y,l.z=h.z+n*c.z,p.push(l.x,l.y,l.z)}}!function(){for(a=0;a0){var a=i[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=a.length;e0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Ml.prototype=Object.assign(Object.create(Nn.prototype),{constructor:Ml,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Pl.prototype=Object.create(Nn.prototype),Pl.prototype.constructor=Pl,Pl.prototype.isCompressedTexture=!0,Al.prototype=Object.create(Nn.prototype),Al.prototype.constructor=Al,Al.prototype.isCanvasTexture=!0,Rl.prototype=Object.create(Nn.prototype),Rl.prototype.constructor=Rl,Rl.prototype.isDepthTexture=!0,Il.prototype=Object.create(Li.prototype),Il.prototype.constructor=Il,Ll.prototype=Object.create(ao.prototype),Ll.prototype.constructor=Ll,Dl.prototype=Object.create(Li.prototype),Dl.prototype.constructor=Dl,Nl.prototype=Object.create(ao.prototype),Nl.prototype.constructor=Nl,Fl.prototype=Object.create(Li.prototype),Fl.prototype.constructor=Fl,Bl.prototype=Object.create(ao.prototype),Bl.prototype.constructor=Bl,zl.prototype=Object.create(Fl.prototype),zl.prototype.constructor=zl,Ul.prototype=Object.create(ao.prototype),Ul.prototype.constructor=Ul,Hl.prototype=Object.create(Fl.prototype),Hl.prototype.constructor=Hl,ql.prototype=Object.create(ao.prototype),ql.prototype.constructor=ql,Gl.prototype=Object.create(Fl.prototype),Gl.prototype.constructor=Gl,Vl.prototype=Object.create(ao.prototype),Vl.prototype.constructor=Vl,Wl.prototype=Object.create(Fl.prototype),Wl.prototype.constructor=Wl,Xl.prototype=Object.create(ao.prototype),Xl.prototype.constructor=Xl,Yl.prototype=Object.create(Li.prototype),Yl.prototype.constructor=Yl,Yl.prototype.toJSON=function(){var e=Li.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},Jl.prototype=Object.create(ao.prototype),Jl.prototype.constructor=Jl,Kl.prototype=Object.create(Li.prototype),Kl.prototype.constructor=Kl,$l.prototype=Object.create(ao.prototype),$l.prototype.constructor=$l,Zl.prototype=Object.create(Li.prototype),Zl.prototype.constructor=Zl;var Ql=function(e,t,n){n=n||2;var r,i,o,a,s,l,c,u=t&&t.length,h=u?t[0]*n:e.length,p=ec(e,0,h,n,!0),d=[];if(!p||p.next===p.prev)return d;if(u&&(p=function(e,t,n,r){var i,o,a,s,l,c=[];for(i=0,o=t.length;i80*n){r=o=e[0],i=a=e[1];for(var f=n;fo&&(o=s),l>a&&(a=l);c=0!==(c=Math.max(o-r,a-i))?1/c:0}return nc(p,d,n,r,i,c),d};function ec(e,t,n,r,i){var o,a;if(i===function(e,t,n,r){for(var i=0,o=t,a=n-r;o0)for(o=t;o=t;o-=r)a=bc(o,e[o],e[o+1],a);return a&&fc(a,a.next)&&(yc(a),a=a.next),a}function tc(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!fc(r,r.next)&&0!==dc(r.prev,r,r.next))r=r.next;else{if(yc(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function nc(e,t,n,r,i,o,a){if(e){!a&&o&&function(e,t,n,r){var i=e;do{null===i.z&&(i.z=cc(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,n,r,i,o,a,s,l,c=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,c*=2}while(a>1)}(i)}(e,r,i,o);for(var s,l,c=e;e.prev!==e.next;)if(s=e.prev,l=e.next,o?ic(e,r,i,o):rc(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),yc(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?nc(e=oc(e,t,n),t,n,r,i,o,2):2===a&&ac(e,t,n,r,i,o):nc(tc(e),t,n,r,i,o,1);break}}}function rc(e){var t=e.prev,n=e,r=e.next;if(dc(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(hc(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&dc(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function ic(e,t,n,r){var i=e.prev,o=e,a=e.next;if(dc(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=cc(s,l,t,n,r),p=cc(c,u,t,n,r),d=e.prevZ,f=e.nextZ;d&&d.z>=h&&f&&f.z<=p;){if(d!==e.prev&&d!==e.next&&hc(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&dc(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,f!==e.prev&&f!==e.next&&hc(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&dc(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;d&&d.z>=h;){if(d!==e.prev&&d!==e.next&&hc(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&dc(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;f&&f.z<=p;){if(f!==e.prev&&f!==e.next&&hc(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&dc(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function oc(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!fc(i,o)&&mc(i,r,r.next,o)&&gc(i,o)&&gc(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),yc(r),yc(r.next),r=e=o),r=r.next}while(r!==e);return r}function ac(e,t,n,r,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&pc(a,s)){var l=vc(a,s);return a=tc(a,a.next),l=tc(l,l.next),nc(a,t,n,r,i,o),void nc(l,t,n,r,i,o)}s=s.next}a=a.next}while(a!==e)}function sc(e,t){return e.x-t.x}function lc(e,t){if(t=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x=r.x&&r.x>=u&&i!==r.x&&hc(on.x)&&gc(r,e)&&(n=r,p=l),r=r.next;return n}(e,t)){var n=vc(t,e);tc(n,n.next)}}function cc(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function uc(e){var t=e,n=e;do{(t.x=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function pc(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&mc(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&gc(e,t)&&gc(t,e)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!==n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)}function dc(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function fc(e,t){return e.x===t.x&&e.y===t.y}function mc(e,t,n,r){return!!(fc(e,n)&&fc(t,r)||fc(e,r)&&fc(n,t))||dc(e,t,n)>0!==dc(e,t,r)>0&&dc(n,r,e)>0!==dc(n,r,t)>0}function gc(e,t){return dc(e.prev,e,e.next)<0?dc(e,t,e.next)>=0&&dc(e,e.prev,t)>=0:dc(e,t,e.prev)<0||dc(e,e.next,t)<0}function vc(e,t){var n=new _c(e.i,e.x,e.y),r=new _c(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function bc(e,t,n,r){var i=new _c(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function yc(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function _c(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var xc={area:function(e){for(var t=e.length,n=0,r=t-1,i=0;i2&&e[t-1].equals(e[0])&&e.pop()}function Sc(e,t){for(var n=0;nNumber.EPSILON){var p=Math.sqrt(u),d=Math.sqrt(l*l+c*c),f=t.x-s/p,m=t.y+a/p,g=((n.x-c/d-f)*c-(n.y+l/d-m)*l)/(a*c-s*l),v=(r=f+a*g-e.x)*r+(i=m+s*g-e.y)*i;if(v<=2)return new Rn(r,i);o=Math.sqrt(v/2)}else{var b=!1;a>Number.EPSILON?l>Number.EPSILON&&(b=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(b=!0):Math.sign(s)===Math.sign(c)&&(b=!0),b?(r=-s,i=a,o=Math.sqrt(u)):(r=a,i=s,o=Math.sqrt(u/2))}return new Rn(r/o,i/o)}for(var z=[],U=0,H=O.length,q=H-1,G=U+1;U=0;P--){for(R=P/d,I=u*Math.cos(R*Math.PI/2),A=h*Math.sin(R*Math.PI/2)+p,U=0,H=O.length;U=0;){n=U,(r=U-1)<0&&(r=e.length-1);var i=0,o=s+2*d;for(i=0;i0)&&f.push(w,S,C),(l!==n-1||c0&&v(!0),t>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new Ei(u,3)),this.setAttribute("normal",new Ei(h,3)),this.setAttribute("uv",new Ei(p,2))}function Hc(e,t,n,r,i,o,a){zc.call(this,0,e,t,n,r,i,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}function qc(e,t,n,r,i,o,a){Uc.call(this,0,e,t,n,r,i,o,a),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:o,thetaLength:a}}function Gc(e,t,n,r){ao.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new Vc(e,t,n,r)),this.mergeVertices()}function Vc(e,t,n,r){Li.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},e=e||1,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var i,o,a=[],s=[],l=[],c=[],u=new Gn,h=new Rn;for(s.push(0,0,0),l.push(0,0,1),c.push(.5,.5),o=0,i=3;o<=t;o++,i+=3){var p=n+o/t*r;u.x=e*Math.cos(p),u.y=e*Math.sin(p),s.push(u.x,u.y,u.z),l.push(0,0,1),h.x=(s[i]/e+1)/2,h.y=(s[i+1]/e+1)/2,c.push(h.x,h.y)}for(i=1;i<=t;i++)a.push(i,i+1,0);this.setIndex(a),this.setAttribute("position",new Ei(s,3)),this.setAttribute("normal",new Ei(l,3)),this.setAttribute("uv",new Ei(c,2))}jc.prototype=Object.create(ao.prototype),jc.prototype.constructor=jc,Oc.prototype=Object.create(Cc.prototype),Oc.prototype.constructor=Oc,Mc.prototype=Object.create(ao.prototype),Mc.prototype.constructor=Mc,Pc.prototype=Object.create(Li.prototype),Pc.prototype.constructor=Pc,Ac.prototype=Object.create(ao.prototype),Ac.prototype.constructor=Ac,Rc.prototype=Object.create(Li.prototype),Rc.prototype.constructor=Rc,Ic.prototype=Object.create(ao.prototype),Ic.prototype.constructor=Ic,Lc.prototype=Object.create(Li.prototype),Lc.prototype.constructor=Lc,Dc.prototype=Object.create(ao.prototype),Dc.prototype.constructor=Dc,Dc.prototype.toJSON=function(){var e=ao.prototype.toJSON.call(this);return Fc(this.parameters.shapes,e)},Nc.prototype=Object.create(Li.prototype),Nc.prototype.constructor=Nc,Nc.prototype.toJSON=function(){var e=Li.prototype.toJSON.call(this);return Fc(this.parameters.shapes,e)},Bc.prototype=Object.create(Li.prototype),Bc.prototype.constructor=Bc,zc.prototype=Object.create(ao.prototype),zc.prototype.constructor=zc,Uc.prototype=Object.create(Li.prototype),Uc.prototype.constructor=Uc,Hc.prototype=Object.create(zc.prototype),Hc.prototype.constructor=Hc,qc.prototype=Object.create(Uc.prototype),qc.prototype.constructor=qc,Gc.prototype=Object.create(ao.prototype),Gc.prototype.constructor=Gc,Vc.prototype=Object.create(Li.prototype),Vc.prototype.constructor=Vc;var Wc=Object.freeze({__proto__:null,WireframeGeometry:Il,ParametricGeometry:Ll,ParametricBufferGeometry:Dl,TetrahedronGeometry:Bl,TetrahedronBufferGeometry:zl,OctahedronGeometry:Ul,OctahedronBufferGeometry:Hl,IcosahedronGeometry:ql,IcosahedronBufferGeometry:Gl,DodecahedronGeometry:Vl,DodecahedronBufferGeometry:Wl,PolyhedronGeometry:Nl,PolyhedronBufferGeometry:Fl,TubeGeometry:Xl,TubeBufferGeometry:Yl,TorusKnotGeometry:Jl,TorusKnotBufferGeometry:Kl,TorusGeometry:$l,TorusBufferGeometry:Zl,TextGeometry:jc,TextBufferGeometry:Oc,SphereGeometry:Mc,SphereBufferGeometry:Pc,RingGeometry:Ac,RingBufferGeometry:Rc,PlaneGeometry:Oo,PlaneBufferGeometry:Mo,LatheGeometry:Ic,LatheBufferGeometry:Lc,ShapeGeometry:Dc,ShapeBufferGeometry:Nc,ExtrudeGeometry:Ec,ExtrudeBufferGeometry:Cc,EdgesGeometry:Bc,ConeGeometry:Hc,ConeBufferGeometry:qc,CylinderGeometry:zc,CylinderBufferGeometry:Uc,CircleGeometry:Gc,CircleBufferGeometry:Vc,BoxGeometry:so,BoxBufferGeometry:lo});function Xc(e){di.call(this),this.type="ShadowMaterial",this.color=new si(0),this.transparent=!0,this.setValues(e)}function Yc(e){mo.call(this,e),this.type="RawShaderMaterial"}function Jc(e){di.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new si(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 si(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=en,this.normalScale=new Rn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Kc(e){Jc.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearcoat=0,this.clearcoatRoughness=0,this.sheen=null,this.clearcoatNormalScale=new Rn(1,1),this.clearcoatNormalMap=null,this.transparency=0,this.setValues(e)}function $c(e){di.call(this),this.type="MeshPhongMaterial",this.color=new si(16777215),this.specular=new si(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new si(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=en,this.normalScale=new Rn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=se,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Zc(e){di.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new si(16777215),this.specular=new si(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 si(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=en,this.normalScale=new Rn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Qc(e){di.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=en,this.normalScale=new Rn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function eu(e){di.call(this),this.type="MeshLambertMaterial",this.color=new si(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new si(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=se,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function tu(e){di.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new si(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=en,this.normalScale=new Rn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function nu(e){pl.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}Xc.prototype=Object.create(di.prototype),Xc.prototype.constructor=Xc,Xc.prototype.isShadowMaterial=!0,Xc.prototype.copy=function(e){return di.prototype.copy.call(this,e),this.color.copy(e.color),this},Yc.prototype=Object.create(mo.prototype),Yc.prototype.constructor=Yc,Yc.prototype.isRawShaderMaterial=!0,Jc.prototype=Object.create(di.prototype),Jc.prototype.constructor=Jc,Jc.prototype.isMeshStandardMaterial=!0,Jc.prototype.copy=function(e){return di.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Kc.prototype=Object.create(Jc.prototype),Kc.prototype.constructor=Kc,Kc.prototype.isMeshPhysicalMaterial=!0,Kc.prototype.copy=function(e){return Jc.prototype.copy.call(this,e),this.defines={STANDARD:"",PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearcoat=e.clearcoat,this.clearcoatRoughness=e.clearcoatRoughness,e.sheen?this.sheen=(this.sheen||new si).copy(e.sheen):this.sheen=null,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.transparency=e.transparency,this},$c.prototype=Object.create(di.prototype),$c.prototype.constructor=$c,$c.prototype.isMeshPhongMaterial=!0,$c.prototype.copy=function(e){return di.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Zc.prototype=Object.create(di.prototype),Zc.prototype.constructor=Zc,Zc.prototype.isMeshToonMaterial=!0,Zc.prototype.copy=function(e){return di.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Qc.prototype=Object.create(di.prototype),Qc.prototype.constructor=Qc,Qc.prototype.isMeshNormalMaterial=!0,Qc.prototype.copy=function(e){return di.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},eu.prototype=Object.create(di.prototype),eu.prototype.constructor=eu,eu.prototype.isMeshLambertMaterial=!0,eu.prototype.copy=function(e){return di.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},tu.prototype=Object.create(di.prototype),tu.prototype.constructor=tu,tu.prototype.isMeshMatcapMaterial=!0,tu.prototype.copy=function(e){return di.prototype.copy.call(this,e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},nu.prototype=Object.create(pl.prototype),nu.prototype.constructor=nu,nu.prototype.isLineDashedMaterial=!0,nu.prototype.copy=function(e){return pl.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var ru=Object.freeze({__proto__:null,ShadowMaterial:Xc,SpriteMaterial:Fs,RawShaderMaterial:Yc,ShaderMaterial:mo,PointsMaterial:Sl,MeshPhysicalMaterial:Kc,MeshStandardMaterial:Jc,MeshPhongMaterial:$c,MeshToonMaterial:Zc,MeshNormalMaterial:Qc,MeshLambertMaterial:eu,MeshDepthMaterial:bs,MeshDistanceMaterial:ys,MeshBasicMaterial:fi,MeshMatcapMaterial:tu,LineDashedMaterial:nu,LineBasicMaterial:pl,Material:di}),iu={arraySlice:function(e,t,n){return iu.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"===typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,n=new Array(t),r=0;r!==t;++r)n[r]=r;return n.sort(function(t,n){return e[t]-e[n]}),n},sortedArray:function(e,t,n){for(var r=e.length,i=new e.constructor(r),o=0,a=0;a!==r;++o)for(var s=n[o]*t,l=0;l!==t;++l)i[a++]=e[s+l];return i},flattenJSON:function(e,t,n,r){for(var i=1,o=e[0];void 0!==o&&void 0===o[r];)o=e[i++];if(void 0!==o){var a=o[r];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[r])&&(t.push(o.time),n.push.apply(n,a)),o=e[i++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[r])&&(t.push(o.time),a.toArray(n,n.length)),o=e[i++]}while(void 0!==o);else do{void 0!==(a=o[r])&&(t.push(o.time),n.push(a)),o=e[i++]}while(void 0!==o)}},subclip:function(e,t,n,r,i){i=i||30;var o=e.clone();o.name=t;for(var a=[],s=0;s=r)){u.push(l.times[p]);for(var f=0;fo.tracks[s].times[0]&&(m=o.tracks[s].times[0]);for(s=0;s=i)break e;var s=t[1];e=(i=t[--n-1]))break t}o=n,n=0}for(;n>>1;et;)--o;if(++o,0!==i||o!==r){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=iu.arraySlice(n,i,o),this.values=iu.arraySlice(this.values,i*a,o*a)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var o=null,a=0;a!==i;a++){var s=n[a];if("number"===typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),e=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),e=!1;break}o=s}if(void 0!==r&&iu.isTypedArray(r)){a=0;for(var l=r.length;a!==l;++a){var c=r[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}}return e},optimize:function(){for(var e=iu.arraySlice(this.times),t=iu.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===Nt,i=1,o=e.length-1,a=1;a0){e[i]=e[o];for(f=o*n,m=i*n,p=0;p!==n;++p)t[m+p]=t[f+p];++i}return i!==e.length?(this.times=iu.arraySlice(e,0,i),this.values=iu.arraySlice(t,0,i*n)):(this.times=e,this.values=t),this},clone:function(){var e=iu.arraySlice(this.times,0),t=iu.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),uu.prototype=Object.assign(Object.create(cu.prototype),{constructor:uu,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Lt,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),hu.prototype=Object.assign(Object.create(cu.prototype),{constructor:hu,ValueTypeName:"color"}),pu.prototype=Object.assign(Object.create(cu.prototype),{constructor:pu,ValueTypeName:"number"}),du.prototype=Object.assign(Object.create(ou.prototype),{constructor:du,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=e*a,l=(n-t)/(r-t),c=s+a;s!==c;s+=4)Un.slerpFlat(i,0,o,s-a,o,s,l);return i}}),fu.prototype=Object.assign(Object.create(cu.prototype),{constructor:fu,ValueTypeName:"quaternion",DefaultInterpolation:Dt,InterpolantFactoryMethodLinear:function(e){return new du(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),mu.prototype=Object.assign(Object.create(cu.prototype),{constructor:mu,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Lt,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),gu.prototype=Object.assign(Object.create(cu.prototype),{constructor:gu,ValueTypeName:"vector"}),Object.assign(vu,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,o=n.length;i!==o;++i)t.push(bu(n[i]).scale(r));return new vu(e.name,e.duration,t)},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid},i=0,o=n.length;i!==o;++i)t.push(cu.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var i=t.length,o=[],a=0;a1){var c=r[h=l[1]];c||(r[h]=c=[]),c.push(s)}}var u=[];for(var h in r)u.push(vu.CreateFromMorphTargetSequence(h,r[h],t,n));return u},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){if(0!==n.length){var o=[],a=[];iu.flattenJSON(n,o,a,r),0!==o.length&&i.push(new e(t,o,a))}},r=[],i=e.name||"default",o=e.length||-1,a=e.fps||30,s=e.hierarchy||[],l=0;l0||0===e.search(/^data\:image\/jpeg/);i.format=r?Ke:$e,i.needsUpdate=!0,void 0!==t&&t(i)},n,r),i}}),Object.assign(Pu.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n,r=[],i=this.getPoint(0),o=0;for(r.push(0),n=1;n<=e;n++)o+=(t=this.getPoint(n/e)).distanceTo(i),r.push(o),i=t;return this.cacheArcLengths=r,r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,o=r.length;n=t||e*r[o-1];for(var a,s=0,l=o-1;s<=l;)if((a=r[i=Math.floor(s+(l-s)/2)]-n)<0)s=i+1;else{if(!(a>0)){l=i;break}l=i-1}if(r[i=l]===n)return i/(o-1);var c=r[i];return(i+(n-c)/(r[i+1]-c))/(o-1)},getTangent:function(e){var t=e-1e-4,n=e+1e-4;t<0&&(t=0),n>1&&(n=1);var r=this.getPoint(t);return this.getPoint(n).clone().sub(r).normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var n,r,i,o=new Gn,a=[],s=[],l=[],c=new Gn,u=new Zn;for(n=0;n<=e;n++)r=n/e,a[n]=this.getTangentAt(r),a[n].normalize();s[0]=new Gn,l[0]=new Gn;var h=Number.MAX_VALUE,p=Math.abs(a[0].x),d=Math.abs(a[0].y),f=Math.abs(a[0].z);for(p<=h&&(h=p,o.set(1,0,0)),d<=h&&(h=d,o.set(0,1,0)),f<=h&&o.set(0,0,1),c.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],c),l[0].crossVectors(a[0],s[0]),n=1;n<=e;n++)s[n]=s[n-1].clone(),l[n]=l[n-1].clone(),c.crossVectors(a[n-1],a[n]),c.length()>Number.EPSILON&&(c.normalize(),i=Math.acos(An.clamp(a[n-1].dot(a[n]),-1,1)),s[n].applyMatrix4(u.makeRotationAxis(c,i))),l[n].crossVectors(a[n],s[n]);if(!0===t)for(i=Math.acos(An.clamp(s[0].dot(s[e]),-1,1)),i/=e,a[0].dot(c.crossVectors(s[0],s[e]))>0&&(i=-i),n=1;n<=e;n++)s[n].applyMatrix4(u.makeRotationAxis(a[n],i*n)),l[n].crossVectors(a[n],s[n]);return{tangents:a,normals:s,binormals:l}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),Au.prototype=Object.create(Pu.prototype),Au.prototype.constructor=Au,Au.prototype.isEllipseCurve=!0,Au.prototype.getPoint=function(e,t){for(var n=t||new Rn,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)r;)i-=r;i0?0:(Math.floor(Math.abs(u)/l)+1)*l:0===h&&u===l-1&&(u=l-2,h=1),this.closed||u>0?n=s[(u-1)%l]:(Lu.subVectors(s[0],s[1]).add(s[0]),n=Lu),r=s[u%l],i=s[(u+1)%l],this.closed||u+2r.length-2?r.length-1:o+1],u=r[o>r.length-3?r.length-1:o+2];return n.set(zu(a,s.x,l.x,c.x,u.x),zu(a,s.y,l.y,c.y,u.y)),n},Ju.prototype.copy=function(e){Pu.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t=t){var i=n[r]-t,o=this.curves[r],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){Pu.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t0){var c=l.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(l);var u=l.getPoint(1);return this.currentPoint.copy(u),this},copy:function(e){return $u.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=$u.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return $u.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Qu.prototype=Object.assign(Object.create(Zu.prototype),{constructor:Qu,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n0){var o=new ju(new _u(t));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=e.length;a0?new nl(a,s):new Qi(a,s);break;case"InstancedMesh":a=i(e.geometry),s=o(e.material);var l=e.count,c=e.instanceMatrix;(r=new hl(a,s,l)).instanceMatrix=new gi(new Float32Array(c.array),16);break;case"LOD":r=new tl;break;case"Line":r=new bl(i(e.geometry),o(e.material),e.mode);break;case"LineLoop":r=new wl(i(e.geometry),o(e.material));break;case"LineSegments":r=new xl(i(e.geometry),o(e.material));break;case"PointCloud":case"Points":r=new jl(i(e.geometry),o(e.material));break;case"Sprite":r=new $s(o(e.material));break;case"Group":r=new Os;break;default:r=new gr}if(r.uuid=e.uuid,void 0!==e.name&&(r.name=e.name),void 0!==e.matrix?(r.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(r.matrixAutoUpdate=e.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==e.position&&r.position.fromArray(e.position),void 0!==e.rotation&&r.rotation.fromArray(e.rotation),void 0!==e.quaternion&&r.quaternion.fromArray(e.quaternion),void 0!==e.scale&&r.scale.fromArray(e.scale)),void 0!==e.castShadow&&(r.castShadow=e.castShadow),void 0!==e.receiveShadow&&(r.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(r.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(r.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&r.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(r.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.frustumCulled&&(r.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(r.renderOrder=e.renderOrder),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.layers&&(r.layers.mask=e.layers),void 0!==e.children)for(var u=e.children,h=0;hNumber.EPSILON){if(c<0&&(a=t[o],l=-l,s=t[i],c=-c),e.ys.y)continue;if(e.y===a.y){if(e.x===a.x)return!0}else{var u=c*(e.x-a.x)-l*(e.y-a.y);if(0===u)return!0;if(u<0)continue;r=!r}}else{if(e.y!==a.y)continue;if(s.x<=e.x&&e.x<=a.x||a.x<=e.x&&e.x<=s.x)return!0}}return r}var i=xc.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===t)return n(o);var a,s,l,c=[];if(1===o.length)return s=o[0],(l=new Qu).curves=s.curves,c.push(l),c;var u=!i(o[0].getPoints());u=e?!u:u;var h,p,d=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var v=0,b=o.length;v1){for(var y=!1,_=[],x=0,w=f.length;x0&&(y||(m=d))}v=0;for(var j=f.length;v0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e=.5)for(var o=0;o!==i;++o)e[t+o]=e[n+o]},_slerp:function(e,t,n,r){Un.slerpFlat(e,t,e,t,e,n,r)},_lerp:function(e,t,n,r,i){for(var o=1-r,a=0;a!==i;++a){var s=t+a;e[s]=e[s]*o+e[n+a]*r}}});var $h=new RegExp("[\\[\\]\\.:\\/]","g"),Zh="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Qh=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),ep=/(WCOD+)?/.source.replace("WCOD",Zh),tp=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),np=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),rp=new RegExp("^"+Qh+ep+tp+np+"$"),ip=["material","materials","bones"];function op(e,t,n){var r=n||ap.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function ap(e,t,n){this.path=t,this.parsedPath=n||ap.parseTrackName(t),this.node=ap.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function sp(){this.uuid=An.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}function lp(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var r=t.tracks,i=r.length,o=new Array(i),a={endingStart:Ft,endingEnd:Ft},s=0;s!==i;++s){var l=r[s].createInterpolant(null);o[s]=l,l.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Rt,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function cp(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function up(e){"string"===typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function hp(e,t,n){Is.call(this,e,t),this.meshPerAttribute=n||1}function pp(e,t,n,r){this.ray=new Hr(e,t),this.near=n||0,this.far=r||1/0,this.camera=null,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function dp(e,t){return e.distance-t.distance}function fp(e,t,n,r){if(!1!==e.visible&&(e.raycast(t,n),!0===r))for(var i=e.children,o=0,a=i.length;o=t){var u=t++,h=e[u];n[h.uuid]=c,e[c]=h,n[l]=u,e[u]=s;for(var p=0,d=i;p!==d;++p){var f=r[p],m=f[u],g=f[c];f[c]=m,f[u]=g}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,o=i.length,a=0,s=arguments.length;a!==s;++a){var l=arguments[a].uuid,c=r[l];if(void 0!==c)if(delete r[l],c0)for(var l=this._interpolants,c=this._propertyBindings,u=0,h=l.length;u!==h;++u)l[u].evaluate(a),c[u].accumulate(r,s)}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e,n=this._clip.duration,r=this.loop,i=this._loopCount,o=r===It;if(0===e)return-1===i?t:o&&1===(1&i)?n-t:t;if(r===At){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(t>=n)t=n;else{if(!(t<0)){this.time=t;break e}t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),t>=n||t<0){var a=Math.floor(t/n);t-=n*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=e>0?n:0,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var l=e<0;this._setEndings(l,!l,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=t,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=t;if(o&&1===(1&i))return n-t}return t},_setEndings:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=Bt,r.endingEnd=Bt):(r.endingStart=e?this.zeroSlopeAtStart?Bt:Ft:zt,r.endingEnd=t?this.zeroSlopeAtEnd?Bt:Ft:zt)},_scheduleFading:function(e,t,n){var r=this._mixer,i=r.time,o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=t,a[1]=i+e,s[1]=n,this}}),cp.prototype=Object.assign(Object.create(jn.prototype),{constructor:cp,_bindAction:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,o=e._propertyBindings,a=e._interpolants,s=n.uuid,l=this._bindingsByRootAndName,c=l[s];void 0===c&&(c={},l[s]=c);for(var u=0;u!==i;++u){var h=r[u],p=h.name,d=c[p];if(void 0!==d)o[u]=d;else{if(void 0!==(d=o[u])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=t&&t._propertyBindings[u].binding.parsedPath;++(d=new Kh(ap.create(n,p,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(d,s,p),o[u]=d}a[u].resultBuffer=d.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,o=0,a=i.length;o!==a;++o){var s=i[o];0===s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0===--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&tthis.max.x||e.ythis.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new Rn),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new Rn),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return vp.copy(e).clamp(this.min,this.max).sub(e).length()},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var yp=new Gn,_p=new Gn;function xp(e,t){this.start=void 0!==e?e:new Gn,this.end=void 0!==t?t:new Gn}function wp(e){gr.call(this),this.material=e,this.render=function(){}}Object.assign(xp.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new Gn),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new Gn),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new Gn),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){yp.subVectors(e,this.start),_p.subVectors(this.end,this.start);var n=_p.dot(_p),r=_p.dot(yp)/n;return t&&(r=An.clamp(r,0,1)),r},closestPointToPoint:function(e,t,n){var r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Gn),this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),wp.prototype=Object.create(gr.prototype),wp.prototype.constructor=wp,wp.prototype.isImmediateRenderObject=!0;var Sp=new Gn;function Ep(e,t){gr.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new Li,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,o=1;i<32;i++,o++){var a=i/32*Math.PI*2,s=o/32*Math.PI*2;r.push(Math.cos(a),Math.sin(a),1,Math.cos(s),Math.sin(s),1)}n.setAttribute("position",new Ei(r,3));var l=new pl({fog:!1});this.cone=new xl(n,l),this.add(this.cone),this.update()}Ep.prototype=Object.create(gr.prototype),Ep.prototype.constructor=Ep,Ep.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Ep.prototype.update=function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Sp.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Sp),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var Cp=new Gn,Tp=new Zn,kp=new Zn;function jp(e){for(var t=function e(t){var n=[];t&&t.isBone&&n.push(t);for(var r=0;r.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Kp.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Kp,t)}},$p.prototype.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},$p.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},$p.prototype.copy=function(e){return gr.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},$p.prototype.clone=function(){return(new this.constructor).copy(this)},Zp.prototype=Object.create(xl.prototype),Zp.prototype.constructor=Zp;var Qp=4,ed=8,td=Math.pow(2,ed),nd=[.125,.215,.35,.446,.526,.582],rd=ed-Qp+1+nd.length,id=20,od=(r={},Object(i.a)(r,Gt,0),Object(i.a)(r,Vt,1),Object(i.a)(r,Xt,2),Object(i.a)(r,Jt,3),Object(i.a)(r,Kt,4),Object(i.a)(r,$t,5),Object(i.a)(r,Wt,6),r),ad=new sh,sd=function(e){var t=new Float32Array(e),n=new Gn(0,1,0),r=new Yc({defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:t},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:n},inputEncoding:{value:od[Gt]},outputEncoding:{value:od[Gt]}},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".concat("\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include \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 \n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tfor (int i = 0; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfor (int dir = -1; dir < 2; dir += 2) {\n\t\t\tif (i == 0 && dir == 1)\n\t\t\t\tcontinue;\n\t\t\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\t\t\tif (all(equal(axis, vec3(0.0))))\n\t\t\t\taxis = cross(vec3(0.0, 1.0, 0.0), vOutputDirection);\n\t\t\taxis = normalize(axis);\n\t\t\tfloat theta = dTheta * float(dir * i);\n\t\t\tfloat cosTheta = cos(theta);\n\t\t\t// Rodrigues' axis-angle rotation\n\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t\t\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\t\t\tgl_FragColor.rgb +=\n\t\t\t\t\tweights[i] * bilinearCubeUV(envMap, sampleDirection, mipInt);\n\t\t}\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t"),blending:P,depthTest:!1,depthWrite:!1});return r.type="SphericalGaussianBlur",r}(id),ld=null,cd=null,ud=function(){for(var e=[],t=[],n=[],r=ed,i=0;ied-Qp?a=nd[i-ed+Qp-1]:0==i&&(a=0),n.push(a);for(var s=1/(o-1),l=-s/2,c=1+s/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=new Float32Array(108),p=new Float32Array(72),d=new Float32Array(36),f=0;f<6;f++){var m=f%3*2/3-1,g=f>2?0:-1,v=[m,g,0,m+2/3,g,0,m+2/3,g+1,0,m,g,0,m+2/3,g+1,0,m,g+1,0];h.set(v,18*f),p.set(u,12*f);var b=[f,f,f,f,f,f];d.set(b,6*f)}var y=new Li;y.setAttribute("position",new gi(h,3)),y.setAttribute("uv",new gi(p,2)),y.setAttribute("faceIndex",new gi(d,1)),e.push(y),r>Qp&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}(),hd=ud._lodPlanes,pd=ud._sizeLods,dd=ud._sigmas,fd=null,md=null,gd=null,vd=(1+Math.sqrt(5))/2,bd=1/vd,yd=[new Gn(1,1,1),new Gn(-1,1,1),new Gn(1,1,-1),new Gn(-1,1,-1),new Gn(0,vd,bd),new Gn(0,vd,-bd),new Gn(bd,0,vd),new Gn(-bd,0,vd),new Gn(vd,bd,0),new Gn(-vd,bd,0)];function _d(e){md=e,Sd(sd)}function xd(e){var t={magFilter:ke,minFilter:ke,generateMipmaps:!1,type:e?e.type:Ne,format:e?e.format:et,encoding:e?e.encoding:Xt,depthBuffer:!1,stencilBuffer:!1},n=Ed(t);return n.depthBuffer=!e,fd=Ed(t),n}function wd(e){fd.dispose(),md.setRenderTarget(gd),e.scissorTest=!1,e.setSize(e.width,e.height)}function Sd(e){var t=new vr;t.add(new Qi(hd[0],e)),md.compile(t,ad)}function Ed(e){var t=new Bn(3*td,3*td,e);return t.texture.mapping=we,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function Cd(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function Td(e){var t=md.autoClear;md.autoClear=!1;for(var n=1;nid&&console.warn("sigmaRadians, ".concat(i,", is too large and will clip, as it requested ").concat(p," samples when the maximum is set to ").concat(id));for(var d=[],f=0,m=0;med-Qp?r-ed+Qp:0),3*b,2*b),md.setRenderTarget(t),md.render(s,ad)}function Od(){var e=new Yc({uniforms:{envMap:{value:null},texelSize:{value:new Rn(1,1)},inputEncoding:{value:od[Gt]},outputEncoding:{value:od[Gt]}},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 vec2 texelSize;\n\n".concat("\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include \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 RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tvec3 outputDirection = normalize(vOutputDirection);\n\tvec2 uv;\n\tuv.y = asin(clamp(outputDirection.y, -1.0, 1.0)) * RECIPROCAL_PI + 0.5;\n\tuv.x = atan(outputDirection.z, outputDirection.x) * RECIPROCAL_PI2 + 0.5;\n\tvec2 f = fract(uv / texelSize - 0.5);\n\tuv -= f * texelSize;\n\tvec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x += texelSize.x;\n\tvec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.y += texelSize.y;\n\tvec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x -= texelSize.x;\n\tvec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tvec3 tm = mix(tl, tr, f.x);\n\tvec3 bm = mix(bl, br, f.x);\n\tgl_FragColor.rgb = mix(tm, bm, f.y);\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t"),blending:P,depthTest:!1,depthWrite:!1});return e.type="EquirectangularToCubeUV",e}function Md(){var e=new Yc({uniforms:{envMap:{value:null},inputEncoding:{value:od[Gt]},outputEncoding:{value:od[Gt]}},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 samplerCube envMap;\n\n".concat("\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include \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\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t"),blending:P,depthTest:!1,depthWrite:!1});return e.type="CubemapToCubeUV",e}function Pd(e,t,n,r,i,o,a){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new hi(e,t,n,i,o,a)}_d.prototype={constructor:_d,fromScene:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;gd=md.getRenderTarget();var i=xd();return function(e,t,n,r){var i=new vo(90,1,t,n),o=[1,1,1,1,-1,1],a=[1,1,-1,-1,-1,1],s=md.outputEncoding,l=md.toneMapping,c=md.toneMappingExposure,u=md.getClearColor(),h=md.getClearAlpha();md.toneMapping=he,md.toneMappingExposure=1,md.outputEncoding=Gt,e.scale.z*=-1;var p=e.background;if(p&&p.isColor){p.convertSRGBToLinear();var d=Math.max(p.r,p.g,p.b),f=Math.min(Math.max(Math.ceil(Math.log2(d)),-128),127);p=p.multiplyScalar(Math.pow(2,-f));var m=(f+128)/255;md.setClearColor(p,m),e.background=null}for(var g=0;g<6;g++){var v=g%3;0==v?(i.up.set(0,o[g],0),i.lookAt(a[g],0,0)):1==v?(i.up.set(0,0,o[g]),i.lookAt(0,a[g],0)):(i.up.set(0,o[g],0),i.lookAt(0,0,a[g])),Cd(r,v*td,g>2?td:0,td,td),md.setRenderTarget(r),md.render(e,i)}md.toneMapping=l,md.toneMappingExposure=c,md.outputEncoding=s,md.setClearColor(u,h),e.scale.z*=-1}(e,n,r,i),t>0&&kd(i,0,0,t),Td(i),wd(i),i},fromEquirectangular:function(e){return e.magFilter=ke,e.minFilter=ke,e.generateMipmaps=!1,this.fromCubemap(e)},fromCubemap:function(e){gd=md.getRenderTarget();var t=xd(e);return function(e,t){var n=new vr;e.isCubeTexture?null==cd&&(cd=Md()):null==ld&&(ld=Od());var r=e.isCubeTexture?cd:ld;n.add(new Qi(hd[0],r));var i=r.uniforms;i.envMap.value=e,e.isCubeTexture||i.texelSize.value.set(1/e.image.width,1/e.image.height);i.inputEncoding.value=od[e.encoding],i.outputEncoding.value=od[e.encoding],Cd(t,0,0,3*td,2*td),md.setRenderTarget(t),md.render(n,ad)}(e,t),Td(t),wd(t),t},compileCubemapShader:function(){null==cd&&Sd(cd=Md())},compileEquirectangularShader:function(){null==ld&&Sd(ld=Od())},dispose:function(){sd.dispose(),null!=cd&&cd.dispose(),null!=ld&&ld.dispose();for(var e=0;e=0&&e.splice(n,1)}function f(e){var t=!1;return function(){t||(t=!0,e())}}var m=function(e){throw e},g=function(e){return{value:e,done:!0}};function v(e,t,n){void 0===t&&(t=m),void 0===n&&(n="iterator");var r={meta:{name:n},next:e,throw:t,return:g,isSagaIterator:!0};return"undefined"!==typeof Symbol&&(r[Symbol.iterator]=function(){return r}),r}function b(e,t){var n=t.sagaStack;console.error(e),console.error(n)}var y=function(e){return new Error("\n redux-saga: Error checking hooks detected an inconsistent state. This is likely a bug\n in redux-saga code and not yours. Thanks for reporting this in the project's github repo.\n Error: "+e+"\n")},_=function(e){return Array.apply(null,new Array(e))},x=function(e){return function(t){return e(Object.defineProperty(t,r.f,{value:!0}))}},w=function(e){return e===r.k},S=function(e){return e===r.j},E=function(e){return w(e)||S(e)};function C(e,t){var n=Object.keys(e),r=n.length;var i,a=0,s=Object(o.a)(e)?_(r):{},c={};return n.forEach(function(e){var n=function(n,o){i||(o||E(n)?(t.cancel(),t(n,o)):(s[e]=n,++a===r&&(i=!0,t(s))))};n.cancel=l,c[e]=n}),t.cancel=function(){i||(i=!0,n.forEach(function(e){return c[e].cancel()}))},c}function T(e){return{name:e.name||"anonymous",location:k(e)}}function k(e){return e[r.g]}var j="Channel's Buffer overflow!",O=1,M=3,P=4,A={isEmpty:s,put:l,take:l};function R(e,t){void 0===e&&(e=10);var n=new Array(e),r=0,i=0,o=0,a=function(t){n[i]=t,i=(i+1)%e,r++},s=function(){if(0!=r){var t=n[o];return n[o]=null,r--,o=(o+1)%e,t}},l=function(){for(var e=[];r;)e.push(s());return e};return{isEmpty:function(){return 0==r},put:function(s){var c;if(r1?t-1:0),r=1;r1?t-1:0),r=1;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},function(e,t,n){"use strict";function r(e){var t,n,i="";if(e)if("object"===typeof e)if(e.push)for(t=0;t2?n-2:0),o=2;o2?n-2:0),o=2;o1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var o=t.defaultTheme,s=t.withTheme,p=void 0!==s&&s,d=t.name,f=Object(i.a)(t,["defaultTheme","withTheme","name"]),m=d,g=Object(c.a)(e,Object(r.a)({defaultTheme:o,Component:n,name:d||n.displayName,classNamePrefix:m},f)),v=a.a.forwardRef(function(e,t){e.classes;var s,l=e.innerRef,c=Object(i.a)(e,["classes","innerRef"]),f=g(e),m=c;return("string"===typeof d||p)&&(s=Object(h.a)()||o,d&&(m=Object(u.a)({theme:s,name:d,props:c})),p&&!m.theme&&(m.theme=s)),a.a.createElement(n,Object(r.a)({ref:l||t,classes:f},m))});return v.defaultProps=n.defaultProps,l()(v,n),v}},d=n(50);t.a=function(e,t){return p(e,Object(r.a)({defaultTheme:d.a},t))}},function(e,t,n){"use strict";var r=n(0),i=n.n(r),o=n(12),a=n.n(o),s=i.a.createContext(null);var l=function(e){e()},c=function(){return l},u=null,h={notify:function(){}};var p=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=h,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=function(){var e=c(),t=[],n=[];return{clear:function(){n=u,t=u},notify:function(){var r=t=n;e(function(){for(var e=0;e. You may also pass a {context : MyContext} option to connect");var I=A;return function(t){var n=t.displayName||t.name||"Component",o=a(n),s=Object(m.a)({},R,{getDisplayName:a,methodName:c,renderCountProp:h,shouldHandleStateChanges:f,storeKey:y,displayName:o,wrappedComponentName:n,WrappedComponent:t}),l=R.pure;var u=l?r.useMemo:function(e){return e()};function d(n){var a=Object(r.useMemo)(function(){var e=n.forwardedRef,t=Object(g.a)(n,["forwardedRef"]);return[n.context,e,t]},[n]),l=a[0],c=a[1],h=a[2],d=Object(r.useMemo)(function(){return l&&l.Consumer&&Object(x.isContextConsumer)(i.a.createElement(l.Consumer,null))?l:I},[l,I]),v=Object(r.useContext)(d),b=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch),y=Boolean(v)&&Boolean(v.store);_()(b||y,'Could not find "store" in the context of "'+o+'". Either wrap the root component in a , or pass a custom React context provider to and the corresponding React context consumer to '+o+" in connect options.");var k=b?n.store:v.store,j=Object(r.useMemo)(function(){return function(t){return e(t.dispatch,s)}(k)},[k]),O=Object(r.useMemo)(function(){if(!f)return E;var e=new p(k,b?null:v.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]},[k,b,v]),M=O[0],P=O[1],A=Object(r.useMemo)(function(){return b?v:Object(m.a)({},v,{subscription:M})},[b,v,M]),R=Object(r.useReducer)(C,S,T),L=R[0][0],D=R[1];if(L&&L.error)throw L.error;var N=Object(r.useRef)(),F=Object(r.useRef)(h),B=Object(r.useRef)(),z=Object(r.useRef)(!1),U=u(function(){return B.current&&h===F.current?B.current:j(k.getState(),h)},[k,L,h]);w(function(){F.current=h,N.current=U,z.current=!1,B.current&&(B.current=null,P())}),w(function(){if(f){var e=!1,t=null,n=function(){if(!e){var n,r,i=k.getState();try{n=j(i,F.current)}catch(o){r=o,t=o}r||(t=null),n===N.current?z.current||P():(N.current=n,B.current=n,z.current=!0,D({type:"STORE_UPDATED",payload:{error:r}}))}};M.onStateChange=n,M.trySubscribe(),n();return function(){if(e=!0,M.tryUnsubscribe(),M.onStateChange=null,t)throw t}}},[k,M,j]);var H=Object(r.useMemo)(function(){return i.a.createElement(t,Object(m.a)({},U,{ref:c}))},[c,t,U]);return Object(r.useMemo)(function(){return f?i.a.createElement(d.Provider,{value:A},H):H},[d,H,A])}var v=l?i.a.memo(d):d;if(v.WrappedComponent=t,v.displayName=o,M){var k=i.a.forwardRef(function(e,t){return i.a.createElement(v,Object(m.a)({},e,{forwardedRef:t}))});return k.displayName=o,k.WrappedComponent=t,b()(k,t)}return b()(v,t)}}var j=Object.prototype.hasOwnProperty;function O(e,t){return e===t?0!==e||0!==t||1/e===1/t:e!==e&&t!==t}function M(e,t){if(O(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i=0;r--){var i=t[r](e);if(i)return i}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function q(e,t){return e===t}!function(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?k:n,i=t.mapStateToPropsFactories,o=void 0===i?D:i,a=t.mapDispatchToPropsFactories,s=void 0===a?L:a,l=t.mergePropsFactories,c=void 0===l?F:l,u=t.selectorFactory,h=void 0===u?U:u}();function G(){var e=Object(r.useContext)(s);return _()(e,"could not find react-redux context value; please ensure the component is wrapped in a "),e}function V(e){void 0===e&&(e=s);var t=e===s?G:function(){return Object(r.useContext)(e)};return function(){return t().store}}var W=V();var X=function(e){void 0===e&&(e=s);var t=e===s?W:V(e);return function(){return t().dispatch}}(),Y=function(e,t){return e===t};var J,K=function(e){void 0===e&&(e=s);var t=e===s?G:function(){return Object(r.useContext)(e)};return function(e,n){void 0===n&&(n=Y),_()(e,"You must pass a selector to useSelectors");var i=t();return function(e,t,n,i){var o,a=Object(r.useReducer)(function(e){return e+1},0)[1],s=Object(r.useMemo)(function(){return new p(n,i)},[n,i]),l=Object(r.useRef)(),c=Object(r.useRef)(),u=Object(r.useRef)();try{o=e!==c.current||l.current?e(n.getState()):u.current}catch(d){var h="An error occurred while selecting the store state: "+d.message+".";throw l.current&&(h+="\nThe error may be correlated with this previous error:\n"+l.current.stack+"\n\nOriginal stack trace:"),new Error(h)}return w(function(){c.current=e,u.current=o,l.current=void 0}),w(function(){function e(){try{var e=c.current(n.getState());if(t(e,u.current))return;u.current=e}catch(d){l.current=d}a({})}return s.onStateChange=e,s.trySubscribe(),e(),function(){return s.tryUnsubscribe()}},[n,s]),o}(e,n,i.store,i.subscription)}}(),$=n(22);n.d(t,"a",function(){return f}),n.d(t,"b",function(){return X}),n.d(t,"c",function(){return K}),J=$.unstable_batchedUpdates,l=J},function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return o}),n.d(t,"c",function(){return a}),n.d(t,"d",function(){return s}),n.d(t,"e",function(){return l}),n.d(t,"f",function(){return c}),n.d(t,"g",function(){return f}),n.d(t,"h",function(){return u}),n.d(t,"i",function(){return h}),n.d(t,"j",function(){return p}),n.d(t,"k",function(){return d});var r=function(e){return"@@redux-saga/"+e},i=r("CANCEL_PROMISE"),o=r("CHANNEL_END"),a=r("IO"),s=r("MATCH"),l=r("MULTICAST"),c=r("SAGA_ACTION"),u=r("SELF_CANCELLATION"),h=r("TASK"),p=r("TASK_CANCEL"),d=r("TERMINATE"),f=r("LOCATION")},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";function r(e){return e.charAt(0).toUpperCase()+e.slice(1)}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";function r(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";(function(e){var r=n(52),i=n(0),o=n.n(i),a=(n(117),n(118)),s=n(119),l=n(96),c=n(34),u=n.n(c);function h(){return(h=Object.assign||function(e){for(var t=1;t1?t-1:0),r=1;r0?" Additional arguments: "+n.join(", "):""))}var T=function(e){var t=document.head,n=e||t,r=document.createElement("style"),i=function(e){for(var t=e.childNodes,n=t.length;n>=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(y))return r}}(n),o=void 0!==i?i.nextSibling:null;r.setAttribute(y,"active"),r.setAttribute(_,x);var a=E();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},k=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)(i<<=1)<0&&C(16,""+e);this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var o=r;o=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,o=r;o=L&&(L=t+1),R.set(e,t),I.set(t,e)},B="style["+y+"]["+_+'="'+x+'"]',z=new RegExp("^"+y+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),U=function(e,t,n){for(var r,i=n.split(","),o=0,a=i.length;o0&&(c+=e+",")}),r+=""+s+l+'{content:"'+c+'"}/*!sc*/\n'}}}return r}(this)},e}(),X=5381,Y=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},J=function(e){return Y(X,e)};var K=/^\s*\/\/.*$/gm;function $(e){var t,n,r,i=void 0===e?m:e,o=i.options,s=void 0===o?m:o,l=i.plugins,c=void 0===l?f:l,u=new a.a(s),h=[],p=function(e){function t(t){if(t)try{e(t+"}")}catch(n){}}return function(n,r,i,o,a,s,l,c,u,h){switch(n){case 1:if(0===u&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===c)return r+"/*|*/";break;case 3:switch(c){case 102:case 112:return e(i[0]+r),"";default:return r+(0===h?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}(function(e){h.push(e)}),d=function(e,r,i){return r>0&&-1!==i.slice(0,r).indexOf(n)&&i.slice(r-n.length,r)!==n?"."+t:e};function g(e,i,o,a){void 0===a&&(a="&");var s=e.replace(K,""),l=i&&o?o+" "+i+" { "+s+" }":s;return t=a,n=i,r=new RegExp("\\"+n+"\\b","g"),u(o||!i?"":i,l)}return u.use([].concat(c,[function(e,t,i){2===e&&i.length&&i[0].lastIndexOf(n)>0&&(i[0]=i[0].replace(r,d))},p,function(e){if(-2===e){var t=h;return h=[],t}}])),g.hash=c.length?c.reduce(function(e,t){return t.name||C(15),Y(e,t.name)},X).toString():"",g}var Z=o.a.createContext(),Q=(Z.Consumer,o.a.createContext()),ee=(Q.Consumer,new W),te=$();function ne(){return Object(i.useContext)(Z)||ee}function re(){return Object(i.useContext)(Q)||te}var ie=function(){function e(e,t){var n=this;this.inject=function(e){e.hasNameForId(n.id,n.name)||e.insertRules(n.id,n.name,te.apply(void 0,n.stringifyArgs))},this.toString=function(){return C(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.stringifyArgs=t}return e.prototype.getName=function(){return this.name},e}(),oe=/([A-Z])/g,ae=/^ms-/;function se(e){return e.replace(oe,"-$1").toLowerCase().replace(ae,"-ms-")}var le=function(e){return void 0===e||null===e||!1===e||""===e},ce=function e(t,n){var r=[];return Object.keys(t).forEach(function(n){if(!le(t[n])){if(d(t[n]))return r.push.apply(r,e(t[n],n)),r;if(g(t[n]))return r.push(se(n)+":",t[n],";"),r;r.push(se(n)+": "+(i=n,null==(o=t[n])||"boolean"===typeof o||""===o?"":"number"!==typeof o||0===o||i in s.a?String(o).trim():o+"px")+";")}var i,o;return r}),n?[n+" {"].concat(r,["}"]):r};function ue(e,t,n){if(Array.isArray(e)){for(var r,i=[],o=0,a=e.length;o1?t-1:0),r=1;r1?t-1:0),r=1;r25?39:97))};function ye(e){var t,n="";for(t=Math.abs(e);t>ve;t=t/ve|0)n=be(t%ve)+n;return(be(t%ve)+n).replace(ge,"$1-$2")}function _e(e){for(var t=0;t>>0);if(!t.hasNameForId(r,o)){var a=n(i,"."+o,void 0,r);t.insertRules(r,o,a)}return this.staticRulesId=o,o}for(var s=this.rules.length,l=Y(this.baseHash,n.hash),c="",u=0;u>>0);if(!t.hasNameForId(r,f)){var m=n(c,"."+f,void 0,r);t.insertRules(r,f,m)}return f},e}(),we=(new Set,function(e,t,n){return void 0===n&&(n=m),e.theme!==n.theme&&e.theme||t||n.theme}),Se=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Ee=/(^-|-$)/g;function Ce(e){return e.replace(Se,"-").replace(Ee,"")}function Te(e){return"string"===typeof e&&!0}var ke=function(e){return ye(J(e)>>>0)};var je=o.a.createContext();je.Consumer;var Oe={};function Me(e,t,n){var r=e.attrs,o=e.componentStyle,a=e.defaultProps,s=e.foldedComponentIds,c=e.shouldForwardProp,u=e.styledComponentId,p=e.target;Object(i.useDebugValue)(u);var d=function(e,t,n){void 0===e&&(e=m);var r=h({},t,{theme:e}),i={};return n.forEach(function(e){var t,n,o,a=e;for(t in g(a)&&(a=a(r)),a)r[t]=i[t]="className"===t?(n=i[t],o=a[t],n&&o?n+" "+o:n||o):a[t]}),[r,i]}(we(t,Object(i.useContext)(je),a)||m,t,r),f=d[0],v=d[1],b=function(e,t,n,r){var o=ne(),a=re(),s=e.isStatic&&!t?e.generateAndInjectStyles(m,o,a):e.generateAndInjectStyles(n,o,a);return Object(i.useDebugValue)(s),s}(o,r.length>0,f),y=n,_=v.$as||t.$as||v.as||t.as||p,x=Te(_),w=v!==t?h({},t,{},v):t,S=c||x&&l.a,E={};for(var C in w)"$"!==C[0]&&"as"!==C&&("forwardedAs"===C?E.as=w[C]:S&&!S(C,l.a)||(E[C]=w[C]));return t.style&&v.style!==t.style&&(E.style=h({},t.style,{},v.style)),E.className=Array.prototype.concat(s,u,b!==u?b:null,t.className,v.className).filter(Boolean).join(" "),E.ref=y,Object(i.createElement)(_,E)}function Pe(e,t,n){var r=b(e),i=!Te(e),a=t.displayName,s=void 0===a?function(e){return Te(e)?"styled."+e:"Styled("+v(e)+")"}(e):a,l=t.componentId,c=void 0===l?function(e,t){var n="string"!==typeof e?"sc":Ce(e);Oe[n]=(Oe[n]||0)+1;var r=n+"-"+ke(n+Oe[n]);return t?t+"-"+r:r}(t.displayName,t.parentComponentId):l,p=t.attrs,d=void 0===p?f:p,m=t.displayName&&t.componentId?Ce(t.displayName)+"-"+t.componentId:t.componentId||c,g=r&&e.attrs?Array.prototype.concat(e.attrs,d).filter(Boolean):d,y=t.shouldForwardProp;r&&e.shouldForwardProp&&(y=y?function(n,r){return e.shouldForwardProp(n,r)&&t.shouldForwardProp(n,r)}:e.shouldForwardProp);var _,x=new xe(r?e.componentStyle.rules.concat(n):n,m),w=function(e,t){return Me(_,e,t)};return w.displayName=s,(_=o.a.forwardRef(w)).attrs=g,_.componentStyle=x,_.displayName=s,_.shouldForwardProp=y,_.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):f,_.styledComponentId=m,_.target=r?e.target:e,_.withComponent=function(e){var r=t.componentId,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(t,["componentId"]),o=r&&r+"-"+(Te(e)?e:Ce(v(e)));return Pe(e,h({},i,{attrs:g,componentId:o}),n)},Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?me({},e.defaultProps,t):t}}),_.toString=function(){return"."+_.styledComponentId},i&&u()(_,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,self:!0,styledComponentId:!0,target:!0,withComponent:!0}),_}var Ae=function(e){return function e(t,n,i){if(void 0===i&&(i=m),!Object(r.isValidElementType)(n))return C(1,String(n));var o=function(){return t(n,i,he.apply(void 0,arguments))};return o.withConfig=function(r){return e(t,n,h({},i,{},r))},o.attrs=function(r){return e(t,n,h({},i,{attrs:Array.prototype.concat(i.attrs,r).filter(Boolean)}))},o}(Pe,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){Ae[e]=Ae(e)});t.a=Ae}).call(this,n(72))},function(e,t,n){e.exports=n(155)},function(e,t,n){"use strict";function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),n)}function i(e){if(e.type)return e;if("#"===e.charAt(0))return i(function(e){e=e.substr(1);var t=new RegExp(".{1,".concat(e.length/3,"}"),"g"),n=e.match(t);return n&&1===n[0].length&&(n=n.map(function(e){return e+e})),n?"rgb(".concat(n.map(function(e){return parseInt(e,16)}).join(", "),")"):""}(e));var t=e.indexOf("("),n=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(["Material-UI: unsupported `".concat(e,"` color."),"We support the following formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()."].join("\n"));var r=e.substring(t+1,e.length-1).split(",");return{type:n,values:r=r.map(function(e){return parseFloat(e)})}}function o(e){var t=e.type,n=e.values;return-1!==t.indexOf("rgb")?n=n.map(function(e,t){return t<3?parseInt(e,10):e}):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(t,"(").concat(n.join(", "),")")}function a(e,t){var n=s(e),r=s(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function s(e){var t="hsl"===(e=i(e)).type?i(function(e){var t=(e=i(e)).values,n=t[0],r=t[1]/100,a=t[2]/100,s=r*Math.min(a,1-a),l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+n/30)%12;return a-s*Math.max(Math.min(t-3,9-t,1),-1)},c="rgb",u=[Math.round(255*l(0)),Math.round(255*l(8)),Math.round(255*l(4))];return"hsla"===e.type&&(c+="a",u.push(t[3])),o({type:c,values:u})}(e)).values:e.values;return t=t.map(function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function l(e,t){return e=i(e),t=r(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,o(e)}function c(e,t){if(e=i(e),t=r(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]*=1-t;return o(e)}function u(e,t){if(e=i(e),t=r(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;return o(e)}n.d(t,"c",function(){return a}),n.d(t,"b",function(){return l}),n.d(t,"a",function(){return c}),n.d(t,"d",function(){return u})},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(148)},,function(e,t,n){"use strict";n.d(t,"a",function(){return h}),n.d(t,"b",function(){return v});var r=n(42),i=n(26),o=n(0),a=n.n(o),s=n(38),l=(n(12),n(1)),c=n(16),u=n(32),h=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i=0||(i[n]=e[n]);return i}var d,f=n(2),m=n(111),g=n.n(m),v=n(56),b=n(0),y=n.n(b),_=n(112),x=(n(113),n(22)),w=n.n(x),S=n(114),E=[],C="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(d||(d={}));var T,k=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Object.freeze(this)}return e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),j=function(e){return e instanceof SVGElement&&"getBBox"in e},O=function(e){if(j(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,o=i.offsetWidth,a=i.offsetHeight;return!(o||a||e.getClientRects().length)},M="undefined"!==typeof window?window:{},P=new Map,A=/auto|scroll/,R=/^tb|vertical/,I=/msie|trident/i.test(M.navigator&&M.navigator.userAgent),L=function(e){return parseFloat(e||"0")},D=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),Object.freeze({inlineSize:(n?t:e)||0,blockSize:(n?e:t)||0})},N=Object.freeze({devicePixelContentBoxSize:D(),borderBoxSize:D(),contentBoxSize:D(),contentRect:new k(0,0,0,0)}),F=function(e){if(P.has(e))return P.get(e);if(O(e))return P.set(e,N),N;var t=getComputedStyle(e),n=j(e)&&e.ownerSVGElement&&e.getBBox(),r=!I&&"border-box"===t.boxSizing,i=R.test(t.writingMode||""),o=!n&&A.test(t.overflowY||""),a=!n&&A.test(t.overflowX||""),s=n?0:L(t.paddingTop),l=n?0:L(t.paddingRight),c=n?0:L(t.paddingBottom),u=n?0:L(t.paddingLeft),h=n?0:L(t.borderTopWidth),p=n?0:L(t.borderRightWidth),d=n?0:L(t.borderBottomWidth),f=u+l,m=s+c,g=(n?0:L(t.borderLeftWidth))+p,v=h+d,b=a?e.offsetHeight-v-e.clientHeight:0,y=o?e.offsetWidth-g-e.clientWidth:0,_=r?f+g:0,x=r?m+v:0,w=n?n.width:L(t.width)-_-y,S=n?n.height:L(t.height)-x-b,E=w+f+y+g,C=S+m+b+v,T=Object.freeze({devicePixelContentBoxSize:D(Math.round(w*devicePixelRatio),Math.round(S*devicePixelRatio),i),borderBoxSize:D(E,C,i),contentBoxSize:D(w,S,i),contentRect:new k(u,s,w,S)});return P.set(e,T),T},B=function(e,t){var n=F(e),r=n.borderBoxSize,i=n.contentBoxSize,o=n.devicePixelContentBoxSize;switch(t){case d.DEVICE_PIXEL_CONTENT_BOX:return o;case d.BORDER_BOX:return r;default:return i}},z=function(){return function(e){var t=F(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=[t.borderBoxSize],this.contentBoxSize=[t.contentBoxSize],this.devicePixelContentBoxSize=[t.devicePixelContentBoxSize]}}(),U=function(e){if(O(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},H=function(){var e=1/0,t=[];E.forEach(function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach(function(t){var n=new z(t.target),i=U(t.target);r.push(n),t.lastReportedSize=B(t.target,t.observedBox),ie?t.activeTargets.push(n):t.skippedTargets.push(n))})})},G=function(){var e=0;for(q(e);E.some(function(e){return e.activeTargets.length>0});)e=H(),q(e);return E.some(function(e){return e.skippedTargets.length>0})&&function(){var e;"function"===typeof ErrorEvent?e=new ErrorEvent("error",{message:C}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=C),window.dispatchEvent(e)}(),e>0},V=[],W=function(e){if(!T){var t=document.createTextNode("");new MutationObserver(function(){return V.splice(0).forEach(function(e){return e()})}).observe(t,{characterData:!0}),T=function(){t.textContent=""}}V.push(e),T()},X=0,Y={attributes:!0,characterData:!0,childList:!0,subtree:!0},J=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],K=!1,$=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t,n=this;K||(K=!0,t=function(){var t=!1;try{t=G()}finally{if(K=!1,!X)return;t?n.run(60):e?n.run(e-1):n.start()}},W(function(){requestAnimationFrame(t)}))},e.prototype.schedule=function(){this.stop(),this.run(12)},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,Y)};document.body?t():M.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),J.forEach(function(t){return M.addEventListener(t,e.listener,!0)}))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),J.forEach(function(t){return M.removeEventListener(t,e.listener,!0)}),this.stopped=!0)},e}()),Z=function(e){!X&&e>0&&$.start(),!(X+=e)&&$.stop()},Q=function(){function e(e,t){this.target=e,this.observedBox=t||d.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=B(this.target,this.observedBox);return e=this.target,j(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),ee=function(){return function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t}}(),te=new Map,ne=function(e,t){for(var n=0;n=0&&(n.observationTargets.splice(r,1),Z(-1))}},e.disconnect=function(e){if(te.has(e)){var t=te.get(e);E.splice(E.indexOf(t),1),te.delete(e),Z(-t.observationTargets.length)}},e}(),ie=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!==typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");re.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(e instanceof Element===!1)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");re.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(e instanceof Element===!1)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");re.unobserve(this,e)},e.prototype.disconnect=function(){re.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();n.d(t,"a",function(){return Ue}),n.d(t,"b",function(){return ue}),n.d(t,"c",function(){return ve}),n.d(t,"d",function(){return ge}),n.d(t,"e",function(){return fe}),n.d(t,"f",function(){return Ie}),n.d(t,"g",function(){return Le});function oe(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}var ae=new Map,se={},le={obj:function(e){return e===Object(e)},str:function(e){return"string"===typeof e},num:function(e){return"number"===typeof e},und:function(e){return void 0===e},arr:function(e){return Array.isArray(e)},equ:function(e,t){if(typeof e!==typeof t)return!1;if(le.str(e)||le.num(e)||le.obj(e))return e===t;if(le.arr(e)&&e==t)return!0;var n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!le.und(n)||e===t}},ce=[];function ue(e){ce.push(e)}function he(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;arguments.length>3&&void 0!==arguments[3]&&arguments[3]&&ce.forEach(function(e){return e(t)&&n++});var r=e.current.clock.getDelta();return e.current.subscribers.forEach(function(t){return t.ref.current(e.current,r)}),e.current.frames=Math.max(0,e.current.frames-1),n+=e.current.invalidateFrameloop?e.current.frames:1,e.current.manual||e.current.gl.render(e.current.scene,e.current.camera),n}var pe=!1;function de(e){pe=!0;var t=0;if(ce.forEach(function(n){return n(e)&&t++}),ae.forEach(function(n){var r=n.containerInfo.__state;r.current.active&&r.current.ready&&(!r.current.invalidateFrameloop||r.current.frames>0)&&(t=he(r,e,t))}),0!==t)return requestAnimationFrame(de);pe=!1}function fe(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!0===e)ae.forEach(function(e){return e.containerInfo.__state.current.frames=t});else if(e&&e.current){if(e.current.vr)return;e.current.frames=t}pe||(pe=!0,requestAnimationFrame(de))}var me={},ge=function(e){me=h({},me,{},e)};function ve(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e.__container,d=Object.keys(t).filter(function(e){return le.equ(t[e],n[e])}),m=Object.keys(t).filter(function(e){return"function"===typeof t[e]&&e.startsWith("on")}),g=r?Object.keys(n).filter(function(e){return void 0===t[e]}):[],v=[].concat(Object(u.a)(d),["children","key","ref"]).reduce(function(e,t){return p(e,[t].map(oe))},t);if(g.forEach(function(e){return"children"!==e&&(v[e]=void 0)}),Object.keys(v).length>0){if(Object.entries(v).forEach(function(t){var n,r=Object(c.a)(t,2),i=r[0],o=r[1];if(!m.includes(i)){var h,p=e,d=p[i];if(i.includes("-")){var g=i.split("-");if(!(d=g.reduce(function(e,t){return e[t]},e))||!d.set){var v=g.reverse(),b=(n=v,Object(a.a)(n)||Object(s.a)(n)||Object(l.a)()),y=b[0];p=b.slice(1).reverse().reduce(function(e,t){return e[t]},e),i=y}}if(d&&d.set&&(d.copy||d instanceof f.Layers))Array.isArray(o)?(h=d).set.apply(h,Object(u.a)(o)):d.copy&&o&&o.constructor&&d.constructor.name===o.constructor.name?d.copy(o):void 0!==o&&d.set(o);else p[i]=o;be(e)}}),r&&i&&e.raycast&&e.__handlers){e.__handlers=void 0;var b=i.__interaction.indexOf(e);b>-1&&i.__interaction.splice(b,1)}m.length&&(i&&e.raycast&&(1===m.length&&"onUpdate"===m[0]||i.__interaction.push(e)),e.__handlers=m.reduce(function(e,n){return h({},e,Object(o.a)({},n.charAt(2).toLowerCase()+n.substr(3),t[n]))},{})),e.parent&&ye(e)}}function be(e){e.__container&&e.__container.__state&&fe(e.__container.__state)}function ye(e){e.__handlers&&e.__handlers.update&&e.__handlers.update(e)}function _e(e,t,n,r,o){var a,s=t.args,l=void 0===s?[]:s,c=p(t,["args"]),h=""+e[0].toUpperCase()+e.slice(1);if("primitive"===e)(a=c.object).__instance=!0;else if("new"===e)a=new c.object(l);else{var d=me[h]||f[h];a=le.arr(l)?i(d,Object(u.a)(l)):new d(l)}for(;n.__container;)n=n.__container;if(!ae.has(n)){n=function e(t){return t.return?e(t.return):t.stateNode&&t.stateNode.containerInfo}(o)}return a.__objects=[],a.__container=n,ve(a,c,{}),a}function xe(e,t){t&&(t.isObject3D?e.add(t):(e.__objects.push(t),t.parent=e,t.attach?e[t.attach]=t:t.attachArray?(le.arr(e[t.attachArray])||(e[t.attachArray]=[]),e[t.attachArray].push(t)):t.attachObject&&(le.obj(e[t.attachObject[0]])||(e[t.attachObject[0]]={}),e[t.attachObject[0]][t.attachObject[1]]=t)),ye(t),be(t))}function we(e,t,n){if(t){if(t.isObject3D){t.parent=e,t.dispatchEvent({type:"added"});var r=e.children.indexOf(n);e.children=[].concat(Object(u.a)(e.children.slice(0,r)),[t],Object(u.a)(e.children.slice(r))),ye(t)}else xe(e,t);be(t)}}function Se(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e&&(n?Object(u.a)(e):e).forEach(function(e){return Ee(t,e)})}function Ee(e,t){t&&(t.isObject3D?e.remove(t):(t.parent=null,e.__objects=e.__objects.filter(function(e){return e!==t}),t.attach?e[t.attach]=null:t.attachArray?e[t.attachArray]=e[t.attachArray].filter(function(e){return e!==t}):t.attachObject&&delete e[t.attachObject[0]][t.attachObject[1]]),be(t),null!==t.dispose&&Object(v.unstable_runWithPriority)(v.unstable_IdlePriority,function(){t.__container&&(t.__container.__interaction=t.__container.__interaction.filter(function(e){return e!==t})),Se(t.__objects,t),Se(t.children,t,!0),t.dispose&&t.dispose(),delete t.__container,delete t.__objects}))}function Ce(e,t,n,r){var i=e.parent,o=_e(t,n,e.__container,0,r);Ee(i,e),xe(i,o),[r,r.alternate].forEach(function(e){null!==e&&(e.stateNode=o,e.ref&&("function"===typeof e.ref?e.ref(o):e.ref.current=o))})}var Te=g()({now:v.unstable_now,createInstance:_e,removeChild:Ee,appendChild:xe,insertBefore:we,supportsMutation:!0,isPrimaryRenderer:!1,scheduleTimeout:"function"===typeof setTimeout?setTimeout:void 0,cancelTimeout:"function"===typeof clearTimeout?clearTimeout:void 0,noTimeout:-1,appendInitialChild:xe,appendChildToContainer:xe,removeChildFromContainer:Ee,insertInContainerBefore:we,commitUpdate:function(e,t,n,r,i,o){if(e.__instance&&i.object&&i.object!==e)Ce(e,n,i,o);else{var a=i.args,s=void 0===a?[]:a,l=p(i,["args"]),u=r.args,h=void 0===u?[]:u,d=p(r,["args"]);s.some(function(e,t){return le.obj(e)?Object.entries(e).some(function(e){var n=Object(c.a)(e,2),r=n[0];return n[1]!==h[t][r]}):e!==h[t]})?Ce(e,n,i,o):ve(e,l,d,!0)}},hideInstance:function(e){e.isObject3D&&(e.visible=!1,be(e))},unhideInstance:function(e,t){(e.isObject3D&&null==t.visible||t.visible)&&(e.visible=!0,be(e))},getPublicInstance:function(e){return e},getRootHostContext:function(){return se},getChildHostContext:function(){return se},createTextInstance:function(){},finalizeInitialChildren:function(){return!1},prepareUpdate:function(){return se},shouldDeprioritizeSubtree:function(){return!1},prepareForCommit:function(){},resetAfterCommit:function(){},shouldSetTextContent:function(){return!1}}),ke=0,je=2;"function"===typeof Symbol&&Symbol.for&&Symbol.for("react.portal");function Oe(e){return e.isOrthographicCamera}function Me(e){return(e.eventObject||e.object).uuid+"/"+e.index}Te.injectIntoDevTools({bundleType:0,version:"4.0.14",rendererPackageName:"react-three-fiber",findHostInstanceByFiber:Te.findHostInstance});var Pe=Object(b.createContext)({}),Ae=function(e){var t=e.children,n=e.gl,r=e.camera,i=e.orthographic,o=e.raycaster,a=e.size,s=e.pixelRatio,l=e.vr,u=void 0!==l&&l,d=e.concurrent,m=void 0!==d&&d,g=e.shadowMap,v=void 0!==g&&g,y=e.invalidateFrameloop,x=void 0!==y&&y,w=e.updateDefaultCamera,S=void 0===w||w,E=e.noEvents,C=void 0!==E&&E,T=e.onCreated,k=e.onPointerMissed,j=Object(b.useState)(!1),O=Object(c.a)(j,2),M=O[0],P=O[1],A=Object(b.useState)(function(){return new f.Vector2}),R=Object(c.a)(A,1)[0],I=Object(b.useState)(function(){var e=new f.Raycaster;o&&ve(e,p(o,["filter"]),{});return e}),L=Object(c.a)(I,1)[0],D=Object(b.useState)(function(){var e=new f.Scene;return e.__interaction=[],e.__objects=[],e}),N=Object(c.a)(D,1)[0],F=Object(b.useState)(function(){var e=i?new f.OrthographicCamera(0,0,0,0,.1,1e3):new f.PerspectiveCamera(75,0,.1,1e3);return e.position.z=5,r&&ve(e,r,{}),e}),B=Object(c.a)(F,2),z=B[0],U=B[1],H=Object(b.useState)(function(){return new f.Clock}),q=Object(c.a)(H,1)[0],G=Object(b.useRef)({ready:!1,active:!0,manual:0,vr:u,concurrent:m,noEvents:C,invalidateFrameloop:!1,frames:0,aspect:0,subscribers:[],camera:z,scene:N,raycaster:L,mouse:R,clock:q,gl:n,size:a,viewport:{width:0,height:0,factor:0},initialClick:[0,0],initialHits:[],pointer:new _.TinyEmitter,captured:void 0,events:void 0,subscribe:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t&&G.current.manual++,G.current.subscribers.push({ref:e,priority:t}),G.current.subscribers=G.current.subscribers.sort(function(e,t){return e.priority-t.priority}),function(){t&&G.current.manual--,G.current.subscribers=G.current.subscribers.filter(function(t){return t.ref!==e})}},setDefaultCamera:function(e){return U(e)},invalidate:function(){return fe(G)},intersect:function(e){return K(e||{})}});Object(b.useMemo)(function(){G.current.ready=M,G.current.size=a,G.current.camera=z,G.current.invalidateFrameloop=x,G.current.vr=u,G.current.gl=n,G.current.concurrent=m,G.current.noEvents=C},[x,u,m,C,M,a,z,n]),Object(b.useMemo)(function(){if(G.current.aspect=a.width/a.height,Oe(z))G.current.viewport={width:a.width,height:a.height,factor:1};else{var e=new f.Vector3(0,0,0),t=z.position.distanceTo(e),r=f.Math.degToRad(z.fov),i=2*Math.tan(r/2)*t,o=i*G.current.aspect;G.current.viewport={width:o,height:i,factor:a.width/o}}S&&(Oe(z)?(z.left=a.width/-2,z.right=a.width/2,z.top=a.height/2,z.bottom=a.height/-2):z.aspect=G.current.aspect,z.updateProjectionMatrix(),z.updateMatrixWorld()),n.setSize(a.width,a.height),M&&fe(G)},[z,a,S]);var V=Object(b.useCallback)(function(e){var t=e.clientX,n=e.clientY;if(void 0!==t){var r=G.current.size,i=r.left,o=r.right,a=r.top,s=r.bottom;R.set((t-i)/(o-i)*2-1,-(n-a)/(s-a)*2+1),L.setFromCamera(R,G.current.camera)}},[]),W=Object(b.useCallback)(function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(G.current.noEvents)return[];t&&V(e);var n=new Set,r=[],i=L.intersectObjects(G.current.scene.__interaction,!0).filter(function(e){var t=Me(e);return!n.has(t)&&(n.add(t),!0)});o&&o.filter&&Q.current&&(i=o.filter(i,Q.current));var a=!0,s=!1,l=void 0;try{for(var c,u=i[Symbol.iterator]();!(a=(c=u.next()).done);a=!0)for(var p=c.value,d=p.object;d;){d.__handlers&&r.push(h({},p,{eventObject:d})),d=d.parent}}catch(f){s=!0,l=f}finally{try{a||null==u.return||u.return()}finally{if(s)throw l}}return r},[]),X=Object(b.useCallback)(function(e){var t=e.clientX-G.current.initialClick[0],n=e.clientY-G.current.initialClick[1];return Math.round(Math.sqrt(t*t+n*n))},[]),Y=Object(b.useMemo)(function(){return new Map},[]),J=Object(b.useCallback)(function(e,t){V(e);var n=W(e,!1);if(G.current.captured&&"click"!==e.type&&"wheel"!==e.type&&G.current.captured.forEach(function(e){n.find(function(t){return t.eventObject===e.eventObject})||n.push(e)}),n.length){var r=new f.Vector3(R.x,R.y,0).unproject(G.current.camera),i="click"===e.type?X(e):0,o=!0,a=!1,s=void 0;try{for(var l,c=function(){var n=l.value,o={current:!1},a=h({},e,{},n,{stopped:o,delta:i,unprojectedPoint:r,ray:L.ray,camera:G.current.camera,stopPropagation:function(){return o.current=!0},sourceEvent:e});if(t(a),!0===o.current)return Y.size&&Array.from(Y.values()).find(function(e){return e.object===n.object})&&$(a,[n]),"break"},u=n[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){if("break"===c())break}}catch(p){a=!0,s=p}finally{try{o||null==u.return||u.return()}finally{if(a)throw s}}}return n},[]),K=Object(b.useCallback)(function(e){G.current.pointer.emit("pointerMove",e);var t=J(e,function(e){var t=e.eventObject.__handlers;if(t&&(t.pointerMove&&t.pointerMove(e),t.pointerOver||t.pointerEnter||t.pointerOut||t.pointerLeave)){var n=Me(e),r=Y.get(n);r?r.stopped.current&&e.stopPropagation():(Y.set(n,e),t.pointerOver&&t.pointerOver(h({},e,{type:"pointerover"})),t.pointerEnter&&t.pointerEnter(h({},e,{type:"pointerEnter"})))}});return $(e,t),t},[]),$=Object(b.useCallback)(function(e,t){G.current.pointer.emit("pointerCancel",e),t||(t=J(e,function(){return null})),Array.from(Y.values()).forEach(function(e){if(t&&(!t.length||!t.find(function(t){return t.eventObject===e.eventObject}))){var n=e.eventObject.__handlers;n&&(n.pointerOut&&n.pointerOut(h({},e,{type:"pointerout"})),n.pointerLeave&&n.pointerLeave(h({},e,{type:"pointerleave"}))),Y.delete(Me(e))}})},[]),Z=Object(b.useCallback)(function(e){return function(t){G.current.pointer.emit(e,t);var n=J(t,function(t){var n=t.eventObject,r=n.__handlers;r&&r[e]&&("click"!==e||G.current.initialHits.includes(n))&&r[e](t)});"pointerDown"===e&&(G.current.initialClick=[t.clientX,t.clientY],G.current.initialHits=n.map(function(e){return e.eventObject})),"click"===e&&!n.length&&k&&X(t)<=2&&k()}},[k]);Object(b.useMemo)(function(){G.current.events={onClick:Z("click"),onWheel:Z("wheel"),onPointerDown:Z("pointerDown"),onPointerUp:Z("pointerUp"),onPointerLeave:function(e){return $(e,[])},onPointerMove:K,onGotPointerCapture:function(e){return G.current.captured=W(e,!1)},onLostPointerCapture:function(e){return G.current.captured=void 0,$(e)}}},[k]);var Q=Object(b.useRef)();Object(b.useMemo)(function(){var e=p(G.current,["ready","manual","vr","noEvents","invalidateFrameloop","frames","subscribers","captured","initialClick","initialHits"]);Q.current=e},[a,z]),Object(b.useLayoutEffect)(function(){s&&n.setPixelRatio(s)},[s]),Object(b.useLayoutEffect)(function(){v&&(n.shadowMap.enabled=!0,"object"===typeof v?Object.assign(n,v):n.shadowMap.type=f.PCFSoftShadowMap)},[v]);var ee=Object(b.useCallback)(function(e){var t=function(){return P(!0)};return Object(b.useEffect)(function(){var e=T&&T(G.current);e&&e.then?e.then(t):t()},[]),e.children},[]);return Object(b.useLayoutEffect)(function(){!function(e,t,n){var r=ae.get(t);if(!r){t.__state=n;var i=r=Te.createContainer(t,void 0!==n&&n.current.concurrent?je:ke,!1);ae.set(t,i)}Te.updateContainer(e,r,null,function(){}),Te.getPublicRootInstance(r)}(Object(b.createElement)(ee,null,Object(b.createElement)(Pe.Provider,{value:Q.current},"function"===typeof t?t(G.current):t)),N,G)},[M,t,Q.current]),Object(b.useLayoutEffect)(function(){M&&(G.current.vr?(n.xr||n.vr)&&n.setAnimationLoop?((n.xr||n.vr).enabled=!0,n.setAnimationLoop(function(e){return he(G,e,0,!0)})):console.warn("the gl instance does not support VR!"):fe(G))},[M,x]),Object(b.useEffect)(function(){return function(){G.current.gl&&(G.current.gl.forceContextLoss&&G.current.gl.forceContextLoss(),G.current.gl.dispose&&G.current.gl.dispose(),G.current.gl=void 0,function(e){var t=ae.get(e);t&&Te.updateContainer(null,t,null,function(){ae.delete(e)})}(G.current.scene),G.current.active=!1)}},[]),G.current.events};function Re(e){var t=Object(b.useContext)(e);return t||console.warn("hooks can only be used within the canvas! https://github.com/react-spring/react-three-fiber#hooks"),t}function Ie(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Re(Pe).subscribe,r=Object(b.useRef)(e);return Object(b.useLayoutEffect)(function(){r.current=e},[e]),Object(b.useEffect)(function(){var e=n(r,t);return function(){return e()}},[t]),null}function Le(){return Re(Pe)}var De=new f.Vector3;function Ne(e,t,n){De.setFromMatrixPosition(e.matrixWorld),De.project(t);var r=n.width/2,i=n.height/2;return[De.x*r+r,-De.y*i+i]}y.a.forwardRef(function(e,t){var n=e.children,r=e.eps,i=void 0===r?.001:r,o=e.style,a=e.className,s=e.prepend,l=e.center,u=p(e,["children","eps","style","className","prepend","center"]),d=Le(),f=d.gl,m=d.scene,g=d.camera,v=d.size,_=Object(b.useState)(function(){return document.createElement("div")}),x=Object(c.a)(_,1)[0],S=Object(b.useRef)(null),E=Object(b.useRef)([0,0]);return Object(b.useEffect)(function(){if(S.current){m.updateMatrixWorld();var e=Ne(S.current,g,v);return x.style.cssText="position:absolute;top:0;left:0;transform:translate3d("+e[0]+"px,"+e[1]+"px,0);",f.domElement.parentNode&&(s?f.domElement.parentNode.prepend(x):f.domElement.parentNode.appendChild(x)),function(){f.domElement.parentNode&&f.domElement.parentNode.removeChild(x),w.a.unmountComponentAtNode(x)}}},[]),Object(b.useEffect)(function(){w.a.render(y.a.createElement("div",{style:h({transform:l?"translate3d(-50%,-50%,0)":"none"},o),className:a,ref:t},n),x)}),Ie(function(){if(S.current){var e=Ne(S.current,g,v);(Math.abs(E.current[0]-e[0])>i||Math.abs(E.current[1]-e[1])>i)&&(x.style.transform="translate3d("+e[0]+"px,"+e[1]+"px,0)"),E.current=e}}),y.a.createElement("group",h({},u,{ref:S}))});var Fe={position:"relative",width:"100%",height:"100%",overflow:"hidden"};function Be(e){var t=e.children,n=e.setEvents,r=e.container,i=e.renderer,o=e.effects,a=p(e,["children","setEvents","container","renderer","effects"]),s=Object(b.useState)(i),l=Object(c.a)(s,1)[0];l||console.warn("No renderer created!"),Object(b.useEffect)(function(){return o&&o(l,r)},[]);var u=Ae(h({},a,{children:t,gl:l}));return Object(b.useEffect)(function(){n(u)},[u]),null}var ze=y.a.memo(function(e){var t,n=e.preRender,r=e.resize,i=e.style,o=p(e,["renderer","effects","children","vr","gl2","concurrent","shadowMap","orthographic","invalidateFrameloop","updateDefaultCamera","noEvents","gl","camera","raycaster","pixelRatio","onCreated","onPointerMissed","preRender","resize","style"]),a=Object(b.useRef)(),s=Object(b.useState)({}),l=Object(c.a)(s,2),u=l[0],d=l[1],f=Object(S.a)(r||{scroll:!0,debounce:{scroll:50,resize:0},polyfill:"undefined"!==typeof window&&window.ResizeObserver?void 0:ie}),m=Object(c.a)(f,2),g=m[0],v=m[1],_=Object(b.useRef)(!1),x=Object(b.useMemo)(function(){return _.current=_.current||!!v.width&&!!v.height},[v]),w=Object(b.useMemo)(function(){return{size:v,setEvents:d,container:a.current}},[v]);return"undefined"===typeof window?y.a.createElement("div",h({style:h({},Fe,{},i)},o),n):y.a.createElement("div",h({ref:(t=[g,a],function(e){t.forEach(function(t){"function"==typeof t?t(e):null!=t&&(t.current=e)})}),style:h({},Fe,{},i)},u,o),n,x&&y.a.createElement(Be,h({},e,w)))}),Ue=y.a.memo(function(e){var t=e.children,n=p(e,["children"]),r=Object(b.useRef)();return y.a.createElement(ze,h({},n,{renderer:function(){if(r.current){var e=h({antialias:!0,alpha:!0},n.gl);return new f.WebGLRenderer(h({canvas:r.current,context:n.gl2?r.current.getContext("webgl2",e):void 0},e))}},preRender:y.a.createElement("canvas",{ref:r,style:{display:"block"}})}),t)})},function(e,t,n){"use strict";var r=n(1);function i(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,i=e.length;r=0;p--){var d=a[p];"."===d?o(a,p):".."===d?(o(a,p),h++):h&&(o(a,p),h--)}if(!c)for(;h--;h)a.unshift("..");!c||""===a[0]||a[0]&&i(a[0])||a.unshift("");var f=a.join("/");return n&&"/"!==f.substr(-1)&&(f+="/"),f};function s(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var l=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every(function(t,r){return e(t,n[r])});if("object"===typeof t||"object"===typeof n){var r=s(t),i=s(n);return r!==t||i!==n?e(r,i):Object.keys(Object.assign({},t,n)).every(function(r){return e(t[r],n[r])})}return!1},c=n(32);function u(e){return"/"===e.charAt(0)?e:"/"+e}function h(e){return"/"===e.charAt(0)?e.substr(1):e}function p(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function f(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function m(e,t,n,i){var o;"string"===typeof e?(o=function(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=Object(r.a)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(s){throw s instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):s}return n&&(o.key=n),i?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=a(o.pathname,i.pathname)):o.pathname=i.pathname:o.pathname||(o.pathname="/"),o}function g(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&l(e.state,t.state)}function v(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var o="function"===typeof e?e(t,n):e;"string"===typeof o?"function"===typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter(function(e){return e!==r})}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,r):n.push(r),h({action:"PUSH",location:r,index:t,entries:n})}})},replace:function(e,t){var r=m(e,t,p(),_.location);u.confirmTransitionTo(r,"REPLACE",n,function(e){e&&(_.entries[_.index]=r,h({action:"REPLACE",location:r}))})},go:y,goBack:function(){y(-1)},goForward:function(){y(1)},canGo:function(e){var t=_.index+e;return t>=0&&t<_.entries.length},block:function(e){return void 0===e&&(e=!1),u.setPrompt(e)},listen:function(e){return u.appendListener(e)}};return _}},function(e,t,n){"use strict";n.d(t,"b",function(){return o});var r=n(8),i={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},o={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function a(e){return"".concat(Math.round(e),"ms")}t.a={easing:i,duration:o,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.duration,s=void 0===n?o.standard:n,l=t.easing,c=void 0===l?i.easeInOut:l,u=t.delay,h=void 0===u?0:u;Object(r.a)(t,["duration","easing","delay"]);return(Array.isArray(e)?e:[e]).map(function(e){return"".concat(e," ").concat("string"===typeof s?s:a(s)," ").concat(c," ").concat("string"===typeof h?h:a(h))}).join(",")},getAutoHeightDuration:function(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}}},function(e,t,n){"use strict";n.r(t),n.d(t,"__DO_NOT_USE__ActionTypes",function(){return o}),n.d(t,"applyMiddleware",function(){return m}),n.d(t,"bindActionCreators",function(){return h}),n.d(t,"combineReducers",function(){return c}),n.d(t,"compose",function(){return f}),n.d(t,"createStore",function(){return s});var r=n(91),i=function(){return Math.random().toString(36).substring(7).split("").join(".")},o={INIT:"@@redux/INIT"+i(),REPLACE:"@@redux/REPLACE"+i(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+i()}};function a(e){if("object"!==typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function s(e,t,n){var i;if("function"===typeof t&&"function"===typeof n||"function"===typeof n&&"function"===typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"===typeof t&&"undefined"===typeof n&&(n=t,t=void 0),"undefined"!==typeof n){if("function"!==typeof n)throw new Error("Expected the enhancer to be a function.");return n(s)(e,t)}if("function"!==typeof e)throw new Error("Expected the reducer to be a function.");var l=e,c=t,u=[],h=u,p=!1;function d(){h===u&&(h=u.slice())}function f(){if(p)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return c}function m(e){if("function"!==typeof e)throw new Error("Expected the listener to be a function.");if(p)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var t=!0;return d(),h.push(e),function(){if(t){if(p)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");t=!1,d();var n=h.indexOf(e);h.splice(n,1),u=null}}}function g(e){if(!a(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"===typeof e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(p)throw new Error("Reducers may not dispatch actions.");try{p=!0,c=l(c,e)}finally{p=!1}for(var t=u=h,n=0;nc||8*(1-g.dot(n.object.quaternion))>c)&&(n.dispatchEvent(i),m.copy(n.object.position),g.copy(n.object.quaternion),f=!1,!0)}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",Y,!1),n.domElement.removeEventListener("mousedown",z,!1),n.domElement.removeEventListener("wheel",q,!1),n.domElement.removeEventListener("touchstart",V,!1),n.domElement.removeEventListener("touchend",X,!1),n.domElement.removeEventListener("touchmove",W,!1),document.removeEventListener("mousemove",U,!1),document.removeEventListener("mouseup",H,!1),n.domElement.removeEventListener("keydown",G,!1)};var n=this,i={type:"change"},o={type:"start"},a={type:"end"},s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},l=s.NONE,c=1e-6,u=new r.Spherical,h=new r.Spherical,p=1,d=new r.Vector3,f=!1,m=new r.Vector2,g=new r.Vector2,v=new r.Vector2,b=new r.Vector2,y=new r.Vector2,_=new r.Vector2,x=new r.Vector2,w=new r.Vector2,S=new r.Vector2;function E(){return Math.pow(.95,n.zoomSpeed)}function C(e){h.theta-=e}function T(e){h.phi-=e}var k=function(){var e=new r.Vector3;return function(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),d.add(e)}}(),j=function(){var e=new r.Vector3;return function(t,r){!0===n.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(n.object.up,e)),e.multiplyScalar(t),d.add(e)}}(),O=function(){var e=new r.Vector3;return function(t,r){var i=n.domElement;if(n.object.isPerspectiveCamera){var o=n.object.position;e.copy(o).sub(n.target);var a=e.length();a*=Math.tan(n.object.fov/2*Math.PI/180),k(2*t*a/i.clientHeight,n.object.matrix),j(2*r*a/i.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(k(t*(n.object.right-n.object.left)/n.object.zoom/i.clientWidth,n.object.matrix),j(r*(n.object.top-n.object.bottom)/n.object.zoom/i.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function M(e){n.object.isPerspectiveCamera?p/=e:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom*e)),n.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function P(e){n.object.isPerspectiveCamera?p*=e:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/e)),n.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function A(e){m.set(e.clientX,e.clientY)}function R(e){b.set(e.clientX,e.clientY)}function I(e){if(1==e.touches.length)m.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);m.set(t,n)}}function L(e){if(1==e.touches.length)b.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),n=.5*(e.touches[0].pageY+e.touches[1].pageY);b.set(t,n)}}function D(e){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+n*n);x.set(0,r)}function N(e){if(1==e.touches.length)g.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),r=.5*(e.touches[0].pageY+e.touches[1].pageY);g.set(t,r)}v.subVectors(g,m).multiplyScalar(n.rotateSpeed);var i=n.domElement;C(2*Math.PI*v.x/i.clientHeight),T(2*Math.PI*v.y/i.clientHeight),m.copy(g)}function F(e){if(1==e.touches.length)y.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),r=.5*(e.touches[0].pageY+e.touches[1].pageY);y.set(t,r)}_.subVectors(y,b).multiplyScalar(n.panSpeed),O(_.x,_.y),b.copy(y)}function B(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,i=Math.sqrt(t*t+r*r);w.set(0,i),S.set(0,Math.pow(w.y/x.y,n.zoomSpeed)),M(S.y),x.copy(w)}function z(e){if(!1!==n.enabled){var t;switch(e.preventDefault(),n.domElement.focus?n.domElement.focus():window.focus(),e.button){case 0:t=n.mouseButtons.LEFT;break;case 1:t=n.mouseButtons.MIDDLE;break;case 2:t=n.mouseButtons.RIGHT;break;default:t=-1}switch(t){case r.MOUSE.DOLLY:if(!1===n.enableZoom)return;!function(e){x.set(e.clientX,e.clientY)}(e),l=s.DOLLY;break;case r.MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enablePan)return;R(e),l=s.PAN}else{if(!1===n.enableRotate)return;A(e),l=s.ROTATE}break;case r.MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enableRotate)return;A(e),l=s.ROTATE}else{if(!1===n.enablePan)return;R(e),l=s.PAN}break;default:l=s.NONE}l!==s.NONE&&(document.addEventListener("mousemove",U,!1),document.addEventListener("mouseup",H,!1),n.dispatchEvent(o))}}function U(e){if(!1!==n.enabled)switch(e.preventDefault(),l){case s.ROTATE:if(!1===n.enableRotate)return;!function(e){g.set(e.clientX,e.clientY),v.subVectors(g,m).multiplyScalar(n.rotateSpeed);var t=n.domElement;C(2*Math.PI*v.x/t.clientHeight),T(2*Math.PI*v.y/t.clientHeight),m.copy(g),n.update()}(e);break;case s.DOLLY:if(!1===n.enableZoom)return;!function(e){w.set(e.clientX,e.clientY),S.subVectors(w,x),S.y>0?M(E()):S.y<0&&P(E()),x.copy(w),n.update()}(e);break;case s.PAN:if(!1===n.enablePan)return;!function(e){y.set(e.clientX,e.clientY),_.subVectors(y,b).multiplyScalar(n.panSpeed),O(_.x,_.y),b.copy(y),n.update()}(e)}}function H(e){!1!==n.enabled&&(document.removeEventListener("mousemove",U,!1),document.removeEventListener("mouseup",H,!1),n.dispatchEvent(a),l=s.NONE)}function q(e){!1===n.enabled||!1===n.enableZoom||l!==s.NONE&&l!==s.ROTATE||(e.preventDefault(),e.stopPropagation(),n.dispatchEvent(o),function(e){e.deltaY<0?P(E()):e.deltaY>0&&M(E()),n.update()}(e),n.dispatchEvent(a))}function G(e){!1!==n.enabled&&!1!==n.enableKeys&&!1!==n.enablePan&&function(e){var t=!1;switch(e.keyCode){case n.keys.UP:O(0,n.keyPanSpeed),t=!0;break;case n.keys.BOTTOM:O(0,-n.keyPanSpeed),t=!0;break;case n.keys.LEFT:O(n.keyPanSpeed,0),t=!0;break;case n.keys.RIGHT:O(-n.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),n.update())}(e)}function V(e){if(!1!==n.enabled){switch(e.preventDefault(),e.touches.length){case 1:switch(n.touches.ONE){case r.TOUCH.ROTATE:if(!1===n.enableRotate)return;I(e),l=s.TOUCH_ROTATE;break;case r.TOUCH.PAN:if(!1===n.enablePan)return;L(e),l=s.TOUCH_PAN;break;default:l=s.NONE}break;case 2:switch(n.touches.TWO){case r.TOUCH.DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(e){n.enableZoom&&D(e),n.enablePan&&L(e)}(e),l=s.TOUCH_DOLLY_PAN;break;case r.TOUCH.DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(e){n.enableZoom&&D(e),n.enableRotate&&I(e)}(e),l=s.TOUCH_DOLLY_ROTATE;break;default:l=s.NONE}break;default:l=s.NONE}l!==s.NONE&&n.dispatchEvent(o)}}function W(e){if(!1!==n.enabled)switch(e.preventDefault(),e.stopPropagation(),l){case s.TOUCH_ROTATE:if(!1===n.enableRotate)return;N(e),n.update();break;case s.TOUCH_PAN:if(!1===n.enablePan)return;F(e),n.update();break;case s.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(e){n.enableZoom&&B(e),n.enablePan&&F(e)}(e),n.update();break;case s.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(e){n.enableZoom&&B(e),n.enableRotate&&N(e)}(e),n.update();break;default:l=s.NONE}}function X(e){!1!==n.enabled&&(n.dispatchEvent(a),l=s.NONE)}function Y(e){!1!==n.enabled&&e.preventDefault()}n.domElement.addEventListener("contextmenu",Y,!1),n.domElement.addEventListener("mousedown",z,!1),n.domElement.addEventListener("wheel",q,!1),n.domElement.addEventListener("touchstart",V,!1),n.domElement.addEventListener("touchend",X,!1),n.domElement.addEventListener("touchmove",W,!1),n.domElement.addEventListener("keydown",G,!1),-1===n.domElement.tabIndex&&(n.domElement.tabIndex=0),this.update()};i.prototype=Object.create(r.EventDispatcher.prototype),i.prototype.constructor=i;var o=function(e,t){i.call(this,e,t),this.mouseButtons.LEFT=r.MOUSE.PAN,this.mouseButtons.RIGHT=r.MOUSE.ROTATE,this.touches.ONE=r.TOUCH.PAN,this.touches.TWO=r.TOUCH.DOLLY_ROTATE};o.prototype=Object.create(r.EventDispatcher.prototype),o.prototype.constructor=o},function(e,t,n){"use strict";t.a=function(e){return"function"===typeof e}},function(e,t,n){"use strict";function r(e,t){for(var n=0;n=e);++n);return n-1}(e,o);return function(e,t,n,r,i,o,a,s,l){var c=l?l(e):e;if(cn){if("identity"===s)return c;"clamp"===s&&(c=n)}if(r===i)return r;if(t===n)return e<=t?r:i;t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t);c=o(c),r===-1/0?c=-c:i===1/0?c+=r:c=c*(i-r)+r;return c}(e,o[t],o[t+1],i[t],i[t+1],l,a,s,r.map)}}var L=function(e){function t(e,n,r,i){var s;return Object(c.a)(this,t),(s=Object(o.a)(this,Object(a.a)(t).call(this))).calc=void 0,s.payload=e instanceof x&&!(e instanceof t)?e.getPayload():Array.isArray(e)?e:[e],s.calc=I(n,r,i),s}return Object(l.a)(t,e),h(t,[{key:"getValue",value:function(){return this.calc.apply(this,Object(i.a)(this.payload.map(function(e){return e.getValue()})))}},{key:"updateConfig",value:function(e,t,n){this.calc=I(e,t,n)}},{key:"interpolate",value:function(e,n,r){return new t(this,e,n,r)}}]),t}(x),D={arr:Array.isArray,obj:function(e){return"[object Object]"===Object.prototype.toString.call(e)},fun:function(e){return"function"===typeof e},str:function(e){return"string"===typeof e},num:function(e){return"number"===typeof e},und:function(e){return void 0===e},nul:function(e){return null===e},set:function(e){return e instanceof Set},map:function(e){return e instanceof Map},equ:function(e,t){if(typeof e!==typeof t)return!1;if(D.str(e)||D.num(e))return e===t;if(D.obj(e)&&D.obj(t)&&Object.keys(e).length+Object.keys(t).length===0)return!0;var n;for(n in e)if(!(n in t))return!1;for(n in t)if(e[n]!==t[n])return!1;return!D.und(n)||e===t}};function N(){var e=Object(g.useState)(!1)[1];return Object(g.useCallback)(function(){return e(function(e){return!e})},[])}function F(e,t){return D.und(e)||D.nul(e)?t:e}function B(e){return D.und(e)?[]:D.arr(e)?e:[e]}function z(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function re(e,t,n){var r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,o=ne(i,r,e+1/3),a=ne(i,r,e),s=ne(i,r,e-1/3);return Math.round(255*o)<<24|Math.round(255*a)<<16|Math.round(255*s)<<8}function ie(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function oe(e){return(parseFloat(e)%360+360)%360/360}function ae(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function se(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function le(e){var t=function(e){var t;return"number"===typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=ee.exec(e))?parseInt(t[1]+"ff",16)>>>0:G.hasOwnProperty(e)?G[e]:(t=Y.exec(e))?(ie(t[1])<<24|ie(t[2])<<16|ie(t[3])<<8|255)>>>0:(t=J.exec(e))?(ie(t[1])<<24|ie(t[2])<<16|ie(t[3])<<8|ae(t[4]))>>>0:(t=Z.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=te.exec(e))?parseInt(t[1],16)>>>0:(t=Q.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=K.exec(e))?(255|re(oe(t[1]),se(t[2]),se(t[3])))>>>0:(t=$.exec(e))?(re(oe(t[1]),se(t[2]),se(t[3]))|ae(t[4]))>>>0:null}(e);if(null===t)return e;var n=(16711680&(t=t||0))>>>16,r=(65280&t)>>>8,i=(255&t)/255;return"rgba(".concat((4278190080&t)>>>24,", ").concat(n,", ").concat(r,", ").concat(i,")")}var ce=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,ue=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,he=new RegExp("(".concat(Object.keys(G).join("|"),")"),"g");var pe=function(e){function t(e){var n,r;return Object(c.a)(this,t),n=Object(o.a)(this,Object(a.a)(t).call(this)),r=Object(s.a)(n),n.animatedStyles=new Set,n.value=void 0,n.startPosition=void 0,n.lastPosition=void 0,n.lastVelocity=void 0,n.startTime=void 0,n.lastTime=void 0,n.done=!1,n.setValue=function(e,t){void 0===t&&(t=!0),r.value=e,t&&r.flush()},n.value=e,n.startPosition=e,n.lastPosition=e,n}return Object(l.a)(t,e),h(t,[{key:"flush",value:function(){0===this.animatedStyles.size&&function e(t,n){"update"in t?n.add(t):t.getChildren().forEach(function(t){return e(t,n)})}(this,this.animatedStyles),this.animatedStyles.forEach(function(e){return e.update()})}},{key:"clearStyles",value:function(){this.animatedStyles.clear()}},{key:"getValue",value:function(){return this.value}},{key:"interpolate",value:function(e,t,n){return new L(this,e,t,n)}}]),t}(_),de=function(e){function t(e){var n;return Object(c.a)(this,t),(n=Object(o.a)(this,Object(a.a)(t).call(this))).payload=e.map(function(e){return new pe(e)}),n}return Object(l.a)(t,e),h(t,[{key:"setValue",value:function(e,t){var n=this;void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach(function(e,r){return n.payload[r].setValue(e,t)}):this.payload.forEach(function(n){return n.setValue(e,t)})}},{key:"getValue",value:function(){return this.payload.map(function(e){return e.getValue()})}},{key:"interpolate",value:function(e,t){return new L(this,e,t)}}]),t}(x),fe=!1,me=new Set,ge=function e(){if(!fe)return!1;var t=j(),n=!0,r=!1,i=void 0;try{for(var o,a=me[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){for(var s=o.value,l=!1,c=0;c=f.startTime+u.duration;else if(u.decay)v=m+y/(1-.998)*(1-Math.exp(-(1-.998)*(t-f.startTime))),(h=Math.abs(f.lastPosition-v)<.1)&&(g=v);else{p=void 0!==f.lastTime?f.lastTime:t,y=void 0!==f.lastVelocity?f.lastVelocity:u.initialVelocity,t>p+64&&(p=t);for(var x=Math.floor(t-p),w=0;wg:v1)for(var n=1;n1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:p(e)?2:d(e)?3:0}function l(e,t){return 2===s(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){return 2===s(e)?e.get(t):e[t]}function u(e,t,n){var r=s(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function h(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e){return B&&e instanceof Map}function d(e){return z&&e instanceof Set}function f(e){return e.o||e.t}function m(e){if(Array.isArray(e))return e.slice();var t=W(e);delete t[G];for(var n=V(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=v),Object.freeze(e),t&&a(e,function(e,t){return g(t,!0)},!0))}function v(){r(2)}function b(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function y(e){var t=X[e];return t||r(19,e),t}function _(){return N}function x(e,t){t&&(y("Patches"),e.u=[],e.s=[],e.v=t)}function w(e){S(e),e.p.forEach(C),e.p=null}function S(e){e===N&&(N=e.l)}function E(e){return N={p:[],l:N,h:e,m:!0,_:0}}function C(e){var t=e[G];0===t.i||1===t.i?t.j():t.g=!0}function T(e,t){t._=t.p.length;var n=t.p[0],i=void 0!==e&&e!==n;return t.h.O||y("ES5").S(t,e,i),i?(n[G].P&&(w(t),r(4)),o(e)&&(e=k(t,e),t.l||O(t,e)),t.u&&y("Patches").M(n[G],e,t.u,t.s)):e=k(t,n,[]),w(t),t.u&&t.v(t.u,t.s),e!==H?e:void 0}function k(e,t,n){if(b(t))return t;var r=t[G];if(!r)return a(t,function(i,o){return j(e,r,t,i,o,n)},!0),t;if(r.A!==e)return t;if(!r.P)return O(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=4===r.i||5===r.i?r.o=m(r.k):r.o;a(i,function(t,o){return j(e,r,i,t,o,n)}),O(e,i,!1),n&&e.u&&y("Patches").R(r,n,e.u,e.s)}return r.o}function j(e,t,n,r,a,s){if(i(a)){var c=k(e,a,s&&t&&3!==t.i&&!l(t.D,r)?s.concat(r):void 0);if(u(n,r,c),!i(c))return;e.m=!1}if(o(a)&&!b(a)){if(!e.h.N&&e._<1)return;k(e,a),t&&t.A.l||O(e,a)}}function O(e,t,n){void 0===n&&(n=!1),e.h.N&&e.m&&g(t,n)}function M(e,t){var n=e[G];return(n?f(n):e)[t]}function P(e){e.P||(e.P=!0,e.l&&P(e.l))}function A(e){e.o||(e.o=m(e.t))}function R(e,t,n){var r=p(t)?y("MapSet").T(t,n):d(t)?y("MapSet").F(t,n):e.O?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:_(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},i=r,o=Y;n&&(i=[r],o=J);var a=Proxy.revocable(i,o),s=a.revoke,l=a.proxy;return r.k=l,r.j=s,l}(t,n):y("ES5").J(t,n);return(n?n.A:_()).p.push(r),r}function I(e){return i(e)||r(22,e),function e(t){if(!o(t))return t;var n,r=t[G],i=s(t);if(r){if(!r.P&&(r.i<4||!y("ES5").K(r)))return r.t;r.I=!0,n=L(t,i),r.I=!1}else n=L(t,i);return a(n,function(t,i){r&&c(r.t,t)===i||u(n,t,e(i))}),3===i?new Set(n):n}(e)}function L(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return m(e)}var D,N,F="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),B="undefined"!=typeof Map,z="undefined"!=typeof Set,U="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=F?Symbol("immer-nothing"):((D={})["immer-nothing"]=!0,D),q=F?Symbol("immer-draftable"):"__$immer_draftable",G=F?Symbol("immer-state"):"__$immer_state",V=("undefined"!=typeof Symbol&&Symbol.iterator,"undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames),W=Object.getOwnPropertyDescriptors||function(e){var t={};return V(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},X={},Y={get:function(e,t){if(t===G)return e;var n=f(e);if(!l(n,t))return function(e,t,n){if(n in t)for(var r=Object.getPrototypeOf(t);r;){var i,o=Object.getOwnPropertyDescriptor(r,n);if(o)return"value"in o?o.value:null===(i=o.get)||void 0===i?void 0:i.call(e.k);r=Object.getPrototypeOf(r)}}(e,n,t);var r=n[t];return e.I||!o(r)?r:r===M(e.t,t)?(A(e),e.o[t]=R(e.A.h,r,e)):r},has:function(e,t){return t in f(e)},ownKeys:function(e){return Reflect.ownKeys(f(e))},set:function(e,t,n){if(e.D[t]=!0,!e.P){if(h(n,M(f(e),t))&&void 0!==n)return!0;A(e),P(e)}return e.o[t]=n,!0},deleteProperty:function(e,t){return void 0!==M(e.t,t)||t in e.t?(e.D[t]=!1,A(e),P(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=f(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){r(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){r(12)}},J={};a(Y,function(e,t){J[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),J.deleteProperty=function(e,t){return Y.deleteProperty.call(this,e[0],t)},J.set=function(e,t,n){return Y.set.call(this,e[0],t,n,e[0])};var K=new(function(){function e(e){this.O=U,this.N=!1,"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),this.produce=this.produce.bind(this),this.produceWithPatches=this.produceWithPatches.bind(this)}var t=e.prototype;return t.produce=function(e,t,n){if("function"==typeof e&&"function"!=typeof t){var i=t;t=e;var a=this;return function(e){var n=this;void 0===e&&(e=i);for(var r=arguments.length,o=Array(r>1?r-1:0),s=1;s1?n-1:0),o=1;o=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}var o=y("Patches").$;return i(e)?o(e,t):this.produce(e,function(e){return o(e,t.slice(n+1))})},e}()),$=K.produce;K.produceWithPatches.bind(K),K.setAutoFreeze.bind(K),K.setUseProxies.bind(K),K.applyPatches.bind(K),K.createDraft.bind(K),K.finishDraft.bind(K);t.a=$},function(e,t,n){"use strict";var r=n(0),i=n.n(r).a.createContext(null);t.a=i},function(e,t,n){"use strict";var r="function"===typeof Symbol&&Symbol.for;t.a=r?Symbol.for("mui.nested"):"__THEME_NESTED__"},function(e,t,n){"use strict";t.a={mobileStepper:1e3,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500}},function(e,t,n){"use strict";var r=n(0),i=n.n(r).a.createContext();t.a=i},function(e,t,n){"use strict";function r(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,i=new Array(r),o=0;o=2.0 are supported."));else{if(v.extensionsUsed)for(var b=0;b=0&&console.warn('THREE.GLTFLoader: Unknown extension "'+y+'".')}}new U(v,g,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse(l,c)}}});var n={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function i(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=n.MSFT_TEXTURE_DDS,this.ddsLoader=e}function o(e){this.name=n.KHR_LIGHTS_PUNCTUAL;var t=e.extensions&&e.extensions[n.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function a(){this.name=n.KHR_MATERIALS_UNLIT}o.prototype.loadLight=function(e){var t,n=this.lightDefs[e],i=new r.Color(16777215);void 0!==n.color&&i.fromArray(n.color);var o=void 0!==n.range?n.range:0;switch(n.type){case"directional":(t=new r.DirectionalLight(i)).target.position.set(0,0,-1),t.add(t.target);break;case"point":(t=new r.PointLight(i)).distance=o;break;case"spot":(t=new r.SpotLight(i)).distance=o,n.spot=n.spot||{},n.spot.innerConeAngle=void 0!==n.spot.innerConeAngle?n.spot.innerConeAngle:0,n.spot.outerConeAngle=void 0!==n.spot.outerConeAngle?n.spot.outerConeAngle:Math.PI/4,t.angle=n.spot.outerConeAngle,t.penumbra=1-n.spot.innerConeAngle/n.spot.outerConeAngle,t.target.position.set(0,0,-1),t.add(t.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+n.type+'".')}return t.position.set(0,0,0),t.decay=2,void 0!==n.intensity&&(t.intensity=n.intensity),t.name=n.name||"light_"+e,Promise.resolve(t)},a.prototype.getMaterialType=function(){return r.MeshBasicMaterial},a.prototype.extendParams=function(e,t,n){var i=[];e.color=new r.Color(1,1,1),e.opacity=1;var o=t.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){var a=o.baseColorFactor;e.color.fromArray(a),e.opacity=a[3]}void 0!==o.baseColorTexture&&i.push(n.assignTexture(e,"map",o.baseColorTexture))}return Promise.all(i)};var s="glTF",l=12,c={JSON:1313821514,BIN:5130562};function u(e){this.name=n.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,l);if(this.header={magic:r.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==s)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var i=new DataView(e,l),o=0;o",t),e.fragmentShader=e.fragmentShader.replace("#include ",n),e.fragmentShader=e.fragmentShader.replace("#include ",i),e.fragmentShader=e.fragmentShader.replace("#include ",o),e.fragmentShader=e.fragmentShader.replace("#include ",a)},Object.defineProperties(this,{specular:{get:function(){return s.specular.value},set:function(e){s.specular.value=e}},specularMap:{get:function(){return s.specularMap.value},set:function(e){s.specularMap.value=e}},glossiness:{get:function(){return s.glossiness.value},set:function(e){s.glossiness.value=e}},glossinessMap:{get:function(){return s.glossinessMap.value},set:function(e){s.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}function f(){return{name:n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return d},extendParams:function(e,t,n){var i=t.extensions[this.name];e.color=new r.Color(1,1,1),e.opacity=1;var o=[];if(Array.isArray(i.diffuseFactor)){var a=i.diffuseFactor;e.color.fromArray(a),e.opacity=a[3]}if(void 0!==i.diffuseTexture&&o.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new r.Color(0,0,0),e.glossiness=void 0!==i.glossinessFactor?i.glossinessFactor:1,e.specular=new r.Color(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),void 0!==i.specularGlossinessTexture){var s=i.specularGlossinessTexture;o.push(n.assignTexture(e,"glossinessMap",s)),o.push(n.assignTexture(e,"specularMap",s))}return Promise.all(o)},createMaterial:function(e){var t=new d(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=r.TangentSpaceNormalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}}function m(){this.name=n.KHR_MESH_QUANTIZATION}function g(e,t,n,i){r.Interpolant.call(this,e,t,n,i)}h.prototype.decodePrimitive=function(e,t){var n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,a={},s={},l={};for(var c in o){var u=j[c]||c.toLowerCase();a[u]=o[c]}for(c in e.attributes){u=j[c]||c.toLowerCase();if(void 0!==o[c]){var h=n.accessors[e.attributes[c]],p=E[h.componentType];l[u]=p,s[u]=!0===h.normalized}}return t.getDependency("bufferView",i).then(function(e){return new Promise(function(t){r.decodeDracoFile(e,function(e){for(var n in e.attributes){var r=e.attributes[n],i=s[n];void 0!==i&&(r.normalized=i)}t(e)},a,l)})})},p.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},d.prototype=Object.create(r.MeshStandardMaterial.prototype),d.prototype.constructor=d,d.prototype.copy=function(e){return r.MeshStandardMaterial.prototype.copy.call(this,e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},g.prototype=Object.create(r.Interpolant.prototype),g.prototype.constructor=g,g.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r,o=0;o!==r;o++)t[o]=n[i+o];return t},g.prototype.beforeStart_=g.prototype.copySampleValue_,g.prototype.afterEnd_=g.prototype.copySampleValue_,g.prototype.interpolate_=function(e,t,n,r){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=2*a,l=3*a,c=r-t,u=(n-t)/c,h=u*u,p=h*u,d=e*l,f=d-l,m=-2*p+3*h,g=p-h,v=1-m,b=g-h+u,y=0;y!==a;y++){var _=o[f+y+a],x=o[f+y+s]*c,w=o[d+y+a],S=o[d+y]*c;i[y]=v*_+b*x+m*w+g*S}return i};var v=0,b=1,y=2,_=3,x=4,w=5,S=6,E={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},C={9728:r.NearestFilter,9729:r.LinearFilter,9984:r.NearestMipmapNearestFilter,9985:r.LinearMipmapNearestFilter,9986:r.NearestMipmapLinearFilter,9987:r.LinearMipmapLinearFilter},T={33071:r.ClampToEdgeWrapping,33648:r.MirroredRepeatWrapping,10497:r.RepeatWrapping},k={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},j={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},O={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},M={CUBICSPLINE:void 0,LINEAR:r.InterpolateLinear,STEP:r.InterpolateDiscrete},P="OPAQUE",A="MASK",R="BLEND",I={"image/png":r.RGBAFormat,"image/jpeg":r.RGBFormat};function L(e,t){return"string"!==typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)?e:/^data:.*,.*$/i.test(e)?e:/^blob:.*$/i.test(e)?e:t+e)}function D(e,t,n){for(var r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function N(e,t){void 0!==t.extras&&("object"===typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function F(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var n=0,r=t.weights.length;n=2&&a.setY(j,S[C*l+1]),l>=3&&a.setZ(j,S[C*l+2]),l>=4&&a.setW(j,S[C*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return a})},U.prototype.loadTexture=function(e){var t,i=this,o=this.json,a=this.options,s=this.textureLoader,l=window.URL||window.webkitURL,c=o.textures[e],u=c.extensions||{},h=(t=u[n.MSFT_TEXTURE_DDS]?o.images[u[n.MSFT_TEXTURE_DDS].source]:o.images[c.source]).uri,p=!1;return void 0!==t.bufferView&&(h=i.getDependency("bufferView",t.bufferView).then(function(e){p=!0;var n=new Blob([e],{type:t.mimeType});return h=l.createObjectURL(n)})),Promise.resolve(h).then(function(e){var t=a.manager.getHandler(e);return t||(t=u[n.MSFT_TEXTURE_DDS]?i.extensions[n.MSFT_TEXTURE_DDS].ddsLoader:s),new Promise(function(n,r){t.load(L(e,a.path),n,void 0,r)})}).then(function(e){!0===p&&l.revokeObjectURL(h),e.flipY=!1,void 0!==c.name&&(e.name=c.name),t.mimeType in I&&(e.format=I[t.mimeType]);var n=(o.samplers||{})[c.sampler]||{};return e.magFilter=C[n.magFilter]||r.LinearFilter,e.minFilter=C[n.minFilter]||r.LinearMipmapLinearFilter,e.wrapS=T[n.wrapS]||r.RepeatWrapping,e.wrapT=T[n.wrapT]||r.RepeatWrapping,e})},U.prototype.assignTexture=function(e,t,i){var o=this;return this.getDependency("texture",i.index).then(function(a){if(!a.isCompressedTexture)switch(t){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":a.format=r.RGBFormat}if(void 0===i.texCoord||0==i.texCoord||"aoMap"===t&&1==i.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+t+" not yet supported."),o.extensions[n.KHR_TEXTURE_TRANSFORM]){var s=void 0!==i.extensions?i.extensions[n.KHR_TEXTURE_TRANSFORM]:void 0;s&&(a=o.extensions[n.KHR_TEXTURE_TRANSFORM].extendTexture(a,s))}e[t]=a})},U.prototype.assignFinalMaterial=function(e){var t=e.geometry,n=e.material,i=(this.extensions,void 0!==t.attributes.tangent),o=void 0!==t.attributes.color,a=void 0===t.attributes.normal,s=!0===e.isSkinnedMesh,l=Object.keys(t.morphAttributes).length>0,c=l&&void 0!==t.morphAttributes.normal;if(e.isPoints){var u="PointsMaterial:"+n.uuid,h=this.cache.get(u);h||(h=new r.PointsMaterial,r.Material.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,h.sizeAttenuation=!1,this.cache.add(u,h)),n=h}else if(e.isLine){u="LineBasicMaterial:"+n.uuid;var p=this.cache.get(u);p||(p=new r.LineBasicMaterial,r.Material.prototype.copy.call(p,n),p.color.copy(n.color),this.cache.add(u,p)),n=p}if(i||o||a||s||l){u="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(u+="specular-glossiness:"),s&&(u+="skinning:"),i&&(u+="vertex-tangents:"),o&&(u+="vertex-colors:"),a&&(u+="flat-shading:"),l&&(u+="morph-targets:"),c&&(u+="morph-normals:");var d=this.cache.get(u);d||(d=n.clone(),s&&(d.skinning=!0),i&&(d.vertexTangents=!0),o&&(d.vertexColors=r.VertexColors),a&&(d.flatShading=!0),l&&(d.morphTargets=!0),c&&(d.morphNormals=!0),this.cache.add(u,d)),n=d}n.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",new r.BufferAttribute(t.attributes.uv.array,2)),n.normalScale&&!i&&(n.normalScale.y=-n.normalScale.y),e.material=n},U.prototype.loadMaterial=function(e){var t,i=this.json,o=this.extensions,a=i.materials[e],s={},l=a.extensions||{},c=[];if(l[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=o[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=u.getMaterialType(),c.push(u.extendParams(s,a,this))}else if(l[n.KHR_MATERIALS_UNLIT]){var h=o[n.KHR_MATERIALS_UNLIT];t=h.getMaterialType(),c.push(h.extendParams(s,a,this))}else{t=r.MeshStandardMaterial;var p=a.pbrMetallicRoughness||{};if(s.color=new r.Color(1,1,1),s.opacity=1,Array.isArray(p.baseColorFactor)){var f=p.baseColorFactor;s.color.fromArray(f),s.opacity=f[3]}void 0!==p.baseColorTexture&&c.push(this.assignTexture(s,"map",p.baseColorTexture)),s.metalness=void 0!==p.metallicFactor?p.metallicFactor:1,s.roughness=void 0!==p.roughnessFactor?p.roughnessFactor:1,void 0!==p.metallicRoughnessTexture&&(c.push(this.assignTexture(s,"metalnessMap",p.metallicRoughnessTexture)),c.push(this.assignTexture(s,"roughnessMap",p.metallicRoughnessTexture)))}!0===a.doubleSided&&(s.side=r.DoubleSide);var m=a.alphaMode||P;return m===R?s.transparent=!0:(s.transparent=!1,m===A&&(s.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&t!==r.MeshBasicMaterial&&(c.push(this.assignTexture(s,"normalMap",a.normalTexture)),s.normalScale=new r.Vector2(1,1),void 0!==a.normalTexture.scale&&s.normalScale.set(a.normalTexture.scale,a.normalTexture.scale)),void 0!==a.occlusionTexture&&t!==r.MeshBasicMaterial&&(c.push(this.assignTexture(s,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(s.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&t!==r.MeshBasicMaterial&&(s.emissive=(new r.Color).fromArray(a.emissiveFactor)),void 0!==a.emissiveTexture&&t!==r.MeshBasicMaterial&&c.push(this.assignTexture(s,"emissiveMap",a.emissiveTexture)),Promise.all(c).then(function(){var e;return e=t===d?o[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):new t(s),void 0!==a.name&&(e.name=a.name),e.map&&(e.map.encoding=r.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=r.sRGBEncoding),N(e,a),a.extensions&&D(o,e,a),e})},U.prototype.loadGeometries=function(e){var t=this,i=this.extensions,o=this.primitiveCache;function a(e){return i[n.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then(function(n){return H(n,e,t)})}for(var s=[],l=0,c=e.length;l0&&F(h,i),h.name=i.name||"mesh_"+e,s.length>1&&(h.name+="_"+c),N(h,i),n.assignFinalMaterial(h),l.push(h)}if(1===l.length)return l[0];var m=new r.Group;for(c=0,u=l.length;c1){var n=s[l.mesh]++;(t=e.clone()).name+="_instance_"+n}else t=e;return void 0!==l.weights&&t.traverse(function(e){if(e.isMesh)for(var t=0,n=l.weights.length;t1?new r.Group:1===e.length?e[0]:new r.Object3D)!==e[0])for(var n=0,o=e.length;n=0?r=setTimeout(l,t-c):(r=null,n||(s=e.apply(o,i),o=i=null))}null==t&&(t=100);var c=function(){o=this,i=arguments,a=Date.now();var c=n&&!r;return r||(r=setTimeout(l,t)),c&&(s=e.apply(o,i),o=i=null),s};return c.clear=function(){r&&(clearTimeout(r),r=null)},c.flush=function(){r&&(s=e.apply(o,i),o=i=null,clearTimeout(r),r=null)},c}n.debounce=n,e.exports=n},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},function(e,t,n){var r=n(173);e.exports=d,e.exports.parse=o,e.exports.compile=function(e,t){return s(o(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=p;var i=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,a=0,s="",u=t&&t.delimiter||"/";null!=(n=i.exec(e));){var h=n[0],p=n[1],d=n.index;if(s+=e.slice(a,d),a=d+h.length,p)s+=p[1];else{var f=e[a],m=n[2],g=n[3],v=n[4],b=n[5],y=n[6],_=n[7];s&&(r.push(s),s="");var x=null!=m&&null!=f&&f!==m,w="+"===y||"*"===y,S="?"===y||"*"===y,E=n[2]||u,C=v||b;r.push({name:g||o++,prefix:m||"",delimiter:E,optional:S,repeat:w,partial:x,asterisk:!!_,pattern:C?c(C):_?".*":"[^"+l(E)+"]+?"})}}return a=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],function(e){s.headers[e]={}}),r.forEach(["post","put","patch"],function(e){s.headers[e]=r.merge(o)}),e.exports=s}).call(this,n(72))},function(e,t,n){"use strict";var r=n(31),i=n(161),o=n(100),a=n(163),s=n(166),l=n(167),c=n(104);e.exports=function(e){return new Promise(function(t,u){var h=e.data,p=e.headers;r.isFormData(h)&&delete p["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var f=e.auth.username||"",m=e.auth.password||"";p.Authorization="Basic "+btoa(f+":"+m)}var g=a(e.baseURL,e.url);if(d.open(e.method.toUpperCase(),o(g,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in d?s(d.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:n,config:e,request:d};i(t,u,r),d=null}},d.onabort=function(){d&&(u(c("Request aborted",e,"ECONNABORTED",d)),d=null)},d.onerror=function(){u(c("Network Error",e,null,d)),d=null},d.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),u(c(t,e,"ECONNABORTED",d)),d=null},r.isStandardBrowserEnv()){var v=n(168),b=(e.withCredentials||l(g))&&e.xsrfCookieName?v.read(e.xsrfCookieName):void 0;b&&(p[e.xsrfHeaderName]=b)}if("setRequestHeader"in d&&r.forEach(p,function(e,t){"undefined"===typeof h&&"content-type"===t.toLowerCase()?delete p[t]:d.setRequestHeader(t,e)}),r.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),e.responseType)try{d.responseType=e.responseType}catch(y){if("json"!==e.responseType)throw y}"function"===typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){d&&(d.abort(),u(e),d=null)}),void 0===h&&(h=null),d.send(h)})}},function(e,t,n){"use strict";var r=n(162);e.exports=function(e,t,n,i,o){var a=new Error(e);return r(a,t,n,i,o)}},function(e,t,n){"use strict";var r=n(31);e.exports=function(e,t){t=t||{};var n={},i=["url","method","params","data"],o=["headers","auth","proxy"],a=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];r.forEach(i,function(e){"undefined"!==typeof t[e]&&(n[e]=t[e])}),r.forEach(o,function(i){r.isObject(t[i])?n[i]=r.deepMerge(e[i],t[i]):"undefined"!==typeof t[i]?n[i]=t[i]:r.isObject(e[i])?n[i]=r.deepMerge(e[i]):"undefined"!==typeof e[i]&&(n[i]=e[i])}),r.forEach(a,function(r){"undefined"!==typeof t[r]?n[r]=t[r]:"undefined"!==typeof e[r]&&(n[r]=e[r])});var s=i.concat(o).concat(a),l=Object.keys(t).filter(function(e){return-1===s.indexOf(e)});return r.forEach(l,function(r){"undefined"!==typeof t[r]?n[r]=t[r]:"undefined"!==typeof e[r]&&(n[r]=e[r])}),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){"use strict";(function(e){var r=n(174),i=n(175),o=n(176);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function f(e,t){if(l.isBuffer(e))return e.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!==typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(r)return z(e).length;t=(""+t).toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,i){if(0===e.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"===typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){var o,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var u=-1;for(o=n;os&&(n=s-l),o=n;o>=0;o--){for(var h=!0,p=0;pi&&(r=i):r=i;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function E(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(u=c);break;case 2:128===(192&(o=e[i+1]))&&(l=(31&c)<<6|63&o)>127&&(u=l);break;case 3:o=e[i+1],a=e[i+2],128===(192&o)&&128===(192&a)&&(l=(15&c)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128===(192&o)&&128===(192&a)&&128===(192&s)&&(l=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,h=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=h}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rthis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return k(this,t,n);case"latin1":case"binary":return j(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},l.prototype.compare=function(e,t,n,r,i){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),c=this.slice(r,i),u=e.slice(t,n),h=0;hi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return y(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function k(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function A(e,t,n,r,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function R(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function I(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function L(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,o){return o||L(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function N(e,t,n,r,o){return o||L(e,0,n,8),i.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||A(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):I(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);A(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);A(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):I(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return N(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"===typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(F,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function H(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(89))},function(e,t,n){"use strict";var r=n(1),i=n(8),o=n(0),a=n.n(o),s=(n(12),n(9)),l=n(13),c=n(17),u=a.a.forwardRef(function(e,t){var n=e.children,o=e.classes,l=e.className,u=e.color,h=void 0===u?"inherit":u,p=e.component,d=void 0===p?"svg":p,f=e.fontSize,m=void 0===f?"default":f,g=e.htmlColor,v=e.titleAccess,b=e.viewBox,y=void 0===b?"0 0 24 24":b,_=Object(i.a)(e,["children","classes","className","color","component","fontSize","htmlColor","titleAccess","viewBox"]);return a.a.createElement(d,Object(r.a)({className:Object(s.a)(o.root,l,"inherit"!==h&&o["color".concat(Object(c.a)(h))],"default"!==m&&o["fontSize".concat(Object(c.a)(m))]),focusable:"false",viewBox:y,color:g,"aria-hidden":v?null:"true",role:v?"img":"presentation",ref:t},_),n,v?a.a.createElement("title",null,v):null)});u.muiName="SvgIcon",t.a=Object(l.a)(function(e){return{root:{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,fontSize:e.typography.pxToRem(24),transition:e.transitions.create("fill",{duration:e.transitions.duration.shorter})},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},colorAction:{color:e.palette.action.active},colorError:{color:e.palette.error.main},colorDisabled:{color:e.palette.action.disabled},fontSizeInherit:{fontSize:"inherit"},fontSizeSmall:{fontSize:e.typography.pxToRem(20)},fontSizeLarge:{fontSize:e.typography.pxToRem(35)}}},{name:"MuiSvgIcon"})(u)},function(e,t,n){"use strict";n.r(t);var r=n(108);n.d(t,"default",function(){return r.a})},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"===typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";e.exports=n(171)},function(e,t){function n(){}n.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function i(){r.off(e,i),t.apply(n,arguments)}return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,i=n.length;r=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}},i=this&&this.__read||function(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},o=this&&this.__spread||function(){for(var e=[],t=0;t0&&setTimeout(function(){var e=s.indexOf(p);-1!==e&&s.splice(e,1)},n)}),inputs:t};throw s.push(p),p.promise}},function(e,t,n){"use strict";(function(e){var r=n(29),i=n(7),o=n(30),a=n(0),s=n(92);function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{debounce:0,scroll:!1},t=e.debounce,n=e.scroll,l=e.polyfill||("undefined"===typeof window?function e(){Object(o.a)(this,e)}:window.ResizeObserver);if(!l)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");var c=Object(a.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),h=Object(i.a)(c,2),p=h[0],d=h[1],f=Object(a.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:p}),m=t?"number"===typeof t?t:t.scroll:null,g=t?"number"===typeof t?t:t.resize:null,v=Object(a.useMemo)(function(){var e=function(){if(f.current.element){var e=f.current.element.getBoundingClientRect(),t={left:e.left,top:e.top,width:e.width,height:e.height,bottom:e.bottom,right:e.right,x:e.x,y:e.y};Object.freeze(t),u(f.current.lastBounds,t)||d(f.current.lastBounds=t)}};return[g?Object(s.debounce)(e,g):e,m?Object(s.debounce)(e,m):e]},[d,m,g]),b=Object(i.a)(v,2),y=b[0],_=b[1];function x(){f.current.scrollContainers&&(f.current.scrollContainers.forEach(function(e){e.removeEventListener("scroll",_,!0)}),f.current.scrollContainers=null),f.current.resizeObserver&&(f.current.resizeObserver.disconnect(),f.current.resizeObserver=null)}function w(){f.current.element&&(f.current.resizeObserver=new l(_),f.current.resizeObserver.observe(f.current.element),n&&f.current.scrollContainers&&f.current.scrollContainers.forEach(function(e){e.addEventListener("scroll",_,{capture:!0,passive:!0})}))}var S,E,C;return S=_,E=Boolean(n),Object(a.useEffect)(function(){if(E){var e=S;return window.addEventListener("scroll",e,{capture:!0,passive:!0}),function(){return window.removeEventListener("scroll",e,!0)}}},[S,E]),C=y,Object(a.useEffect)(function(){var e=C;return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[C]),Object(a.useEffect)(function(){x(),w()},[n,_,y]),Object(a.useEffect)(function(){return x},[]),[function(e){e&&e!==f.current.element&&(x(),f.current.element=e,f.current.scrollContainers=function e(t){var n=[];if(!t||t===document.body)return n;var i=window.getComputedStyle(t),o=i.overflow,a=i.overflowX,s=i.overflowY;return[o,a,s].some(function(e){return"auto"===e||"scroll"===e})&&n.push(t),[].concat(n,Object(r.a)(e(t.parentElement)))}(e),w())},p]}var c=["x","y","top","bottom","left","right","width","height"],u=function(e,t){return c.every(function(n){return e[n]===t[n]})};Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(e,"exports").writable&&(e.exports=l),t.a=l}).call(this,n(98)(e))},function(e,t,n){"use strict";(function(t){var n="__global_unique_id__";e.exports=function(){return t[n]=(t[n]||0)+1}}).call(this,n(89))},function(e,t,n){(function(t){var n;"undefined"!==typeof self&&self,n=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=109)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(17),i=n(18),o=n(19),a=n(45),s=n(46),l=n(47),c=n(48),u=n(49),h=n(12),p=n(32),d=n(33),f=n(31),m=n(1),g={Scope:m.Scope,create:m.create,find:m.find,query:m.query,register:m.register,Container:r.default,Format:i.default,Leaf:o.default,Embed:c.default,Scroll:a.default,Block:l.default,Inline:s.default,Text:u.default,Attributor:{Attribute:h.default,Class:p.default,Style:d.default,Store:f.default}};t.default=g},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t){var n=this;return t="[Parchment] "+t,(n=e.call(this,t)||this).message=t,n.name=n.constructor.name,n}return r(t,e),t}(Error);t.ParchmentError=i;var o,a={},s={},l={},c={};function u(e,t){var n;if(void 0===t&&(t=o.ANY),"string"===typeof e)n=c[e]||a[e];else if(e instanceof Text||e.nodeType===Node.TEXT_NODE)n=c.text;else if("number"===typeof e)e&o.LEVEL&o.BLOCK?n=c.block:e&o.LEVEL&o.INLINE&&(n=c.inline);else if(e instanceof HTMLElement){var r=(e.getAttribute("class")||"").split(/\s+/);for(var i in r)if(n=s[r[i]])break;n=n||l[e.tagName]}return null==n?null:t&o.LEVEL&n.scope&&t&o.TYPE&n.scope?n:null}t.DATA_KEY="__blot",function(e){e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY"}(o=t.Scope||(t.Scope={})),t.create=function(e,t){var n=u(e);if(null==n)throw new i("Unable to create "+e+" blot");var r=n,o=e instanceof Node||e.nodeType===Node.TEXT_NODE?e:r.create(t);return new r(o,t)},t.find=function e(n,r){return void 0===r&&(r=!1),null==n?null:null!=n[t.DATA_KEY]?n[t.DATA_KEY].blot:r?e(n.parentNode,r):null},t.query=u,t.register=function e(){for(var t=[],n=0;n1)return t.map(function(t){return e(t)});var r=t[0];if("string"!==typeof r.blotName&&"string"!==typeof r.attrName)throw new i("Invalid definition");if("abstract"===r.blotName)throw new i("Cannot register abstract class");c[r.blotName||r.attrName]=r,"string"===typeof r.keyName?a[r.keyName]=r:(null!=r.className&&(s[r.className]=r),null!=r.tagName&&(Array.isArray(r.tagName)?r.tagName=r.tagName.map(function(e){return e.toUpperCase()}):r.tagName=r.tagName.toUpperCase(),(Array.isArray(r.tagName)?r.tagName:[r.tagName]).forEach(function(e){null!=l[e]&&null!=r.className||(l[e]=r)})));return r}},function(e,t,n){var r=n(51),i=n(11),o=n(3),a=n(20),s=String.fromCharCode(0),l=function(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]};l.prototype.insert=function(e,t){var n={};return 0===e.length?this:(n.insert=e,null!=t&&"object"===typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))},l.prototype.delete=function(e){return e<=0?this:this.push({delete:e})},l.prototype.retain=function(e,t){if(e<=0)return this;var n={retain:e};return null!=t&&"object"===typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)},l.prototype.push=function(e){var t=this.ops.length,n=this.ops[t-1];if(e=o(!0,{},e),"object"===typeof n){if("number"===typeof e.delete&&"number"===typeof n.delete)return this.ops[t-1]={delete:n.delete+e.delete},this;if("number"===typeof n.delete&&null!=e.insert&&(t-=1,"object"!==typeof(n=this.ops[t-1])))return this.ops.unshift(e),this;if(i(e.attributes,n.attributes)){if("string"===typeof e.insert&&"string"===typeof n.insert)return this.ops[t-1]={insert:n.insert+e.insert},"object"===typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this;if("number"===typeof e.retain&&"number"===typeof n.retain)return this.ops[t-1]={retain:n.retain+e.retain},"object"===typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this},l.prototype.chop=function(){var e=this.ops[this.ops.length-1];return e&&e.retain&&!e.attributes&&this.ops.pop(),this},l.prototype.filter=function(e){return this.ops.filter(e)},l.prototype.forEach=function(e){this.ops.forEach(e)},l.prototype.map=function(e){return this.ops.map(e)},l.prototype.partition=function(e){var t=[],n=[];return this.forEach(function(r){(e(r)?t:n).push(r)}),[t,n]},l.prototype.reduce=function(e,t){return this.ops.reduce(e,t)},l.prototype.changeLength=function(){return this.reduce(function(e,t){return t.insert?e+a.length(t):t.delete?e-t.delete:e},0)},l.prototype.length=function(){return this.reduce(function(e,t){return e+a.length(t)},0)},l.prototype.slice=function(e,t){e=e||0,"number"!==typeof t&&(t=1/0);for(var n=[],r=a.iterator(this.ops),i=0;i0&&n.next(o.retain-s)}for(var c=new l(r);t.hasNext()||n.hasNext();)if("insert"===n.peekType())c.push(n.next());else if("delete"===t.peekType())c.push(t.next());else{var u=Math.min(t.peekLength(),n.peekLength()),h=t.next(u),p=n.next(u);if("number"===typeof p.retain){var d={};"number"===typeof h.retain?d.retain=u:d.insert=h.insert;var f=a.attributes.compose(h.attributes,p.attributes,"number"===typeof h.retain);if(f&&(d.attributes=f),c.push(d),!n.hasNext()&&i(c.ops[c.ops.length-1],d)){var m=new l(t.rest());return c.concat(m).chop()}}else"number"===typeof p.delete&&"number"===typeof h.retain&&c.push(p)}return c.chop()},l.prototype.concat=function(e){var t=new l(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t},l.prototype.diff=function(e,t){if(this.ops===e.ops)return new l;var n=[this,e].map(function(t){return t.map(function(n){if(null!=n.insert)return"string"===typeof n.insert?n.insert:s;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")}).join("")}),o=new l,c=r(n[0],n[1],t),u=a.iterator(this.ops),h=a.iterator(e.ops);return c.forEach(function(e){for(var t=e[1].length;t>0;){var n=0;switch(e[0]){case r.INSERT:n=Math.min(h.peekLength(),t),o.push(h.next(n));break;case r.DELETE:n=Math.min(t,u.peekLength()),u.next(n),o.delete(n);break;case r.EQUAL:n=Math.min(u.peekLength(),h.peekLength(),t);var s=u.next(n),l=h.next(n);i(s.insert,l.insert)?o.retain(n,a.attributes.diff(s.attributes,l.attributes)):o.push(l).delete(n)}t-=n}}),o.chop()},l.prototype.eachLine=function(e,t){t=t||"\n";for(var n=a.iterator(this.ops),r=new l,i=0;n.hasNext();){if("insert"!==n.peekType())return;var o=n.peek(),s=a.length(o)-n.peekLength(),c="string"===typeof o.insert?o.insert.indexOf(t,s)-s:-1;if(c<0)r.push(n.next());else if(c>0)r.push(n.next(c));else{if(!1===e(r,n.next(1).attributes||{},i))return;i+=1,r=new l}}r.length()>0&&e(r,{},i)},l.prototype.transform=function(e,t){if(t=!!t,"number"===typeof e)return this.transformPosition(e,t);for(var n=a.iterator(this.ops),r=a.iterator(e.ops),i=new l;n.hasNext()||r.hasNext();)if("insert"!==n.peekType()||!t&&"insert"===r.peekType())if("insert"===r.peekType())i.push(r.next());else{var o=Math.min(n.peekLength(),r.peekLength()),s=n.next(o),c=r.next(o);if(s.delete)continue;c.delete?i.push(c):i.retain(o,a.attributes.transform(s.attributes,c.attributes,t))}else i.retain(a.length(n.next()));return i.chop()},l.prototype.transformPosition=function(e,t){t=!!t;for(var n=a.iterator(this.ops),r=0;n.hasNext()&&r<=e;){var i=n.peekLength(),o=n.peekType();n.next(),"delete"!==o?("insert"===o&&(r0&&(e1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===e||e>=this.length()-1)){var r=this.clone();return 0===e?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}var o=i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"split",this).call(this,e,n);return this.cache={},o}}]),t}();function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null==e?t:("function"===typeof e.formats&&(t=(0,o.default)(t,e.formats())),null==e.parent||"scroll"==e.parent.blotName||e.parent.statics.scope!==e.statics.scope?t:v(e.parent,t))}g.blotName="block",g.tagName="P",g.defaultChild="break",g.allowedChildren=[c.default,s.default.Embed,u.default],t.bubbleFormats=v,t.BlockEmbed=m,t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.overload=t.expandConfig=void 0;var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=_(t,r),this.container=this.options.container,null==this.container)return b.error("Invalid Quill container",t);this.options.debug&&e.debug(this.options.debug);var i=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new l.default,this.scroll=u.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new s.default(this.scroll),this.selection=new p.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(l.default.events.EDITOR_CHANGE,function(e){e===l.default.events.TEXT_CHANGE&&n.root.classList.toggle("ql-blank",n.editor.isBlank())}),this.emitter.on(l.default.events.SCROLL_UPDATE,function(e,t){var r=n.selection.lastRange,i=r&&0===r.length?r.index:void 0;x.call(n,function(){return n.editor.update(null,t,i)},e)});var o=this.clipboard.convert("
"+i+"


");this.setContents(o),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return o(e,null,[{key:"debug",value:function(e){!0===e&&(e="log"),f.default.level(e)}},{key:"find",value:function(e){return e.__quill||u.default.find(e)}},{key:"import",value:function(e){return null==this.imports[e]&&b.error("Cannot import "+e+". Are you sure it was registered?"),this.imports[e]}},{key:"register",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!==typeof e){var i=e.attrName||e.blotName;"string"===typeof i?this.register("formats/"+i,e,t):Object.keys(e).forEach(function(r){n.register(r,e[r],t)})}else null==this.imports[e]||r||b.warn("Overwriting "+e+" with",t),this.imports[e]=t,(e.startsWith("blots/")||e.startsWith("formats/"))&&"abstract"!==t.blotName?u.default.register(t):e.startsWith("modules")&&"function"===typeof t.register&&t.register()}}]),o(e,[{key:"addContainer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"===typeof e){var n=e;(e=document.createElement("div")).classList.add(n)}return this.container.insertBefore(e,t),e}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(e,t,n){var r=this,o=w(e,t,n),a=i(o,4);return e=a[0],t=a[1],n=a[3],x.call(this,function(){return r.editor.deleteText(e,t)},n,e,-1*t)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}},{key:"focus",value:function(){var e=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=e,this.scrollIntoView()}},{key:"format",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default.sources.API;return x.call(this,function(){var r=n.getSelection(!0),i=new a.default;if(null==r)return i;if(u.default.query(e,u.default.Scope.BLOCK))i=n.editor.formatLine(r.index,r.length,v({},e,t));else{if(0===r.length)return n.selection.format(e,t),i;i=n.editor.formatText(r.index,r.length,v({},e,t))}return n.setSelection(r,l.default.sources.SILENT),i},r)}},{key:"formatLine",value:function(e,t,n,r,o){var a,s=this,l=w(e,t,n,r,o),c=i(l,4);return e=c[0],t=c[1],a=c[2],o=c[3],x.call(this,function(){return s.editor.formatLine(e,t,a)},o,e,0)}},{key:"formatText",value:function(e,t,n,r,o){var a,s=this,l=w(e,t,n,r,o),c=i(l,4);return e=c[0],t=c[1],a=c[2],o=c[3],x.call(this,function(){return s.editor.formatText(e,t,a)},o,e,0)}},{key:"getBounds",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=void 0;n="number"===typeof e?this.selection.getBounds(e,t):this.selection.getBounds(e.index,e.length);var r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}},{key:"getContents",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e,n=w(e,t),r=i(n,2);return e=r[0],t=r[1],this.editor.getContents(e,t)}},{key:"getFormat",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"===typeof e?this.editor.getFormat(e,t):this.editor.getFormat(e.index,e.length)}},{key:"getIndex",value:function(e){return e.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(e){return this.scroll.leaf(e)}},{key:"getLine",value:function(e){return this.scroll.line(e)}},{key:"getLines",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!==typeof e?this.scroll.lines(e.index,e.length):this.scroll.lines(e,t)}},{key:"getModule",value:function(e){return this.theme.modules[e]}},{key:"getSelection",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-e,n=w(e,t),r=i(n,2);return e=r[0],t=r[1],this.editor.getText(e,t)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(t,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.sources.API;return x.call(this,function(){return i.editor.insertEmbed(t,n,r)},o,t)}},{key:"insertText",value:function(e,t,n,r,o){var a,s=this,l=w(e,0,n,r,o),c=i(l,4);return e=c[0],a=c[2],o=c[3],x.call(this,function(){return s.editor.insertText(e,t,a)},o,e,t.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(e,t,n){this.clipboard.dangerouslyPasteHTML(e,t,n)}},{key:"removeFormat",value:function(e,t,n){var r=this,o=w(e,t,n),a=i(o,4);return e=a[0],t=a[1],n=a[3],x.call(this,function(){return r.editor.removeFormat(e,t)},n,e)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API;return x.call(this,function(){e=new a.default(e);var n=t.getLength(),r=t.editor.deleteText(0,n),i=t.editor.applyDelta(e),o=i.ops[i.ops.length-1];return null!=o&&"string"===typeof o.insert&&"\n"===o.insert[o.insert.length-1]&&(t.editor.deleteText(t.getLength()-1,1),i.delete(1)),r.compose(i)},n)}},{key:"setSelection",value:function(t,n,r){if(null==t)this.selection.setRange(null,n||e.sources.API);else{var o=w(t,n,r),a=i(o,4);t=a[0],n=a[1],r=a[3],this.selection.setRange(new h.Range(t,n),r),r!==l.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API,n=(new a.default).insert(e);return this.setContents(n,t)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.default.sources.USER,t=this.scroll.update(e);return this.selection.update(e),t}},{key:"updateContents",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.default.sources.API;return x.call(this,function(){return e=new a.default(e),t.editor.applyDelta(e,n)},n,!0)}}]),e}();function _(e,t){if((t=(0,d.default)(!0,{container:e,modules:{clipboard:!0,keyboard:!0,history:!0}},t)).theme&&t.theme!==y.DEFAULTS.theme){if(t.theme=y.import("themes/"+t.theme),null==t.theme)throw new Error("Invalid theme "+t.theme+". Did you register it?")}else t.theme=m.default;var n=(0,d.default)(!0,{},t.theme.DEFAULTS);[n,t].forEach(function(e){e.modules=e.modules||{},Object.keys(e.modules).forEach(function(t){!0===e.modules[t]&&(e.modules[t]={})})});var r=Object.keys(n.modules).concat(Object.keys(t.modules)).reduce(function(e,t){var n=y.import("modules/"+t);return null==n?b.error("Cannot load "+t+" module. Are you sure you registered it?"):e[t]=n.DEFAULTS||{},e},{});return null!=t.modules&&t.modules.toolbar&&t.modules.toolbar.constructor!==Object&&(t.modules.toolbar={container:t.modules.toolbar}),t=(0,d.default)(!0,{},y.DEFAULTS,{modules:r},n,t),["bounds","container","scrollingContainer"].forEach(function(e){"string"===typeof t[e]&&(t[e]=document.querySelector(t[e]))}),t.modules=Object.keys(t.modules).reduce(function(e,n){return t.modules[n]&&(e[n]=t.modules[n]),e},{}),t}function x(e,t,n,r){if(this.options.strict&&!this.isEnabled()&&t===l.default.sources.USER)return new a.default;var i=null==n?null:this.getSelection(),o=this.editor.delta,s=e();if(null!=i&&(!0===n&&(n=i.index),null==r?i=S(i,s,t):0!==r&&(i=S(i,n,r,t)),this.setSelection(i,l.default.sources.SILENT)),s.length()>0){var c,u,h=[l.default.events.TEXT_CHANGE,s,o,t];if((c=this.emitter).emit.apply(c,[l.default.events.EDITOR_CHANGE].concat(h)),t!==l.default.sources.SILENT)(u=this.emitter).emit.apply(u,h)}return s}function w(e,t,n,i,o){var a={};return"number"===typeof e.index&&"number"===typeof e.length?"number"!==typeof t?(o=i,i=n,n=t,t=e.length,e=e.index):(t=e.length,e=e.index):"number"!==typeof t&&(o=i,i=n,n=t,t=0),"object"===("undefined"===typeof n?"undefined":r(n))?(a=n,o=i):"string"===typeof n&&(null!=i?a[n]=i:o=n),[e,t,a,o=o||l.default.sources.API]}function S(e,t,n,r){if(null==e)return null;var o=void 0,s=void 0;if(t instanceof a.default){var c=[e.index,e.index+e.length].map(function(e){return t.transformPosition(e,r!==l.default.sources.USER)}),u=i(c,2);o=u[0],s=u[1]}else{var p=[e.index,e.index+e.length].map(function(e){return e=0?e+n:Math.max(t,e+n)}),d=i(p,2);o=d[0],s=d[1]}return new h.Range(o,s-o)}y.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},y.events=l.default.events,y.sources=l.default.sources,y.version="1.3.7",y.imports={delta:a.default,parchment:u.default,"core/module":c.default,"core/theme":m.default},t.expandConfig=_,t.overload=w,t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(e,n){var r=t.order.indexOf(e),i=t.order.indexOf(n);return r>=0||i>=0?r-i:e===n?0:e1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.quill=t,this.options=n};r.DEFAULTS={},t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=["error","warn","log","info"],i="warn";function o(e){if(r.indexOf(e)<=r.indexOf(i)){for(var t,n=arguments.length,o=Array(n>1?n-1:0),a=1;a=0;c--)if(h[c]!=p[c])return!1;for(c=h.length-1;c>=0;c--)if(u=h[c],!a(e[u],t[u],n))return!1;return typeof e===typeof t}(e,t,n))};function s(e){return null===e||void 0===e}function l(e){return!(!e||"object"!==typeof e||"number"!==typeof e.length)&&("function"===typeof e.copy&&"function"===typeof e.slice&&!(e.length>0&&"number"!==typeof e[0]))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=function(){function e(e,t,n){void 0===n&&(n={}),this.attrName=e,this.keyName=t;var i=r.Scope.TYPE&r.Scope.ATTRIBUTE;null!=n.scope?this.scope=n.scope&r.Scope.LEVEL|i:this.scope=r.Scope.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}return e.keys=function(e){return[].map.call(e.attributes,function(e){return e.name})},e.prototype.add=function(e,t){return!!this.canAdd(e,t)&&(e.setAttribute(this.keyName,t),!0)},e.prototype.canAdd=function(e,t){return null!=r.query(e,r.Scope.BLOT&(this.scope|r.Scope.TYPE))&&(null==this.whitelist||("string"===typeof t?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1))},e.prototype.remove=function(e){e.removeAttribute(this.keyName)},e.prototype.value=function(e){var t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""},e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Code=void 0;var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var n=0;n=e+n)){var a=this.newlineIndex(e,!0)+1,l=o-a+1,c=this.isolate(a,l),u=c.next;c.format(r,i),u instanceof t&&u.formatAt(0,e-a+n-l,r,i)}}}},{key:"insertAt",value:function(e,t,n){if(null==n){var i=this.descendant(u.default,e),o=r(i,2),a=o[0],s=o[1];a.insertAt(s,t)}}},{key:"length",value:function(){var e=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?e:e+1}},{key:"newlineIndex",value:function(e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return this.domNode.textContent.slice(0,e).lastIndexOf("\n");var t=this.domNode.textContent.slice(e).indexOf("\n");return t>-1?e+t:-1}},{key:"optimize",value:function(e){this.domNode.textContent.endsWith("\n")||this.appendChild(s.default.create("text","\n")),o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(e),n.moveChildren(this),n.remove())}},{key:"replace",value:function(e){o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replace",this).call(this,e),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(e){var t=s.default.find(e);null==t?e.parentNode.removeChild(e):t instanceof s.default.Embed?t.remove():t.unwrap()})}}],[{key:"create",value:function(e){var n=o(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return n.setAttribute("spellcheck",!1),n}},{key:"formats",value:function(){return!0}}]),t}();g.blotName="code-block",g.tagName="PRE",g.TAB=" ",t.Code=m,t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function e(e,t){for(var n=0;n=o&&!d.endsWith("\n")&&(n=!0),t.scroll.insertAt(e,d);var f=t.scroll.line(e),m=i(f,2),v=m[0],b=m[1],y=(0,g.default)({},(0,h.bubbleFormats)(v));if(v instanceof p.default){var _=v.descendant(l.default.Leaf,b),x=i(_,1)[0];y=(0,g.default)(y,(0,h.bubbleFormats)(x))}u=s.default.attributes.diff(y,u)||{}}else if("object"===r(a.insert)){var w=Object.keys(a.insert)[0];if(null==w)return e;t.scroll.insertAt(e,w,a.insert[w])}o+=c}return Object.keys(u).forEach(function(n){t.scroll.formatAt(e,c,n,u[n])}),e+c},0),e.reduce(function(e,n){return"number"===typeof n.delete?(t.scroll.deleteAt(e,n.delete),e):e+(n.retain||n.insert.length||1)},0),this.scroll.batchEnd(),this.update(e)}},{key:"deleteText",value:function(e,t){return this.scroll.deleteAt(e,t),this.update((new a.default).retain(e).delete(t))}},{key:"formatLine",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(r).forEach(function(i){if(null==n.scroll.whitelist||n.scroll.whitelist[i]){var o=n.scroll.lines(e,Math.max(t,1)),a=t;o.forEach(function(t){var o=t.length();if(t instanceof c.default){var s=e-t.offset(n.scroll),l=t.newlineIndex(s+a)-s+1;t.formatAt(s,l,i,r[i])}else t.format(i,r[i]);a-=o})}}),this.scroll.optimize(),this.update((new a.default).retain(e).retain(t,(0,f.default)(r)))}},{key:"formatText",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(r).forEach(function(i){n.scroll.formatAt(e,t,i,r[i])}),this.update((new a.default).retain(e).retain(t,(0,f.default)(r)))}},{key:"getContents",value:function(e,t){return this.delta.slice(e,e+t)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(e,t){return e.concat(t.delta())},new a.default)}},{key:"getFormat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===t?this.scroll.path(e).forEach(function(e){var t=i(e,1)[0];t instanceof p.default?n.push(t):t instanceof l.default.Leaf&&r.push(t)}):(n=this.scroll.lines(e,t),r=this.scroll.descendants(l.default.Leaf,e,t));var o=[n,r].map(function(e){if(0===e.length)return{};for(var t=(0,h.bubbleFormats)(e.shift());Object.keys(t).length>0;){var n=e.shift();if(null==n)return t;t=_((0,h.bubbleFormats)(n),t)}return t});return g.default.apply(g.default,o)}},{key:"getText",value:function(e,t){return this.getContents(e,t).filter(function(e){return"string"===typeof e.insert}).map(function(e){return e.insert}).join("")}},{key:"insertEmbed",value:function(e,t,n){return this.scroll.insertAt(e,t,n),this.update((new a.default).retain(e).insert(function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,n)))}},{key:"insertText",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=t.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(e,t),Object.keys(r).forEach(function(i){n.scroll.formatAt(e,t.length,i,r[i])}),this.update((new a.default).retain(e).insert(t,(0,f.default)(r)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var e=this.scroll.children.head;return e.statics.blotName===p.default.blotName&&(!(e.children.length>1)&&e.children.head instanceof d.default)}},{key:"removeFormat",value:function(e,t){var n=this.getText(e,t),r=this.scroll.line(e+t),o=i(r,2),s=o[0],l=o[1],u=0,h=new a.default;null!=s&&(u=s instanceof c.default?s.newlineIndex(l)-l+1:s.length()-l,h=s.delta().slice(l,l+u-1).insert("\n"));var p=this.getContents(e,t+u).diff((new a.default).insert(n).concat(h)),d=(new a.default).retain(e).concat(p);return this.applyDelta(d)}},{key:"update",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=this.delta;if(1===t.length&&"characterData"===t[0].type&&t[0].target.data.match(b)&&l.default.find(t[0].target)){var i=l.default.find(t[0].target),o=(0,h.bubbleFormats)(i),s=i.offset(this.scroll),c=t[0].oldValue.replace(u.default.CONTENTS,""),p=(new a.default).insert(c),d=(new a.default).insert(i.value());e=(new a.default).retain(s).concat(p.diff(d,n)).reduce(function(e,t){return t.insert?e.insert(t.insert,o):e.push(t)},new a.default),this.delta=r.compose(e)}else this.delta=this.getDelta(),e&&(0,m.default)(r.compose(e),this.delta)||(e=r.diff(this.delta,n));return e}}]),e}();function _(e,t){return Object.keys(t).reduce(function(n,r){return null==e[r]?n:(t[r]===e[r]?n[r]=t[r]:Array.isArray(t[r])?t[r].indexOf(e[r])<0&&(n[r]=t[r].concat([e[r]])):n[r]=[t[r],e[r]],n)},{})}t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Range=void 0;var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:0;h(this,e),this.index=t,this.length=n},f=function(){function e(t,n){var r=this;h(this,e),this.emitter=n,this.scroll=t,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=o.default.create("cursor",this),this.lastRange=this.savedRange=new d(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){r.mouseDown||setTimeout(r.update.bind(r,l.default.sources.USER),1)}),this.emitter.on(l.default.events.EDITOR_CHANGE,function(e,t){e===l.default.events.TEXT_CHANGE&&t.length()>0&&r.update(l.default.sources.SILENT)}),this.emitter.on(l.default.events.SCROLL_BEFORE_UPDATE,function(){if(r.hasFocus()){var e=r.getNativeRange();null!=e&&e.start.node!==r.cursor.textNode&&r.emitter.once(l.default.events.SCROLL_UPDATE,function(){try{r.setNativeRange(e.start.node,e.start.offset,e.end.node,e.end.offset)}catch(t){}})}}),this.emitter.on(l.default.events.SCROLL_OPTIMIZE,function(e,t){if(t.range){var n=t.range,i=n.startNode,o=n.startOffset,a=n.endNode,s=n.endOffset;r.setNativeRange(i,o,a,s)}}),this.update(l.default.sources.SILENT)}return i(e,[{key:"handleComposition",value:function(){var e=this;this.root.addEventListener("compositionstart",function(){e.composing=!0}),this.root.addEventListener("compositionend",function(){if(e.composing=!1,e.cursor.parent){var t=e.cursor.restore();if(!t)return;setTimeout(function(){e.setNativeRange(t.startNode,t.startOffset,t.endNode,t.endOffset)},1)}})}},{key:"handleDragging",value:function(){var e=this;this.emitter.listenDOM("mousedown",document.body,function(){e.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){e.mouseDown=!1,e.update(l.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(e,t){if(null==this.scroll.whitelist||this.scroll.whitelist[e]){this.scroll.update();var n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!o.default.query(e,o.default.Scope.BLOCK)){if(n.start.node!==this.cursor.textNode){var r=o.default.find(n.start.node,!1);if(null==r)return;if(r instanceof o.default.Leaf){var i=r.split(n.start.offset);r.parent.insertBefore(this.cursor,i)}else r.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(e,t),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();e=Math.min(e,n-1),t=Math.min(e+t,n-1)-e;var i=void 0,o=this.scroll.leaf(e),a=r(o,2),s=a[0],l=a[1];if(null==s)return null;var c=s.position(l,!0),u=r(c,2);i=u[0],l=u[1];var h=document.createRange();if(t>0){h.setStart(i,l);var p=this.scroll.leaf(e+t),d=r(p,2);if(s=d[0],l=d[1],null==s)return null;var f=s.position(l,!0),m=r(f,2);return i=m[0],l=m[1],h.setEnd(i,l),h.getBoundingClientRect()}var g="left",v=void 0;return i instanceof Text?(l0&&(g="right")),{bottom:v.top+v.height,height:v.height,left:v[g],right:v[g],top:v.top,width:0}}},{key:"getNativeRange",value:function(){var e=document.getSelection();if(null==e||e.rangeCount<=0)return null;var t=e.getRangeAt(0);if(null==t)return null;var n=this.normalizeNative(t);return p.info("getNativeRange",n),n}},{key:"getRange",value:function(){var e=this.getNativeRange();return null==e?[null,null]:[this.normalizedToRange(e),e]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(e){var t=this,n=[[e.start.node,e.start.offset]];e.native.collapsed||n.push([e.end.node,e.end.offset]);var i=n.map(function(e){var n=r(e,2),i=n[0],a=n[1],s=o.default.find(i,!0),l=s.offset(t.scroll);return 0===a?l:s instanceof o.default.Container?l+s.length():l+s.index(i,a)}),a=Math.min(Math.max.apply(Math,u(i)),this.scroll.length()-1),s=Math.min.apply(Math,[a].concat(u(i)));return new d(s,a-s)}},{key:"normalizeNative",value:function(e){if(!m(this.root,e.startContainer)||!e.collapsed&&!m(this.root,e.endContainer))return null;var t={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[t.start,t.end].forEach(function(e){for(var t=e.node,n=e.offset;!(t instanceof Text)&&t.childNodes.length>0;)if(t.childNodes.length>n)t=t.childNodes[n],n=0;else{if(t.childNodes.length!==n)break;n=(t=t.lastChild)instanceof Text?t.data.length:t.childNodes.length+1}e.node=t,e.offset=n}),t}},{key:"rangeToNative",value:function(e){var t=this,n=e.collapsed?[e.index]:[e.index,e.index+e.length],i=[],o=this.scroll.length();return n.forEach(function(e,n){e=Math.min(o-1,e);var a,s=t.scroll.leaf(e),l=r(s,2),c=l[0],u=l[1],h=c.position(u,0!==n),p=r(h,2);a=p[0],u=p[1],i.push(a,u)}),i.length<2&&(i=i.concat(i)),i}},{key:"scrollIntoView",value:function(e){var t=this.lastRange;if(null!=t){var n=this.getBounds(t.index,t.length);if(null!=n){var i=this.scroll.length()-1,o=this.scroll.line(Math.min(t.index,i)),a=r(o,1)[0],s=a;if(t.length>0){var l=this.scroll.line(Math.min(t.index+t.length,i));s=r(l,1)[0]}if(null!=a&&null!=s){var c=e.getBoundingClientRect();n.topc.bottom&&(e.scrollTop+=n.bottom-c.bottom)}}}}},{key:"setNativeRange",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(p.info("setNativeRange",e,t,n,r),null==e||null!=this.root.parentNode&&null!=e.parentNode&&null!=n.parentNode){var o=document.getSelection();if(null!=o)if(null!=e){this.hasFocus()||this.root.focus();var a=(this.getNativeRange()||{}).native;if(null==a||i||e!==a.startContainer||t!==a.startOffset||n!==a.endContainer||r!==a.endOffset){"BR"==e.tagName&&(t=[].indexOf.call(e.parentNode.childNodes,e),e=e.parentNode),"BR"==n.tagName&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);var s=document.createRange();s.setStart(e,t),s.setEnd(n,r),o.removeAllRanges(),o.addRange(s)}}else o.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.default.sources.API;if("string"===typeof t&&(n=t,t=!1),p.info("setRange",e),null!=e){var r=this.rangeToNative(e);this.setNativeRange.apply(this,u(r).concat([t]))}else this.setNativeRange(null);this.update(n)}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.default.sources.USER,t=this.lastRange,n=this.getRange(),i=r(n,2),o=i[0],c=i[1];if(this.lastRange=o,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,s.default)(t,this.lastRange)){var u;!this.composing&&null!=c&&c.native.collapsed&&c.start.node!==this.cursor.textNode&&this.cursor.restore();var h,p=[l.default.events.SELECTION_CHANGE,(0,a.default)(this.lastRange),(0,a.default)(t),e];if((u=this.emitter).emit.apply(u,[l.default.events.EDITOR_CHANGE].concat(p)),e!==l.default.sources.SILENT)(h=this.emitter).emit.apply(h,p)}}}]),e}();function m(e,t){try{t.parentNode}catch(n){return!1}return t instanceof Text&&(t=t.parentNode),e.contains(t)}t.Range=d,t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n0&&(n+=1),[this.parent.domNode,n]},t.prototype.value=function(){var e;return(e={})[this.statics.blotName]=this.statics.value(this.domNode)||!0,e},t.scope=o.Scope.INLINE_BLOT,t}(i.default);t.default=a},function(e,t,n){var r=n(11),i=n(3),o={attributes:{compose:function(e,t,n){"object"!==typeof e&&(e={}),"object"!==typeof t&&(t={});var r=i(!0,{},t);for(var o in n||(r=Object.keys(r).reduce(function(e,t){return null!=r[t]&&(e[t]=r[t]),e},{})),e)void 0!==e[o]&&void 0===t[o]&&(r[o]=e[o]);return Object.keys(r).length>0?r:void 0},diff:function(e,t){"object"!==typeof e&&(e={}),"object"!==typeof t&&(t={});var n=Object.keys(e).concat(Object.keys(t)).reduce(function(n,i){return r(e[i],t[i])||(n[i]=void 0===t[i]?null:t[i]),n},{});return Object.keys(n).length>0?n:void 0},transform:function(e,t,n){if("object"!==typeof e)return t;if("object"===typeof t){if(!n)return t;var r=Object.keys(t).reduce(function(n,r){return void 0===e[r]&&(n[r]=t[r]),n},{});return Object.keys(r).length>0?r:void 0}}},iterator:function(e){return new a(e)},length:function(e){return"number"===typeof e.delete?e.delete:"number"===typeof e.retain?e.retain:"string"===typeof e.insert?e.insert.length:1}};function a(e){this.ops=e,this.index=0,this.offset=0}a.prototype.hasNext=function(){return this.peekLength()<1/0},a.prototype.next=function(e){e||(e=1/0);var t=this.ops[this.index];if(t){var n=this.offset,r=o.length(t);if(e>=r-n?(e=r-n,this.index+=1,this.offset=0):this.offset+=e,"number"===typeof t.delete)return{delete:e};var i={};return t.attributes&&(i.attributes=t.attributes),"number"===typeof t.retain?i.retain=e:"string"===typeof t.insert?i.insert=t.insert.substr(n,e):i.insert=t.insert,i}return{retain:1/0}},a.prototype.peek=function(){return this.ops[this.index]},a.prototype.peekLength=function(){return this.ops[this.index]?o.length(this.ops[this.index])-this.offset:1/0},a.prototype.peekType=function(){return this.ops[this.index]?"number"===typeof this.ops[this.index].delete?"delete":"number"===typeof this.ops[this.index].retain?"retain":"insert":"retain"},a.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var e=this.offset,t=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=e,this.index=t,[n].concat(r)}return[]},e.exports=o},function(e,n){var r=function(){"use strict";function e(e,t){return null!=t&&e instanceof t}var n,r,i;try{n=Map}catch(l){n=function(){}}try{r=Set}catch(l){r=function(){}}try{i=Promise}catch(l){i=function(){}}function o(a,l,c,u,h){"object"===typeof l&&(c=l.depth,u=l.prototype,h=l.includeNonEnumerable,l=l.circular);var p=[],d=[],f="undefined"!=typeof t;return"undefined"==typeof l&&(l=!0),"undefined"==typeof c&&(c=1/0),function a(c,m){if(null===c)return null;if(0===m)return c;var g,v;if("object"!=typeof c)return c;if(e(c,n))g=new n;else if(e(c,r))g=new r;else if(e(c,i))g=new i(function(e,t){c.then(function(t){e(a(t,m-1))},function(e){t(a(e,m-1))})});else if(o.__isArray(c))g=[];else if(o.__isRegExp(c))g=new RegExp(c.source,s(c)),c.lastIndex&&(g.lastIndex=c.lastIndex);else if(o.__isDate(c))g=new Date(c.getTime());else{if(f&&t.isBuffer(c))return g=t.allocUnsafe?t.allocUnsafe(c.length):new t(c.length),c.copy(g),g;e(c,Error)?g=Object.create(c):"undefined"==typeof u?(v=Object.getPrototypeOf(c),g=Object.create(v)):(g=Object.create(u),v=u)}if(l){var b=p.indexOf(c);if(-1!=b)return d[b];p.push(c),d.push(g)}for(var y in e(c,n)&&c.forEach(function(e,t){var n=a(t,m-1),r=a(e,m-1);g.set(n,r)}),e(c,r)&&c.forEach(function(e){var t=a(e,m-1);g.add(t)}),c){var _;v&&(_=Object.getOwnPropertyDescriptor(v,y)),_&&null==_.set||(g[y]=a(c[y],m-1))}if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(c);for(y=0;y0){if(s instanceof l.BlockEmbed||d instanceof l.BlockEmbed)return void this.optimize();if(s instanceof h.default){var f=s.newlineIndex(s.length(),!0);if(f>-1&&(s=s.split(f+1))===d)return void this.optimize()}else if(d instanceof h.default){var m=d.newlineIndex(0);m>-1&&d.split(m+1)}var g=d.children.head instanceof u.default?null:d.children.head;s.moveChildren(d,g),s.remove()}this.optimize()}},{key:"enable",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",e)}},{key:"formatAt",value:function(e,n,r,i){(null==this.whitelist||this.whitelist[r])&&(o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"formatAt",this).call(this,e,n,r,i),this.optimize())}},{key:"insertAt",value:function(e,n,r){if(null==r||null==this.whitelist||this.whitelist[n]){if(e>=this.length())if(null==r||null==a.default.query(n,a.default.Scope.BLOCK)){var i=a.default.create(this.statics.defaultChild);this.appendChild(i),null==r&&n.endsWith("\n")&&(n=n.slice(0,-1)),i.insertAt(0,n,r)}else{var s=a.default.create(n,r);this.appendChild(s)}else o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertAt",this).call(this,e,n,r);this.optimize()}}},{key:"insertBefore",value:function(e,n){if(e.statics.scope===a.default.Scope.INLINE_BLOT){var r=a.default.create(this.statics.defaultChild);r.appendChild(e),e=r}o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,e,n)}},{key:"leaf",value:function(e){return this.path(e).pop()||[null,-1]}},{key:"line",value:function(e){return e===this.length()?this.line(e-1):this.descendant(f,e)}},{key:"lines",value:function(){return function e(t,n,r){var i=[],o=r;return t.children.forEachAt(n,r,function(t,n,r){f(t)?i.push(t):t instanceof a.default.Container&&(i=i.concat(e(t,n,o))),o-=r}),i}(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE)}},{key:"optimize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e,n),e.length>0&&this.emitter.emit(s.default.events.SCROLL_OPTIMIZE,e,n))}},{key:"path",value:function(e){return o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"path",this).call(this,e).slice(1)}},{key:"update",value:function(e){if(!0!==this.batch){var n=s.default.sources.USER;"string"===typeof e&&(n=e),Array.isArray(e)||(e=this.observer.takeRecords()),e.length>0&&this.emitter.emit(s.default.events.SCROLL_BEFORE_UPDATE,n,e),o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"update",this).call(this,e.concat([])),e.length>0&&this.emitter.emit(s.default.events.SCROLL_UPDATE,n,e)}}}]),t}();m.blotName="scroll",m.className="ql-editor",m.tagName="DIV",m.defaultChild="block",m.allowedChildren=[c.default,l.BlockEmbed,p.default],t.default=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHORTKEY=t.default=void 0;var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=k(e);if(null==r||null==r.key)return v.warn("Attempted to add invalid keyboard binding",r);"function"===typeof t&&(t={handler:t}),"function"===typeof n&&(n={handler:n}),r=(0,l.default)(r,t,n),this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}},{key:"listen",value:function(){var e=this;this.quill.root.addEventListener("keydown",function(n){if(!n.defaultPrevented){var o=n.which||n.keyCode,a=(e.bindings[o]||[]).filter(function(e){return t.match(n,e)});if(0!==a.length){var l=e.quill.getSelection();if(null!=l&&e.quill.hasFocus()){var c=e.quill.getLine(l.index),u=i(c,2),p=u[0],d=u[1],f=e.quill.getLeaf(l.index),m=i(f,2),g=m[0],v=m[1],b=0===l.length?[g,v]:e.quill.getLeaf(l.index+l.length),y=i(b,2),_=y[0],x=y[1],w=g instanceof h.default.Text?g.value().slice(0,v):"",S=_ instanceof h.default.Text?_.value().slice(x):"",E={collapsed:0===l.length,empty:0===l.length&&p.length()<=1,format:e.quill.getFormat(l),offset:d,prefix:w,suffix:S};a.some(function(t){if(null!=t.collapsed&&t.collapsed!==E.collapsed)return!1;if(null!=t.empty&&t.empty!==E.empty)return!1;if(null!=t.offset&&t.offset!==E.offset)return!1;if(Array.isArray(t.format)){if(t.format.every(function(e){return null==E.format[e]}))return!1}else if("object"===r(t.format)&&!Object.keys(t.format).every(function(e){return!0===t.format[e]?null!=E.format[e]:!1===t.format[e]?null==E.format[e]:(0,s.default)(t.format[e],E.format[e])}))return!1;return!(null!=t.prefix&&!t.prefix.test(E.prefix))&&(!(null!=t.suffix&&!t.suffix.test(E.suffix))&&!0!==t.handler.call(e,l,E))})&&n.preventDefault()}}}})}}]),t}();function _(e,t){var n,r=e===y.keys.LEFT?"prefix":"suffix";return g(n={key:e,shiftKey:t,altKey:null},r,/^$/),g(n,"handler",function(n){var r=n.index;e===y.keys.RIGHT&&(r+=n.length+1);var o=this.quill.getLeaf(r);return!(i(o,1)[0]instanceof h.default.Embed)||(e===y.keys.LEFT?t?this.quill.setSelection(n.index-1,n.length+1,p.default.sources.USER):this.quill.setSelection(n.index-1,p.default.sources.USER):t?this.quill.setSelection(n.index,n.length+1,p.default.sources.USER):this.quill.setSelection(n.index+n.length+1,p.default.sources.USER),!1)}),n}function x(e,t){if(!(0===e.index||this.quill.getLength()<=1)){var n=this.quill.getLine(e.index),r=i(n,1)[0],o={};if(0===t.offset){var a=this.quill.getLine(e.index-1),s=i(a,1)[0];if(null!=s&&s.length()>1){var l=r.formats(),c=this.quill.getFormat(e.index-1,1);o=u.default.attributes.diff(l,c)||{}}}var h=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(t.prefix)?2:1;this.quill.deleteText(e.index-h,h,p.default.sources.USER),Object.keys(o).length>0&&this.quill.formatLine(e.index-h,h,o,p.default.sources.USER),this.quill.focus()}}function w(e,t){var n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(t.suffix)?2:1;if(!(e.index>=this.quill.getLength()-n)){var r={},o=0,a=this.quill.getLine(e.index),s=i(a,1)[0];if(t.offset>=s.length()-1){var l=this.quill.getLine(e.index+1),c=i(l,1)[0];if(c){var h=s.formats(),d=this.quill.getFormat(e.index,1);r=u.default.attributes.diff(h,d)||{},o=c.length()}}this.quill.deleteText(e.index,n,p.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(e.index+o-1,n,r,p.default.sources.USER)}}function S(e){var t=this.quill.getLines(e),n={};if(t.length>1){var r=t[0].formats(),i=t[t.length-1].formats();n=u.default.attributes.diff(i,r)||{}}this.quill.deleteText(e,p.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(e.index,1,n,p.default.sources.USER),this.quill.setSelection(e.index,p.default.sources.SILENT),this.quill.focus()}function E(e,t){var n=this;e.length>0&&this.quill.scroll.deleteAt(e.index,e.length);var r=Object.keys(t.format).reduce(function(e,n){return h.default.query(n,h.default.Scope.BLOCK)&&!Array.isArray(t.format[n])&&(e[n]=t.format[n]),e},{});this.quill.insertText(e.index,"\n",r,p.default.sources.USER),this.quill.setSelection(e.index+1,p.default.sources.SILENT),this.quill.focus(),Object.keys(t.format).forEach(function(e){null==r[e]&&(Array.isArray(t.format[e])||"link"!==e&&n.quill.format(e,t.format[e],p.default.sources.USER))})}function C(e){return{key:y.keys.TAB,shiftKey:!e,format:{"code-block":!0},handler:function(t){var n=h.default.query("code-block"),r=t.index,o=t.length,a=this.quill.scroll.descendant(n,r),s=i(a,2),l=s[0],c=s[1];if(null!=l){var u=this.quill.getIndex(l),d=l.newlineIndex(c,!0)+1,f=l.newlineIndex(u+c+o),m=l.domNode.textContent.slice(d,f).split("\n");c=0,m.forEach(function(t,i){e?(l.insertAt(d+c,n.TAB),c+=n.TAB.length,0===i?r+=n.TAB.length:o+=n.TAB.length):t.startsWith(n.TAB)&&(l.deleteAt(d+c,n.TAB.length),c-=n.TAB.length,0===i?r-=n.TAB.length:o-=n.TAB.length),c+=t.length+1}),this.quill.update(p.default.sources.USER),this.quill.setSelection(r,o,p.default.sources.SILENT)}}}}function T(e){return{key:e[0].toUpperCase(),shortKey:!0,handler:function(t,n){this.quill.format(e,!n.format[e],p.default.sources.USER)}}}function k(e){if("string"===typeof e||"number"===typeof e)return k({key:e});if("object"===("undefined"===typeof e?"undefined":r(e))&&(e=(0,a.default)(e,!1)),"string"===typeof e.key)if(null!=y.keys[e.key.toUpperCase()])e.key=y.keys[e.key.toUpperCase()];else{if(1!==e.key.length)return null;e.key=e.key.toUpperCase().charCodeAt(0)}return e.shortKey&&(e[b]=e.shortKey,delete e.shortKey),e}y.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},y.DEFAULTS={bindings:{bold:T("bold"),italic:T("italic"),underline:T("underline"),indent:{key:y.keys.TAB,format:["blockquote","indent","list"],handler:function(e,t){if(t.collapsed&&0!==t.offset)return!0;this.quill.format("indent","+1",p.default.sources.USER)}},outdent:{key:y.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(e,t){if(t.collapsed&&0!==t.offset)return!0;this.quill.format("indent","-1",p.default.sources.USER)}},"outdent backspace":{key:y.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(e,t){null!=t.format.indent?this.quill.format("indent","-1",p.default.sources.USER):null!=t.format.list&&this.quill.format("list",!1,p.default.sources.USER)}},"indent code-block":C(!0),"outdent code-block":C(!1),"remove tab":{key:y.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(e){this.quill.deleteText(e.index-1,1,p.default.sources.USER)}},tab:{key:y.keys.TAB,handler:function(e){this.quill.history.cutoff();var t=(new c.default).retain(e.index).delete(e.length).insert("\t");this.quill.updateContents(t,p.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index+1,p.default.sources.SILENT)}},"list empty enter":{key:y.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(e,t){this.quill.format("list",!1,p.default.sources.USER),t.format.indent&&this.quill.format("indent",!1,p.default.sources.USER)}},"checklist enter":{key:y.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(e){var t=this.quill.getLine(e.index),n=i(t,2),r=n[0],o=n[1],a=(0,l.default)({},r.formats(),{list:"checked"}),s=(new c.default).retain(e.index).insert("\n",a).retain(r.length()-o-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,p.default.sources.USER),this.quill.setSelection(e.index+1,p.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:y.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(e,t){var n=this.quill.getLine(e.index),r=i(n,2),o=r[0],a=r[1],s=(new c.default).retain(e.index).insert("\n",t.format).retain(o.length()-a-1).retain(1,{header:null});this.quill.updateContents(s,p.default.sources.USER),this.quill.setSelection(e.index+1,p.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(e,t){var n=t.prefix.length,r=this.quill.getLine(e.index),o=i(r,2),a=o[0],s=o[1];if(s>n)return!0;var l=void 0;switch(t.prefix.trim()){case"[]":case"[ ]":l="unchecked";break;case"[x]":l="checked";break;case"-":case"*":l="bullet";break;default:l="ordered"}this.quill.insertText(e.index," ",p.default.sources.USER),this.quill.history.cutoff();var u=(new c.default).retain(e.index-s).delete(n+1).retain(a.length()-2-s).retain(1,{list:l});this.quill.updateContents(u,p.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(e.index-n,p.default.sources.SILENT)}},"code exit":{key:y.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(e){var t=this.quill.getLine(e.index),n=i(t,2),r=n[0],o=n[1],a=(new c.default).retain(e.index+r.length()-o-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(a,p.default.sources.USER)}},"embed left":_(y.keys.LEFT,!1),"embed left shift":_(y.keys.LEFT,!0),"embed right":_(y.keys.RIGHT,!1),"embed right shift":_(y.keys.RIGHT,!0)}},t.default=y,t.SHORTKEY=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0},o=function(){function e(e,t){for(var n=0;n-1}l.blotName="link",l.tagName="A",l.SANITIZED_URL="about:blank",l.PROTOCOL_WHITELIST=["http","https","mailto","tel"],t.default=l,t.sanitize=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(e!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=e&&(e.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(e.parentNode.children,e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),t))){if("function"===typeof Event)this.select.dispatchEvent(new Event("change"));else if("object"===("undefined"===typeof Event?"undefined":r(Event))){var i=document.createEvent("Event");i.initEvent("change",!0,!0),this.select.dispatchEvent(i)}this.close()}}},{key:"update",value:function(){var e=void 0;if(this.select.selectedIndex>-1){var t=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(t)}else this.selectItem(null);var n=null!=e&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=v(n(0)),i=v(n(5)),o=n(4),a=v(o),s=v(n(16)),l=v(n(25)),c=v(n(24)),u=v(n(35)),h=v(n(6)),p=v(n(22)),d=v(n(7)),f=v(n(55)),m=v(n(42)),g=v(n(23));function v(e){return e&&e.__esModule?e:{default:e}}i.default.register({"blots/block":a.default,"blots/block/embed":o.BlockEmbed,"blots/break":s.default,"blots/container":l.default,"blots/cursor":c.default,"blots/embed":u.default,"blots/inline":h.default,"blots/scroll":p.default,"blots/text":d.default,"modules/clipboard":f.default,"modules/history":m.default,"modules/keyboard":g.default}),r.default.register(a.default,s.default,c.default,h.default,p.default,d.default),t.default=i.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=function(){function e(e){this.domNode=e,this.domNode[r.DATA_KEY]={blot:this}}return Object.defineProperty(e.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),e.create=function(e){if(null==this.tagName)throw new r.ParchmentError("Blot definition missing tagName");var t;return Array.isArray(this.tagName)?("string"===typeof e&&(e=e.toUpperCase(),parseInt(e).toString()===e&&(e=parseInt(e))),t="number"===typeof e?document.createElement(this.tagName[e-1]):this.tagName.indexOf(e)>-1?document.createElement(e):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t},e.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},e.prototype.clone=function(){var e=this.domNode.cloneNode(!1);return r.create(e)},e.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},e.prototype.deleteAt=function(e,t){this.isolate(e,t).remove()},e.prototype.formatAt=function(e,t,n,i){var o=this.isolate(e,t);if(null!=r.query(n,r.Scope.BLOT)&&i)o.wrap(n,i);else if(null!=r.query(n,r.Scope.ATTRIBUTE)){var a=r.create(this.statics.scope);o.wrap(a),a.format(n,i)}},e.prototype.insertAt=function(e,t,n){var i=null==n?r.create("text",t):r.create(t,n),o=this.split(e);this.parent.insertBefore(i,o)},e.prototype.insertInto=function(e,t){void 0===t&&(t=null),null!=this.parent&&this.parent.children.remove(this);var n=null;e.children.insertBefore(this,t),null!=t&&(n=t.domNode),this.domNode.parentNode==e.domNode&&this.domNode.nextSibling==n||e.domNode.insertBefore(this.domNode,n),this.parent=e,this.attach()},e.prototype.isolate=function(e,t){var n=this.split(e);return n.split(t),n},e.prototype.length=function(){return 1},e.prototype.offset=function(e){return void 0===e&&(e=this.parent),null==this.parent||this==e?0:this.parent.children.offset(this)+this.parent.offset(e)},e.prototype.optimize=function(e){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},e.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},e.prototype.replace=function(e){null!=e.parent&&(e.parent.insertBefore(this,e.next),e.remove())},e.prototype.replaceWith=function(e,t){var n="string"===typeof e?r.create(e,t):e;return n.replace(this),n},e.prototype.split=function(e,t){return 0===e?this:this.next},e.prototype.update=function(e,t){},e.prototype.wrap=function(e,t){var n="string"===typeof e?r.create(e,t):e;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},e.blotName="abstract",e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),i=n(32),o=n(33),a=n(1),s=function(){function e(e){this.attributes={},this.domNode=e,this.build()}return e.prototype.attribute=function(e,t){t?e.add(this.domNode,t)&&(null!=e.value(this.domNode)?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])},e.prototype.build=function(){var e=this;this.attributes={};var t=r.default.keys(this.domNode),n=i.default.keys(this.domNode),s=o.default.keys(this.domNode);t.concat(n).concat(s).forEach(function(t){var n=a.query(t,a.Scope.ATTRIBUTE);n instanceof r.default&&(e.attributes[n.attrName]=n)})},e.prototype.copy=function(e){var t=this;Object.keys(this.attributes).forEach(function(n){var r=t.attributes[n].value(t.domNode);e.format(n,r)})},e.prototype.move=function(e){var t=this;this.copy(e),Object.keys(this.attributes).forEach(function(e){t.attributes[e].remove(t.domNode)}),this.attributes={}},e.prototype.values=function(){var e=this;return Object.keys(this.attributes).reduce(function(t,n){return t[n]=e.attributes[n].value(e.domNode),t},{})},e}();t.default=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function i(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter(function(e){return 0===e.indexOf(t+"-")})}Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.keys=function(e){return(e.getAttribute("class")||"").split(/\s+/).map(function(e){return e.split("-").slice(0,-1).join("-")})},t.prototype.add=function(e,t){return!!this.canAdd(e,t)&&(this.remove(e),e.classList.add(this.keyName+"-"+t),!0)},t.prototype.remove=function(e){i(e,this.keyName).forEach(function(t){e.classList.remove(t)}),0===e.classList.length&&e.removeAttribute("class")},t.prototype.value=function(e){var t=(i(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""},t}(n(12).default);t.default=o},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function i(e){var t=e.split("-"),n=t.slice(1).map(function(e){return e[0].toUpperCase()+e.slice(1)}).join("");return t[0]+n}Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.keys=function(e){return(e.getAttribute("style")||"").split(";").map(function(e){return e.split(":")[0].trim()})},t.prototype.add=function(e,t){return!!this.canAdd(e,t)&&(e.style[i(this.keyName)]=t,!0)},t.prototype.remove=function(e){e.style[i(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")},t.prototype.value=function(e){var t=e.style[i(this.keyName)];return this.canAdd(e,t)?t:""},t}(n(12).default);t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;nr&&this.stack.undo.length>0){var i=this.stack.undo.pop();n=n.compose(i.undo),e=i.redo.compose(e)}else this.lastRecorded=r;this.stack.undo.push({redo:e,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(e){this.stack.undo.forEach(function(t){t.undo=e.transform(t.undo,!0),t.redo=e.transform(t.redo,!0)}),this.stack.redo.forEach(function(t){t.undo=e.transform(t.undo,!0),t.redo=e.transform(t.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),t}();function c(e){var t=e.reduce(function(e,t){return e+=t.delete||0},0),n=e.length()-t;return function(e){var t=e.ops[e.ops.length-1];return null!=t&&(null!=t.insert?"string"===typeof t.insert&&t.insert.endsWith("\n"):null!=t.attributes&&Object.keys(t.attributes).some(function(e){return null!=i.default.query(e,i.default.Scope.BLOCK)}))}(e)&&(n-=1),n}l.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},t.default=l,t.getLastChangeIndex=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.BaseTooltip=void 0;var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"link",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=t?this.textbox.value=t:e!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+e)||""),this.root.setAttribute("data-mode",e)}},{key:"restoreFocus",value:function(){var e=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=e}},{key:"save",value:function(){var e=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var t=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,a.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,a.default.sources.USER)),this.quill.root.scrollTop=t;break;case"video":e=function(e){var t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);if(t)return(t[1]||"https")+"://www.youtube.com/embed/"+t[2]+"?showinfo=0";if(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))return(t[1]||"https")+"://player.vimeo.com/video/"+t[2]+"/";return e}(e);case"formula":if(!e)break;var n=this.quill.getSelection(!0);if(null!=n){var r=n.index+n.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,a.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(r+1," ",a.default.sources.USER),this.quill.setSelection(r+2,a.default.sources.USER)}}this.textbox.value="",this.hide()}}]),t}();function E(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.forEach(function(t){var r=document.createElement("option");t===n?r.setAttribute("selected","selected"):r.setAttribute("value",t),e.appendChild(r)})}t.BaseTooltip=S,t.default=w},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){this.head=this.tail=null,this.length=0}return e.prototype.append=function(){for(var e=[],t=0;t1&&this.append.apply(this,e.slice(1))},e.prototype.contains=function(e){for(var t,n=this.iterator();t=n();)if(t===e)return!0;return!1},e.prototype.insertBefore=function(e,t){e&&(e.next=t,null!=t?(e.prev=t.prev,null!=t.prev&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):null!=this.tail?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)},e.prototype.offset=function(e){for(var t=0,n=this.head;null!=n;){if(n===e)return t;t+=n.length(),n=n.next}return-1},e.prototype.remove=function(e){this.contains(e)&&(null!=e.prev&&(e.prev.next=e.next),null!=e.next&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)},e.prototype.iterator=function(e){return void 0===e&&(e=this.head),function(){var t=e;return null!=e&&(e=e.next),t}},e.prototype.find=function(e,t){void 0===t&&(t=!1);for(var n,r=this.iterator();n=r();){var i=n.length();if(ea?n(r,e-a,Math.min(t,a+l-e)):n(r,0,Math.min(l,e+t-a)),a+=l}},e.prototype.map=function(e){return this.reduce(function(t,n){return t.push(e(n)),t},[])},e.prototype.reduce=function(e,t){for(var n,r=this.iterator();n=r();)t=e(t,n);return t},e}();t.default=r},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(17),o=n(1),a={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},s=function(e){function t(t){var n=e.call(this,t)||this;return n.scroll=n,n.observer=new MutationObserver(function(e){n.update(e)}),n.observer.observe(n.domNode,a),n.attach(),n}return r(t,e),t.prototype.detach=function(){e.prototype.detach.call(this),this.observer.disconnect()},t.prototype.deleteAt=function(t,n){this.update(),0===t&&n===this.length()?this.children.forEach(function(e){e.remove()}):e.prototype.deleteAt.call(this,t,n)},t.prototype.formatAt=function(t,n,r,i){this.update(),e.prototype.formatAt.call(this,t,n,r,i)},t.prototype.insertAt=function(t,n,r){this.update(),e.prototype.insertAt.call(this,t,n,r)},t.prototype.optimize=function(t,n){var r=this;void 0===t&&(t=[]),void 0===n&&(n={}),e.prototype.optimize.call(this,n);for(var a=[].slice.call(this.observer.takeRecords());a.length>0;)t.push(a.pop());for(var s=function e(t,n){void 0===n&&(n=!0),null!=t&&t!==r&&null!=t.domNode.parentNode&&(null==t.domNode[o.DATA_KEY].mutations&&(t.domNode[o.DATA_KEY].mutations=[]),n&&e(t.parent))},l=function e(t){null!=t.domNode[o.DATA_KEY]&&null!=t.domNode[o.DATA_KEY].mutations&&(t instanceof i.default&&t.children.forEach(e),t.optimize(n))},c=t,u=0;c.length>0;u+=1){if(u>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(c.forEach(function(e){var t=o.find(e.target,!0);null!=t&&(t.domNode===e.target&&("childList"===e.type?(s(o.find(e.previousSibling,!1)),[].forEach.call(e.addedNodes,function(e){var t=o.find(e,!1);s(t,!1),t instanceof i.default&&t.children.forEach(function(e){s(e,!1)})})):"attributes"===e.type&&s(t.prev)),s(t))}),this.children.forEach(l),a=(c=[].slice.call(this.observer.takeRecords())).slice();a.length>0;)t.push(a.pop())}},t.prototype.update=function(t,n){var r=this;void 0===n&&(n={}),(t=t||this.observer.takeRecords()).map(function(e){var t=o.find(e.target,!0);return null==t?null:null==t.domNode[o.DATA_KEY].mutations?(t.domNode[o.DATA_KEY].mutations=[e],t):(t.domNode[o.DATA_KEY].mutations.push(e),null)}).forEach(function(e){null!=e&&e!==r&&null!=e.domNode[o.DATA_KEY]&&e.update(e.domNode[o.DATA_KEY].mutations||[],n)}),null!=this.domNode[o.DATA_KEY].mutations&&e.prototype.update.call(this,this.domNode[o.DATA_KEY].mutations,n),this.optimize(t,n)},t.blotName="scroll",t.defaultChild="block",t.scope=o.Scope.BLOCK_BLOT,t.tagName="DIV",t}(i.default);t.default=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),o=n(1);var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.formats=function(n){if(n.tagName!==t.tagName)return e.formats.call(this,n)},t.prototype.format=function(n,r){var o=this;n!==this.statics.blotName||r?e.prototype.format.call(this,n,r):(this.children.forEach(function(e){e instanceof i.default||(e=e.wrap(t.blotName,!0)),o.attributes.copy(e)}),this.unwrap())},t.prototype.formatAt=function(t,n,r,i){null!=this.formats()[r]||o.query(r,o.Scope.ATTRIBUTE)?this.isolate(t,n).format(r,i):e.prototype.formatAt.call(this,t,n,r,i)},t.prototype.optimize=function(n){e.prototype.optimize.call(this,n);var r=this.formats();if(0===Object.keys(r).length)return this.unwrap();var i=this.next;i instanceof t&&i.prev===this&&function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(e[n]!==t[n])return!1;return!0}(r,i.formats())&&(i.moveChildren(this),i.remove())},t.blotName="inline",t.scope=o.Scope.INLINE_BLOT,t.tagName="SPAN",t}(i.default);t.default=a},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),o=n(1),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.formats=function(n){var r=o.query(t.blotName).tagName;if(n.tagName!==r)return e.formats.call(this,n)},t.prototype.format=function(n,r){null!=o.query(n,o.Scope.BLOCK)&&(n!==this.statics.blotName||r?e.prototype.format.call(this,n,r):this.replaceWith(t.blotName))},t.prototype.formatAt=function(t,n,r,i){null!=o.query(r,o.Scope.BLOCK)?this.format(r,i):e.prototype.formatAt.call(this,t,n,r,i)},t.prototype.insertAt=function(t,n,r){if(null==r||null!=o.query(n,o.Scope.INLINE))e.prototype.insertAt.call(this,t,n,r);else{var i=this.split(t),a=o.create(n,r);i.parent.insertBefore(a,i)}},t.prototype.update=function(t,n){navigator.userAgent.match(/Trident/)?this.build():e.prototype.update.call(this,t,n)},t.blotName="block",t.scope=o.Scope.BLOCK_BLOT,t.tagName="P",t}(i.default);t.default=a},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.formats=function(e){},t.prototype.format=function(t,n){e.prototype.formatAt.call(this,0,this.length(),t,n)},t.prototype.formatAt=function(t,n,r,i){0===t&&n===this.length()?this.format(r,i):e.prototype.formatAt.call(this,t,n,r,i)},t.prototype.formats=function(){return this.statics.formats(this.domNode)},t}(n(19).default);t.default=i},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=n(19),o=n(1),a=function(e){function t(t){var n=e.call(this,t)||this;return n.text=n.statics.value(n.domNode),n}return r(t,e),t.create=function(e){return document.createTextNode(e)},t.value=function(e){var t=e.data;return t.normalize&&(t=t.normalize()),t},t.prototype.deleteAt=function(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)},t.prototype.index=function(e,t){return this.domNode===e?t:-1},t.prototype.insertAt=function(t,n,r){null==r?(this.text=this.text.slice(0,t)+n+this.text.slice(t),this.domNode.data=this.text):e.prototype.insertAt.call(this,t,n,r)},t.prototype.length=function(){return this.text.length},t.prototype.optimize=function(n){e.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof t&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},t.prototype.position=function(e,t){return void 0===t&&(t=!1),[this.domNode,e]},t.prototype.split=function(e,t){if(void 0===t&&(t=!1),!t){if(0===e)return this;if(e===this.length())return this.next}var n=o.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},t.prototype.update=function(e,t){var n=this;e.some(function(e){return"characterData"===e.type&&e.target===n.domNode})&&(this.text=this.statics.value(this.domNode))},t.prototype.value=function(){return this.text},t.blotName="text",t.scope=o.Scope.INLINE_BLOT,t}(i.default);t.default=a},function(e,t,n){"use strict";var r=document.createElement("div");if(r.classList.toggle("test-class",!1),r.classList.contains("test-class")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return arguments.length>1&&!this.contains(e)===!t?t:i.call(this,e)}}String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.substr(t,e.length)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){var n=this.toString();("number"!==typeof t||!isFinite(t)||Math.floor(t)!==t||t>n.length)&&(t=n.length),t-=e.length;var r=n.indexOf(e,t);return-1!==r&&r===t}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!==typeof e)throw new TypeError("predicate must be a function");for(var t,n=Object(this),r=n.length>>>0,i=arguments[1],o=0;ot.length?e:t,h=e.length>t.length?t:e,p=u.indexOf(h);if(-1!=p)return c=[[r,u.substring(0,p)],[i,h],[r,u.substring(p+h.length)]],e.length>t.length&&(c[0][0]=c[2][0]=n),c;if(1==h.length)return[[n,e],[r,t]];var d=function(e,t){var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length=e.length?[r,i,o,a,h]:null}var o,a,c,u,h,p=i(n,r,Math.ceil(n.length/4)),d=i(n,r,Math.ceil(n.length/2));if(!p&&!d)return null;o=d?p&&p[4].length>d[4].length?p:d:p;e.length>t.length?(a=o[0],c=o[1],u=o[2],h=o[3]):(u=o[0],h=o[1],a=o[2],c=o[3]);var f=o[4];return[a,c,u,h,f]}(e,t);if(d){var f=d[0],m=d[1],g=d[2],v=d[3],b=d[4],y=o(f,g),_=o(m,v);return y.concat([[i,b]],_)}return function(e,t){for(var i=e.length,o=t.length,s=Math.ceil((i+o)/2),l=s,c=2*s,u=new Array(c),h=new Array(c),p=0;pi)g+=2;else if(w>o)m+=2;else if(f){var S=l+d-_;if(S>=0&&S=E)return a(e,t,k,w)}}}for(var C=-y+v;C<=y-b;C+=2){for(var S=l+C,T=(E=C==-y||C!=y&&h[S-1]i)b+=2;else if(T>o)v+=2;else if(!f){var x=l+d-C;if(x>=0&&x=(E=i-E))return a(e,t,k,w)}}}}return[[n,e],[r,t]]}(e,t)}(e=e.substring(0,e.length-h),t=t.substring(0,t.length-h));return p&&f.unshift([i,p]),d&&f.push([i,d]),function e(t){t.push([i,""]);var o=0;var a=0;var c=0;var u="";var h="";var p;for(;o1?(0!==a&&0!==c&&(0!==(p=s(h,u))&&(o-a-c>0&&t[o-a-c-1][0]==i?t[o-a-c-1][1]+=h.substring(0,p):(t.splice(0,0,[i,h.substring(0,p)]),o++),h=h.substring(p),u=u.substring(p)),0!==(p=l(h,u))&&(t[o][1]=h.substring(h.length-p)+t[o][1],h=h.substring(0,h.length-p),u=u.substring(0,u.length-p))),0===a?t.splice(o-c,a+c,[r,h]):0===c?t.splice(o-a,a+c,[n,u]):t.splice(o-a-c,a+c,[n,u],[r,h]),o=o-a-c+(a?1:0)+(c?1:0)+1):0!==o&&t[o-1][0]==i?(t[o-1][1]+=t[o][1],t.splice(o,1)):o++,c=0,a=0,u="",h=""}""===t[t.length-1][1]&&t.pop();var d=!1;o=1;for(;o0&&o.splice(a+2,0,[l[0],c]),u(o,a,3)}return e}(f,c)),f=function(e){for(var t=!1,o=function(e){return e.charCodeAt(0)>=56320&&e.charCodeAt(0)<=57343},a=function(e){return e.charCodeAt(e.length-1)>=55296&&e.charCodeAt(e.length-1)<=56319},s=2;s0&&l.push(e[s]);return l}(f)}function a(e,t,n,r){var i=e.substring(0,n),a=t.substring(0,r),s=e.substring(n),l=t.substring(r),c=o(i,a),u=o(s,l);return c.concat(u)}function s(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,o=0;n=0&&r>=t-1;r--)if(r+1=700)&&(n.bold=!0);Object.keys(n).length>0&&(t=k(t,n));parseFloat(r.textIndent||0)>0&&(t=(new s.default).insert("\t").concat(t));return t}],["li",function(e,t){var n=l.default.query(e);if(null==n||"list-item"!==n.blotName||!O(t,"\n"))return t;var r=-1,i=e.parentNode;for(;!i.classList.contains("ql-clipboard");)"list"===(l.default.query(i)||{}).blotName&&(r+=1),i=i.parentNode;return r<=0?t:t.compose((new s.default).retain(t.length()-1).retain(1,{indent:r}))}],["b",P.bind(P,"bold")],["i",P.bind(P,"italic")],["style",function(){return new s.default}]],E=[p.AlignAttribute,g.DirectionAttribute].reduce(function(e,t){return e[t.keyName]=t,e},{}),C=[p.AlignStyle,d.BackgroundStyle,m.ColorStyle,g.DirectionStyle,v.FontStyle,b.SizeStyle].reduce(function(e,t){return e[t.keyName]=t,e},{}),T=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.quill.root.addEventListener("paste",r.onPaste.bind(r)),r.container=r.quill.addContainer("ql-clipboard"),r.container.setAttribute("contenteditable",!0),r.container.setAttribute("tabindex",-1),r.matchers=[],S.concat(r.options.matchers).forEach(function(e){var t=i(e,2),o=t[0],a=t[1];(n.matchVisual||a!==L)&&r.addMatcher(o,a)}),r}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,h.default),o(t,[{key:"addMatcher",value:function(e,t){this.matchers.push([e,t])}},{key:"convert",value:function(e){if("string"===typeof e)return this.container.innerHTML=e.replace(/\>\r?\n +\<"),this.convert();var t=this.quill.getFormat(this.quill.selection.savedRange.index);if(t[f.default.blotName]){var n=this.container.innerText;return this.container.innerHTML="",(new s.default).insert(n,_({},f.default.blotName,t[f.default.blotName]))}var r=this.prepareMatching(),o=i(r,2),a=o[0],l=o[1],c=function e(t,n,r){return t.nodeType===t.TEXT_NODE?r.reduce(function(e,n){return n(t,e)},new s.default):t.nodeType===t.ELEMENT_NODE?[].reduce.call(t.childNodes||[],function(i,o){var a=e(o,n,r);return o.nodeType===t.ELEMENT_NODE&&(a=n.reduce(function(e,t){return t(o,e)},a),a=(o[w]||[]).reduce(function(e,t){return t(o,e)},a)),i.concat(a)},new s.default):new s.default}(this.container,a,l);return O(c,"\n")&&null==c.ops[c.ops.length-1].attributes&&(c=c.compose((new s.default).retain(c.length()-1).delete(1))),x.log("convert",this.container.innerHTML,c),this.container.innerHTML="",c}},{key:"dangerouslyPasteHTML",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c.default.sources.API;if("string"===typeof e)this.quill.setContents(this.convert(e),t),this.quill.setSelection(0,c.default.sources.SILENT);else{var r=this.convert(t);this.quill.updateContents((new s.default).retain(e).concat(r),n),this.quill.setSelection(e+r.length(),c.default.sources.SILENT)}}},{key:"onPaste",value:function(e){var t=this;if(!e.defaultPrevented&&this.quill.isEnabled()){var n=this.quill.getSelection(),r=(new s.default).retain(n.index),i=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(c.default.sources.SILENT),setTimeout(function(){r=r.concat(t.convert()).delete(n.length),t.quill.updateContents(r,c.default.sources.USER),t.quill.setSelection(r.length()-n.length,c.default.sources.SILENT),t.quill.scrollingContainer.scrollTop=i,t.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var e=this,t=[],n=[];return this.matchers.forEach(function(r){var o=i(r,2),a=o[0],s=o[1];switch(a){case Node.TEXT_NODE:n.push(s);break;case Node.ELEMENT_NODE:t.push(s);break;default:[].forEach.call(e.container.querySelectorAll(a),function(e){e[w]=e[w]||[],e[w].push(s)})}}),[t,n]}}]),t}();function k(e,t,n){return"object"===("undefined"===typeof t?"undefined":r(t))?Object.keys(t).reduce(function(e,n){return k(e,n,t[n])},e):e.reduce(function(e,r){return r.attributes&&r.attributes[t]?e.push(r):e.insert(r.insert,(0,a.default)({},_({},t,n),r.attributes))},new s.default)}function j(e){if(e.nodeType!==Node.ELEMENT_NODE)return{};return e["__ql-computed-style"]||(e["__ql-computed-style"]=window.getComputedStyle(e))}function O(e,t){for(var n="",r=e.ops.length-1;r>=0&&n.length-1}function P(e,t,n){return k(n,e,!0)}function A(e,t){var n=l.default.Attributor.Attribute.keys(e),r=l.default.Attributor.Class.keys(e),i=l.default.Attributor.Style.keys(e),o={};return n.concat(r).concat(i).forEach(function(t){var n=l.default.query(t,l.default.Scope.ATTRIBUTE);null!=n&&(o[n.attrName]=n.value(e),o[n.attrName])||(null==(n=E[t])||n.attrName!==t&&n.keyName!==t||(o[n.attrName]=n.value(e)||void 0),null==(n=C[t])||n.attrName!==t&&n.keyName!==t||(n=C[t],o[n.attrName]=n.value(e)||void 0))}),Object.keys(o).length>0&&(t=k(t,o)),t}function R(e,t){var n=l.default.query(e);if(null==n)return t;if(n.prototype instanceof l.default.Embed){var r={},i=n.value(e);null!=i&&(r[n.blotName]=i,t=(new s.default).insert(r,n.formats(e)))}else"function"===typeof n.formats&&(t=k(t,n.blotName,n.formats(e)));return t}function I(e,t){return O(t,"\n")||(M(e)||t.length()>0&&e.nextSibling&&M(e.nextSibling))&&t.insert("\n"),t}function L(e,t){if(M(e)&&null!=e.nextElementSibling&&!O(t,"\n\n")){var n=e.offsetHeight+parseFloat(j(e).marginTop)+parseFloat(j(e).marginBottom);e.nextElementSibling.offsetTop>e.offsetTop+1.5*n&&t.insert("\n")}return t}function D(e,t){var n=e.data;if("O:P"===e.parentNode.tagName)return t.insert(n.trim());if(0===n.trim().length&&e.parentNode.classList.contains("ql-clipboard"))return t;if(!j(e.parentNode).whiteSpace.startsWith("pre")){var r=function(e,t){return(t=t.replace(/[^\u00a0]/g,"")).length<1&&e?" ":t};n=(n=n.replace(/\r\n/g," ").replace(/\n/g," ")).replace(/\s\s+/g,r.bind(r,!0)),(null==e.previousSibling&&M(e.parentNode)||null!=e.previousSibling&&M(e.previousSibling))&&(n=n.replace(/^\s+/,r.bind(r,!1))),(null==e.nextSibling&&M(e.parentNode)||null!=e.nextSibling&&M(e.nextSibling))&&(n=n.replace(/\s+$/,r.bind(r,!1)))}return t.insert(n)}T.DEFAULTS={matchers:[],matchVisual:!0},t.default=T,t.matchAttributor=A,t.matchBlot=R,t.matchNewline=I,t.matchSpacing=L,t.matchText=D},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n '},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;nr.right&&(o=r.right-i.right,this.root.style.left=t+o+"px"),i.leftr.bottom){var a=i.bottom-i.top,s=e.bottom-e.top+a;this.root.style.top=n-s+"px",this.root.classList.add("ql-flip")}return o}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),e}();t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0},o=function(){function e(e,t){for(var n=0;n','','',''].join(""),t.default=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=L(n(29)),i=n(36),o=n(38),a=n(64),s=L(n(65)),l=L(n(66)),c=n(67),u=L(c),h=n(37),p=n(26),d=n(39),f=n(40),m=L(n(56)),g=L(n(68)),v=L(n(27)),b=L(n(69)),y=L(n(70)),_=L(n(71)),x=L(n(72)),w=L(n(73)),S=n(13),E=L(S),C=L(n(74)),T=L(n(75)),k=L(n(57)),j=L(n(41)),O=L(n(28)),M=L(n(59)),P=L(n(60)),A=L(n(61)),R=L(n(108)),I=L(n(62));function L(e){return e&&e.__esModule?e:{default:e}}r.default.register({"attributors/attribute/direction":o.DirectionAttribute,"attributors/class/align":i.AlignClass,"attributors/class/background":h.BackgroundClass,"attributors/class/color":p.ColorClass,"attributors/class/direction":o.DirectionClass,"attributors/class/font":d.FontClass,"attributors/class/size":f.SizeClass,"attributors/style/align":i.AlignStyle,"attributors/style/background":h.BackgroundStyle,"attributors/style/color":p.ColorStyle,"attributors/style/direction":o.DirectionStyle,"attributors/style/font":d.FontStyle,"attributors/style/size":f.SizeStyle},!0),r.default.register({"formats/align":i.AlignClass,"formats/direction":o.DirectionClass,"formats/indent":a.IndentClass,"formats/background":h.BackgroundStyle,"formats/color":p.ColorStyle,"formats/font":d.FontClass,"formats/size":f.SizeClass,"formats/blockquote":s.default,"formats/code-block":E.default,"formats/header":l.default,"formats/list":u.default,"formats/bold":m.default,"formats/code":S.Code,"formats/italic":g.default,"formats/link":v.default,"formats/script":b.default,"formats/strike":y.default,"formats/underline":_.default,"formats/image":x.default,"formats/video":w.default,"formats/list/item":c.ListItem,"modules/formula":C.default,"modules/syntax":T.default,"modules/toolbar":k.default,"themes/bubble":R.default,"themes/snow":I.default,"ui/icons":j.default,"ui/picker":O.default,"ui/icon-picker":P.default,"ui/color-picker":M.default,"ui/tooltip":A.default},!0),t.default=r.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IndentClass=void 0;var r,i=function(){function e(e,t){for(var n=0;n0&&this.children.tail.format(e,t)}},{key:"formats",value:function(){return e={},t=this.statics.blotName,n=this.statics.formats(this.domNode),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e;var e,t,n}},{key:"insertBefore",value:function(e,n){if(e instanceof p)i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"insertBefore",this).call(this,e,n);else{var r=null==n?this.length():n.offset(this),o=this.split(r);o.parent.insertBefore(e,o)}}},{key:"optimize",value:function(e){i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"optimize",this).call(this,e);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(n.moveChildren(this),n.remove())}},{key:"replace",value:function(e){if(e.statics.blotName!==this.statics.blotName){var n=o.default.create(this.statics.defaultChild);e.moveChildren(n),this.appendChild(n)}i(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"replace",this).call(this,e)}}]),t}();d.blotName="list",d.scope=o.default.Scope.BLOCK_BLOT,d.tagName=["OL","UL"],d.defaultChild="list-item",d.allowedChildren=[p],t.ListItem=p,t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(56),o=(r=i)&&r.__esModule?r:{default:r};var a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default),t}();a.blotName="italic",a.tagName=["EM","I"],t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n)}}],[{key:"create",value:function(e){var n=o(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return"string"===typeof e&&n.setAttribute("src",this.sanitize(e)),n}},{key:"formats",value:function(e){return c.reduce(function(t,n){return e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t},{})}},{key:"match",value:function(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}},{key:"sanitize",value:function(e){return(0,l.sanitize)(e,["http","https","data"])?e:"//:0"}},{key:"value",value:function(e){return e.getAttribute("src")}}]),t}();u.blotName="image",u.tagName="IMG",t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):o(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"format",this).call(this,e,n)}}],[{key:"create",value:function(e){var n=o(t.__proto__||Object.getPrototypeOf(t),"create",this).call(this,e);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(e)),n}},{key:"formats",value:function(e){return c.reduce(function(t,n){return e.hasAttribute(n)&&(t[n]=e.getAttribute(n)),t},{})}},{key:"sanitize",value:function(e){return l.default.sanitize(e)}},{key:"value",value:function(e){return e.getAttribute("src")}}]),t}();u.blotName="video",u.className="ql-video",u.tagName="IFRAME",t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.FormulaBlot=void 0;var r=function(){function e(e,t){for(var n=0;n0||null==this.cachedText)&&(this.domNode.innerHTML=e(t),this.domNode.normalize(),this.attach()),this.cachedText=t)}}]),t}();p.className="ql-syntax";var d=new i.default.Attributor.Class("token","hljs",{scope:i.default.Scope.INLINE}),f=function(e){function t(e,n){c(this,t);var r=u(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));if("function"!==typeof r.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var i=null;return r.quill.on(o.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(i),i=setTimeout(function(){r.highlight(),i=null},r.options.interval)}),r.highlight(),r}return h(t,a.default),r(t,null,[{key:"register",value:function(){o.default.register(d,!0),o.default.register(p,!0)}}]),r(t,[{key:"highlight",value:function(){var e=this;if(!this.quill.selection.composing){this.quill.update(o.default.sources.USER);var t=this.quill.getSelection();this.quill.scroll.descendants(p).forEach(function(t){t.highlight(e.options.highlight)}),this.quill.update(o.default.sources.SILENT),null!=t&&this.quill.setSelection(t,o.default.sources.SILENT)}}}]),t}();f.DEFAULTS={highlight:null==window.hljs?null:function(e){return window.hljs.highlightAuto(e).value},interval:1e3},t.CodeBlock=p,t.CodeToken=d,t.default=f},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t){e.exports=' '},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.BubbleTooltip=void 0;var r=function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0},i=function(){function e(e,t){for(var n=0;n0&&i===a.default.sources.USER){r.show(),r.root.style.left="0px",r.root.style.width="",r.root.style.width=r.root.offsetWidth+"px";var o=r.quill.getLines(t.index,t.length);if(1===o.length)r.position(r.quill.getBounds(t));else{var s=o[o.length-1],l=r.quill.getIndex(s),u=Math.min(s.length()-1,t.index+t.length-l),h=r.quill.getBounds(new c.Range(l,u));r.position(h)}}else document.activeElement!==r.textbox&&r.quill.hasFocus()&&r.hide()}),r}return f(t,s.BaseTooltip),i(t,[{key:"listen",value:function(){var e=this;r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){e.root.classList.remove("ql-editing")}),this.quill.on(a.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!e.root.classList.contains("ql-hidden")){var t=e.quill.getSelection();null!=t&&e.position(e.quill.getBounds(t))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(e){var n=r(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"position",this).call(this,e),i=this.root.querySelector(".ql-tooltip-arrow");if(i.style.marginLeft="",0===n)return n;i.style.marginLeft=-1*n-i.offsetWidth/2+"px"}}]),t}();v.TEMPLATE=['','
','','',"
"].join(""),t.BubbleTooltip=v,t.default=g},function(e,t,n){e.exports=n(63)}]).default},e.exports=n()}).call(this,n(107).Buffer)},function(e,t){e.exports=function(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!==typeof e||!e||"object"!==typeof t||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;lr&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0l.charCodeAt(8))break;case 115:a=a.replace(l,"-webkit-"+l)+";"+a;break;case 207:case 102:a=a.replace(l,"-webkit-"+(102s.charCodeAt(0)&&(s=s.trim()),s=[s],0d)&&(B=(H=H.replace(" ",":")).length),01&&void 0!==arguments[1]?arguments[1]:{};return Object(i.a)(e,Object(r.a)({defaultTheme:o.a},t))}},function(e,t,n){"use strict";var r=n(55);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(0)),o=(0,r(n(65)).default)(i.default.createElement("path",{d:"M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"}),"FavoriteBorder");t.default=o},function(e,t,n){"use strict";var r=n(55);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(0)),o=(0,r(n(65)).default)(i.default.createElement("path",{d:"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"}),"Favorite");t.default=o},function(e,t,n){"use strict";var r=n(55);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(0)),o=(0,r(n(65)).default)(i.default.createElement("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}),"Menu");t.default=o},function(e,t,n){"use strict";var r=n(55);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(0)),o=(0,r(n(65)).default)(i.default.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft");t.default=o},function(e,t,n){"use strict";var r=n(55);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(0)),o=(0,r(n(65)).default)(i.default.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");t.default=o},function(e,t,n){"use strict";var r=n(40).compose;t.__esModule=!0,t.composeWithDevTools="undefined"!==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"===typeof arguments[0]?r:r.apply(null,arguments)},t.devToolsEnhancer="undefined"!==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}}},function(e,t,n){"use strict";var r=n(33),i=n(8),o=n(216),a=n(1),s=["xs","sm","md","lg","xl"];function l(e,t,n){var i;return Object(a.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(a.a)({paddingLeft:t(2),paddingRight:t(2)},n,Object(r.a)({},e.up("sm"),Object(a.a)({paddingLeft:t(3),paddingRight:t(3)},n[e.up("sm")])))},toolbar:(i={minHeight:56},Object(r.a)(i,"".concat(e.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(i,e.up("sm"),{minHeight:64}),i)},n)}var c={black:"#000",white:"#fff"},u={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},h={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},p={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},d=n(85),f={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},m={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},g={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},v=n(21),b={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:c.white,default:u[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)"}},y={text:{primary:c.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:u[800],default:"#303030"},action:{active:c.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)"}};function _(e,t,n,r){e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Object(v.d)(e.main,r):"dark"===t&&(e.dark=Object(v.a)(e.main,1.5*r)))}function x(e){return Math.round(1e5*e)/1e5}var w={textTransform:"uppercase"},S='"Roboto", "Helvetica", "Arial", sans-serif';function E(e,t){var n="function"===typeof t?t(e):t,r=n.fontFamily,s=void 0===r?S:r,l=n.fontSize,c=void 0===l?14:l,u=n.fontWeightLight,h=void 0===u?300:u,p=n.fontWeightRegular,d=void 0===p?400:p,f=n.fontWeightMedium,m=void 0===f?500:f,g=n.fontWeightBold,v=void 0===g?700:g,b=n.htmlFontSize,y=void 0===b?16:b,_=n.allVariants,E=n.pxToRem,C=Object(i.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var T=c/14,k=E||function(e){return"".concat(e/y*T,"rem")},j=function(e,t,n,r,i){return Object(a.a)({fontFamily:s,fontWeight:e,fontSize:k(t),lineHeight:n},s===S?{letterSpacing:"".concat(x(r/t),"em")}:{},{},i,{},_)},O={h1:j(h,96,1.167,-1.5),h2:j(h,60,1.2,-.5),h3:j(d,48,1.167,0),h4:j(d,34,1.235,.25),h5:j(d,24,1.334,0),h6:j(m,20,1.6,.15),subtitle1:j(d,16,1.75,.15),subtitle2:j(m,14,1.57,.1),body1:j(d,16,1.5,.15),body2:j(d,14,1.43,.15),button:j(m,14,1.75,.4,w),caption:j(d,12,1.66,.4),overline:j(d,12,2.66,1,w)};return Object(o.a)(Object(a.a)({htmlFontSize:y,pxToRem:k,round:x,fontFamily:s,fontSize:c,fontWeightLight:h,fontWeightRegular:d,fontWeightMedium:m,fontWeightBold:v},O),C,{clone:!1})}var C=.2,T=.14,k=.12;function j(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(C,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(T,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(k,")")].join(",")}var O=["none",j(0,2,1,-1,0,1,1,0,0,1,3,0),j(0,3,1,-2,0,2,2,0,0,1,5,0),j(0,3,3,-2,0,3,4,0,0,1,8,0),j(0,2,4,-1,0,4,5,0,0,1,10,0),j(0,3,5,-1,0,5,8,0,0,1,14,0),j(0,3,5,-1,0,6,10,0,0,1,18,0),j(0,4,5,-2,0,7,10,1,0,2,16,1),j(0,5,5,-3,0,8,10,1,0,3,14,2),j(0,5,6,-3,0,9,12,1,0,3,16,2),j(0,6,6,-3,0,10,14,1,0,4,18,3),j(0,6,7,-4,0,11,15,1,0,4,20,3),j(0,7,8,-4,0,12,17,2,0,5,22,4),j(0,7,8,-4,0,13,19,2,0,5,24,4),j(0,7,9,-4,0,14,21,2,0,5,26,4),j(0,8,9,-5,0,15,22,2,0,6,28,5),j(0,8,10,-5,0,16,24,2,0,6,30,5),j(0,8,11,-5,0,17,26,2,0,6,32,5),j(0,9,11,-5,0,18,28,2,0,7,34,6),j(0,9,12,-6,0,19,29,2,0,7,36,6),j(0,10,13,-6,0,20,31,3,0,8,38,7),j(0,10,13,-6,0,21,33,3,0,8,40,7),j(0,10,14,-6,0,22,35,3,0,8,42,7),j(0,11,14,-7,0,23,36,3,0,9,44,8),j(0,11,15,-7,0,24,38,3,0,9,46,8)],M={borderRadius:4};var P=n(39),A=n(81);t.a=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,n=void 0===t?{}:t,r=e.mixins,x=void 0===r?{}:r,w=e.palette,S=void 0===w?{}:w,C=e.spacing,T=e.typography,k=void 0===T?{}:T,j=Object(i.a)(e,["breakpoints","mixins","palette","spacing","typography"]),R=function(e){var t=e.primary,n=void 0===t?{light:h[300],main:h[500],dark:h[700]}:t,r=e.secondary,s=void 0===r?{light:p.A200,main:p.A400,dark:p.A700}:r,l=e.error,x=void 0===l?{light:d.a[300],main:d.a[500],dark:d.a[700]}:l,w=e.warning,S=void 0===w?{light:f[300],main:f[500],dark:f[700]}:w,E=e.info,C=void 0===E?{light:m[300],main:m[500],dark:m[700]}:E,T=e.success,k=void 0===T?{light:g[300],main:g[500],dark:g[700]}:T,j=e.type,O=void 0===j?"light":j,M=e.contrastThreshold,P=void 0===M?3:M,A=e.tonalOffset,R=void 0===A?.2:A,I=Object(i.a)(e,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function L(e){if(!e)throw new TypeError("Material-UI: missing background argument in getContrastText(".concat(e,")."));return Object(v.c)(e,y.text.primary)>=P?y.text.primary:b.text.primary}function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;return!(e=Object(a.a)({},e)).main&&e[t]&&(e.main=e[t]),_(e,"light",n,R),_(e,"dark",r,R),e.contrastText||(e.contrastText=L(e.main)),e}var N={dark:y,light:b};return Object(o.a)(Object(a.a)({common:c,type:O,primary:D(n),secondary:D(s,"A400","A200","A700"),error:D(x),warning:D(S),info:D(C),success:D(k),grey:u,contrastThreshold:P,getContrastText:L,augmentColor:D,tonalOffset:R},N[O]),I)}(S),I=function(e){var t=e.values,n=void 0===t?{xs:0,sm:600,md:960,lg:1280,xl:1920}:t,r=e.unit,o=void 0===r?"px":r,l=e.step,c=void 0===l?5:l,u=Object(i.a)(e,["values","unit","step"]);function h(e){var t="number"===typeof n[e]?n[e]:e;return"@media (min-width:".concat(t).concat(o,")")}function p(e,t){var r=s.indexOf(t);return r===s.length-1?h(e):"@media (min-width:".concat("number"===typeof n[e]?n[e]:e).concat(o,") and ")+"(max-width:".concat((-1!==r&&"number"===typeof n[s[r+1]]?n[s[r+1]]:t)-c/100).concat(o,")")}return Object(a.a)({keys:s,values:n,up:h,down:function(e){var t=s.indexOf(e)+1,r=n[s[t]];return t===s.length?h("xs"):"@media (max-width:".concat(("number"===typeof r&&t>0?r:e)-c/100).concat(o,")")},between:p,only:function(e){return p(e,e)},width:function(e){return n[e]}},u)}(n),L=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(t.mui)return t;e="function"===typeof t?t:function(e){return t*e};var n=function(){for(var t=arguments.length,n=new Array(t),r=0;r1?N-1:0),B=1;B2?f-2:0),v=2;v=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";n.d(t,"a",function(){return a});var r=n(0),i=n.n(r),o=n(79);function a(){return i.a.useContext(o.a)}},function(e,t,n){"use strict";var r=n(1),i=n(8),o=n(0),a=n.n(o),s=(n(12),n(22)),l=n.n(s),c=n(9),u=n(25),h=n(44),p=n(13),d="undefined"!==typeof window?a.a.useLayoutEffect:a.a.useEffect;var f=function(e){var t=e.children,n=e.defer,r=void 0!==n&&n,i=e.fallback,o=void 0===i?null:i,s=a.a.useState(!1),l=s[0],c=s[1];return d(function(){r||c(!0)},[r]),a.a.useEffect(function(){r&&c(!0)},[r]),a.a.createElement(a.a.Fragment,null,l?t:o)},m=!0,g=!1,v=null,b={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function y(e){e.metaKey||e.altKey||e.ctrlKey||(m=!0)}function _(){m=!1}function x(){"hidden"===this.visibilityState&&g&&(m=!0)}function w(e){var t=e.target;try{return t.matches(":focus-visible")}catch(n){}return m||function(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!b[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}function S(){g=!0,window.clearTimeout(v),v=window.setTimeout(function(){g=!1},100)}function E(){return{isFocusVisible:w,onBlurVisible:S,ref:a.a.useCallback(function(e){var t,n=l.a.findDOMNode(e);null!=n&&((t=n.ownerDocument).addEventListener("keydown",y,!0),t.addEventListener("mousedown",_,!0),t.addEventListener("pointerdown",_,!0),t.addEventListener("touchstart",_,!0),t.addEventListener("visibilitychange",x,!0))},[])}}var C=n(58),T=n(16),k=n(26),j=n(62),O=n(54);function M(e,t){var n=Object.create(null);return e&&o.Children.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&Object(o.isValidElement)(e)?t(e):e}(e)}),n}function P(e,t,n){return null!=n[t]?n[t]:e.props[t]}function A(e,t,n){var r=M(e.children),i=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,i=Object.create(null),o=[];for(var a in e)a in t?o.length&&(i[a]=o,o=[]):o.push(a);var s={};for(var l in t){if(i[l])for(r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t.pulsate,i=void 0!==r&&r,a=t.center,s=void 0===a?o||t.pulsate:a,l=t.fakeElement,c=void 0!==l&&l;if("mousedown"===e.type&&g.current)g.current=!1;else{"touchstart"===e.type&&(g.current=!0);var u,h,p,d=c?null:y.current,f=d?d.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(s||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)u=Math.round(f.width/2),h=Math.round(f.height/2);else{var m=e.clientX?e.clientX:e.touches[0].clientX,x=e.clientY?e.clientY:e.touches[0].clientY;u=Math.round(m-f.left),h=Math.round(x-f.top)}if(s)(p=Math.sqrt((2*Math.pow(f.width,2)+Math.pow(f.height,2))/3))%2===0&&(p+=1);else{var w=2*Math.max(Math.abs((d?d.clientWidth:0)-u),u)+2,S=2*Math.max(Math.abs((d?d.clientHeight:0)-h),h)+2;p=Math.sqrt(Math.pow(w,2)+Math.pow(S,2))}e.touches?null===b.current&&(b.current=function(){_({pulsate:i,rippleX:u,rippleY:h,rippleSize:p,cb:n})},v.current=setTimeout(function(){b.current&&(b.current(),b.current=null)},80)):_({pulsate:i,rippleX:u,rippleY:h,rippleSize:p,cb:n})}},[o,_]),w=a.a.useCallback(function(){x({},{pulsate:!0})},[x]),S=a.a.useCallback(function(e,t){if(clearTimeout(v.current),"touchend"===e.type&&b.current)return e.persist(),b.current(),b.current=null,void(v.current=setTimeout(function(){S(e,t)}));b.current=null,d(function(e){return e.length>0?e.slice(1):e}),m.current=t},[]);return a.a.useImperativeHandle(t,function(){return{pulsate:w,start:x,stop:S}},[w,x,S]),a.a.createElement("span",Object(r.a)({className:Object(c.a)(s.root,l),ref:y},u),a.a.createElement(L,{component:null,exit:!0},p))});var B,z=Object(p.a)(function(e){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(e.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(e.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(e.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}},{flip:!1,name:"MuiTouchRipple"})(((B=a.a.memo(F)).muiName="MuiTouchRipple",B)),U=a.a.forwardRef(function(e,t){var n=e.action,o=e.buttonRef,s=e.centerRipple,p=void 0!==s&&s,d=e.children,m=e.classes,g=e.className,v=e.component,b=void 0===v?"button":v,y=e.disabled,_=void 0!==y&&y,x=e.disableRipple,w=void 0!==x&&x,S=e.disableTouchRipple,C=void 0!==S&&S,T=e.focusRipple,k=void 0!==T&&T,j=e.focusVisibleClassName,O=e.onBlur,M=e.onClick,P=e.onFocus,A=e.onFocusVisible,R=e.onKeyDown,I=e.onKeyUp,L=e.onMouseDown,D=e.onMouseLeave,N=e.onMouseUp,F=e.onTouchEnd,B=e.onTouchMove,U=e.onTouchStart,H=e.onDragLeave,q=e.tabIndex,G=void 0===q?0:q,V=e.TouchRippleProps,W=e.type,X=void 0===W?"button":W,Y=Object(i.a)(e,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),J=a.a.useRef(null);var K=a.a.useRef(null),$=a.a.useState(!1),Z=$[0],Q=$[1];_&&Z&&Q(!1);var ee=E(),te=ee.isFocusVisible,ne=ee.onBlurVisible,re=ee.ref;function ie(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:C;return Object(h.a)(function(r){return t&&t(r),!n&&K.current&&K.current[e](r),!0})}a.a.useImperativeHandle(n,function(){return{focusVisible:function(){Q(!0),J.current.focus()}}},[]),a.a.useEffect(function(){Z&&k&&!w&&K.current.pulsate()},[w,k,Z]);var oe=ie("start",L),ae=ie("stop",H),se=ie("stop",N),le=ie("stop",function(e){Z&&e.preventDefault(),D&&D(e)}),ce=ie("start",U),ue=ie("stop",F),he=ie("stop",B),pe=ie("stop",function(e){Z&&(ne(e),Q(!1)),O&&O(e)},!1),de=Object(h.a)(function(e){_||(J.current||(J.current=e.currentTarget),te(e)&&(Q(!0),A&&A(e)),P&&P(e))}),fe=function(){var e=l.a.findDOMNode(J.current);return b&&"button"!==b&&!("A"===e.tagName&&e.href)},me=a.a.useRef(!1),ge=Object(h.a)(function(e){k&&!me.current&&Z&&K.current&&" "===e.key&&(me.current=!0,e.persist(),K.current.stop(e,function(){K.current.start(e)})),R&&R(e),e.target===e.currentTarget&&fe()&&"Enter"===e.key&&(e.preventDefault(),M&&M(e))}),ve=Object(h.a)(function(e){k&&" "===e.key&&K.current&&Z&&!e.defaultPrevented&&(me.current=!1,e.persist(),K.current.stop(e,function(){K.current.pulsate(e)})),I&&I(e),e.target===e.currentTarget&&fe()&&" "===e.key&&!e.defaultPrevented&&(e.preventDefault(),M&&M(e))}),be=b;"button"===be&&Y.href&&(be="a");var ye={};"button"===be?(ye.type=X,ye.disabled=_):("a"===be&&Y.href||(ye.role="button"),ye["aria-disabled"]=_);var _e=Object(u.a)(o,t),xe=Object(u.a)(re,J),we=Object(u.a)(_e,xe);return a.a.createElement(be,Object(r.a)({className:Object(c.a)(m.root,g,Z&&[m.focusVisible,j],_&&m.disabled),onBlur:pe,onClick:M,onFocus:de,onKeyDown:ge,onKeyUp:ve,onMouseDown:oe,onMouseLeave:le,onMouseUp:se,onDragLeave:ae,onTouchEnd:ue,onTouchMove:he,onTouchStart:ce,ref:we,tabIndex:_?-1:G},ye,Y),d,w||_?null:a.a.createElement(f,null,a.a.createElement(z,Object(r.a)({ref:K,center:p},V))))});t.a=Object(p.a)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(U)},,,,,,,,,,,,,function(e,t,n){"use strict";var r=n(88),i="function"===typeof Symbol&&Symbol.for,o=i?Symbol.for("react.element"):60103,a=i?Symbol.for("react.portal"):60106,s=i?Symbol.for("react.fragment"):60107,l=i?Symbol.for("react.strict_mode"):60108,c=i?Symbol.for("react.profiler"):60114,u=i?Symbol.for("react.provider"):60109,h=i?Symbol.for("react.context"):60110,p=i?Symbol.for("react.forward_ref"):60112,d=i?Symbol.for("react.suspense"):60113;i&&Symbol.for("react.suspense_list");var f=i?Symbol.for("react.memo"):60115,m=i?Symbol.for("react.lazy"):60116;i&&Symbol.for("react.fundamental"),i&&Symbol.for("react.responder"),i&&Symbol.for("react.scope");var g="function"===typeof Symbol&&Symbol.iterator;function v(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nP.length&&P.push(e)}function I(e,t,n){return null==e?0:function e(t,n,r,i){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var l=!1;if(null===t)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case o:case a:l=!0}}if(l)return r(i,t,""===n?"."+L(t,0):n),1;if(l=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;c