// Version 2.20.2 react-globe.gl - https://github.com/vasturiano/react-globe.gl !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).Globe=t(e.React)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e);function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||o(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n(e[t]=n,e)),{})};function c(e){return c="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},c(e)}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||d(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n>8&255]+oe[e>>16&255]+oe[e>>24&255]+"-"+oe[255&t]+oe[t>>8&255]+"-"+oe[t>>16&15|64]+oe[t>>24&255]+"-"+oe[63&n|128]+oe[n>>8&255]+"-"+oe[n>>16&255]+oe[n>>24&255]+oe[255&r]+oe[r>>8&255]+oe[r>>16&255]+oe[r>>24&255]).toUpperCase()}function ce(e,t,n){return Math.max(t,Math.min(n,e))}function ue(e,t){return(e%t+t)%t}function he(e,t,n){return(1-n)*e+n*t}function de(e){return 0==(e&e-1)&&0!==e}function fe(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}var pe=Object.freeze({__proto__:null,DEG2RAD:se,RAD2DEG:Ae,generateUUID:le,clamp:ce,euclideanModulo:ue,mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:he,damp:function(e,t,n,r){return he(e,t,1-Math.exp(-n*r))},pingpong:function(e,t=1){return t-Math.abs(ue(e,2*t)-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())},seededRandom:function(e){return void 0!==e&&(ae=e%2147483647),ae=16807*ae%2147483647,(ae-1)/2147483646},degToRad:function(e){return e*se},radToDeg:function(e){return e*Ae},isPowerOfTwo:de,ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:fe,setQuaternionFromProperEuler:function(e,t,n,r,i){const o=Math.cos,a=Math.sin,s=o(n/2),A=a(n/2),l=o((t+r)/2),c=a((t+r)/2),u=o((t-r)/2),h=a((t-r)/2),d=o((r-t)/2),f=a((r-t)/2);switch(i){case"XYX":e.set(s*c,A*u,A*h,s*l);break;case"YZY":e.set(A*h,s*c,A*u,s*l);break;case"ZXZ":e.set(A*u,A*h,s*c,s*l);break;case"XZX":e.set(s*c,A*f,A*d,s*l);break;case"YXY":e.set(A*d,s*c,A*f,s*l);break;case"ZYZ":e.set(A*f,A*d,s*c,s*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}});class me{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(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(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(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(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(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(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const 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(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(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(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(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){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(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(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(e,t){const 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}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}me.prototype.isVector2=!0;class ge{constructor(){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.")}set(e,t,n,r,i,o,a,s,A){const l=this.elements;return l[0]=e,l[1]=r,l[2]=a,l[3]=t,l[4]=i,l[5]=s,l[6]=n,l[7]=o,l[8]=A,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const 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(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[3],s=n[6],A=n[1],l=n[4],c=n[7],u=n[2],h=n[5],d=n[8],f=r[0],p=r[3],m=r[6],g=r[1],v=r[4],y=r[7],x=r[2],b=r[5],_=r[8];return i[0]=o*f+a*g+s*x,i[3]=o*p+a*v+s*b,i[6]=o*m+a*y+s*_,i[1]=A*f+l*g+c*x,i[4]=A*p+l*v+c*b,i[7]=A*m+l*y+c*_,i[2]=u*f+h*g+d*x,i[5]=u*p+h*v+d*b,i[8]=u*m+h*y+d*_,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],A=e[7],l=e[8];return t*o*l-t*a*A-n*i*l+n*a*s+r*i*A-r*o*s}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],A=e[7],l=e[8],c=l*o-a*A,u=a*s-l*i,h=A*i-o*s,d=t*c+n*u+r*h;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);const f=1/d;return e[0]=c*f,e[1]=(r*A-l*n)*f,e[2]=(a*n-r*o)*f,e[3]=u*f,e[4]=(l*t-r*s)*f,e[5]=(r*i-a*t)*f,e[6]=h*f,e[7]=(n*s-A*t)*f,e[8]=(o*t-n*i)*f,this}transpose(){let e;const 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(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const 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(e,t,n,r,i,o,a){const s=Math.cos(i),A=Math.sin(i);return this.set(n*s,n*A,-n*(s*o+A*a)+o+e,-r*A,r*s,-r*(-A*o+s*a)+a+t,0,0,1),this}scale(e,t){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],o=r[3],a=r[6],s=r[1],A=r[4],l=r[7];return r[0]=t*i+n*s,r[3]=t*o+n*A,r[6]=t*a+n*l,r[1]=-n*i+t*s,r[4]=-n*o+t*A,r[7]=-n*a+t*l,this}translate(e,t){const 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(e){const t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const 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}clone(){return(new this.constructor).fromArray(this.elements)}}function ve(e){for(let t=e.length-1;t>=0;--t)if(e[t]>65535)return!0;return!1}function ye(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}ge.prototype.isMatrix3=!0;const xe={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},be={h:0,s:0,l:0},_e={h:0,s:0,l:0};function we(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 Me(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Se(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class Ee{constructor(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(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(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=ue(e,1),t=ce(t,0,1),n=ce(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=we(i,r,e+1/3),this.g=we(i,r,e),this.b=we(i,r,e-1/3)}return this}setStyle(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let e;const r=n[1],i=n[2];switch(r){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,t(e[4]),this;if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,t(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i)){const n=parseFloat(e[1])/360,r=parseInt(e[2],10)/100,i=parseInt(e[3],10)/100;return t(e[4]),this.setHSL(n,r,i)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const e=n[1],t=e.length;if(3===t)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2),16)/255,this;if(6===t)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=xe[e.toLowerCase()];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Me(e.r),this.g=Me(e.g),this.b=Me(e.b),this}copyLinearToSRGB(e){return this.r=Se(e.r),this.g=Se(e.g),this.b=Se(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){const t=this.r,n=this.g,r=this.b,i=Math.max(t,n,r),o=Math.min(t,n,r);let a,s;const A=(o+i)/2;if(o===i)a=0,s=0;else{const e=i-o;switch(s=A<=.5?e/(i+o):e/(2-i-o),i){case t:a=(n-r)/e+(n2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=ye("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e1)switch(this.wrapS){case S:e.x=e.x-Math.floor(e.x);break;case E:e.x=e.x<0?0:1;break;case T: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 S:e.y=e.y-Math.floor(e.y);break;case E:e.y=e.y<0?0:1;break;case T: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}set needsUpdate(e){!0===e&&this.version++}}function Le(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Ce.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}Pe.DEFAULT_IMAGE=void 0,Pe.DEFAULT_MAPPING=300,Pe.prototype.isTexture=!0;class qe{constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(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(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(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(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(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(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(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(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(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(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(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}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const 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(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const 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(e){let t,n,r,i;const o=.01,a=.1,s=e.elements,A=s[0],l=s[4],c=s[8],u=s[1],h=s[5],d=s[9],f=s[2],p=s[6],m=s[10];if(Math.abs(l-u)s&&e>g?eg?s=0?1:-1,r=1-t*t;if(r>Number.EPSILON){const i=Math.sqrt(r),o=Math.atan2(i,t*n);e=Math.sin(e*o)/i,a=Math.sin(a*o)/i}const i=a*n;if(s=s*e+u*i,A=A*e+h*i,l=l*e+d*i,c=c*e+f*i,e===1-a){const e=1/Math.sqrt(s*s+A*A+l*l+c*c);s*=e,A*=e,l*=e,c*=e}}e[t]=s,e[t+1]=A,e[t+2]=l,e[t+3]=c}static multiplyQuaternionsFlat(e,t,n,r,i,o){const a=n[r],s=n[r+1],A=n[r+2],l=n[r+3],c=i[o],u=i[o+1],h=i[o+2],d=i[o+3];return e[t]=a*d+l*c+s*h-A*u,e[t+1]=s*d+l*u+A*c-a*h,e[t+2]=A*d+l*h+a*u-s*c,e[t+3]=l*d-a*c-s*u-A*h,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=e._x,r=e._y,i=e._z,o=e._order,a=Math.cos,s=Math.sin,A=a(n/2),l=a(r/2),c=a(i/2),u=s(n/2),h=s(r/2),d=s(i/2);switch(o){case"XYZ":this._x=u*l*c+A*h*d,this._y=A*h*c-u*l*d,this._z=A*l*d+u*h*c,this._w=A*l*c-u*h*d;break;case"YXZ":this._x=u*l*c+A*h*d,this._y=A*h*c-u*l*d,this._z=A*l*d-u*h*c,this._w=A*l*c+u*h*d;break;case"ZXY":this._x=u*l*c-A*h*d,this._y=A*h*c+u*l*d,this._z=A*l*d+u*h*c,this._w=A*l*c-u*h*d;break;case"ZYX":this._x=u*l*c-A*h*d,this._y=A*h*c+u*l*d,this._z=A*l*d-u*h*c,this._w=A*l*c+u*h*d;break;case"YZX":this._x=u*l*c+A*h*d,this._y=A*h*c+u*l*d,this._z=A*l*d-u*h*c,this._w=A*l*c-u*h*d;break;case"XZY":this._x=u*l*c-A*h*d,this._y=A*h*c-u*l*d,this._z=A*l*d+u*h*c,this._w=A*l*c+u*h*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const 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(e){const t=e.elements,n=t[0],r=t[4],i=t[8],o=t[1],a=t[5],s=t[9],A=t[2],l=t[6],c=t[10],u=n+a+c;if(u>0){const e=.5/Math.sqrt(u+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-A)*e,this._z=(o-r)*e}else if(n>a&&n>c){const e=2*Math.sqrt(1+n-a-c);this._w=(l-s)/e,this._x=.25*e,this._y=(r+o)/e,this._z=(i+A)/e}else if(a>c){const e=2*Math.sqrt(1+a-n-c);this._w=(i-A)/e,this._x=(r+o)/e,this._y=.25*e,this._z=(s+l)/e}else{const e=2*Math.sqrt(1+c-n-a);this._w=(o-r)/e,this._x=(i+A)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.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(e){return 2*Math.acos(Math.abs(ce(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let 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(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(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,i=e._z,o=e._w,a=t._x,s=t._y,A=t._z,l=t._w;return this._x=n*l+o*a+r*A-i*s,this._y=r*l+o*s+i*a-n*A,this._z=i*l+o*A+n*s-r*a,this._w=o*l-n*a-r*s-i*A,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,r=this._y,i=this._z,o=this._w;let 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;const s=1-a*a;if(s<=Number.EPSILON){const e=1-t;return this._w=e*o+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this._onChangeCallback(),this}const A=Math.sqrt(s),l=Math.atan2(A,a),c=Math.sin((1-t)*l)/A,u=Math.sin(t*l)/A;return this._w=o*c+this._w*u,this._x=n*c+this._x*u,this._y=r*c+this._y*u,this._z=i*c+this._z*u,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),r=2*Math.PI*Math.random(),i=2*Math.PI*Math.random();return this.set(t*Math.cos(r),n*Math.sin(i),n*Math.cos(i),t*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}Oe.prototype.isQuaternion=!0;class Be{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(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(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(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(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(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(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(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(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(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Ne.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Ne.setFromAxisAngle(e,t))}applyMatrix3(e){const 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(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const 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(e){const t=this.x,n=this.y,r=this.z,i=e.x,o=e.y,a=e.z,s=e.w,A=s*t+o*r-a*n,l=s*n+a*t-i*r,c=s*r+i*n-o*t,u=-i*t-o*n-a*r;return this.x=A*s+u*-i+l*-a-c*-o,this.y=l*s+u*-o+c*-i-A*-a,this.z=c*s+u*-a+A*-o-l*-i,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const 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(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(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(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(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(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(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){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(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(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(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(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(e,t){const 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(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return ke.copy(this).projectOnVector(e),this.sub(ke)}reflect(e){return this.sub(ke.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(ce(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const 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(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const 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(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(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}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}Be.prototype.isVector3=!0;const ke=new Be,Ne=new Oe;class ze{constructor(e=new Be(1/0,1/0,1/0),t=new Be(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0;for(let s=0,A=e.length;si&&(i=A),l>o&&(o=l),c>a&&(a=c)}return this.min.set(t,n,r),this.max.set(i,o,a),this}setFromBufferAttribute(e){let t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0;for(let s=0,A=e.count;si&&(i=A),l>o&&(o=l),c>a&&(a=c)}return this.min.set(t,n,r),this.max.set(i,o,a),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(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(e,t){return 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(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Fe),Fe.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let 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(e){if(this.isEmpty())return!1;this.getCenter(Xe),Ze.subVectors(this.max,Xe),Ge.subVectors(e.a,Xe),Ve.subVectors(e.b,Xe),je.subVectors(e.c,Xe),We.subVectors(Ve,Ge),Qe.subVectors(je,Ve),Ye.subVectors(Ge,je);let t=[0,-We.z,We.y,0,-Qe.z,Qe.y,0,-Ye.z,Ye.y,We.z,0,-We.x,Qe.z,0,-Qe.x,Ye.z,0,-Ye.x,-We.y,We.x,0,-Qe.y,Qe.x,0,-Ye.y,Ye.x,0];return!!$e(t,Ge,Ve,je,Ze)&&(t=[1,0,0,0,1,0,0,0,1],!!$e(t,Ge,Ve,je,Ze)&&(Je.crossVectors(We,Qe),t=[Je.x,Je.y,Je.z],$e(t,Ge,Ve,je,Ze)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Fe.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(Fe).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(Ue[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ue[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ue[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ue[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ue[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ue[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ue[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ue[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ue)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}ze.prototype.isBox3=!0;const Ue=[new Be,new Be,new Be,new Be,new Be,new Be,new Be,new Be],Fe=new Be,He=new ze,Ge=new Be,Ve=new Be,je=new Be,We=new Be,Qe=new Be,Ye=new Be,Xe=new Be,Ze=new Be,Je=new Be,Ke=new Be;function $e(e,t,n,r,i){for(let o=0,a=e.length-3;o<=a;o+=3){Ke.fromArray(e,o);const a=i.x*Math.abs(Ke.x)+i.y*Math.abs(Ke.y)+i.z*Math.abs(Ke.z),s=t.dot(Ke),A=n.dot(Ke),l=r.dot(Ke);if(Math.max(-Math.max(s,A,l),Math.min(s,A,l))>a)return!1}return!0}const et=new ze,tt=new Be,nt=new Be,rt=new Be;class it{constructor(e=new Be,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):et.setFromPoints(e).getCenter(n);let r=0;for(let t=0,i=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){rt.subVectors(e,this.center);const t=rt.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.add(rt.multiplyScalar(n/e)),this.radius+=n}return this}union(e){return!0===this.center.equals(e.center)?nt.set(0,0,1).multiplyScalar(e.radius):nt.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(tt.copy(e.center).add(nt)),this.expandByPoint(tt.copy(e.center).sub(nt)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const ot=new Be,at=new Be,st=new Be,At=new Be,lt=new Be,ct=new Be,ut=new Be;class ht{constructor(e=new Be,t=new Be(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ot)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ot.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ot.copy(this.direction).multiplyScalar(t).add(this.origin),ot.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){at.copy(e).add(t).multiplyScalar(.5),st.copy(t).sub(e).normalize(),At.copy(this.origin).sub(at);const i=.5*e.distanceTo(t),o=-this.direction.dot(st),a=At.dot(this.direction),s=-At.dot(st),A=At.lengthSq(),l=Math.abs(1-o*o);let c,u,h,d;if(l>0)if(c=o*s-a,u=o*a-s,d=i*l,c>=0)if(u>=-d)if(u<=d){const e=1/l;c*=e,u*=e,h=c*(c+o*u+2*a)+u*(o*c+u+2*s)+A}else u=i,c=Math.max(0,-(o*u+a)),h=-c*c+u*(u+2*s)+A;else u=-i,c=Math.max(0,-(o*u+a)),h=-c*c+u*(u+2*s)+A;else u<=-d?(c=Math.max(0,-(-o*i+a)),u=c>0?-i:Math.min(Math.max(-i,-s),i),h=-c*c+u*(u+2*s)+A):u<=d?(c=0,u=Math.min(Math.max(-i,-s),i),h=u*(u+2*s)+A):(c=Math.max(0,-(o*i+a)),u=c>0?i:Math.min(Math.max(-i,-s),i),h=-c*c+u*(u+2*s)+A);else u=o>0?-i:i,c=Math.max(0,-(o*u+a)),h=-c*c+u*(u+2*s)+A;return n&&n.copy(this.direction).multiplyScalar(c).add(this.origin),r&&r.copy(st).multiplyScalar(u).add(at),h}intersectSphere(e,t){ot.subVectors(e.center,this.origin);const n=ot.dot(this.direction),r=ot.dot(ot)-n*n,i=e.radius*e.radius;if(r>i)return null;const 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(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,o,a,s;const A=1/this.direction.x,l=1/this.direction.y,c=1/this.direction.z,u=this.origin;return A>=0?(n=(e.min.x-u.x)*A,r=(e.max.x-u.x)*A):(n=(e.max.x-u.x)*A,r=(e.min.x-u.x)*A),l>=0?(i=(e.min.y-u.y)*l,o=(e.max.y-u.y)*l):(i=(e.max.y-u.y)*l,o=(e.min.y-u.y)*l),n>o||i>r?null:((i>n||n!=n)&&(n=i),(o=0?(a=(e.min.z-u.z)*c,s=(e.max.z-u.z)*c):(a=(e.max.z-u.z)*c,s=(e.min.z-u.z)*c),n>s||a>r?null:((a>n||n!=n)&&(n=a),(s=0?n:r,t)))}intersectsBox(e){return null!==this.intersectBox(e,ot)}intersectTriangle(e,t,n,r,i){lt.subVectors(t,e),ct.subVectors(n,e),ut.crossVectors(lt,ct);let o,a=this.direction.dot(ut);if(a>0){if(r)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}At.subVectors(this.origin,e);const s=o*this.direction.dot(ct.crossVectors(At,ct));if(s<0)return null;const A=o*this.direction.dot(lt.cross(At));if(A<0)return null;if(s+A>a)return null;const l=-o*At.dot(ut);return l<0?null:this.at(l/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class dt{constructor(){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.")}set(e,t,n,r,i,o,a,s,A,l,c,u,h,d,f,p){const m=this.elements;return m[0]=e,m[4]=t,m[8]=n,m[12]=r,m[1]=i,m[5]=o,m[9]=a,m[13]=s,m[2]=A,m[6]=l,m[10]=c,m[14]=u,m[3]=h,m[7]=d,m[11]=f,m[15]=p,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new dt).fromArray(this.elements)}copy(e){const 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(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(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(e){const t=this.elements,n=e.elements,r=1/ft.setFromMatrixColumn(e,0).length(),i=1/ft.setFromMatrixColumn(e,1).length(),o=1/ft.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(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,n=e.x,r=e.y,i=e.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(r),A=Math.sin(r),l=Math.cos(i),c=Math.sin(i);if("XYZ"===e.order){const e=o*l,n=o*c,r=a*l,i=a*c;t[0]=s*l,t[4]=-s*c,t[8]=A,t[1]=n+r*A,t[5]=e-i*A,t[9]=-a*s,t[2]=i-e*A,t[6]=r+n*A,t[10]=o*s}else if("YXZ"===e.order){const e=s*l,n=s*c,r=A*l,i=A*c;t[0]=e+i*a,t[4]=r*a-n,t[8]=o*A,t[1]=o*c,t[5]=o*l,t[9]=-a,t[2]=n*a-r,t[6]=i+e*a,t[10]=o*s}else if("ZXY"===e.order){const e=s*l,n=s*c,r=A*l,i=A*c;t[0]=e-i*a,t[4]=-o*c,t[8]=r+n*a,t[1]=n+r*a,t[5]=o*l,t[9]=i-e*a,t[2]=-o*A,t[6]=a,t[10]=o*s}else if("ZYX"===e.order){const e=o*l,n=o*c,r=a*l,i=a*c;t[0]=s*l,t[4]=r*A-n,t[8]=e*A+i,t[1]=s*c,t[5]=i*A+e,t[9]=n*A-r,t[2]=-A,t[6]=a*s,t[10]=o*s}else if("YZX"===e.order){const e=o*s,n=o*A,r=a*s,i=a*A;t[0]=s*l,t[4]=i-e*c,t[8]=r*c+n,t[1]=c,t[5]=o*l,t[9]=-a*l,t[2]=-A*l,t[6]=n*c+r,t[10]=e-i*c}else if("XZY"===e.order){const e=o*s,n=o*A,r=a*s,i=a*A;t[0]=s*l,t[4]=-c,t[8]=A*l,t[1]=e*c+i,t[5]=o*l,t[9]=n*c-r,t[2]=r*c-n,t[6]=a*l,t[10]=i*c+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(mt,e,gt)}lookAt(e,t,n){const r=this.elements;return xt.subVectors(e,t),0===xt.lengthSq()&&(xt.z=1),xt.normalize(),vt.crossVectors(n,xt),0===vt.lengthSq()&&(1===Math.abs(n.z)?xt.x+=1e-4:xt.z+=1e-4,xt.normalize(),vt.crossVectors(n,xt)),vt.normalize(),yt.crossVectors(xt,vt),r[0]=vt.x,r[4]=yt.x,r[8]=xt.x,r[1]=vt.y,r[5]=yt.y,r[9]=xt.y,r[2]=vt.z,r[6]=yt.z,r[10]=xt.z,this}multiply(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(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,o=n[0],a=n[4],s=n[8],A=n[12],l=n[1],c=n[5],u=n[9],h=n[13],d=n[2],f=n[6],p=n[10],m=n[14],g=n[3],v=n[7],y=n[11],x=n[15],b=r[0],_=r[4],w=r[8],M=r[12],S=r[1],E=r[5],T=r[9],C=r[13],R=r[2],P=r[6],L=r[10],q=r[14],D=r[3],I=r[7],O=r[11],B=r[15];return i[0]=o*b+a*S+s*R+A*D,i[4]=o*_+a*E+s*P+A*I,i[8]=o*w+a*T+s*L+A*O,i[12]=o*M+a*C+s*q+A*B,i[1]=l*b+c*S+u*R+h*D,i[5]=l*_+c*E+u*P+h*I,i[9]=l*w+c*T+u*L+h*O,i[13]=l*M+c*C+u*q+h*B,i[2]=d*b+f*S+p*R+m*D,i[6]=d*_+f*E+p*P+m*I,i[10]=d*w+f*T+p*L+m*O,i[14]=d*M+f*C+p*q+m*B,i[3]=g*b+v*S+y*R+x*D,i[7]=g*_+v*E+y*P+x*I,i[11]=g*w+v*T+y*L+x*O,i[15]=g*M+v*C+y*q+x*B,this}multiplyScalar(e){const 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(){const e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],o=e[1],a=e[5],s=e[9],A=e[13],l=e[2],c=e[6],u=e[10],h=e[14];return e[3]*(+i*s*c-r*A*c-i*a*u+n*A*u+r*a*h-n*s*h)+e[7]*(+t*s*h-t*A*u+i*o*u-r*o*h+r*A*l-i*s*l)+e[11]*(+t*A*c-t*a*h-i*o*c+n*o*h+i*a*l-n*A*l)+e[15]*(-r*a*l-t*s*c+t*a*u+r*o*c-n*o*u+n*s*l)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const 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}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],A=e[7],l=e[8],c=e[9],u=e[10],h=e[11],d=e[12],f=e[13],p=e[14],m=e[15],g=c*p*A-f*u*A+f*s*h-a*p*h-c*s*m+a*u*m,v=d*u*A-l*p*A-d*s*h+o*p*h+l*s*m-o*u*m,y=l*f*A-d*c*A+d*a*h-o*f*h-l*a*m+o*c*m,x=d*c*s-l*f*s-d*a*u+o*f*u+l*a*p-o*c*p,b=t*g+n*v+r*y+i*x;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const _=1/b;return e[0]=g*_,e[1]=(f*u*i-c*p*i-f*r*h+n*p*h+c*r*m-n*u*m)*_,e[2]=(a*p*i-f*s*i+f*r*A-n*p*A-a*r*m+n*s*m)*_,e[3]=(c*s*i-a*u*i-c*r*A+n*u*A+a*r*h-n*s*h)*_,e[4]=v*_,e[5]=(l*p*i-d*u*i+d*r*h-t*p*h-l*r*m+t*u*m)*_,e[6]=(d*s*i-o*p*i-d*r*A+t*p*A+o*r*m-t*s*m)*_,e[7]=(o*u*i-l*s*i+l*r*A-t*u*A-o*r*h+t*s*h)*_,e[8]=y*_,e[9]=(d*c*i-l*f*i-d*n*h+t*f*h+l*n*m-t*c*m)*_,e[10]=(o*f*i-d*a*i+d*n*A-t*f*A-o*n*m+t*a*m)*_,e[11]=(l*a*i-o*c*i-l*n*A+t*c*A+o*n*h-t*a*h)*_,e[12]=x*_,e[13]=(l*f*r-d*c*r+d*n*u-t*f*u-l*n*p+t*c*p)*_,e[14]=(d*a*r-o*f*r-d*n*s+t*f*s+o*n*p-t*a*p)*_,e[15]=(o*c*r-l*a*r+l*n*s-t*c*s-o*n*u+t*a*u)*_,this}scale(e){const 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(){const 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(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const 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(e){const 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(e){const 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(e,t){const n=Math.cos(t),r=Math.sin(t),i=1-n,o=e.x,a=e.y,s=e.z,A=i*o,l=i*a;return this.set(A*o+n,A*a-r*s,A*s+r*a,0,A*a+r*s,l*a+n,l*s-r*o,0,A*s-r*a,l*s+r*o,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,o){return this.set(1,n,i,0,e,1,o,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,i=t._x,o=t._y,a=t._z,s=t._w,A=i+i,l=o+o,c=a+a,u=i*A,h=i*l,d=i*c,f=o*l,p=o*c,m=a*c,g=s*A,v=s*l,y=s*c,x=n.x,b=n.y,_=n.z;return r[0]=(1-(f+m))*x,r[1]=(h+y)*x,r[2]=(d-v)*x,r[3]=0,r[4]=(h-y)*b,r[5]=(1-(u+m))*b,r[6]=(p+g)*b,r[7]=0,r[8]=(d+v)*_,r[9]=(p-g)*_,r[10]=(1-(u+f))*_,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let i=ft.set(r[0],r[1],r[2]).length();const o=ft.set(r[4],r[5],r[6]).length(),a=ft.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],pt.copy(this);const s=1/i,A=1/o,l=1/a;return pt.elements[0]*=s,pt.elements[1]*=s,pt.elements[2]*=s,pt.elements[4]*=A,pt.elements[5]*=A,pt.elements[6]*=A,pt.elements[8]*=l,pt.elements[9]*=l,pt.elements[10]*=l,t.setFromRotationMatrix(pt),n.x=i,n.y=o,n.z=a,this}makePerspective(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.");const a=this.elements,s=2*i/(t-e),A=2*i/(n-r),l=(t+e)/(t-e),c=(n+r)/(n-r),u=-(o+i)/(o-i),h=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=l,a[12]=0,a[1]=0,a[5]=A,a[9]=c,a[13]=0,a[2]=0,a[6]=0,a[10]=u,a[14]=h,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(e,t,n,r,i,o){const a=this.elements,s=1/(t-e),A=1/(n-r),l=1/(o-i),c=(t+e)*s,u=(n+r)*A,h=(o+i)*l;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-c,a[1]=0,a[5]=2*A,a[9]=0,a[13]=-u,a[2]=0,a[6]=0,a[10]=-2*l,a[14]=-h,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const 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}}dt.prototype.isMatrix4=!0;const ft=new Be,pt=new dt,mt=new Be(0,0,0),gt=new Be(1,1,1),vt=new Be,yt=new Be,xt=new Be,bt=new dt,_t=new Oe;class wt{constructor(e=0,t=0,n=0,r=wt.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,i=r[0],o=r[4],a=r[8],s=r[1],A=r[5],l=r[9],c=r[2],u=r[6],h=r[10];switch(t){case"XYZ":this._y=Math.asin(ce(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-l,h),this._z=Math.atan2(-o,i)):(this._x=Math.atan2(u,A),this._z=0);break;case"YXZ":this._x=Math.asin(-ce(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(a,h),this._z=Math.atan2(s,A)):(this._y=Math.atan2(-c,i),this._z=0);break;case"ZXY":this._x=Math.asin(ce(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-c,h),this._z=Math.atan2(-o,A)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-ce(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(u,h),this._z=Math.atan2(s,i)):(this._x=0,this._z=Math.atan2(-o,A));break;case"YZX":this._z=Math.asin(ce(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-l,A),this._y=Math.atan2(-c,i)):(this._x=0,this._y=Math.atan2(a,h));break;case"XZY":this._z=Math.asin(-ce(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(u,A),this._y=Math.atan2(a,i)):(this._x=Math.atan2(-l,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return bt.makeRotationFromQuaternion(e),this.setFromRotationMatrix(bt,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return _t.setFromEuler(this),this.setFromQuaternion(_t,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(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(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new Be(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}wt.prototype.isEuler=!0,wt.DefaultOrder="XYZ",wt.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Mt{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let e=0;e1){for(let e=0;e0){r.children=[];for(let t=0;t0){r.animations=[];for(let t=0;t0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),a.length>0&&(n.images=a),s.length>0&&(n.shapes=s),A.length>0&&(n.skeletons=A),l.length>0&&(n.animations=l)}return n.object=r,n;function o(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,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(let t=0;t0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){zt.subVectors(r,t),Ut.subVectors(n,t),Ft.subVectors(e,t);const o=zt.dot(zt),a=zt.dot(Ut),s=zt.dot(Ft),A=Ut.dot(Ut),l=Ut.dot(Ft),c=o*A-a*a;if(0===c)return i.set(-2,-1,-1);const u=1/c,h=(A*s-a*l)*u,d=(o*l-a*s)*u;return i.set(1-h-d,d,h)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Ht),Ht.x>=0&&Ht.y>=0&&Ht.x+Ht.y<=1}static getUV(e,t,n,r,i,o,a,s){return this.getBarycoord(e,t,n,r,Ht),s.set(0,0),s.addScaledVector(i,Ht.x),s.addScaledVector(o,Ht.y),s.addScaledVector(a,Ht.z),s}static isFrontFacing(e,t,n,r){return zt.subVectors(n,t),Ut.subVectors(e,t),zt.cross(Ut).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return zt.subVectors(this.c,this.b),Ut.subVectors(this.a,this.b),.5*zt.cross(Ut).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Xt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Xt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,i){return Xt.getUV(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return Xt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Xt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,i=this.c;let o,a;Gt.subVectors(r,n),Vt.subVectors(i,n),Wt.subVectors(e,n);const s=Gt.dot(Wt),A=Vt.dot(Wt);if(s<=0&&A<=0)return t.copy(n);Qt.subVectors(e,r);const l=Gt.dot(Qt),c=Vt.dot(Qt);if(l>=0&&c<=l)return t.copy(r);const u=s*c-l*A;if(u<=0&&s>=0&&l<=0)return o=s/(s-l),t.copy(n).addScaledVector(Gt,o);Yt.subVectors(e,i);const h=Gt.dot(Yt),d=Vt.dot(Yt);if(d>=0&&h<=d)return t.copy(i);const f=h*A-s*d;if(f<=0&&A>=0&&d<=0)return a=A/(A-d),t.copy(n).addScaledVector(Vt,a);const p=l*d-h*c;if(p<=0&&c-l>=0&&h-d>=0)return jt.subVectors(i,r),a=(c-l)/(c-l+(h-d)),t.copy(r).addScaledVector(jt,a);const m=1/(p+f+u);return o=f*m,a=u*m,t.copy(n).addScaledVector(Gt,o).addScaledVector(Vt,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let Zt=0;class Jt extends ie{constructor(){super(),Object.defineProperty(this,"id",{value:Zt++}),this.uuid=le(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=b,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=$,this.stencilZFail=$,this.stencilZPass=$,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const n=e[t];if(void 0===n){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if("shading"===t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;continue}const r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!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.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){const t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,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;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let r=0;r!==e;++r)n[r]=t[r].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.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}Jt.prototype.isMaterial=!0;class Kt extends Jt{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new Ee(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(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}}Kt.prototype.isMeshBasicMaterial=!0;const $t=new Be,en=new me;class tn{constructor(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=ee,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(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(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const t in n){const r=n[t];e.data.attributes[t]=r.toJSON(e.data)}const r={};let i=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],o=[];for(let t=0,r=n.length;t0&&(r[t]=o,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return null!==a&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const r=e.attributes;for(const e in r){const n=r[e];this.setAttribute(e,n.clone(t))}const i=e.morphAttributes;for(const e in i){const n=[],r=i[e];for(let e=0,i=r.length;e0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0===r)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),mn.copy(n.boundingSphere),mn.applyMatrix4(i),!1===e.ray.intersectsSphere(mn))return;if(fn.copy(i).invert(),pn.copy(e.ray).applyMatrix4(fn),null!==n.boundingBox&&!1===pn.intersectsBox(n.boundingBox))return;let o;if(n.isBufferGeometry){const i=n.index,a=n.attributes.position,s=n.morphAttributes.position,A=n.morphTargetsRelative,l=n.attributes.uv,c=n.attributes.uv2,u=n.groups,h=n.drawRange;if(null!==i)if(Array.isArray(r))for(let n=0,d=u.length;nn.far?null:{distance:l,point:Pn.clone(),object:e}}(e,t,n,r,gn,vn,yn,Rn);if(d){s&&(En.fromBufferAttribute(s,l),Tn.fromBufferAttribute(s,c),Cn.fromBufferAttribute(s,u),d.uv=Xt.getUV(Rn,gn,vn,yn,En,Tn,Cn,new me)),A&&(En.fromBufferAttribute(A,l),Tn.fromBufferAttribute(A,c),Cn.fromBufferAttribute(A,u),d.uv2=Xt.getUV(Rn,gn,vn,yn,En,Tn,Cn,new me));const e={a:l,b:c,c:u,normal:new Be,materialIndex:0};Xt.getNormal(gn,vn,yn,e.normal),d.face=e}return d}Ln.prototype.isMesh=!0;class Dn extends dn{constructor(e=1,t=1,n=1,r=1,i=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:o};const a=this;r=Math.floor(r),i=Math.floor(i),o=Math.floor(o);const s=[],A=[],l=[],c=[];let u=0,h=0;function d(e,t,n,r,i,o,d,f,p,m,g){const v=o/p,y=d/m,x=o/2,b=d/2,_=f/2,w=p+1,M=m+1;let S=0,E=0;const T=new Be;for(let o=0;o0?1:-1,l.push(T.x,T.y,T.z),c.push(s/p),c.push(1-o/m),S+=1}}for(let e=0;e0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}kn.prototype.isShaderMaterial=!0;class Nn extends Nt{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new dt,this.projectionMatrix=new dt,this.projectionMatrixInverse=new dt}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}Nn.prototype.isCamera=!0;class zn extends Nn{constructor(e=50,t=1,n=.1,r=2e3){super(),this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(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(e){const t=.5*this.getFilmHeight()/e;this.fov=2*Ae*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*se*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Ae*Math.atan(Math.tan(.5*se*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(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(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*se*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r;const o=this.view;if(null!==this.view&&this.view.enabled){const e=o.fullWidth,a=o.fullHeight;i+=o.offsetX*r/e,t-=o.offsetY*n/a,r*=o.width/e,n*=o.height/a}const a=this.filmOffset;0!==a&&(i+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(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}}zn.prototype.isPerspectiveCamera=!0;const Un=90;class Fn extends Nt{constructor(e,t,n){if(super(),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const r=new zn(Un,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Be(1,0,0)),this.add(r);const i=new zn(Un,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Be(-1,0,0)),this.add(i);const o=new zn(Un,1,e,t);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new Be(0,1,0)),this.add(o);const a=new zn(Un,1,e,t);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new Be(0,-1,0)),this.add(a);const s=new zn(Un,1,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new Be(0,0,1)),this.add(s);const A=new zn(Un,1,e,t);A.layers=this.layers,A.up.set(0,-1,0),A.lookAt(new Be(0,0,-1)),this.add(A)}update(e,t){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget,[r,i,o,a,s,A]=this.children,l=e.xr.enabled,c=e.getRenderTarget();e.xr.enabled=!1;const u=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,s),n.texture.generateMipmaps=u,e.setRenderTarget(n,5),e.render(t,A),e.setRenderTarget(c),e.xr.enabled=l,n.texture.needsPMREMUpdate=!0}}class Hn extends Pe{constructor(e,t,n,r,i,o,a,s,A,l){super(e=void 0!==e?e:[],t=void 0!==t?t:_,n,r,i,o,a,s,A,l),this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}Hn.prototype.isCubeTexture=!0;class Gn extends De{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),super(e,e,t),t=t||{},this.texture=new Hn(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:R}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=k,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},r=new Dn(5,5,5),i=new kn({name:"CubemapFromEquirect",uniforms:In(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;const o=new Ln(r,i),a=t.minFilter;t.minFilter===P&&(t.minFilter=R);return new Fn(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,r){const i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}}Gn.prototype.isWebGLCubeRenderTarget=!0;const Vn=new Be,jn=new Be,Wn=new ge;class Qn{constructor(e=new Be(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=Vn.subVectors(n,t).cross(jn.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const n=e.delta(Vn),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(n).multiplyScalar(i).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||Wn.getNormalMatrix(e),r=this.coplanarPoint(Vn).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}Qn.prototype.isPlane=!0;const Yn=new it,Xn=new Be;class Zn{constructor(e=new Qn,t=new Qn,n=new Qn,r=new Qn,i=new Qn,o=new Qn){this.planes=[e,t,n,r,i,o]}set(e,t,n,r,i,o){const 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}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],A=n[5],l=n[6],c=n[7],u=n[8],h=n[9],d=n[10],f=n[11],p=n[12],m=n[13],g=n[14],v=n[15];return t[0].setComponents(a-r,c-s,f-u,v-p).normalize(),t[1].setComponents(a+r,c+s,f+u,v+p).normalize(),t[2].setComponents(a+i,c+A,f+h,v+m).normalize(),t[3].setComponents(a-i,c-A,f-h,v-m).normalize(),t[4].setComponents(a-o,c-l,f-d,v-g).normalize(),t[5].setComponents(a+o,c+l,f+d,v+g).normalize(),this}intersectsObject(e){const t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Yn.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Yn)}intersectsSprite(e){return Yn.center.set(0,0,0),Yn.radius=.7071067811865476,Yn.applyMatrix4(e.matrixWorld),this.intersectsSphere(Yn)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(n)0?e.max.x:e.min.x,Xn.y=r.normal.y>0?e.max.y:e.min.y,Xn.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(Xn)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Jn(){let e=null,t=!1,n=null,r=null;function i(t,o){n(t,o),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Kn(e,t){const 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);const n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){const e=r.get(t);return void((!e||e.version 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}\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_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\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, float faceDirection ) {\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 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\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 max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\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 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 USE_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}\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\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ) + 0.5;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\treturn texture2D( envMap, uv ).rgb;\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\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:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\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}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\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#else\n\t\tvec4 envColor = vec4( 0.0 );\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\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 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec;\n\t\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\t\treflectVec = reflect( - viewDir, normal );\n\t\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\t#else\n\t\t\t\treflectVec = refract( - viewDir, normal, refractionRatio );\n\t\t\t#endif\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\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\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\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 vFogDepth;\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 vec3( texture2D( gradientMap, coord ).r );\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\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tlightMapIrradiance *= PI;\n\t#endif\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\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;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.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 vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\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\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\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_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;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\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\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, 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_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.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.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}\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.roughness;\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#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\treflectedLight.directDiffuse += irradiance * BRDF_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_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 USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += 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 USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = 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 += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\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 sampledDiffuseColor = texture2D( map, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\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\tdiffuseColor *= texture2D( map, uv );\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\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1, 2 ) * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform vec2 morphTargetsTextureSize;\n\t\tvec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset, const in int stride ) {\n\t\t\tfloat texelIndex = float( vertexIndex * stride + offset );\n\t\t\tfloat y = floor( texelIndex / morphTargetsTextureSize.x );\n\t\t\tfloat x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tvec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );\n\t\t\treturn texture( morphTargetsTexture, morphUV ).xyz;\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\t#ifndef USE_MORPHNORMALS\n\t\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 1 ) * morphTargetInfluences[ i ];\n\t\t\t#else\n\t\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 2 ) * morphTargetInfluences[ i ];\n\t\t\t#endif\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#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 * faceDirection;\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 * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\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 * faceDirection;\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, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#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",normal_pars_vertex:"#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",normal_vertex:"#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",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, float faceDirection ) {\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\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_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, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",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\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\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\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\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\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\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\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\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\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\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\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\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}\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 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",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 ) || defined ( USE_TRANSMISSION )\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_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}",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\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}",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}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\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\tvHighPrecisionZW = gl_Position.zw;\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 \n#include \nvarying vec2 vHighPrecisionZW;\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\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",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}",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 \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}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\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 \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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\t#include \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#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include \n\t\t#include \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\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 \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\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += 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\t#include \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}",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 \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#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_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_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\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\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\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\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#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\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#include \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}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\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\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\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\tvViewPosition = - mvPosition.xyz;\n\t#include \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 \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\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\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\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\t#include \n\t#include \n\t#include \n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\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 \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 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include \n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\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\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \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}",points_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\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#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}",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}",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}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \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\t#include \n\t#include \n\t#include \n\t#include \n}"},tr={common:{diffuse:{value:new Ee(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new ge},uv2Transform:{value:new ge},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},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 me(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 Ee(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ee(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new ge}},sprite:{diffuse:{value:new Ee(16777215)},opacity:{value:1},center:{value:new me(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new ge}}},nr={basic:{uniforms:On([tr.common,tr.specularmap,tr.envmap,tr.aomap,tr.lightmap,tr.fog]),vertexShader:er.meshbasic_vert,fragmentShader:er.meshbasic_frag},lambert:{uniforms:On([tr.common,tr.specularmap,tr.envmap,tr.aomap,tr.lightmap,tr.emissivemap,tr.fog,tr.lights,{emissive:{value:new Ee(0)}}]),vertexShader:er.meshlambert_vert,fragmentShader:er.meshlambert_frag},phong:{uniforms:On([tr.common,tr.specularmap,tr.envmap,tr.aomap,tr.lightmap,tr.emissivemap,tr.bumpmap,tr.normalmap,tr.displacementmap,tr.fog,tr.lights,{emissive:{value:new Ee(0)},specular:{value:new Ee(1118481)},shininess:{value:30}}]),vertexShader:er.meshphong_vert,fragmentShader:er.meshphong_frag},standard:{uniforms:On([tr.common,tr.envmap,tr.aomap,tr.lightmap,tr.emissivemap,tr.bumpmap,tr.normalmap,tr.displacementmap,tr.roughnessmap,tr.metalnessmap,tr.fog,tr.lights,{emissive:{value:new Ee(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:er.meshphysical_vert,fragmentShader:er.meshphysical_frag},toon:{uniforms:On([tr.common,tr.aomap,tr.lightmap,tr.emissivemap,tr.bumpmap,tr.normalmap,tr.displacementmap,tr.gradientmap,tr.fog,tr.lights,{emissive:{value:new Ee(0)}}]),vertexShader:er.meshtoon_vert,fragmentShader:er.meshtoon_frag},matcap:{uniforms:On([tr.common,tr.bumpmap,tr.normalmap,tr.displacementmap,tr.fog,{matcap:{value:null}}]),vertexShader:er.meshmatcap_vert,fragmentShader:er.meshmatcap_frag},points:{uniforms:On([tr.points,tr.fog]),vertexShader:er.points_vert,fragmentShader:er.points_frag},dashed:{uniforms:On([tr.common,tr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:er.linedashed_vert,fragmentShader:er.linedashed_frag},depth:{uniforms:On([tr.common,tr.displacementmap]),vertexShader:er.depth_vert,fragmentShader:er.depth_frag},normal:{uniforms:On([tr.common,tr.bumpmap,tr.normalmap,tr.displacementmap,{opacity:{value:1}}]),vertexShader:er.meshnormal_vert,fragmentShader:er.meshnormal_frag},sprite:{uniforms:On([tr.sprite,tr.fog]),vertexShader:er.sprite_vert,fragmentShader:er.sprite_frag},background:{uniforms:{uvTransform:{value:new ge},t2D:{value:null}},vertexShader:er.background_vert,fragmentShader:er.background_frag},cube:{uniforms:On([tr.envmap,{opacity:{value:1}}]),vertexShader:er.cube_vert,fragmentShader:er.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:er.equirect_vert,fragmentShader:er.equirect_frag},distanceRGBA:{uniforms:On([tr.common,tr.displacementmap,{referencePosition:{value:new Be},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:er.distanceRGBA_vert,fragmentShader:er.distanceRGBA_frag},shadow:{uniforms:On([tr.lights,tr.fog,{color:{value:new Ee(0)},opacity:{value:1}}]),vertexShader:er.shadow_vert,fragmentShader:er.shadow_frag}};function rr(e,t,n,r,i,o){const a=new Ee(0);let s,A,l=!0===i?0:1,c=null,u=0,h=null;function d(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,o)}return{getClearColor:function(){return a},setClearColor:function(e,t=1){a.set(e),l=t,d(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(e){l=e,d(a,l)},render:function(n,i){let o=!1,f=!0===i.isScene?i.background:null;f&&f.isTexture&&(f=t.get(f));const p=e.xr,m=p.getSession&&p.getSession();m&&"additive"===m.environmentBlendMode&&(f=null),null===f?d(a,l):f&&f.isColor&&(d(f,1),o=!0),(e.autoClear||o)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),f&&(f.isCubeTexture||f.mapping===M)?(void 0===A&&(A=new Ln(new Dn(1,1,1),new kn({name:"BackgroundCubeMaterial",uniforms:In(nr.cube.uniforms),vertexShader:nr.cube.vertexShader,fragmentShader:nr.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),A.geometry.deleteAttribute("normal"),A.geometry.deleteAttribute("uv"),A.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(A.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(A)),A.material.uniforms.envMap.value=f,A.material.uniforms.flipEnvMap.value=f.isCubeTexture&&!1===f.isRenderTargetTexture?-1:1,c===f&&u===f.version&&h===e.toneMapping||(A.material.needsUpdate=!0,c=f,u=f.version,h=e.toneMapping),n.unshift(A,A.geometry,A.material,0,0,null)):f&&f.isTexture&&(void 0===s&&(s=new Ln(new $n(2,2),new kn({name:"BackgroundMaterial",uniforms:In(nr.background.uniforms),vertexShader:nr.background.vertexShader,fragmentShader:nr.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),Object.defineProperty(s.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(s)),s.material.uniforms.t2D.value=f,!0===f.matrixAutoUpdate&&f.updateMatrix(),s.material.uniforms.uvTransform.value.copy(f.matrix),c===f&&u===f.version&&h===e.toneMapping||(s.material.needsUpdate=!0,c=f,u=f.version,h=e.toneMapping),n.unshift(s,s.geometry,s.material,0,0,null))}}}function ir(e,t,n,r){const i=e.getParameter(34921),o=r.isWebGL2?null:t.get("OES_vertex_array_object"),a=r.isWebGL2||null!==o,s={},A=h(null);let l=A;function c(t){return r.isWebGL2?e.bindVertexArray(t):o.bindVertexArrayOES(t)}function u(t){return r.isWebGL2?e.deleteVertexArray(t):o.deleteVertexArrayOES(t)}function h(e){const t=[],n=[],r=[];for(let e=0;e=0){let o=A[t];if(void 0===o&&("instanceMatrix"===t&&i.instanceMatrix&&(o=i.instanceMatrix),"instanceColor"===t&&i.instanceColor&&(o=i.instanceColor)),void 0!==o){const t=o.normalized,a=o.itemSize,A=n.get(o);if(void 0===A)continue;const l=A.buffer,c=A.type,u=A.bytesPerElement;if(o.isInterleavedBufferAttribute){const n=o.data,A=n.stride,h=o.offset;if(n&&n.isInstancedInterleavedBuffer){for(let e=0;e0&&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"}const o="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext;let a=void 0!==n.precision?n.precision:"highp";const s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);const A=o||t.has("WEBGL_draw_buffers"),l=!0===n.logarithmicDepthBuffer,c=e.getParameter(34930),u=e.getParameter(35660),h=e.getParameter(3379),d=e.getParameter(34076),f=e.getParameter(34921),p=e.getParameter(36347),m=e.getParameter(36348),g=e.getParameter(36349),v=u>0,y=o||t.has("OES_texture_float");return{isWebGL2:o,drawBuffers:A,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:d,maxAttributes:f,maxVertexUniforms:p,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:o?e.getParameter(36183):0}}function sr(e){const t=this;let n=null,r=0,i=!1,o=!1;const a=new Qn,s=new ge,A={value:null,needsUpdate:!1};function l(){A.value!==n&&(A.value=n,A.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function c(e,n,r,i){const o=null!==e?e.length:0;let l=null;if(0!==o){if(l=A.value,!0!==i||null===l){const t=r+4*o,i=n.matrixWorldInverse;s.getNormalMatrix(i),(null===l||l.length0){const a=new Gn(o.height/2);return a.fromEquirectangularTexture(e,i),t.set(i,a),i.addEventListener("dispose",r),n(a.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}nr.physical={uniforms:On([nr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new me(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new Ee(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new me},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Ee(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Ee(1,1,1)},specularColorMap:{value:null}}]),vertexShader:er.meshphysical_vert,fragmentShader:er.meshphysical_frag};class lr extends Nn{constructor(e=-1,t=1,n=1,r=-1,i=.1,o=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,o){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(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=n-e,o=n+e,a=r+t,s=r-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,o=i+e*this.view.width,a-=t*this.view.offsetY,s=a-t*this.view.height}this.projectionMatrix.makeOrthographic(i,o,a,s,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}lr.prototype.isOrthographicCamera=!0;class cr extends kn{constructor(e){super(e),this.type="RawShaderMaterial"}}cr.prototype.isRawShaderMaterial=!0;const ur=Math.pow(2,8),hr=[.125,.215,.35,.446,.526,.582],dr=5+hr.length,fr=20,pr=new lr,{_lodPlanes:mr,_sizeLods:gr,_sigmas:vr}=Sr(),yr=new Ee;let xr=null;const br=(1+Math.sqrt(5))/2,_r=1/br,wr=[new Be(1,1,1),new Be(-1,1,1),new Be(1,1,-1),new Be(-1,1,-1),new Be(0,br,_r),new Be(0,br,-_r),new Be(_r,0,br),new Be(-_r,0,br),new Be(br,_r,0),new Be(-br,_r,0)];class Mr{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._blurMaterial=function(e){const t=new Float32Array(e),n=new Be(0,1,0);return new cr({name:"SphericalGaussianBlur",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}},vertexShader:Pr(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\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\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}(fr),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,r=100){xr=this._renderer.getRenderTarget();const i=this._allocateTargets();return this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapShader&&(this._cubemapShader=Rr(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){null===this._equirectShader&&(this._equirectShader=Cr(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(let e=0;e2?ur:0,ur,ur),s.setRenderTarget(r),h&&s.render(u,i),s.render(e,i)}u.geometry.dispose(),u.material.dispose(),s.toneMapping=l,s.autoClear=A,e.background=d}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===_||e.mapping===w;r?(null===this._cubemapShader&&(this._cubemapShader=Rr()),this._cubemapShader.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectShader&&(this._equirectShader=Cr());const i=r?this._cubemapShader:this._equirectShader,o=new Ln(mr[0],i),a=i.uniforms;a.envMap.value=e,r||a.texelSize.value.set(1/e.image.width,1/e.image.height),Tr(t,0,0,3*ur,2*ur),n.setRenderTarget(t),n.render(o,pr)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let t=1;tfr&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const p=[];let m=0;for(let e=0;e4?r-8+4:0),3*g,2*g),s.setRenderTarget(t),s.render(l,pr)}}function Sr(){const e=[],t=[],n=[];let r=8;for(let i=0;i4?a=hr[i-8+4-1]:0===i&&(a=0),n.push(a);const s=1/(o-1),A=-s/2,l=1+s/2,c=[A,A,l,A,l,l,A,A,l,l,A,l],u=6,h=6,d=3,f=2,p=1,m=new Float32Array(d*h*u),g=new Float32Array(f*h*u),v=new Float32Array(p*h*u);for(let e=0;e2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];m.set(r,d*h*e),g.set(c,f*h*e);const i=[e,e,e,e,e,e];v.set(i,p*h*e)}const y=new dn;y.setAttribute("position",new tn(m,d)),y.setAttribute("uv",new tn(g,f)),y.setAttribute("faceIndex",new tn(v,p)),e.push(y),r>4&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function Er(e){const t=new De(3*ur,3*ur,e);return t.texture.mapping=M,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function Tr(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function Cr(){const e=new me(1,1);return new cr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:e}},vertexShader:Pr(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = texture2D ( envMap, uv ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = texture2D ( envMap, uv ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = texture2D ( envMap, uv ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = texture2D ( envMap, uv ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Rr(){return new cr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Pr(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Pr(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function Lr(e){let t=new WeakMap,n=null;function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const o=i.mapping,a=303===o||304===o,s=o===_||o===w;if(a||s){if(i.isRenderTargetTexture&&!0===i.needsPMREMUpdate){i.needsPMREMUpdate=!1;let r=t.get(i);return null===n&&(n=new Mr(e)),r=a?n.fromEquirectangular(i,r):n.fromCubemap(i,r),t.set(i,r),r.texture}if(t.has(i))return t.get(i).texture;{const o=i.image;if(a&&o&&o.height>0||s&&o&&function(e){let t=0;const n=6;for(let r=0;rt.maxTextureSize&&(u=Math.ceil(c/t.maxTextureSize),c=t.maxTextureSize);const h=new Float32Array(c*u*4*r),d=new Br(h,c,u,r);d.format=k,d.type=I,d.needsUpdate=!0;const f=4*A;for(let t=0;t0)return e;const i=t*n;let o=Qr[i];if(void 0===o&&(o=new Float32Array(i),Qr[i]=o),0!==t){r.toArray(o,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(o,i)}return o}function $r(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n/gm;function no(e){return e.replace(to,ro)}function ro(e,t){const n=er[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return no(n)}const io=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,oo=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function ao(e){return e.replace(oo,Ao).replace(io,so)}function so(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Ao(e,t,n,r)}function Ao(e,t,n,r){let i="";for(let e=parseInt(t);e0&&(p+="\n"),m=[h,d].filter(Ki).join("\n"),m.length>0&&(m+="\n")):(p=[lo(n),"#define SHADER_NAME "+n.shaderName,d,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#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 "+c:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",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.morphTargets&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargets&&n.isWebGL2?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+A:"",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","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\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(Ki).join("\n"),m=[h,lo(n),"#define SHADER_NAME "+n.shaderName,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 "+l:"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",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.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",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 "+A:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?er.tonemapping_pars_fragment:"",0!==n.toneMapping?Ji("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.transparent?"":"#define OPAQUE",er.encodings_pars_fragment,Zi("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Ki).join("\n")),a=no(a),a=$i(a,n),a=eo(a,n),s=no(s),s=$i(s,n),s=eo(s,n),a=ao(a),s=ao(s),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(g="#version 300 es\n",p=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+p,m=["#define varying in",n.glslVersion===ne?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===ne?"":"#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"+m);const v=g+m+s,y=Qi(i,35633,g+p+a),x=Qi(i,35632,v);if(i.attachShader(f,y),i.attachShader(f,x),void 0!==n.index0AttributeName?i.bindAttribLocation(f,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(f,0,"position"),i.linkProgram(f),e.debug.checkShaderErrors){const e=i.getProgramInfoLog(f).trim(),t=i.getShaderInfoLog(y).trim(),n=i.getShaderInfoLog(x).trim();let r=!0,o=!0;if(!1===i.getProgramParameter(f,35714)){r=!1;const t=Xi(i,y,"vertex"),n=Xi(i,x,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(f,35715)+"\n\nProgram Info Log: "+e+"\n"+t+"\n"+n)}else""!==e?console.warn("THREE.WebGLProgram: Program Info Log:",e):""!==t&&""!==n||(o=!1);o&&(this.diagnostics={runnable:r,programLog:e,vertexShader:{log:t,prefix:p},fragmentShader:{log:n,prefix:m}})}let b,S;return i.deleteShader(y),i.deleteShader(x),this.getUniforms=function(){return void 0===b&&(b=new Wi(i,f)),b},this.getAttributes=function(){return void 0===S&&(S=function(e,t){const n={},r=e.getProgramParameter(t,35721);for(let i=0;i0,L=o.clearcoat>0;return{isWebGL2:c,shaderID:_,shaderName:o.type,vertexShader:S,fragmentShader:E,defines:o.defines,customVertexShaderID:T,customFragmentShaderID:C,isRawShaderMaterial:!0===o.isRawShaderMaterial,glslVersion:o.glslVersion,precision:p,instancing:!0===v.isInstancedMesh,instancingColor:!0===v.isInstancedMesh&&null!==v.instanceColor,supportsVertexTextures:f,outputEncoding:null===R?e.outputEncoding:!0===R.isXRRenderTarget?R.texture.encoding:J,map:!!o.map,matcap:!!o.matcap,envMap:!!b,envMapMode:b&&b.mapping,envMapCubeUV:!!b&&(b.mapping===M||307===b.mapping),lightMap:!!o.lightMap,aoMap:!!o.aoMap,emissiveMap:!!o.emissiveMap,bumpMap:!!o.bumpMap,normalMap:!!o.normalMap,objectSpaceNormalMap:1===o.normalMapType,tangentSpaceNormalMap:0===o.normalMapType,decodeVideoTexture:!!o.map&&!0===o.map.isVideoTexture&&o.map.encoding===K,clearcoat:L,clearcoatMap:L&&!!o.clearcoatMap,clearcoatRoughnessMap:L&&!!o.clearcoatRoughnessMap,clearcoatNormalMap:L&&!!o.clearcoatNormalMap,displacementMap:!!o.displacementMap,roughnessMap:!!o.roughnessMap,metalnessMap:!!o.metalnessMap,specularMap:!!o.specularMap,specularIntensityMap:!!o.specularIntensityMap,specularColorMap:!!o.specularColorMap,transparent:o.transparent,alphaMap:!!o.alphaMap,alphaTest:P,gradientMap:!!o.gradientMap,sheen:o.sheen>0,sheenColorMap:!!o.sheenColorMap,sheenRoughnessMap:!!o.sheenRoughnessMap,transmission:o.transmission>0,transmissionMap:!!o.transmissionMap,thicknessMap:!!o.thicknessMap,combine:o.combine,vertexTangents:!!o.normalMap&&!!v.geometry&&!!v.geometry.attributes.tangent,vertexColors:o.vertexColors,vertexAlphas:!0===o.vertexColors&&!!v.geometry&&!!v.geometry.attributes.color&&4===v.geometry.attributes.color.itemSize,vertexUvs:!!(o.map||o.bumpMap||o.normalMap||o.specularMap||o.alphaMap||o.emissiveMap||o.roughnessMap||o.metalnessMap||o.clearcoatMap||o.clearcoatRoughnessMap||o.clearcoatNormalMap||o.displacementMap||o.transmissionMap||o.thicknessMap||o.specularIntensityMap||o.specularColorMap||o.sheenColorMap||o.sheenRoughnessMap),uvsVertexOnly:!(o.map||o.bumpMap||o.normalMap||o.specularMap||o.alphaMap||o.emissiveMap||o.roughnessMap||o.metalnessMap||o.clearcoatNormalMap||o.transmission>0||o.transmissionMap||o.thicknessMap||o.specularIntensityMap||o.specularColorMap||o.sheen>0||o.sheenColorMap||o.sheenRoughnessMap||!o.displacementMap),fog:!!y,useFog:o.fog,fogExp2:y&&y.isFogExp2,flatShading:!!o.flatShading,sizeAttenuation:o.sizeAttenuation,logarithmicDepthBuffer:u,skinning:!0===v.isSkinnedMesh&&w>0,maxBones:w,useVertexTexture:h,morphTargets:!!v.geometry&&!!v.geometry.morphAttributes.position,morphNormals:!!v.geometry&&!!v.geometry.morphAttributes.normal,morphTargetsCount:v.geometry&&v.geometry.morphAttributes.position?v.geometry.morphAttributes.position.length:0,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:o.dithering,shadowMapEnabled:e.shadowMap.enabled&&l.length>0,shadowMapType:e.shadowMap.type,toneMapping:o.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:o.premultipliedAlpha,doubleSided:2===o.side,flipSided:1===o.side,depthPacking:void 0!==o.depthPacking&&o.depthPacking,index0AttributeName:o.index0AttributeName,extensionDerivatives:o.extensions&&o.extensions.derivatives,extensionFragDepth:o.extensions&&o.extensions.fragDepth,extensionDrawBuffers:o.extensions&&o.extensions.drawBuffers,extensionShaderTextureLOD:o.extensions&&o.extensions.shaderTextureLOD,rendererExtensionFragDepth:c||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:c||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:c||r.has("EXT_shader_texture_lod"),customProgramCacheKey:o.customProgramCacheKey()}},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(!function(e,t){e.push(t.precision),e.push(t.outputEncoding),e.push(t.envMapMode),e.push(t.combine),e.push(t.vertexUvs),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.maxBones),e.push(t.morphTargetsCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection)}(n,t),function(e,t){s.disableAll(),t.isWebGL2&&s.enable(0);t.supportsVertexTextures&&s.enable(1);t.instancing&&s.enable(2);t.instancingColor&&s.enable(3);t.map&&s.enable(4);t.matcap&&s.enable(5);t.envMap&&s.enable(6);t.envMapCubeUV&&s.enable(7);t.lightMap&&s.enable(8);t.aoMap&&s.enable(9);t.emissiveMap&&s.enable(10);t.bumpMap&&s.enable(11);t.normalMap&&s.enable(12);t.objectSpaceNormalMap&&s.enable(13);t.tangentSpaceNormalMap&&s.enable(14);t.clearcoat&&s.enable(15);t.clearcoatMap&&s.enable(16);t.clearcoatRoughnessMap&&s.enable(17);t.clearcoatNormalMap&&s.enable(18);t.displacementMap&&s.enable(19);t.specularMap&&s.enable(20);t.roughnessMap&&s.enable(21);t.metalnessMap&&s.enable(22);t.gradientMap&&s.enable(23);t.alphaMap&&s.enable(24);t.alphaTest&&s.enable(25);t.vertexColors&&s.enable(26);t.vertexAlphas&&s.enable(27);t.vertexUvs&&s.enable(28);t.vertexTangents&&s.enable(29);t.uvsVertexOnly&&s.enable(30);t.fog&&s.enable(31);e.push(s.mask),s.disableAll(),t.useFog&&s.enable(0);t.flatShading&&s.enable(1);t.logarithmicDepthBuffer&&s.enable(2);t.skinning&&s.enable(3);t.useVertexTexture&&s.enable(4);t.morphTargets&&s.enable(5);t.morphNormals&&s.enable(6);t.premultipliedAlpha&&s.enable(7);t.shadowMapEnabled&&s.enable(8);t.physicallyCorrectLights&&s.enable(9);t.doubleSided&&s.enable(10);t.flipSided&&s.enable(11);t.depthPacking&&s.enable(12);t.dithering&&s.enable(13);t.specularIntensityMap&&s.enable(14);t.specularColorMap&&s.enable(15);t.transmission&&s.enable(16);t.transmissionMap&&s.enable(17);t.thicknessMap&&s.enable(18);t.sheen&&s.enable(19);t.sheenColorMap&&s.enable(20);t.sheenRoughnessMap&&s.enable(21);t.decodeVideoTexture&&s.enable(22);t.transparent&&s.enable(23);e.push(s.mask)}(n,t),n.push(e.outputEncoding)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=m[e.type];let n;if(t){const e=nr[t];n=Bn.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let r;for(let e=0,t=l.length;e0?r.push(c):!0===a.transparent?i.push(c):n.push(c)},unshift:function(e,t,a,s,A,l){const c=o(e,t,a,s,A,l);a.transmission>0?r.unshift(c):!0===a.transparent?i.unshift(c):n.unshift(c)},finish:function(){for(let n=t,r=e.length;n1&&n.sort(e||go),r.length>1&&r.sort(t||vo),i.length>1&&i.sort(t||vo)}}}function xo(){let e=new WeakMap;return{get:function(t,n){let r;return!1===e.has(t)?(r=new yo,e.set(t,[r])):n>=e.get(t).length?(r=new yo,e.get(t).push(r)):r=e.get(t)[n],r},dispose:function(){e=new WeakMap}}}function bo(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new Be,color:new Ee};break;case"SpotLight":n={position:new Be,direction:new Be,color:new Ee,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Be,color:new Ee,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Be,skyColor:new Ee,groundColor:new Ee};break;case"RectAreaLight":n={color:new Ee,position:new Be,halfWidth:new Be,halfHeight:new Be}}return e[t.id]=n,n}}}let _o=0;function wo(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Mo(e,t){const n=new bo,r=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new me};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new me,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let e=0;e<9;e++)i.probe.push(new Be);const o=new Be,a=new dt,s=new dt;return{setup:function(o,a){let s=0,A=0,l=0;for(let e=0;e<9;e++)i.probe[e].set(0,0,0);let c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0;o.sort(wo);const v=!0!==a?Math.PI:1;for(let e=0,t=o.length;e0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=tr.LTC_FLOAT_1,i.rectAreaLTC2=tr.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=tr.LTC_HALF_1,i.rectAreaLTC2=tr.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=s,i.ambient[1]=A,i.ambient[2]=l;const y=i.hash;y.directionalLength===c&&y.pointLength===u&&y.spotLength===h&&y.rectAreaLength===d&&y.hemiLength===f&&y.numDirectionalShadows===p&&y.numPointShadows===m&&y.numSpotShadows===g||(i.directional.length=c,i.spot.length=h,i.rectArea.length=d,i.point.length=u,i.hemi.length=f,i.directionalShadow.length=p,i.directionalShadowMap.length=p,i.pointShadow.length=m,i.pointShadowMap.length=m,i.spotShadow.length=g,i.spotShadowMap.length=g,i.directionalShadowMatrix.length=p,i.pointShadowMatrix.length=m,i.spotShadowMatrix.length=g,y.directionalLength=c,y.pointLength=u,y.spotLength=h,y.rectAreaLength=d,y.hemiLength=f,y.numDirectionalShadows=p,y.numPointShadows=m,y.numSpotShadows=g,i.version=_o++)},setupView:function(e,t){let n=0,r=0,A=0,l=0,c=0;const u=t.matrixWorldInverse;for(let t=0,h=e.length;t=n.get(r).length?(o=new So(e,t),n.get(r).push(o)):o=n.get(r)[i],o},dispose:function(){n=new WeakMap}}}class To extends Jt{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}To.prototype.isMeshDepthMaterial=!0;class Co extends Jt{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new Be,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}Co.prototype.isMeshDistanceMaterial=!0;function Ro(e,t,n){let r=new Zn;const i=new me,o=new me,a=new qe,s=new To({depthPacking:3201}),A=new Co,l={},c=n.maxTextureSize,u={0:1,1:0,2:2},h=new kn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new me},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),d=h.clone();d.defines.HORIZONTAL_PASS=1;const f=new dn;f.setAttribute("position",new tn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const p=new Ln(f,h),m=this;function g(n,r){const i=t.update(p);h.defines.VSM_SAMPLES!==n.blurSamples&&(h.defines.VSM_SAMPLES=n.blurSamples,d.defines.VSM_SAMPLES=n.blurSamples,h.needsUpdate=!0,d.needsUpdate=!0),h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,h,p,null),d.uniforms.shadow_pass.value=n.mapPass.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,d,p,null)}function v(t,n,r,i,o,a,c){let h=null;const d=!0===i.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(h=void 0!==d?d:!0===i.isPointLight?A:s,e.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length||r.displacementMap&&0!==r.displacementScale||r.alphaMap&&r.alphaTest>0){const e=h.uuid,t=r.uuid;let n=l[e];void 0===n&&(n={},l[e]=n);let i=n[t];void 0===i&&(i=h.clone(),n[t]=i),h=i}return h.visible=r.visible,h.wireframe=r.wireframe,h.side=3===c?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:u[r.side],h.alphaMap=r.alphaMap,h.alphaTest=r.alphaTest,h.clipShadows=r.clipShadows,h.clippingPlanes=r.clippingPlanes,h.clipIntersection=r.clipIntersection,h.displacementMap=r.displacementMap,h.displacementScale=r.displacementScale,h.displacementBias=r.displacementBias,h.wireframeLinewidth=r.wireframeLinewidth,h.linewidth=r.linewidth,!0===i.isPointLight&&!0===h.isMeshDistanceMaterial&&(h.referencePosition.setFromMatrixPosition(i.matrixWorld),h.nearDistance=o,h.farDistance=a),h}function y(n,i,o,a,s){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);const r=t.update(n),i=n.material;if(Array.isArray(i)){const t=r.groups;for(let A=0,l=t.length;Ac||i.y>c)&&(i.x>c&&(o.x=Math.floor(c/d.x),i.x=o.x*d.x,u.mapSize.x=o.x),i.y>c&&(o.y=Math.floor(c/d.y),i.y=o.y*d.y,u.mapSize.y=o.y)),null===u.map&&!u.isPointLightShadow&&3===this.type){const e={minFilter:R,magFilter:R,format:k};u.map=new De(i.x,i.y,e),u.map.texture.name=l.name+".shadowMap",u.mapPass=new De(i.x,i.y,e),u.camera.updateProjectionMatrix()}if(null===u.map){const e={minFilter:C,magFilter:C,format:k};u.map=new De(i.x,i.y,e),u.map.texture.name=l.name+".shadowMap",u.camera.updateProjectionMatrix()}e.setRenderTarget(u.map),e.clear();const f=u.getViewportCount();for(let e=0;e=1):-1!==P.indexOf("OpenGL ES")&&(R=parseFloat(/^OpenGL ES (\d)/.exec(P)[1]),C=R>=2);let L=null,q={};const D=e.getParameter(3088),I=e.getParameter(2978),O=(new qe).fromArray(D),B=(new qe).fromArray(I);function k(t,n,r){const i=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let t=0;tr||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){const r=t?fe:Math.floor,o=r(i*e.width),a=r(i*e.height);void 0===f&&(f=m(o,a));const s=n?m(o,a):f;s.width=o,s.height=a;return s.getContext("2d").drawImage(e,0,0,o,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+a+")."),s}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function v(e){return de(e.width)&&de(e.height)}function y(e,t){return e.generateMipmaps&&t&&e.minFilter!==C&&e.minFilter!==R}function x(t){e.generateMipmap(t)}function b(n,r,i,o,a=!1){if(!1===s)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+"'")}let A=r;return 6403===r&&(5126===i&&(A=33326),5131===i&&(A=33325),5121===i&&(A=33321)),33319===r&&(5126===i&&(A=33328),5131===i&&(A=33327),5121===i&&(A=33323)),6408===r&&(5126===i&&(A=34836),5131===i&&(A=34842),5121===i&&(A=o===K&&!1===a?35907:32856),32819===i&&(A=32854),32820===i&&(A=32855)),33325!==A&&33326!==A&&33327!==A&&33328!==A&&34842!==A&&34836!==A||t.get("EXT_color_buffer_float"),A}function _(e,t,n){return!0===y(e,n)||e.isFramebufferTexture&&e.minFilter!==C&&e.minFilter!==R?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function w(e){return e===C||1004===e||1005===e?9728:9729}function M(t){const n=t.target;n.removeEventListener("dispose",M),function(t){const n=r.get(t);if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture),r.remove(t)}(n),n.isVideoTexture&&d.delete(n),a.memory.textures--}function U(t){const n=t.target;n.removeEventListener("dispose",U),function(t){const n=t.texture,i=r.get(t),o=r.get(n);if(!t)return;void 0!==o.__webglTexture&&(e.deleteTexture(o.__webglTexture),a.memory.textures--);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(i.__webglFramebuffer[t]),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[t]);else e.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&e.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer&&e.deleteRenderbuffer(i.__webglColorRenderbuffer),i.__webglDepthRenderbuffer&&e.deleteRenderbuffer(i.__webglDepthRenderbuffer);if(t.isWebGLMultipleRenderTargets)for(let t=0,i=n.length;t0&&i.__version!==e.version){const n=e.image;if(void 0===n)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==n.complete)return void Y(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 G(t,i){const a=r.get(t);t.version>0&&a.__version!==t.version?function(t,r,i){if(6!==r.image.length)return;Q(t,r),n.activeTexture(33984+i),n.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment),e.pixelStorei(37443,0);const a=r&&(r.isCompressedTexture||r.image[0].isCompressedTexture),A=r.image[0]&&r.image[0].isDataTexture,c=[];for(let e=0;e<6;e++)c[e]=a||A?A?r.image[e].image:r.image[e]:g(r.image[e],!1,!0,l),c[e]=te(r,c[e]);const u=c[0],h=v(u)||s,d=o.convert(r.format,r.encoding),f=o.convert(r.type),p=b(r.internalFormat,d,f,r.encoding),m=s&&!0!==r.isVideoTexture,w=void 0===t.__version;let M,S=_(r,u,h);if(W(34067,r,h),a){m&&w&&n.texStorage2D(34067,S,p,u.width,u.height);for(let e=0;e<6;e++){M=c[e].mipmaps;for(let t=0;t0&&S++,n.texStorage2D(34067,S,p,c[0].width,c[0].height));for(let e=0;e<6;e++)if(A){m?n.texSubImage2D(34069+e,0,0,0,c[e].width,c[e].height,d,f,c[e].data):n.texImage2D(34069+e,0,p,c[e].width,c[e].height,0,d,f,c[e].data);for(let t=0;t1||r.get(o).__currentAnisotropy)&&(e.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),r.get(o).__currentAnisotropy=o.anisotropy)}}function Q(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",M),t.__webglTexture=e.createTexture(),a.memory.textures++)}function Y(t,r,i){let a=3553;r.isDataTexture2DArray&&(a=35866),r.isDataTexture3D&&(a=32879),Q(t,r),n.activeTexture(33984+i),n.bindTexture(a,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment),e.pixelStorei(37443,0);const A=function(e){return!s&&(e.wrapS!==E||e.wrapT!==E||e.minFilter!==C&&e.minFilter!==R)}(r)&&!1===v(r.image);let l=g(r.image,A,!1,c);l=te(r,l);const u=v(l)||s,h=o.convert(r.format,r.encoding);let d,f=o.convert(r.type),p=b(r.internalFormat,h,f,r.encoding,r.isVideoTexture);W(a,r,u);const m=r.mipmaps,w=s&&!0!==r.isVideoTexture,M=void 0===t.__version,S=_(r,l,u);if(r.isDepthTexture)p=6402,s?p=r.type===I?36012:r.type===D?33190:r.type===B?35056:33189:r.type===I&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),r.format===N&&6402===p&&r.type!==q&&r.type!==D&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=q,f=o.convert(r.type)),r.format===z&&6402===p&&(p=34041,r.type!==B&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=B,f=o.convert(r.type))),w&&M?n.texStorage2D(3553,1,p,l.width,l.height):n.texImage2D(3553,0,p,l.width,l.height,0,h,f,null);else if(r.isDataTexture)if(m.length>0&&u){w&&M&&n.texStorage2D(3553,S,p,m[0].width,m[0].height);for(let e=0,t=m.length;e0&&u){w&&M&&n.texStorage2D(3553,S,p,m[0].width,m[0].height);for(let e=0,t=m.length;e=A&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+A),F+=1,e},this.resetTextureUnits=function(){F=0},this.setTexture2D=H,this.setTexture2DArray=function(e,t){const i=r.get(e);e.version>0&&i.__version!==e.version?Y(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){const i=r.get(e);e.version>0&&i.__version!==e.version?Y(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=G,this.rebindTextures=function(e,t,n){const i=r.get(e);void 0!==t&&X(i.__webglFramebuffer,e,e.texture,36064,3553),void 0!==n&&$(e)},this.setupRenderTarget=function(t){const A=t.texture,l=r.get(t),c=r.get(A);t.addEventListener("dispose",U),!0!==t.isWebGLMultipleRenderTargets&&(void 0===c.__webglTexture&&(c.__webglTexture=e.createTexture()),c.__version=A.version,a.memory.textures++);const u=!0===t.isWebGLCubeRenderTarget,h=!0===t.isWebGLMultipleRenderTargets,d=A.isDataTexture3D||A.isDataTexture2DArray,f=v(t)||s;if(u){l.__webglFramebuffer=[];for(let t=0;t<6;t++)l.__webglFramebuffer[t]=e.createFramebuffer()}else if(l.__webglFramebuffer=e.createFramebuffer(),h)if(i.drawBuffers){const n=t.texture;for(let t=0,i=n.length;ts+l?(A.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!A.inputState.pinching&&a<=s-l&&(A.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==s&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),i.linearVelocity?(s.hasLinearVelocity=!0,s.linearVelocity.copy(i.linearVelocity)):s.hasLinearVelocity=!1,i.angularVelocity?(s.hasAngularVelocity=!0,s.angularVelocity.copy(i.angularVelocity)):s.hasAngularVelocity=!1));return null!==a&&(a.visible=null!==r),null!==s&&(s.visible=null!==i),null!==A&&(A.visible=null!==o),this}}class ko extends Pe{constructor(e,t,n,r,i,o,a,s,A,l){if((l=void 0!==l?l:N)!==N&&l!==z)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&l===N&&(n=q),void 0===n&&l===z&&(n=B),super(null,r,i,o,a,s,l,n,A),this.image={width:e,height:t},this.magFilter=void 0!==a?a:C,this.minFilter=void 0!==s?s:C,this.flipY=!1,this.generateMipmaps=!1}}ko.prototype.isDepthTexture=!0;class No extends ie{constructor(e,t){super();const n=this;let r=null,i=1,o=null,a="local-floor";const s=e.extensions.has("WEBGL_multisampled_render_to_texture");let A=null,l=null,c=null,u=null,h=!1,d=null;const f=t.getContextAttributes();let p=null,m=null;const g=[],v=new Map,y=new zn;y.layers.enable(1),y.viewport=new qe;const x=new zn;x.layers.enable(2),x.viewport=new qe;const b=[y,x],_=new Do;_.layers.enable(1),_.layers.enable(2);let w=null,M=null;function S(e){const t=v.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function E(){v.forEach((function(e,t){e.disconnect(t)})),v.clear(),w=null,M=null,e.setRenderTarget(p),u=null,c=null,l=null,r=null,m=null,I.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function T(e){const t=r.inputSources;for(let e=0;e0&&(t.alphaTest.value=n.alphaTest);const r=e.get(n).envMap;let i,o;r&&(t.envMap.value=r,t.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,t.reflectivity.value=n.reflectivity,t.ior.value=n.ior,t.refractionRatio.value=n.refractionRatio),n.lightMap&&(t.lightMap.value=n.lightMap,t.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(t.aoMap.value=n.aoMap,t.aoMapIntensity.value=n.aoMapIntensity),n.map?i=n.map:n.specularMap?i=n.specularMap:n.displacementMap?i=n.displacementMap:n.normalMap?i=n.normalMap:n.bumpMap?i=n.bumpMap:n.roughnessMap?i=n.roughnessMap:n.metalnessMap?i=n.metalnessMap:n.alphaMap?i=n.alphaMap:n.emissiveMap?i=n.emissiveMap:n.clearcoatMap?i=n.clearcoatMap:n.clearcoatNormalMap?i=n.clearcoatNormalMap:n.clearcoatRoughnessMap?i=n.clearcoatRoughnessMap:n.specularIntensityMap?i=n.specularIntensityMap:n.specularColorMap?i=n.specularColorMap:n.transmissionMap?i=n.transmissionMap:n.thicknessMap?i=n.thicknessMap:n.sheenColorMap?i=n.sheenColorMap:n.sheenRoughnessMap&&(i=n.sheenRoughnessMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix)),n.aoMap?o=n.aoMap:n.lightMap&&(o=n.lightMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),t.uv2Transform.value.copy(o.matrix))}function n(t,n){t.roughness.value=n.roughness,t.metalness.value=n.metalness,n.roughnessMap&&(t.roughnessMap.value=n.roughnessMap),n.metalnessMap&&(t.metalnessMap.value=n.metalnessMap),n.emissiveMap&&(t.emissiveMap.value=n.emissiveMap),n.bumpMap&&(t.bumpMap.value=n.bumpMap,t.bumpScale.value=n.bumpScale,1===n.side&&(t.bumpScale.value*=-1)),n.normalMap&&(t.normalMap.value=n.normalMap,t.normalScale.value.copy(n.normalScale),1===n.side&&t.normalScale.value.negate()),n.displacementMap&&(t.displacementMap.value=n.displacementMap,t.displacementScale.value=n.displacementScale,t.displacementBias.value=n.displacementBias);e.get(n).envMap&&(t.envMapIntensity.value=n.envMapIntensity)}return{refreshFogUniforms: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)},refreshMaterialUniforms:function(e,r,i,o,a){r.isMeshBasicMaterial?t(e,r):r.isMeshLambertMaterial?(t(e,r),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(e,r)):r.isMeshToonMaterial?(t(e,r),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap);t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshPhongMaterial?(t(e,r),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshStandardMaterial?(t(e,r),r.isMeshPhysicalMaterial?function(e,t,r){n(e,t),e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap));t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,1===t.side&&e.clearcoatNormalScale.value.negate()));t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor));e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap);t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap)}(e,r,a):n(e,r)):r.isMeshMatcapMaterial?(t(e,r),function(e,t){t.matcap&&(e.matcap.value=t.matcap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshDepthMaterial?(t(e,r),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isMeshDistanceMaterial?(t(e,r),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}(e,r)):r.isMeshNormalMaterial?(t(e,r),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(e,r)):r.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,r),r.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,r)):r.isPointsMaterial?function(e,t,n,r){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=.5*r,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);t.alphaTest>0&&(e.alphaTest.value=t.alphaTest);let i;t.map?i=t.map:t.alphaMap&&(i=t.alphaMap);void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix))}(e,r,i,o):r.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);t.alphaTest>0&&(e.alphaTest.value=t.alphaTest);let 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))}(e,r):r.isShadowMaterial?(e.color.value.copy(r.color),e.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function Uo(e={}){const t=void 0!==e.canvas?e.canvas:function(){const e=ye("canvas");return e.style.display="block",e}(),n=void 0!==e.context?e.context:null,r=void 0!==e.alpha&&e.alpha,i=void 0===e.depth||e.depth,o=void 0===e.stencil||e.stencil,a=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,A=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,l=void 0!==e.powerPreference?e.powerPreference:"default",c=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat;let u=null,h=null;const d=[],f=[];this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=J,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1;const p=this;let m=!1,g=0,v=0,y=null,x=-1,b=null;const _=new qe,w=new qe;let M=null,S=t.width,T=t.height,R=1,q=null,D=null;const B=new qe(0,0,S,T),N=new qe(0,0,S,T);let z=!1;const U=new Zn;let F=!1,H=!1,G=null;const V=new dt,j=new Be,W={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Q(){return null===y?R:1}let Y,X,Z,K,$,ee,te,ne,re,ie,oe,ae,se,Ae,le,ce,ue,he,de,fe,pe,me,ge,ve=n;function xe(e,n){for(let r=0;r0&&function(e,t,n){if(null===G){const e=!0===a&&!0===X.isWebGL2;G=new(e?Ie:De)(1024,1024,{generateMipmaps:!0,type:null!==me.convert(O)?O:L,minFilter:P,magFilter:C,wrapS:E,wrapT:E,useRenderToTexture:Y.has("WEBGL_multisampled_render_to_texture")})}const r=p.getRenderTarget();p.setRenderTarget(G),p.clear();const i=p.toneMapping;p.toneMapping=0,Oe(e,t,n),p.toneMapping=i,ee.updateMultisampleRenderTarget(G),ee.updateRenderTargetMipmap(G),p.setRenderTarget(r)}(i,t,n),r&&Z.viewport(_.copy(r)),i.length>0&&Oe(i,t,n),o.length>0&&Oe(o,t,n),s.length>0&&Oe(s,t,n)}function Oe(e,t,n){const r=!0===t.isScene?t.overrideMaterial:null;for(let i=0,o=e.length;i0?f[f.length-1]:null,d.pop(),u=d.length>0?d[d.length-1]:null},this.getActiveCubeFace=function(){return g},this.getActiveMipmapLevel=function(){return v},this.getRenderTarget=function(){return y},this.setRenderTargetTextures=function(e,t,n){$.get(e.texture).__webglTexture=t,$.get(e.depthTexture).__webglTexture=n;const r=$.get(e);r.__hasExternalTextures=!0,r.__hasExternalTextures&&(r.__autoAllocateDepthBuffer=void 0===n,r.__autoAllocateDepthBuffer||e.useRenderToTexture&&(console.warn("render-to-texture extension was disabled because an external texture was provided"),e.useRenderToTexture=!1,e.useRenderbuffer=!0))},this.setRenderTargetFramebuffer=function(e,t){const n=$.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,n=0){y=e,g=t,v=n;let r=!0;if(e){const t=$.get(e);void 0!==t.__useDefaultFramebuffer?(Z.bindFramebuffer(36160,null),r=!1):void 0===t.__webglFramebuffer?ee.setupRenderTarget(e):t.__hasExternalTextures&&ee.rebindTextures(e,$.get(e.texture).__webglTexture,$.get(e.depthTexture).__webglTexture)}let i=null,o=!1,a=!1;if(e){const n=e.texture;(n.isDataTexture3D||n.isDataTexture2DArray)&&(a=!0);const r=$.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=r[t],o=!0):i=e.useRenderbuffer?$.get(e).__webglMultisampledFramebuffer:r,_.copy(e.viewport),w.copy(e.scissor),M=e.scissorTest}else _.copy(B).multiplyScalar(R).floor(),w.copy(N).multiplyScalar(R).floor(),M=z;if(Z.bindFramebuffer(36160,i)&&X.drawBuffers&&r&&Z.drawBuffers(e,i),Z.viewport(_),Z.scissor(w),Z.setScissorTest(M),o){const r=$.get(e.texture);ve.framebufferTexture2D(36160,36064,34069+t,r.__webglTexture,n)}else if(a){const r=$.get(e.texture),i=t||0;ve.framebufferTextureLayer(36160,36064,r.__webglTexture,n||0,i)}x=-1},this.readRenderTargetPixels=function(e,t,n,r,i,o,a){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=$.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==a&&(s=s[a]),s){Z.bindFramebuffer(36160,s);try{const a=e.texture,s=a.format,A=a.type;if(s!==k&&me.convert(s)!==ve.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const l=A===O&&(Y.has("EXT_color_buffer_half_float")||X.isWebGL2&&Y.has("EXT_color_buffer_float"));if(!(A===L||me.convert(A)===ve.getParameter(35738)||A===I&&(X.isWebGL2||Y.has("OES_texture_float")||Y.has("WEBGL_color_buffer_float"))||l))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===ve.checkFramebufferStatus(36160)?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&ve.readPixels(t,n,r,i,me.convert(s),me.convert(A),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const e=null!==y?$.get(y).__webglFramebuffer:null;Z.bindFramebuffer(36160,e)}}},this.copyFramebufferToTexture=function(e,t,n=0){if(!0!==t.isFramebufferTexture)return void console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");const r=Math.pow(2,-n),i=Math.floor(t.image.width*r),o=Math.floor(t.image.height*r);ee.setTexture2D(t,0),ve.copyTexSubImage2D(3553,n,0,0,e.x,e.y,i,o),Z.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r=0){const i=t.image.width,o=t.image.height,a=me.convert(n.format),s=me.convert(n.type);ee.setTexture2D(n,0),ve.pixelStorei(37440,n.flipY),ve.pixelStorei(37441,n.premultiplyAlpha),ve.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?ve.texSubImage2D(3553,r,e.x,e.y,i,o,a,s,t.image.data):t.isCompressedTexture?ve.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,a,t.mipmaps[0].data):ve.texSubImage2D(3553,r,e.x,e.y,a,s,t.image),0===r&&n.generateMipmaps&&ve.generateMipmap(3553),Z.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n,r,i=0){if(p.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const o=e.max.x-e.min.x+1,a=e.max.y-e.min.y+1,s=e.max.z-e.min.z+1,A=me.convert(r.format),l=me.convert(r.type);let c;if(r.isDataTexture3D)ee.setTexture3D(r,0),c=32879;else{if(!r.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");ee.setTexture2DArray(r,0),c=35866}ve.pixelStorei(37440,r.flipY),ve.pixelStorei(37441,r.premultiplyAlpha),ve.pixelStorei(3317,r.unpackAlignment);const u=ve.getParameter(3314),h=ve.getParameter(32878),d=ve.getParameter(3316),f=ve.getParameter(3315),m=ve.getParameter(32877),g=n.isCompressedTexture?n.mipmaps[0]:n.image;ve.pixelStorei(3314,g.width),ve.pixelStorei(32878,g.height),ve.pixelStorei(3316,e.min.x),ve.pixelStorei(3315,e.min.y),ve.pixelStorei(32877,e.min.z),n.isDataTexture||n.isDataTexture3D?ve.texSubImage3D(c,i,t.x,t.y,t.z,o,a,s,A,l,g.data):n.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ve.compressedTexSubImage3D(c,i,t.x,t.y,t.z,o,a,s,A,g.data)):ve.texSubImage3D(c,i,t.x,t.y,t.z,o,a,s,A,l,g),ve.pixelStorei(3314,u),ve.pixelStorei(32878,h),ve.pixelStorei(3316,d),ve.pixelStorei(3315,f),ve.pixelStorei(32877,m),0===i&&r.generateMipmaps&&ve.generateMipmap(c),Z.unbindTexture()},this.initTexture=function(e){ee.setTexture2D(e,0),Z.unbindTexture()},this.resetState=function(){g=0,v=0,y=null,Z.reset(),ge.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Uo.prototype.isWebGLRenderer=!0;(class extends Uo{}).prototype.isWebGL1Renderer=!0;class Fo extends Nt{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}Fo.prototype.isScene=!0;class Ho{constructor(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=ee,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=le()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;re.far||t.push({distance:s,point:Qo.clone(),uv:Xt.getUV(Qo,$o,ea,ta,na,ra,ia,new me),face:null,object:this})}copy(e){return super.copy(e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}).prototype.isSprite=!0;const aa=new Be,sa=new qe,Aa=new qe,la=new Be,ca=new dt;class ua extends Ln{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new dt,this.bindMatrixInverse=new dt}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new qe,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;ns)continue;u.applyMatrix4(this.matrixWorld);const h=e.ray.origin.distanceTo(u);he.far||t.push({distance:h,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,o.start),r=Math.min(i.count,o.start+o.count)-1;ns)continue;u.applyMatrix4(this.matrixWorld);const r=e.ray.origin.distanceTo(u);re.far||t.push({distance:r,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}wa.prototype.isLine=!0;const Ma=new Be,Sa=new Be;class Ea extends wa{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,r=t.count;ei.far)return;o.push({distance:A,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,object:a})}}(class extends Nt{constructor(e=new dn,t=new Ta){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,o=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Pa.copy(n.boundingSphere),Pa.applyMatrix4(r),Pa.radius+=i,!1===e.ray.intersectsSphere(Pa))return;Ca.copy(r).invert(),Ra.copy(e.ray).applyMatrix4(Ca);const a=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=a*a;if(n.isBufferGeometry){const i=n.index,a=n.attributes.position;if(null!==i){for(let n=Math.max(0,o.start),A=Math.min(i.count,o.start+o.count);n0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}).prototype.isPoints=!0;(class extends Pe{constructor(e,t,n,r,i,o,a,s,A){super(e,t,n,r,i,o,a,s,A),this.minFilter=void 0!==o?o:R,this.magFilter=void 0!==i?i:R,this.generateMipmaps=!1;const l=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){l.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}).prototype.isVideoTexture=!0;(class extends Pe{constructor(e,t,n){super({width:e,height:t}),this.format=n,this.magFilter=C,this.minFilter=C,this.generateMipmaps=!1,this.needsUpdate=!0}}).prototype.isFramebufferTexture=!0;(class extends Pe{constructor(e,t,n,r,i,o,a,s,A,l,c,u){super(null,o,a,s,A,l,r,i,c,u),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}).prototype.isCompressedTexture=!0;(class extends Pe{constructor(e,t,n,r,i,o,a,s,A){super(e,t,n,r,i,o,a,s,A),this.needsUpdate=!0}}).prototype.isCanvasTexture=!0;class Da extends dn{constructor(e=1,t=8,n=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);const i=[],o=[],a=[],s=[],A=new Be,l=new me;o.push(0,0,0),a.push(0,0,1),s.push(.5,.5);for(let i=0,c=3;i<=t;i++,c+=3){const u=n+i/t*r;A.x=e*Math.cos(u),A.y=e*Math.sin(u),o.push(A.x,A.y,A.z),a.push(0,0,1),l.x=(o[c]/e+1)/2,l.y=(o[c+1]/e+1)/2,s.push(l.x,l.y)}for(let e=1;e<=t;e++)i.push(e,e+1,0);this.setIndex(i),this.setAttribute("position",new on(o,3)),this.setAttribute("normal",new on(a,3)),this.setAttribute("uv",new on(s,2))}static fromJSON(e){return new Da(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Ia extends dn{constructor(e=1,t=1,n=1,r=8,i=1,o=!1,a=0,s=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:o,thetaStart:a,thetaLength:s};const A=this;r=Math.floor(r),i=Math.floor(i);const l=[],c=[],u=[],h=[];let d=0;const f=[],p=n/2;let m=0;function g(n){const i=d,o=new me,f=new Be;let g=0;const v=!0===n?e:t,y=!0===n?1:-1;for(let e=1;e<=r;e++)c.push(0,p*y,0),u.push(0,y,0),h.push(.5,.5),d++;const x=d;for(let e=0;e<=r;e++){const t=e/r*s+a,n=Math.cos(t),i=Math.sin(t);f.x=v*i,f.y=p*y,f.z=v*n,c.push(f.x,f.y,f.z),u.push(0,y,0),o.x=.5*n+.5,o.y=.5*i*y+.5,h.push(o.x,o.y),d++}for(let e=0;e0&&g(!0),t>0&&g(!1)),this.setIndex(l),this.setAttribute("position",new on(c,3)),this.setAttribute("normal",new on(u,3)),this.setAttribute("uv",new on(h,2))}static fromJSON(e){return new Ia(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}new Be,new Be,new Be,new Xt;class Oa{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),i=0;t.push(0);for(let o=1;o<=e;o++)n=this.getPoint(o/e),i+=n.distanceTo(r),t.push(i),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let r=0;const i=n.length;let o;o=t||e*n[i-1];let a,s=0,A=i-1;for(;s<=A;)if(r=Math.floor(s+(A-s)/2),a=n[r]-o,a<0)s=r+1;else{if(!(a>0)){A=r;break}A=r-1}if(r=A,n[r]===o)return r/(i-1);const l=n[r];return(r+(o-l)/(n[r+1]-l))/(i-1)}getTangent(e,t){const n=1e-4;let r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);const o=this.getPoint(r),a=this.getPoint(i),s=t||(o.isVector2?new me:new Be);return s.copy(a).sub(o).normalize(),s}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new Be,r=[],i=[],o=[],a=new Be,s=new dt;for(let t=0;t<=e;t++){const n=t/e;r[t]=this.getTangentAt(n,new Be)}i[0]=new Be,o[0]=new Be;let A=Number.MAX_VALUE;const l=Math.abs(r[0].x),c=Math.abs(r[0].y),u=Math.abs(r[0].z);l<=A&&(A=l,n.set(1,0,0)),c<=A&&(A=c,n.set(0,1,0)),u<=A&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],a),o[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),o[t]=o[t-1].clone(),a.crossVectors(r[t-1],r[t]),a.length()>Number.EPSILON){a.normalize();const e=Math.acos(ce(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(s.makeRotationAxis(a,e))}o[t].crossVectors(r[t],i[t])}if(!0===t){let t=Math.acos(ce(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(a.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],t*n)),o[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:o}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Ba extends Oa{constructor(e=0,t=0,n=1,r=1,i=0,o=2*Math.PI,a=!1,s=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=o,this.aClockwise=a,this.aRotation=s}getPoint(e,t){const n=t||new me,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const o=Math.abs(i)r;)i-=r;i0?0:(Math.floor(Math.abs(A)/i)+1)*i:0===l&&A===i-1&&(A=i-2,l=1),this.closed||A>0?a=r[(A-1)%i]:(za.subVectors(r[0],r[1]).add(r[0]),a=za);const c=r[A%i],u=r[(A+1)%i];if(this.closed||A+2r.length-2?r.length-1:o+1],c=r[o>r.length-3?r.length-1:o+2];return n.set(Va(a,s.x,A.x,l.x,c.x),Va(a,s.y,A.y,l.y,c.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){const e=r[i]-n,o=this.curves[i],a=o.getLength(),s=0===a?0:1-e/a;return o.getPointAt(s,t)}i++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){const e=A.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(A);const l=A.getPoint(1);return this.currentPoint.copy(l),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class ns extends ts{constructor(e){super(e),this.uuid=le(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,r=this.holes.length;n80*n){s=l=e[0],A=c=e[1];for(let t=n;tl&&(l=u),h>c&&(c=h);d=Math.max(l-s,c-A),d=0!==d?1/d:0}return as(o,a,n,s,A,d),a};function is(e,t,n,r,i){let o,a;if(i===function(e,t,n,r){let i=0;for(let o=t,a=n-r;o0)for(o=t;o=t;o-=r)a=Ss(o,e[o],e[o+1],a);return a&&ys(a,a.next)&&(Es(a),a=a.next),a}function os(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!ys(r,r.next)&&0!==vs(r.prev,r,r.next))r=r.next;else{if(Es(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function as(e,t,n,r,i,o,a){if(!e)return;!a&&o&&function(e,t,n,r){let i=e;do{null===i.z&&(i.z=fs(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){let t,n,r,i,o,a,s,A,l=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t0||A>0&&r;)0!==s&&(0===A||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,A--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(e,r,i,o);let s,A,l=e;for(;e.prev!==e.next;)if(s=e.prev,A=e.next,o?As(e,r,i,o):ss(e))t.push(s.i/n),t.push(e.i/n),t.push(A.i/n),Es(e),e=A.next,l=A.next;else if((e=A)===l){a?1===a?as(e=ls(os(e),t,n),t,n,r,i,o,2):2===a&&cs(e,t,n,r,i,o):as(os(e),t,n,r,i,o,1);break}}function ss(e){const t=e.prev,n=e,r=e.next;if(vs(t,n,r)>=0)return!1;let i=e.next.next;for(;i!==e.prev;){if(ms(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&vs(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function As(e,t,n,r){const i=e.prev,o=e,a=e.next;if(vs(i,o,a)>=0)return!1;const s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,u=fs(s,A,t,n,r),h=fs(l,c,t,n,r);let d=e.prevZ,f=e.nextZ;for(;d&&d.z>=u&&f&&f.z<=h;){if(d!==e.prev&&d!==e.next&&ms(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&vs(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,f!==e.prev&&f!==e.next&&ms(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&vs(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;d&&d.z>=u;){if(d!==e.prev&&d!==e.next&&ms(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&vs(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;f&&f.z<=h;){if(f!==e.prev&&f!==e.next&&ms(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&vs(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function ls(e,t,n){let r=e;do{const i=r.prev,o=r.next.next;!ys(i,o)&&xs(i,r,r.next,o)&&ws(i,o)&&ws(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),Es(r),Es(r.next),r=e=o),r=r.next}while(r!==e);return os(r)}function cs(e,t,n,r,i,o){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&gs(a,e)){let s=Ms(a,e);return a=os(a,a.next),s=os(s,s.next),as(a,t,n,r,i,o),void as(s,t,n,r,i,o)}e=e.next}a=a.next}while(a!==e)}function us(e,t){return e.x-t.x}function hs(e,t){if(t=function(e,t){let n=t;const r=e.x,i=e.y;let o,a=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a){if(a=e,e===r){if(i===n.y)return n;if(i===n.next.y)return n.next}o=n.x=n.x&&n.x>=A&&r!==n.x&&ms(io.x||n.x===o.x&&ds(o,n)))&&(o=n,u=c)),n=n.next}while(n!==s);return o}(e,t),t){const n=Ms(t,e);os(t,t.next),os(n,n.next)}}function ds(e,t){return vs(e.prev,e,t.prev)<0&&vs(t.next,e,e.next)<0}function fs(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 ps(e){let 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 gs(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&xs(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(ws(e,t)&&ws(t,e)&&function(e,t){let n=e,r=!1;const 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)&&(vs(e.prev,e,t.prev)||vs(e,t.prev,t))||ys(e,t)&&vs(e.prev,e,e.next)>0&&vs(t.prev,t,t.next)>0)}function vs(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function ys(e,t){return e.x===t.x&&e.y===t.y}function xs(e,t,n,r){const i=_s(vs(e,t,n)),o=_s(vs(e,t,r)),a=_s(vs(n,r,e)),s=_s(vs(n,r,t));return i!==o&&a!==s||(!(0!==i||!bs(e,n,t))||(!(0!==o||!bs(e,r,t))||(!(0!==a||!bs(n,e,r))||!(0!==s||!bs(n,t,r)))))}function bs(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function _s(e){return e>0?1:e<0?-1:0}function ws(e,t){return vs(e.prev,e,e.next)<0?vs(e,t,e.next)>=0&&vs(e,e.prev,t)>=0:vs(e,t,e.prev)<0||vs(e,e.next,t)<0}function Ms(e,t){const n=new Ts(e.i,e.x,e.y),r=new Ts(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 Ss(e,t,n,r){const i=new Ts(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 Es(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 Ts(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}class Cs{static area(e){const t=e.length;let n=0;for(let r=t-1,i=0;i2&&e[t-1].equals(e[0])&&e.pop()}function Ps(e,t){for(let n=0;nNumber.EPSILON){const u=Math.sqrt(c),h=Math.sqrt(A*A+l*l),d=t.x-s/u,f=t.y+a/u,p=((n.x-l/h-d)*l-(n.y+A/h-f)*A)/(a*l-s*A);r=d+a*p-e.x,i=f+s*p-e.y;const m=r*r+i*i;if(m<=2)return new me(r,i);o=Math.sqrt(m/2)}else{let e=!1;a>Number.EPSILON?A>Number.EPSILON&&(e=!0):a<-Number.EPSILON?A<-Number.EPSILON&&(e=!0):Math.sign(s)===Math.sign(l)&&(e=!0),e?(r=-s,i=a,o=Math.sqrt(c)):(r=a,i=s,o=Math.sqrt(c/2))}return new me(r/o,i/o)}const L=[];for(let e=0,t=E.length,n=t-1,r=e+1;e=0;e--){const t=e/d,n=c*Math.cos(t*Math.PI/2),r=u*Math.sin(t*Math.PI/2)+h;for(let e=0,t=E.length;e=0;){const r=n;let i=n-1;i<0&&(i=e.length-1);for(let e=0,n=s+2*d;e0)&&h.push(t,i,A),(e!==n-1||s0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}).prototype.isMeshPhysicalMaterial=!0;class Ns extends Jt{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new Ee(16777215),this.specular=new Ee(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ee(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(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.flatShading=e.flatShading,this}}Ns.prototype.isMeshPhongMaterial=!0;(class extends Jt{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ee(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ee(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),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.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}).prototype.isMeshToonMaterial=!0;(class extends Jt{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(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.flatShading=e.flatShading,this}}).prototype.isMeshNormalMaterial=!0;class zs extends Jt{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new Ee(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ee(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(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}}zs.prototype.isMeshLambertMaterial=!0;(class extends Jt{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ee(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new me(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(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.flatShading=e.flatShading,this}}).prototype.isMeshMatcapMaterial=!0;(class extends ga{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}).prototype.isLineDashedMaterial=!0;const Us={arraySlice:function(e,t,n){return Us.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){const t=e.length,n=new Array(t);for(let e=0;e!==t;++e)n[e]=e;return n.sort((function(t,n){return e[t]-e[n]})),n},sortedArray:function(e,t,n){const r=e.length,i=new e.constructor(r);for(let o=0,a=0;a!==r;++o){const r=n[o]*t;for(let n=0;n!==t;++n)i[a++]=e[r+n]}return i},flattenJSON:function(e,t,n,r){let i=1,o=e[0];for(;void 0!==o&&void 0===o[r];)o=e[i++];if(void 0===o)return;let a=o[r];if(void 0!==a)if(Array.isArray(a))do{a=o[r],void 0!==a&&(t.push(o.time),n.push.apply(n,a)),o=e[i++]}while(void 0!==o);else if(void 0!==a.toArray)do{a=o[r],void 0!==a&&(t.push(o.time),a.toArray(n,n.length)),o=e[i++]}while(void 0!==o);else do{a=o[r],void 0!==a&&(t.push(o.time),n.push(a)),o=e[i++]}while(void 0!==o)},subclip:function(e,t,n,r,i=30){const o=e.clone();o.name=t;const a=[];for(let e=0;e=r)){A.push(t.times[e]);for(let n=0;no.tracks[e].times[0]&&(s=o.tracks[e].times[0]);for(let e=0;e=r.times[u]){const e=u*A+s,t=e+A-s;h=Us.arraySlice(r.values,e,t)}else{const e=r.createInterpolant(),t=s,n=A-s;e.evaluate(o),h=Us.arraySlice(e.resultBuffer,t,n)}if("quaternion"===i){(new Oe).fromArray(h).normalize().conjugate().toArray(h)}const d=a.times.length;for(let e=0;e=i)break e;{const a=t[1];e=i)break t}o=n,n=0}}for(;n>>1;et;)--o;if(++o,0!==i||o!==r){i>=o&&(o=Math.max(o,1),i=o-1);const e=this.getValueSize();this.times=Us.arraySlice(n,i,o),this.values=Us.arraySlice(this.values,i*e,o*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let t=0;t!==i;t++){const r=n[t];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,r),e=!1;break}if(null!==o&&o>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,r,o),e=!1;break}o=r}if(void 0!==r&&Us.isTypedArray(r))for(let t=0,n=r.length;t!==n;++t){const n=r[t];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,n),e=!1;break}}return e}optimize(){const e=Us.arraySlice(this.times),t=Us.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===W,i=e.length-1;let o=1;for(let a=1;a0){e[o]=e[i];for(let e=i*n,r=o*n,a=0;a!==n;++a)t[r+a]=t[e+a];++o}return o!==e.length?(this.times=Us.arraySlice(e,0,o),this.values=Us.arraySlice(t,0,o*n)):(this.times=e,this.values=t),this}clone(){const e=Us.arraySlice(this.times,0),t=Us.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}js.prototype.TimeBufferType=Float32Array,js.prototype.ValueBufferType=Float32Array,js.prototype.DefaultInterpolation=j;class Ws extends js{}Ws.prototype.ValueTypeName="bool",Ws.prototype.ValueBufferType=Array,Ws.prototype.DefaultInterpolation=V,Ws.prototype.InterpolantFactoryMethodLinear=void 0,Ws.prototype.InterpolantFactoryMethodSmooth=void 0;class Qs extends js{}Qs.prototype.ValueTypeName="color";class Ys extends js{}Ys.prototype.ValueTypeName="number";class Xs extends Fs{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=(n-t)/(r-t);let A=e*a;for(let e=A+a;A!==e;A+=4)Oe.slerpFlat(i,0,o,A-a,o,A,s);return i}}class Zs extends js{InterpolantFactoryMethodLinear(e){return new Xs(this.times,this.values,this.getValueSize(),e)}}Zs.prototype.ValueTypeName="quaternion",Zs.prototype.DefaultInterpolation=j,Zs.prototype.InterpolantFactoryMethodSmooth=void 0;class Js extends js{}Js.prototype.ValueTypeName="string",Js.prototype.ValueBufferType=Array,Js.prototype.DefaultInterpolation=V,Js.prototype.InterpolantFactoryMethodLinear=void 0,Js.prototype.InterpolantFactoryMethodSmooth=void 0;class Ks extends js{}Ks.prototype.ValueTypeName="vector";class $s{constructor(e,t=-1,n,r=2500){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=le(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push(eA(n[e]).scale(r));const i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,r=n.length;e!==r;++e)t.push(js.toJSON(n[e]));return r}static CreateFromMorphTargetSequence(e,t,n,r){const i=t.length,o=[];for(let e=0;e1){const e=o[1];let t=r[e];t||(r[e]=t=[]),t.push(n)}}const o=[];for(const e in r)o.push(this.CreateFromMorphTargetSequence(e,r[e],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,r,i){if(0!==n.length){const o=[],a=[];Us.flattenJSON(n,o,a,r),0!==o.length&&i.push(new e(t,o,a))}},r=[],i=e.name||"default",o=e.fps||30,a=e.blendMode;let s=e.length||-1;const A=e.hierarchy||[];for(let e=0;e{t&&t(i),this.manager.itemEnd(e)}),0),i;if(void 0!==iA[e])return void iA[e].push({onLoad:t,onProgress:n,onError:r});iA[e]=[],iA[e].push({onLoad:t,onProgress:n,onError:r});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,s=this.responseType;fetch(o).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body.getReader)return t;const n=iA[e],r=t.body.getReader(),i=t.headers.get("Content-Length"),o=i?parseInt(i):0,a=0!==o;let s=0;const A=new ReadableStream({start(e){!function t(){r.read().then((({done:r,value:i})=>{if(r)e.close();else{s+=i.byteLength;const r=new ProgressEvent("progress",{lengthComputable:a,loaded:s,total:o});for(let e=0,t=n.length;e{switch(s){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,a)));case"json":return e.json();default:if(void 0===a)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(a),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then((e=>r.decode(e)))}}})).then((t=>{tA.add(e,t);const n=iA[e];delete iA[e];for(let e=0,r=n.length;e{const n=iA[e];if(void 0===n)throw this.manager.itemError(e),t;delete iA[e];for(let e=0,r=n.length;e{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class aA extends rA{constructor(e){super(e)}load(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,o=tA.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout((function(){t&&t(o),i.manager.itemEnd(e)}),0),o;const a=ye("img");function s(){l(),tA.add(e,this),t&&t(this),i.manager.itemEnd(e)}function A(t){l(),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}function l(){a.removeEventListener("load",s,!1),a.removeEventListener("error",A,!1)}return a.addEventListener("load",s,!1),a.addEventListener("error",A,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),i.manager.itemStart(e),a.src=e,a}}class sA extends rA{constructor(e){super(e)}load(e,t,n,r){const i=new Hn,o=new aA(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let a=0;function s(n){o.load(e[n],(function(e){i.images[n]=e,a++,6===a&&(i.needsUpdate=!0,t&&t(i))}),void 0,r)}for(let t=0;t0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(n[e]!==n[e+t]){a.setValue(n,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let e=n,i=r;e!==i;++e)t[e]=t[r+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let r=0;r!==i;++r)e[t+r]=e[n+r]}_slerp(e,t,n,r){Oe.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,i){const o=this._workIndex*i;Oe.multiplyQuaternionsFlat(e,o,e,t,e,n),Oe.slerpFlat(e,t,e,t,e,o,r)}_lerp(e,t,n,r,i){const o=1-r;for(let a=0;a!==i;++a){const i=t+a;e[i]=e[i]*o+e[n+a]*r}}_lerpAdditive(e,t,n,r,i){for(let o=0;o!==i;++o){const i=t+o;e[i]=e[i]+e[n+o]*r}}}const LA="\\[\\]\\.:\\/",qA=new RegExp("[\\[\\]\\.:\\/]","g"),DA="[^\\[\\]\\.:\\/]",IA="[^"+LA.replace("\\.","")+"]",OA=/((?:WC+[\/:])*)/.source.replace("WC",DA),BA=/(WCOD+)?/.source.replace("WCOD",IA),kA=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",DA),NA=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",DA),zA=new RegExp("^"+OA+BA+kA+NA+"$"),UA=["material","materials","bones"];class FA{constructor(e,t,n){this.path=t,this.parsedPath=n||FA.parseTrackName(t),this.node=FA.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new FA.Composite(e,t,n):new FA(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(qA,"")}static parseTrackName(e){const t=zA.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const e=n.nodeName.substring(r+1);-1!==UA.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(!t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let r=0;r0){const e=this._interpolants,t=this._propertyBindings;if(2501===this.blendMode)for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(o),t[n].accumulateAdditive(a);else for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(o),t[n].accumulate(r,a)}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(null!==n){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const 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(e){const t=this._clip.duration,n=this.loop;let r=this.time+e,i=this._loopCount;const o=2202===n;if(0===e)return-1===i?r:o&&1==(1&i)?t-r:r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,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)),r>=t||r<0){const n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);const a=this.repetitions-i;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===a){const t=e<0;this._setEndings(t,!t,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=r;if(o&&1==(1&i))return t-r}return r}_setEndings(e,t,n){const r=this._interpolantSettings;n?(r.endingStart=Y,r.endingEnd=Y):(r.endingStart=e?this.zeroSlopeAtStart?Y:Q:X,r.endingEnd=t?this.zeroSlopeAtEnd?Y:Q:X)}_scheduleFading(e,t,n){const r=this._mixer,i=r.time;let o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=t,a[1]=i+e,s[1]=n,this}}(class extends ie{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,o=e._propertyBindings,a=e._interpolants,s=n.uuid,A=this._bindingsByRootAndName;let l=A[s];void 0===l&&(l={},A[s]=l);for(let e=0;e!==i;++e){const i=r[e],A=i.name;let c=l[A];if(void 0!==c)++c.referenceCount,o[e]=c;else{if(c=o[e],void 0!==c){null===c._cacheIndex&&(++c.referenceCount,this._addInactiveBinding(c,s,A));continue}const r=t&&t._propertyBindings[e].binding.parsedPath;c=new PA(FA.create(n,A,r),i.ValueTypeName,i.getValueSize()),++c.referenceCount,this._addInactiveBinding(c,s,A),o[e]=c}a[e].resultBuffer=c.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const 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)}const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const 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(e){const t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),o=this._accuIndex^=1;for(let a=0;a!==n;++a){t[a]._update(r,e,i,o)}const a=this._bindings,s=this._nActiveBindings;for(let e=0;e!==s;++e)a[e].apply(o);return this}setTime(e){this.time=0;for(let e=0;eNumber.EPSILON){if(A<0&&(n=t[o],s=-s,a=t[i],A=-A),e.ya.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=A*(e.x-n.x)-s*(e.y-n.y);if(0===t)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(a.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=a.x)return!0}}return r}const i=Cs.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===t)return n(o);let a,s,A;const l=[];if(1===o.length)return s=o[0],A=new ns,A.curves=s.curves,l.push(A),l;let c=!i(o[0].getPoints());c=e?!c:c;const u=[],h=[];let d,f,p=[],m=0;h[m]=void 0,p[m]=[];for(let t=0,n=o.length;t1){let e=!1;const t=[];for(let e=0,t=h.length;e0&&(e||(p=u))}for(let e=0,t=h.length;e=0?r=setTimeout(A,t-l):(r=null,n||(s=e.apply(o,i),o=i=null))}null==t&&(t=100);var l=function(){o=this,i=arguments,a=Date.now();var l=n&&!r;return r||(r=setTimeout(A,t)),l&&(s=e.apply(o,i),o=i=null),s};return l.clear=function(){r&&(clearTimeout(r),r=null)},l.flush=function(){r&&(s=e.apply(o,i),o=i=null,clearTimeout(r),r=null)},l}Oa.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Oa.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},ts.prototype.fromPoints=function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)},class extends Ea{constructor(e=10,t=10,n=4473924,r=8947848){n=new Ee(n),r=new Ee(r);const i=t/2,o=e/t,a=e/2,s=[],A=[];for(let e=0,l=0,c=-a;e<=t;e++,c+=o){s.push(-a,0,c,a,0,c),s.push(c,0,-a,c,0,a);const t=e===i?n:r;t.toArray(A,l),l+=3,t.toArray(A,l),l+=3,t.toArray(A,l),l+=3,t.toArray(A,l),l+=3}const l=new dn;l.setAttribute("position",new on(s,3)),l.setAttribute("color",new on(A,3));super(l,new ga({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},class extends Ea{constructor(e){const t=$A(e),n=new dn,r=[],i=[],o=new Ee(0,0,1),a=new Ee(0,1,0);for(let e=0;e0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;ee.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},n instanceof Function?n(e):n,{initialised:!1}),r={};function i(t){return o(t,e),s(),i}var o=function(e,n){c.call(i,e,t,n),t.initialised=!0},s=rl((function(){t.initialised&&(h.call(i,t,r),r={})}),1);return d.forEach((function(e){i[e.name]=function(e){var n=e.name,o=e.triggerUpdate,a=void 0!==o&&o,A=e.onChange,l=void 0===A?function(e,t){}:A,c=e.defaultVal,u=void 0===c?null:c;return function(e){var o=t[n];if(!arguments.length)return o;var A=void 0===e?u:e;return t[n]=A,l.call(i,A,t,o),!r.hasOwnProperty(n)&&(r[n]=o),a&&s(),i}}(e)})),Object.keys(a).forEach((function(e){i[e]=function(){for(var n,r=arguments.length,o=new Array(r),s=0;s0;){this._tweensAddedDuringUpdate={};for(var r=0;r1?o(e[n],e[n-1],n-r):o(e[i],e[i+1>n?n:i+1],r-i)},Bezier:function(e,t){for(var n=0,r=e.length-1,i=Math.pow,o=fl.Utils.Bernstein,a=0;a<=r;a++)n+=i(1-t,r-a)*i(t,a)*e[a]*o(r,a);return n},CatmullRom:function(e,t){var n=e.length-1,r=n*t,i=Math.floor(r),o=fl.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(i=Math.floor(r=n*(1+t))),o(e[(i-1+n)%n],e[i],e[(i+1)%n],e[(i+2)%n],r-i)):t<0?e[0]-(o(e[0],e[0],e[1],e[1],-r)-e[0]):t>1?e[n]-(o(e[n],e[n],e[n-1],e[n-1],r-n)-e[n]):o(e[i?i-1:0],e[i],e[n1;n--)t*=n;return cl[e]=t,t}),CatmullRom:function(e,t,n,r,i){var o=.5*(n-e),a=.5*(r-t),s=i*i;return(2*t-2*n+o+a)*(i*s)+(-3*t+3*n-2*o-a)*s+o*i+t}}},pl=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),ml=new dl,gl=function(){function e(e,t){void 0===t&&(t=ml),this._object=e,this._group=t,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=ul.Linear.None,this._interpolationFunction=fl.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=pl.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.to=function(e,t){return this._valuesEnd=Object.create(e),void 0!==t&&(this._duration=t),this},e.prototype.duration=function(e){return this._duration=e,this},e.prototype.start=function(e){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var t in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(t),this._valuesStart[t]=this._valuesStartRepeat[t];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==e?"string"==typeof e?hl()+parseFloat(e):e:hl(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},e.prototype._setupProperties=function(e,t,n,r){for(var i in n){var o=e[i],a=Array.isArray(o),s=a?"array":typeof o,A=!a&&Array.isArray(n[i]);if("undefined"!==s&&"function"!==s){if(A){var l=n[i];if(0===l.length)continue;l=l.map(this._handleRelativeValue.bind(this,o)),n[i]=[o].concat(l)}if("object"!==s&&!a||!o||A)void 0===t[i]&&(t[i]=o),a||(t[i]*=1),r[i]=A?n[i].slice().reverse():t[i]||0;else{for(var c in t[i]=a?[]:{},o)t[i][c]=o[c];r[i]=a?[]:{},this._setupProperties(o,t[i],n[i],r[i])}}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(e){return void 0===e&&(e=hl()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=e,this._group&&this._group.remove(this)),this},e.prototype.resume=function(e){return void 0===e&&(e=hl()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},e.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;ei)return!1;t&&this.start(e)}if(this._goToEnd=!1,e1?1:r;var o=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),1===r){if(this._repeat>0){for(n in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[n]||(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=e+this._repeatDelayTime:this._startTime=e+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,s=this._chainedTweens.length;a80*n){r=o=e[0],i=a=e[1];for(var f=n;fo&&(o=s),A>a&&(a=A);l=0!==(l=Math.max(o-r,a-i))?1/l:0}return Pl(h,d,n,r,i,l),d}function Cl(e,t,n,r,i){var o,a;if(i===Kl(e,t,n,r)>0)for(o=t;o=t;o-=r)a=Xl(o,e[o],e[o+1],a);return a&&Gl(a,a.next)&&(Zl(a),a=a.next),a}function Rl(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!Gl(r,r.next)&&0!==Hl(r.prev,r,r.next))r=r.next;else{if(Zl(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function Pl(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=Nl(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,A,l=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;t0||A>0&&r;)0!==s&&(0===A||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,A--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(e,r,i,o);for(var s,A,l=e;e.prev!==e.next;)if(s=e.prev,A=e.next,o?ql(e,r,i,o):Ll(e))t.push(s.i/n),t.push(e.i/n),t.push(A.i/n),Zl(e),e=A.next,l=A.next;else if((e=A)===l){a?1===a?Pl(e=Dl(Rl(e),t,n),t,n,r,i,o,2):2===a&&Il(e,t,n,r,i,o):Pl(Rl(e),t,n,r,i,o,1);break}}}function Ll(e){var t=e.prev,n=e,r=e.next;if(Hl(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(Ul(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Hl(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function ql(e,t,n,r){var i=e.prev,o=e,a=e.next;if(Hl(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,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,u=Nl(s,A,t,n,r),h=Nl(l,c,t,n,r),d=e.prevZ,f=e.nextZ;d&&d.z>=u&&f&&f.z<=h;){if(d!==e.prev&&d!==e.next&&Ul(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&Hl(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,f!==e.prev&&f!==e.next&&Ul(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Hl(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;d&&d.z>=u;){if(d!==e.prev&&d!==e.next&&Ul(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&Hl(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;f&&f.z<=h;){if(f!==e.prev&&f!==e.next&&Ul(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Hl(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Dl(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!Gl(i,o)&&Vl(i,r,r.next,o)&&Ql(i,o)&&Ql(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),Zl(r),Zl(r.next),r=e=o),r=r.next}while(r!==e);return Rl(r)}function Il(e,t,n,r,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Fl(a,s)){var A=Yl(a,s);return a=Rl(a,a.next),A=Rl(A,A.next),Pl(a,t,n,r,i,o),void Pl(A,t,n,r,i,o)}s=s.next}a=a.next}while(a!==e)}function Ol(e,t){return e.x-t.x}function Bl(e,t){var n=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>=c&&i!==r.x&&Ul(on.x||r.x===n.x&&kl(n,r)))&&(n=r,h=A)),r=r.next}while(r!==l);return n}(e,t);if(!n)return t;var r=Yl(n,e),i=Rl(n,n.next);return Rl(r,r.next),t===n?i:t}function kl(e,t){return Hl(e.prev,e,t.prev)<0&&Hl(t.next,e,e.next)<0}function Nl(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 zl(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 Fl(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&&Vl(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(Ql(e,t)&&Ql(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)&&(Hl(e.prev,e,t.prev)||Hl(e,t.prev,t))||Gl(e,t)&&Hl(e.prev,e,e.next)>0&&Hl(t.prev,t,t.next)>0)}function Hl(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Gl(e,t){return e.x===t.x&&e.y===t.y}function Vl(e,t,n,r){var i=Wl(Hl(e,t,n)),o=Wl(Hl(e,t,r)),a=Wl(Hl(n,r,e)),s=Wl(Hl(n,r,t));return i!==o&&a!==s||(!(0!==i||!jl(e,n,t))||(!(0!==o||!jl(e,r,t))||(!(0!==a||!jl(n,e,r))||!(0!==s||!jl(n,t,r)))))}function jl(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Wl(e){return e>0?1:e<0?-1:0}function Ql(e,t){return Hl(e.prev,e,e.next)<0?Hl(e,t,e.next)>=0&&Hl(e,e.prev,t)>=0:Hl(e,t,e.prev)<0||Hl(e,e.next,t)<0}function Yl(e,t){var n=new Jl(e.i,e.x,e.y),r=new Jl(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 Xl(e,t,n,r){var i=new Jl(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 Zl(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 Jl(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}function Kl(e,t,n,r){for(var i=0,o=t,a=n-r;o0&&(r+=e[i-1].length,n.holes.push(r))}return n};var $l=El.exports;function ec(e,t){return null==e||null==t?NaN:et?1:e>=t?0:NaN}function tc(e){let t=e,n=e,r=e;function i(e,t,i=0,o=e.length){if(i>>1;r(e[n],t)<0?i=n+1:o=n}while(ie(t)-n,n=ec,r=(t,n)=>ec(e(t),n)),{left:i,center:function(e,n,r=0,o=e.length){const a=i(e,n,r,o-1);return a>r&&t(e[a-1],n)>-t(e[a],n)?a-1:a},right:function(e,t,i=0,o=e.length){if(i>>1;r(e[n],t)<=0?i=n+1:o=n}while(i=t&&(n=r=t):(n>t&&(n=t),r=o&&(n=r=o):(n>o&&(n=o),r0){for(o=e[--i];i>0&&(t=o,n=e[--i],o=t+n,r=n-(o-t),!r););i>0&&(r<0&&e[i-1]<0||r>0&&e[i-1]>0)&&(n=2*r,t=o+n,n==t-o&&(o=t))}return o}}var ac=Math.sqrt(50),sc=Math.sqrt(10),Ac=Math.sqrt(2);function lc(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=ac?10:o>=sc?5:o>=Ac?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=ac?10:o>=sc?5:o>=Ac?2:1)}function cc(e,t){let n=0,r=0;if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(++n,r+=t);else{let i=-1;for(let o of e)null!=(o=t(o,++i,e))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function uc(e){return Array.from(function*(e){for(const t of e)yield*t}(e))}function hc(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r0?1:e<0?-1:0},Rc=Math.sqrt;function Pc(e){return e>1?mc:e<-1?-mc:Math.asin(e)}function Lc(e){return(e=Tc(e/2))*e}function qc(){}function Dc(e,t){e&&Oc.hasOwnProperty(e.type)&&Oc[e.type](e,t)}var Ic={Feature:function(e,t){Dc(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,o=Mc(t=(t*=xc)/2+gc),a=Tc(t),s=Gc*a,A=Hc*o+s*Mc(i),l=s*r*Tc(i);tu.add(wc(l,A)),Fc=e,Hc=o,Gc=a}function Au(e){return[wc(e[1],e[0]),Pc(e[2])]}function lu(e){var t=e[0],n=e[1],r=Mc(n);return[r*Mc(t),r*Tc(t),Tc(n)]}function cu(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function uu(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function hu(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function du(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function fu(e){var t=Rc(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var pu,mu,gu,vu,yu,xu,bu,_u,wu,Mu,Su,Eu,Tu,Cu,Ru,Pu,Lu={point:qu,lineStart:Iu,lineEnd:Ou,polygonStart:function(){Lu.point=Bu,Lu.lineStart=ku,Lu.lineEnd=Nu,Kc=new oc,ru.polygonStart()},polygonEnd:function(){ru.polygonEnd(),Lu.point=qu,Lu.lineStart=Iu,Lu.lineEnd=Ou,tu<0?(Vc=-(Wc=180),jc=-(Qc=90)):Kc>dc?Qc=90:Kc<-1e-6&&(jc=-90),eu[0]=Vc,eu[1]=Wc},sphere:function(){Vc=-(Wc=180),jc=-(Qc=90)}};function qu(e,t){$c.push(eu=[Vc=e,Wc=e]),tQc&&(Qc=t)}function Du(e,t){var n=lu([e*xc,t*xc]);if(Jc){var r=uu(Jc,n),i=uu([r[1],-r[0],0],r);fu(i),i=Au(i);var o,a=e-Yc,s=a>0?1:-1,A=i[0]*yc*s,l=bc(a)>180;l^(s*YcQc&&(Qc=o):l^(s*Yc<(A=(A+360)%360-180)&&AQc&&(Qc=t)),l?ezu(Vc,Wc)&&(Wc=e):zu(e,Wc)>zu(Vc,Wc)&&(Vc=e):Wc>=Vc?(eWc&&(Wc=e)):e>Yc?zu(Vc,e)>zu(Vc,Wc)&&(Wc=e):zu(e,Wc)>zu(Vc,Wc)&&(Vc=e)}else $c.push(eu=[Vc=e,Wc=e]);tQc&&(Qc=t),Jc=n,Yc=e}function Iu(){Lu.point=Du}function Ou(){eu[0]=Vc,eu[1]=Wc,Lu.point=qu,Jc=null}function Bu(e,t){if(Jc){var n=e-Yc;Kc.add(bc(n)>180?n+(n>0?360:-360):n)}else Xc=e,Zc=t;ru.point(e,t),Du(e,t)}function ku(){ru.lineStart()}function Nu(){Bu(Xc,Zc),ru.lineEnd(),bc(Kc)>dc&&(Vc=-(Wc=180)),eu[0]=Vc,eu[1]=Wc,Jc=null}function zu(e,t){return(t-=e)<0?t+360:t}function Uu(e,t){return e[0]-t[0]}function Fu(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tzu(r[0],r[1])&&(r[1]=i[1]),zu(i[0],r[1])>zu(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,t=0,r=o[n=o.length-1];t<=n;r=i,++t)i=o[t],(s=zu(r[1],i[0]))>a&&(a=s,Vc=i[0],Wc=r[1])}return $c=eu=null,Vc===1/0||jc===1/0?[[NaN,NaN],[NaN,NaN]]:[[Vc,jc],[Wc,Qc]]}var Gu={sphere:qc,point:Vu,lineStart:Wu,lineEnd:Xu,polygonStart:function(){Gu.lineStart=Zu,Gu.lineEnd=Ju},polygonEnd:function(){Gu.lineStart=Wu,Gu.lineEnd=Xu}};function Vu(e,t){e*=xc;var n=Mc(t*=xc);ju(n*Mc(e),n*Tc(e),Tc(t))}function ju(e,t,n){++pu,gu+=(e-gu)/pu,vu+=(t-vu)/pu,yu+=(n-yu)/pu}function Wu(){Gu.point=Qu}function Qu(e,t){e*=xc;var n=Mc(t*=xc);Cu=n*Mc(e),Ru=n*Tc(e),Pu=Tc(t),Gu.point=Yu,ju(Cu,Ru,Pu)}function Yu(e,t){e*=xc;var n=Mc(t*=xc),r=n*Mc(e),i=n*Tc(e),o=Tc(t),a=wc(Rc((a=Ru*o-Pu*i)*a+(a=Pu*r-Cu*o)*a+(a=Cu*i-Ru*r)*a),Cu*r+Ru*i+Pu*o);mu+=a,xu+=a*(Cu+(Cu=r)),bu+=a*(Ru+(Ru=i)),_u+=a*(Pu+(Pu=o)),ju(Cu,Ru,Pu)}function Xu(){Gu.point=Vu}function Zu(){Gu.point=Ku}function Ju(){$u(Eu,Tu),Gu.point=Vu}function Ku(e,t){Eu=e,Tu=t,e*=xc,t*=xc,Gu.point=$u;var n=Mc(t);Cu=n*Mc(e),Ru=n*Tc(e),Pu=Tc(t),ju(Cu,Ru,Pu)}function $u(e,t){e*=xc;var n=Mc(t*=xc),r=n*Mc(e),i=n*Tc(e),o=Tc(t),a=Ru*o-Pu*i,s=Pu*r-Cu*o,A=Cu*i-Ru*r,l=Ec(a,s,A),c=Pc(l),u=l&&-c/l;wu.add(u*a),Mu.add(u*s),Su.add(u*A),mu+=c,xu+=c*(Cu+(Cu=r)),bu+=c*(Ru+(Ru=i)),_u+=c*(Pu+(Pu=o)),ju(Cu,Ru,Pu)}function eh(e){pu=mu=gu=vu=yu=xu=bu=_u=0,wu=new oc,Mu=new oc,Su=new oc,Nc(e,Gu);var t=+wu,n=+Mu,r=+Su,i=Ec(t,n,r);return ipc?e+Math.round(-e/vc)*vc:e,t]}function rh(e,t,n){return(e%=vc)?t||n?th(oh(e),ah(t,n)):oh(e):t||n?ah(t,n):nh}function ih(e){return function(t,n){return[(t+=e)>pc?t-vc:t<-pc?t+vc:t,n]}}function oh(e){var t=ih(e);return t.invert=ih(-e),t}function ah(e,t){var n=Mc(e),r=Tc(e),i=Mc(t),o=Tc(t);function a(e,t){var a=Mc(t),s=Mc(e)*a,A=Tc(e)*a,l=Tc(t),c=l*n+s*r;return[wc(A*i-c*o,s*n-l*r),Pc(c*i+A*o)]}return a.invert=function(e,t){var a=Mc(t),s=Mc(e)*a,A=Tc(e)*a,l=Tc(t),c=l*i-A*o;return[wc(A*i+l*o,s*n+c*r),Pc(c*n-s*r)]},a}function sh(e,t){(t=lu(t))[0]-=e,fu(t);var n,r=(n=-t[1])>1?0:n<-1?pc:Math.acos(n);return((-t[2]<0?-r:r)+vc-dc)%vc}function Ah(){var e,t=[];return{point:function(t,n,r){e.push([t,n,r])},lineStart:function(){t.push(e=[])},lineEnd:qc,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function lh(e,t){return bc(e[0]-t[0])=0;--o)i.point((c=l[o])[0],c[1]);else r(h.x,h.p.x,-1,i);h=h.p}l=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function hh(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r=0?1:-1,E=S*M,T=E>pc,C=m*_;if(A.add(wc(C*S*Tc(E),g*w+C*Mc(E))),a+=T?M+S*vc:M,T^f>=n^x>=n){var R=uu(lu(d),lu(y));fu(R);var P=uu(o,R);fu(P);var L=(T^M>=0?-1:1)*Pc(P[2]);(r>L||r===L&&(R[0]||R[1]))&&(s+=T^M>=0?1:-1)}}return(a<-1e-6||a0){for(u||(i.polygonStart(),u=!0),i.lineStart(),e=0;e1&&2&A&&h.push(h.pop().concat(h.shift())),a.push(h.filter(mh))}return h}}function mh(e){return e.length>1}function gh(e,t){return((e=e.x)[0]<0?e[1]-mc-dc:mc-e[1])-((t=t.x)[0]<0?t[1]-mc-dc:mc-t[1])}nh.invert=nh;var vh=ph((function(){return!0}),(function(e){var t,n=NaN,r=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,a){var s=o>0?pc:-pc,A=bc(o-n);bc(A-pc)0?mc:-mc),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(o,r),t=0):i!==s&&A>=pc&&(bc(n-i)dc?_c((Tc(t)*(o=Mc(r))*Tc(n)-Tc(r)*(i=Mc(t))*Tc(e))/(i*o*a)):(t+r)/2}(n,r,o,a),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),t=0),e.point(n=o,r=a),i=s},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}}),(function(e,t,n,r){var i;if(null==e)i=n*mc,r.point(-pc,i),r.point(0,i),r.point(pc,i),r.point(pc,0),r.point(pc,-i),r.point(0,-i),r.point(-pc,-i),r.point(-pc,0),r.point(-pc,i);else if(bc(e[0]-t[0])>dc){var o=e[0]0,i=bc(t)>dc;function o(e,n){return Mc(e)*Mc(n)>t}function a(e,n,r){var i=[1,0,0],o=uu(lu(e),lu(n)),a=cu(o,o),s=o[0],A=a-s*s;if(!A)return!r&&e;var l=t*a/A,c=-t*s/A,u=uu(i,o),h=du(i,l);hu(h,du(o,c));var d=u,f=cu(h,d),p=cu(d,d),m=f*f-p*(cu(h,h)-1);if(!(m<0)){var g=Rc(m),v=du(d,(-f-g)/p);if(hu(v,h),v=Au(v),!r)return v;var y,x=e[0],b=n[0],_=e[1],w=n[1];b0^v[1]<(bc(v[0]-x)pc^(x<=v[0]&&v[0]<=b)){var E=du(d,(-f+g)/p);return hu(E,h),[v,Au(E)]}}}function s(t,n){var i=r?e:pc-e,o=0;return t<-i?o|=1:t>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return ph(o,(function(e){var t,n,A,l,c;return{lineStart:function(){l=A=!1,c=1},point:function(u,h){var d,f=[u,h],p=o(u,h),m=r?p?0:s(u,h):p?s(u+(u<0?pc:-pc),h):0;if(!t&&(l=A=p)&&e.lineStart(),p!==A&&(!(d=a(t,f))||lh(t,d)||lh(f,d))&&(f[2]=1),p!==A)c=0,p?(e.lineStart(),d=a(f,t),e.point(d[0],d[1])):(d=a(t,f),e.point(d[0],d[1],2),e.lineEnd()),t=d;else if(i&&t&&r^p){var g;m&n||!(g=a(f,t,!0))||(c=0,r?(e.lineStart(),e.point(g[0][0],g[0][1]),e.point(g[1][0],g[1][1]),e.lineEnd()):(e.point(g[1][0],g[1][1]),e.lineEnd(),e.lineStart(),e.point(g[0][0],g[0][1],3)))}!p||t&&lh(t,f)||e.point(f[0],f[1]),t=f,A=p,n=m},lineEnd:function(){A&&e.lineEnd(),t=null},clean:function(){return c|(l&&A)<<1}}}),(function(t,r,i,o){!function(e,t,n,r,i,o){if(n){var a=Mc(t),s=Tc(t),A=r*n;null==i?(i=t+r*vc,o=t-A/2):(i=sh(a,i),o=sh(a,o),(r>0?io)&&(i+=r*vc));for(var l,c=i;r>0?c>o:c0)do{l.point(0===c||3===c?e:n,c>1?r:t)}while((c=(c+s+4)%4)!==u);else l.point(o[0],o[1])}function a(r,i){return bc(r[0]-e)0?0:3:bc(r[0]-n)0?2:1:bc(r[1]-t)0?1:0:i>0?3:2}function s(e,t){return A(e.x,t.x)}function A(e,t){var n=a(e,1),r=a(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(a){var A,l,c,u,h,d,f,p,m,g,v,y=a,x=Ah(),b={point:_,lineStart:function(){b.point=w,l&&l.push(c=[]);g=!0,m=!1,f=p=NaN},lineEnd:function(){A&&(w(u,h),d&&m&&x.rejoin(),A.push(x.result()));b.point=_,m&&y.lineEnd()},polygonStart:function(){y=x,A=[],l=[],v=!0},polygonEnd:function(){var t=function(){for(var t=0,n=0,i=l.length;nr&&(h-o)*(r-a)>(d-a)*(e-o)&&++t:d<=r&&(h-o)*(r-a)<(d-a)*(e-o)&&--t;return t}(),n=v&&t,i=(A=uc(A)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&uh(A,s,t,o,a),a.polygonEnd());y=a,A=l=c=null}};function _(e,t){i(e,t)&&y.point(e,t)}function w(o,a){var s=i(o,a);if(l&&c.push([o,a]),g)u=o,h=a,d=s,g=!1,s&&(y.lineStart(),y.point(o,a));else if(s&&m)y.point(o,a);else{var A=[f=Math.max(Sh,Math.min(Mh,f)),p=Math.max(Sh,Math.min(Mh,p))],x=[o=Math.max(Sh,Math.min(Mh,o)),a=Math.max(Sh,Math.min(Mh,a))];!function(e,t,n,r,i,o){var a,s=e[0],A=e[1],l=0,c=1,u=t[0]-s,h=t[1]-A;if(a=n-s,u||!(a>0)){if(a/=u,u<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=i-s,u||!(a<0)){if(a/=u,u<0){if(a>c)return;a>l&&(l=a)}else if(u>0){if(a0)){if(a/=h,h<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=o-A,h||!(a<0)){if(a/=h,h<0){if(a>c)return;a>l&&(l=a)}else if(h>0){if(a0&&(e[0]=s+l*u,e[1]=A+l*h),c<1&&(t[0]=s+c*u,t[1]=A+c*h),!0}}}}}(A,x,e,t,n,r)?s&&(y.lineStart(),y.point(o,a),v=!1):(m||(y.lineStart(),y.point(A[0],A[1])),y.point(x[0],x[1]),s||y.lineEnd(),v=!1)}f=o,p=a,m=s}return b}}var Th={sphere:qc,point:qc,lineStart:function(){Th.point=Rh,Th.lineEnd=Ch},lineEnd:qc,polygonStart:qc,polygonEnd:qc};function Ch(){Th.point=Th.lineEnd=qc}function Rh(e,t){bh=e*=xc,_h=Tc(t*=xc),wh=Mc(t),Th.point=Ph}function Ph(e,t){e*=xc;var n=Tc(t*=xc),r=Mc(t),i=bc(e-bh),o=Mc(i),a=r*Tc(i),s=wh*n-_h*r*o,A=_h*n+wh*r*o;xh.add(wc(Rc(a*a+s*s),A)),bh=e,_h=n,wh=r}var Lh=[null,null],qh={type:"LineString",coordinates:Lh};function Dh(e,t){return Lh[0]=e,Lh[1]=t,function(e){return xh=new oc,Nc(e,Th),+xh}(qh)}var Ih={Feature:function(e,t){return Bh(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r0&&(i=Dh(e[o],e[o-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))dc})).map(A)).concat(hc(Sc(o/d)*d,i,d).filter((function(e){return bc(e%p)>dc})).map(l))}return g.lines=function(){return v().map((function(e){return{type:"LineString",coordinates:e}}))},g.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(u(a).slice(1),c(n).reverse().slice(1),u(s).reverse().slice(1))]}},g.extent=function(e){return arguments.length?g.extentMajor(e).extentMinor(e):g.extentMinor()},g.extentMajor=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],s=+e[0][1],a=+e[1][1],r>n&&(e=r,r=n,n=e),s>a&&(e=s,s=a,a=e),g.precision(m)):[[r,s],[n,a]]},g.extentMinor=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],o=+n[0][1],i=+n[1][1],t>e&&(n=t,t=e,e=n),o>i&&(n=o,o=i,i=n),g.precision(m)):[[t,o],[e,i]]},g.step=function(e){return arguments.length?g.stepMajor(e).stepMinor(e):g.stepMinor()},g.stepMajor=function(e){return arguments.length?(f=+e[0],p=+e[1],g):[f,p]},g.stepMinor=function(e){return arguments.length?(h=+e[0],d=+e[1],g):[h,d]},g.precision=function(h){return arguments.length?(m=+h,A=Gh(o,i,90),l=Vh(t,e,m),c=Gh(s,a,90),u=Vh(r,n,m),g):m},g.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}()()}function Wh(e,t){var n=e[0]*xc,r=e[1]*xc,i=t[0]*xc,o=t[1]*xc,a=Mc(r),s=Tc(r),A=Mc(o),l=Tc(o),c=a*Mc(n),u=a*Tc(n),h=A*Mc(i),d=A*Tc(i),f=2*Pc(Rc(Lc(o-r)+a*A*Lc(i-n))),p=Tc(f),m=f?function(e){var t=Tc(e*=f)/p,n=Tc(f-e)/p,r=n*c+t*h,i=n*u+t*d,o=n*s+t*l;return[wc(i,r)*yc,wc(o,Rc(r*r+i*i))*yc]}:function(){return[n*yc,r*yc]};return m.distance=f,m}var Qh=e=>e,Yh=1/0,Xh=Yh,Zh=-Yh,Jh=Zh;var Kh={point:function(e,t){eZh&&(Zh=e);tJh&&(Jh=t)},lineStart:qc,lineEnd:qc,polygonStart:qc,polygonEnd:qc,result:function(){var e=[[Yh,Xh],[Zh,Jh]];return Zh=Jh=-(Xh=Yh=1/0),e}};function $h(e){return function(t){var n=new ed;for(var r in e)n[r]=e[r];return n.stream=t,n}}function ed(){}function td(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),Nc(n,e.stream(Kh)),t(Kh.result()),null!=r&&e.clipExtent(r),e}function nd(e,t,n){return td(e,(function(n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+t[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+t[0][1]+(i-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([a,s])}),n)}ed.prototype={constructor:ed,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var rd=Mc(30*xc);function id(e,t){return+t?function(e,t){function n(r,i,o,a,s,A,l,c,u,h,d,f,p,m){var g=l-r,v=c-i,y=g*g+v*v;if(y>4*t&&p--){var x=a+h,b=s+d,_=A+f,w=Rc(x*x+b*b+_*_),M=Pc(_/=w),S=bc(bc(_)-1)t||bc((g*R+v*P)/y-.5)>.3||a*h+s*d+A*f2?e[2]%360*xc:0,R()):[m*yc,g*yc,v*yc]},T.angle=function(e){return arguments.length?(y=e%360*xc,R()):y*yc},T.reflectX=function(e){return arguments.length?(x=e?-1:1,R()):x<0},T.reflectY=function(e){return arguments.length?(b=e?-1:1,R()):b<0},T.precision=function(e){return arguments.length?(a=id(s,E=e*e),P()):Rc(E)},T.fitExtent=function(e,t){return nd(T,e,t)},T.fitSize=function(e,t){return function(e,t,n){return nd(e,[[0,0],t],n)}(T,e,t)},T.fitWidth=function(e,t){return function(e,t,n){return td(e,(function(n){var r=+t,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];e.scale(150*i).translate([o,a])}),n)}(T,e,t)},T.fitHeight=function(e,t){return function(e,t,n){return td(e,(function(n){var r=+t,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;e.scale(150*i).translate([o,a])}),n)}(T,e,t)},function(){return t=e.apply(this,arguments),T.invert=t.invert&&C,R()}}((function(){return e}))()}function Ad(e,t){var n=Mc(t),r=1+Mc(e)*n;return[n*Tc(e)/r,Tc(t)/r]}function ld(){return sd(Ad).scale(250).clipAngle(142)}function cd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ud(e){return ud=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ud(e)}function hd(e,t){return hd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},hd(e,t)}function dd(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function fd(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=ud(e);if(t){var i=ud(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return dd(this,n)}}function pd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||md(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function md(e,t){if(e){if("string"==typeof e)return gd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gd(e,t):void 0}}function gd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=[],r=null;return e.forEach((function(e){if(r){var i=180*Dh(e,r)/Math.PI;if(i>t)for(var o=Wh(r,e),a=1/Math.ceil(i/t),s=a;s<1;)n.push(o(s)),s+=a}n.push(r=e)})),n},yd="undefined"!=typeof window&&window.THREE?window.THREE:{BufferGeometry:dn,Float32BufferAttribute:on},xd=(new yd.BufferGeometry).setAttribute?"setAttribute":"addAttribute",bd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&hd(e,t)}(n,e);var t=fd(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;cd(this,n),(r=t.call(this)).type="GeoJsonGeometry",r.parameters={geoJson:e,radius:i,resolution:o};var a=({Point:c,MultiPoint:u,LineString:h,MultiLineString:d,Polygon:f,MultiPolygon:p}[e.type]||function(){return[]})(e.coordinates,i),s=[],A=[],l=0;function c(e,t){return[{vertices:Md(e[1],e[0],t),indices:[]}]}function u(e,t){var n={vertices:[],indices:[]};return e.map((function(e){return c(e,t)})).forEach((function(e){var t=pd(e,1)[0];_d(n,t)})),[n]}function h(e,t){for(var n=vd(e,o).map((function(e){var n=pd(e,2),r=n[0];return Md(n[1],r,t)})),r=$l.flatten([n]).vertices,i=Math.round(r.length/3),a=[],s=1;s=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;e.push(i)}}catch(e){r.e(e)}finally{r.f()}}function Md(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-e)*Math.PI/180,i=(90-t)*Math.PI/180;return[n*Math.sin(r)*Math.cos(i),n*Math.cos(r),n*Math.sin(r)*Math.sin(i)]}function Sd(e){let t,n,r,i=0;for(let o=0;o[])))}const h=Math.log10(1/t),d=Math.pow(10,h);for(let t=0;t1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=P(e,360),t=P(t,100),n=P(n,100),0===t)r=i=o=n;else{var s=n<.5?n*(1+t):n+t-n*t,A=2*n-s;r=a(A,s,e+1/3),i=a(A,s,e),o=a(A,s,e-1/3)}return{r:255*r,g:255*i,b:255*o}}(e.h,A,c),u=!0,h="hsl"),e.hasOwnProperty("a")&&(o=e.a));var d,f,p;return o=R(o),{ok:u,format:e.format||h,r:a(255,s(i.r,0)),g:a(255,s(i.g,0)),b:a(255,s(i.b,0)),a:o}}(e);this._originalInput=e,this._r=c.r,this._g=c.g,this._b=c.b,this._a=c.a,this._roundA=o(100*this._a)/100,this._format=A.format||c.format,this._gradientType=A.gradientType,this._r<1&&(this._r=o(this._r)),this._g<1&&(this._g=o(this._g)),this._b<1&&(this._b=o(this._b)),this._ok=c.ok,this._tc_id=i++}function c(e,t,n){e=P(e,255),t=P(t,255),n=P(n,255);var r,i,o=s(e,t,n),A=a(e,t,n),l=(o+A)/2;if(o==A)r=i=0;else{var c=o-A;switch(i=l>.5?c/(2-o-A):c/(o+A),o){case e:r=(t-n)/c+(t>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(l(r));return o}function E(e,t){t=t||6;for(var n=l(e).toHsv(),r=n.h,i=n.s,o=n.v,a=[],s=1/t;t--;)a.push(l({h:r,s:i,v:o})),o=(o+s)%1;return a}l.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,n,r,i=this.toRgb();return e=i.r/255,n=i.g/255,r=i.b/255,.2126*(e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=R(e),this._roundA=o(100*this._a)/100,this},toHsv:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=u(this._r,this._g,this._b),t=o(360*e.h),n=o(100*e.s),r=o(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=c(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=c(this._r,this._g,this._b),t=o(360*e.h),n=o(100*e.s),r=o(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return h(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,i){var a=[D(o(e).toString(16)),D(o(t).toString(16)),D(o(n).toString(16)),D(O(r))];if(i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1))return a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0);return a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:o(this._r),g:o(this._g),b:o(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+o(this._r)+", "+o(this._g)+", "+o(this._b)+")":"rgba("+o(this._r)+", "+o(this._g)+", "+o(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:o(100*P(this._r,255))+"%",g:o(100*P(this._g,255))+"%",b:o(100*P(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+o(100*P(this._r,255))+"%, "+o(100*P(this._g,255))+"%, "+o(100*P(this._b,255))+"%)":"rgba("+o(100*P(this._r,255))+"%, "+o(100*P(this._g,255))+"%, "+o(100*P(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(C[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+d(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var i=l(e);n="#"+d(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return l(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(y,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(p,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(E,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(w,arguments)}},l.fromRatio=function(e,t){if("object"==typeof e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:I(e[r]));e=n}return l(e,t)},l.equals=function(e,t){return!(!e||!t)&&l(e).toRgbString()==l(t).toRgbString()},l.random=function(){return l.fromRatio({r:A(),g:A(),b:A()})},l.mix=function(e,t,n){n=0===n?0:n||50;var r=l(e).toRgb(),i=l(t).toRgb(),o=n/100;return l({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})}, // =4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},l.mostReadable=function(e,t,n){var r,i,o,a,s=null,A=0;i=(n=n||{}).includeFallbackColors,o=n.level,a=n.size;for(var c=0;cA&&(A=r,s=l(t[c]));return l.isReadable(e,s,{level:o,size:a})||!i?s:(n.includeFallbackColors=!1,l.mostReadable(e,["#fff","#000"],n))};var T=l.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},C=l.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(T);function R(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function P(e,n){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=a(n,s(0,parseFloat(e))),r&&(e=parseInt(e*n,10)/100),t.abs(e-n)<1e-6?1:e%n/parseFloat(n)}function L(e){return a(1,s(0,e))}function q(e){return parseInt(e,16)}function D(e){return 1==e.length?"0"+e:""+e}function I(e){return e<=1&&(e=100*e+"%"),e}function O(e){return t.round(255*parseFloat(e)).toString(16)}function B(e){return q(e)/255}var k,N,z,U=(N="[\\s|\\(]+("+(k="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+k+")[,|\\s]+("+k+")\\s*\\)?",z="[\\s|\\(]+("+k+")[,|\\s]+("+k+")[,|\\s]+("+k+")[,|\\s]+("+k+")\\s*\\)?",{CSS_UNIT:new RegExp(k),rgb:new RegExp("rgb"+N),rgba:new RegExp("rgba"+z),hsl:new RegExp("hsl"+N),hsla:new RegExp("hsla"+z),hsv:new RegExp("hsv"+N),hsva:new RegExp("hsva"+z),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function F(e){return!!U.CSS_UNIT.exec(e)}e.exports?e.exports=l:window.tinycolor=l}(Math)}(Cd);var Rd=Cd.exports;function Pd(e,t){if(null==e)return{};var n,r,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}(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}function Ld(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||Dd(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qd(e){return function(e){if(Array.isArray(e))return Id(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Dd(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dd(e,t){if(e){if("string"==typeof e)return Id(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Id(e,t):void 0}}function Id(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=(t instanceof Array?t.length?t:[void 0]:[t]).map((function(e){return{keyAccessor:e,isProp:!(e instanceof Function)}})),o=e.reduce((function(e,t){var r=e,o=t;return i.forEach((function(e,t){var a,s=e.keyAccessor;if(e.isProp){var A=o,l=A[s],c=Pd(A,[s].map(Od));a=l,o=c}else a=s(o,t);t+11&&void 0!==arguments[1]?arguments[1]:1;r===i.length?Object.keys(t).forEach((function(e){return t[e]=n(t[e])})):Object.values(t).forEach((function(t){return e(t,r+1)}))}(o);var a=o;return r&&(a=[],function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];n.length===i.length?a.push({keys:n,vals:t}):Object.entries(t).forEach((function(t){var r=Ld(t,2),i=r[0],o=r[1];return e(o,[].concat(qd(n),[i]))}))}(o),t instanceof Array&&0===t.length&&1===a.length&&(a[0].keys=[])),a};function kd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Nd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zd(e,t){if(null==e)return{};var n,r,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}(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}function Ud(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||Hd(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fd(e){return function(e){if(Array.isArray(e))return Gd(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Hd(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hd(e,t){if(e){if("string"==typeof e)return Gd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gd(e,t):void 0}}function Gd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=this._minInterval)if(isNaN(this._maxInterval))this.update(this._frameDeltaTime*this._timeScale,!0),this._lastTimeUpdated=this._now;else for(this._interval=Math.min(this._frameDeltaTime,this._maxInterval);this._now>=this._lastTimeUpdated+this._interval;)this.update(this._interval*this._timeScale,this._now<=this._lastTimeUpdated+2*this._maxInterval),this._lastTimeUpdated+=this._interval;this._isRunning&&this.animateOnce()},e.prototype.update=function(e,t){void 0===t&&(t=!0),this._currentTick++,this._currentTime+=e,this._tickDeltaTime=e,this._onTick.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick),t&&this._onTickOncePerFrame.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},e.prototype.getTimer=function(){return Date.now()},e}();Object.defineProperty(t,"__esModule",{value:!0}),t.default=i},function(e,t,n){!function(t,n){e.exports=n()}(0,(function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t){var n=function(){function e(){this.functions=[]}return e.prototype.add=function(e){return-1===this.functions.indexOf(e)&&(this.functions.push(e),!0)},e.prototype.remove=function(e){var t=this.functions.indexOf(e);return t>-1&&(this.functions.splice(t,1),!0)},e.prototype.removeAll=function(){return this.functions.length>0&&(this.functions.length=0,!0)},e.prototype.dispatch=function(){for(var e=[],t=0;t>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?mf(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?mf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=of.exec(e))?new yf(t[1],t[2],t[3],1):(t=af.exec(e))?new yf(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=sf.exec(e))?mf(t[1],t[2],t[3],t[4]):(t=Af.exec(e))?mf(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=lf.exec(e))?wf(t[1],t[2]/100,t[3]/100,1):(t=cf.exec(e))?wf(t[1],t[2]/100,t[3]/100,t[4]):uf.hasOwnProperty(e)?pf(uf[e]):"transparent"===e?new yf(NaN,NaN,NaN,0):null}function pf(e){return new yf(e>>16&255,e>>8&255,255&e,1)}function mf(e,t,n,r){return r<=0&&(e=t=n=NaN),new yf(e,t,n,r)}function gf(e){return e instanceof Jd||(e=ff(e)),e?new yf((e=e.rgb()).r,e.g,e.b,e.opacity):new yf}function vf(e,t,n,r){return 1===arguments.length?gf(e):new yf(e,t,n,null==r?1:r)}function yf(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function xf(){return"#"+_f(this.r)+_f(this.g)+_f(this.b)}function bf(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function _f(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function wf(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Sf(e,t,n,r)}function Mf(e){if(e instanceof Sf)return new Sf(e.h,e.s,e.l,e.opacity);if(e instanceof Jd||(e=ff(e)),!e)return new Sf;if(e instanceof Sf)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,A=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n0&&A<1?0:a,new Sf(a,s,A,e.opacity)}function Sf(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ef(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Xd(Jd,ff,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:hf,formatHex:hf,formatHsl:function(){return Mf(this).formatHsl()},formatRgb:df,toString:df}),Xd(yf,vf,Zd(Jd,{brighter:function(e){return e=null==e?$d:Math.pow($d,e),new yf(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?Kd:Math.pow(Kd,e),new yf(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xf,formatHex:xf,formatRgb:bf,toString:bf})),Xd(Sf,(function(e,t,n,r){return 1===arguments.length?Mf(e):new Sf(e,t,n,null==r?1:r)}),Zd(Jd,{brighter:function(e){return e=null==e?$d:Math.pow($d,e),new Sf(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?Kd:Math.pow(Kd,e),new Sf(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new yf(Ef(e>=240?e-240:e+120,i,r),Ef(e,i,r),Ef(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Tf=e=>()=>e;function Cf(e){return 1==(e=+e)?Rf:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Tf(isNaN(t)?n:t)}}function Rf(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Tf(isNaN(e)?t:e)}var Pf=function e(t){var n=Cf(t);function r(e,t){var r=n((e=vf(e)).r,(t=vf(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Rf(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function Lf(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;no&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,A.push({i:a,x:Bf(n,r)})),o=zf.lastIndex;return ot&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?Yf:Qf,i=o=null,u}function u(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),s,A)))(e(l(t)))}return u.invert=function(n){return l(t((o||(o=r(s,a.map(e),Bf)))(n)))},u.domain=function(e){return arguments.length?(a=Array.from(e,Gf),c()):a.slice()},u.range=function(e){return arguments.length?(s=Array.from(e),c()):s.slice()},u.rangeRound=function(e){return s=Array.from(e),A=Hf,c()},u.clamp=function(e){return arguments.length?(l=!!e||jf,c()):l!==jf},u.interpolate=function(e){return arguments.length?(A=e,c()):A},u.unknown=function(e){return arguments.length?(n=e,u):n},function(n,r){return e=n,t=r,c()}}function Jf(){return Zf()(jf,jf)}function Kf(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function $f(e){return(e=Kf(Math.abs(e)))?e[1]:NaN}var ep,tp=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function np(e){if(!(t=tp.exec(e)))throw new Error("invalid format: "+e);var t;return new rp({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function rp(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function ip(e,t){var n=Kf(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}np.prototype=rp.prototype,rp.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var op={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>ip(100*e,t),r:ip,s:function(e,t){var n=Kf(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(ep=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Kf(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function ap(e){return e}var sp,Ap,lp,cp=Array.prototype.map,up=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function hp(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?ap:(t=cp.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,o=[],a=0,s=t[0],A=0;i>0&&s>0&&(A+s+1>r&&(s=Math.max(1,r-A)),o.push(e.substring(i-=s,i+s)),!((A+=s+1)>r));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?ap:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(cp.call(e.numerals,String)),A=void 0===e.percent?"%":e.percent+"",l=void 0===e.minus?"−":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function u(e){var t=(e=np(e)).fill,n=e.align,u=e.sign,h=e.symbol,d=e.zero,f=e.width,p=e.comma,m=e.precision,g=e.trim,v=e.type;"n"===v?(p=!0,v="g"):op[v]||(void 0===m&&(m=12),g=!0,v="g"),(d||"0"===t&&"="===n)&&(d=!0,t="0",n="=");var y="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===h?o:/[%p]/.test(v)?A:"",b=op[v],_=/[defgprs%]/.test(v);function w(e){var i,o,A,h=y,w=x;if("c"===v)w=b(e)+w,e="";else{var M=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:b(Math.abs(e),m),g&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),M&&0==+e&&"+"!==u&&(M=!1),h=(M?"("===u?u:l:"-"===u||"("===u?"":u)+h,w=("s"===v?up[8+ep/3]:"")+w+(M&&"("===u?")":""),_)for(i=-1,o=e.length;++i(A=e.charCodeAt(i))||A>57){w=(46===A?a+e.slice(i+1):e.slice(i))+w,e=e.slice(0,i);break}}p&&!d&&(e=r(e,1/0));var S=h.length+e.length+w.length,E=S>1)+h+e+w+E.slice(S);break;default:e=E+h+e+w}return s(e)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),w.toString=function(){return e+""},w}return{format:u,formatPrefix:function(e,t){var n=u(((e=np(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor($f(t)/3))),i=Math.pow(10,-r),o=up[8+r/3];return function(e){return n(i*e)+o}}}}function dp(e,t,n,r){var i,o=function(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=ac?i*=10:o>=sc?i*=5:o>=Ac&&(i*=2),t0)return[e];if((r=t0){let n=Math.round(e/a),r=Math.round(t/a);for(n*at&&--r,o=new Array(i=r-n+1);++st&&--r,o=new Array(i=r-n+1);++s0;){if((i=lc(A,l,n))===r)return o[a]=A,o[s]=l,t(o);if(i>0)A=Math.floor(A/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;A=Math.ceil(A*i)/i,l=Math.floor(l*i)/i}r=i}return e},e}function pp(){var e=Jf();return e.copy=function(){return Xf(e,pp())},Yd.apply(e,arguments),fp(e)}sp=hp({thousands:",",grouping:[3],currency:["$",""]}),Ap=sp.format,lp=sp.formatPrefix;const mp=134217729;function gp(e,t,n,r,i){let o,a,s,A,l=t[0],c=r[0],u=0,h=0;c>l==c>-l?(o=l,l=t[++u]):(o=c,c=r[++h]);let d=0;if(ul==c>-l?(a=l+o,s=o-(a-l),l=t[++u]):(a=c+o,s=o-(a-c),c=r[++h]),o=a,0!==s&&(i[d++]=s);ul==c>-l?(a=o+l,A=a-o,s=o-(a-A)+(l-A),l=t[++u]):(a=o+c,A=a-o,s=o-(a-A)+(c-A),c=r[++h]),o=a,0!==s&&(i[d++]=s);for(;u0!=s>0)return A;const l=Math.abs(a+s);return Math.abs(A)>=33306690738754716e-32*l?A:-function(e,t,n,r,i,o,a){let s,A,l,c,u,h,d,f,p,m,g,v,y,x,b,_,w,M;const S=e-i,E=n-i,T=t-o,C=r-o;x=S*C,h=mp*S,d=h-(h-S),f=S-d,h=mp*C,p=h-(h-C),m=C-p,b=f*m-(x-d*p-f*p-d*m),_=T*E,h=mp*T,d=h-(h-T),f=T-d,h=mp*E,p=h-(h-E),m=E-p,w=f*m-(_-d*p-f*p-d*m),g=b-w,u=b-g,yp[0]=b-(g+u)+(u-w),v=x+g,u=v-x,y=x-(v-u)+(g-u),g=y-_,u=y-g,yp[1]=y-(g+u)+(u-_),M=v+g,u=M-v,yp[2]=v-(M-u)+(g-u),yp[3]=M;let R=function(e,t){let n=t[0];for(let r=1;r=P||-R>=P)return R;if(u=e-S,s=e-(S+u)+(u-i),u=n-E,l=n-(E+u)+(u-i),u=t-T,A=t-(T+u)+(u-o),u=r-C,c=r-(C+u)+(u-o),0===s&&0===A&&0===l&&0===c)return R;if(P=11093356479670487e-47*a+33306690738754706e-32*Math.abs(R),R+=S*c+C*s-(T*l+E*A),R>=P||-R>=P)return R;x=s*C,h=mp*s,d=h-(h-s),f=s-d,h=mp*C,p=h-(h-C),m=C-p,b=f*m-(x-d*p-f*p-d*m),_=A*E,h=mp*A,d=h-(h-A),f=A-d,h=mp*E,p=h-(h-E),m=E-p,w=f*m-(_-d*p-f*p-d*m),g=b-w,u=b-g,wp[0]=b-(g+u)+(u-w),v=x+g,u=v-x,y=x-(v-u)+(g-u),g=y-_,u=y-g,wp[1]=y-(g+u)+(u-_),M=v+g,u=M-v,wp[2]=v-(M-u)+(g-u),wp[3]=M;const L=gp(4,yp,4,wp,xp);x=S*c,h=mp*S,d=h-(h-S),f=S-d,h=mp*c,p=h-(h-c),m=c-p,b=f*m-(x-d*p-f*p-d*m),_=T*l,h=mp*T,d=h-(h-T),f=T-d,h=mp*l,p=h-(h-l),m=l-p,w=f*m-(_-d*p-f*p-d*m),g=b-w,u=b-g,wp[0]=b-(g+u)+(u-w),v=x+g,u=v-x,y=x-(v-u)+(g-u),g=y-_,u=y-g,wp[1]=y-(g+u)+(u-_),M=v+g,u=M-v,wp[2]=v-(M-u)+(g-u),wp[3]=M;const q=gp(L,xp,4,wp,bp);x=s*c,h=mp*s,d=h-(h-s),f=s-d,h=mp*c,p=h-(h-c),m=c-p,b=f*m-(x-d*p-f*p-d*m),_=A*l,h=mp*A,d=h-(h-A),f=A-d,h=mp*l,p=h-(h-l),m=l-p,w=f*m-(_-d*p-f*p-d*m),g=b-w,u=b-g,wp[0]=b-(g+u)+(u-w),v=x+g,u=v-x,y=x-(v-u)+(g-u),g=y-_,u=y-g,wp[1]=y-(g+u)+(u-_),M=v+g,u=M-v,wp[2]=v-(M-u)+(g-u),wp[3]=M;const D=gp(q,bp,4,wp,_p);return _p[D-1]}(e,t,n,r,i,o,l)}const Sp=Math.pow(2,-52),Ep=new Uint32Array(512);class Tp{static from(e,t=Dp,n=Ip){const r=e.length,i=new Float64Array(2*r);for(let o=0;o>1;if(t>0&&"number"!=typeof e[0])throw new Error("Expected coords to contain numbers.");this.coords=e;const n=Math.max(2*t-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=e.length>>1;let a=1/0,s=1/0,A=-1/0,l=-1/0;for(let t=0;tA&&(A=n),r>l&&(l=r),this._ids[t]=t}const c=(a+A)/2,u=(s+l)/2;let h,d,f,p=1/0;for(let t=0;t0&&(d=t,p=n)}let v=e[2*d],y=e[2*d+1],x=1/0;for(let t=0;tr&&(t[n++]=i,r=this._dists[i])}return this.hull=t.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(Mp(m,g,v,y,b,_)<0){const e=d,t=v,n=y;d=f,v=b,y=_,f=e,b=t,_=n}const w=function(e,t,n,r,i,o){const a=n-e,s=r-t,A=i-e,l=o-t,c=a*a+s*s,u=A*A+l*l,h=.5/(a*l-s*A);return{x:e+(l*c-s*u)*h,y:t+(a*u-A*c)*h}}(m,g,v,y,b,_);this._cx=w.x,this._cy=w.y;for(let t=0;t0&&Math.abs(l-o)<=Sp&&Math.abs(c-a)<=Sp)continue;if(o=l,a=c,A===h||A===d||A===f)continue;let u=0;for(let e=0,t=this._hashKey(l,c);e=0;)if(m=p,m===u){m=-1;break}if(-1===m)continue;let g=this._addTriangle(m,A,n[m],-1,-1,r[m]);r[A]=this._legalize(g+2),r[m]=g,M++;let v=n[m];for(;p=n[v],Mp(l,c,e[2*v],e[2*v+1],e[2*p],e[2*p+1])<0;)g=this._addTriangle(v,A,p,r[A],-1,r[v]),r[A]=this._legalize(g+2),n[v]=v,M--,v=p;if(m===u)for(;p=t[m],Mp(l,c,e[2*p],e[2*p+1],e[2*m],e[2*m+1])<0;)g=this._addTriangle(p,A,m,-1,r[m],r[p]),this._legalize(g+2),r[p]=g,n[m]=m,M--,m=p;this._hullStart=t[A]=m,n[m]=t[v]=A,n[A]=v,i[this._hashKey(l,c)]=A,i[this._hashKey(e[2*m],e[2*m+1])]=m}this.hull=new Uint32Array(M);for(let e=0,t=this._hullStart;e0?3-n:1+n)/4}(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:t,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[e],s=e-e%3;if(o=s+(e+2)%3,-1===a){if(0===i)break;e=Ep[--i];continue}const A=a-a%3,l=s+(e+1)%3,c=A+(a+2)%3,u=t[o],h=t[e],d=t[l],f=t[c];if(Rp(r[2*u],r[2*u+1],r[2*h],r[2*h+1],r[2*d],r[2*d+1],r[2*f],r[2*f+1])){t[e]=f,t[a]=u;const r=n[c];if(-1===r){let t=this._hullStart;do{if(this._hullTri[t]===c){this._hullTri[t]=e;break}t=this._hullPrev[t]}while(t!==this._hullStart)}this._link(e,r),this._link(a,n[o]),this._link(o,c);const s=A+(a+1)%3;i=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=r}else{let i=n+1,o=r;qp(e,n+r>>1,i),t[e[n]]>t[e[r]]&&qp(e,n,r),t[e[i]]>t[e[r]]&&qp(e,i,r),t[e[n]]>t[e[i]]&&qp(e,n,i);const a=e[i],s=t[a];for(;;){do{i++}while(t[e[i]]s);if(o=o-n?(Lp(e,t,i,r),Lp(e,t,n,o-1)):(Lp(e,t,n,o-1),Lp(e,t,i,r))}}function qp(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Dp(e){return e[0]}function Ip(e){return e[1]}function Op(e,t,n){if(void 0===n&&(n={}),!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");var r,i=function(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return e.geometry.coordinates;if("Point"===e.type)return e.coordinates}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return e;throw new Error("coord must be GeoJSON Point or an Array of numbers")}(e),o="Feature"===(r=t).type?r.geometry:r,a=o.type,s=t.bbox,A=o.coordinates;if(s&&!1===function(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}(i,s))return!1;"Polygon"===a&&(A=[A]);for(var l=!1,c=0;ce[1]!=l>e[1]&&e[0]<(A-a)*(e[1]-s)/(l-s)+a&&(r=!r)}return r}const kp=1e-6;class Np{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,t){this._+=`L${this._x1=+e},${this._y1=+t}`}arc(e,t,n){const r=(e=+e)+(n=+n),i=t=+t;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>kp||Math.abs(this._y1-i)>kp)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${e-n},${t}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(e,t,n,r){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class zp{constructor(){this._=[]}moveTo(e,t){this._.push([e,t])}closePath(){this._.push(this._[0].slice())}lineTo(e,t){this._.push([e,t])}value(){return this._.length?this._:null}}class Up{constructor(e,[t,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(t=+t)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=r,this.xmin=t,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:t,triangles:n},vectors:r}=this,i=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let t,r,o=0,a=0,s=n.length;o1;)i-=2;for(let e=2;e4)for(let e=0;e0){if(t>=this.ymax)return null;(i=(this.ymax-t)/r)0){if(e>=this.xmax)return null;(i=(this.xmax-e)/n)this.xmax?2:0)|(tthis.ymax?8:0)}}const Fp=2*Math.PI,Hp=Math.pow;function Gp(e){return e[0]}function Vp(e){return e[1]}function jp(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class Wp{static from(e,t=Gp,n=Vp,r){return new Wp("length"in e?function(e,t,n,r){const i=e.length,o=new Float64Array(2*i);for(let a=0;a2&&function(e){const{triangles:t,coords:n}=e;for(let e=0;e1e-10)return!1}return!0}(e)){this.collinear=Int32Array.from({length:t.length/2},((e,t)=>t)).sort(((e,n)=>t[2*e]-t[2*n]||t[2*e+1]-t[2*n+1]));const e=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[t[2*e],t[2*e+1],t[2*n],t[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let e=0,n=t.length/2;e0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,2===r.length&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(e){return new Up(this,e)}*neighbors(e){const{inedges:t,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const t=a.indexOf(e);return t>0&&(yield a[t-1]),void(t=0&&i!==n&&i!==r;)n=i;return i}_step(e,t,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:s,points:A}=this;if(-1===r[e]||!A.length)return(e+1)%(A.length>>1);let l=e,c=Hp(t-A[2*e],2)+Hp(n-A[2*e+1],2);const u=r[e];let h=u;do{let r=s[h];const u=Hp(t-A[2*r],2)+Hp(n-A[2*r+1],2);if(u0?1:e<0?-1:0},rm=Math.sqrt;function im(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function om(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function am(e,t){return[e[0]+t[0],e[1]+t[1],e[2]+t[2]]}function sm(e){var t=rm(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);return[e[0]/t,e[1]/t,e[2]/t]}function Am(e){return[Jp(e[1],e[0])*Xp,(t=$p(-1,em(1,e[2])),(t>1?Yp:t<-1?-Yp:Math.asin(t))*Xp)];var t}function lm(e){const t=e[0]*Zp,n=e[1]*Zp,r=Kp(n);return[r*Kp(t),r*tm(t),tm(n)]}function cm(e){return im((e=e.map((e=>lm(e))))[0],om(e[2],e[1]))}function um(e){const t=function(e){if(e.length<2)return{};let t=0;for(;isNaN(e[t][0]+e[t][1])&&t++2?e[2]*xc:0),t.invert=function(t){return(t=e.invert(t[0]*xc,t[1]*xc))[0]*=yc,t[1]*=yc,t},t}(e[t]),r=ld().translate([0,0]).scale(1).rotate(n.invert([180,0]));e=e.map(r);const i=[];let o=1;for(let t=0,n=e.length;t1e32?i.push(t):n>o&&(o=n)}const a=1e6*rm(o);i.forEach((t=>e[t]=[a,0])),e.push([0,a]),e.push([-a,0]),e.push([0,-a]);const s=Wp.from(e);s.projection=r;const{triangles:A,halfedges:l,inedges:c}=s;for(let n=0,r=l.length;ne.length-3-1&&(A[n]=t);return s}(e),n=function(e){const{triangles:t}=e;if(!t)return[];const n=[];for(let e=0,r=t.length/3;e{if(e[0]!==e[1]&&!(cm(e.map((e=>t[e])))<0))for(let t,r=0;r<3;r++)t=(r+1)%3,n.add(ic([e[r],e[t]]).join("-"))})),Array.from(n,(e=>e.split("-").map(Number))))}(n,e),i=function(e,t){const n=[];e.forEach((e=>{for(let t=0;t<3;t++){const r=e[t],i=e[(t+1)%3];n[r]=n[r]||[],n[r].push(i)}})),0===e.length&&(2===t?(n[0]=[1],n[1]=[0]):1===t&&(n[0]=[]));return n}(n,e.length),o=function(e,t){function n(e,t){let n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}return function(r,i,o){void 0===o&&(o=0);let a,s,A=o;const l=lm([r,i]);do{a=o,o=null,s=n(l,lm(t[a])),e[a].forEach((e=>{let r=n(l,lm(t[e]));if(r{const n=e.map((e=>t[e])).map(lm);return Am(sm(am(am(om(n[1],n[0]),om(n[2],n[1])),om(n[0],n[2]))))}))}(n,e),{polygons:s,centers:A}=function(e,t,n){const r=[],i=e.slice();if(0===t.length){if(n.length<2)return{polygons:r,centers:i};if(2===n.length){const e=lm(n[0]),t=lm(n[1]),a=sm(am(e,t)),s=sm(om(e,t)),A=om(a,s),l=[a,om(a,A),om(om(a,A),A),om(om(om(a,A),A),A)].map(Am).map(o);return r.push(l),r.push(l.slice().reverse()),{polygons:r,centers:i}}}t.forEach(((e,t)=>{for(let n=0;n<3;n++){const i=e[n],o=e[(n+1)%3],a=e[(n+2)%3];r[i]=r[i]||[],r[i].push([o,a,t,[i,o,a]])}}));function o(e){let n=-1;return i.slice(t.length,1/0).forEach(((r,i)=>{r[0]===e[0]&&r[1]===e[1]&&(n=i+t.length)})),n<0&&(n=i.length,i.push(e)),n}return{polygons:r.map((e=>{const t=[e[0][2]];let r=e[0][1];for(let n=1;n2)return t;if(2==t.length){const r=hm(n[e[0][3][0]],n[e[0][3][1]],i[t[0]]),a=hm(n[e[0][3][2]],n[e[0][3][0]],i[t[0]]),s=o(r),A=o(a);return[t[0],A,t[1],s]}})),centers:i}}(a,n,e),l=function(e){const t=[];return e.forEach((e=>{if(!e)return;let n=e[e.length-1];for(let r of e)r>n&&t.push([n,r]),n=r})),t}(s),c=function(e,t){const n=new Set,r=[];e.map((e=>{if(!(cm(e.map((e=>t[e>t.length?0:e])))>1e-12))for(let t=0;t<3;t++){let r=[e[t],e[(t+1)%3]],i=`${r[0]}-${r[1]}`;n.has(i)?n.delete(i):n.add(`${r[1]}-${r[0]}`)}}));const i=new Map;let o;if(n.forEach((e=>{e=e.split("-").map(Number),i.set(e[0],e[1]),o=e[0]})),void 0===o)return r;let a=o;do{r.push(a);let e=i.get(a);i.set(a,-1),a=e}while(a>-1&&a!==o);return r}(n,e),u=function(e,t){return function(n){const r=new Map,i=new Map;return e.forEach(((e,t)=>{const o=e.join("-");r.set(o,n[t]),i.set(o,!0)})),t.forEach((e=>{let t=0,n=-1;for(let i=0;i<3;i++){let o=ic([e[i],e[(i+1)%3]]).join("-");r.get(o)>t&&(t=r.get(o),n=o)}i.set(n,!1)})),e.map((e=>i.get(e.join("-"))))}}(r,n);return{delaunay:t,edges:r,triangles:n,centers:A,neighbors:i,polygons:s,mesh:l,hull:c,urquhart:u,find:o}}function hm(e,t,n){e=lm(e),t=lm(t),n=lm(n);const r=nm(im(om(t,e),n));return Am(sm(am(e,t)).map((e=>r*e)))}function dm(e){const t=function(e){if(t.delaunay=null,t._data=e,"object"==typeof t._data&&"FeatureCollection"===t._data.type&&(t._data=t._data.features),"object"==typeof t._data){const e=t._data.map((e=>[t._vx(e),t._vy(e),e])).filter((e=>isFinite(e[0]+e[1])));t.points=e.map((e=>[e[0],e[1]])),t.valid=e.map((e=>e[2])),t.delaunay=um(t.points)}return t};return t._vx=function(e){return"object"==typeof e&&"type"in e?eh(e)[0]:0 in e?e[0]:void 0},t._vy=function(e){return"object"==typeof e&&"type"in e?eh(e)[1]:1 in e?e[1]:void 0},t.x=function(e){return e?(t._vx=e,t):t._vx},t.y=function(e){return e?(t._vy=e,t):t._vy},t.polygons=function(e){if(void 0!==e&&t(e),!t.delaunay)return!1;const n={type:"FeatureCollection",features:[]};return 0===t.valid.length||(t.delaunay.polygons.forEach(((e,r)=>n.features.push({type:"Feature",geometry:e?{type:"Polygon",coordinates:[[...e,e[0]].map((e=>t.delaunay.centers[e]))]}:null,properties:{site:t.valid[r],sitecoordinates:t.points[r],neighbours:t.delaunay.neighbors[r]}}))),1===t.valid.length&&n.features.push({type:"Feature",geometry:{type:"Sphere"},properties:{site:t.valid[0],sitecoordinates:t.points[0],neighbours:[]}})),n},t.triangles=function(e){return void 0!==e&&t(e),!!t.delaunay&&{type:"FeatureCollection",features:t.delaunay.triangles.map(((e,n)=>((e=e.map((e=>t.points[e]))).center=t.delaunay.centers[n],e))).filter((e=>cm(e)>0)).map((e=>({type:"Feature",properties:{circumcenter:e.center},geometry:{type:"Polygon",coordinates:[[...e,e[0]]]}})))}},t.links=function(e){if(void 0!==e&&t(e),!t.delaunay)return!1;const n=t.delaunay.edges.map((e=>Dh(t.points[e[0]],t.points[e[1]]))),r=t.delaunay.urquhart(n);return{type:"FeatureCollection",features:t.delaunay.edges.map(((e,i)=>({type:"Feature",properties:{source:t.valid[e[0]],target:t.valid[e[1]],length:n[i],urquhart:!!r[i]},geometry:{type:"LineString",coordinates:[t.points[e[0]],t.points[e[1]]]}})))}},t.mesh=function(e){return void 0!==e&&t(e),!!t.delaunay&&{type:"MultiLineString",coordinates:t.delaunay.edges.map((e=>[t.points[e[0]],t.points[e[1]]]))}},t.cellMesh=function(e){if(void 0!==e&&t(e),!t.delaunay)return!1;const{centers:n,polygons:r}=t.delaunay,i=[];for(const e of r)if(e)for(let t=e.length,r=e[t-1],o=e[0],a=0;ar&&i.push([n[r],n[o]]);return{type:"MultiLineString",coordinates:i}},t._found=void 0,t.find=function(e,n,r){if(t._found=t.delaunay.find(e,n,t._found),!r||Dh([e,n],t.points[t._found])r[e])),r[n[0]]]]}},e?t(e):t}function fm(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nt)for(var o=Wh(n,e),a=1/Math.ceil(i/t),s=a;s<1;)r.push(o(s)),s+=a}r.push(n=e)})),r}))}function Mm(e,t){var n={type:"Polygon",coordinates:e},r=ym(Hu(n),2),i=ym(r[0],2),o=i[0],a=i[1],s=ym(r[1],2),A=s[0],l=s[1];if(Math.min(Math.abs(A-o),Math.abs(l-a))A||l>=89||a<=-89;return function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.minLng,r=t.maxLng,i=t.minLat,o=t.maxLat,a=Math.round(Math.pow(360/e,2)/Math.PI),s=(1+Math.sqrt(5))/2,A=function(e){return e/s*360%360-180},l=function(e){return Math.acos(2*e/a-1)/Math.PI*180-90},c=function(e){return a*(Math.cos((e+90)*Math.PI/180)+1)/2},u=[void 0!==o?Math.ceil(c(o)):0,void 0!==i?Math.floor(c(i)):a-1],h=void 0===n&&void 0===r?function(){return!0}:void 0===n?function(e){return e<=r}:void 0===r?function(e){return e>=n}:r>=n?function(e){return e>=n&&e<=r}:function(e){return e>=n||e<=r},d=[],f=u[0];f<=u[1];f++){var p=A(f);h(p)&&d.push([p,l(f)])}return d}(t,{minLng:o,maxLng:A,minLat:a,maxLat:l}).filter((function(e){return Sm(e,n,c)}))}function Sm(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return n?Hh(t,e):Op(e,t)}var Em=window.THREE?window.THREE:{BufferGeometry:dn,Float32BufferAttribute:on},Tm=(new Em.BufferGeometry).setAttribute?"setAttribute":"addAttribute",Cm=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mm(e,t)}(o,e);var t,n,r,i=vm(o);function o(e,t,n,r,a,s,A){var l;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(l=i.call(this)).type="ConicPolygonBufferGeometry",l.parameters={polygonGeoJson:e,startHeight:t,endHeight:n,closedBottom:r,closedTop:a,includeSides:s,curvatureResolution:A},t=t||0,n=n||1,r=void 0===r||r,a=void 0===a||a,s=void 0===s||s;var c=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).resolution,n=void 0===t?1/0:t,r=wm(e,n),i=uc(r),o=Mm(e,n),a=[].concat(xm(i),xm(o)),s={type:"Polygon",coordinates:e},A=ym(Hu(s),2),l=ym(A[0],2),c=l[0],u=l[1],h=ym(A[1],2),d=h[0],f=h[1],p=c>d||f>=89||u<=-89,m=[];if(p){var g=dm(a).triangles(),v=new Map(a.map((function(e,t){var n=ym(e,2),r=n[0],i=n[1];return["".concat(r,"-").concat(i),t]})));g.features.forEach((function(e){var t,n=e.geometry.coordinates[0].slice(0,3).reverse(),r=[];if(n.forEach((function(e){var t=ym(e,2),n=t[0],i=t[1],o="".concat(n,"-").concat(i);v.has(o)&&r.push(v.get(o))})),3===r.length){if(r.some((function(e){return e2&&void 0!==arguments[2]?arguments[2]:0,r=(90-e)*Math.PI/180,i=(90-t)*Math.PI/180;return[n*Math.sin(r)*Math.cos(i),n*Math.cos(r),n*Math.sin(r)*Math.sin(i)]}(n[1],r,t)}))}));return $l.flatten(n)}function x(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{indices:t?h.indices:h.indices.slice().reverse(),vertices:y([h.points],e).vertices,uvs:d}}return s&&v(function(){for(var e=y(u,t),r=e.vertices,i=e.holes,o=y(u,n).vertices,a=uc([o,r]),s=Math.round(o.length/3),A=new Set(i),l=0,c=[],h=0;h=0;m--)for(var g=0;g1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),n.inspect=function(){return"[Emscripten Module object]"}):A?("undefined"!=typeof read&&(l=function(e){var t=ie(e);return t?ne(t):read(e)}),u=function(e){var t;return(t=ie(e))?t:"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(x("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(i||o)&&(o?f=self.location.href:document.currentScript&&(f=document.currentScript.src),f=0!==f.indexOf("blob:")?f.substr(0,f.lastIndexOf("/")+1):"",l=function(e){try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText}catch(t){var n=ie(e);if(n)return ne(n);throw t}},o&&(u=function(e){try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}catch(t){var n=ie(e);if(n)return n;throw t}}),c=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){if(200==r.status||0==r.status&&r.response)t(r.response);else{var i=ie(e);i?t(i.buffer):n()}},r.onerror=n,r.send(null)});var p=n.print||console.log.bind(console),m=n.printErr||console.warn.bind(console);for(t in r)r.hasOwnProperty(t)&&(n[t]=r[t]);r=null,n.arguments,n.thisProgram;var g=0,v=function(){return g};var y=!1;function x(e,t){e||ve("Assertion failed: "+t)}function b(e){var t=n["_"+e];return x(t,"Cannot call unknown function "+e+", make sure it is exported"),t}function _(e,t,n,r,i){var o={string:function(e){var t=0;if(null!=e&&0!==e){var n=1+(e.length<<2);(function(e,t,n){(function(e,t,n,r){if(!(r>0))return 0;for(var i=n,o=n+r-1,a=0;a=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a);if(s<=127){if(n>=o)break;t[n++]=s}else if(s<=2047){if(n+1>=o)break;t[n++]=192|s>>6,t[n++]=128|63&s}else if(s<=65535){if(n+2>=o)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|63&s}else{if(n+3>=o)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|63&s}}t[n]=0})(e,S,t,n)})(e,t=le(n),n)}return t},array:function(e){var t=le(e.length);return function(e,t){M.set(e,t)}(e,t),t}};var a=b(e),s=[],A=0;if(r)for(var l=0;l=r);)++i;if(i-t>16&&e.subarray&&P)return P.decode(e.subarray(t,i));for(var o="";t>10,56320|1023&l)}}else o+=String.fromCharCode((31&a)<<6|s)}else o+=String.fromCharCode(a)}return o}(S,e,t):""}function q(e,t){return e%t>0&&(e+=t-e%t),e}function D(e){w=e,n.HEAP8=M=new Int8Array(e),n.HEAP16=E=new Int16Array(e),n.HEAP32=T=new Int32Array(e),n.HEAPU8=S=new Uint8Array(e),n.HEAPU16=new Uint16Array(e),n.HEAPU32=new Uint32Array(e),n.HEAPF32=C=new Float32Array(e),n.HEAPF64=R=new Float64Array(e)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var I=n.TOTAL_MEMORY||33554432;function O(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?n.dynCall_v(r):n.dynCall_vi(r,t.arg):r(void 0===t.arg?null:t.arg)}else t()}}I=(w=n.buffer?n.buffer:new ArrayBuffer(I)).byteLength,D(w),T[6004]=5266928;var B=[],k=[],N=[],z=[];var U=Math.abs,F=Math.ceil,H=Math.floor,G=Math.min,V=0,j=null;n.preloadedImages={},n.preloadedAudios={};var W,Q,Y=null,X="data:application/octet-stream;base64,";function Z(e){return String.prototype.startsWith?e.startsWith(X):0===e.indexOf(X)}Y="data:application/octet-stream;base64,AAAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAABAAAAAMAAAAGAAAABQAAAAIAAAAAAAAAAgAAAAMAAAABAAAABAAAAAYAAAAAAAAABQAAAAMAAAAGAAAABAAAAAUAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAABAAAABQAAAAIAAAAAAAAAAQAAAAMAAAAGAAAABAAAAAYAAAAAAAAABQAAAAIAAAABAAAABAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAgAAAAMAAAAAAAAAAAAAAAIAAAAAAAAAAQAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAABgAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAAAAAAAAAAAAAAAAAIAAAAAAAAABgAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAAAAAACAAAAAwAAAAQAAAAFAAAABgAAAAAAAAABAAAAAwAAAAQAAAAFAAAABgAAAAAAAAABAAAAAgAAAAQAAAAFAAAABgAAAAAAAAABAAAAAgAAAAMAAAAFAAAABgAAAAAAAAABAAAAAgAAAAMAAAAEAAAABgAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAgAAAAAAAAAAAAAABgAAAAAAAAADAAAAAgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAUAAAAEAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAEAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAUAAAACAAAABAAAAAMAAAAIAAAAAQAAAAcAAAAGAAAACQAAAAAAAAADAAAAAgAAAAIAAAAGAAAACgAAAAsAAAAAAAAAAQAAAAUAAAADAAAADQAAAAEAAAAHAAAABAAAAAwAAAAAAAAABAAAAH8AAAAPAAAACAAAAAMAAAAAAAAADAAAAAUAAAACAAAAEgAAAAoAAAAIAAAAAAAAABAAAAAGAAAADgAAAAsAAAARAAAAAQAAAAkAAAACAAAABwAAABUAAAAJAAAAEwAAAAMAAAANAAAAAQAAAAgAAAAFAAAAFgAAABAAAAAEAAAAAAAAAA8AAAAJAAAAEwAAAA4AAAAUAAAAAQAAAAcAAAAGAAAACgAAAAsAAAAYAAAAFwAAAAUAAAACAAAAEgAAAAsAAAARAAAAFwAAABkAAAACAAAABgAAAAoAAAAMAAAAHAAAAA0AAAAaAAAABAAAAA8AAAADAAAADQAAABoAAAAVAAAAHQAAAAMAAAAMAAAABwAAAA4AAAB/AAAAEQAAABsAAAAJAAAAFAAAAAYAAAAPAAAAFgAAABwAAAAfAAAABAAAAAgAAAAMAAAAEAAAABIAAAAhAAAAHgAAAAgAAAAFAAAAFgAAABEAAAALAAAADgAAAAYAAAAjAAAAGQAAABsAAAASAAAAGAAAAB4AAAAgAAAABQAAAAoAAAAQAAAAEwAAACIAAAAUAAAAJAAAAAcAAAAVAAAACQAAABQAAAAOAAAAEwAAAAkAAAAoAAAAGwAAACQAAAAVAAAAJgAAABMAAAAiAAAADQAAAB0AAAAHAAAAFgAAABAAAAApAAAAIQAAAA8AAAAIAAAAHwAAABcAAAAYAAAACwAAAAoAAAAnAAAAJQAAABkAAAAYAAAAfwAAACAAAAAlAAAACgAAABcAAAASAAAAGQAAABcAAAARAAAACwAAAC0AAAAnAAAAIwAAABoAAAAqAAAAHQAAACsAAAAMAAAAHAAAAA0AAAAbAAAAKAAAACMAAAAuAAAADgAAABQAAAARAAAAHAAAAB8AAAAqAAAALAAAAAwAAAAPAAAAGgAAAB0AAAArAAAAJgAAAC8AAAANAAAAGgAAABUAAAAeAAAAIAAAADAAAAAyAAAAEAAAABIAAAAhAAAAHwAAACkAAAAsAAAANQAAAA8AAAAWAAAAHAAAACAAAAAeAAAAGAAAABIAAAA0AAAAMgAAACUAAAAhAAAAHgAAADEAAAAwAAAAFgAAABAAAAApAAAAIgAAABMAAAAmAAAAFQAAADYAAAAkAAAAMwAAACMAAAAuAAAALQAAADgAAAARAAAAGwAAABkAAAAkAAAAFAAAACIAAAATAAAANwAAACgAAAA2AAAAJQAAACcAAAA0AAAAOQAAABgAAAAXAAAAIAAAACYAAAB/AAAAIgAAADMAAAAdAAAALwAAABUAAAAnAAAAJQAAABkAAAAXAAAAOwAAADkAAAAtAAAAKAAAABsAAAAkAAAAFAAAADwAAAAuAAAANwAAACkAAAAxAAAANQAAAD0AAAAWAAAAIQAAAB8AAAAqAAAAOgAAACsAAAA+AAAAHAAAACwAAAAaAAAAKwAAAD4AAAAvAAAAQAAAABoAAAAqAAAAHQAAACwAAAA1AAAAOgAAAEEAAAAcAAAAHwAAACoAAAAtAAAAJwAAACMAAAAZAAAAPwAAADsAAAA4AAAALgAAADwAAAA4AAAARAAAABsAAAAoAAAAIwAAAC8AAAAmAAAAKwAAAB0AAABFAAAAMwAAAEAAAAAwAAAAMQAAAB4AAAAhAAAAQwAAAEIAAAAyAAAAMQAAAH8AAAA9AAAAQgAAACEAAAAwAAAAKQAAADIAAAAwAAAAIAAAAB4AAABGAAAAQwAAADQAAAAzAAAARQAAADYAAABHAAAAJgAAAC8AAAAiAAAANAAAADkAAABGAAAASgAAACAAAAAlAAAAMgAAADUAAAA9AAAAQQAAAEsAAAAfAAAAKQAAACwAAAA2AAAARwAAADcAAABJAAAAIgAAADMAAAAkAAAANwAAACgAAAA2AAAAJAAAAEgAAAA8AAAASQAAADgAAABEAAAAPwAAAE0AAAAjAAAALgAAAC0AAAA5AAAAOwAAAEoAAABOAAAAJQAAACcAAAA0AAAAOgAAAH8AAAA+AAAATAAAACwAAABBAAAAKgAAADsAAAA/AAAATgAAAE8AAAAnAAAALQAAADkAAAA8AAAASAAAAEQAAABQAAAAKAAAADcAAAAuAAAAPQAAADUAAAAxAAAAKQAAAFEAAABLAAAAQgAAAD4AAAArAAAAOgAAACoAAABSAAAAQAAAAEwAAAA/AAAAfwAAADgAAAAtAAAATwAAADsAAABNAAAAQAAAAC8AAAA+AAAAKwAAAFQAAABFAAAAUgAAAEEAAAA6AAAANQAAACwAAABWAAAATAAAAEsAAABCAAAAQwAAAFEAAABVAAAAMQAAADAAAAA9AAAAQwAAAEIAAAAyAAAAMAAAAFcAAABVAAAARgAAAEQAAAA4AAAAPAAAAC4AAABaAAAATQAAAFAAAABFAAAAMwAAAEAAAAAvAAAAWQAAAEcAAABUAAAARgAAAEMAAAA0AAAAMgAAAFMAAABXAAAASgAAAEcAAABZAAAASQAAAFsAAAAzAAAARQAAADYAAABIAAAAfwAAAEkAAAA3AAAAUAAAADwAAABYAAAASQAAAFsAAABIAAAAWAAAADYAAABHAAAANwAAAEoAAABOAAAAUwAAAFwAAAA0AAAAOQAAAEYAAABLAAAAQQAAAD0AAAA1AAAAXgAAAFYAAABRAAAATAAAAFYAAABSAAAAYAAAADoAAABBAAAAPgAAAE0AAAA/AAAARAAAADgAAABdAAAATwAAAFoAAABOAAAASgAAADsAAAA5AAAAXwAAAFwAAABPAAAATwAAAE4AAAA/AAAAOwAAAF0AAABfAAAATQAAAFAAAABEAAAASAAAADwAAABjAAAAWgAAAFgAAABRAAAAVQAAAF4AAABlAAAAPQAAAEIAAABLAAAAUgAAAGAAAABUAAAAYgAAAD4AAABMAAAAQAAAAFMAAAB/AAAASgAAAEYAAABkAAAAVwAAAFwAAABUAAAARQAAAFIAAABAAAAAYQAAAFkAAABiAAAAVQAAAFcAAABlAAAAZgAAAEIAAABDAAAAUQAAAFYAAABMAAAASwAAAEEAAABoAAAAYAAAAF4AAABXAAAAUwAAAGYAAABkAAAAQwAAAEYAAABVAAAAWAAAAEgAAABbAAAASQAAAGMAAABQAAAAaQAAAFkAAABhAAAAWwAAAGcAAABFAAAAVAAAAEcAAABaAAAATQAAAFAAAABEAAAAagAAAF0AAABjAAAAWwAAAEkAAABZAAAARwAAAGkAAABYAAAAZwAAAFwAAABTAAAATgAAAEoAAABsAAAAZAAAAF8AAABdAAAATwAAAFoAAABNAAAAbQAAAF8AAABqAAAAXgAAAFYAAABRAAAASwAAAGsAAABoAAAAZQAAAF8AAABcAAAATwAAAE4AAABtAAAAbAAAAF0AAABgAAAAaAAAAGIAAABuAAAATAAAAFYAAABSAAAAYQAAAH8AAABiAAAAVAAAAGcAAABZAAAAbwAAAGIAAABuAAAAYQAAAG8AAABSAAAAYAAAAFQAAABjAAAAUAAAAGkAAABYAAAAagAAAFoAAABxAAAAZAAAAGYAAABTAAAAVwAAAGwAAAByAAAAXAAAAGUAAABmAAAAawAAAHAAAABRAAAAVQAAAF4AAABmAAAAZQAAAFcAAABVAAAAcgAAAHAAAABkAAAAZwAAAFsAAABhAAAAWQAAAHQAAABpAAAAbwAAAGgAAABrAAAAbgAAAHMAAABWAAAAXgAAAGAAAABpAAAAWAAAAGcAAABbAAAAcQAAAGMAAAB0AAAAagAAAF0AAABjAAAAWgAAAHUAAABtAAAAcQAAAGsAAAB/AAAAZQAAAF4AAABzAAAAaAAAAHAAAABsAAAAZAAAAF8AAABcAAAAdgAAAHIAAABtAAAAbQAAAGwAAABdAAAAXwAAAHUAAAB2AAAAagAAAG4AAABiAAAAaAAAAGAAAAB3AAAAbwAAAHMAAABvAAAAYQAAAG4AAABiAAAAdAAAAGcAAAB3AAAAcAAAAGsAAABmAAAAZQAAAHgAAABzAAAAcgAAAHEAAABjAAAAdAAAAGkAAAB1AAAAagAAAHkAAAByAAAAcAAAAGQAAABmAAAAdgAAAHgAAABsAAAAcwAAAG4AAABrAAAAaAAAAHgAAAB3AAAAcAAAAHQAAABnAAAAdwAAAG8AAABxAAAAaQAAAHkAAAB1AAAAfwAAAG0AAAB2AAAAcQAAAHkAAABqAAAAdgAAAHgAAABsAAAAcgAAAHUAAAB5AAAAbQAAAHcAAABvAAAAcwAAAG4AAAB5AAAAdAAAAHgAAAB4AAAAcwAAAHIAAABwAAAAeQAAAHcAAAB2AAAAeQAAAHQAAAB4AAAAdwAAAHUAAABxAAAAdgAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAEAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAQAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAADAAAABQAAAAEAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAgAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAABQAAAAUAAAAAAAAAAAAAAP////8BAAAAAAAAAAMAAAAEAAAAAgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAQAAAP//////////AQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAIAAAAAAAAAAAAAAAEAAAACAAAABgAAAAQAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAoAAAACAAAAAAAAAAAAAAABAAAAAQAAAAUAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAAAAAAAAAAAAAEAAAADAAAABwAAAAYAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAHAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAgAAAAAAAAAAAAAAAQAAAAAAAAAJAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAAAAAAAAAAAAQAAAAQAAAAIAAAACgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAAAAAAAAAAABAAAACwAAAA8AAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAgAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAAAAAAAAAAABAAAADAAAABAAAAAMAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAEAAAAKAAAAEwAAAAgAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAJAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAgAAAAAAAAAAAAAAAQAAAA0AAAARAAAADQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABMAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAIAAAAAAAAAAAAAAAEAAAAOAAAAEgAAAA8AAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAAAAAABAAAA//////////8TAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABIAAAAAAAAAGAAAAAAAAAAhAAAAAAAAAB4AAAAAAAAAIAAAAAMAAAAxAAAAAQAAADAAAAADAAAAMgAAAAMAAAAIAAAAAAAAAAUAAAAFAAAACgAAAAUAAAAWAAAAAAAAABAAAAAAAAAAEgAAAAAAAAApAAAAAQAAACEAAAAAAAAAHgAAAAAAAAAEAAAAAAAAAAAAAAAFAAAAAgAAAAUAAAAPAAAAAQAAAAgAAAAAAAAABQAAAAUAAAAfAAAAAQAAABYAAAAAAAAAEAAAAAAAAAACAAAAAAAAAAYAAAAAAAAADgAAAAAAAAAKAAAAAAAAAAsAAAAAAAAAEQAAAAMAAAAYAAAAAQAAABcAAAADAAAAGQAAAAMAAAAAAAAAAAAAAAEAAAAFAAAACQAAAAUAAAAFAAAAAAAAAAIAAAAAAAAABgAAAAAAAAASAAAAAQAAAAoAAAAAAAAACwAAAAAAAAAEAAAAAQAAAAMAAAAFAAAABwAAAAUAAAAIAAAAAQAAAAAAAAAAAAAAAQAAAAUAAAAQAAAAAQAAAAUAAAAAAAAAAgAAAAAAAAAHAAAAAAAAABUAAAAAAAAAJgAAAAAAAAAJAAAAAAAAABMAAAAAAAAAIgAAAAMAAAAOAAAAAQAAABQAAAADAAAAJAAAAAMAAAADAAAAAAAAAA0AAAAFAAAAHQAAAAUAAAABAAAAAAAAAAcAAAAAAAAAFQAAAAAAAAAGAAAAAQAAAAkAAAAAAAAAEwAAAAAAAAAEAAAAAgAAAAwAAAAFAAAAGgAAAAUAAAAAAAAAAQAAAAMAAAAAAAAADQAAAAUAAAACAAAAAQAAAAEAAAAAAAAABwAAAAAAAAAaAAAAAAAAACoAAAAAAAAAOgAAAAAAAAAdAAAAAAAAACsAAAAAAAAAPgAAAAMAAAAmAAAAAQAAAC8AAAADAAAAQAAAAAMAAAAMAAAAAAAAABwAAAAFAAAALAAAAAUAAAANAAAAAAAAABoAAAAAAAAAKgAAAAAAAAAVAAAAAQAAAB0AAAAAAAAAKwAAAAAAAAAEAAAAAwAAAA8AAAAFAAAAHwAAAAUAAAADAAAAAQAAAAwAAAAAAAAAHAAAAAUAAAAHAAAAAQAAAA0AAAAAAAAAGgAAAAAAAAAfAAAAAAAAACkAAAAAAAAAMQAAAAAAAAAsAAAAAAAAADUAAAAAAAAAPQAAAAMAAAA6AAAAAQAAAEEAAAADAAAASwAAAAMAAAAPAAAAAAAAABYAAAAFAAAAIQAAAAUAAAAcAAAAAAAAAB8AAAAAAAAAKQAAAAAAAAAqAAAAAQAAACwAAAAAAAAANQAAAAAAAAAEAAAABAAAAAgAAAAFAAAAEAAAAAUAAAAMAAAAAQAAAA8AAAAAAAAAFgAAAAUAAAAaAAAAAQAAABwAAAAAAAAAHwAAAAAAAAAyAAAAAAAAADAAAAAAAAAAMQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAIQAAAAMAAAAYAAAAAwAAABIAAAADAAAAEAAAAAMAAABGAAAAAAAAAEMAAAAAAAAAQgAAAAMAAAA0AAAAAwAAADIAAAAAAAAAMAAAAAAAAAAlAAAAAwAAACAAAAAAAAAAHgAAAAMAAABTAAAAAAAAAFcAAAADAAAAVQAAAAMAAABKAAAAAwAAAEYAAAAAAAAAQwAAAAAAAAA5AAAAAQAAADQAAAADAAAAMgAAAAAAAAAZAAAAAAAAABcAAAAAAAAAGAAAAAMAAAARAAAAAAAAAAsAAAADAAAACgAAAAMAAAAOAAAAAwAAAAYAAAADAAAAAgAAAAMAAAAtAAAAAAAAACcAAAAAAAAAJQAAAAMAAAAjAAAAAwAAABkAAAAAAAAAFwAAAAAAAAAbAAAAAwAAABEAAAAAAAAACwAAAAMAAAA/AAAAAAAAADsAAAADAAAAOQAAAAMAAAA4AAAAAwAAAC0AAAAAAAAAJwAAAAAAAAAuAAAAAwAAACMAAAADAAAAGQAAAAAAAAAkAAAAAAAAABQAAAAAAAAADgAAAAMAAAAiAAAAAAAAABMAAAADAAAACQAAAAMAAAAmAAAAAwAAABUAAAADAAAABwAAAAMAAAA3AAAAAAAAACgAAAAAAAAAGwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAFAAAAAAAAAAzAAAAAwAAACIAAAAAAAAAEwAAAAMAAABIAAAAAAAAADwAAAADAAAALgAAAAMAAABJAAAAAwAAADcAAAAAAAAAKAAAAAAAAABHAAAAAwAAADYAAAADAAAAJAAAAAAAAABAAAAAAAAAAC8AAAAAAAAAJgAAAAMAAAA+AAAAAAAAACsAAAADAAAAHQAAAAMAAAA6AAAAAwAAACoAAAADAAAAGgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAMwAAAAMAAABSAAAAAwAAAEAAAAAAAAAALwAAAAAAAABMAAAAAwAAAD4AAAAAAAAAKwAAAAMAAABhAAAAAAAAAFkAAAADAAAARwAAAAMAAABiAAAAAwAAAFQAAAAAAAAARQAAAAAAAABgAAAAAwAAAFIAAAADAAAAQAAAAAAAAABLAAAAAAAAAEEAAAAAAAAAOgAAAAMAAAA9AAAAAAAAADUAAAADAAAALAAAAAMAAAAxAAAAAwAAACkAAAADAAAAHwAAAAMAAABeAAAAAAAAAFYAAAAAAAAATAAAAAMAAABRAAAAAwAAAEsAAAAAAAAAQQAAAAAAAABCAAAAAwAAAD0AAAAAAAAANQAAAAMAAABrAAAAAAAAAGgAAAADAAAAYAAAAAMAAABlAAAAAwAAAF4AAAAAAAAAVgAAAAAAAABVAAAAAwAAAFEAAAADAAAASwAAAAAAAAA5AAAAAAAAADsAAAAAAAAAPwAAAAMAAABKAAAAAAAAAE4AAAADAAAATwAAAAMAAABTAAAAAwAAAFwAAAADAAAAXwAAAAMAAAAlAAAAAAAAACcAAAADAAAALQAAAAMAAAA0AAAAAAAAADkAAAAAAAAAOwAAAAAAAABGAAAAAwAAAEoAAAAAAAAATgAAAAMAAAAYAAAAAAAAABcAAAADAAAAGQAAAAMAAAAgAAAAAwAAACUAAAAAAAAAJwAAAAMAAAAyAAAAAwAAADQAAAAAAAAAOQAAAAAAAAAuAAAAAAAAADwAAAAAAAAASAAAAAMAAAA4AAAAAAAAAEQAAAADAAAAUAAAAAMAAAA/AAAAAwAAAE0AAAADAAAAWgAAAAMAAAAbAAAAAAAAACgAAAADAAAANwAAAAMAAAAjAAAAAAAAAC4AAAAAAAAAPAAAAAAAAAAtAAAAAwAAADgAAAAAAAAARAAAAAMAAAAOAAAAAAAAABQAAAADAAAAJAAAAAMAAAARAAAAAwAAABsAAAAAAAAAKAAAAAMAAAAZAAAAAwAAACMAAAAAAAAALgAAAAAAAABHAAAAAAAAAFkAAAAAAAAAYQAAAAMAAABJAAAAAAAAAFsAAAADAAAAZwAAAAMAAABIAAAAAwAAAFgAAAADAAAAaQAAAAMAAAAzAAAAAAAAAEUAAAADAAAAVAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAWQAAAAAAAAA3AAAAAwAAAEkAAAAAAAAAWwAAAAMAAAAmAAAAAAAAAC8AAAADAAAAQAAAAAMAAAAiAAAAAwAAADMAAAAAAAAARQAAAAMAAAAkAAAAAwAAADYAAAAAAAAARwAAAAAAAABgAAAAAAAAAGgAAAAAAAAAawAAAAMAAABiAAAAAAAAAG4AAAADAAAAcwAAAAMAAABhAAAAAwAAAG8AAAADAAAAdwAAAAMAAABMAAAAAAAAAFYAAAADAAAAXgAAAAMAAABSAAAAAAAAAGAAAAAAAAAAaAAAAAAAAABUAAAAAwAAAGIAAAAAAAAAbgAAAAMAAAA6AAAAAAAAAEEAAAADAAAASwAAAAMAAAA+AAAAAwAAAEwAAAAAAAAAVgAAAAMAAABAAAAAAwAAAFIAAAAAAAAAYAAAAAAAAABVAAAAAAAAAFcAAAAAAAAAUwAAAAMAAABlAAAAAAAAAGYAAAADAAAAZAAAAAMAAABrAAAAAwAAAHAAAAADAAAAcgAAAAMAAABCAAAAAAAAAEMAAAADAAAARgAAAAMAAABRAAAAAAAAAFUAAAAAAAAAVwAAAAAAAABeAAAAAwAAAGUAAAAAAAAAZgAAAAMAAAAxAAAAAAAAADAAAAADAAAAMgAAAAMAAAA9AAAAAwAAAEIAAAAAAAAAQwAAAAMAAABLAAAAAwAAAFEAAAAAAAAAVQAAAAAAAABfAAAAAAAAAFwAAAAAAAAAUwAAAAAAAABPAAAAAAAAAE4AAAAAAAAASgAAAAMAAAA/AAAAAQAAADsAAAADAAAAOQAAAAMAAABtAAAAAAAAAGwAAAAAAAAAZAAAAAUAAABdAAAAAQAAAF8AAAAAAAAAXAAAAAAAAABNAAAAAQAAAE8AAAAAAAAATgAAAAAAAAB1AAAABAAAAHYAAAAFAAAAcgAAAAUAAABqAAAAAQAAAG0AAAAAAAAAbAAAAAAAAABaAAAAAQAAAF0AAAABAAAAXwAAAAAAAABaAAAAAAAAAE0AAAAAAAAAPwAAAAAAAABQAAAAAAAAAEQAAAAAAAAAOAAAAAMAAABIAAAAAQAAADwAAAADAAAALgAAAAMAAABqAAAAAAAAAF0AAAAAAAAATwAAAAUAAABjAAAAAQAAAFoAAAAAAAAATQAAAAAAAABYAAAAAQAAAFAAAAAAAAAARAAAAAAAAAB1AAAAAwAAAG0AAAAFAAAAXwAAAAUAAABxAAAAAQAAAGoAAAAAAAAAXQAAAAAAAABpAAAAAQAAAGMAAAABAAAAWgAAAAAAAABpAAAAAAAAAFgAAAAAAAAASAAAAAAAAABnAAAAAAAAAFsAAAAAAAAASQAAAAMAAABhAAAAAQAAAFkAAAADAAAARwAAAAMAAABxAAAAAAAAAGMAAAAAAAAAUAAAAAUAAAB0AAAAAQAAAGkAAAAAAAAAWAAAAAAAAABvAAAAAQAAAGcAAAAAAAAAWwAAAAAAAAB1AAAAAgAAAGoAAAAFAAAAWgAAAAUAAAB5AAAAAQAAAHEAAAAAAAAAYwAAAAAAAAB3AAAAAQAAAHQAAAABAAAAaQAAAAAAAAB3AAAAAAAAAG8AAAAAAAAAYQAAAAAAAABzAAAAAAAAAG4AAAAAAAAAYgAAAAMAAABrAAAAAQAAAGgAAAADAAAAYAAAAAMAAAB5AAAAAAAAAHQAAAAAAAAAZwAAAAUAAAB4AAAAAQAAAHcAAAAAAAAAbwAAAAAAAABwAAAAAQAAAHMAAAAAAAAAbgAAAAAAAAB1AAAAAQAAAHEAAAAFAAAAaQAAAAUAAAB2AAAAAQAAAHkAAAAAAAAAdAAAAAAAAAByAAAAAQAAAHgAAAABAAAAdwAAAAAAAAByAAAAAAAAAHAAAAAAAAAAawAAAAAAAABkAAAAAAAAAGYAAAAAAAAAZQAAAAMAAABTAAAAAQAAAFcAAAADAAAAVQAAAAMAAAB2AAAAAAAAAHgAAAAAAAAAcwAAAAUAAABsAAAAAQAAAHIAAAAAAAAAcAAAAAAAAABcAAAAAQAAAGQAAAAAAAAAZgAAAAAAAAB1AAAAAAAAAHkAAAAFAAAAdwAAAAUAAABtAAAAAQAAAHYAAAAAAAAAeAAAAAAAAABfAAAAAQAAAGwAAAABAAAAcgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAABAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAB+ogX28rbpPxqumpJv+fM/165tC4ns9D+XaEnTqUsEQFrOtNlC4PA/3U+0XG6P9b9TdUUBxTTjP4PUp8ex1ty/B1rD/EN43z+lcDi6LLrZP/a45NWEHMY/oJ5ijLDZ+j/xw3rjxWPjP2B8A46ioQdAotff3wla2z+FMSpA1jj+v6b5Y1mtPbS/cIu8K0F457/2esiyJpDNv98k5Ts2NeA/pvljWa09tD88ClUJ60MDQPZ6yLImkM0/4ONKxa0UBcD2uOTVhBzGv5G7JRxGave/8cN648Vj47+HCwtkjAXIv6LX398JWtu/qyheaCAL9D9TdUUBxTTjv4gyTxslhwVAB1rD/EN4378EH/28teoFwH6iBfbytum/F6ztFYdK/r/Xrm0Liez0vwcS6wNGWeO/Ws602ULg8L9TCtRLiLT8P8pi5RexJsw/BlIKPVwR5T95Wyu0/QjnP5PjoT7YYcu/mBhKZ6zrwj8wRYS7NebuP3qW6geh+Ls/SLrixebL3r+pcyymN9XrPwmkNHp7xec/GWNMZVAA17+82s+x2BLiPwn2ytbJ9ek/LgEH1sMS1j8yp/2LhTfeP+SnWwtQBbu/d38gkp5X7z8ytsuHaADGPzUYObdf1+m/7IauECWhwz+cjSACjzniP76Z+wUhN9K/1+GEKzup67+/GYr/04baPw6idWOvsuc/ZedTWsRa5b/EJQOuRzi0v/OncYhHPes/h49PixY53j+i8wWfC03Nvw2idWOvsue/ZedTWsRa5T/EJQOuRzi0P/KncYhHPeu/iY9PixY53r+i8wWfC03NP9anWwtQBbs/d38gkp5X778ytsuHaADGvzUYObdf1+k/74auECWhw7+cjSACjzniv8CZ+wUhN9I/1uGEKzup6z+/GYr/04bavwmkNHp7xee/F2NMZVAA1z+82s+x2BLivwr2ytbJ9em/KwEH1sMS1r8yp/2LhTfev81i5RexJsy/BlIKPVwR5b95Wyu0/Qjnv5DjoT7YYcs/nBhKZ6zrwr8wRYS7Nebuv3OW6geh+Lu/SLrixebL3j+pcyymN9Xrv8rHIFfWehZAMBwUdlo0DECTUc17EOb2PxpVB1SWChdAzjbhb9pTDUDQhmdvECX5P9FlMKCC9+g/IIAzjELgE0DajDngMv8GQFhWDmDPjNs/y1guLh96EkAxPi8k7DIEQJCc4URlhRhA3eLKKLwkEECqpNAyTBD/P6xpjXcDiwVAFtl//cQm4z+Ibt3XKiYTQM7mCLUb3QdAoM1t8yVv7D8aLZv2Nk8UQEAJPV5nQwxAtSsfTCoE9z9TPjXLXIIWQBVanC5W9AtAYM3d7Adm9j++5mQz1FoWQBUThyaVBghAwH5muQsV7T89Q1qv82MUQJoWGOfNuBdAzrkClkmwDkDQjKq77t37Py+g0dtitsE/ZwAMTwVPEUBojepluNwBQGYbtuW+t9w/HNWIJs6MEkDTNuQUSlgEQKxktPP5TcQ/ixbLB8JjEUCwuWjXMQYCQAS/R09FkRdAowpiZjhhDkB7LmlczD/7P01iQmhhsAVAnrtTwDy84z/Z6jfQ2TgTQChOCXMnWwpAhrW3daoz8z/HYJvVPI4VQLT3ik5FcA5Angi7LOZd+z+NNVzDy5gXQBXdvVTFUA1AYNMgOeYe+T8+qHXGCwkXQKQTOKwa5AJA8gFVoEMW0T+FwzJyttIRQAEAAAD/////BwAAAP////8xAAAA/////1cBAAD/////YQkAAP////+nQQAA/////5HLAQD/////95AMAP/////B9lcAAAAAAAAAAAAAAAAAAgAAAP////8OAAAA/////2IAAAD/////rgIAAP/////CEgAA/////06DAAD/////IpcDAP/////uIRkA/////4LtrwAAAAAAAAAAAAAAAAAAAAAAAgAAAP//////////AQAAAAMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////wIAAAD//////////wEAAAAAAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA/////////////////////wEAAAD///////////////8CAAAA////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD///////////////////////////////8CAAAA////////////////AQAAAP////////////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAAAQAAAP//////////AgAAAP//////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAAEAAAD//////////wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAgAAAAAAAAACAAAAAQAAAAEAAAACAAAAAgAAAAAAAAAFAAAABQAAAAAAAAACAAAAAgAAAAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAIAAAABAAAAAgAAAAIAAAACAAAAAAAAAAUAAAAGAAAAAAAAAAIAAAACAAAAAwAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAIAAAAAAAAAAgAAAAEAAAADAAAAAgAAAAIAAAAAAAAABQAAAAcAAAAAAAAAAgAAAAIAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAgAAAAAAAAACAAAAAQAAAAQAAAACAAAAAgAAAAAAAAAFAAAACAAAAAAAAAACAAAAAgAAAAMAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAACAAAAAAAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAUAAAAJAAAAAAAAAAIAAAACAAAAAwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAIAAAACAAAAAAAAAAMAAAAOAAAAAgAAAAAAAAACAAAAAwAAAAAAAAAAAAAAAgAAAAIAAAADAAAABgAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAgAAAAIAAAAAAAAAAwAAAAoAAAACAAAAAAAAAAIAAAADAAAAAQAAAAAAAAACAAAAAgAAAAMAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAgAAAAAAAAADAAAACwAAAAIAAAAAAAAAAgAAAAMAAAACAAAAAAAAAAIAAAACAAAAAwAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAACAAAAAAAAAAMAAAAMAAAAAgAAAAAAAAACAAAAAwAAAAMAAAAAAAAAAgAAAAIAAAADAAAACQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAgAAAAIAAAAAAAAAAwAAAA0AAAACAAAAAAAAAAIAAAADAAAABAAAAAAAAAACAAAAAgAAAAMAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAgAAAAAAAAADAAAABgAAAAIAAAAAAAAAAgAAAAMAAAAPAAAAAAAAAAIAAAACAAAAAwAAAAsAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAIAAAACAAAAAAAAAAMAAAAHAAAAAgAAAAAAAAACAAAAAwAAABAAAAAAAAAAAgAAAAIAAAADAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAIAAAAAAAAAAwAAAAgAAAACAAAAAAAAAAIAAAADAAAAEQAAAAAAAAACAAAAAgAAAAMAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAACAAAAAgAAAAAAAAADAAAACQAAAAIAAAAAAAAAAgAAAAMAAAASAAAAAAAAAAIAAAACAAAAAwAAAA4AAAAAAAAAAAAAAAAAAAAAAAAACQAAAAIAAAACAAAAAAAAAAMAAAAFAAAAAgAAAAAAAAACAAAAAwAAABMAAAAAAAAAAgAAAAIAAAADAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAgAAAAAAAAACAAAAAQAAABMAAAACAAAAAgAAAAAAAAAFAAAACgAAAAAAAAACAAAAAgAAAAMAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABEAAAACAAAAAAAAAAIAAAABAAAADwAAAAIAAAACAAAAAAAAAAUAAAALAAAAAAAAAAIAAAACAAAAAwAAABEAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAIAAAAAAAAAAgAAAAEAAAAQAAAAAgAAAAIAAAAAAAAABQAAAAwAAAAAAAAAAgAAAAIAAAADAAAAEgAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAACAAAAAQAAABEAAAACAAAAAgAAAAAAAAAFAAAADQAAAAAAAAACAAAAAgAAAAMAAAATAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAACAAAAAAAAAAIAAAABAAAAEgAAAAIAAAACAAAAAAAAAAUAAAAOAAAAAAAAAAIAAAACAAAAAwAAAAIAAAABAAAAAAAAAAEAAAACAAAAAAAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAEAAAAAAAAAAgAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAAAAAAAAAAABQAAAAQAAAAAAAAAAQAAAAUAAAAEAAAAAAAAAAUAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAgAAAAAAAAABAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAAAAAAAAAAABQAAAAQAAAAAAAAAAQAAAAUAAAAEAAAAAAAAAAUAAAAFAAAAAAAAAAEAAAAAAAAAAAAAAMuhRbbsNlBBYqHW9OmHIkF9XBuqnS31QAK37uYhNMhAOSo3UUupm0DC+6pc6JxvQHV9eseEEEJAzURsCyqlFEB8BQ4NMJjnPyy3tBoS97o/xawXQznRjj89J2K2CZxhP6vX43RIIDQ/S8isgygEBz+LvFHQkmzaPjFFFO7wMq4+AADMLkTtjkIAAOgkJqxhQgAAU7B0MjRCAADwpBcVB0IAAACYP2HaQQAAAIn/Ja5BzczM4Eg6gUHNzMxMU7BTQTMzMzNfgCZBAAAAAEi3+UAAAAAAwGPNQDMzMzMzy6BAmpmZmZkxc0AzMzMzM/NFQDMzMzMzMxlAzczMzMzM7D+ygXSx2U6RQKimJOvQKnpA23hmONTHY0A/AGcxyudNQNb3K647mzZA+S56rrwWIUAm4kUQ+9UJQKre9hGzh/M/BLvoy9WG3T+LmqMf8VHGP2m3nYNV37A/gbFHcyeCmT+cBPWBckiDP61tZACjKW0/q2RbYVUYVj8uDypVyLNAP6jGS5cA5zBBwcqhBdCNGUEGEhQ/JVEDQT6WPnRbNO1AB/AWSJgT1kDfUWNCNLDAQNk+5C33OqlAchWL34QSk0DKvtDIrNV8QNF0G3kFzGVASSeWhBl6UED+/0mNGuk4QGjA/dm/1CJALPLPMql6DEDSHoDrwpP1P2jouzWST+A/egAAAAAAAABKAwAAAAAAAPoWAAAAAAAAyqAAAAAAAAB6ZQQAAAAAAErGHgAAAAAA+mvXAAAAAADK8+MFAAAAAHqqOykAAAAASqmhIAEAAAD6oGvkBwAAAMpm8T43AAAAes+ZuIIBAABKrDQMkwoAAPq1cFUFSgAAyvkUViUGAgAAAAAAAwAAAAYAAAACAAAABQAAAAEAAAAEAAAAAAAAAAAAAAAFAAAAAwAAAAEAAAAGAAAABAAAAAIAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAA/////wAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAP////8AAAAAAAAAAAEAAAABAAAAAAAAAAAAAAD/////AAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAFAAAAAQAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAAAAAABAAEAAAEBAAAAAAABAAAAAQAAAAEAAQAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAHAAAABwAAAAEAAAACAAAABAAAAAMAAAAAAAAAAAAAAAcAAAADAAAAAQAAAAIAAAAFAAAABAAAAAAAAAAAAAAAYWxnb3MuYwBfcG9seWZpbGxJbnRlcm5hbABhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0dlb0JvdW5kYXJ5AGFkamFjZW50RmFjZURpcltjZW50ZXJJSksuZmFjZV1bZmFjZTJdID09IEtJAF9mYWNlSWprVG9HZW9Cb3VuZGFyeQBwb2x5Z29uLT5uZXh0ID09IE5VTEwAbGlua2VkR2VvLmMAYWRkTmV3TGlua2VkUG9seWdvbgBuZXh0ICE9IE5VTEwAbG9vcCAhPSBOVUxMAGFkZE5ld0xpbmtlZExvb3AAcG9seWdvbi0+Zmlyc3QgPT0gTlVMTABhZGRMaW5rZWRMb29wAGNvb3JkICE9IE5VTEwAYWRkTGlua2VkQ29vcmQAbG9vcC0+Zmlyc3QgPT0gTlVMTABpbm5lckxvb3BzICE9IE5VTEwAbm9ybWFsaXplTXVsdGlQb2x5Z29uAGJib3hlcyAhPSBOVUxMAGNhbmRpZGF0ZXMgIT0gTlVMTABmaW5kUG9seWdvbkZvckhvbGUAY2FuZGlkYXRlQkJveGVzICE9IE5VTEwAcmV2RGlyICE9IElOVkFMSURfRElHSVQAbG9jYWxpai5jAGgzVG9Mb2NhbElqawBiYXNlQ2VsbCAhPSBvcmlnaW5CYXNlQ2VsbAAhKG9yaWdpbk9uUGVudCAmJiBpbmRleE9uUGVudCkAcGVudGFnb25Sb3RhdGlvbnMgPj0gMABkaXJlY3Rpb25Sb3RhdGlvbnMgPj0gMABiYXNlQ2VsbCA9PSBvcmlnaW5CYXNlQ2VsbABiYXNlQ2VsbCAhPSBJTlZBTElEX0JBU0VfQ0VMTABsb2NhbElqa1RvSDMAIV9pc0Jhc2VDZWxsUGVudGFnb24oYmFzZUNlbGwpAGJhc2VDZWxsUm90YXRpb25zID49IDAAd2l0aGluUGVudGFnb25Sb3RhdGlvbnMgPj0gMABncmFwaC0+YnVja2V0cyAhPSBOVUxMAHZlcnRleEdyYXBoLmMAaW5pdFZlcnRleEdyYXBoAG5vZGUgIT0gTlVMTABhZGRWZXJ0ZXhOb2Rl";function J(e){return e}function K(e){return e.replace(/\b__Z[\w\d_]+/g,(function(e){return e===e?e:e+" ["+e+"]"}))}function $(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function ee(){return M.length}function te(e){try{var t=new ArrayBuffer(e);if(t.byteLength!=e)return;return new Int8Array(t).set(M),ae(t),D(t),1}catch(e){}}function ne(e){for(var t=[],n=0;n255&&(r&=255),t.push(String.fromCharCode(r))}return t.join("")}var re="function"==typeof atob?atob:function(e){var t,n,r,i,o,a,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",A="",l=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{t=s.indexOf(e.charAt(l++))<<2|(i=s.indexOf(e.charAt(l++)))>>4,n=(15&i)<<4|(o=s.indexOf(e.charAt(l++)))>>2,r=(3&o)<<6|(a=s.indexOf(e.charAt(l++))),A+=String.fromCharCode(t),64!==o&&(A+=String.fromCharCode(n)),64!==a&&(A+=String.fromCharCode(r))}while(l>2]=e,i[s+4>>2]=t,(s=0!=(0|o))&&(i[o>>2]=0),0|Ie(e,t))return P=a,0|(f=1);i[f>>2]=0;e:do{if((0|n)>=1)if(s)for(u=0,h=1,d=1,A=0,s=e;;){if(!(A|u)){if(0==(0|(s=0|I(s,t,4,f)))&0==(0|(t=0|w()))){s=2;break e}if(0|Ie(s,t)){s=1;break e}}if(0==(0|(s=0|I(s,t,0|i[16+(u<<2)>>2],f)))&0==(0|(t=0|w()))){s=2;break e}if(i[(e=r+(d<<3)|0)>>2]=s,i[e+4>>2]=t,i[o+(d<<2)>>2]=h,e=(0|(A=A+1|0))==(0|h),c=6==(0|(l=u+1|0)),0|Ie(s,t)){s=1;break e}if((0|(h=h+(c&e&1)|0))>(0|n)){s=0;break}u=e?c?0:l:u,d=d+1|0,A=e?0:A}else for(u=0,h=1,d=1,A=0,s=e;;){if(!(A|u)){if(0==(0|(s=0|I(s,t,4,f)))&0==(0|(t=0|w()))){s=2;break e}if(0|Ie(s,t)){s=1;break e}}if(0==(0|(s=0|I(s,t,0|i[16+(u<<2)>>2],f)))&0==(0|(t=0|w()))){s=2;break e}if(i[(e=r+(d<<3)|0)>>2]=s,i[e+4>>2]=t,e=(0|(A=A+1|0))==(0|h),c=6==(0|(l=u+1|0)),0|Ie(s,t)){s=1;break e}if((0|(h=h+(c&e&1)|0))>(0|n)){s=0;break}u=e?c?0:l:u,d=d+1|0,A=e?0:A}else s=0}while(0);return P=a,0|(f=s)}function D(e,t,n,r,o,a,s){n|=0,r|=0,o|=0,a|=0,s|=0;var A,l,c=0,u=0,h=0,d=0,f=0;if(l=P,P=P+16|0,A=l,0==(0|(e|=0))&0==(0|(t|=0)))P=l;else{if(c=0|wt(0|e,0|t,0|a,((0|a)<0)<<31>>31|0),w(),!(0==(0|(f=0|i[(d=u=r+(c<<3)|0)>>2]))&0==(0|(d=0|i[d+4>>2]))|(h=(0|f)==(0|e)&(0|d)==(0|t))))do{h=(0|(d=0|i[(f=u=r+((c=(c+1|0)%(0|a)|0)<<3)|0)>>2]))==(0|e)&(0|(f=0|i[f+4>>2]))==(0|t)}while(!(0==(0|d)&0==(0|f)|h));c=o+(c<<2)|0,h&&(0|i[c>>2])<=(0|s)||(i[(f=u)>>2]=e,i[f+4>>2]=t,i[c>>2]=s,(0|s)>=(0|n)||(f=s+1|0,i[A>>2]=0,D(d=0|I(e,t,2,A),0|w(),n,r,o,a,f),i[A>>2]=0,D(d=0|I(e,t,3,A),0|w(),n,r,o,a,f),i[A>>2]=0,D(d=0|I(e,t,1,A),0|w(),n,r,o,a,f),i[A>>2]=0,D(d=0|I(e,t,5,A),0|w(),n,r,o,a,f),i[A>>2]=0,D(d=0|I(e,t,4,A),0|w(),n,r,o,a,f),i[A>>2]=0,D(d=0|I(e,t,6,A),0|w(),n,r,o,a,f))),P=l}}function I(e,t,n,r){e|=0,t|=0,n|=0;var o,a,s=0,A=0,l=0,c=0,u=0,h=0,d=0;if((0|i[(r|=0)>>2])>0){s=0;do{n=0|Ae(n),s=s+1|0}while((0|s)<(0|i[r>>2]))}o=0|Mt(0|e,0|t,45),w(),a=127&o,A=0|Oe(e,t),s=0|Mt(0|e,0|t,52),w(),s&=15;e:do{if(s)for(;;){if(h=0|Mt(0|e,0|t,0|(u=3*(15-s|0)|0)),w(),h&=7,d=0==(0|Ue(s)),s=s+-1|0,c=0|St(7,0,0|u),t&=~(0|w()),e=(u=0|St(0|i[(d?464:48)+(28*h|0)+(n<<2)>>2],0,0|u))|e&~c,t|=0|w(),!(n=0|i[(d?672:256)+(28*h|0)+(n<<2)>>2])){n=0;break e}if(!s){l=6;break}}else l=6}while(0);6==(0|l)&&(e|=h=0|St(0|(d=0|i[880+(28*a|0)+(n<<2)>>2]),0,45),t=0|w()|-1040385&t,n=0|i[4304+(28*a|0)+(n<<2)>>2],127==(127&d|0)&&(d=0|St(0|i[880+(28*a|0)+20>>2],0,45),t=0|w()|-1040385&t,n=0|i[4304+(28*a|0)+20>>2],e=0|ke(d|e,t),t=0|w(),i[r>>2]=1+(0|i[r>>2]))),l=0|Mt(0|e,0|t,45),w(),l&=127;e:do{if(0|B(l)){t:do{if(1==(0|Oe(e,t))){if((0|a)!=(0|l)){if(0|U(l,0|i[7728+(28*a|0)>>2])){e=0|ze(e,t),A=1,t=0|w();break}e=0|ke(e,t),A=1,t=0|w();break}switch(0|A){case 5:e=0|ze(e,t),t=0|w(),i[r>>2]=5+(0|i[r>>2]),A=0;break t;case 3:e=0|ke(e,t),t=0|w(),i[r>>2]=1+(0|i[r>>2]),A=0;break t;default:return d=0,_(0|(h=0)),0|d}}else A=0}while(0);if((0|n)>0){s=0;do{e=0|Be(e,t),t=0|w(),s=s+1|0}while((0|s)!=(0|n))}if((0|a)!=(0|l)){if(!(0|k(l))){if(0!=(0|A)|5!=(0|Oe(e,t)))break;i[r>>2]=1+(0|i[r>>2]);break}switch(127&o){case 8:case 118:break e}3!=(0|Oe(e,t))&&(i[r>>2]=1+(0|i[r>>2]))}}else if((0|n)>0){s=0;do{e=0|ke(e,t),t=0|w(),s=s+1|0}while((0|s)!=(0|n))}}while(0);return i[r>>2]=((0|i[r>>2])+n|0)%6|0,d=e,_(0|(h=t)),0|d}function O(e,t,n,r,a,s){t|=0,n|=0,r|=0,a|=0,s|=0;var A,l,c,u,h,d,f,p,m,g=0,v=0,y=0,x=0,b=0,_=0,M=0,S=0,E=0,T=0,C=0,R=0,L=0,q=0;if(m=P,P=P+48|0,d=m+32|0,f=m+16|0,p=m,(0|(g=0|i[(e|=0)>>2]))<=0)return P=m,0|(R=0);A=e+4|0,l=d+8|0,c=f+8|0,u=p+8|0,h=((0|t)<0)<<31>>31,C=0;e:for(;;){E=(v=0|i[A>>2])+(C<<4)|0,i[d>>2]=i[E>>2],i[d+4>>2]=i[E+4>>2],i[d+8>>2]=i[E+8>>2],i[d+12>>2]=i[E+12>>2],(0|C)==(g+-1|0)?(i[f>>2]=i[v>>2],i[f+4>>2]=i[v+4>>2],i[f+8>>2]=i[v+8>>2],i[f+12>>2]=i[v+12>>2]):(E=v+(C+1<<4)|0,i[f>>2]=i[E>>2],i[f+4>>2]=i[E+4>>2],i[f+8>>2]=i[E+8>>2],i[f+12>>2]=i[E+12>>2]),E=0|W(d,f,n);t:do{if((0|E)>0){T=+(0|E),S=0;n:for(;;){q=+(E-S|0),L=+(0|S),o[p>>3]=+o[d>>3]*q/T+ +o[f>>3]*L/T,o[u>>3]=+o[l>>3]*q/T+ +o[c>>3]*L/T,v=0|wt(0|(_=0|Fe(p,n)),0|(M=0|w()),0|t,0|h),w(),x=0|i[(y=g=s+(v<<3)|0)>>2],y=0|i[y+4>>2];r:do{if(0==(0|x)&0==(0|y))R=14;else for(b=0;;){if((0|b)>(0|t)){g=1;break r}if((0|x)==(0|_)&(0|y)==(0|M)){g=7;break r}if(0==(0|(x=0|i[(y=g=s+((v=(v+1|0)%(0|t)|0)<<3)|0)>>2]))&0==(0|(y=0|i[y+4>>2]))){R=14;break}b=b+1|0}}while(0);switch(14==(0|R)&&(R=0,0==(0|_)&0==(0|M)?g=7:(i[g>>2]=_,i[g+4>>2]=M,g=0|i[r>>2],i[(b=a+(g<<3)|0)>>2]=_,i[b+4>>2]=M,i[r>>2]=g+1,g=0)),7&g){case 7:case 0:break;default:break n}if((0|E)<=(0|(S=S+1|0))){R=8;break t}}if(0|g){g=-1,R=20;break e}}else R=8}while(0);if(8==(0|R)&&(R=0),(0|(C=C+1|0))>=(0|(g=0|i[e>>2]))){g=0,R=20;break}}return 20==(0|R)?(P=m,0|g):0}function B(e){return 0|i[7728+(28*(e|=0)|0)+16>>2]}function k(e){return 4==(0|(e|=0))|117==(0|e)|0}function N(e){return 0|i[11152+(216*(0|i[(e|=0)>>2])|0)+(72*(0|i[e+4>>2])|0)+(24*(0|i[e+8>>2])|0)+(i[e+12>>2]<<3)>>2]}function z(e){return 0|i[11152+(216*(0|i[(e|=0)>>2])|0)+(72*(0|i[e+4>>2])|0)+(24*(0|i[e+8>>2])|0)+(i[e+12>>2]<<3)+4>>2]}function U(e,t){return t|=0,(0|i[7728+(28*(e|=0)|0)+20>>2])==(0|t)?0|(t=1):0|(t=(0|i[7728+(28*e|0)+24>>2])==(0|t))}function F(e,t){return 0|i[880+(28*(e|=0)|0)+((t|=0)<<2)>>2]}function H(e,t){return t|=0,(0|i[880+(28*(e|=0)|0)>>2])==(0|t)?0|(t=0):(0|i[880+(28*e|0)+4>>2])==(0|t)?0|(t=1):(0|i[880+(28*e|0)+8>>2])==(0|t)?0|(t=2):(0|i[880+(28*e|0)+12>>2])==(0|t)?0|(t=3):(0|i[880+(28*e|0)+16>>2])==(0|t)?0|(t=4):(0|i[880+(28*e|0)+20>>2])==(0|t)?0|(t=5):0|((0|i[880+(28*e|0)+24>>2])==(0|t)?6:7)}function G(e){return+o[(e|=0)+16>>3]<+o[e+24>>3]|0}function V(e,t){e|=0;var n,r,i=0;return(i=+o[(t|=0)>>3])>=+o[e+8>>3]&&i<=+o[e>>3]?(n=+o[e+16>>3],i=+o[e+24>>3],t=(r=+o[t+8>>3])>=i,e=r<=n&1,n>2]=0,u=u+4|0}while((0|u)<(0|h));return We(t,a),Ve(h=0|i[(u=a)>>2],u=0|i[u+4>>2],n),je(h,u,r),l=+Ce(n,r+8|0),o[n>>3]=+o[e>>3],o[(u=n+8|0)>>3]=+o[e+16>>3],o[r>>3]=+o[e+8>>3],o[(h=r+8|0)>>3]=+o[e+24>>3],c=+Ce(n,r),h=~~+v(+c*c/+Et(+ +A(+(+o[u>>3]-+o[h>>3])/(+o[n>>3]-+o[r>>3])),3)/(l*(2.59807621135*l)*.8)),P=s,0|(0==(0|h)?1:h)}function W(e,t,n){e|=0,t|=0,n|=0;var r,o,a,s,A,l=0,c=0;s=P,P=P+288|0,r=s+264|0,o=s+96|0,c=(l=a=s)+96|0;do{i[l>>2]=0,l=l+4|0}while((0|l)<(0|c));return We(n,a),Ve(l=0|i[(c=a)>>2],c=0|i[c+4>>2],r),je(l,c,o),A=+Ce(r,o+8|0),c=~~+v(+ +Ce(e,t)/(2*A)),P=s,0|(0==(0|c)?1:c)}function Q(e,t,n,r){t|=0,n|=0,r|=0,i[(e|=0)>>2]=t,i[e+4>>2]=n,i[e+8>>2]=r}function Y(e,t){e|=0;var n,r,a,s,l=0,c=0,u=0,h=0,d=0,f=0,p=0;i[(s=(t|=0)+8|0)>>2]=0,r=+o[e>>3],h=+A(+r),a=+o[e+8>>3],h+=.5*(d=+A(+a)/.8660254037844386),h-=+(0|(l=~~h)),d-=+(0|(e=~~d));do{if(h<.5){if(h<.3333333333333333){if(i[t>>2]=l,d<.5*(h+1)){i[t+4>>2]=e;break}e=e+1|0,i[t+4>>2]=e;break}if(e=(1&!(d<(p=1-h)))+e|0,i[t+4>>2]=e,p<=d&d<2*h){l=l+1|0,i[t>>2]=l;break}i[t>>2]=l;break}if(!(h<.6666666666666666)){if(l=l+1|0,i[t>>2]=l,d<.5*h){i[t+4>>2]=e;break}e=e+1|0,i[t+4>>2]=e;break}if(d<1-h){if(i[t+4>>2]=e,2*h-1>2]=l;break}}else e=e+1|0,i[t+4>>2]=e;l=l+1|0,i[t>>2]=l}while(0);do{if(r<0){if(1&e){l=~~(+(0|l)-(2*(+((f=0|xt(0|l,((0|l)<0)<<31>>31|0,0|(f=(e+1|0)/2|0),((0|f)<0)<<31>>31|0))>>>0)+4294967296*+(0|w()))+1)),i[t>>2]=l;break}l=~~(+(0|l)-2*(+((f=0|xt(0|l,((0|l)<0)<<31>>31|0,0|(f=(0|e)/2|0),((0|f)<0)<<31>>31|0))>>>0)+4294967296*+(0|w()))),i[t>>2]=l;break}}while(0);f=t+4|0,a<0&&(l=l-((1|e<<1)/2|0)|0,i[t>>2]=l,e=0-e|0,i[f>>2]=e),c=e-l|0,(0|l)<0?(u=0-l|0,i[f>>2]=c,i[s>>2]=u,i[t>>2]=0,e=c,l=0):u=0,(0|e)<0&&(l=l-e|0,i[t>>2]=l,u=u-e|0,i[s>>2]=u,i[f>>2]=0,e=0),n=l-u|0,c=e-u|0,(0|u)<0&&(i[t>>2]=n,i[f>>2]=c,i[s>>2]=0,e=c,l=n,u=0),(0|(c=(0|u)<(0|(c=(0|e)<(0|l)?e:l))?u:c))<=0||(i[t>>2]=l-c,i[f>>2]=e-c,i[s>>2]=u-c)}function X(e){var t,n=0,r=0,o=0,a=0,s=0;n=0|i[(e|=0)>>2],r=0|i[(t=e+4|0)>>2],(0|n)<0&&(r=r-n|0,i[t>>2]=r,i[(s=e+8|0)>>2]=(0|i[s>>2])-n,i[e>>2]=0,n=0),(0|r)<0?(n=n-r|0,i[e>>2]=n,a=(0|i[(s=e+8|0)>>2])-r|0,i[s>>2]=a,i[t>>2]=0,r=0):(s=a=e+8|0,a=0|i[a>>2]),(0|a)<0&&(n=n-a|0,i[e>>2]=n,r=r-a|0,i[t>>2]=r,i[s>>2]=0,a=0),(0|(o=(0|a)<(0|(o=(0|r)<(0|n)?r:n))?a:o))<=0||(i[e>>2]=n-o,i[t>>2]=r-o,i[s>>2]=a-o)}function Z(e,t){t|=0;var n,r;r=0|i[(e|=0)+8>>2],n=+((0|i[e+4>>2])-r|0),o[t>>3]=+((0|i[e>>2])-r|0)-.5*n,o[t+8>>3]=.8660254037844386*n}function J(e,t,n){e|=0,t|=0,i[(n|=0)>>2]=(0|i[t>>2])+(0|i[e>>2]),i[n+4>>2]=(0|i[t+4>>2])+(0|i[e+4>>2]),i[n+8>>2]=(0|i[t+8>>2])+(0|i[e+8>>2])}function K(e,t,n){e|=0,t|=0,i[(n|=0)>>2]=(0|i[e>>2])-(0|i[t>>2]),i[n+4>>2]=(0|i[e+4>>2])-(0|i[t+4>>2]),i[n+8>>2]=(0|i[e+8>>2])-(0|i[t+8>>2])}function $(e,t){t|=0;var n,r=0;r=0|y(0|i[(e|=0)>>2],t),i[e>>2]=r,n=0|y(0|i[(r=e+4|0)>>2],t),i[r>>2]=n,t=0|y(0|i[(e=e+8|0)>>2],t),i[e>>2]=t}function ee(e){var t,n,r=0,o=0,a=0,s=0,A=0;A=(0|(n=0|i[(e|=0)>>2]))<0,e=(e=(o=(0|(s=((t=(0|(a=(0|i[e+4>>2])-(A?n:0)|0))<0)?0-a|0:0)+((0|i[e+8>>2])-(A?n:0))|0))<0)?0:s)-((a=(0|(o=(0|e)<(0|(o=(0|(r=(t?0:a)-(o?s:0)|0))<(0|(s=(A?0:n)-(t?a:0)-(o?s:0)|0))?r:s))?e:o))>0)?o:0)|0,r=r-(a?o:0)|0;e:do{switch(s-(a?o:0)|0){case 0:switch(0|r){case 0:return 0|(A=0==(0|e)?0:1==(0|e)?1:7);case 1:return 0|(A=0==(0|e)?2:1==(0|e)?3:7);default:break e}case 1:switch(0|r){case 0:return 0|(A=0==(0|e)?4:1==(0|e)?5:7);case 1:if(e)break e;return 0|(e=6);default:break e}}}while(0);return 0|(A=7)}function te(e){var t,n,r=0,o=0,a=0,s=0,A=0;o=0|i[(t=(e|=0)+8|0)>>2],a=0|mt(+((3*(r=(0|i[e>>2])-o|0)|0)-(o=(0|i[(n=e+4|0)>>2])-o|0)|0)/7),i[e>>2]=a,r=0|mt(+((o<<1)+r|0)/7),i[n>>2]=r,i[t>>2]=0,o=r-a|0,(0|a)<0?(A=0-a|0,i[n>>2]=o,i[t>>2]=A,i[e>>2]=0,r=o,a=0,o=A):o=0,(0|r)<0&&(a=a-r|0,i[e>>2]=a,o=o-r|0,i[t>>2]=o,i[n>>2]=0,r=0),A=a-o|0,s=r-o|0,(0|o)<0?(i[e>>2]=A,i[n>>2]=s,i[t>>2]=0,r=s,s=A,o=0):s=a,(0|(a=(0|o)<(0|(a=(0|r)<(0|s)?r:s))?o:a))<=0||(i[e>>2]=s-a,i[n>>2]=r-a,i[t>>2]=o-a)}function ne(e){var t,n,r=0,o=0,a=0,s=0,A=0;o=0|i[(t=(e|=0)+8|0)>>2],a=0|mt(+(((r=(0|i[e>>2])-o|0)<<1)+(o=(0|i[(n=e+4|0)>>2])-o|0)|0)/7),i[e>>2]=a,r=0|mt(+((3*o|0)-r|0)/7),i[n>>2]=r,i[t>>2]=0,o=r-a|0,(0|a)<0?(A=0-a|0,i[n>>2]=o,i[t>>2]=A,i[e>>2]=0,r=o,a=0,o=A):o=0,(0|r)<0&&(a=a-r|0,i[e>>2]=a,o=o-r|0,i[t>>2]=o,i[n>>2]=0,r=0),A=a-o|0,s=r-o|0,(0|o)<0?(i[e>>2]=A,i[n>>2]=s,i[t>>2]=0,r=s,s=A,o=0):s=a,(0|(a=(0|o)<(0|(a=(0|r)<(0|s)?r:s))?o:a))<=0||(i[e>>2]=s-a,i[n>>2]=r-a,i[t>>2]=o-a)}function re(e){var t,n,r,o=0,a=0,s=0,A=0;o=0|i[(e|=0)>>2],a=0|i[(n=e+4|0)>>2],s=0|i[(r=e+8|0)>>2],A=a+(3*o|0)|0,i[e>>2]=A,a=s+(3*a|0)|0,i[n>>2]=a,o=(3*s|0)+o|0,i[r>>2]=o,s=a-A|0,(0|A)<0?(o=o-A|0,i[n>>2]=s,i[r>>2]=o,i[e>>2]=0,a=s,s=0):s=A,(0|a)<0&&(s=s-a|0,i[e>>2]=s,o=o-a|0,i[r>>2]=o,i[n>>2]=0,a=0),t=s-o|0,A=a-o|0,(0|o)<0?(i[e>>2]=t,i[n>>2]=A,i[r>>2]=0,s=t,o=0):A=a,(0|(a=(0|o)<(0|(a=(0|A)<(0|s)?A:s))?o:a))<=0||(i[e>>2]=s-a,i[n>>2]=A-a,i[r>>2]=o-a)}function ie(e){var t,n,r,o=0,a=0,s=0,A=0;A=0|i[(e|=0)>>2],s=(3*(o=0|i[(n=e+4|0)>>2])|0)+A|0,A=(a=0|i[(r=e+8|0)>>2])+(3*A|0)|0,i[e>>2]=A,i[n>>2]=s,o=(3*a|0)+o|0,i[r>>2]=o,a=s-A|0,(0|A)<0?(o=o-A|0,i[n>>2]=a,i[r>>2]=o,i[e>>2]=0,A=0):a=s,(0|a)<0&&(A=A-a|0,i[e>>2]=A,o=o-a|0,i[r>>2]=o,i[n>>2]=0,a=0),t=A-o|0,s=a-o|0,(0|o)<0?(i[e>>2]=t,i[n>>2]=s,i[r>>2]=0,A=t,o=0):s=a,(0|(a=(0|o)<(0|(a=(0|s)<(0|A)?s:A))?o:a))<=0||(i[e>>2]=A-a,i[n>>2]=s-a,i[r>>2]=o-a)}function oe(e,t){e|=0;var n,r,o,a=0,s=0,A=0;((t|=0)+-1|0)>>>0>=6||(A=(0|i[15472+(12*t|0)>>2])+(0|i[e>>2])|0,i[e>>2]=A,o=e+4|0,s=(0|i[15472+(12*t|0)+4>>2])+(0|i[o>>2])|0,i[o>>2]=s,r=e+8|0,t=(0|i[15472+(12*t|0)+8>>2])+(0|i[r>>2])|0,i[r>>2]=t,a=s-A|0,(0|A)<0?(t=t-A|0,i[o>>2]=a,i[r>>2]=t,i[e>>2]=0,s=0):(a=s,s=A),(0|a)<0&&(s=s-a|0,i[e>>2]=s,t=t-a|0,i[r>>2]=t,i[o>>2]=0,a=0),n=s-t|0,A=a-t|0,(0|t)<0?(i[e>>2]=n,i[o>>2]=A,i[r>>2]=0,s=n,t=0):A=a,(0|(a=(0|t)<(0|(a=(0|A)<(0|s)?A:s))?t:a))<=0||(i[e>>2]=s-a,i[o>>2]=A-a,i[r>>2]=t-a))}function ae(e){var t,n,r,o=0,a=0,s=0,A=0;A=0|i[(e|=0)>>2],s=(o=0|i[(n=e+4|0)>>2])+A|0,A=(a=0|i[(r=e+8|0)>>2])+A|0,i[e>>2]=A,i[n>>2]=s,o=a+o|0,i[r>>2]=o,a=s-A|0,(0|A)<0?(o=o-A|0,i[n>>2]=a,i[r>>2]=o,i[e>>2]=0,s=0):(a=s,s=A),(0|a)<0&&(s=s-a|0,i[e>>2]=s,o=o-a|0,i[r>>2]=o,i[n>>2]=0,a=0),t=s-o|0,A=a-o|0,(0|o)<0?(i[e>>2]=t,i[n>>2]=A,i[r>>2]=0,s=t,o=0):A=a,(0|(a=(0|o)<(0|(a=(0|A)<(0|s)?A:s))?o:a))<=0||(i[e>>2]=s-a,i[n>>2]=A-a,i[r>>2]=o-a)}function se(e){var t,n,r,o=0,a=0,s=0,A=0;o=0|i[(e|=0)>>2],s=0|i[(n=e+4|0)>>2],a=0|i[(r=e+8|0)>>2],A=s+o|0,i[e>>2]=A,s=a+s|0,i[n>>2]=s,o=a+o|0,i[r>>2]=o,a=s-A|0,(0|A)<0?(o=o-A|0,i[n>>2]=a,i[r>>2]=o,i[e>>2]=0,s=0):(a=s,s=A),(0|a)<0&&(s=s-a|0,i[e>>2]=s,o=o-a|0,i[r>>2]=o,i[n>>2]=0,a=0),t=s-o|0,A=a-o|0,(0|o)<0?(i[e>>2]=t,i[n>>2]=A,i[r>>2]=0,s=t,o=0):A=a,(0|(a=(0|o)<(0|(a=(0|A)<(0|s)?A:s))?o:a))<=0||(i[e>>2]=s-a,i[n>>2]=A-a,i[r>>2]=o-a)}function Ae(e){switch(0|(e|=0)){case 1:e=5;break;case 5:e=4;break;case 4:e=6;break;case 6:e=2;break;case 2:e=3;break;case 3:e=1}return 0|e}function le(e){switch(0|(e|=0)){case 1:e=3;break;case 3:e=2;break;case 2:e=6;break;case 6:e=4;break;case 4:e=5;break;case 5:e=1}return 0|e}function ce(e){var t,n,r,o=0,a=0,s=0,A=0;o=0|i[(e|=0)>>2],a=0|i[(n=e+4|0)>>2],s=0|i[(r=e+8|0)>>2],A=a+(o<<1)|0,i[e>>2]=A,a=s+(a<<1)|0,i[n>>2]=a,o=(s<<1)+o|0,i[r>>2]=o,s=a-A|0,(0|A)<0?(o=o-A|0,i[n>>2]=s,i[r>>2]=o,i[e>>2]=0,a=s,s=0):s=A,(0|a)<0&&(s=s-a|0,i[e>>2]=s,o=o-a|0,i[r>>2]=o,i[n>>2]=0,a=0),t=s-o|0,A=a-o|0,(0|o)<0?(i[e>>2]=t,i[n>>2]=A,i[r>>2]=0,s=t,o=0):A=a,(0|(a=(0|o)<(0|(a=(0|A)<(0|s)?A:s))?o:a))<=0||(i[e>>2]=s-a,i[n>>2]=A-a,i[r>>2]=o-a)}function ue(e){var t,n,r,o=0,a=0,s=0,A=0;A=0|i[(e|=0)>>2],s=((o=0|i[(n=e+4|0)>>2])<<1)+A|0,A=(a=0|i[(r=e+8|0)>>2])+(A<<1)|0,i[e>>2]=A,i[n>>2]=s,o=(a<<1)+o|0,i[r>>2]=o,a=s-A|0,(0|A)<0?(o=o-A|0,i[n>>2]=a,i[r>>2]=o,i[e>>2]=0,A=0):a=s,(0|a)<0&&(A=A-a|0,i[e>>2]=A,o=o-a|0,i[r>>2]=o,i[n>>2]=0,a=0),t=A-o|0,s=a-o|0,(0|o)<0?(i[e>>2]=t,i[n>>2]=s,i[r>>2]=0,A=t,o=0):s=a,(0|(a=(0|o)<(0|(a=(0|s)<(0|A)?s:A))?o:a))<=0||(i[e>>2]=A-a,i[n>>2]=s-a,i[r>>2]=o-a)}function he(e,t){t|=0;var n,r,o,a=0,s=0,A=0;return o=(0|(r=(0|i[(e|=0)>>2])-(0|i[t>>2])|0))<0,n=(0|(s=(0|i[e+4>>2])-(0|i[t+4>>2])-(o?r:0)|0))<0,t=(t=(e=(0|(A=(o?0-r|0:0)+(0|i[e+8>>2])-(0|i[t+8>>2])+(n?0-s|0:0)|0))<0)?0:A)-((s=(0|(e=(0|t)<(0|(e=(0|(a=(n?0:s)-(e?A:0)|0))<(0|(A=(o?0:r)-(n?s:0)-(e?A:0)|0))?a:A))?t:e))>0)?e:0)|0,a=a-(s?e:0)|0,0|((0|(e=(0|(e=A-(s?e:0)|0))>-1?e:0-e|0))>(0|(t=(0|(a=(0|a)>-1?a:0-a|0))>(0|(t=(0|t)>-1?t:0-t|0))?a:t))?e:t)}function de(e,t){t|=0;var n;n=0|i[(e|=0)+8>>2],i[t>>2]=(0|i[e>>2])-n,i[t+4>>2]=(0|i[e+4>>2])-n}function fe(e,t){t|=0;var n,r,o,a=0,s=0,A=0;s=0|i[(e|=0)>>2],i[t>>2]=s,e=0|i[e+4>>2],i[(r=t+4|0)>>2]=e,i[(o=t+8|0)>>2]=0,a=e-s|0,(0|s)<0?(e=0-s|0,i[r>>2]=a,i[o>>2]=e,i[t>>2]=0,s=0):(a=e,e=0),(0|a)<0&&(s=s-a|0,i[t>>2]=s,e=e-a|0,i[o>>2]=e,i[r>>2]=0,a=0),n=s-e|0,A=a-e|0,(0|e)<0?(i[t>>2]=n,i[r>>2]=A,i[o>>2]=0,a=A,A=n,e=0):A=s,(0|(s=(0|e)<(0|(s=(0|a)<(0|A)?a:A))?e:s))<=0||(i[t>>2]=A-s,i[r>>2]=a-s,i[o>>2]=e-s)}function pe(e){var t,n,r,o;n=(o=0|i[(t=(e|=0)+8|0)>>2])-(0|i[e>>2])|0,i[e>>2]=n,e=(0|i[(r=e+4|0)>>2])-o|0,i[r>>2]=e,i[t>>2]=0-(e+n)}function me(e){var t,n,r=0,o=0,a=0,s=0,A=0;r=0-(o=0|i[(e|=0)>>2])|0,i[e>>2]=r,i[(t=e+8|0)>>2]=0,s=(a=0|i[(n=e+4|0)>>2])+o|0,(0|o)>0?(i[n>>2]=s,i[t>>2]=o,i[e>>2]=0,r=0,a=s):o=0,(0|a)<0?(A=r-a|0,i[e>>2]=A,o=o-a|0,i[t>>2]=o,i[n>>2]=0,s=A-o|0,r=0-o|0,(0|o)<0?(i[e>>2]=s,i[n>>2]=r,i[t>>2]=0,a=r,o=0):(a=0,s=A)):s=r,(0|(r=(0|o)<(0|(r=(0|a)<(0|s)?a:s))?o:r))<=0||(i[e>>2]=s-r,i[n>>2]=a-r,i[t>>2]=o-r)}function ge(e,t,n,r){t|=0,n|=0,r|=0;var a,s=0,A=0,l=0,c=0;if(a=P,P=P+32|0,function(e,t){t|=0;var n=0,r=0,i=0;n=+o[(e=e|0)>>3],r=+u(+n),n=+h(+n),o[t+16>>3]=n,n=+o[e+8>>3],i=r*+u(+n),o[t>>3]=i,n=r*+h(+n),o[t+8>>3]=n}(e|=0,A=a),i[n>>2]=0,s=+At(15888,A),(l=+At(15912,A))>2]=1,s=l),(l=+At(15936,A))>2]=2,s=l),(l=+At(15960,A))>2]=3,s=l),(l=+At(15984,A))>2]=4,s=l),(l=+At(16008,A))>2]=5,s=l),(l=+At(16032,A))>2]=6,s=l),(l=+At(16056,A))>2]=7,s=l),(l=+At(16080,A))>2]=8,s=l),(l=+At(16104,A))>2]=9,s=l),(l=+At(16128,A))>2]=10,s=l),(l=+At(16152,A))>2]=11,s=l),(l=+At(16176,A))>2]=12,s=l),(l=+At(16200,A))>2]=13,s=l),(l=+At(16224,A))>2]=14,s=l),(l=+At(16248,A))>2]=15,s=l),(l=+At(16272,A))>2]=16,s=l),(l=+At(16296,A))>2]=17,s=l),(l=+At(16320,A))>2]=18,s=l),(l=+At(16344,A))>2]=19,s=l),(l=+f(+(1-.5*s)))<1e-16)return i[r>>2]=0,i[r+4>>2]=0,i[r+8>>2]=0,i[r+12>>2]=0,void(P=a);if(n=0|i[n>>2],s=+Ee((s=+o[16368+(24*n|0)>>3])-+Ee(+function(e,t){e|=0;var n=0,r=0,i=0,a=0,s=0;return a=+o[(t=t|0)>>3],r=+u(+a),i=+o[t+8>>3]-+o[e+8>>3],s=r*+h(+i),n=+o[e>>3],+ +g(+s,+(+h(+a)*+u(+n)-+u(+i)*(r*+h(+n))))}(15568+(n<<4)|0,e))),c=0|Ue(t)?+Ee(s+-.3334731722518321):s,s=+d(+l)/.381966011250105,(0|t)>0){A=0;do{s*=2.6457513110645907,A=A+1|0}while((0|A)!=(0|t))}l=+u(+c)*s,o[r>>3]=l,c=+h(+c)*s,o[r+8>>3]=c,P=a}function ve(e,t,n,r,a){t|=0,n|=0,r|=0,a|=0;var s=0,c=0;if(s=+function(e){var t=0,n=0;return n=+o[(e=e|0)>>3],t=+o[e+8>>3],+ +l(+(n*n+t*t))}(e|=0),s<1e-16)return t=15568+(t<<4)|0,i[a>>2]=i[t>>2],i[a+4>>2]=i[t+4>>2],i[a+8>>2]=i[t+8>>2],void(i[a+12>>2]=i[t+12>>2]);if(c=+g(+ +o[e+8>>3],+ +o[e>>3]),(0|n)>0){e=0;do{s/=2.6457513110645907,e=e+1|0}while((0|e)!=(0|n))}r?(s/=3,n=0==(0|Ue(n)),s=+m(.381966011250105*(n?s:s/2.6457513110645907))):(s=+m(.381966011250105*s),0|Ue(n)&&(c=+Ee(c+.3334731722518321))),function(e,t,n,r){e|=0,t=+t,r|=0;var a=0,s=0,l=0,c=0;if((n=+n)<1e-16)return i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],void(i[r+12>>2]=i[e+12>>2]);s=t<0?t+6.283185307179586:t,s=t>=6.283185307179586?s+-6.283185307179586:s;do{if(!(s<1e-16)){if(a=+A(+(s+-3.141592653589793))<1e-16,t=+o[e>>3],a){t-=n,o[r>>3]=t,a=r;break}if(l=+u(+n),n=+h(+n),t=l*+h(+t)+ +u(+s)*(n*+u(+t)),t=+p(+((t=t>1?1:t)<-1?-1:t)),o[r>>3]=t,+A(+(t+-1.5707963267948966))<1e-16)return o[r>>3]=1.5707963267948966,void(o[r+8>>3]=0);if(+A(+(t+1.5707963267948966))<1e-16)return o[r>>3]=-1.5707963267948966,void(o[r+8>>3]=0);if(c=+u(+t),s=n*+h(+s)/c,n=+o[e>>3],t=(l-+h(+t)*+h(+n))/+u(+n)/c,l=s>1?1:s,t=t>1?1:t,(t=+o[e+8>>3]+ +g(+(l<-1?-1:l),+(t<-1?-1:t)))>3.141592653589793)do{t+=-6.283185307179586}while(t>3.141592653589793);if(t<-3.141592653589793)do{t+=6.283185307179586}while(t<-3.141592653589793);return void(o[r+8>>3]=t)}t=+o[e>>3]+n,o[r>>3]=t,a=r}while(0);if(+A(+(t+-1.5707963267948966))<1e-16)return o[a>>3]=1.5707963267948966,void(o[r+8>>3]=0);if(+A(+(t+1.5707963267948966))<1e-16)return o[a>>3]=-1.5707963267948966,void(o[r+8>>3]=0);if((t=+o[e+8>>3])>3.141592653589793)do{t+=-6.283185307179586}while(t>3.141592653589793);if(t<-3.141592653589793)do{t+=6.283185307179586}while(t<-3.141592653589793);o[r+8>>3]=t}(15568+(t<<4)|0,+Ee(+o[16368+(24*t|0)>>3]-c),s,a)}function ye(e,t,n){t|=0,n|=0;var r,o;r=P,P=P+16|0,Z((e|=0)+4|0,o=r),ve(o,0|i[e>>2],t,0,n),P=r}function xe(e,t,n,r,a){e|=0,t|=0,n|=0,r|=0,a|=0;var s,A,l,c,u,h,d,f,p,m,g,v,y,x,b,_,w,S,E,T,C,R,L=0,q=0,D=0,I=0,O=0,B=0;if(R=P,P=P+272|0,I=R+240|0,E=R,T=R+224|0,C=R+208|0,g=R+176|0,v=R+160|0,y=R+192|0,x=R+144|0,b=R+128|0,_=R+112|0,w=R+96|0,S=R+80|0,i[(L=R+256|0)>>2]=t,i[I>>2]=i[e>>2],i[I+4>>2]=i[e+4>>2],i[I+8>>2]=i[e+8>>2],i[I+12>>2]=i[e+12>>2],be(I,L,E),i[a>>2]=0,(0|(I=r+n+(5==(0|r)&1)|0))<=(0|n))P=R;else{A=T+4|0,l=g+4|0,c=n+5|0,u=16848+((s=0|i[L>>2])<<2)|0,h=16928+(s<<2)|0,d=b+8|0,f=_+8|0,p=w+8|0,m=C+4|0,D=n;e:for(;;){q=E+(((0|D)%5|0)<<4)|0,i[C>>2]=i[q>>2],i[C+4>>2]=i[q+4>>2],i[C+8>>2]=i[q+8>>2],i[C+12>>2]=i[q+12>>2];do{}while(2==(0|_e(C,s,0,1)));if((0|D)>(0|n)&0!=(0|Ue(t))){if(i[g>>2]=i[C>>2],i[g+4>>2]=i[C+4>>2],i[g+8>>2]=i[C+8>>2],i[g+12>>2]=i[C+12>>2],Z(A,v),r=0|i[g>>2],L=0|i[17008+(80*r|0)+(i[T>>2]<<2)>>2],i[g>>2]=i[18608+(80*r|0)+(20*L|0)>>2],(0|(q=0|i[18608+(80*r|0)+(20*L|0)+16>>2]))>0){e=0;do{ae(l),e=e+1|0}while((0|e)<(0|q))}switch(q=18608+(80*r|0)+(20*L|0)+4|0,i[y>>2]=i[q>>2],i[y+4>>2]=i[q+4>>2],i[y+8>>2]=i[q+8>>2],$(y,3*(0|i[u>>2])|0),J(l,y,l),X(l),Z(l,x),O=+(0|i[h>>2]),o[b>>3]=3*O,o[d>>3]=0,B=-1.5*O,o[_>>3]=B,o[f>>3]=2.598076211353316*O,o[w>>3]=B,o[p>>3]=-2.598076211353316*O,0|i[17008+(80*(0|i[g>>2])|0)+(i[C>>2]<<2)>>2]){case 1:e=_,r=b;break;case 3:e=w,r=_;break;case 2:e=b,r=w;break;default:e=12;break e}at(v,x,r,e,S),ve(S,0|i[g>>2],s,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2])}if((0|D)<(0|c)&&(Z(m,g),ve(g,0|i[C>>2],s,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2])),i[T>>2]=i[C>>2],i[T+4>>2]=i[C+4>>2],i[T+8>>2]=i[C+8>>2],i[T+12>>2]=i[C+12>>2],(0|(D=D+1|0))>=(0|I)){e=3;break}}3!=(0|e)?12==(0|e)&&M(22474,22521,581,22531):P=R}}function be(e,t,n){e|=0,t|=0,n|=0;var r,o=0,a=0,s=0,A=0,l=0;r=P,P=P+128|0,a=r,A=20208,l=(s=o=r+64|0)+60|0;do{i[s>>2]=i[A>>2],s=s+4|0,A=A+4|0}while((0|s)<(0|l));A=20272,l=(s=a)+60|0;do{i[s>>2]=i[A>>2],s=s+4|0,A=A+4|0}while((0|s)<(0|l));o=(l=0==(0|Ue(0|i[t>>2])))?o:a,ce(a=e+4|0),ue(a),0|Ue(0|i[t>>2])&&(ie(a),i[t>>2]=1+(0|i[t>>2])),i[n>>2]=i[e>>2],J(a,o,t=n+4|0),X(t),i[n+16>>2]=i[e>>2],J(a,o+12|0,t=n+20|0),X(t),i[n+32>>2]=i[e>>2],J(a,o+24|0,t=n+36|0),X(t),i[n+48>>2]=i[e>>2],J(a,o+36|0,t=n+52|0),X(t),i[n+64>>2]=i[e>>2],J(a,o+48|0,n=n+68|0),X(n),P=r}function _e(e,t,n,r){n|=0,r|=0;var o,a,s,A,l,c,u=0,h=0,d=0,f=0,p=0;if(c=P,P=P+32|0,l=c+12|0,a=c,p=(e|=0)+4|0,f=0|i[16928+((t|=0)<<2)>>2],f=(A=0!=(0|r))?3*f|0:f,u=0|i[p>>2],o=0|i[(s=e+8|0)>>2],A){if((0|(u=o+u+(r=0|i[(h=e+12|0)>>2])|0))==(0|f))return P=c,0|(p=1);d=h}else u=o+u+(r=0|i[(d=e+12|0)>>2])|0;if((0|u)<=(0|f))return P=c,0|(p=0);do{if((0|r)>0){if(r=0|i[e>>2],(0|o)>0){h=18608+(80*r|0)+60|0,r=e;break}r=18608+(80*r|0)+40|0,n?(Q(l,f,0,0),K(p,l,a),se(a),J(a,l,p),h=r,r=e):(h=r,r=e)}else h=18608+(80*(0|i[e>>2])|0)+20|0,r=e}while(0);if(i[r>>2]=i[h>>2],(0|i[(u=h+16|0)>>2])>0){r=0;do{ae(p),r=r+1|0}while((0|r)<(0|i[u>>2]))}return e=h+4|0,i[l>>2]=i[e>>2],i[l+4>>2]=i[e+4>>2],i[l+8>>2]=i[e+8>>2],t=0|i[16848+(t<<2)>>2],$(l,A?3*t|0:t),J(p,l,p),X(p),r=A&&((0|i[s>>2])+(0|i[p>>2])+(0|i[d>>2])|0)==(0|f)?1:2,P=c,0|(p=r)}function we(e,t){e|=0,t|=0;var n=0;do{n=0|_e(e,t,0,1)}while(2==(0|n));return 0|n}function Me(e,t,n,r,a){e|=0,t|=0,n|=0,r|=0,a|=0;var s,A,l,c,u,h,d,f,p,m,g,v,y,x,b,_,w,S,E=0,T=0,C=0,R=0,L=0;if(S=P,P=P+240|0,x=S+208|0,b=S,_=S+192|0,w=S+176|0,p=S+160|0,m=S+144|0,g=S+128|0,v=S+112|0,y=S+96|0,i[(E=S+224|0)>>2]=t,i[x>>2]=i[e>>2],i[x+4>>2]=i[e+4>>2],i[x+8>>2]=i[e+8>>2],i[x+12>>2]=i[e+12>>2],Se(x,E,b),i[a>>2]=0,(0|(f=r+n+(6==(0|r)&1)|0))<=(0|n))P=S;else{A=n+6|0,l=16928+((s=0|i[E>>2])<<2)|0,c=m+8|0,u=g+8|0,h=v+8|0,d=_+4|0,T=0,C=n,r=-1;e:for(;;){if(e=b+((E=(0|C)%6|0)<<4)|0,i[_>>2]=i[e>>2],i[_+4>>2]=i[e+4>>2],i[_+8>>2]=i[e+8>>2],i[_+12>>2]=i[e+12>>2],e=T,T=0|_e(_,s,0,1),(0|C)>(0|n)&0!=(0|Ue(t))&&(1!=(0|e)&&(0|i[_>>2])!=(0|r))){switch(Z(b+(((E+5|0)%6|0)<<4)+4|0,w),Z(b+(E<<4)+4|0,p),R=+(0|i[l>>2]),o[m>>3]=3*R,o[c>>3]=0,L=-1.5*R,o[g>>3]=L,o[u>>3]=2.598076211353316*R,o[v>>3]=L,o[h>>3]=-2.598076211353316*R,E=0|i[x>>2],0|i[17008+(80*E|0)+(((0|r)==(0|E)?0|i[_>>2]:r)<<2)>>2]){case 1:e=g,r=m;break;case 3:e=v,r=g;break;case 2:e=m,r=v;break;default:e=8;break e}at(w,p,r,e,y),0|st(w,y)||0|st(p,y)||(ve(y,0|i[x>>2],s,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2]))}if((0|C)<(0|A)&&(Z(d,w),ve(w,0|i[_>>2],s,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2])),(0|(C=C+1|0))>=(0|f)){e=3;break}r=0|i[_>>2]}3!=(0|e)?8==(0|e)&&M(22557,22521,746,22602):P=S}}function Se(e,t,n){e|=0,t|=0,n|=0;var r,o=0,a=0,s=0,A=0,l=0;r=P,P=P+160|0,a=r,A=20336,l=(s=o=r+80|0)+72|0;do{i[s>>2]=i[A>>2],s=s+4|0,A=A+4|0}while((0|s)<(0|l));A=20416,l=(s=a)+72|0;do{i[s>>2]=i[A>>2],s=s+4|0,A=A+4|0}while((0|s)<(0|l));o=(l=0==(0|Ue(0|i[t>>2])))?o:a,ce(a=e+4|0),ue(a),0|Ue(0|i[t>>2])&&(ie(a),i[t>>2]=1+(0|i[t>>2])),i[n>>2]=i[e>>2],J(a,o,t=n+4|0),X(t),i[n+16>>2]=i[e>>2],J(a,o+12|0,t=n+20|0),X(t),i[n+32>>2]=i[e>>2],J(a,o+24|0,t=n+36|0),X(t),i[n+48>>2]=i[e>>2],J(a,o+36|0,t=n+52|0),X(t),i[n+64>>2]=i[e>>2],J(a,o+48|0,t=n+68|0),X(t),i[n+80>>2]=i[e>>2],J(a,o+60|0,n=n+84|0),X(n),P=r}function Ee(e){var t;return t=(e=+e)<0?e+6.283185307179586:e,+(e>=6.283185307179586?t+-6.283185307179586:t)}function Te(e,t){return t|=0,+A(+(+o[(e|=0)>>3]-+o[t>>3]))<17453292519943298e-27?0|(t=+A(+(+o[e+8>>3]-+o[t+8>>3]))<17453292519943298e-27):0|(t=0)}function Ce(e,t){e|=0;var n,r,i,a=0;return r=+o[(t|=0)>>3],n=+o[e>>3],a=(i=+h(.5*(r-n)))*i+(a=+h(.5*(+o[t+8>>3]-+o[e+8>>3])))*(+u(+r)*+u(+n)*a),2*+g(+ +l(+a),+ +l(+(1-a)))*6371.007180918475}function Re(e,t,n){e|=0,n|=0;var r,i,a,s,A=0,c=0,f=0,p=0,v=0,y=0;return y=+o[(t|=0)>>3],a=+o[e>>3],v=+h(.5*(y-a)),f=+o[t+8>>3],i=+o[e+8>>3],p=+h(.5*(f-i)),r=+u(+a),s=+u(+y),p=2*+g(+ +l(+(p=v*v+p*(s*r*p))),+ +l(+(1-p))),v=+o[n>>3],y=+h(.5*(v-y)),A=+o[n+8>>3],f=+h(.5*(A-f)),c=+u(+v),f=2*+g(+ +l(+(f=y*y+f*(s*c*f))),+ +l(+(1-f))),v=+h(.5*(a-v)),A=+h(.5*(i-A)),A=2*+g(+ +l(+(A=v*v+A*(r*c*A))),+ +l(+(1-A))),4*+m(+ +l(+ +d(.5*(c=.5*(p+f+A)))*+d(.5*(c-p))*+d(.5*(c-f))*+d(.5*(c-A))))}function Pe(e,t){return t=0|Mt(0|(e|=0),0|(t|=0),45),w(),127&t|0}function Le(e,t){var n=0,r=0,i=0,o=0,a=0,s=0;if(!(!0&134217728==(-16777216&(t|=0)|0)))return 0|(t=0);if(a=0|Mt(0|(e|=0),0|t,45),w(),(a&=127)>>>0>121)return 0|(t=0);n=0|Mt(0|e,0|t,52),w(),n&=15;do{if(0|n){for(i=1,r=0;;){if(o=0|Mt(0|e,0|t,3*(15-i|0)|0),w(),0!=(0|(o&=7))&(1^r)){if(1==(0|o)&0!=(0|B(a))){s=0,r=13;break}r=1}if(7==(0|o)){s=0,r=13;break}if(!(i>>>0>>0)){r=9;break}i=i+1|0}if(9==(0|r)){if(15!=(0|n))break;return 0|(s=1)}if(13==(0|r))return 0|s}}while(0);for(;;){if(s=0|Mt(0|e,0|t,3*(14-n|0)|0),w(),!(7==(7&s|0)&!0)){s=0,r=13;break}if(!(n>>>0<14)){s=1,r=13;break}n=n+1|0}return 13==(0|r)?0|s:0}function qe(e,t,n){n|=0;var r=0,i=0;if(r=0|Mt(0|(e|=0),0|(t|=0),52),w(),(0|(r&=15))>=(0|n)){if((0|r)!=(0|n))if(n>>>0<=15){if(e|=i=0|St(0|n,0,52),t=0|w()|-15728641&t,(0|r)>(0|n))do{i=0|St(7,0,3*(14-n|0)|0),n=n+1|0,e|=i,t=0|w()|t}while((0|n)<(0|r))}else t=0,e=0}else t=0,e=0;return _(0|t),0|e}function De(e,t,n,r){n|=0,r|=0;var o,a=0,s=0,A=0,l=0,c=0,u=0;if(A=0|Mt(0|(e|=0),0|(t|=0),52),w(),(0|n)<16&(0|(A&=15))<=(0|n)){if((0|A)==(0|n))return i[(n=r)>>2]=e,void(i[n+4>>2]=t);if(o=(0|(c=0|tt(7,n-A|0)))/7|0,l=0|Mt(0|e,0|t,45),w(),0|B(127&l)){e:do{if(A)for(s=1;;){if(a=0|Mt(0|e,0|t,3*(15-s|0)|0),w(),0|(a&=7))break e;if(!(s>>>0>>0)){a=0;break}s=s+1|0}else a=0}while(0);s=0==(0|a)}else s=0;if(u=0|St(A+1|0,0,52),a=0|w()|-15728641&t,De(t=(u|e)&~(t=0|St(7,0,0|(l=3*(14-A|0)|0))),A=a&~(0|w()),n,r),a=r+(o<<3)|0,!s)return De((u=0|St(1,0,0|l))|t,0|w()|A,n,a),u=a+(o<<3)|0,De((c=0|St(2,0,0|l))|t,0|w()|A,n,u),u=u+(o<<3)|0,De((c=0|St(3,0,0|l))|t,0|w()|A,n,u),u=u+(o<<3)|0,De((c=0|St(4,0,0|l))|t,0|w()|A,n,u),u=u+(o<<3)|0,De((c=0|St(5,0,0|l))|t,0|w()|A,n,u),void De((c=0|St(6,0,0|l))|t,0|w()|A,n,u+(o<<3)|0);s=a+(o<<3)|0,(0|c)>6&&(Rt(0|a,0,(u=(s>>>0>(c=a+8|0)>>>0?s:c)+-1+(0-a)|0)+8&-8|0),a=c+(u>>>3<<3)|0),De((u=0|St(2,0,0|l))|t,0|w()|A,n,a),u=a+(o<<3)|0,De((c=0|St(3,0,0|l))|t,0|w()|A,n,u),u=u+(o<<3)|0,De((c=0|St(4,0,0|l))|t,0|w()|A,n,u),u=u+(o<<3)|0,De((c=0|St(5,0,0|l))|t,0|w()|A,n,u),De((c=0|St(6,0,0|l))|t,0|w()|A,n,u+(o<<3)|0)}}function Ie(e,t){var n=0,r=0,i=0;if(i=0|Mt(0|(e|=0),0|(t|=0),45),w(),!(0|B(127&i)))return 0|(i=0);i=0|Mt(0|e,0|t,52),w(),i&=15;e:do{if(i)for(r=1;;){if(n=0|Mt(0|e,0|t,3*(15-r|0)|0),w(),0|(n&=7))break e;if(!(r>>>0>>0)){n=0;break}r=r+1|0}else n=0}while(0);return 0|(i=0==(0|n)&1)}function Oe(e,t){var n=0,r=0,i=0;if(i=0|Mt(0|(e|=0),0|(t|=0),52),w(),!(i&=15))return 0|(i=0);for(r=1;;){if(n=0|Mt(0|e,0|t,3*(15-r|0)|0),w(),0|(n&=7)){r=5;break}if(!(r>>>0>>0)){n=0,r=5;break}r=r+1|0}return 5==(0|r)?0|n:0}function Be(e,t){var n=0,r=0,i=0,o=0,a=0,s=0,A=0;if(A=0|Mt(0|(e|=0),0|(t|=0),52),w(),!(A&=15))return A=e,_(0|(s=t)),0|A;for(s=1,n=0;;){r=0|St(7,0,0|(o=3*(15-s|0)|0)),i=0|w(),a=0|Mt(0|e,0|t,0|o),w(),e=(o=0|St(0|Ae(7&a),0,0|o))|e&~r,t=(a=0|w())|t&~i;e:do{if(!n)if(0==(o&r|0)&0==(a&i|0))n=0;else if(r=0|Mt(0|e,0|t,52),w(),r&=15){n=1;t:for(;;){switch(a=0|Mt(0|e,0|t,3*(15-n|0)|0),w(),7&a){case 1:break t;case 0:break;default:n=1;break e}if(!(n>>>0>>0)){n=1;break e}n=n+1|0}for(n=1;;){if(i=0|Mt(0|e,0|t,0|(a=3*(15-n|0)|0)),w(),o=0|St(7,0,0|a),t&=~(0|w()),e=e&~o|(a=0|St(0|Ae(7&i),0,0|a)),t=0|t|w(),!(n>>>0>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0>>0))break;s=s+1|0}return _(0|t),0|e}function ke(e,t){var n=0,r=0,i=0,o=0,a=0;if(r=0|Mt(0|(e|=0),0|(t|=0),52),w(),!(r&=15))return r=e,_(0|(n=t)),0|r;for(n=1;a=0|Mt(0|e,0|t,0|(o=3*(15-n|0)|0)),w(),i=0|St(7,0,0|o),t&=~(0|w()),e=(o=0|St(0|Ae(7&a),0,0|o))|e&~i,t=0|w()|t,n>>>0>>0;)n=n+1|0;return _(0|t),0|e}function Ne(e,t){var n=0,r=0,i=0,o=0,a=0,s=0,A=0;if(A=0|Mt(0|(e|=0),0|(t|=0),52),w(),!(A&=15))return A=e,_(0|(s=t)),0|A;for(s=1,n=0;;){r=0|St(7,0,0|(o=3*(15-s|0)|0)),i=0|w(),a=0|Mt(0|e,0|t,0|o),w(),e=(o=0|St(0|le(7&a),0,0|o))|e&~r,t=(a=0|w())|t&~i;e:do{if(!n)if(0==(o&r|0)&0==(a&i|0))n=0;else if(r=0|Mt(0|e,0|t,52),w(),r&=15){n=1;t:for(;;){switch(a=0|Mt(0|e,0|t,3*(15-n|0)|0),w(),7&a){case 1:break t;case 0:break;default:n=1;break e}if(!(n>>>0>>0)){n=1;break e}n=n+1|0}for(n=1;;){if(o=0|St(7,0,0|(i=3*(15-n|0)|0)),a=t&~(0|w()),t=0|Mt(0|e,0|t,0|i),w(),e=e&~o|(t=0|St(0|le(7&t),0,0|i)),t=0|a|w(),!(n>>>0>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0>>0))break;s=s+1|0}return _(0|t),0|e}function ze(e,t){var n=0,r=0,i=0,o=0,a=0;if(r=0|Mt(0|(e|=0),0|(t|=0),52),w(),!(r&=15))return r=e,_(0|(n=t)),0|r;for(n=1;o=0|St(7,0,0|(a=3*(15-n|0)|0)),i=t&~(0|w()),t=0|Mt(0|e,0|t,0|a),w(),e=(t=0|St(0|le(7&t),0,0|a))|e&~o,t=0|w()|i,n>>>0>>0;)n=n+1|0;return _(0|t),0|e}function Ue(e){return 0|(0|(e|=0))%2}function Fe(e,t){e|=0;var n,r;return r=P,P=P+16|0,n=r,(t|=0)>>>0<=15&&2146435072!=(2146435072&i[e+4>>2]|0)&&2146435072!=(2146435072&i[e+8+4>>2]|0)?(!function(e,t,n){var r,i;r=P,P=P+16|0,ge(e|=0,t|=0,n|=0,i=r),Y(i,n+4|0),P=r}(e,t,n),t=0|function(e,t){e|=0;var n,r=0,o=0,a=0,s=0,A=0,l=0,c=0,u=0;if(n=P,P=P+64|0,l=n+40|0,o=n+24|0,a=n+12|0,s=n,St(0|(t|=0),0,52),r=134225919|w(),!t)return(0|i[e+4>>2])>2||(0|i[e+8>>2])>2||(0|i[e+12>>2])>2?(l=0,_(0|(A=0)),P=n,0|l):(St(0|N(e),0,45),A=0|w()|r,l=-1,_(0|A),P=n,0|l);if(i[l>>2]=i[e>>2],i[l+4>>2]=i[e+4>>2],i[l+8>>2]=i[e+8>>2],i[l+12>>2]=i[e+12>>2],A=l+4|0,(0|t)>0)for(e=-1;i[o>>2]=i[A>>2],i[o+4>>2]=i[A+4>>2],i[o+8>>2]=i[A+8>>2],1&t?(te(A),i[a>>2]=i[A>>2],i[a+4>>2]=i[A+4>>2],i[a+8>>2]=i[A+8>>2],re(a)):(ne(A),i[a>>2]=i[A>>2],i[a+4>>2]=i[A+4>>2],i[a+8>>2]=i[A+8>>2],ie(a)),K(o,a,s),X(s),c=0|St(7,0,0|(u=3*(15-t|0)|0)),r&=~(0|w()),e=(u=0|St(0|ee(s),0,0|u))|e&~c,r=0|w()|r,(0|t)>1;)t=t+-1|0;else e=-1;e:do{if((0|i[A>>2])<=2&&(0|i[l+8>>2])<=2&&(0|i[l+12>>2])<=2){if(t=0|St(0|(o=0|N(l)),0,45),t|=e,e=0|w()|-1040385&r,s=0|z(l),!(0|B(o))){if((0|s)<=0)break;for(a=0;;){if(o=0|Mt(0|t,0|e,52),w(),o&=15)for(r=1;l=0|Mt(0|t,0|e,0|(u=3*(15-r|0)|0)),w(),c=0|St(7,0,0|u),e&=~(0|w()),t=t&~c|(u=0|St(0|Ae(7&l),0,0|u)),e=0|e|w(),r>>>0>>0;)r=r+1|0;if((0|(a=a+1|0))==(0|s))break e}}a=0|Mt(0|t,0|e,52),w(),a&=15;t:do{if(a){r=1;n:for(;;){switch(u=0|Mt(0|t,0|e,3*(15-r|0)|0),w(),7&u){case 1:break n;case 0:break;default:break t}if(!(r>>>0>>0))break t;r=r+1|0}if(0|U(o,0|i[l>>2]))for(r=1;c=0|St(7,0,0|(l=3*(15-r|0)|0)),u=e&~(0|w()),e=0|Mt(0|t,0|e,0|l),w(),t=t&~c|(e=0|St(0|le(7&e),0,0|l)),e=0|u|w(),r>>>0>>0;)r=r+1|0;else for(r=1;l=0|Mt(0|t,0|e,0|(u=3*(15-r|0)|0)),w(),c=0|St(7,0,0|u),e&=~(0|w()),t=t&~c|(u=0|St(0|Ae(7&l),0,0|u)),e=0|e|w(),r>>>0>>0;)r=r+1|0}}while(0);if((0|s)>0){r=0;do{t=0|Be(t,e),e=0|w(),r=r+1|0}while((0|r)!=(0|s))}}else t=0,e=0}while(0);return u=t,_(0|(c=e)),P=n,0|u}(n,t),e=0|w()):(e=0,t=0),_(0|e),P=r,0|t}function He(e,t,n){var r,o=0,a=0,s=0;if(r=(n|=0)+4|0,a=0|Mt(0|(e|=0),0|(t|=0),52),w(),a&=15,s=0|Mt(0|e,0|t,45),w(),o=0==(0|a),0|B(127&s)){if(o)return 0|(s=1);o=1}else{if(o)return 0|(s=0);o=0==(0|i[r>>2])&&0==(0|i[n+8>>2])?0!=(0|i[n+12>>2])&1:1}for(n=1;1&n?re(r):ie(r),s=0|Mt(0|e,0|t,3*(15-n|0)|0),w(),oe(r,7&s),n>>>0>>0;)n=n+1|0;return 0|o}function Ge(e,t,n){n|=0;var r,o,a=0,s=0,A=0,l=0,c=0,u=0;o=P,P=P+16|0,r=o,u=0|Mt(0|(e|=0),0|(t|=0),45),w(),u&=127;e:do{if(0!=(0|B(u))&&(A=0|Mt(0|e,0|t,52),w(),0!=(0|(A&=15)))){a=1;t:for(;;){switch(c=0|Mt(0|e,0|t,3*(15-a|0)|0),w(),7&c){case 5:break t;case 0:break;default:a=t;break e}if(!(a>>>0>>0)){a=t;break e}a=a+1|0}for(s=1,a=t;l=0|St(7,0,0|(t=3*(15-s|0)|0)),c=a&~(0|w()),a=0|Mt(0|e,0|a,0|t),w(),e=e&~l|(a=0|St(0|le(7&a),0,0|t)),a=0|c|w(),s>>>0>>0;)s=s+1|0}else a=t}while(0);if(c=7728+(28*u|0)|0,i[n>>2]=i[c>>2],i[n+4>>2]=i[c+4>>2],i[n+8>>2]=i[c+8>>2],i[n+12>>2]=i[c+12>>2],0|He(e,a,n)){if(l=n+4|0,i[r>>2]=i[l>>2],i[r+4>>2]=i[l+4>>2],i[r+8>>2]=i[l+8>>2],A=0|Mt(0|e,0|a,52),w(),c=15&A,1&A?(ie(l),A=c+1|0):A=c,0|B(u)){e:do{if(c)for(t=1;;){if(s=0|Mt(0|e,0|a,3*(15-t|0)|0),w(),0|(s&=7)){a=s;break e}if(!(t>>>0>>0)){a=0;break}t=t+1|0}else a=0}while(0);a=4==(0|a)&1}else a=0;if(0|_e(n,A,a,0)){if(0|B(u))do{}while(0!=(0|_e(n,A,0,0)));(0|A)!=(0|c)&&ne(l)}else(0|A)!=(0|c)&&(i[l>>2]=i[r>>2],i[l+4>>2]=i[r+4>>2],i[l+8>>2]=i[r+8>>2]);P=o}else P=o}function Ve(e,t,n){n|=0;var r,i;r=P,P=P+16|0,Ge(e|=0,t|=0,i=r),t=0|Mt(0|e,0|t,52),w(),ye(i,15&t,n),P=r}function je(e,t,n){n|=0;var r,i,o=0,a=0;i=P,P=P+16|0,Ge(e|=0,t|=0,r=i),o=0|Mt(0|e,0|t,45),w(),o=0==(0|B(127&o)),a=0|Mt(0|e,0|t,52),w(),a&=15;e:do{if(!o){if(0|a)for(o=1;;){if(!(0==((0|St(7,0,3*(15-o|0)|0))&e|0)&0==((0|w())&t|0)))break e;if(!(o>>>0>>0))break;o=o+1|0}return xe(r,a,0,5,n),void(P=i)}}while(0);Me(r,a,0,6,n),P=i}function We(e,t){t|=0;var n,r=0,o=0,a=0,s=0,A=0,l=0;if(St(0|(e|=0),0,52),n=134225919|w(),(0|e)<1){o=0,r=0;do{0|B(o)&&(St(0|o,0,45),A=0|n|w(),i[(e=t+(r<<3)|0)>>2]=-1,i[e+4>>2]=A,r=r+1|0),o=o+1|0}while(122!=(0|o))}else{A=0,r=0;do{if(0|B(A)){for(St(0|A,0,45),o=1,a=-1,s=0|n|w();a&=~(l=0|St(7,0,3*(15-o|0)|0)),s&=~(0|w()),(0|o)!=(0|e);)o=o+1|0;i[(l=t+(r<<3)|0)>>2]=a,i[l+4>>2]=s,r=r+1|0}A=A+1|0}while(122!=(0|A))}}function Qe(e,t,n,r){var o,a=0,s=0,A=0,l=0,c=0;if(o=P,P=P+64|0,A=o,(0|(e|=0))==(0|(n|=0))&(0|(t|=0))==(0|(r|=0))|!1|134217728!=(2013265920&t|0)|!1|134217728!=(2013265920&r|0))return P=o,0|(A=0);if(a=0|Mt(0|e,0|t,52),w(),a&=15,s=0|Mt(0|n,0|r,52),w(),(0|a)!=(15&s|0))return P=o,0|(A=0);if(s=a+-1|0,a>>>0>1&&(c=0|qe(e,t,s),l=0|w(),(0|c)==(0|(s=0|qe(n,r,s)))&(0|l)==(0|w()))){if(a=0|Mt(0|e,0|t,0|(s=3*(15^a)|0)),w(),a&=7,s=0|Mt(0|n,0|r,0|s),w(),0==(0|a)|0==(0|(s&=7)))return P=o,0|(c=1);if((0|i[21136+(a<<2)>>2])==(0|s))return P=o,0|(c=1);if((0|i[21168+(a<<2)>>2])==(0|s))return P=o,0|(c=1)}s=(a=A)+56|0;do{i[a>>2]=0,a=a+4|0}while((0|a)<(0|s));return L(e,t,1,A),a=(0|i[(c=A)>>2])==(0|n)&&(0|i[c+4>>2])==(0|r)||(0|i[(c=A+8|0)>>2])==(0|n)&&(0|i[c+4>>2])==(0|r)||(0|i[(c=A+16|0)>>2])==(0|n)&&(0|i[c+4>>2])==(0|r)||(0|i[(c=A+24|0)>>2])==(0|n)&&(0|i[c+4>>2])==(0|r)||(0|i[(c=A+32|0)>>2])==(0|n)&&(0|i[c+4>>2])==(0|r)||(0|i[(c=A+40|0)>>2])==(0|n)&&(0|i[c+4>>2])==(0|r)?1:1&((0|i[(a=A+48|0)>>2])==(0|n)?(0|i[a+4>>2])==(0|r):0),P=o,0|(c=a)}function Ye(e,t,n){n|=0;var r,o,a,s,A=0;if(a=P,P=P+16|0,o=a,A=0|Mt(0|(e|=0),0|(t|=0),56),w(),t=0|function(e,t,n){n|=0;var r=0,o=0;if(r=0|Ie(e=e|0,t=t|0),(n+-1|0)>>>0>5)return 0|(n=-1);if(1==(0|n)&(o=0!=(0|r)))return 0|(n=-1);return r=0|function(e,t){var n=0,r=0,o=0,a=0,s=0,A=0,l=0,c=0;if(c=P,P=P+32|0,a=c,Ge(e=e|0,t=t|0,o=c+16|0),s=0|Pe(e,t),l=0|Oe(e,t),function(e,t){e=7728+(28*(e|=0)|0)|0,i[(t|=0)>>2]=i[e>>2],i[t+4>>2]=i[e+4>>2],i[t+8>>2]=i[e+8>>2],i[t+12>>2]=i[e+12>>2]}(s,a),t=0|function(e,t){e|=0;var n=0,r=0;if((t|=0)>>>0>20)return-1;do{if((0|i[11152+(216*t|0)>>2])!=(0|e))if((0|i[11152+(216*t|0)+8>>2])!=(0|e))if((0|i[11152+(216*t|0)+16>>2])!=(0|e))if((0|i[11152+(216*t|0)+24>>2])!=(0|e))if((0|i[11152+(216*t|0)+32>>2])!=(0|e))if((0|i[11152+(216*t|0)+40>>2])!=(0|e))if((0|i[11152+(216*t|0)+48>>2])!=(0|e))if((0|i[11152+(216*t|0)+56>>2])!=(0|e))if((0|i[11152+(216*t|0)+64>>2])!=(0|e))if((0|i[11152+(216*t|0)+72>>2])!=(0|e))if((0|i[11152+(216*t|0)+80>>2])!=(0|e))if((0|i[11152+(216*t|0)+88>>2])!=(0|e))if((0|i[11152+(216*t|0)+96>>2])!=(0|e))if((0|i[11152+(216*t|0)+104>>2])!=(0|e))if((0|i[11152+(216*t|0)+112>>2])!=(0|e))if((0|i[11152+(216*t|0)+120>>2])!=(0|e))if((0|i[11152+(216*t|0)+128>>2])!=(0|e)){if((0|i[11152+(216*t|0)+136>>2])!=(0|e)){if((0|i[11152+(216*t|0)+144>>2])==(0|e)){e=0,n=2,r=0;break}if((0|i[11152+(216*t|0)+152>>2])==(0|e)){e=0,n=2,r=1;break}if((0|i[11152+(216*t|0)+160>>2])==(0|e)){e=0,n=2,r=2;break}if((0|i[11152+(216*t|0)+168>>2])==(0|e)){e=1,n=2,r=0;break}if((0|i[11152+(216*t|0)+176>>2])==(0|e)){e=1,n=2,r=1;break}if((0|i[11152+(216*t|0)+184>>2])==(0|e)){e=1,n=2,r=2;break}if((0|i[11152+(216*t|0)+192>>2])==(0|e)){e=2,n=2,r=0;break}if((0|i[11152+(216*t|0)+200>>2])==(0|e)){e=2,n=2,r=1;break}if((0|i[11152+(216*t|0)+208>>2])==(0|e)){e=2,n=2,r=2;break}return-1}e=2,n=1,r=2}else e=2,n=1,r=1;else e=2,n=1,r=0;else e=1,n=1,r=2;else e=1,n=1,r=1;else e=1,n=1,r=0;else e=0,n=1,r=2;else e=0,n=1,r=1;else e=0,n=1,r=0;else e=2,n=0,r=2;else e=2,n=0,r=1;else e=2,n=0,r=0;else e=1,n=0,r=2;else e=1,n=0,r=1;else e=1,n=0,r=0;else e=0,n=0,r=2;else e=0,n=0,r=1;else e=0,n=0,r=0}while(0);return 0|i[11152+(216*t|0)+(72*n|0)+(24*e|0)+(r<<3)+4>>2]}(s,0|i[o>>2]),!(0|B(s)))return P=c,0|(l=t);switch(0|s){case 4:e=0,n=14;break;case 14:e=1,n=14;break;case 24:e=2,n=14;break;case 38:e=3,n=14;break;case 49:e=4,n=14;break;case 58:e=5,n=14;break;case 63:e=6,n=14;break;case 72:e=7,n=14;break;case 83:e=8,n=14;break;case 97:e=9,n=14;break;case 107:e=10,n=14;break;case 117:e=11,n=14;break;default:A=0,r=0}14==(0|n)&&(A=0|i[22096+(24*e|0)+8>>2],r=0|i[22096+(24*e|0)+16>>2]);(0|(e=0|i[o>>2]))!=(0|i[a>>2])&&(s=0|k(s))|(0|(e=0|i[o>>2]))==(0|r)&&(t=(t+1|0)%6|0);if(3==(0|l)&(0|e)==(0|r))return P=c,0|(l=(t+5|0)%6|0);if(!(5==(0|l)&(0|e)==(0|A)))return P=c,0|(l=t);return P=c,0|(l=(t+1|0)%6|0)}(e,t),o?0|(n=(5-r+(0|i[22384+(n<<2)>>2])|0)%5|0):0|(n=(6-r+(0|i[22416+(n<<2)>>2])|0)%6|0)}(r=(s=!0&268435456==(2013265920&t|0))?e:0,e=s?-2130706433&t|134217728:0,7&A),-1==(0|t))return i[n>>2]=0,void(P=a);Ge(r,e,o),A=0|Mt(0|r,0|e,52),w(),A&=15,0|Ie(r,e)?xe(o,A,t,2,n):Me(o,A,t,2,n),P=a}function Xe(e){e|=0;var t,n,r=0;return(t=0|yt(1,12))||M(22691,22646,49,22704),0|(r=0|i[(n=e+4|0)>>2])?(i[(r=r+8|0)>>2]=t,i[n>>2]=t,0|t):(0|i[e>>2]&&M(22721,22646,61,22744),i[(r=e)>>2]=t,i[n>>2]=t,0|t)}function Ze(e,t){e|=0,t|=0;var n,r;return(r=0|gt(24))||M(22758,22646,78,22772),i[r>>2]=i[t>>2],i[r+4>>2]=i[t+4>>2],i[r+8>>2]=i[t+8>>2],i[r+12>>2]=i[t+12>>2],i[r+16>>2]=0,0|(n=0|i[(t=e+4|0)>>2])?(i[n+16>>2]=r,i[t>>2]=r,0|r):(0|i[e>>2]&&M(22787,22646,82,22772),i[e>>2]=r,i[t>>2]=r,0|r)}function Je(e){var t,n,r=0,a=0,s=0,l=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,y=0,x=0,b=0,_=0,w=0,S=0,E=0,T=0,C=0,R=0,P=0,L=0,q=0,D=0,I=0,O=0,B=0;if(0|i[(l=(e|=0)+8|0)>>2])return 0|(B=1);if(!(s=0|i[e>>2]))return 0|(B=0);r=s,a=0;do{a=a+1|0,r=0|i[r+8>>2]}while(0!=(0|r));if(a>>>0<2)return 0|(B=0);(n=0|gt(a<<2))||M(22807,22646,317,22826),(t=0|gt(a<<5))||M(22848,22646,321,22826),i[e>>2]=0,i[(C=e+4|0)>>2]=0,i[l>>2]=0,a=0,I=0,T=0,m=0;e:for(;;){if(p=0|i[s>>2]){c=0,u=p;do{if(d=+o[u+8>>3],r=u,u=0|i[u+16>>2],h=+o[(l=(f=0==(0|u))?p:u)+8>>3],+A(+(d-h))>3.141592653589793){B=14;break}c+=(h-d)*(+o[r>>3]+ +o[l>>3])}while(!f);if(14==(0|B)){B=0,c=0,r=p;do{E=+o[r+8>>3],q=0|i[(D=r+16|0)>>2],S=+o[(q=0==(0|q)?p:q)+8>>3],c+=(+o[r>>3]+ +o[q>>3])*((S<0?S+6.283185307179586:S)-(E<0?E+6.283185307179586:E)),r=0|i[(0==(0|r)?s:D)>>2]}while(0!=(0|r))}c>0?(i[n+(I<<2)>>2]=s,I=I+1|0,l=T,r=m):B=19}else B=19;if(19==(0|B)){B=0;do{if(!a){if(m){l=C,u=m+8|0,r=s,a=e;break}if(0|i[e>>2]){B=27;break e}l=C,u=e,r=s,a=e;break}if(0|i[(r=a+8|0)>>2]){B=21;break e}if(!(a=0|yt(1,12))){B=23;break e}i[r>>2]=a,l=a+4|0,u=a,r=m}while(0);if(i[u>>2]=s,i[l>>2]=s,u=t+(T<<5)|0,f=0|i[s>>2]){for(o[(p=t+(T<<5)+8|0)>>3]=17976931348623157e292,o[(m=t+(T<<5)+24|0)>>3]=17976931348623157e292,o[u>>3]=-17976931348623157e292,o[(g=t+(T<<5)+16|0)>>3]=-17976931348623157e292,_=17976931348623157e292,w=-17976931348623157e292,l=0,v=f,d=17976931348623157e292,x=17976931348623157e292,b=-17976931348623157e292,h=-17976931348623157e292;c=+o[v>>3],E=+o[v+8>>3],v=0|i[v+16>>2],S=+o[((y=0==(0|v))?f:v)+8>>3],c>3]=c,d=c),E>3]=E,x=E),c>b?o[u>>3]=c:c=b,E>h&&(o[g>>3]=E,h=E),_=E>0&E<_?E:_,w=E<0&E>w?E:w,l|=+A(+(E-S))>3.141592653589793,!y;)b=c;l&&(o[g>>3]=w,o[m>>3]=_)}else i[u>>2]=0,i[u+4>>2]=0,i[u+8>>2]=0,i[u+12>>2]=0,i[u+16>>2]=0,i[u+20>>2]=0,i[u+24>>2]=0,i[u+28>>2]=0;l=T+1|0}if(s=0|i[(D=s+8|0)>>2],i[D>>2]=0,!s){B=45;break}T=l,m=r}if(21==(0|B))M(22624,22646,35,22658);else if(23==(0|B))M(22678,22646,37,22658);else if(27==(0|B))M(22721,22646,61,22744);else if(45==(0|B)){e:do{if((0|I)>0){for(D=0==(0|l),L=l<<2,q=0==(0|e),P=0,r=0;;){if(R=0|i[n+(P<<2)>>2],D)B=73;else{if(!(T=0|gt(L))){B=50;break}if(!(C=0|gt(L))){B=52;break}t:do{if(q)a=0;else{for(l=0,a=0,u=e;s=t+(l<<5)|0,0|Ke(0|i[u>>2],s,0|i[R>>2])?(i[T+(a<<2)>>2]=u,i[C+(a<<2)>>2]=s,y=a+1|0):y=a,u=0|i[u+8>>2];)l=l+1|0,a=y;if((0|y)>0)if(s=0|i[T>>2],1==(0|y))a=s;else for(g=0,v=-1,a=s,m=s;;){for(f=0|i[m>>2],s=0,u=0;p=(0|(l=0|i[i[T+(u<<2)>>2]>>2]))==(0|f)?s:s+(1&(0|Ke(l,0|i[C+(u<<2)>>2],0|i[f>>2])))|0,(0|(u=u+1|0))!=(0|y);)s=p;if(a=(l=(0|p)>(0|v))?m:a,(0|(s=g+1|0))==(0|y))break t;g=s,v=l?p:v,m=0|i[T+(s<<2)>>2]}else a=0}}while(0);if(vt(T),vt(C),a){if(s=0|i[(l=a+4|0)>>2])a=s+8|0;else if(0|i[a>>2]){B=70;break}i[a>>2]=R,i[l>>2]=R}else B=73}if(73==(0|B)){if(B=0,0|(r=0|i[R>>2]))do{C=r,r=0|i[r+16>>2],vt(C)}while(0!=(0|r));vt(R),r=2}if((0|(P=P+1|0))>=(0|I)){O=r;break e}}50==(0|B)?M(22863,22646,249,22882):52==(0|B)?M(22901,22646,252,22882):70==(0|B)&&M(22721,22646,61,22744)}else O=0}while(0);return vt(n),vt(t),0|(B=O)}return 0}function Ke(e,t,n){e|=0;var r,a=0,s=0,A=0,l=0,c=0,u=0,h=0;if(!(0|V(t|=0,n|=0)))return 0|(e=0);if(t=0|G(t),r=+o[n>>3],a=t&(a=+o[n+8>>3])<0?a+6.283185307179586:a,!(e=0|i[e>>2]))return 0|(e=0);if(t){t=0,n=e;e:for(;;){for(;l=+o[n>>3],u=+o[n+8>>3],h=0|i[(n=n+16|0)>>2],A=+o[(h=0==(0|h)?e:h)>>3],s=+o[h+8>>3],l>A?(c=l,l=u):(c=A,A=l,l=s,s=u),rc;)if(!(n=0|i[n>>2])){n=22;break e}if(a=(l=l<0?l+6.283185307179586:l)==a|(u=s<0?s+6.283185307179586:s)==a?a+-2220446049250313e-31:a,((u+=(r-A)/(c-A)*(l-u))<0?u+6.283185307179586:u)>a&&(t^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|t}else{t=0,n=e;e:for(;;){for(;l=+o[n>>3],u=+o[n+8>>3],h=0|i[(n=n+16|0)>>2],A=+o[(h=0==(0|h)?e:h)>>3],s=+o[h+8>>3],l>A?(c=l,l=u):(c=A,A=l,l=s,s=u),rc;)if(!(n=0|i[n>>2])){n=22;break e}if(s+(r-A)/(c-A)*(l-s)>(a=l==a|s==a?a+-2220446049250313e-31:a)&&(t^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|t}return 0}function $e(e,t,n,o,a){n|=0,o|=0,a|=0;var s,A,l,c,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,y=0,x=0;if(c=P,P=P+32|0,x=c+16|0,l=c,u=0|Mt(0|(e|=0),0|(t|=0),52),w(),u&=15,g=0|Mt(0|n,0|o,52),w(),(0|u)!=(15&g|0))return P=c,0|(x=1);if(p=0|Mt(0|e,0|t,45),w(),p&=127,m=0|Mt(0|n,0|o,45),w(),g=(0|p)!=(0|(m&=127))){if(7==(0|(d=0|H(p,m))))return P=c,0|(x=2);7==(0|(f=0|H(m,p)))?M(22925,22949,151,22959):(v=d,h=f)}else v=0,h=0;s=0|B(p),A=0|B(m),i[x>>2]=0,i[x+4>>2]=0,i[x+8>>2]=0,i[x+12>>2]=0;do{if(v){if(d=(0|(m=0|i[4304+(28*p|0)+(v<<2)>>2]))>0,A)if(d){p=0,f=n,d=o;do{f=0|Ne(f,d),d=0|w(),1==(0|(h=0|le(h)))&&(h=0|le(1)),p=p+1|0}while((0|p)!=(0|m));m=h,p=f,f=d}else m=h,p=n,f=o;else if(d){p=0,f=n,d=o;do{f=0|ze(f,d),d=0|w(),h=0|le(h),p=p+1|0}while((0|p)!=(0|m));m=h,p=f,f=d}else m=h,p=n,f=o;if(He(p,f,x),g||M(22972,22949,181,22959),(d=0!=(0|s))&(h=0!=(0|A))&&M(22999,22949,182,22959),d){if(h=0|Oe(e,t),0|r[22032+(7*h|0)+v>>0]){u=3;break}p=f=0|i[21200+(28*h|0)+(v<<2)>>2],y=26}else if(h){if(h=0|Oe(p,f),0|r[22032+(7*h|0)+m>>0]){u=4;break}p=0,f=0|i[21200+(28*m|0)+(h<<2)>>2],y=26}else h=0;if(26==(0|y))if((0|f)<=-1&&M(23030,22949,212,22959),(0|p)<=-1&&M(23053,22949,213,22959),(0|f)>0){d=x+4|0,h=0;do{se(d),h=h+1|0}while((0|h)!=(0|f));h=p}else h=p;if(i[l>>2]=0,i[l+4>>2]=0,i[l+8>>2]=0,oe(l,v),0|u)for(;0|Ue(u)?re(l):ie(l),(0|u)>1;)u=u+-1|0;if((0|h)>0){u=0;do{se(l),u=u+1|0}while((0|u)!=(0|h))}J(y=x+4|0,l,y),X(y),y=50}else if(He(n,o,x),0!=(0|s)&0!=(0|A))if((0|m)!=(0|p)&&M(23077,22949,243,22959),h=0|Oe(e,t),u=0|Oe(n,o),0|r[22032+(7*h|0)+u>>0])u=5;else if((0|(h=0|i[21200+(28*h|0)+(u<<2)>>2]))>0){d=x+4|0,u=0;do{se(d),u=u+1|0}while((0|u)!=(0|h));y=50}else y=50;else y=50}while(0);return 50==(0|y)&&(u=x+4|0,i[a>>2]=i[u>>2],i[a+4>>2]=i[u+4>>2],i[a+8>>2]=i[u+8>>2],u=0),P=c,0|(x=u)}function et(e,t,n,r){n|=0,r|=0;var o,a,s=0,A=0,l=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,y=0;if(a=P,P=P+48|0,l=a+36|0,c=a+24|0,u=a+12|0,h=a,A=0|Mt(0|(e|=0),0|(t|=0),52),w(),A&=15,f=0|Mt(0|e,0|t,45),w(),o=0|B(f&=127),St(0|A,0,52),g=134225919|w(),i[(m=r)>>2]=-1,i[m+4>>2]=g,!A)return(0|i[n>>2])>1||(0|i[n+4>>2])>1||(0|i[n+8>>2])>1||127==(0|(s=0|F(f,0|ee(n))))?(P=a,0|(g=1)):(p=0|St(0|s,0,45),m=0|w(),m=-1040385&i[(f=r)+4>>2]|m,i[(g=r)>>2]=i[f>>2]|p,i[g+4>>2]=m,P=a,0|(g=0));for(i[l>>2]=i[n>>2],i[l+4>>2]=i[n+4>>2],i[l+8>>2]=i[n+8>>2];i[c>>2]=i[l>>2],i[c+4>>2]=i[l+4>>2],i[c+8>>2]=i[l+8>>2],0|Ue(A)?(te(l),i[u>>2]=i[l>>2],i[u+4>>2]=i[l+4>>2],i[u+8>>2]=i[l+8>>2],re(u)):(ne(l),i[u>>2]=i[l>>2],i[u+4>>2]=i[l+4>>2],i[u+8>>2]=i[l+8>>2],ie(u)),K(c,u,h),X(h),v=0|i[(m=r)>>2],m=0|i[m+4>>2],n=0|St(7,0,0|(y=3*(15-A|0)|0)),m&=~(0|w()),y=0|St(0|ee(h),0,0|y),m=0|w()|m,i[(g=r)>>2]=y|v&~n,i[g+4>>2]=m,(0|A)>1;)A=A+-1|0;e:do{if((0|i[l>>2])<=1&&(0|i[l+4>>2])<=1&&(0|i[l+8>>2])<=1){h=127==(0|(c=0|F(f,A=0|ee(l))))?0:0|B(c);t:do{if(A){if(o){if(l=21408+(28*(0|Oe(e,t))|0)+(A<<2)|0,(0|(l=0|i[l>>2]))>0){n=0;do{A=0|Ae(A),n=n+1|0}while((0|n)!=(0|l))}if(1==(0|A)){s=3;break e}127==(0|(n=0|F(f,A)))&&M(23104,22949,376,23134),0|B(n)?M(23147,22949,377,23134):(p=l,d=A,s=n)}else p=0,d=A,s=c;if((0|(u=0|i[4304+(28*f|0)+(d<<2)>>2]))<=-1&&M(23178,22949,384,23134),!h){if((0|p)<=-1&&M(23030,22949,417,23134),0|p){A=0,n=0|i[(l=r)>>2],l=0|i[l+4>>2];do{n=0|ke(n,l),l=0|w(),i[(y=r)>>2]=n,i[y+4>>2]=l,A=A+1|0}while((0|A)<(0|p))}if((0|u)<=0){A=54;break}for(A=0,n=0|i[(l=r)>>2],l=0|i[l+4>>2];;)if(n=0|ke(n,l),l=0|w(),i[(y=r)>>2]=n,i[y+4>>2]=l,(0|(A=A+1|0))==(0|u)){A=54;break t}}if(7==(0|(c=0|H(s,f)))&&M(22925,22949,393,23134),n=0|i[(A=r)>>2],A=0|i[A+4>>2],(0|u)>0){l=0;do{n=0|ke(n,A),A=0|w(),i[(y=r)>>2]=n,i[y+4>>2]=A,l=l+1|0}while((0|l)!=(0|u))}if(n=0|Oe(n,A),y=0|k(s),(0|(n=0|i[(y?21824:21616)+(28*c|0)+(n<<2)>>2]))<=-1&&M(23030,22949,412,23134),n){A=0,l=0|i[(c=r)>>2],c=0|i[c+4>>2];do{l=0|Be(l,c),c=0|w(),i[(y=r)>>2]=l,i[y+4>>2]=c,A=A+1|0}while((0|A)<(0|n));A=54}else A=54}else if(0!=(0|o)&0!=(0|h))if(A=21408+(28*(y=0|Oe(e,t))|0)+((0|Oe(0|i[(A=r)>>2],0|i[A+4>>2]))<<2)|0,(0|(A=0|i[A>>2]))<=-1&&M(23201,22949,433,23134),A){s=0,n=0|i[(l=r)>>2],l=0|i[l+4>>2];do{n=0|ke(n,l),l=0|w(),i[(y=r)>>2]=n,i[y+4>>2]=l,s=s+1|0}while((0|s)<(0|A));s=c,A=54}else s=c,A=55;else s=c,A=54}while(0);if(54==(0|A)&&h&&(A=55),55==(0|A)&&1==(0|Oe(0|i[(y=r)>>2],0|i[y+4>>2]))){s=4;break}g=0|i[(y=r)>>2],y=-1040385&i[y+4>>2],v=0|St(0|s,0,45),y=0|y|w(),i[(s=r)>>2]=g|v,i[s+4>>2]=y,s=0}else s=2}while(0);return P=a,0|(y=s)}function tt(e,t){var n=0;if(!(t|=0))return 0|(n=1);n=e|=0,e=1;do{e=0|y(0==(1&t|0)?1:n,e),t>>=1,n=0|y(n,n)}while(0!=(0|t));return 0|e}function nt(e,t,n){e|=0;var r,a,s=0,A=0,l=0,c=0,u=0,h=0,d=0,f=0;if(!(0|V(t|=0,n|=0)))return 0|(f=0);if(t=0|G(t),a=+o[n>>3],s=t&(s=+o[n+8>>3])<0?s+6.283185307179586:s,(0|(f=0|i[e>>2]))<=0)return 0|(f=0);if(r=0|i[e+4>>2],t){t=0,n=-1,e=0;e:for(;;){for(d=e;c=+o[r+(d<<4)>>3],h=+o[r+(d<<4)+8>>3],l=+o[r+((e=(n+2|0)%(0|f)|0)<<4)>>3],A=+o[r+(e<<4)+8>>3],c>l?(u=c,c=h):(u=l,l=c,c=A,A=h),au;){if(!((0|(n=d+1|0))<(0|f))){n=22;break e}e=d,d=n,n=e}if(s=(c=c<0?c+6.283185307179586:c)==s|(h=A<0?A+6.283185307179586:A)==s?s+-2220446049250313e-31:s,((h+=(a-l)/(u-l)*(c-h))<0?h+6.283185307179586:h)>s&&(t^=1),(0|(e=d+1|0))>=(0|f)){n=22;break}n=d}if(22==(0|n))return 0|t}else{t=0,n=-1,e=0;e:for(;;){for(d=e;c=+o[r+(d<<4)>>3],h=+o[r+(d<<4)+8>>3],l=+o[r+((e=(n+2|0)%(0|f)|0)<<4)>>3],A=+o[r+(e<<4)+8>>3],c>l?(u=c,c=h):(u=l,l=c,c=A,A=h),au;){if(!((0|(n=d+1|0))<(0|f))){n=22;break e}e=d,d=n,n=e}if(A+(a-l)/(u-l)*(c-A)>(s=c==s|A==s?s+-2220446049250313e-31:s)&&(t^=1),(0|(e=d+1|0))>=(0|f)){n=22;break}n=d}if(22==(0|n))return 0|t}return 0}function rt(e,t){t|=0;var n,r,a,s,l,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,y=0,x=0,b=0;if(!(r=0|i[(e|=0)>>2]))return i[t>>2]=0,i[t+4>>2]=0,i[t+8>>2]=0,i[t+12>>2]=0,i[t+16>>2]=0,i[t+20>>2]=0,i[t+24>>2]=0,void(i[t+28>>2]=0);if(o[(a=t+8|0)>>3]=17976931348623157e292,o[(s=t+24|0)>>3]=17976931348623157e292,o[t>>3]=-17976931348623157e292,o[(l=t+16|0)>>3]=-17976931348623157e292,!((0|r)<=0)){for(n=0|i[e+4>>2],g=17976931348623157e292,v=-17976931348623157e292,y=0,e=-1,d=17976931348623157e292,f=17976931348623157e292,m=-17976931348623157e292,u=-17976931348623157e292,x=0;c=+o[n+(x<<4)>>3],p=+o[n+(x<<4)+8>>3],h=+o[n+(((0|(e=e+2|0))==(0|r)?0:e)<<4)+8>>3],c>3]=c,d=c),p>3]=p,f=p),c>m?o[t>>3]=c:c=m,p>u&&(o[l>>3]=p,u=p),g=p>0&pv?p:v,y|=+A(+(p-h))>3.141592653589793,(0|(e=x+1|0))!=(0|r);)b=x,m=c,x=e,e=b;y&&(o[l>>3]=v,o[s>>3]=g)}}function it(e,t){t|=0;var n,r=0,a=0,s=0,l=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,y=0,x=0,b=0,_=0,w=0,M=0,S=0,E=0;if(v=0|i[(e|=0)>>2]){if(o[(y=t+8|0)>>3]=17976931348623157e292,o[(x=t+24|0)>>3]=17976931348623157e292,o[t>>3]=-17976931348623157e292,o[(b=t+16|0)>>3]=-17976931348623157e292,(0|v)>0){for(s=0|i[e+4>>2],m=17976931348623157e292,g=-17976931348623157e292,a=0,r=-1,h=17976931348623157e292,d=17976931348623157e292,p=-17976931348623157e292,c=-17976931348623157e292,_=0;l=+o[s+(_<<4)>>3],f=+o[s+(_<<4)+8>>3],u=+o[s+(((0|(S=r+2|0))==(0|v)?0:S)<<4)+8>>3],l>3]=l,h=l),f>3]=f,d=f),l>p?o[t>>3]=l:l=p,f>c&&(o[b>>3]=f,c=f),m=f>0&fg?f:g,a|=+A(+(f-u))>3.141592653589793,(0|(r=_+1|0))!=(0|v);)S=_,p=l,_=r,r=S;a&&(o[b>>3]=g,o[x>>3]=m)}}else i[t>>2]=0,i[t+4>>2]=0,i[t+8>>2]=0,i[t+12>>2]=0,i[t+16>>2]=0,i[t+20>>2]=0,i[t+24>>2]=0,i[t+28>>2]=0;if(!((0|(r=0|i[(S=e+8|0)>>2]))<=0)){n=e+12|0,M=0;do{if(s=0|i[n>>2],a=M,x=t+((M=M+1|0)<<5)|0,b=0|i[s+(a<<3)>>2]){if(o[(_=t+(M<<5)+8|0)>>3]=17976931348623157e292,o[(e=t+(M<<5)+24|0)>>3]=17976931348623157e292,o[x>>3]=-17976931348623157e292,o[(w=t+(M<<5)+16|0)>>3]=-17976931348623157e292,(0|b)>0){for(v=0|i[s+(a<<3)+4>>2],m=17976931348623157e292,g=-17976931348623157e292,s=0,a=-1,y=0,h=17976931348623157e292,d=17976931348623157e292,f=-17976931348623157e292,c=-17976931348623157e292;l=+o[v+(y<<4)>>3],p=+o[v+(y<<4)+8>>3],u=+o[v+(((0|(a=a+2|0))==(0|b)?0:a)<<4)+8>>3],l>3]=l,h=l),p>3]=p,d=p),l>f?o[x>>3]=l:l=f,p>c&&(o[w>>3]=p,c=p),m=p>0&pg?p:g,s|=+A(+(p-u))>3.141592653589793,(0|(a=y+1|0))!=(0|b);)E=y,y=a,f=l,a=E;s&&(o[w>>3]=g,o[e>>3]=m)}}else i[x>>2]=0,i[x+4>>2]=0,i[x+8>>2]=0,i[x+12>>2]=0,i[x+16>>2]=0,i[x+20>>2]=0,i[x+24>>2]=0,i[x+28>>2]=0,r=0|i[S>>2]}while((0|M)<(0|r))}}function ot(e,t,n){var r=0,o=0,a=0;if(!(0|nt(e|=0,t|=0,n|=0)))return 0|(o=0);if((0|i[(o=e+8|0)>>2])<=0)return 0|(o=1);for(r=e+12|0,e=0;;){if(a=e,e=e+1|0,0|nt((0|i[r>>2])+(a<<3)|0,t+(e<<5)|0,n)){e=0,r=6;break}if((0|e)>=(0|i[o>>2])){e=1,r=6;break}}return 6==(0|r)?0|e:0}function at(e,t,n,r,i){t|=0,n|=0,r|=0,i|=0;var a,s,A,l,c,u,h,d=0;l=+o[(e|=0)>>3],A=+o[t>>3]-l,s=+o[e+8>>3],a=+o[t+8>>3]-s,u=+o[n>>3],d=((d=+o[r>>3]-u)*(s-(h=+o[n+8>>3]))-(l-u)*(c=+o[r+8>>3]-h))/(A*c-a*d),o[i>>3]=l+A*d,o[i+8>>3]=s+a*d}function st(e,t){return t|=0,+o[(e|=0)>>3]!=+o[t>>3]?0|(t=0):0|(t=+o[e+8>>3]==+o[t+8>>3])}function At(e,t){t|=0;var n,r,i;return+((i=+o[(e|=0)>>3]-+o[t>>3])*i+(r=+o[e+8>>3]-+o[t+8>>3])*r+(n=+o[e+16>>3]-+o[t+16>>3])*n)}function lt(e,t,n){e|=0,n|=0;var r=0;(0|(t|=0))>0?(r=0|yt(t,4),i[e>>2]=r,r||M(23230,23253,40,23267)):i[e>>2]=0,i[e+4>>2]=t,i[e+8>>2]=0,i[e+12>>2]=n}function ct(e){var t,n,r,a=0,s=0,l=0,u=0;t=(e|=0)+4|0,n=e+12|0,r=e+8|0;e:for(;;){for(s=0|i[t>>2],a=0;;){if((0|a)>=(0|s))break e;if(l=0|i[e>>2],u=0|i[l+(a<<2)>>2])break;a=a+1|0}a=l+(~~(+A(+ +c(10,+ +(15-(0|i[n>>2])|0))*(+o[u>>3]+ +o[u+8>>3]))%+(0|s))>>>0<<2)|0,s=0|i[a>>2];t:do{if(0|s){if(l=u+32|0,(0|s)==(0|u))i[a>>2]=i[l>>2];else{if(!(a=0|i[(s=s+32|0)>>2]))break;for(;(0|a)!=(0|u);)if(!(a=0|i[(s=a+32|0)>>2]))break t;i[s>>2]=i[l>>2]}vt(u),i[r>>2]=(0|i[r>>2])-1}}while(0)}vt(0|i[e>>2])}function ut(e){var t,n=0,r=0;for(t=0|i[(e|=0)+4>>2],r=0;;){if((0|r)>=(0|t)){n=0,r=4;break}if(n=0|i[(0|i[e>>2])+(r<<2)>>2]){r=4;break}r=r+1|0}return 4==(0|r)?0|n:0}function ht(e,t){t|=0;var n=0,r=0,a=0,s=0;if(n=~~(+A(+ +c(10,+ +(15-(0|i[(e|=0)+12>>2])|0))*(+o[t>>3]+ +o[t+8>>3]))%+(0|i[e+4>>2]))>>>0,n=(0|i[e>>2])+(n<<2)|0,!(r=0|i[n>>2]))return 0|(s=1);s=t+32|0;do{if((0|r)!=(0|t)){if(!(n=0|i[r+32>>2]))return 0|(s=1);for(a=n;;){if((0|a)==(0|t)){a=8;break}if(!(n=0|i[a+32>>2])){n=1,a=10;break}r=a,a=n}if(8==(0|a)){i[r+32>>2]=i[s>>2];break}if(10==(0|a))return 0|n}else i[n>>2]=i[s>>2]}while(0);return vt(t),i[(s=e+8|0)>>2]=(0|i[s>>2])-1,0|(s=0)}function dt(e,t,n){e|=0,t|=0,n|=0;var r,a=0,s=0,l=0;(r=0|gt(40))||M(23283,23253,98,23296),i[r>>2]=i[t>>2],i[r+4>>2]=i[t+4>>2],i[r+8>>2]=i[t+8>>2],i[r+12>>2]=i[t+12>>2],i[(s=r+16|0)>>2]=i[n>>2],i[s+4>>2]=i[n+4>>2],i[s+8>>2]=i[n+8>>2],i[s+12>>2]=i[n+12>>2],i[r+32>>2]=0,s=~~(+A(+ +c(10,+ +(15-(0|i[e+12>>2])|0))*(+o[t>>3]+ +o[t+8>>3]))%+(0|i[e+4>>2]))>>>0,s=(0|i[e>>2])+(s<<2)|0,a=0|i[s>>2];do{if(a){for(;!(0|Te(a,t)&&0|Te(a+16|0,n));)if(s=0|i[a+32>>2],!(0|i[(a=0==(0|s)?a:s)+32>>2])){l=10;break}if(10==(0|l)){i[a+32>>2]=r;break}return vt(r),0|(l=a)}i[s>>2]=r}while(0);return i[(l=e+8|0)>>2]=1+(0|i[l>>2]),0|(l=r)}function ft(e,t,n){t|=0,n|=0;var r=0,a=0;if(a=~~(+A(+ +c(10,+ +(15-(0|i[(e|=0)+12>>2])|0))*(+o[t>>3]+ +o[t+8>>3]))%+(0|i[e+4>>2]))>>>0,!(a=0|i[(0|i[e>>2])+(a<<2)>>2]))return 0|(n=0);if(!n){for(e=a;;){if(0|Te(e,t)){r=10;break}if(!(e=0|i[e+32>>2])){e=0,r=10;break}}if(10==(0|r))return 0|e}for(e=a;;){if(0|Te(e,t)&&0|Te(e+16|0,n)){r=10;break}if(!(e=0|i[e+32>>2])){e=0,r=10;break}}return 10==(0|r)?0|e:0}function pt(e,t){t|=0;var n=0;if(n=~~(+A(+ +c(10,+ +(15-(0|i[(e|=0)+12>>2])|0))*(+o[t>>3]+ +o[t+8>>3]))%+(0|i[e+4>>2]))>>>0,!(e=0|i[(0|i[e>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|Te(e,t)){t=5;break}if(!(e=0|i[e+32>>2])){e=0,t=5;break}}return 5==(0|t)?0|e:0}function mt(e){return 0|~~+function(e){return+ +Pt(+(e=+e))}(e=+e)}function gt(e){e|=0;var t,n=0,r=0,o=0,a=0,s=0,A=0,l=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,y=0,x=0,b=0,_=0;t=P,P=P+16|0,f=t;do{if(e>>>0<245){if(e=(u=e>>>0<11?16:e+11&-8)>>>3,3&(r=(d=0|i[5829])>>>e)|0)return o=0|i[(r=(e=23356+((n=(1&r^1)+e|0)<<1<<2)|0)+8|0)>>2],(0|(s=0|i[(a=o+8|0)>>2]))==(0|e)?i[5829]=d&~(1<>2]=e,i[r>>2]=s),_=n<<3,i[o+4>>2]=3|_,i[(_=o+_+4|0)>>2]=1|i[_>>2],P=t,0|(_=a);if(u>>>0>(h=0|i[5831])>>>0){if(0|r)return n=((n=r<>>=l=n>>>12&16)>>>5&8)|l|(s=(n>>>=r)>>>2&4)|(e=(n>>>=s)>>>1&2)|(o=(n>>>=e)>>>1&1))+(n>>>o)|0)<<1<<2)|0)+8|0)>>2],(0|(r=0|i[(l=s+8|0)>>2]))==(0|n)?(e=d&~(1<>2]=n,i[e>>2]=r,e=d),A=(_=o<<3)-u|0,i[s+4>>2]=3|u,i[(a=s+u|0)+4>>2]=1|A,i[s+_>>2]=A,0|h&&(o=0|i[5834],r=23356+((n=h>>>3)<<1<<2)|0,e&(n=1<>2]:(i[5829]=e|n,n=r,e=r+8|0),i[e>>2]=o,i[n+12>>2]=o,i[o+8>>2]=n,i[o+12>>2]=r),i[5831]=A,i[5834]=a,P=t,0|(_=l);if(s=0|i[5830]){for(r=(s&0-s)-1|0,r=c=0|i[23620+(((o=(r>>>=a=r>>>12&16)>>>5&8)|a|(A=(r>>>=o)>>>2&4)|(l=(r>>>=A)>>>1&2)|(c=(r>>>=l)>>>1&1))+(r>>>c)<<2)>>2],l=c,c=(-8&i[c+4>>2])-u|0;(e=0|i[r+16>>2])||(e=0|i[r+20>>2]);)r=e,l=(a=(A=(-8&i[e+4>>2])-u|0)>>>0>>0)?e:l,c=a?A:c;if((A=l+u|0)>>>0>l>>>0){a=0|i[l+24>>2],n=0|i[l+12>>2];do{if((0|n)==(0|l)){if(!(n=0|i[(e=l+20|0)>>2])&&!(n=0|i[(e=l+16|0)>>2])){r=0;break}for(;;)if(r=0|i[(o=n+20|0)>>2])n=r,e=o;else{if(!(r=0|i[(o=n+16|0)>>2]))break;n=r,e=o}i[e>>2]=0,r=n}else r=0|i[l+8>>2],i[r+12>>2]=n,i[n+8>>2]=r,r=n}while(0);do{if(0|a){if(n=0|i[l+28>>2],(0|l)==(0|i[(e=23620+(n<<2)|0)>>2])){if(i[e>>2]=r,!r){i[5830]=s&~(1<>2])==(0|l)?_:a+20|0)>>2]=r,!r)break;i[r+24>>2]=a,0|(n=0|i[l+16>>2])&&(i[r+16>>2]=n,i[n+24>>2]=r),0|(n=0|i[l+20>>2])&&(i[r+20>>2]=n,i[n+24>>2]=r)}}while(0);return c>>>0<16?(_=c+u|0,i[l+4>>2]=3|_,i[(_=l+_+4|0)>>2]=1|i[_>>2]):(i[l+4>>2]=3|u,i[A+4>>2]=1|c,i[A+c>>2]=c,0|h&&(o=0|i[5834],r=23356+((n=h>>>3)<<1<<2)|0,(n=1<>2]:(i[5829]=n|d,n=r,e=r+8|0),i[e>>2]=o,i[n+12>>2]=o,i[o+8>>2]=n,i[o+12>>2]=r),i[5831]=c,i[5834]=A),P=t,0|(_=l+8|0)}d=u}else d=u}else d=u}else if(e>>>0<=4294967231)if(u=-8&(e=e+11|0),o=0|i[5830]){a=0-u|0,c=(e>>>=8)?u>>>0>16777215?31:u>>>((c=14-((l=((g=e<<(d=(e+1048320|0)>>>16&8))+520192|0)>>>16&4)|d|(c=((g<<=l)+245760|0)>>>16&2))+(g<>>15)|0)+7|0)&1|c<<1:0,r=0|i[23620+(c<<2)>>2];e:do{if(r)for(e=0,l=u<<(31==(0|c)?0:25-(c>>>1)|0),s=0;;){if((A=(-8&i[r+4>>2])-u|0)>>>0>>0){if(!A){e=r,a=0,g=65;break e}e=r,a=A}if(s=0==(0|(g=0|i[r+20>>2]))|(0|g)==(0|(r=0|i[r+16+(l>>>31<<2)>>2]))?s:g,!r){r=s,g=61;break}l<<=1}else r=0,e=0,g=61}while(0);if(61==(0|g)){if(0==(0|r)&0==(0|e)){if(!(e=((e=2<>>=A=d>>>12&16)>>>5&8)|A|(l=(d>>>=s)>>>2&4)|(c=(d>>>=l)>>>1&2)|(r=(d>>>=c)>>>1&1))+(d>>>r)<<2)>>2]}r?g=65:(l=e,A=a)}if(65==(0|g))for(s=r;;){if(a=(r=(d=(-8&i[s+4>>2])-u|0)>>>0>>0)?d:a,e=r?s:e,(r=0|i[s+16>>2])||(r=0|i[s+20>>2]),!r){l=e,A=a;break}s=r}if(0!=(0|l)&&A>>>0<((0|i[5831])-u|0)>>>0&&(h=l+u|0)>>>0>l>>>0){s=0|i[l+24>>2],n=0|i[l+12>>2];do{if((0|n)==(0|l)){if(!(n=0|i[(e=l+20|0)>>2])&&!(n=0|i[(e=l+16|0)>>2])){n=0;break}for(;;)if(r=0|i[(a=n+20|0)>>2])n=r,e=a;else{if(!(r=0|i[(a=n+16|0)>>2]))break;n=r,e=a}i[e>>2]=0}else _=0|i[l+8>>2],i[_+12>>2]=n,i[n+8>>2]=_}while(0);do{if(s){if(e=0|i[l+28>>2],(0|l)==(0|i[(r=23620+(e<<2)|0)>>2])){if(i[r>>2]=n,!n){o&=~(1<>2])==(0|l)?_:s+20|0)>>2]=n,!n)break;i[n+24>>2]=s,0|(e=0|i[l+16>>2])&&(i[n+16>>2]=e,i[e+24>>2]=n),(e=0|i[l+20>>2])&&(i[n+20>>2]=e,i[e+24>>2]=n)}}while(0);e:do{if(A>>>0<16)_=A+u|0,i[l+4>>2]=3|_,i[(_=l+_+4|0)>>2]=1|i[_>>2];else{if(i[l+4>>2]=3|u,i[h+4>>2]=1|A,i[h+A>>2]=A,n=A>>>3,A>>>0<256){r=23356+(n<<1<<2)|0,(e=0|i[5829])&(n=1<>2]:(i[5829]=e|n,n=r,e=r+8|0),i[e>>2]=h,i[n+12>>2]=h,i[h+8>>2]=n,i[h+12>>2]=r;break}if(n=23620+((r=(n=A>>>8)?A>>>0>16777215?31:A>>>((r=14-((x=((_=n<<(b=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(r=((_<<=x)+245760|0)>>>16&2))+(_<>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[h+28>>2]=r,i[(e=h+16|0)+4>>2]=0,i[e>>2]=0,!(o&(e=1<>2]=h,i[h+24>>2]=n,i[h+12>>2]=h,i[h+8>>2]=h;break}n=0|i[n>>2];t:do{if((-8&i[n+4>>2]|0)!=(0|A)){for(o=A<<(31==(0|r)?0:25-(r>>>1)|0);e=0|i[(r=n+16+(o>>>31<<2)|0)>>2];){if((-8&i[e+4>>2]|0)==(0|A)){n=e;break t}o<<=1,n=e}i[r>>2]=h,i[h+24>>2]=n,i[h+12>>2]=h,i[h+8>>2]=h;break e}}while(0);_=0|i[(b=n+8|0)>>2],i[_+12>>2]=h,i[b>>2]=h,i[h+8>>2]=_,i[h+12>>2]=n,i[h+24>>2]=0}}while(0);return P=t,0|(_=l+8|0)}d=u}else d=u;else d=-1}while(0);if((r=0|i[5831])>>>0>=d>>>0)return n=r-d|0,e=0|i[5834],n>>>0>15?(_=e+d|0,i[5834]=_,i[5831]=n,i[_+4>>2]=1|n,i[e+r>>2]=n,i[e+4>>2]=3|d):(i[5831]=0,i[5834]=0,i[e+4>>2]=3|r,i[(_=e+r+4|0)>>2]=1|i[_>>2]),P=t,0|(_=e+8|0);if((A=0|i[5832])>>>0>d>>>0)return x=A-d|0,i[5832]=x,b=(_=0|i[5835])+d|0,i[5835]=b,i[b+4>>2]=1|x,i[_+4>>2]=3|d,P=t,0|(_=_+8|0);if(0|i[5947]?e=0|i[5949]:(i[5949]=4096,i[5948]=4096,i[5950]=-1,i[5951]=-1,i[5952]=0,i[5940]=0,i[5947]=-16&f^1431655768,e=4096),l=d+48|0,(u=(s=e+(c=d+47|0)|0)&(a=0-e|0))>>>0<=d>>>0)return P=t,0|(_=0);if(0|(e=0|i[5939])&&(f=(h=0|i[5937])+u|0)>>>0<=h>>>0|f>>>0>e>>>0)return P=t,0|(_=0);e:do{if(4&i[5940])n=0,g=143;else{r=0|i[5835];t:do{if(r){for(o=23764;!((f=0|i[o>>2])>>>0<=r>>>0&&(f+(0|i[o+4>>2])|0)>>>0>r>>>0);){if(!(e=0|i[o+8>>2])){g=128;break t}o=e}if((n=s-A&a)>>>0<2147483647)if((0|(e=0|Lt(0|n)))==((0|i[o>>2])+(0|i[o+4>>2])|0)){if(-1!=(0|e)){A=n,s=e,g=145;break e}}else o=e,g=136;else n=0}else g=128}while(0);do{if(128==(0|g))if(-1!=(0|(r=0|Lt(0)))&&(n=r,m=(n=(0==((m=(p=0|i[5948])+-1|0)&n|0)?0:(m+n&0-p)-n|0)+u|0)+(p=0|i[5937])|0,n>>>0>d>>>0&n>>>0<2147483647)){if(0|(f=0|i[5939])&&m>>>0<=p>>>0|m>>>0>f>>>0){n=0;break}if((0|(e=0|Lt(0|n)))==(0|r)){A=n,s=r,g=145;break e}o=e,g=136}else n=0}while(0);do{if(136==(0|g)){if(r=0-n|0,!(l>>>0>n>>>0&n>>>0<2147483647&-1!=(0|o))){if(-1==(0|o)){n=0;break}A=n,s=o,g=145;break e}if((e=c-n+(e=0|i[5949])&0-e)>>>0>=2147483647){A=n,s=o,g=145;break e}if(-1==(0|Lt(0|e))){Lt(0|r),n=0;break}A=e+n|0,s=o,g=145;break e}}while(0);i[5940]=4|i[5940],g=143}}while(0);if(143==(0|g)&&u>>>0<2147483647&&!(-1==(0|(x=0|Lt(0|u)))|1^(y=(v=(m=0|Lt(0))-x|0)>>>0>(d+40|0)>>>0)|x>>>0>>0&-1!=(0|x)&-1!=(0|m)^1)&&(A=y?v:n,s=x,g=145),145==(0|g)){n=(0|i[5937])+A|0,i[5937]=n,n>>>0>(0|i[5938])>>>0&&(i[5938]=n),c=0|i[5835];e:do{if(c){for(n=23764;;){if((0|s)==((e=0|i[n>>2])+(r=0|i[n+4>>2])|0)){g=154;break}if(!(o=0|i[n+8>>2]))break;n=o}if(154==(0|g)&&(b=n+4|0,0==(8&i[n+12>>2]|0))&&s>>>0>c>>>0&e>>>0<=c>>>0){i[b>>2]=r+A,b=c+(x=0==(7&(x=c+8|0)|0)?0:0-x&7)|0,x=(_=(0|i[5832])+A|0)-x|0,i[5835]=b,i[5832]=x,i[b+4>>2]=1|x,i[c+_+4>>2]=40,i[5836]=i[5951];break}for(s>>>0<(0|i[5833])>>>0&&(i[5833]=s),r=s+A|0,n=23764;;){if((0|i[n>>2])==(0|r)){g=162;break}if(!(e=0|i[n+8>>2]))break;n=e}if(162==(0|g)&&0==(8&i[n+12>>2]|0)){i[n>>2]=s,i[(h=n+4|0)>>2]=(0|i[h>>2])+A,u=(h=s+(0==(7&(h=s+8|0)|0)?0:0-h&7)|0)+d|0,l=(n=r+(0==(7&(n=r+8|0)|0)?0:0-n&7)|0)-h-d|0,i[h+4>>2]=3|d;t:do{if((0|c)==(0|n))_=(0|i[5832])+l|0,i[5832]=_,i[5835]=u,i[u+4>>2]=1|_;else{if((0|i[5834])==(0|n)){_=(0|i[5831])+l|0,i[5831]=_,i[5834]=u,i[u+4>>2]=1|_,i[u+_>>2]=_;break}if(1==(3&(e=0|i[n+4>>2])|0)){A=-8&e,o=e>>>3;n:do{if(e>>>0<256){if(e=0|i[n+8>>2],(0|(r=0|i[n+12>>2]))==(0|e)){i[5829]=i[5829]&~(1<>2]=r,i[r+8>>2]=e;break}s=0|i[n+24>>2],e=0|i[n+12>>2];do{if((0|e)==(0|n)){if(e=0|i[(o=(r=n+16|0)+4|0)>>2])r=o;else if(!(e=0|i[r>>2])){e=0;break}for(;;)if(o=0|i[(a=e+20|0)>>2])e=o,r=a;else{if(!(o=0|i[(a=e+16|0)>>2]))break;e=o,r=a}i[r>>2]=0}else _=0|i[n+8>>2],i[_+12>>2]=e,i[e+8>>2]=_}while(0);if(!s)break;o=23620+((r=0|i[n+28>>2])<<2)|0;do{if((0|i[o>>2])==(0|n)){if(i[o>>2]=e,0|e)break;i[5830]=i[5830]&~(1<>2])==(0|n)?_:s+20|0)>>2]=e,!e)break n}while(0);if(i[e+24>>2]=s,0|(o=0|i[(r=n+16|0)>>2])&&(i[e+16>>2]=o,i[o+24>>2]=e),!(r=0|i[r+4>>2]))break;i[e+20>>2]=r,i[r+24>>2]=e}while(0);n=n+A|0,a=A+l|0}else a=l;if(i[(n=n+4|0)>>2]=-2&i[n>>2],i[u+4>>2]=1|a,i[u+a>>2]=a,n=a>>>3,a>>>0<256){r=23356+(n<<1<<2)|0,(e=0|i[5829])&(n=1<>2]:(i[5829]=e|n,n=r,e=r+8|0),i[e>>2]=u,i[n+12>>2]=u,i[u+8>>2]=n,i[u+12>>2]=r;break}n=a>>>8;do{if(n){if(a>>>0>16777215){o=31;break}o=a>>>((o=14-((x=((_=n<<(b=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(o=((_<<=x)+245760|0)>>>16&2))+(_<>>15)|0)+7|0)&1|o<<1}else o=0}while(0);if(n=23620+(o<<2)|0,i[u+28>>2]=o,i[(e=u+16|0)+4>>2]=0,i[e>>2]=0,!((e=0|i[5830])&(r=1<>2]=u,i[u+24>>2]=n,i[u+12>>2]=u,i[u+8>>2]=u;break}n=0|i[n>>2];n:do{if((-8&i[n+4>>2]|0)!=(0|a)){for(o=a<<(31==(0|o)?0:25-(o>>>1)|0);e=0|i[(r=n+16+(o>>>31<<2)|0)>>2];){if((-8&i[e+4>>2]|0)==(0|a)){n=e;break n}o<<=1,n=e}i[r>>2]=u,i[u+24>>2]=n,i[u+12>>2]=u,i[u+8>>2]=u;break t}}while(0);_=0|i[(b=n+8|0)>>2],i[_+12>>2]=u,i[b>>2]=u,i[u+8>>2]=_,i[u+12>>2]=n,i[u+24>>2]=0}}while(0);return P=t,0|(_=h+8|0)}for(n=23764;!((e=0|i[n>>2])>>>0<=c>>>0&&(_=e+(0|i[n+4>>2])|0)>>>0>c>>>0);)n=0|i[n+8>>2];n=(e=(e=(a=_+-47|0)+(0==(7&(e=a+8|0)|0)?0:0-e&7)|0)>>>0<(a=c+16|0)>>>0?c:e)+8|0,b=s+(x=0==(7&(x=s+8|0)|0)?0:0-x&7)|0,x=(r=A+-40|0)-x|0,i[5835]=b,i[5832]=x,i[b+4>>2]=1|x,i[s+r+4>>2]=40,i[5836]=i[5951],i[(r=e+4|0)>>2]=27,i[n>>2]=i[5941],i[n+4>>2]=i[5942],i[n+8>>2]=i[5943],i[n+12>>2]=i[5944],i[5941]=s,i[5942]=A,i[5944]=0,i[5943]=n,n=e+24|0;do{b=n,i[(n=n+4|0)>>2]=7}while((b+8|0)>>>0<_>>>0);if((0|e)!=(0|c)){if(s=e-c|0,i[r>>2]=-2&i[r>>2],i[c+4>>2]=1|s,i[e>>2]=s,n=s>>>3,s>>>0<256){r=23356+(n<<1<<2)|0,(e=0|i[5829])&(n=1<>2]:(i[5829]=e|n,n=r,e=r+8|0),i[e>>2]=c,i[n+12>>2]=c,i[c+8>>2]=n,i[c+12>>2]=r;break}if(r=23620+((o=(n=s>>>8)?s>>>0>16777215?31:s>>>((o=14-((x=((_=n<<(b=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(o=((_<<=x)+245760|0)>>>16&2))+(_<>>15)|0)+7|0)&1|o<<1:0)<<2)|0,i[c+28>>2]=o,i[c+20>>2]=0,i[a>>2]=0,!((n=0|i[5830])&(e=1<>2]=c,i[c+24>>2]=r,i[c+12>>2]=c,i[c+8>>2]=c;break}n=0|i[r>>2];t:do{if((-8&i[n+4>>2]|0)!=(0|s)){for(o=s<<(31==(0|o)?0:25-(o>>>1)|0);e=0|i[(r=n+16+(o>>>31<<2)|0)>>2];){if((-8&i[e+4>>2]|0)==(0|s)){n=e;break t}o<<=1,n=e}i[r>>2]=c,i[c+24>>2]=n,i[c+12>>2]=c,i[c+8>>2]=c;break e}}while(0);_=0|i[(b=n+8|0)>>2],i[_+12>>2]=c,i[b>>2]=c,i[c+8>>2]=_,i[c+12>>2]=n,i[c+24>>2]=0}}else 0==(0|(_=0|i[5833]))|s>>>0<_>>>0&&(i[5833]=s),i[5941]=s,i[5942]=A,i[5944]=0,i[5838]=i[5947],i[5837]=-1,i[5842]=23356,i[5841]=23356,i[5844]=23364,i[5843]=23364,i[5846]=23372,i[5845]=23372,i[5848]=23380,i[5847]=23380,i[5850]=23388,i[5849]=23388,i[5852]=23396,i[5851]=23396,i[5854]=23404,i[5853]=23404,i[5856]=23412,i[5855]=23412,i[5858]=23420,i[5857]=23420,i[5860]=23428,i[5859]=23428,i[5862]=23436,i[5861]=23436,i[5864]=23444,i[5863]=23444,i[5866]=23452,i[5865]=23452,i[5868]=23460,i[5867]=23460,i[5870]=23468,i[5869]=23468,i[5872]=23476,i[5871]=23476,i[5874]=23484,i[5873]=23484,i[5876]=23492,i[5875]=23492,i[5878]=23500,i[5877]=23500,i[5880]=23508,i[5879]=23508,i[5882]=23516,i[5881]=23516,i[5884]=23524,i[5883]=23524,i[5886]=23532,i[5885]=23532,i[5888]=23540,i[5887]=23540,i[5890]=23548,i[5889]=23548,i[5892]=23556,i[5891]=23556,i[5894]=23564,i[5893]=23564,i[5896]=23572,i[5895]=23572,i[5898]=23580,i[5897]=23580,i[5900]=23588,i[5899]=23588,i[5902]=23596,i[5901]=23596,i[5904]=23604,i[5903]=23604,b=s+(x=0==(7&(x=s+8|0)|0)?0:0-x&7)|0,x=(_=A+-40|0)-x|0,i[5835]=b,i[5832]=x,i[b+4>>2]=1|x,i[s+_+4>>2]=40,i[5836]=i[5951]}while(0);if((n=0|i[5832])>>>0>d>>>0)return x=n-d|0,i[5832]=x,b=(_=0|i[5835])+d|0,i[5835]=b,i[b+4>>2]=1|x,i[_+4>>2]=3|d,P=t,0|(_=_+8|0)}return i[(_=23312)>>2]=12,P=t,0|(_=0)}function vt(e){var t=0,n=0,r=0,o=0,a=0,s=0,A=0,l=0;if(e|=0){n=e+-8|0,o=0|i[5833],l=n+(t=-8&(e=0|i[e+-4>>2]))|0;do{if(1&e)A=n,s=n;else{if(r=0|i[n>>2],!(3&e))return;if(a=r+t|0,(s=n+(0-r)|0)>>>0>>0)return;if((0|i[5834])==(0|s)){if(3!=(3&(t=0|i[(e=l+4|0)>>2])|0)){A=s,t=a;break}return i[5831]=a,i[e>>2]=-2&t,i[s+4>>2]=1|a,void(i[s+a>>2]=a)}if(n=r>>>3,r>>>0<256){if(e=0|i[s+8>>2],(0|(t=0|i[s+12>>2]))==(0|e)){i[5829]=i[5829]&~(1<>2]=t,i[t+8>>2]=e,A=s,t=a;break}o=0|i[s+24>>2],e=0|i[s+12>>2];do{if((0|e)==(0|s)){if(e=0|i[(n=(t=s+16|0)+4|0)>>2])t=n;else if(!(e=0|i[t>>2])){e=0;break}for(;;)if(n=0|i[(r=e+20|0)>>2])e=n,t=r;else{if(!(n=0|i[(r=e+16|0)>>2]))break;e=n,t=r}i[t>>2]=0}else A=0|i[s+8>>2],i[A+12>>2]=e,i[e+8>>2]=A}while(0);if(o){if(t=0|i[s+28>>2],(0|i[(n=23620+(t<<2)|0)>>2])==(0|s)){if(i[n>>2]=e,!e){i[5830]=i[5830]&~(1<>2])==(0|s)?A:o+20|0)>>2]=e,!e){A=s,t=a;break}i[e+24>>2]=o,0|(n=0|i[(t=s+16|0)>>2])&&(i[e+16>>2]=n,i[n+24>>2]=e),(t=0|i[t+4>>2])?(i[e+20>>2]=t,i[t+24>>2]=e,A=s,t=a):(A=s,t=a)}else A=s,t=a}}while(0);if(!(s>>>0>=l>>>0)&&1&(r=0|i[(e=l+4|0)>>2])){if(2&r)i[e>>2]=-2&r,i[A+4>>2]=1|t,i[s+t>>2]=t,o=t;else{if((0|i[5835])==(0|l)){if(l=(0|i[5832])+t|0,i[5832]=l,i[5835]=A,i[A+4>>2]=1|l,(0|A)!=(0|i[5834]))return;return i[5834]=0,void(i[5831]=0)}if((0|i[5834])==(0|l))return l=(0|i[5831])+t|0,i[5831]=l,i[5834]=s,i[A+4>>2]=1|l,void(i[s+l>>2]=l);o=(-8&r)+t|0,n=r>>>3;do{if(r>>>0<256){if(t=0|i[l+8>>2],(0|(e=0|i[l+12>>2]))==(0|t)){i[5829]=i[5829]&~(1<>2]=e,i[e+8>>2]=t;break}a=0|i[l+24>>2],e=0|i[l+12>>2];do{if((0|e)==(0|l)){if(e=0|i[(n=(t=l+16|0)+4|0)>>2])t=n;else if(!(e=0|i[t>>2])){n=0;break}for(;;)if(n=0|i[(r=e+20|0)>>2])e=n,t=r;else{if(!(n=0|i[(r=e+16|0)>>2]))break;e=n,t=r}i[t>>2]=0,n=e}else n=0|i[l+8>>2],i[n+12>>2]=e,i[e+8>>2]=n,n=e}while(0);if(0|a){if(e=0|i[l+28>>2],(0|i[(t=23620+(e<<2)|0)>>2])==(0|l)){if(i[t>>2]=n,!n){i[5830]=i[5830]&~(1<>2])==(0|l)?r:a+20|0)>>2]=n,!n)break;i[n+24>>2]=a,0|(t=0|i[(e=l+16|0)>>2])&&(i[n+16>>2]=t,i[t+24>>2]=n),0|(e=0|i[e+4>>2])&&(i[n+20>>2]=e,i[e+24>>2]=n)}}while(0);if(i[A+4>>2]=1|o,i[s+o>>2]=o,(0|A)==(0|i[5834]))return void(i[5831]=o)}if(e=o>>>3,o>>>0<256)return n=23356+(e<<1<<2)|0,(t=0|i[5829])&(e=1<>2]:(i[5829]=t|e,e=n,t=n+8|0),i[t>>2]=A,i[e+12>>2]=A,i[A+8>>2]=e,void(i[A+12>>2]=n);e=23620+((r=(e=o>>>8)?o>>>0>16777215?31:o>>>((r=14-((a=((l=e<<(s=(e+1048320|0)>>>16&8))+520192|0)>>>16&4)|s|(r=((l<<=a)+245760|0)>>>16&2))+(l<>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[A+28>>2]=r,i[A+20>>2]=0,i[A+16>>2]=0,t=0|i[5830],n=1<>2];t:do{if((-8&i[e+4>>2]|0)!=(0|o)){for(r=o<<(31==(0|r)?0:25-(r>>>1)|0);t=0|i[(n=e+16+(r>>>31<<2)|0)>>2];){if((-8&i[t+4>>2]|0)==(0|o)){e=t;break t}r<<=1,e=t}i[n>>2]=A,i[A+24>>2]=e,i[A+12>>2]=A,i[A+8>>2]=A;break e}}while(0);l=0|i[(s=e+8|0)>>2],i[l+12>>2]=A,i[s>>2]=A,i[A+8>>2]=l,i[A+12>>2]=e,i[A+24>>2]=0}else i[5830]=t|n,i[e>>2]=A,i[A+24>>2]=e,i[A+12>>2]=A,i[A+8>>2]=A}while(0);if(l=(0|i[5837])-1|0,i[5837]=l,!(0|l)){for(e=23772;e=0|i[e>>2];)e=e+8|0;i[5837]=-1}}}}function yt(e,t){t|=0;var n=0;return(e|=0)?(n=0|y(t,e),(t|e)>>>0>65535&&(n=(0|(n>>>0)/(e>>>0))==(0|t)?n:-1)):n=0,(e=0|gt(n))&&3&i[e+-4>>2]?(Rt(0|e,0,0|n),0|e):0|e}function xt(e,t,n,r){return 0|(_(0|(r=(t|=0)-(r|=0)-((n|=0)>>>0>(e|=0)>>>0|0)>>>0)),e-n>>>0|0)}function bt(e){return 0|((e|=0)?31-(0|b(e^e-1))|0:32)}function _t(e,t,n,r,o){o|=0;var a=0,s=0,A=0,l=0,c=0,u=0,h=0,d=0,f=0,p=0;if(u=e|=0,s=n|=0,A=d=r|=0,!(c=l=t|=0))return a=0!=(0|o),A?a?(i[o>>2]=0|e,i[o+4>>2]=0&t,o=0,0|(_(0|(d=0)),o)):(o=0,0|(_(0|(d=0)),o)):(a&&(i[o>>2]=(u>>>0)%(s>>>0),i[o+4>>2]=0),o=(u>>>0)/(s>>>0)>>>0,0|(_(0|(d=0)),o));a=0==(0|A);do{if(s){if(!a){if((a=(0|b(0|A))-(0|b(0|c))|0)>>>0<=31){s=h=a+1|0,e=u>>>(h>>>0)&(t=a-31>>31)|c<<(A=31-a|0),t&=c>>>(h>>>0),a=0,A=u<>2]=0|e,i[o+4>>2]=l|0&t,o=0,0|(_(0|(d=0)),o)):(o=0,0|(_(0|(d=0)),o))}if((a=s-1|0)&s|0){s=A=33+(0|b(0|s))-(0|b(0|c))|0,e=(h=32-A|0)-1>>31&c>>>((f=A-32|0)>>>0)|(c<>>(A>>>0))&(t=f>>31),t&=c>>>(A>>>0),a=u<<(p=64-A|0)&(l=h>>31),A=(c<>>(f>>>0))&l|u<>31;break}return 0|o&&(i[o>>2]=a&u,i[o+4>>2]=0),1==(0|s)?(p=0|e,0|(_(0|(f=l|0&t)),p)):(f=c>>>((p=0|bt(0|s))>>>0)|0,p=c<<32-p|u>>>(p>>>0)|0,0|(_(0|f),p))}if(a)return 0|o&&(i[o>>2]=(c>>>0)%(s>>>0),i[o+4>>2]=0),p=(c>>>0)/(s>>>0)>>>0,0|(_(0|(f=0)),p);if(!u)return 0|o&&(i[o>>2]=0,i[o+4>>2]=(c>>>0)%(A>>>0)),p=(c>>>0)/(A>>>0)>>>0,0|(_(0|(f=0)),p);if(!((a=A-1|0)&A))return 0|o&&(i[o>>2]=0|e,i[o+4>>2]=a&c|0&t),f=0,p=c>>>((0|bt(0|A))>>>0),0|(_(0|f),p);if((a=(0|b(0|A))-(0|b(0|c))|0)>>>0<=30){s=t=a+1|0,e=c<<(A=31-a|0)|u>>>(t>>>0),t=c>>>(t>>>0),a=0,A=u<>2]=0|e,i[o+4>>2]=l|0&t,p=0,0|(_(0|(f=0)),p)):(p=0,0|(_(0|(f=0)),p))}while(0);if(s){c=0|function(e,t,n,r){return 0|(_((t|=0)+(r|=0)+((n=(e|=0)+(n|=0)>>>0)>>>0>>0|0)>>>0|0),0|n)}(0|(h=0|n),0|(u=d|0&r),-1,-1),n=0|w(),l=A,A=0;do{r=l,l=a>>>31|l<<1,a=A|a<<1,xt(0|c,0|n,0|(r=e<<1|r>>>31|0),0|(d=e>>>31|t<<1|0)),A=1&(f=(p=0|w())>>31|((0|p)<0?-1:0)<<1),e=0|xt(0|r,0|d,f&h|0,(((0|p)<0?-1:0)>>31|((0|p)<0?-1:0)<<1)&u|0),t=0|w(),s=s-1|0}while(0!=(0|s));c=l,l=0}else c=A,l=0,A=0;return s=0,0|o&&(i[o>>2]=e,i[o+4>>2]=t),p=-2&(a<<1|0)|A,0|(_(0|(f=(0|a)>>>31|(c|s)<<1|0&(s<<1|a>>>31)|l)),p)}function wt(e,t,n,r){var o,a;return a=P,P=P+16|0,_t(e|=0,t|=0,n|=0,r|=0,o=0|a),P=a,0|(_(0|i[o+4>>2]),0|i[o>>2])}function Mt(e,t,n){return e|=0,t|=0,(0|(n|=0))<32?(_(t>>>n|0),e>>>n|(t&(1<>>n-32|0)}function St(e,t,n){return e|=0,t|=0,(0|(n|=0))<32?(_(t<>>32-n|0),e<=0?+s(e+.5):+v(e-.5)}function Ct(e,t,n){e|=0,t|=0;var o,a,s=0;if((0|(n|=0))>=8192)return T(0|e,0|t,0|n),0|e;if(a=0|e,o=e+n|0,(3&e)==(3&t)){for(;3&e;){if(!n)return 0|a;r[e>>0]=0|r[t>>0],e=e+1|0,t=t+1|0,n=n-1|0}for(s=(n=-4&o|0)-64|0;(0|e)<=(0|s);)i[e>>2]=i[t>>2],i[e+4>>2]=i[t+4>>2],i[e+8>>2]=i[t+8>>2],i[e+12>>2]=i[t+12>>2],i[e+16>>2]=i[t+16>>2],i[e+20>>2]=i[t+20>>2],i[e+24>>2]=i[t+24>>2],i[e+28>>2]=i[t+28>>2],i[e+32>>2]=i[t+32>>2],i[e+36>>2]=i[t+36>>2],i[e+40>>2]=i[t+40>>2],i[e+44>>2]=i[t+44>>2],i[e+48>>2]=i[t+48>>2],i[e+52>>2]=i[t+52>>2],i[e+56>>2]=i[t+56>>2],i[e+60>>2]=i[t+60>>2],e=e+64|0,t=t+64|0;for(;(0|e)<(0|n);)i[e>>2]=i[t>>2],e=e+4|0,t=t+4|0}else for(n=o-4|0;(0|e)<(0|n);)r[e>>0]=0|r[t>>0],r[e+1>>0]=0|r[t+1>>0],r[e+2>>0]=0|r[t+2>>0],r[e+3>>0]=0|r[t+3>>0],e=e+4|0,t=t+4|0;for(;(0|e)<(0|o);)r[e>>0]=0|r[t>>0],e=e+1|0,t=t+1|0;return 0|a}function Rt(e,t,n){t|=0;var o,a=0,s=0,A=0;if(o=(e|=0)+(n|=0)|0,t&=255,(0|n)>=67){for(;3&e;)r[e>>0]=t,e=e+1|0;for(A=t|t<<8|t<<16|t<<24,s=(a=-4&o|0)-64|0;(0|e)<=(0|s);)i[e>>2]=A,i[e+4>>2]=A,i[e+8>>2]=A,i[e+12>>2]=A,i[e+16>>2]=A,i[e+20>>2]=A,i[e+24>>2]=A,i[e+28>>2]=A,i[e+32>>2]=A,i[e+36>>2]=A,i[e+40>>2]=A,i[e+44>>2]=A,i[e+48>>2]=A,i[e+52>>2]=A,i[e+56>>2]=A,i[e+60>>2]=A,e=e+64|0;for(;(0|e)<(0|a);)i[e>>2]=A,e=e+4|0}for(;(0|e)<(0|o);)r[e>>0]=t,e=e+1|0;return o-n|0}function Pt(e){return(e=+e)>=0?+s(e+.5):+v(e-.5)}function Lt(e){e|=0;var t,n,r;return r=0|E(),(0|e)>0&(0|(t=(n=0|i[a>>2])+e|0))<(0|n)|(0|t)<0?(R(0|t),S(12),-1):(0|t)>(0|r)&&!(0|C(0|t))?(S(12),-1):(i[a>>2]=t,0|n)}return{___uremdi3:wt,_bitshift64Lshr:Mt,_bitshift64Shl:St,_calloc:yt,_cellAreaKm2:function(e,t){var n,r,o,a=0;if(o=P,P=P+192|0,r=o,Ve(e|=0,t|=0,n=o+168|0),je(e,t,r),(0|(t=0|i[r>>2]))>0){if(a=+Re(r+8|0,r+8+((1!=(0|t)&1)<<4)|0,n)+0,1!=(0|t)){e=1;do{a+=+Re(r+8+(e<<4)|0,r+8+(((0|(e=e+1|0))%(0|t)|0)<<4)|0,n)}while((0|e)<(0|t))}}else a=0;return P=o,6371.007180918475*a*6371.007180918475},_cellAreaM2:function(e,t){var n,r,o,a=0;if(o=P,P=P+192|0,r=o,Ve(e|=0,t|=0,n=o+168|0),je(e,t,r),(0|(t=0|i[r>>2]))>0){if(a=+Re(r+8|0,r+8+((1!=(0|t)&1)<<4)|0,n)+0,1!=(0|t)){e=1;do{a+=+Re(r+8+(e<<4)|0,r+8+(((0|(e=e+1|0))%(0|t)|0)<<4)|0,n)}while((0|e)<(0|t))}}else a=0;return P=o,6371.007180918475*a*6371.007180918475*1e3*1e3},_cellAreaRads2:function(e,t){var n,r,o,a=0;if(o=P,P=P+192|0,r=o,Ve(e|=0,t|=0,n=o+168|0),je(e,t,r),(0|(t=0|i[r>>2]))<=0)return P=o,+(a=0);if(a=+Re(r+8|0,r+8+((1!=(0|t)&1)<<4)|0,n)+0,1==(0|t))return P=o,+a;e=1;do{a+=+Re(r+8+(e<<4)|0,r+8+(((0|(e=e+1|0))%(0|t)|0)<<4)|0,n)}while((0|e)<(0|t));return P=o,+a},_compact:function(e,t,n){t|=0;var r,o=0,a=0,s=0,A=0,l=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,y=0,x=0,b=0,_=0,M=0,S=0,E=0;if(!(n|=0))return 0|(S=0);if(o=0|i[(a=e|=0)>>2],!0&0==(15728640&(a=0|i[a+4>>2])|0)){if((0|n)<=0)return 0|(S=0);if(i[(S=t)>>2]=o,i[S+4>>2]=a,1==(0|n))return 0|(S=0);o=1;do{M=0|i[(_=e+(o<<3)|0)+4>>2],i[(S=t+(o<<3)|0)>>2]=i[_>>2],i[S+4>>2]=M,o=o+1|0}while((0|o)!=(0|n));return 0|(o=0)}if(!(M=0|gt(_=n<<3)))return 0|(S=-3);if(Ct(0|M,0|e,0|_),!(r=0|yt(n,8)))return vt(M),0|(S=-3);o=n;e:for(;;){x=0|Mt(0|(h=0|i[(A=M)>>2]),0|(A=0|i[A+4>>2]),52),w(),b=(x&=15)+-1|0,y=(0|o)>0;t:do{if(y){if(v=((0|o)<0)<<31>>31,m=0|St(0|b,0,52),g=0|w(),b>>>0>15)for(a=0,e=h,n=A;;){if(!(0==(0|e)&0==(0|n))){if(s=0|Mt(0|e,0|n,52),w(),l=(0|(s&=15))<(0|b),s=(0|s)==(0|b),n=0|wt(0|(u=l?0:s?e:0),0|(e=l?0:s?n:0),0|o,0|v),w(),0==(0|(c=0|i[(l=s=r+(n<<3)|0)>>2]))&0==(0|(l=0|i[l+4>>2])))n=u;else for(m=0,p=n,f=l,n=u;;){if((0|m)>(0|o)){S=41;break e}if((0|c)==(0|n)&(-117440513&f|0)==(0|e)){u=0|Mt(0|c,0|f,56),w(),d=(u&=7)+1|0,g=0|Mt(0|c,0|f,45),w();n:do{if(0|B(127&g)){if(c=0|Mt(0|c,0|f,52),w(),!(c&=15)){l=6;break}for(l=1;;){if(!(0==((g=0|St(7,0,3*(15-l|0)|0))&n|0)&0==((0|w())&e|0))){l=7;break n}if(!(l>>>0>>0)){l=6;break}l=l+1|0}}else l=7}while(0);if((u+2|0)>>>0>l>>>0){S=51;break e}g=0|St(0|d,0,56),e=0|w()|-117440513&e,i[(l=s)>>2]=0,i[l+4>>2]=0,l=p,n|=g}else l=(p+1|0)%(0|o)|0;if(0==(0|(c=0|i[(f=s=r+(l<<3)|0)>>2]))&0==(0|(f=0|i[f+4>>2])))break;m=m+1|0,p=l}i[(g=s)>>2]=n,i[g+4>>2]=e}if((0|(a=a+1|0))>=(0|o))break t;e=0|i[(n=M+(a<<3)|0)>>2],n=0|i[n+4>>2]}for(a=0,e=h,n=A;;){if(!(0==(0|e)&0==(0|n))){if(l=0|Mt(0|e,0|n,52),w(),(0|(l&=15))>=(0|b)){if((0|l)!=(0|b)&&(e|=m,n=-15728641&n|g,l>>>0>=x>>>0)){s=b;do{p=0|St(7,0,3*(14-s|0)|0),s=s+1|0,e|=p,n=0|w()|n}while(s>>>0>>0)}}else e=0,n=0;if(l=0|wt(0|e,0|n,0|o,0|v),w(),!(0==(0|(u=0|i[(c=s=r+(l<<3)|0)>>2]))&0==(0|(c=0|i[c+4>>2]))))for(p=0;;){if((0|p)>(0|o)){S=41;break e}if((0|u)==(0|e)&(-117440513&c|0)==(0|n)){d=0|Mt(0|u,0|c,56),w(),f=(d&=7)+1|0,E=0|Mt(0|u,0|c,45),w();n:do{if(0|B(127&E)){if(u=0|Mt(0|u,0|c,52),w(),!(u&=15)){c=6;break}for(c=1;;){if(!(0==((E=0|St(7,0,3*(15-c|0)|0))&e|0)&0==((0|w())&n|0))){c=7;break n}if(!(c>>>0>>0)){c=6;break}c=c+1|0}}else c=7}while(0);if((d+2|0)>>>0>c>>>0){S=51;break e}E=0|St(0|f,0,56),n=0|w()|-117440513&n,i[(f=s)>>2]=0,i[f+4>>2]=0,e|=E}else l=(l+1|0)%(0|o)|0;if(0==(0|(u=0|i[(c=s=r+(l<<3)|0)>>2]))&0==(0|(c=0|i[c+4>>2])))break;p=p+1|0}i[(E=s)>>2]=e,i[E+4>>2]=n}if((0|(a=a+1|0))>=(0|o))break t;e=0|i[(n=M+(a<<3)|0)>>2],n=0|i[n+4>>2]}}}while(0);if((o+5|0)>>>0<11){S=99;break}if(!(g=0|yt((0|o)/6|0,8))){S=58;break}t:do{if(y){p=0,f=0;do{if(!(0==(0|(a=0|i[(e=l=r+(p<<3)|0)>>2]))&0==(0|(e=0|i[e+4>>2])))){c=0|Mt(0|a,0|e,56),w(),n=(c&=7)+1|0,u=-117440513&e,E=0|Mt(0|a,0|e,45),w();n:do{if(0|B(127&E)){if(d=0|Mt(0|a,0|e,52),w(),0|(d&=15))for(s=1;;){if(!(0==(a&(E=0|St(7,0,3*(15-s|0)|0))|0)&0==(u&(0|w())|0)))break n;if(!(s>>>0>>0))break;s=s+1|0}a|=e=0|St(0|n,0,56),e=0|w()|u,i[(n=l)>>2]=a,i[n+4>>2]=e,n=c+2|0}}while(0);7==(0|n)&&(i[(E=g+(f<<3)|0)>>2]=a,i[E+4>>2]=-117440513&e,f=f+1|0)}p=p+1|0}while((0|p)!=(0|o));if(y){if(m=((0|o)<0)<<31>>31,d=0|St(0|b,0,52),p=0|w(),b>>>0>15)for(e=0,a=0;;){do{if(!(0==(0|h)&0==(0|A))){for(c=0|Mt(0|h,0|A,52),w(),s=(0|(c&=15))<(0|b),c=(0|c)==(0|b),s=0|wt(0|(l=s?0:c?h:0),0|(c=s?0:c?A:0),0|o,0|m),w(),n=0;;){if((0|n)>(0|o)){S=98;break e}if((-117440513&(u=0|i[(E=r+(s<<3)|0)+4>>2])|0)==(0|c)&&(0|i[E>>2])==(0|l)){S=70;break}if((0|i[(E=r+((s=(s+1|0)%(0|o)|0)<<3)|0)>>2])==(0|l)&&(0|i[E+4>>2])==(0|c))break;n=n+1|0}if(70==(0|S)&&(S=0,!0&100663296==(117440512&u|0)))break;i[(E=t+(a<<3)|0)>>2]=h,i[E+4>>2]=A,a=a+1|0}}while(0);if((0|(e=e+1|0))>=(0|o)){o=f;break t}h=0|i[(A=M+(e<<3)|0)>>2],A=0|i[A+4>>2]}for(e=0,a=0;;){do{if(!(0==(0|h)&0==(0|A))){if(c=0|Mt(0|h,0|A,52),w(),(0|(c&=15))>=(0|b))if((0|c)!=(0|b))if(n=h|d,s=-15728641&A|p,c>>>0>>0)c=s;else{l=b;do{E=0|St(7,0,3*(14-l|0)|0),l=l+1|0,n|=E,s=0|w()|s}while(l>>>0>>0);c=s}else n=h,c=A;else n=0,c=0;for(l=0|wt(0|n,0|c,0|o,0|m),w(),s=0;;){if((0|s)>(0|o)){S=98;break e}if((-117440513&(u=0|i[(E=r+(l<<3)|0)+4>>2])|0)==(0|c)&&(0|i[E>>2])==(0|n)){S=93;break}if((0|i[(E=r+((l=(l+1|0)%(0|o)|0)<<3)|0)>>2])==(0|n)&&(0|i[E+4>>2])==(0|c))break;s=s+1|0}if(93==(0|S)&&(S=0,!0&100663296==(117440512&u|0)))break;i[(E=t+(a<<3)|0)>>2]=h,i[E+4>>2]=A,a=a+1|0}}while(0);if((0|(e=e+1|0))>=(0|o)){o=f;break t}h=0|i[(A=M+(e<<3)|0)>>2],A=0|i[A+4>>2]}}else a=0,o=f}else a=0,o=0}while(0);if(Rt(0|r,0,0|_),Ct(0|M,0|g,o<<3|0),vt(g),!o)break;t=t+(a<<3)|0}return 41==(0|S)?(vt(M),vt(r),0|(E=-1)):51==(0|S)?(vt(M),vt(r),0|(E=-2)):58==(0|S)?(vt(M),vt(r),0|(E=-3)):98==(0|S)?(vt(g),vt(M),vt(r),0|(E=-1)):(99==(0|S)&&Ct(0|t,0|M,o<<3|0),vt(M),vt(r),0|(E=0))},_destroyLinkedPolygon:function(e){var t=0,n=0,r=0,o=0;if(e|=0)for(r=1;;){if(0|(t=0|i[e>>2]))do{if(0|(n=0|i[t>>2]))do{o=n,n=0|i[n+16>>2],vt(o)}while(0!=(0|n));o=t,t=0|i[t+8>>2],vt(o)}while(0!=(0|t));if(t=e,e=0|i[e+8>>2],r||vt(t),!e)break;r=0}},_edgeLengthKm:function(e){return+ +o[20752+((e|=0)<<3)>>3]},_edgeLengthM:function(e){return+ +o[20880+((e|=0)<<3)>>3]},_emscripten_replace_memory:function(e){return r=new Int8Array(e),i=new Int32Array(e),o=new Float64Array(e),n=e,!0},_exactEdgeLengthKm:function(e,t){var n,r,a=0,s=0,A=0,c=0,d=0,f=0;if(r=P,P=P+176|0,Ye(e|=0,t|=0,n=r),(0|(e=0|i[n>>2]))<=1)return P=r,+(A=0);t=e+-1|0,e=0,a=0,s=+o[n+8>>3],A=+o[n+16>>3];do{d=s,s=+o[n+8+((e=e+1|0)<<4)>>3],f=+h(.5*(s-d)),c=A,A=+o[n+8+(e<<4)+8>>3],c=f*f+(c=+h(.5*(A-c)))*(+u(+d)*+u(+s)*c),a+=2*+g(+ +l(+c),+ +l(+(1-c)))}while((0|e)!=(0|t));return P=r,+(f=6371.007180918475*a)},_exactEdgeLengthM:function(e,t){var n,r,a=0,s=0,A=0,c=0,d=0,f=0;if(r=P,P=P+176|0,Ye(e|=0,t|=0,n=r),(0|(e=0|i[n>>2]))<=1)return P=r,+(A=0);t=e+-1|0,e=0,a=0,s=+o[n+8>>3],A=+o[n+16>>3];do{d=s,s=+o[n+8+((e=e+1|0)<<4)>>3],f=+h(.5*(s-d)),c=A,A=+o[n+8+(e<<4)+8>>3],c=f*f+(c=+h(.5*(A-c)))*(+u(+d)*+u(+s)*c),a+=2*+g(+ +l(+c),+ +l(+(1-c)))}while((0|e)!=(0|t));return P=r,+(f=6371.007180918475*a*1e3)},_exactEdgeLengthRads:function(e,t){var n,r,a=0,s=0,A=0,c=0,d=0,f=0;if(r=P,P=P+176|0,Ye(e|=0,t|=0,n=r),(0|(e=0|i[n>>2]))<=1)return P=r,+(A=0);t=e+-1|0,e=0,a=0,s=+o[n+8>>3],A=+o[n+16>>3];do{d=s,s=+o[n+8+((e=e+1|0)<<4)>>3],f=+h(.5*(s-d)),c=A,A=+o[n+8+(e<<4)+8>>3],c=f*f+(c=+h(.5*(A-c)))*(+u(+s)*+u(+d)*c),a+=2*+g(+ +l(+c),+ +l(+(1-c)))}while((0|e)<(0|t));return P=r,+a},_experimentalH3ToLocalIj:function(e,t,n,r,i){var o,a;return i|=0,a=P,P=P+16|0,(e=0|$e(e|=0,t|=0,n|=0,r|=0,o=a))||(de(o,i),e=0),P=a,0|e},_experimentalLocalIjToH3:function(e,t,n,r){var i,o;return e|=0,t|=0,r|=0,i=P,P=P+16|0,fe(n|=0,o=i),r=0|et(e,t,o,r),P=i,0|r},_free:vt,_geoToH3:Fe,_getDestinationH3IndexFromUnidirectionalEdge:function(e,t){e|=0;var n,r,o=0;return n=P,P=P+16|0,o=n,!0&268435456==(2013265920&(t|=0)|0)?(r=0|Mt(0|e,0|t,56),w(),i[o>>2]=0,o=0|I(e,-2130706433&t|134217728,7&r,o),t=0|w(),_(0|t),P=n,0|o):(o=0,_(0|(t=0)),P=n,0|o)},_getH3IndexesFromUnidirectionalEdge:function(e,t,n){e|=0;var r,o,a,s,A=0;a=P,P=P+16|0,r=a,s=!0&268435456==(2013265920&(t|=0)|0),o=-2130706433&t|134217728,i[(A=n|=0)>>2]=s?e:0,i[A+4>>2]=s?o:0,s?(t=0|Mt(0|e,0|t,56),w(),i[r>>2]=0,e=0|I(e,o,7&t,r),t=0|w()):(e=0,t=0),i[(A=n+8|0)>>2]=e,i[A+4>>2]=t,P=a},_getH3UnidirectionalEdge:function(e,t,n,r){var o,a,s=0,A=0,l=0,c=0,u=0;if(a=P,P=P+16|0,o=a,!(0|Qe(e|=0,t|=0,n|=0,r|=0)))return c=0,_(0|(l=0)),P=a,0|c;for(l=-2130706433&t,s=(s=0==(0|Ie(e,t)))?1:2;i[o>>2]=0,A=s+1|0,!((0|(u=0|I(e,t,s,o)))==(0|n)&(0|w())==(0|r));){if(!(A>>>0<7)){s=0,e=0,c=6;break}s=A}return 6==(0|c)?(_(0|s),P=a,0|e):(u=0|St(0|s,0,56),c=0|l|w()|268435456,u|=e,_(0|c),P=a,0|u)},_getH3UnidirectionalEdgeBoundary:Ye,_getH3UnidirectionalEdgesFromHexagon:function(e,t,n){n|=0;var r,o=0;r=0==(0|Ie(e|=0,t|=0)),t&=-2130706433,i[(o=n)>>2]=r?e:0,i[o+4>>2]=r?285212672|t:0,i[(o=n+8|0)>>2]=e,i[o+4>>2]=301989888|t,i[(o=n+16|0)>>2]=e,i[o+4>>2]=318767104|t,i[(o=n+24|0)>>2]=e,i[o+4>>2]=335544320|t,i[(o=n+32|0)>>2]=e,i[o+4>>2]=352321536|t,i[(n=n+40|0)>>2]=e,i[n+4>>2]=369098752|t},_getOriginH3IndexFromUnidirectionalEdge:function(e,t){var n;return e|=0,_(0|((n=!0&268435456==(2013265920&(t|=0)|0))?-2130706433&t|134217728:0)),0|(n?e:0)},_getPentagonIndexes:We,_getRes0Indexes:function(e){e|=0;var t=0,n=0,r=0;t=0;do{St(0|t,0,45),r=134225919|w(),i[(n=e+(t<<3)|0)>>2]=-1,i[n+4>>2]=r,t=t+1|0}while(122!=(0|t))},_h3Distance:function(e,t,n,r){var i,o,a;return n|=0,r|=0,a=P,P=P+32|0,o=a,e=0==(0|$e(e|=0,t|=0,e,t,i=a+12|0))&&0==(0|$e(e,t,n,r,o))?0|he(i,o):-1,P=a,0|e},_h3GetBaseCell:Pe,_h3GetFaces:function e(t,n,r){r|=0;var o,a=0,s=0,A=0,l=0,c=0,u=0,h=0,d=0;o=P,P=P+128|0,h=o+112|0,A=o+96|0,d=o,s=0|Mt(0|(t|=0),0|(n|=0),52),w(),c=15&s,i[h>>2]=c,l=0|Mt(0|t,0|n,45),w(),l&=127;e:do{if(0|B(l)){if(0|c)for(a=1;;){if(!(0==((u=0|St(7,0,3*(15-a|0)|0))&t|0)&0==((0|w())&n|0))){s=0;break e}if(!(a>>>0>>0))break;a=a+1|0}if(!(1&s))return u=0|St(c+1|0,0,52),d=0|w()|-15728641&n,e((u|t)&~(h=0|St(7,0,3*(14-c|0)|0)),d&~(0|w()),r),void(P=o);s=1}else s=0}while(0);Ge(t,n,A),s?(be(A,h,d),u=5):(Se(A,h,d),u=6);e:do{if(0|B(l))if(c)for(a=1;;){if(!(0==((l=0|St(7,0,3*(15-a|0)|0))&t|0)&0==((0|w())&n|0))){a=8;break e}if(!(a>>>0>>0)){a=20;break}a=a+1|0}else a=20;else a=8}while(0);if(Rt(0|r,-1,0|a),s){s=0;do{for(we(A=d+(s<<4)|0,0|i[h>>2]),A=0|i[A>>2],a=0;!(-1==(0|(c=0|i[(l=r+(a<<2)|0)>>2]))|(0|c)==(0|A));)a=a+1|0;i[l>>2]=A,s=s+1|0}while((0|s)!=(0|u))}else{s=0;do{for(_e(A=d+(s<<4)|0,0|i[h>>2],0,1),A=0|i[A>>2],a=0;!(-1==(0|(c=0|i[(l=r+(a<<2)|0)>>2]))|(0|c)==(0|A));)a=a+1|0;i[l>>2]=A,s=s+1|0}while((0|s)!=(0|u))}P=o},_h3GetResolution:function(e,t){return t=0|Mt(0|(e|=0),0|(t|=0),52),w(),15&t|0},_h3IndexesAreNeighbors:Qe,_h3IsPentagon:Ie,_h3IsResClassIII:function(e,t){return t=0|Mt(0|(e|=0),0|(t|=0),52),w(),1&t|0},_h3IsValid:Le,_h3Line:function(e,t,n,r,o){n|=0,r|=0,o|=0;var a,s=0,l=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,y=0,x=0,b=0,_=0,w=0,M=0;if(a=P,P=P+48|0,l=a+12|0,w=a,0==(0|$e(e|=0,t|=0,e,t,s=a+24|0))&&0==(0|$e(e,t,n,r,l))){if((0|(_=0|he(s,l)))<0)return P=a,0|(w=_);for(i[s>>2]=0,i[s+4>>2]=0,i[s+8>>2]=0,i[l>>2]=0,i[l+4>>2]=0,i[l+8>>2]=0,$e(e,t,e,t,s),$e(e,t,n,r,l),pe(s),pe(l),_?(m=+(0|_),b=s,n=d=0|i[s>>2],r=f=0|i[(y=s+4|0)>>2],s=p=0|i[(x=s+8|0)>>2],g=+((0|i[l>>2])-d|0)/m,v=+((0|i[l+4>>2])-f|0)/m,m=+((0|i[l+8>>2])-p|0)/m):(y=r=s+4|0,x=p=s+8|0,b=s,n=0|i[s>>2],r=0|i[r>>2],s=0|i[p>>2],g=0,v=0,m=0),i[w>>2]=n,i[(p=w+4|0)>>2]=r,i[(f=w+8|0)>>2]=s,d=0;;){M=g*(u=+(0|d))+ +(0|n),c=v*u+ +(0|i[y>>2]),u=m*u+ +(0|i[x>>2]),r=~~+Tt(+M),l=~~+Tt(+c),n=~~+Tt(+u),M=+A(+(+(0|r)-M)),c=+A(+(+(0|l)-c)),u=+A(+(+(0|n)-u));do{if(!(M>c&M>u)){if(h=0-r|0,c>u){s=h-n|0;break}s=l,n=h-l|0;break}r=0-(l+n)|0,s=l}while(0);if(i[w>>2]=r,i[p>>2]=s,i[f>>2]=n,me(w),et(e,t,w,o+(d<<3)|0),(0|d)==(0|_))break;d=d+1|0,n=0|i[b>>2]}return P=a,0|(w=0)}return P=a,0|(w=-1)},_h3LineSize:function(e,t,n,r){var i,o,a;return n|=0,r|=0,a=P,P=P+32|0,o=a,e=0==(0|$e(e|=0,t|=0,e,t,i=a+12|0))&&0==(0|$e(e,t,n,r,o))?0|he(i,o):-1,P=a,(e>>>31^1)+e|0},_h3SetToLinkedGeo:function(e,t,n){n|=0;var r,o,a,s=0;if(a=P,P=P+32|0,r=a,function(e,t,n){e|=0,n|=0;var r,o,a=0,s=0,A=0,l=0,c=0;if(o=P,P=P+176|0,r=o,(0|(t|=0))<1)return lt(n,0,0),void(P=o);l=0|Mt(0|i[(l=e)>>2],0|i[l+4>>2],52),w(),lt(n,(0|t)>6?t:6,15&l),l=0;do{if(je(0|i[(a=e+(l<<3)|0)>>2],0|i[a+4>>2],r),(0|(a=0|i[r>>2]))>0){c=0;do{A=r+8+(c<<4)|0,(s=0|ft(n,a=r+8+(((0|(c=c+1|0))%(0|a)|0)<<4)|0,A))?ht(n,s):dt(n,A,a),a=0|i[r>>2]}while((0|c)<(0|a))}l=l+1|0}while((0|l)!=(0|t));P=o}(e|=0,t|=0,o=a+16|0),i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,!(e=0|ut(o)))return Je(n),ct(o),void(P=a);do{t=0|Xe(n);do{Ze(t,e),s=e+16|0,i[r>>2]=i[s>>2],i[r+4>>2]=i[s+4>>2],i[r+8>>2]=i[s+8>>2],i[r+12>>2]=i[s+12>>2],ht(o,e),e=0|pt(o,r)}while(0!=(0|e));e=0|ut(o)}while(0!=(0|e));Je(n),ct(o),P=a},_h3ToCenterChild:function(e,t,n){n|=0;var r=0,i=0;if(r=0|Mt(0|(e|=0),0|(t|=0),52),w(),(0|n)<16&(0|(r&=15))<=(0|n)){if((0|r)!=(0|n)&&(e|=i=0|St(0|n,0,52),t=0|w()|-15728641&t,(0|r)<(0|n)))do{i=0|St(7,0,3*(14-r|0)|0),r=r+1|0,e&=~i,t&=~(0|w())}while((0|r)<(0|n))}else t=0,e=0;return _(0|t),0|e},_h3ToChildren:De,_h3ToGeo:Ve,_h3ToGeoBoundary:je,_h3ToParent:qe,_h3UnidirectionalEdgeIsValid:function(e,t){var n=0;if(!(!0&268435456==(2013265920&(t|=0)|0)))return 0|(n=0);switch(n=0|Mt(0|(e|=0),0|t,56),w(),7&n){case 0:case 7:return 0|(n=0)}return!0&16777216==(117440512&t|0)&0!=(0|Ie(e,n=-2130706433&t|134217728))?0|(n=0):0|(n=0|Le(e,n))},_hexAreaKm2:function(e){return+ +o[20496+((e|=0)<<3)>>3]},_hexAreaM2:function(e){return+ +o[20624+((e|=0)<<3)>>3]},_hexRing:function(e,t,n,r){e|=0,t|=0,r|=0;var o,a=0,s=0,A=0,l=0,c=0,u=0,h=0;if(o=P,P=P+16|0,h=o,!(n|=0))return i[(h=r)>>2]=e,i[h+4>>2]=t,P=o,0|(h=0);i[h>>2]=0;e:do{if(0|Ie(e,t))e=1;else{if(s=(0|n)>0){a=0,u=e;do{if(0==(0|(u=0|I(u,t,4,h)))&0==(0|(t=0|w()))){e=2;break e}if(a=a+1|0,0|Ie(u,t)){e=1;break e}}while((0|a)<(0|n));if(i[(c=r)>>2]=u,i[c+4>>2]=t,c=n+-1|0,s){s=0,A=1,a=u,e=t;do{if(0==(0|(a=0|I(a,e,2,h)))&0==(0|(e=0|w()))){e=2;break e}if(i[(l=r+(A<<3)|0)>>2]=a,i[l+4>>2]=e,A=A+1|0,0|Ie(a,e)){e=1;break e}s=s+1|0}while((0|s)<(0|n));l=0,s=A;do{if(0==(0|(a=0|I(a,e,3,h)))&0==(0|(e=0|w()))){e=2;break e}if(i[(A=r+(s<<3)|0)>>2]=a,i[A+4>>2]=e,s=s+1|0,0|Ie(a,e)){e=1;break e}l=l+1|0}while((0|l)<(0|n));A=0;do{if(0==(0|(a=0|I(a,e,1,h)))&0==(0|(e=0|w()))){e=2;break e}if(i[(l=r+(s<<3)|0)>>2]=a,i[l+4>>2]=e,s=s+1|0,0|Ie(a,e)){e=1;break e}A=A+1|0}while((0|A)<(0|n));A=0;do{if(0==(0|(a=0|I(a,e,5,h)))&0==(0|(e=0|w()))){e=2;break e}if(i[(l=r+(s<<3)|0)>>2]=a,i[l+4>>2]=e,s=s+1|0,0|Ie(a,e)){e=1;break e}A=A+1|0}while((0|A)<(0|n));A=0;do{if(0==(0|(a=0|I(a,e,4,h)))&0==(0|(e=0|w()))){e=2;break e}if(i[(l=r+(s<<3)|0)>>2]=a,i[l+4>>2]=e,s=s+1|0,0|Ie(a,e)){e=1;break e}A=A+1|0}while((0|A)<(0|n));for(A=0;;){if(0==(0|(a=0|I(a,e,6,h)))&0==(0|(e=0|w()))){e=2;break e}if((0|A)!=(0|c)){if(i[(l=r+(s<<3)|0)>>2]=a,i[l+4>>2]=e,0|Ie(a,e)){e=1;break e}s=s+1|0}if((0|(A=A+1|0))>=(0|n)){A=u,s=t;break}}}else A=u,a=u,s=t,e=t}else i[(A=r)>>2]=e,i[A+4>>2]=t,A=e,a=e,s=t,e=t;e=1&((0|A)!=(0|a)|(0|s)!=(0|e))}}while(0);return P=o,0|(h=e)},_i64Subtract:xt,_kRing:L,_kRingDistances:function(e,t,n,r,i){var o;if(0|q(e|=0,t|=0,n|=0,r|=0,i|=0)){if(Rt(0|r,0,(o=1+(0|y(3*n|0,n+1|0))|0)<<3|0),0|i)return Rt(0|i,0,o<<2|0),void D(e,t,n,r,i,o,0);(i=0|yt(o,4))&&(D(e,t,n,r,i,o,0),vt(i))}},_llvm_minnum_f64:Et,_llvm_round_f64:Tt,_malloc:gt,_maxFaceCount:function(e,t){var n=0,r=0;if(r=0|Mt(0|(e|=0),0|(t|=0),45),w(),!(0|B(127&r)))return 0|(r=2);if(r=0|Mt(0|e,0|t,52),w(),!(r&=15))return 0|(r=5);for(n=1;;){if(!(0==((0|St(7,0,3*(15-n|0)|0))&e|0)&0==((0|w())&t|0))){n=2,e=6;break}if(!(n>>>0>>0)){n=5,e=6;break}n=n+1|0}return 6==(0|e)?0|n:0},_maxH3ToChildrenSize:function(e,t,n){return n|=0,e=0|Mt(0|(e|=0),0|(t|=0),52),w(),(0|n)<16&(0|(e&=15))<=(0|n)?0|(n=0|tt(7,n-e|0)):0|(n=0)},_maxKringSize:function(e){return 1+(0|y(3*(e|=0)|0,e+1|0))|0},_maxPolyfillSize:function(e,t){t|=0;var n,r=0,o=0,a=0,s=0,A=0;if(n=P,P=P+48|0,a=n+8|0,o=n,s=0|i[(A=e|=0)+4>>2],i[(r=o)>>2]=i[A>>2],i[r+4>>2]=s,rt(o,a),a=0|j(a,t),t=0|i[o>>2],(0|(o=0|i[e+8>>2]))<=0)return P=n,0|(A=(A=(s=(0|a)<(0|(A=t)))?A:a)+12|0);r=0|i[e+12>>2],e=0;do{t=(0|i[r+(e<<3)>>2])+t|0,e=e+1|0}while((0|e)<(0|o));return P=n,0|(A=(A=(A=(0|a)<(0|t))?t:a)+12|0)},_maxUncompactSize:function(e,t,n){e|=0,n|=0;var r=0,o=0,a=0,s=0;if((0|(t|=0))<=0)return 0|(n=0);if((0|n)>=16){for(r=0;;){if(!(0==(0|i[(s=e+(r<<3)|0)>>2])&0==(0|i[s+4>>2]))){r=-1,o=13;break}if((0|(r=r+1|0))>=(0|t)){r=0,o=13;break}}if(13==(0|o))return 0|r}r=0,s=0;e:for(;;){a=0|i[(o=e+(s<<3)|0)>>2],o=0|i[o+4>>2];do{if(!(0==(0|a)&0==(0|o))){if(o=0|Mt(0|a,0|o,52),w(),(0|(o&=15))>(0|n)){r=-1,o=13;break e}if((0|o)==(0|n)){r=r+1|0;break}r=(0|tt(7,n-o|0))+r|0;break}}while(0);if((0|(s=s+1|0))>=(0|t)){o=13;break}}return 13==(0|o)?0|r:0},_memcpy:Ct,_memset:Rt,_numHexagons:function(e){var t;return e=0|i[(t=21008+((e|=0)<<3)|0)>>2],_(0|i[t+4>>2]),0|e},_pentagonIndexCount:function(){return 12},_pointDistKm:Ce,_pointDistM:function(e,t){e|=0;var n,r,i,a=0;return r=+o[(t|=0)>>3],n=+o[e>>3],a=(i=+h(.5*(r-n)))*i+(a=+h(.5*(+o[t+8>>3]-+o[e+8>>3])))*(+u(+r)*+u(+n)*a),2*+g(+ +l(+a),+ +l(+(1-a)))*6371.007180918475*1e3},_pointDistRads:function(e,t){e|=0;var n,r,i,a=0;return r=+o[(t|=0)>>3],n=+o[e>>3],a=(i=+h(.5*(r-n)))*i+(a=+h(.5*(+o[t+8>>3]-+o[e+8>>3])))*(+u(+r)*+u(+n)*a),2*+g(+ +l(+a),+ +l(+(1-a)))},_polyfill:function(e,t,n){var r,o=0,a=0,s=0,A=0,l=0;if(r=P,P=P+48|0,o=r+8|0,a=r,0|function(e,t,n){t|=0,n|=0;var r=0,o=0,a=0,s=0,A=0,l=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,y=0,x=0,b=0,_=0,S=0,E=0,T=0,C=0,R=0,L=0,I=0,B=0,k=0,N=0,z=0;z=P,P=P+112|0,I=z+80|0,l=z+72|0,B=z,k=z+56|0,(N=0|gt(32+(i[(c=(e=e|0)+8|0)>>2]<<5)|0))||M(22848,22448,800,22456);if(it(e,N),r=0|i[(a=e)+4>>2],i[(A=l)>>2]=i[a>>2],i[A+4>>2]=r,rt(l,I),A=0|j(I,t),r=0|i[l>>2],(0|(a=0|i[c>>2]))>0){s=0|i[e+12>>2],o=0;do{r=(0|i[s+(o<<3)>>2])+r|0,o=o+1|0}while((0|o)!=(0|a))}if(o=0|yt(L=(A=(0|A)<(0|r)?r:A)+12|0,8),u=0|yt(L,8),i[I>>2]=0,R=0|i[(C=e)+4>>2],i[(r=l)>>2]=i[C>>2],i[r+4>>2]=R,0|(r=0|O(l,L,t,I,o,u)))return vt(o),vt(u),vt(N),P=z,0|(N=r);e:do{if((0|i[c>>2])>0){for(a=e+12|0,r=0;s=0|O((0|i[a>>2])+(r<<3)|0,L,t,I,o,u),r=r+1|0,!(0|s);)if((0|r)>=(0|i[c>>2]))break e;return vt(o),vt(u),vt(N),P=z,0|(N=s)}}while(0);(0|A)>-12&&Rt(0|u,0,((0|L)>1?L:1)<<3|0);e:do{if((0|i[I>>2])>0){R=((0|L)<0)<<31>>31,b=o,_=u,S=o,E=o,T=u,C=o,r=o,g=o,v=u,y=u,x=u,o=u;t:for(;;){for(m=0|i[I>>2],f=0,p=0,a=0;;){A=(s=B)+56|0;do{i[s>>2]=0,s=s+4|0}while((0|s)<(0|A));if(0|q(l=0|i[(t=b+(f<<3)|0)>>2],t=0|i[t+4>>2],1,B,0)){A=(s=B)+56|0;do{i[s>>2]=0,s=s+4|0}while((0|s)<(0|A));0|(s=0|yt(7,4))&&(D(l,t,1,B,s,7,0),vt(s))}d=0;do{u=0|i[(h=B+(d<<3)|0)>>2],h=0|i[h+4>>2];n:do{if(!(0==(0|u)&0==(0|h))){if(l=0|wt(0|u,0|h,0|L,0|R),w(),!(0==(0|(t=0|i[(A=s=n+(l<<3)|0)>>2]))&0==(0|(A=0|i[A+4>>2]))))for(c=0;;){if((0|c)>(0|L))break t;if((0|t)==(0|u)&(0|A)==(0|h))break n;if(0==(0|(t=0|i[(A=s=n+((l=(l+1|0)%(0|L)|0)<<3)|0)>>2]))&0==(0|(A=0|i[A+4>>2])))break;c=c+1|0}0==(0|u)&0==(0|h)||(Ve(u,h,k),0|ot(e,N,k)&&(i[(c=s)>>2]=u,i[c+4>>2]=h,i[(c=_+(a<<3)|0)>>2]=u,i[c+4>>2]=h,a=a+1|0))}}while(0);d=d+1|0}while(d>>>0<7);if((0|(p=p+1|0))>=(0|m))break;f=f+1|0}if((0|m)>0&&Rt(0|S,0,m<<3|0),i[I>>2]=a,!((0|a)>0))break e;u=o,h=x,d=C,f=y,p=v,m=_,o=g,x=r,y=E,v=S,g=u,r=h,C=T,T=d,E=f,S=p,_=b,b=m}return vt(E),vt(T),vt(N),P=z,0|(N=-1)}r=u}while(0);return vt(N),vt(o),vt(r),P=z,0|(N=0)}(e|=0,t|=0,n|=0)){if(s=0|i[(l=e)+4>>2],i[(A=a)>>2]=i[l>>2],i[A+4>>2]=s,rt(a,o),A=0|j(o,t),t=0|i[a>>2],(0|(s=0|i[e+8>>2]))>0){a=0|i[e+12>>2],o=0;do{t=(0|i[a+(o<<3)>>2])+t|0,o=o+1|0}while((0|o)!=(0|s))}(0|(t=(0|A)<(0|t)?t:A))<=-12||Rt(0|n,0,8+(((0|(l=t+11|0))>0?l:0)<<3)|0),P=r}else P=r},_res0IndexCount:function(){return 122},_round:Pt,_sbrk:Lt,_sizeOfCoordIJ:function(){return 8},_sizeOfGeoBoundary:function(){return 168},_sizeOfGeoCoord:function(){return 16},_sizeOfGeoPolygon:function(){return 16},_sizeOfGeofence:function(){return 8},_sizeOfH3Index:function(){return 8},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompact:function(e,t,n,r,o){e|=0,n|=0,r|=0,o|=0;var a=0,s=0,A=0,l=0,c=0,u=0;if((0|(t|=0))<=0)return 0|(o=0);if((0|o)>=16){for(a=0;;){if(!(0==(0|i[(u=e+(a<<3)|0)>>2])&0==(0|i[u+4>>2]))){a=14;break}if((0|(a=a+1|0))>=(0|t)){s=0,a=16;break}}if(14==(0|a))return 0|((0|r)>0?-2:-1);if(16==(0|a))return 0|s}a=0,u=0;e:for(;;){s=0|i[(A=c=e+(u<<3)|0)>>2],A=0|i[A+4>>2];do{if(!(0==(0|s)&0==(0|A))){if((0|a)>=(0|r)){s=-1,a=16;break e}if(l=0|Mt(0|s,0|A,52),w(),(0|(l&=15))>(0|o)){s=-2,a=16;break e}if((0|l)==(0|o)){i[(c=n+(a<<3)|0)>>2]=s,i[c+4>>2]=A,a=a+1|0;break}if((0|(s=(0|tt(7,o-l|0))+a|0))>(0|r)){s=-1,a=16;break e}De(0|i[c>>2],0|i[c+4>>2],o,n+(a<<3)|0),a=s}}while(0);if((0|(u=u+1|0))>=(0|t)){s=0,a=16;break}}return 16==(0|a)?0|s:0},establishStackSpace:function(e,t){P=e|=0},stackAlloc:function(e){var t;return t=P,P=(P=P+(e|=0)|0)+15&-16,0|t},stackRestore:function(e){P=e|=0},stackSave:function(){return 0|P}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{a:ve,b:function(e){g=e},c:v,d:function(e,t,n,r){ve("Assertion failed: "+L(e)+", at: "+[t?L(t):"unknown filename",n,r?L(r):"unknown function"])},e:function(e){return n.___errno_location&&(T[n.___errno_location()>>2]=e),e},f:ee,g:function(e,t,n){S.set(S.subarray(t,t+n),e)},h:function(e){var t=ee(),n=16777216,r=2130706432;if(e>r)return!1;for(var i=Math.max(t,16777216);i>0]=t;break;case"i16":E[e>>1]=t;break;case"i32":T[e>>2]=t;break;case"i64":Q=[t>>>0,(W=t,+U(W)>=1?W>0?(0|G(+H(W/4294967296),4294967295))>>>0:~~+F((W-+(~~W>>>0))/4294967296)>>>0:0)],T[e>>2]=Q[0],T[e+4>>2]=Q[1];break;case"float":C[e>>2]=t;break;case"double":R[e>>3]=t;break;default:ve("invalid type for setValue: "+n)}},n.getValue=function(e,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return M[e>>0];case"i16":return E[e>>1];case"i32":case"i64":return T[e>>2];case"float":return C[e>>2];case"double":return R[e>>3];default:ve("invalid type for getValue: "+t)}return null},n.getTempRet0=v,Y)if(Z(Y)||(se=Y,Y=n.locateFile?n.locateFile(se,f):f+se),a||A){var he=u(Y);S.set(he,8)}else{V++,n.monitorRunDependencies&&n.monitorRunDependencies(V);var de=function(e){e.byteLength&&(e=new Uint8Array(e)),S.set(e,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(e){if(V--,n.monitorRunDependencies&&n.monitorRunDependencies(V),0==V&&j){var t=j;j=null,t()}}()},fe=function(){c(Y,de,(function(){throw"could not load memory initializer "+Y}))},pe=ie(Y);if(pe)de(pe.buffer);else if(n.memoryInitializerRequest){var me=function(){var e=n.memoryInitializerRequest,t=e.response;if(200!==e.status&&0!==e.status){var r=ie(n.memoryInitializerRequestURL);if(!r)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+e.status+", retrying "+Y),void fe();t=r.buffer}de(t)};n.memoryInitializerRequest.response?setTimeout(me,0):n.memoryInitializerRequest.addEventListener("load",me)}else fe()}function ge(e){function t(){Ae||(Ae=!0,y||(O(k),O(N),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)e=n.postRun.shift(),z.unshift(e);var e;O(z)}()))}V>0||(!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)e=n.preRun.shift(),B.unshift(e);var e;O(B)}(),V>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),t()}),1)):t()))}function ve(e){throw n.onAbort&&n.onAbort(e),p(e+=""),m(e),y=!0,"abort("+e+"). Build with -s ASSERTIONS=1 for more info."}if(j=function e(){Ae||ge(),Ae||(j=e)},n.run=ge,n.abort=ve,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return ge(),e}("object"==typeof Rm?Rm:{}),Pm="number",Lm={}; /* * Copyright 2018-2019 Uber Technologies, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */[["sizeOfH3Index",Pm],["sizeOfGeoCoord",Pm],["sizeOfGeoBoundary",Pm],["sizeOfGeoPolygon",Pm],["sizeOfGeofence",Pm],["sizeOfLinkedGeoPolygon",Pm],["sizeOfCoordIJ",Pm],["h3IsValid",Pm,[Pm,Pm]],["geoToH3",Pm,[Pm,Pm,Pm]],["h3ToGeo",null,[Pm,Pm,Pm]],["h3ToGeoBoundary",null,[Pm,Pm,Pm]],["maxKringSize",Pm,[Pm]],["kRing",null,[Pm,Pm,Pm,Pm]],["kRingDistances",null,[Pm,Pm,Pm,Pm,Pm]],["hexRing",null,[Pm,Pm,Pm,Pm]],["maxPolyfillSize",Pm,[Pm,Pm]],["polyfill",null,[Pm,Pm,Pm]],["h3SetToLinkedGeo",null,[Pm,Pm,Pm]],["destroyLinkedPolygon",null,[Pm]],["compact",Pm,[Pm,Pm,Pm]],["uncompact",Pm,[Pm,Pm,Pm,Pm,Pm]],["maxUncompactSize",Pm,[Pm,Pm,Pm]],["h3IsPentagon",Pm,[Pm,Pm]],["h3IsResClassIII",Pm,[Pm,Pm]],["h3GetBaseCell",Pm,[Pm,Pm]],["h3GetResolution",Pm,[Pm,Pm]],["maxFaceCount",Pm,[Pm,Pm]],["h3GetFaces",null,[Pm,Pm,Pm]],["h3ToParent",Pm,[Pm,Pm,Pm]],["h3ToChildren",null,[Pm,Pm,Pm,Pm]],["h3ToCenterChild",Pm,[Pm,Pm,Pm]],["maxH3ToChildrenSize",Pm,[Pm,Pm,Pm]],["h3IndexesAreNeighbors",Pm,[Pm,Pm,Pm,Pm]],["getH3UnidirectionalEdge",Pm,[Pm,Pm,Pm,Pm]],["getOriginH3IndexFromUnidirectionalEdge",Pm,[Pm,Pm]],["getDestinationH3IndexFromUnidirectionalEdge",Pm,[Pm,Pm]],["h3UnidirectionalEdgeIsValid",Pm,[Pm,Pm]],["getH3IndexesFromUnidirectionalEdge",null,[Pm,Pm,Pm]],["getH3UnidirectionalEdgesFromHexagon",null,[Pm,Pm,Pm]],["getH3UnidirectionalEdgeBoundary",null,[Pm,Pm,Pm]],["h3Distance",Pm,[Pm,Pm,Pm,Pm]],["h3Line",Pm,[Pm,Pm,Pm,Pm,Pm]],["h3LineSize",Pm,[Pm,Pm,Pm,Pm]],["experimentalH3ToLocalIj",Pm,[Pm,Pm,Pm,Pm,Pm]],["experimentalLocalIjToH3",Pm,[Pm,Pm,Pm,Pm]],["hexAreaM2",Pm,[Pm]],["hexAreaKm2",Pm,[Pm]],["edgeLengthM",Pm,[Pm]],["edgeLengthKm",Pm,[Pm]],["pointDistM",Pm,[Pm,Pm]],["pointDistKm",Pm,[Pm,Pm]],["pointDistRads",Pm,[Pm,Pm]],["cellAreaM2",Pm,[Pm,Pm]],["cellAreaKm2",Pm,[Pm,Pm]],["cellAreaRads2",Pm,[Pm,Pm]],["exactEdgeLengthM",Pm,[Pm,Pm]],["exactEdgeLengthKm",Pm,[Pm,Pm]],["exactEdgeLengthRads",Pm,[Pm,Pm]],["numHexagons",Pm,[Pm]],["getRes0Indexes",null,[Pm]],["res0IndexCount",Pm],["getPentagonIndexes",null,[Pm,Pm]],["pentagonIndexCount",Pm]].forEach((function(e){Lm[e[0]]=Rm.cwrap.apply(Rm,e)}));var qm=16,Dm=Lm.sizeOfH3Index(),Im=Lm.sizeOfGeoCoord(),Om=Lm.sizeOfGeoBoundary(),Bm=Lm.sizeOfGeoPolygon(),km=Lm.sizeOfGeofence();Lm.sizeOfLinkedGeoPolygon(),Lm.sizeOfCoordIJ();var Nm=/[^0-9a-fA-F]/;function zm(e){if(Array.isArray(e)&&2===e.length&&Number.isInteger(e[0])&&Number.isInteger(e[1]))return e;if("string"!=typeof e||Nm.test(e))return[0,0];var t=parseInt(e.substring(0,e.length-8),qm);return[parseInt(e.substring(e.length-8),qm),t]}function Um(e){if(e>=0)return e.toString(qm);var t=Hm(8,(e&=2147483647).toString(qm));return t=(parseInt(t[0],qm)+8).toString(qm)+t.substring(1)}function Fm(e,t){return Um(t)+Hm(8,Um(e))}function Hm(e,t){for(var n=e-t.length,r="",i=0;i15||Math.floor(e)!==e)throw new Error("Invalid resolution: "+e)}(t),n=Boolean(n),0===e.length||0===e[0].length)return[];"number"==typeof e[0][0]&&(e=[e]);var r=function(e,t){var n,r=e.length-1,i=Rm._calloc(Bm),o=0+km,a=o+4;if(Gm(e[0],i+0,t),r>0){n=Rm._calloc(r,km);for(var s=0;s0){for(var i=Rm.getValue(e+n,"i32"),o=0;o\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\t\tvarying vec4 worldPos;\n\t\tvarying vec3 worldStart;\n\t\tvarying vec3 worldEnd;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\tworldStart = start.xyz;\n\t\t\tworldEnd = end.xyz;\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec3 ndcStart = clipStart.xyz / clipStart.w;\n\t\t\tvec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd.xy - ndcStart.xy;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// get the offset direction as perpendicular to the view vector\n\t\t\t\tvec3 worldDir = normalize( end.xyz - start.xyz );\n\t\t\t\tvec3 offset;\n\t\t\t\tif ( position.y < 0.5 ) {\n\n\t\t\t\t\toffset = normalize( cross( start.xyz, worldDir ) );\n\n\t\t\t\t} else {\n\n\t\t\t\t\toffset = normalize( cross( end.xyz, worldDir ) );\n\n\t\t\t\t}\n\n\t\t\t\t// sign flip\n\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\tfloat forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );\n\n\t\t\t\t// don't extend the line if we're rendering dashes because we\n\t\t\t\t// won't be rendering the endcaps\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t// extend the line bounds to encompass endcaps\n\t\t\t\t\tstart.xyz += - worldDir * linewidth * 0.5;\n\t\t\t\t\tend.xyz += worldDir * linewidth * 0.5;\n\n\t\t\t\t\t// shift the position of the quad so it hugs the forward edge of the line\n\t\t\t\t\toffset.xy -= dir * forwardOffset;\n\t\t\t\t\toffset.z += 0.5;\n\n\t\t\t\t#endif\n\n\t\t\t\t// endcaps\n\t\t\t\tif ( position.y > 1.0 || position.y < 0.0 ) {\n\n\t\t\t\t\toffset.xy += dir * 2.0 * forwardOffset;\n\n\t\t\t\t}\n\n\t\t\t\t// adjust for linewidth\n\t\t\t\toffset *= linewidth * 0.5;\n\n\t\t\t\t// set the world position\n\t\t\t\tworldPos = ( position.y < 0.5 ) ? start : end;\n\t\t\t\tworldPos.xyz += offset;\n\n\t\t\t\t// project the worldpos\n\t\t\t\tvec4 clip = projectionMatrix * worldPos;\n\n\t\t\t\t// shift the depth of the projected points so the line\n\t\t\t\t// segements overlap neatly\n\t\t\t\tvec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;\n\t\t\t\tclip.z = clipPose.z * clip.w;\n\n\t\t\t#else\n\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\t#endif\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform float linewidth;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashOffset;\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\t\tvarying vec4 worldPos;\n\t\tvarying vec3 worldStart;\n\t\tvarying vec3 worldEnd;\n\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tvarying vec2 vUv;\n\n\t\tvec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {\n\n\t\t\tfloat mua;\n\t\t\tfloat mub;\n\n\t\t\tvec3 p13 = p1 - p3;\n\t\t\tvec3 p43 = p4 - p3;\n\n\t\t\tvec3 p21 = p2 - p1;\n\n\t\t\tfloat d1343 = dot( p13, p43 );\n\t\t\tfloat d4321 = dot( p43, p21 );\n\t\t\tfloat d1321 = dot( p13, p21 );\n\t\t\tfloat d4343 = dot( p43, p43 );\n\t\t\tfloat d2121 = dot( p21, p21 );\n\n\t\t\tfloat denom = d2121 * d4343 - d4321 * d4321;\n\n\t\t\tfloat numer = d1343 * d4321 - d1321 * d4343;\n\n\t\t\tmua = numer / denom;\n\t\t\tmua = clamp( mua, 0.0, 1.0 );\n\t\t\tmub = ( d1343 + d4321 * ( mua ) ) / d4343;\n\t\t\tmub = clamp( mub, 0.0, 1.0 );\n\n\t\t\treturn vec2( mua, mub );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#include \n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tfloat alpha = opacity;\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// Find the closest points on the view ray and the line segment\n\t\t\t\tvec3 rayEnd = normalize( worldPos.xyz ) * 1e5;\n\t\t\t\tvec3 lineDir = worldEnd - worldStart;\n\t\t\t\tvec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );\n\n\t\t\t\tvec3 p1 = worldStart + lineDir * params.x;\n\t\t\t\tvec3 p2 = rayEnd * params.y;\n\t\t\t\tvec3 delta = p1 - p2;\n\t\t\t\tfloat len = length( delta );\n\t\t\t\tfloat norm = len / linewidth;\n\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t#ifdef ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\tfloat dnorm = fwidth( norm );\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tif ( norm > 0.5 ) {\n\n\t\t\t\t\t\t\tdiscard;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\t#else\n\n\t\t\t\t#ifdef ALPHA_TO_COVERAGE\n\n\t\t\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\tfloat len2 = a * a + b * b;\n\t\t\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t#else\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t#include \n\t\t\t#include \n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\n\t\t}\n\t\t"};class ag extends og.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:og.UniformsUtils.clone(og.ShaderLib.line.uniforms),vertexShader:og.ShaderLib.line.vertexShader,fragmentShader:og.ShaderLib.line.fragmentShader,clipping:!0}),Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(e){!0===e?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashed:{enumerable:!0,get:function(){return Boolean("USE_DASH"in this.defines)},set(e){Boolean(e)!==Boolean("USE_DASH"in this.defines)&&(this.needsUpdate=!0),!0===e?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},alphaToCoverage:{enumerable:!0,get:function(){return Boolean("ALPHA_TO_COVERAGE"in this.defines)},set:function(e){Boolean(e)!==Boolean("ALPHA_TO_COVERAGE"in this.defines)&&(this.needsUpdate=!0),!0===e?(this.defines.ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}}ag.prototype.isLineMaterial=!0;const sg=window.THREE?window.THREE:{Box3:ze,BufferGeometry:dn,InstancedInterleavedBuffer:GA,InterleavedBufferAttribute:Vo,Line3:XA,MathUtils:pe,Matrix4:dt,Mesh:Ln,Sphere:it,Vector3:Be,Vector4:qe};var Ag=(new sg.BufferGeometry).setAttribute?"setAttribute":"addAttribute";const lg=new sg.Vector3,cg=new sg.Vector3,ug=new sg.Vector4,hg=new sg.Vector4,dg=new sg.Vector4,fg=new sg.Vector3,pg=new sg.Matrix4,mg=new sg.Line3,gg=new sg.Vector3,vg=new sg.Box3,yg=new sg.Sphere,xg=new sg.Vector4;class bg extends sg.Mesh{constructor(e=new ig,t=new ag({color:16777215*Math.random()})){super(e,t),this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,r=new Float32Array(2*t.count);for(let e=0,i=0,o=t.count;ed&&hg.z>d)continue;if(ug.z>d){const e=ug.z-hg.z,t=(ug.z-d)/e;ug.lerp(hg,t)}else if(hg.z>d){const e=hg.z-ug.z,t=(hg.z-d)/e;hg.lerp(ug,t)}ug.applyMatrix4(o),hg.applyMatrix4(o),ug.multiplyScalar(1/ug.w),hg.multiplyScalar(1/hg.w),ug.x*=l.x/2,ug.y*=l.y/2,hg.x*=l.x/2,hg.y*=l.y/2,mg.start.copy(ug),mg.start.z=0,mg.end.copy(hg),mg.end.z=0;const n=mg.closestPointToPointParameter(fg,!0);mg.at(n,gg);const i=sg.MathUtils.lerp(ug.z,hg.z,n),s=i>=-1&&i<=1,A=fg.distanceTo(gg)<.5*c;if(s&&A){mg.start.fromBufferAttribute(u,e),mg.end.fromBufferAttribute(h,e),mg.start.applyMatrix4(a),mg.end.applyMatrix4(a);const n=new sg.Vector3,i=new sg.Vector3;r.distanceSqToSegment(mg.start,mg.end,i,n),t.push({point:i,pointOnLine:n,distance:r.origin.distanceTo(i),object:this,face:null,faceIndex:e,uv:null,uv2:null})}}}}}bg.prototype.LineSegments2=!0;class _g extends ig{constructor(){super(),this.type="LineGeometry"}setPositions(e){for(var t=e.length-3,n=new Float32Array(2*t),r=0;r=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}function zg(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ug(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return zg(e)}function Fg(e){var t=Bg();return function(){var n,r=Ig(e);if(t){var i=Ig(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Ug(this,n)}}function Hg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||Vg(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gg(e){return function(e){if(Array.isArray(e))return jg(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Vg(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vg(e,t){if(e){if("string"==typeof e)return jg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jg(e,t):void 0}}function jg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?i-1:0),a=1;a2&&void 0!==arguments[2]?arguments[2]:0,r=(90-e)*Math.PI/180,i=(90-t)*Math.PI/180,o=Zg*(1+n);return{x:o*Math.sin(r)*Math.cos(i),y:o*Math.cos(r),z:o*Math.sin(r)*Math.sin(i)}}function Kg(e){var t=e.x,n=e.y,r=e.z,i=Math.sqrt(t*t+n*n+r*r),o=Math.acos(n/i),a=Math.atan2(r,t);return{lat:90-180*o/Math.PI,lng:90-180*a/Math.PI-(a<-Math.PI/2?360:0),altitude:i/Zg-1}}var $g=window.THREE?window.THREE:{BackSide:1,BufferAttribute:tn,Color:Ee,Mesh:Ln,ShaderMaterial:kn},ev={backside:!0,coefficient:.5,color:"gold",size:2,power:1};function tv(e,t,n){return new $g.ShaderMaterial({depthWrite:!1,fragmentShader:"\nuniform vec3 color;\nuniform float coefficient;\nuniform float power;\nvarying vec3 vVertexNormal;\nvarying vec3 vVertexWorldPosition;\nvoid main() {\n vec3 worldCameraToVertex = vVertexWorldPosition - cameraPosition;\n vec3 viewCameraToVertex\t= (viewMatrix * vec4(worldCameraToVertex, 0.0)).xyz;\n viewCameraToVertex = normalize(viewCameraToVertex);\n float intensity\t= pow(\n coefficient + dot(vVertexNormal, viewCameraToVertex),\n power\n );\n gl_FragColor = vec4(color, intensity);\n}",transparent:!0,uniforms:{coefficient:{value:e},color:{value:new $g.Color(t)},power:{value:n}},vertexShader:"\nvarying vec3 vVertexWorldPosition;\nvarying vec3 vVertexNormal;\nvoid main() {\n vVertexNormal\t= normalize(normalMatrix * normal);\n vVertexWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n gl_Position\t= projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"})}function nv(e,t){for(var n=e.clone(),r=new Float32Array(3*e.attributes.position.count),i=0,o=r.length;i1&&void 0!==arguments[1]?arguments[1]:ev,n=t.backside,r=t.coefficient,i=t.color,o=t.size,a=t.power,s=nv(e,o),A=tv(r,i,a);return n&&(A.side=$g.BackSide),new $g.Mesh(s,A)}(e.globeObj.geometry,{backside:!0,color:e.atmosphereColor,size:Zg*e.atmosphereAltitude,power:3.5,coefficient:.1});r.visible=!!e.showAtmosphere,r.__globeObjType="atmosphere",e.scene.add(r)}e.ready||e.globeImageUrl||(e.ready=!0,e.onReady())}}),ov=function(e){return isNaN(e)?parseInt(Rd(e).toHex(),16):e},av=function(e){return isNaN(e)?Rd(e).getAlpha():1},sv=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=Rd(e).toRgb(),r=["r","g","b"].map((function(e){return n[e]/255}));return t?[].concat(Gg(r),[n.a]):r};function Av(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.removeDelay,o=void 0===i?0:i;return jd(e,t.children,(function(e){return t.add(e)}),(function(e){var n=function(){t.remove(e),Yg(e),e&&e.hasOwnProperty("__data")&&delete e.__data.__currentTargetD};o?setTimeout(n,o):n()}),Cg({objBindAttr:"__threeObj"},n))}var lv=window.THREE?window.THREE:{BufferAttribute:tn,BufferGeometry:dn,Color:Ee,CylinderBufferGeometry:Ia,Matrix4:dt,Mesh:Ln,MeshBasicMaterial:Kt,MeshLambertMaterial:zs,Object3D:Nt,Vector3:Be},cv=Object.assign({},Ed),uv=cv.BufferGeometryUtils||cv,hv=(new lv.BufferGeometry).applyMatrix4?"applyMatrix4":"applyMatrix",dv=ll({props:{pointsData:{default:[]},pointLat:{default:"lat"},pointLng:{default:"lng"},pointColor:{default:function(){return"#ffffaa"}},pointAltitude:{default:.1},pointRadius:{default:.25},pointResolution:{default:12,triggerUpdate:!1},pointsMerge:{default:!1},pointsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t){Yg(e),t.scene=e},update:function(e){var t=Td(e.pointLat),n=Td(e.pointLng),r=Td(e.pointAltitude),i=Td(e.pointRadius),o=Td(e.pointColor),a=new lv.CylinderBufferGeometry(1,1,1,e.pointResolution);a[hv]((new lv.Matrix4).makeRotationX(Math.PI/2)),a[hv]((new lv.Matrix4).makeTranslation(0,0,-.5));var s=2*Math.PI*Zg/360,A={},l=e.pointsMerge?new lv.Object3D:e.scene;if(Av(e.pointsData,l,{createObj:function(){var e=new lv.Mesh(a);return e.__globeObjType="point",e},updateObj:function(a,l){var c=function(t){var n=a.__currentTargetD=t,r=n.r,i=n.alt,o=n.lat,A=n.lng;Object.assign(a.position,Jg(o,A));var l=e.pointsMerge?new lv.Vector3(0,0,0):e.scene.localToWorld(new lv.Vector3(0,0,0));a.lookAt(l),a.scale.x=a.scale.y=Math.min(30,r)*s,a.scale.z=Math.max(i*Zg,.1)},u={alt:+r(l),r:+i(l),lat:+t(l),lng:+n(l)},h=a.__currentTargetD||Object.assign({},u,{alt:-.001});Object.keys(u).some((function(e){return h[e]!==u[e]}))&&(e.pointsMerge||!e.pointsTransitionDuration||e.pointsTransitionDuration<0?c(u):new Sl.Tween(h).to(u,e.pointsTransitionDuration).easing(Sl.Easing.Quadratic.InOut).onUpdate(c).start());if(!e.pointsMerge){var d=o(l),f=d?av(d):0,p=!!f;a.visible=p,p&&(A.hasOwnProperty(d)||(A[d]=new lv.MeshLambertMaterial({color:ov(d),transparent:f<1,opacity:f})),a.material=A[d])}}}),e.pointsMerge){var c=e.pointsData.length?uv.mergeBufferGeometries(e.pointsData.map((function(e){var t=e.__threeObj;e.__threeObj=void 0;var n=t.geometry.clone();t.updateMatrix(),n[hv](t.matrix);for(var r=new lv.Color(o(e)),i=n.attributes.position.count,a=new Float32Array(3*i),s=0,A=i;s dashSize) discard;\n \n // set px color: [r, g, b, a], interpolated between vertices \n gl_FragColor = vColor; \n }\n "},vv=ll({props:{arcsData:{default:[]},arcStartLat:{default:"startLat"},arcStartLng:{default:"startLng"},arcEndLat:{default:"endLat"},arcEndLng:{default:"endLng"},arcColor:{default:function(){return"#ffffaa"}},arcAltitude:{},arcAltitudeAutoScale:{default:.5},arcStroke:{},arcCurveResolution:{default:64,triggerUpdate:!1},arcCircularResolution:{default:6,triggerUpdate:!1},arcDashLength:{default:1},arcDashGap:{default:0},arcDashInitialGap:{default:0},arcDashAnimateTime:{default:0},arcsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t){Yg(e),t.scene=e,(new Qd).onTick.add((function(e,n){t.arcsData.filter((function(e){return e.__threeObj&&e.__threeObj.children.length&&e.__threeObj.children[0].material&&e.__threeObj.children[0].__dashAnimateStep})).forEach((function(e){var t=e.__threeObj.children[0],r=t.__dashAnimateStep*n,i=t.material.uniforms.dashTranslate.value%1e9;t.material.uniforms.dashTranslate.value=i+r}))}))},update:function(e){var t=Td(e.arcStartLat),n=Td(e.arcStartLng),r=Td(e.arcEndLat),i=Td(e.arcEndLng),o=Td(e.arcAltitude),a=Td(e.arcAltitudeAutoScale),s=Td(e.arcStroke),A=Td(e.arcColor),l=Td(e.arcDashLength),c=Td(e.arcDashGap),u=Td(e.arcDashInitialGap),h=Td(e.arcDashAnimateTime),d=new pv.ShaderMaterial(Cg(Cg({},gv),{},{transparent:!0,blending:pv.NormalBlending}));Av(e.arcsData,e.scene,{createObj:function(){var e=new pv.Group;return e.__globeObjType="arc",e},updateObj:function(f,p){var m=s(p),g=null!=m;if(!f.children.length||g!==("Mesh"===f.children[0].type)){Yg(f);var v=g?new pv.Mesh:new pv.Line(new pv.BufferGeometry);v.material=d.clone(),f.add(v)}var y=f.children[0];Object.assign(y.material.uniforms,{dashSize:{value:l(p)},gapSize:{value:c(p)},dashOffset:{value:u(p)}});var x=h(p);y.__dashAnimateStep=x>0?1e3/x:0;var b=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=t+1;if(e instanceof Array||e instanceof Function){var o=e instanceof Array?pp().domain(e.map((function(t,n){return n/(e.length-1)}))).range(e):e;n=function(e){return sv(o(e))}}else{var a=sv(e);n=function(){return a}}for(var s=new pv.Float32BufferAttribute(4*i*r,4),A=0,l=i;A1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e+1,i=r*t,o=new pv.Float32BufferAttribute(i,1),a=0,s=r;a170&&(e[0]+=n>t?360:-360)})),t.__globeObjType="hexbin",t},updateObj:function(t,n){var r=Math.max(0,Math.min(1,+s(n))),A=Hg(t.__hexCenter,2),l=A[0],u=A[1],h=0===r?t.__hexGeoJson:t.__hexGeoJson.map((function(e){var t=Hg(e,2),n=t[0],i=t[1];return[[n,u],[i,l]].map((function(e){var t=Hg(e,2);return function(e,t,n){return e-(e-t)*n}(t[0],t[1],r)}))})),d=e.hexTopCurvatureResolution;t.geometry=new Cm([h],0,Zg,!1,!0,!0,d);var f={alt:+i(n)},p=function(e){var n=(t.__currentTargetD=e).alt;t.scale.x=t.scale.y=t.scale.z=1+n},m=t.__currentTargetD||Object.assign({},f,{alt:-.001});Object.keys(f).some((function(e){return m[e]!==f[e]}))&&(e.hexBinMerge||!e.hexTransitionDuration||e.hexTransitionDuration<0?p(f):new Sl.Tween(m).to(f,e.hexTransitionDuration).easing(Sl.Easing.Quadratic.InOut).onUpdate(p).start());if(!e.hexBinMerge){var g=a(n),v=o(n);[g,v].forEach((function(e){if(!c.hasOwnProperty(e)){var t=av(e);c[e]=new yv.MeshLambertMaterial({color:ov(e),transparent:t<1,opacity:t,side:yv.DoubleSide})}})),t.material=[g,v].map((function(e){return c[e]}))}},idAccessor:function(e){return e.h3Idx}}),e.hexBinMerge){var u=l.length?bv.mergeBufferGeometries(l.map((function(e){var t=e.__threeObj;e.__threeObj=void 0;var n=t.geometry.toNonIndexed();t.updateMatrix(),n[_v](t.matrix);for(var r=new yv.Color(o(e)),i=new yv.Color(a(e)),s=n.attributes.position.count,A=n.groups[0].count,l=new Float32Array(3*s),c=0,u=s;c=A?r:i;l[h]=d.r,l[h+1]=d.g,l[h+2]=d.b}return n.setAttribute("color",new yv.BufferAttribute(l,3)),n}))):new yv.BufferGeometry,h=new yv.Mesh(u,new yv.MeshBasicMaterial({color:16777215,vertexColors:!0,side:yv.DoubleSide}));h.__globeObjType="hexBinPoints",h.__data=l,Yg(e.scene),e.scene.add(h)}}}),Mv=window.THREE?window.THREE:{DoubleSide:2,Group:Io,LineBasicMaterial:ga,LineSegments:Ea,Mesh:Ln,MeshBasicMaterial:Kt},Sv=ll({props:{polygonsData:{default:[]},polygonGeoJsonGeometry:{default:"geometry"},polygonSideColor:{default:function(){return"#ffffaa"}},polygonSideMaterial:{},polygonCapColor:{default:function(){return"#ffffaa"}},polygonCapMaterial:{},polygonStrokeColor:{},polygonAltitude:{default:.01},polygonCapCurvatureResolution:{default:5},polygonsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t){Yg(e),t.scene=e},update:function(e){var t=Td(e.polygonGeoJsonGeometry),n=Td(e.polygonAltitude),r=Td(e.polygonCapCurvatureResolution),i=Td(e.polygonCapColor),o=Td(e.polygonCapMaterial),a=Td(e.polygonSideColor),s=Td(e.polygonSideMaterial),A=Td(e.polygonStrokeColor),l=[];e.polygonsData.forEach((function(e){var c={data:e,capColor:i(e),capMaterial:o(e),sideColor:a(e),sideMaterial:s(e),strokeColor:A(e),altitude:+n(e),capCurvatureResolution:+r(e)},u=t(e),h=e.__id||"".concat(Math.round(1e9*Math.random()));e.__id=h,"Polygon"===u.type?l.push(Cg({id:"".concat(h,"_0"),coords:u.coordinates},c)):"MultiPolygon"===u.type?l.push.apply(l,Gg(u.coordinates.map((function(e,t){return Cg({id:"".concat(h,"_").concat(t),coords:e},c)})))):console.warn("Unsupported GeoJson geometry type: ".concat(u.type,". Skipping geometry..."))})),Av(l,e.scene,{idAccessor:function(e){return e.id},createObj:function(){var e=new Mv.Group;return e.__defaultSideMaterial=new Mv.MeshBasicMaterial({side:Mv.DoubleSide,depthWrite:!0}),e.__defaultCapMaterial=new Mv.MeshBasicMaterial({side:Mv.DoubleSide,depthWrite:!0}),e.add(new Mv.Mesh(void 0,[e.__defaultSideMaterial,e.__defaultCapMaterial])),e.add(new Mv.LineSegments(void 0,new Mv.LineBasicMaterial)),e.__globeObjType="polygon",e},updateObj:function(t,n){var r=n.coords,i=n.capColor,o=n.capMaterial,a=n.sideColor,s=n.sideMaterial,A=n.strokeColor,l=n.altitude,c=n.capCurvatureResolution,u=Hg(t.children,2),h=u[0],d=u[1],f=!!A;if(d.visible=f,!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return function(e,t){return e===t}};return Object.entries(t).every((function(t){var r=Hg(t,2),i=r[0],o=r[1];return e.hasOwnProperty(i)&&n(i)(e[i],o)}))}(h.geometry.parameters||{},{polygonGeoJson:r,curvatureResolution:c})&&(h.geometry=new Cm(r,0,Zg,!1,!0,!0,c)),f&&(!d.geometry.parameters||d.geometry.parameters.geoJson.coordinates!==r||d.geometry.parameters.resolution!==c)&&(d.geometry=new bd({type:"Polygon",coordinates:r},Zg,c)),h.material[0]=s||t.__defaultSideMaterial,h.material[1]=o||t.__defaultCapMaterial,[!s&&a,!o&&i].forEach((function(e,t){if(e){var n=h.material[t],r=av(e);n.color.set(ov(e)),n.transparent=r<1,n.opacity=r}})),f){var p=d.material,m=av(A);p.color.set(ov(A)),p.transparent=m<1,p.opacity=m}var g={alt:l},v=function(e){var n=(t.__currentTargetD=e).alt;h.scale.x=h.scale.y=h.scale.z=1+n,f&&(d.scale.x=d.scale.y=d.scale.z=1+n+1e-4)},y=t.__currentTargetD||Object.assign({},g,{alt:-.001});Object.keys(g).some((function(e){return y[e]!==g[e]}))&&(!e.polygonsTransitionDuration||e.polygonsTransitionDuration<0||y.alt===g.alt?v(g):new Sl.Tween(y).to(g,e.polygonsTransitionDuration).easing(Sl.Easing.Quadratic.InOut).onUpdate(v).start())}})}});var Ev=window.THREE?window.THREE:{BufferGeometry:dn,DoubleSide:2,Mesh:Ln,MeshLambertMaterial:zs},Tv=Object.assign({},Ed),Cv=Tv.BufferGeometryUtils||Tv,Rv=ll({props:{hexPolygonsData:{default:[]},hexPolygonGeoJsonGeometry:{default:"geometry"},hexPolygonColor:{default:function(){return"#ffffaa"}},hexPolygonAltitude:{default:.001},hexPolygonResolution:{default:3},hexPolygonMargin:{default:.2},hexPolygonCurvatureResolution:{default:5},hexPolygonsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(e,t){Yg(e),t.scene=e},update:function(e){var t=Td(e.hexPolygonGeoJsonGeometry),n=Td(e.hexPolygonColor),r=Td(e.hexPolygonAltitude),i=Td(e.hexPolygonResolution),o=Td(e.hexPolygonMargin),a=Td(e.hexPolygonCurvatureResolution);Av(e.hexPolygonsData,e.scene,{createObj:function(e){var t=new Ev.Mesh(void 0,new Ev.MeshLambertMaterial({side:Ev.DoubleSide}));return t.__globeObjType="hexPolygon",t},updateObj:function(s,A){var l=t(A),c=i(A),u=r(A),h=Math.max(0,Math.min(1,+o(A))),d=a(A),f=n(A),p=av(f);s.material.color.set(ov(f)),s.material.transparent=p<1,s.material.opacity=p;var m=[];"Polygon"===l.type?Km(l.coordinates,c,!0).forEach((function(e){return m.push(e)})):"MultiPolygon"===l.type?l.coordinates.forEach((function(e){return Km(e,c,!0).forEach((function(e){return m.push(e)}))})):console.warn("Unsupported GeoJson geometry type: ".concat(l.type,". Skipping geometry..."));var g=m.map((function(e){var t=Zm(e),n=Jm(e,!0).reverse(),r=t[1];return n.forEach((function(e){var t=e[0];Math.abs(r-t)>170&&(e[0]+=r>t?360:-360)})),{h3Idx:e,hexCenter:t,hexGeoJson:n}})),v={alt:u,margin:h,curvatureResolution:d},y=function(e){var t=s.__currentTargetD=e,n=t.alt,r=t.margin,i=t.curvatureResolution;s.geometry=g.length?Cv.mergeBufferGeometries(g.map((function(e){var t=Hg(e.hexCenter,2),o=t[0],a=t[1],s=0===r?e.hexGeoJson:e.hexGeoJson.map((function(e){var t=Hg(e,2),n=t[0],i=t[1];return[[n,a],[i,o]].map((function(e){var t=Hg(e,2);return function(e,t,n){return e-(e-t)*n}(t[0],t[1],r)}))}));return new Cm([s],Zg,Zg*(1+n),!1,!0,!1,i)}))):new Ev.BufferGeometry},x=s.__currentTargetD||Object.assign({},v,{alt:-.001});Object.keys(v).some((function(e){return x[e]!==v[e]}))&&(!e.hexPolygonsTransitionDuration||e.hexPolygonsTransitionDuration<0?y(v):new Sl.Tween(x).to(v,e.hexPolygonsTransitionDuration).easing(Sl.Easing.Quadratic.InOut).onUpdate(y).start())}})}}),Pv=window.THREE?window.THREE:{Vector3:Be};function Lv(e,t){var n=Math.max(e.length,t.length),r=Df.apply(void 0,Gg([e,t].map((function(e){return e.map((function(e){return[e.x,e.y,e.z]}))})).map((function(e){return function(e,t){var n=e[e.length-1];return[].concat(Gg(e),Gg(Gg(new Array(t-e.length)).map((function(){return n}))))}(e,n)}))));return function(n){return 0===n?e:1===n?t:r(n).map((function(e){var t=Hg(e,3),n=t[0],r=t[1],i=t[2];return new Pv.Vector3(n,r,i)}))}}var qv=window.THREE?window.THREE:{BufferGeometry:dn,Color:Ee,Float32BufferAttribute:on,Group:Io,Line:wa,NoColors:0,NormalBlending:1,ShaderMaterial:kn,Vector3:Be,VertexColors:2},Dv=(new qv.BufferGeometry).setAttribute?"setAttribute":"addAttribute",Iv={uniforms:{dashOffset:{value:0},dashSize:{value:1},gapSize:{value:0},dashTranslate:{value:0}},vertexShader:"\n uniform float dashTranslate;\n\n attribute vec4 vertexColor;\n varying vec4 vColor;\n\n attribute float vertexRelDistance;\n varying float vRelDistance;\n\n void main() {\n // pass through colors and distances\n vColor = vertexColor;\n vRelDistance = vertexRelDistance + dashTranslate;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n uniform float dashOffset;\n uniform float dashSize;\n uniform float gapSize;\n\n varying vec4 vColor;\n varying float vRelDistance;\n\n void main() {\n // ignore pixels in the gap\n if (vRelDistance < dashOffset) discard;\n if (mod(vRelDistance - dashOffset, dashSize + gapSize) > dashSize) discard;\n\n // set px color: [r, g, b, a], interpolated between vertices\n gl_FragColor = vColor;\n }\n "},Ov=ll({props:{pathsData:{default:[]},pathPoints:{default:function(e){return e}},pathPointLat:{default:function(e){return e[0]}},pathPointLng:{default:function(e){return e[1]}},pathPointAlt:{default:.001},pathResolution:{default:2},pathColor:{default:function(){return"#ffffaa"}},pathStroke:{},pathDashLength:{default:1},pathDashGap:{default:0},pathDashInitialGap:{default:0},pathDashAnimateTime:{default:0},pathTransitionDuration:{default:1e3,triggerUpdate:!1},rendererSize:{}},init:function(e,t){Yg(e),t.scene=e,(new Qd).onTick.add((function(e,n){t.pathsData.filter((function(e){return e.__threeObj&&e.__threeObj.children.length&&e.__threeObj.children[0].material&&e.__threeObj.children[0].__dashAnimateStep})).forEach((function(e){var t=e.__threeObj.children[0],r=t.__dashAnimateStep*n;if("Line"===t.type){var i=t.material.uniforms.dashTranslate.value%1e9;t.material.uniforms.dashTranslate.value=i+r}else if("Line2"===t.type){for(var o=t.material.dashOffset-r,a=t.material.dashSize+t.material.gapSize;o<=-a;)o+=a;t.material.dashOffset=o}}))}))},update:function(e){var t=Td(e.pathPoints),n=Td(e.pathPointLat),r=Td(e.pathPointLng),i=Td(e.pathPointAlt),o=Td(e.pathStroke),a=Td(e.pathColor),s=Td(e.pathDashLength),A=Td(e.pathDashGap),l=Td(e.pathDashInitialGap),c=Td(e.pathDashAnimateTime),u=new qv.ShaderMaterial(Cg(Cg({},Iv),{},{transparent:!0,blending:qv.NormalBlending}));function h(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=t+1;if(e instanceof Array||e instanceof Function){var a=e instanceof Array?pp().domain(e.map((function(t,n){return n/(e.length-1)}))).range(e):e;n=function(e){return sv(a(e),i)}}else{var s=sv(e,i);n=function(){return s}}for(var A=i?4:3,l=new qv.Float32BufferAttribute(o*A*r,A),c=0,u=o;c1&&void 0!==arguments[1]?arguments[1]:1,t=[],n=null;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(r){if(n){for(;Math.abs(n[1]-r[1])>180;)n[1]+=360*(n[1]e)for(var a=Math.floor(i/e),s=o(n[0],r[0],a),A=o(n[1],r[1],a),l=o(n[2],r[2],a),c=0,u=s.length;c0?1e3/_:0,m){x.material.resolution=e.rendererSize;var w=s(f),M=A(f),S=l(f);x.material.dashed=M>0,x.material.dashed?x.material.defines.USE_DASH="":delete x.material.defines.USE_DASH,x.material.dashed&&(x.material.dashScale=1/(y=0,b.forEach((function(e){v&&(y+=v.distanceTo(e)),v=e})),y),x.material.dashSize=w,x.material.gapSize=M,x.material.dashOffset=-S);var E=a(f);if(E instanceof Array){var T=h(a(f),b.length-1,1,!1);x.geometry.setColors(T.array),x.material.vertexColors=qv.VertexColors}else{var C=E,R=av(C);x.material.color=new qv.Color(ov(C)),x.material.transparent=R<1,x.material.opacity=R,x.material.vertexColors=qv.NoColors}x.material.needsUpdate=!0}else{Object.assign(x.material.uniforms,{dashSize:{value:s(f)},gapSize:{value:A(f)},dashOffset:{value:l(f)}});var P=h(a(f),b.length),L=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e+1,i=r*t,o=new qv.Float32BufferAttribute(i,1),a=0,s=r;a":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},v:{x_min:0,x_max:675.15625,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 737 l 340 147 l 541 737 l 675 738 "},"τ":{x_min:.28125,x_max:644.5,ha:703,o:"m 644 628 l 382 628 l 382 179 q 388 120 382 137 q 436 91 401 91 q 474 94 447 91 q 504 97 501 97 l 504 0 q 454 -9 482 -5 q 401 -14 426 -14 q 278 67 308 -14 q 260 233 260 118 l 260 628 l 0 628 l 0 739 l 644 739 l 644 628 "},"ξ":{x_min:0,x_max:624.9375,ha:699,o:"m 624 -37 q 608 -153 624 -96 q 563 -278 593 -211 l 454 -278 q 491 -183 486 -200 q 511 -83 511 -126 q 484 -23 511 -44 q 370 1 452 1 q 323 0 354 1 q 283 -1 293 -1 q 84 76 169 -1 q 0 266 0 154 q 56 431 0 358 q 197 538 108 498 q 94 613 134 562 q 54 730 54 665 q 77 823 54 780 q 143 901 101 867 l 27 901 l 27 1012 l 576 1012 l 576 901 l 380 901 q 244 863 303 901 q 178 745 178 820 q 312 600 178 636 q 532 582 380 582 l 532 479 q 276 455 361 479 q 118 281 118 410 q 165 173 118 217 q 274 120 208 133 q 494 101 384 110 q 624 -37 624 76 "},"&":{x_min:-3,x_max:894.25,ha:992,o:"m 894 0 l 725 0 l 624 123 q 471 0 553 40 q 306 -41 390 -41 q 168 -7 231 -41 q 62 92 105 26 q 14 187 31 139 q -3 276 -3 235 q 55 433 -3 358 q 248 581 114 508 q 170 689 196 640 q 137 817 137 751 q 214 985 137 922 q 384 1041 284 1041 q 548 988 483 1041 q 622 824 622 928 q 563 666 622 739 q 431 556 516 608 l 621 326 q 649 407 639 361 q 663 493 653 426 l 781 493 q 703 229 781 352 l 894 0 m 504 818 q 468 908 504 877 q 384 940 433 940 q 293 907 331 940 q 255 818 255 875 q 289 714 255 767 q 363 628 313 678 q 477 729 446 682 q 504 818 504 771 m 556 209 l 314 499 q 179 395 223 449 q 135 283 135 341 q 146 222 135 253 q 183 158 158 192 q 333 80 241 80 q 556 209 448 80 "},"Λ":{x_min:0,x_max:862.5,ha:942,o:"m 862 0 l 719 0 l 426 847 l 143 0 l 0 0 l 356 1013 l 501 1013 l 862 0 "},I:{x_min:41,x_max:180,ha:293,o:"m 180 0 l 41 0 l 41 1013 l 180 1013 l 180 0 "},G:{x_min:0,x_max:921,ha:1011,o:"m 921 0 l 832 0 l 801 136 q 655 15 741 58 q 470 -28 568 -28 q 126 133 259 -28 q 0 499 0 284 q 125 881 0 731 q 486 1043 259 1043 q 763 957 647 1043 q 905 709 890 864 l 772 709 q 668 866 747 807 q 486 926 589 926 q 228 795 322 926 q 142 507 142 677 q 228 224 142 342 q 483 94 323 94 q 712 195 625 94 q 796 435 796 291 l 477 435 l 477 549 l 921 549 l 921 0 "},"ΰ":{x_min:0,x_max:617,ha:725,o:"m 524 800 l 414 800 l 414 925 l 524 925 l 524 800 m 183 800 l 73 800 l 73 925 l 183 925 l 183 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 489 1040 l 300 819 l 216 819 l 351 1040 l 489 1040 "},"`":{x_min:0,x_max:138.890625,ha:236,o:"m 138 699 l 0 699 l 0 861 q 36 974 0 929 q 138 1041 72 1020 l 138 977 q 82 931 95 969 q 69 839 69 893 l 138 839 l 138 699 "},"·":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"Υ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 819 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 "},r:{x_min:0,x_max:355.5625,ha:432,o:"m 355 621 l 343 621 q 179 569 236 621 q 122 411 122 518 l 122 0 l 0 0 l 0 737 l 117 737 l 117 604 q 204 719 146 686 q 355 753 262 753 l 355 621 "},x:{x_min:0,x_max:675,ha:764,o:"m 675 0 l 525 0 l 331 286 l 144 0 l 0 0 l 256 379 l 12 738 l 157 737 l 336 473 l 516 738 l 661 738 l 412 380 l 675 0 "},"μ":{x_min:0,x_max:696.609375,ha:747,o:"m 696 -4 q 628 -14 657 -14 q 498 97 513 -14 q 422 8 470 41 q 313 -24 374 -24 q 207 3 258 -24 q 120 80 157 31 l 120 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 172 124 246 q 308 82 216 82 q 451 177 402 82 q 492 358 492 254 l 492 738 l 616 738 l 616 214 q 623 136 616 160 q 673 92 636 92 q 696 95 684 92 l 696 -4 "},h:{x_min:0,x_max:615,ha:724,o:"m 615 472 l 615 0 l 490 0 l 490 454 q 456 590 490 535 q 338 654 416 654 q 186 588 251 654 q 122 436 122 522 l 122 0 l 0 0 l 0 1013 l 122 1013 l 122 633 q 218 727 149 694 q 362 760 287 760 q 552 676 484 760 q 615 472 615 600 "},".":{x_min:0,x_max:142,ha:239,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"φ":{x_min:-2,x_max:878,ha:974,o:"m 496 -279 l 378 -279 l 378 -17 q 101 88 204 -17 q -2 367 -2 194 q 68 626 -2 510 q 283 758 151 758 l 283 646 q 167 537 209 626 q 133 373 133 462 q 192 177 133 254 q 378 93 259 93 l 378 758 q 445 764 426 763 q 476 765 464 765 q 765 659 653 765 q 878 377 878 553 q 771 96 878 209 q 496 -17 665 -17 l 496 -279 m 496 93 l 514 93 q 687 183 623 93 q 746 380 746 265 q 691 569 746 491 q 522 658 629 658 l 496 656 l 496 93 "},";":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 -12 q 105 -132 142 -82 q 0 -206 68 -182 l 0 -138 q 58 -82 43 -123 q 68 0 68 -56 l 0 0 l 0 151 l 142 151 l 142 -12 "},f:{x_min:0,x_max:378,ha:472,o:"m 378 638 l 246 638 l 246 0 l 121 0 l 121 638 l 0 638 l 0 738 l 121 738 q 137 935 121 887 q 290 1028 171 1028 q 320 1027 305 1028 q 378 1021 334 1026 l 378 908 q 323 918 346 918 q 257 870 273 918 q 246 780 246 840 l 246 738 l 378 738 l 378 638 "},"“":{x_min:1,x_max:348.21875,ha:454,o:"m 140 670 l 1 670 l 1 830 q 37 943 1 897 q 140 1011 74 990 l 140 947 q 82 900 97 940 q 68 810 68 861 l 140 810 l 140 670 m 348 670 l 209 670 l 209 830 q 245 943 209 897 q 348 1011 282 990 l 348 947 q 290 900 305 940 q 276 810 276 861 l 348 810 l 348 670 "},A:{x_min:.03125,x_max:906.953125,ha:1008,o:"m 906 0 l 756 0 l 648 303 l 251 303 l 142 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 610 421 l 452 867 l 293 421 l 610 421 "},"‘":{x_min:1,x_max:139.890625,ha:236,o:"m 139 670 l 1 670 l 1 830 q 37 943 1 897 q 139 1011 74 990 l 139 947 q 82 900 97 940 q 68 810 68 861 l 139 810 l 139 670 "},"ϊ":{x_min:-70,x_max:283,ha:361,o:"m 283 800 l 173 800 l 173 925 l 283 925 l 283 800 m 40 800 l -70 800 l -70 925 l 40 925 l 40 800 m 283 3 q 232 -10 257 -5 q 181 -15 206 -15 q 84 26 118 -15 q 41 200 41 79 l 41 737 l 166 737 l 167 215 q 171 141 167 157 q 225 101 182 101 q 247 103 238 101 q 283 112 256 104 l 283 3 "},"π":{x_min:-.21875,x_max:773.21875,ha:857,o:"m 773 -7 l 707 -11 q 575 40 607 -11 q 552 174 552 77 l 552 226 l 552 626 l 222 626 l 222 0 l 97 0 l 97 626 l 0 626 l 0 737 l 773 737 l 773 626 l 676 626 l 676 171 q 695 103 676 117 q 773 90 714 90 l 773 -7 "},"ά":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 727 407 760 q 563 637 524 695 l 563 738 l 685 738 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 95 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 m 604 1040 l 415 819 l 332 819 l 466 1040 l 604 1040 "},O:{x_min:0,x_max:958,ha:1057,o:"m 485 1041 q 834 882 702 1041 q 958 512 958 734 q 834 136 958 287 q 481 -26 702 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 728 q 485 1041 263 1041 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 669 q 480 912 640 912 q 226 784 321 912 q 142 504 142 670 q 226 224 142 339 q 480 98 319 98 "},n:{x_min:0,x_max:615,ha:724,o:"m 615 463 l 615 0 l 490 0 l 490 454 q 453 592 490 537 q 331 656 410 656 q 178 585 240 656 q 117 421 117 514 l 117 0 l 0 0 l 0 738 l 117 738 l 117 630 q 218 728 150 693 q 359 764 286 764 q 552 675 484 764 q 615 463 615 593 "},l:{x_min:41,x_max:166,ha:279,o:"m 166 0 l 41 0 l 41 1013 l 166 1013 l 166 0 "},"¤":{x_min:40.09375,x_max:728.796875,ha:825,o:"m 728 304 l 649 224 l 512 363 q 383 331 458 331 q 256 363 310 331 l 119 224 l 40 304 l 177 441 q 150 553 150 493 q 184 673 150 621 l 40 818 l 119 898 l 267 749 q 321 766 291 759 q 384 773 351 773 q 447 766 417 773 q 501 749 477 759 l 649 898 l 728 818 l 585 675 q 612 618 604 648 q 621 553 621 587 q 591 441 621 491 l 728 304 m 384 682 q 280 643 318 682 q 243 551 243 604 q 279 461 243 499 q 383 423 316 423 q 487 461 449 423 q 525 553 525 500 q 490 641 525 605 q 384 682 451 682 "},"κ":{x_min:0,x_max:632.328125,ha:679,o:"m 632 0 l 482 0 l 225 384 l 124 288 l 124 0 l 0 0 l 0 738 l 124 738 l 124 446 l 433 738 l 596 738 l 312 466 l 632 0 "},p:{x_min:0,x_max:685,ha:786,o:"m 685 364 q 598 96 685 205 q 350 -23 504 -23 q 121 89 205 -23 l 121 -278 l 0 -278 l 0 738 l 121 738 l 121 633 q 220 726 159 691 q 351 761 280 761 q 598 636 504 761 q 685 364 685 522 m 557 371 q 501 560 557 481 q 330 651 437 651 q 162 559 223 651 q 108 366 108 479 q 162 177 108 254 q 333 87 224 87 q 502 178 441 87 q 557 371 557 258 "},"‡":{x_min:0,x_max:777,ha:835,o:"m 458 238 l 458 0 l 319 0 l 319 238 l 0 238 l 0 360 l 319 360 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 l 777 804 l 777 683 l 458 683 l 458 360 l 777 360 l 777 238 l 458 238 "},"ψ":{x_min:0,x_max:808,ha:907,o:"m 465 -278 l 341 -278 l 341 -15 q 87 102 180 -15 q 0 378 0 210 l 0 739 l 133 739 l 133 379 q 182 195 133 275 q 341 98 242 98 l 341 922 l 465 922 l 465 98 q 623 195 563 98 q 675 382 675 278 l 675 742 l 808 742 l 808 381 q 720 104 808 213 q 466 -13 627 -13 l 465 -278 "},"η":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 720 124 755 q 200 630 193 686 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 "}},cssFontWeight:"normal",ascender:1189,underlinePosition:-100,cssFontStyle:"normal",boundingBox:{yMin:-334,xMin:-111,yMax:1189,xMax:1672},resolution:1e3,original_font_information:{postscript_name:"Helvetiker-Regular",version_string:"Version 1.00 2004 initial release",vendor_url:"http://www.magenta.gr/",full_font_name:"Helvetiker",font_family_name:"Helvetiker",copyright:"Copyright (c) Μagenta ltd, 2004",description:"",trademark:"",designer:"",designer_url:"",unique_font_identifier:"Μagenta ltd:Helvetiker:22-10-104",license_url:"http://www.ellak.gr/fonts/MgOpen/license.html",license_description:'Copyright (c) 2004 by MAGENTA Ltd. All Rights Reserved.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: \r\n\r\nThe above copyright and this permission notice shall be included in all copies of one or more of the Font Software typefaces.\r\n\r\nThe Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing the word "MgOpen", or if the modifications are accepted for inclusion in the Font Software itself by the each appointed Administrator.\r\n\r\nThis License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "MgOpen" name.\r\n\r\nThe Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. \r\n\r\nTHE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL MAGENTA OR PERSONS OR BODIES IN CHARGE OF ADMINISTRATION AND MAINTENANCE OF THE FONT SOFTWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.',manufacturer_name:"Μagenta ltd",font_sub_family_name:"Regular"},descender:-334,familyName:"Helvetiker",lineHeight:1522,underlineThickness:50},Uv=Cg(Cg({},window.THREE?window.THREE:{CircleBufferGeometry:Da,Group:Io,Mesh:Ln,MeshLambertMaterial:zs,TextGeometry:Mg,Vector3:Be}),{},{Font:Sg,TextGeometry:Mg}),Fv=ll({props:{labelsData:{default:[]},labelLat:{default:"lat"},labelLng:{default:"lng"},labelAltitude:{default:0},labelText:{default:"text"},labelSize:{default:.5},labelTypeFace:{default:zv,onChange:function(e,t){t.font=new Uv.Font(e)}},labelColor:{default:function(){return"lightgrey"}},labelRotation:{default:0},labelResolution:{default:3},labelIncludeDot:{default:!0},labelDotRadius:{default:.1},labelDotOrientation:{default:function(){return"bottom"}},labelsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t){Yg(e),t.scene=e},update:function(e){var t=Td(e.labelLat),n=Td(e.labelLng),r=Td(e.labelAltitude),i=Td(e.labelText),o=Td(e.labelSize),a=Td(e.labelRotation),s=Td(e.labelColor),A=Td(e.labelIncludeDot),l=Td(e.labelDotRadius),c=Td(e.labelDotOrientation),u=new Set(["right","top","bottom"]),h=2*Math.PI*Zg/360,d=new Uv.CircleBufferGeometry(1,16);Av(e.labelsData,e.scene,{createObj:function(){var e=new Uv.MeshLambertMaterial,t=new Uv.Group;return t.add(new Uv.Mesh(d,e)),t.add(new Uv.Mesh(void 0,e)),t.__globeObjType="label",t},updateObj:function(d,f){var p=Hg(d.children,2),m=p[0],g=p[1],v=s(f),y=av(v);g.material.color.set(ov(v)),g.material.transparent=y<1,g.material.opacity=y;var x=A(f),b=c(f);!x||!u.has(b)&&(b="bottom");var _=x?+l(f)*h:1e-12;m.scale.x=m.scale.y=_;var w=+o(f)*h;if(g.geometry=new Uv.TextGeometry(i(f),{font:e.font,size:w,height:0,curveSegments:e.labelResolution}),"right"!==b&&g.geometry.center(),x){var M=_+w/2;"right"===b&&(g.position.x=M),g.position.y={right:-w/2,top:M+w/2,bottom:-M-w/2}[b]}var S=function(t){var n=d.__currentTargetD=t,r=n.lat,i=n.lng,o=n.alt,a=n.rot,s=n.scale;Object.assign(d.position,Jg(r,i,o)),d.lookAt(e.scene.localToWorld(new Uv.Vector3(0,0,0))),d.rotateY(Math.PI),d.rotateZ(-a*Math.PI/180),d.scale.x=d.scale.y=d.scale.z=s},E={lat:+t(f),lng:+n(f),alt:+r(f),rot:+a(f),scale:1},T=d.__currentTargetD||Object.assign({},E,{scale:1e-12});Object.keys(E).some((function(e){return T[e]!==E[e]}))&&(!e.labelsTransitionDuration||e.labelsTransitionDuration<0?S(E):new Sl.Tween(T).to(E,e.labelsTransitionDuration).easing(Sl.Easing.Quadratic.InOut).onUpdate(S).start())}})}}),Hv=function(e){Dg(n,e);var t=Fg(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32;Rg(this,n),(e=t.call(this)).type="CircleLineGeometry",e.parameters={radius:r,segmentCount:i};for(var o=[],a=0;a<=i;a++){var s=(a/i-.25)*Math.PI*2;o.push({x:Math.cos(s)*r,y:Math.sin(s)*r,z:0})}return e.setFromPoints(o),e}return Lg(n)}((window.THREE?window.THREE:{BufferGeometry:dn}).BufferGeometry),Gv=window.THREE?window.THREE:{Color:Ee,Group:Io,Line:wa,LineBasicMaterial:ga,Vector3:Be},Vv=ll({props:{ringsData:{default:[]},ringLat:{default:"lat"},ringLng:{default:"lng"},ringAltitude:{default:.0015},ringColor:{default:function(){return"#ffffaa"},triggerUpdate:!1},ringResolution:{default:64,triggerUpdate:!1},ringMaxRadius:{default:2,triggerUpdate:!1},ringPropagationSpeed:{default:1,triggerUpdate:!1},ringRepeatPeriod:{default:700,triggerUpdate:!1}},init:function(e,t){Yg(e),t.scene=e,(new Qd).onTick.add((function(e){if(t.ringsData.length){var n=Td(t.ringColor),r=Td(t.ringAltitude),i=Td(t.ringMaxRadius),o=Td(t.ringPropagationSpeed),a=Td(t.ringRepeatPeriod);t.ringsData.filter((function(e){return e.__threeObj})).forEach((function(s){var A,l,c,u=s.__threeObj;if((u.__nextRingTime||0)<=e){var h=a(s)/1e3;u.__nextRingTime=e+(h<=0?1/0:h);var d,f=new Gv.Line(new Hv(1,t.ringResolution),new Gv.LineBasicMaterial),p=n(s),m=p instanceof Array||p instanceof Function;m?p instanceof Array?(d=pp().domain(p.map((function(e,t){return t/(p.length-1)}))).range(p),f.material.transparent=p.some((function(e){return av(e)<1}))):(d=p,f.material.transparent=!0):(f.material.color=new Gv.Color(ov(p)),A=f.material,l=av(p),A.opacity=l,A.transparent=l<1,A.depthWrite=void 0===c?l>=1:c);var g=Zg*(1+r(s)),v=i(s),y=v*Math.PI/180,x=o(s),b=x<=0,_=function(e){var t=e.t,n=(b?1-t:t)*y;if(f.scale.x=f.scale.y=g*Math.sin(n),f.position.z=g*(1-Math.cos(n)),m){var r=d(t);f.material.color=new Gv.Color(ov(r)),f.material.transparent&&(f.material.opacity=av(r))}};if(0===x)_({t:0}),u.add(f);else{var w=1e3*Math.abs(v/x);new Sl.Tween({t:0}).to({t:1},w).onUpdate(_).onStart((function(){return u.add(f)})).onComplete((function(){u.remove(f),Qg(f)})).start()}}}))}}))},update:function(e){var t=Td(e.ringLat),n=Td(e.ringLng),r=Td(e.ringAltitude),i=e.scene.localToWorld(new Gv.Vector3(0,0,0));Av(e.ringsData,e.scene,{createObj:function(){var e=new Gv.Group;return e.__globeObjType="ring",e},updateObj:function(e,o){var a=t(o),s=n(o),A=r(o);Object.assign(e.position,Jg(a,s,A)),e.lookAt(i)}},{removeDelay:3e4})}}),jv=ll({props:{customLayerData:{default:[]},customThreeObject:{},customThreeObjectUpdate:{triggerUpdate:!1}},init:function(e,t){Yg(e),t.scene=e},update:function(e){e.customThreeObjectUpdate||Yg(e.scene);var t=Td(e.customThreeObject),n=Td(e.customThreeObjectUpdate);Av(e.customLayerData,e.scene,{createObj:function(n){var r=t(n,Zg);return r&&(e.customThreeObject===r&&(r=r.clone()),r.__globeObjType="custom"),r},updateObj:function(e,t){return n(e,t,Zg)}})}}),Wv=window.THREE?window.THREE:{Group:Io,Vector2:me,Vector3:Be},Qv=["globeLayer","pointsLayer","arcsLayer","hexBinLayer","polygonsLayer","hexedPolygonsLayer","pathsLayer","tilesLayer","labelsLayer","ringsLayer","customLayer"],Yv=Xg("globeLayer",iv),Xv=Object.assign.apply(Object,Gg(["globeImageUrl","bumpImageUrl","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude"].map((function(e){return qg({},e,Yv.linkProp(e))})))),Zv=Object.assign.apply(Object,Gg(["globeMaterial"].map((function(e){return qg({},e,Yv.linkMethod(e))})))),Jv=Xg("pointsLayer",dv),Kv=Object.assign.apply(Object,Gg(["pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration"].map((function(e){return qg({},e,Jv.linkProp(e))})))),$v=Xg("arcsLayer",vv),ey=Object.assign.apply(Object,Gg(["arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration"].map((function(e){return qg({},e,$v.linkProp(e))})))),ty=Xg("hexBinLayer",wv),ny=Object.assign.apply(Object,Gg(["hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration"].map((function(e){return qg({},e,ty.linkProp(e))})))),ry=Xg("hexedPolygonsLayer",Rv),iy=Object.assign.apply(Object,Gg(["hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonCurvatureResolution","hexPolygonsTransitionDuration"].map((function(e){return qg({},e,ry.linkProp(e))})))),oy=Xg("polygonsLayer",Sv),ay=Object.assign.apply(Object,Gg(["polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration"].map((function(e){return qg({},e,oy.linkProp(e))})))),sy=Xg("pathsLayer",Ov),Ay=Object.assign.apply(Object,Gg(["pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration"].map((function(e){return qg({},e,sy.linkProp(e))})))),ly=Xg("tilesLayer",kv),cy=Object.assign.apply(Object,Gg(["tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration"].map((function(e){return qg({},e,ly.linkProp(e))})))),uy=Xg("labelsLayer",Fv),hy=Object.assign.apply(Object,Gg(["labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration"].map((function(e){return qg({},e,uy.linkProp(e))})))),dy=Xg("ringsLayer",Vv),fy=Object.assign.apply(Object,Gg(["ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod"].map((function(e){return qg({},e,dy.linkProp(e))})))),py=Xg("customLayer",jv),my=Object.assign.apply(Object,Gg(["customLayerData","customThreeObject","customThreeObjectUpdate"].map((function(e){return qg({},e,py.linkProp(e))})))),gy=ll({props:Cg(Cg(Cg(Cg(Cg(Cg(Cg(Cg(Cg(Cg(Cg({onGlobeReady:{triggerUpdate:!1},rendererSize:{default:new Wv.Vector2(window.innerWidth,window.innerHeight),onChange:function(e,t){t.pathsLayer.rendererSize(e)},triggerUpdate:!1}},Xv),Kv),ey),ny),ay),iy),Ay),cy),hy),fy),my),methods:Cg({getCoords:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:Object,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=function(t){Dg(i,t);var r=Fg(i);function i(){var t;Rg(this,i);for(var o=arguments.length,a=new Array(o),s=0;s0&&(n.object.isPerspectiveCamera?v.multiplyScalar(e):n.object.isOrthographicCamera?(n.object.zoom/=e,n.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")),n.staticMoving?_.copy(w):_.y+=(w.y-_.y)*this.dynamicDampingFactor)},this.panCamera=function(){const e=new me,t=new Be,r=new Be;return function(){if(e.copy(S).sub(M),e.lengthSq()){if(n.object.isOrthographicCamera){const t=(n.object.right-n.object.left)/n.object.zoom/n.domElement.clientWidth,r=(n.object.top-n.object.bottom)/n.object.zoom/n.domElement.clientWidth;e.x*=t,e.y*=r}e.multiplyScalar(v.length()*n.panSpeed),r.copy(v).cross(n.object.up).setLength(e.x),r.add(t.copy(n.object.up).setLength(e.y)),n.object.position.add(r),n.target.add(r),n.staticMoving?M.copy(S):M.add(e.subVectors(S,M).multiplyScalar(n.dynamicDampingFactor))}}}(),this.checkDistances=function(){n.noZoom&&n.noPan||(v.lengthSq()>n.maxDistance*n.maxDistance&&(n.object.position.addVectors(n.target,v.setLength(n.maxDistance)),_.copy(w)),v.lengthSq()l&&(n.dispatchEvent(yy),c.copy(n.object.position))):n.object.isOrthographicCamera?(n.object.lookAt(n.target),(c.distanceToSquared(n.object.position)>l||u!==n.object.zoom)&&(n.dispatchEvent(yy),c.copy(n.object.position),u=n.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type")},this.reset=function(){h=r,d=r,n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.up.copy(n.up0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),v.subVectors(n.object.position,n.target),n.object.lookAt(n.target),n.dispatchEvent(yy),c.copy(n.object.position),u=n.object.zoom},this.dispose=function(){n.domElement.removeEventListener("contextmenu",k),n.domElement.removeEventListener("pointerdown",P),n.domElement.removeEventListener("pointercancel",D),n.domElement.removeEventListener("wheel",B),n.domElement.removeEventListener("pointermove",L),n.domElement.removeEventListener("pointerup",q),window.removeEventListener("keydown",I),window.removeEventListener("keyup",O)},this.domElement.addEventListener("contextmenu",k),this.domElement.addEventListener("pointerdown",P),this.domElement.addEventListener("pointercancel",D),this.domElement.addEventListener("wheel",B,{passive:!1}),window.addEventListener("keydown",I),window.addEventListener("keyup",O),this.handleResize(),this.update()}}const wy={type:"change"},My={type:"start"},Sy={type:"end"};class Ey extends ie{constructor(e,t){super(),void 0===t&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),t===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=e,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new Be,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:m.ROTATE,MIDDLE:m.DOLLY,RIGHT:m.PAN},this.touches={ONE:g,TWO:y},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return a.phi},this.getAzimuthalAngle=function(){return a.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(e){e.addEventListener("keydown",Y),this._domElementKeyEvents=e},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(wy),n.update(),i=r.NONE},this.update=function(){const t=new Be,u=(new Oe).setFromUnitVectors(e.up,new Be(0,1,0)),h=u.clone().invert(),d=new Be,f=new Oe,p=2*Math.PI;return function(){const e=n.object.position;t.copy(e).sub(n.target),t.applyQuaternion(u),a.setFromVector3(t),n.autoRotate&&i===r.NONE&&C(2*Math.PI/60/60*n.autoRotateSpeed),n.enableDamping?(a.theta+=s.theta*n.dampingFactor,a.phi+=s.phi*n.dampingFactor):(a.theta+=s.theta,a.phi+=s.phi);let m=n.minAzimuthAngle,g=n.maxAzimuthAngle;return isFinite(m)&&isFinite(g)&&(m<-Math.PI?m+=p:m>Math.PI&&(m-=p),g<-Math.PI?g+=p:g>Math.PI&&(g-=p),a.theta=m<=g?Math.max(m,Math.min(g,a.theta)):a.theta>(m+g)/2?Math.max(m,a.theta):Math.min(g,a.theta)),a.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,a.phi)),a.makeSafe(),a.radius*=A,a.radius=Math.max(n.minDistance,Math.min(n.maxDistance,a.radius)),!0===n.enableDamping?n.target.addScaledVector(l,n.dampingFactor):n.target.add(l),t.setFromSpherical(a),t.applyQuaternion(h),e.copy(n.target).add(t),n.object.lookAt(n.target),!0===n.enableDamping?(s.theta*=1-n.dampingFactor,s.phi*=1-n.dampingFactor,l.multiplyScalar(1-n.dampingFactor)):(s.set(0,0,0),l.set(0,0,0)),A=1,!!(c||d.distanceToSquared(n.object.position)>o||8*(1-f.dot(n.object.quaternion))>o)&&(n.dispatchEvent(wy),d.copy(n.object.position),f.copy(n.object.quaternion),c=!1,!0)}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",X),n.domElement.removeEventListener("pointerdown",G),n.domElement.removeEventListener("pointercancel",W),n.domElement.removeEventListener("wheel",Q),n.domElement.removeEventListener("pointermove",V),n.domElement.removeEventListener("pointerup",j),null!==n._domElementKeyEvents&&n._domElementKeyEvents.removeEventListener("keydown",Y)};const n=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let i=r.NONE;const o=1e-6,a=new WA,s=new WA;let A=1;const l=new Be;let c=!1;const u=new me,h=new me,d=new me,f=new me,p=new me,b=new me,_=new me,w=new me,M=new me,S=[],E={};function T(){return Math.pow(.95,n.zoomSpeed)}function C(e){s.theta-=e}function R(e){s.phi-=e}const P=function(){const e=new Be;return function(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),l.add(e)}}(),L=function(){const e=new Be;return function(t,r){!0===n.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(n.object.up,e)),e.multiplyScalar(t),l.add(e)}}(),q=function(){const e=new Be;return function(t,r){const i=n.domElement;if(n.object.isPerspectiveCamera){const o=n.object.position;e.copy(o).sub(n.target);let a=e.length();a*=Math.tan(n.object.fov/2*Math.PI/180),P(2*t*a/i.clientHeight,n.object.matrix),L(2*r*a/i.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(P(t*(n.object.right-n.object.left)/n.object.zoom/i.clientWidth,n.object.matrix),L(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 D(e){n.object.isPerspectiveCamera?A/=e:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom*e)),n.object.updateProjectionMatrix(),c=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function I(e){n.object.isPerspectiveCamera?A*=e:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/e)),n.object.updateProjectionMatrix(),c=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function O(e){u.set(e.clientX,e.clientY)}function B(e){f.set(e.clientX,e.clientY)}function k(){if(1===S.length)u.set(S[0].pageX,S[0].pageY);else{const e=.5*(S[0].pageX+S[1].pageX),t=.5*(S[0].pageY+S[1].pageY);u.set(e,t)}}function N(){if(1===S.length)f.set(S[0].pageX,S[0].pageY);else{const e=.5*(S[0].pageX+S[1].pageX),t=.5*(S[0].pageY+S[1].pageY);f.set(e,t)}}function z(){const e=S[0].pageX-S[1].pageX,t=S[0].pageY-S[1].pageY,n=Math.sqrt(e*e+t*t);_.set(0,n)}function U(e){if(1==S.length)h.set(e.pageX,e.pageY);else{const t=K(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);h.set(n,r)}d.subVectors(h,u).multiplyScalar(n.rotateSpeed);const t=n.domElement;C(2*Math.PI*d.x/t.clientHeight),R(2*Math.PI*d.y/t.clientHeight),u.copy(h)}function F(e){if(1===S.length)p.set(e.pageX,e.pageY);else{const t=K(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);p.set(n,r)}b.subVectors(p,f).multiplyScalar(n.panSpeed),q(b.x,b.y),f.copy(p)}function H(e){const t=K(e),r=e.pageX-t.x,i=e.pageY-t.y,o=Math.sqrt(r*r+i*i);w.set(0,o),M.set(0,Math.pow(w.y/_.y,n.zoomSpeed)),D(M.y),_.copy(w)}function G(e){!1!==n.enabled&&(0===S.length&&(n.domElement.setPointerCapture(e.pointerId),n.domElement.addEventListener("pointermove",V),n.domElement.addEventListener("pointerup",j)),function(e){S.push(e)}(e),"touch"===e.pointerType?function(e){switch(J(e),S.length){case 1:switch(n.touches.ONE){case g:if(!1===n.enableRotate)return;k(),i=r.TOUCH_ROTATE;break;case v:if(!1===n.enablePan)return;N(),i=r.TOUCH_PAN;break;default:i=r.NONE}break;case 2:switch(n.touches.TWO){case y:if(!1===n.enableZoom&&!1===n.enablePan)return;n.enableZoom&&z(),n.enablePan&&N(),i=r.TOUCH_DOLLY_PAN;break;case x:if(!1===n.enableZoom&&!1===n.enableRotate)return;n.enableZoom&&z(),n.enableRotate&&k(),i=r.TOUCH_DOLLY_ROTATE;break;default:i=r.NONE}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent(My)}(e):function(e){let t;switch(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 m.DOLLY:if(!1===n.enableZoom)return;!function(e){_.set(e.clientX,e.clientY)}(e),i=r.DOLLY;break;case m.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enablePan)return;B(e),i=r.PAN}else{if(!1===n.enableRotate)return;O(e),i=r.ROTATE}break;case m.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enableRotate)return;O(e),i=r.ROTATE}else{if(!1===n.enablePan)return;B(e),i=r.PAN}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent(My)}(e))}function V(e){!1!==n.enabled&&("touch"===e.pointerType?function(e){switch(J(e),i){case r.TOUCH_ROTATE:if(!1===n.enableRotate)return;U(e),n.update();break;case r.TOUCH_PAN:if(!1===n.enablePan)return;F(e),n.update();break;case r.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(e){n.enableZoom&&H(e),n.enablePan&&F(e)}(e),n.update();break;case r.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(e){n.enableZoom&&H(e),n.enableRotate&&U(e)}(e),n.update();break;default:i=r.NONE}}(e):function(e){if(!1===n.enabled)return;switch(i){case r.ROTATE:if(!1===n.enableRotate)return;!function(e){h.set(e.clientX,e.clientY),d.subVectors(h,u).multiplyScalar(n.rotateSpeed);const t=n.domElement;C(2*Math.PI*d.x/t.clientHeight),R(2*Math.PI*d.y/t.clientHeight),u.copy(h),n.update()}(e);break;case r.DOLLY:if(!1===n.enableZoom)return;!function(e){w.set(e.clientX,e.clientY),M.subVectors(w,_),M.y>0?D(T()):M.y<0&&I(T()),_.copy(w),n.update()}(e);break;case r.PAN:if(!1===n.enablePan)return;!function(e){p.set(e.clientX,e.clientY),b.subVectors(p,f).multiplyScalar(n.panSpeed),q(b.x,b.y),f.copy(p),n.update()}(e)}}(e))}function j(e){Z(e),0===S.length&&(n.domElement.releasePointerCapture(e.pointerId),n.domElement.removeEventListener("pointermove",V),n.domElement.removeEventListener("pointerup",j)),n.dispatchEvent(Sy),i=r.NONE}function W(e){Z(e)}function Q(e){!1!==n.enabled&&!1!==n.enableZoom&&i===r.NONE&&(e.preventDefault(),n.dispatchEvent(My),function(e){e.deltaY<0?I(T()):e.deltaY>0&&D(T()),n.update()}(e),n.dispatchEvent(Sy))}function Y(e){!1!==n.enabled&&!1!==n.enablePan&&function(e){let t=!1;switch(e.code){case n.keys.UP:q(0,n.keyPanSpeed),t=!0;break;case n.keys.BOTTOM:q(0,-n.keyPanSpeed),t=!0;break;case n.keys.LEFT:q(n.keyPanSpeed,0),t=!0;break;case n.keys.RIGHT:q(-n.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),n.update())}(e)}function X(e){!1!==n.enabled&&e.preventDefault()}function Z(e){delete E[e.pointerId];for(let t=0;t0){const t=this.getContainerDimensions(),n=t.size[0]/2,r=t.size[1]/2;this.moveState.yawLeft=-(e.pageX-t.offset[0]-n)/n,this.moveState.pitchDown=(e.pageY-t.offset[1]-r)/r,this.updateRotationVector()}},this.mouseup=function(e){if(this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(e.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()},this.update=function(e){const t=e*n.movementSpeed,a=e*n.rollSpeed;n.object.translateX(n.moveVector.x*t),n.object.translateY(n.moveVector.y*t),n.object.translateZ(n.moveVector.z*t),n.tmpQuaternion.set(n.rotationVector.x*a,n.rotationVector.y*a,n.rotationVector.z*a,1).normalize(),n.object.quaternion.multiply(n.tmpQuaternion),(o.distanceToSquared(n.object.position)>r||8*(1-i.dot(n.object.quaternion))>r)&&(n.dispatchEvent(Ty),i.copy(n.object.quaternion),o.copy(n.object.position))},this.updateMovementVector=function(){const e=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-e+this.moveState.back},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",Ry),this.domElement.removeEventListener("mousedown",s),this.domElement.removeEventListener("mousemove",a),this.domElement.removeEventListener("mouseup",A),window.removeEventListener("keydown",l),window.removeEventListener("keyup",c)};const a=this.mousemove.bind(this),s=this.mousedown.bind(this),A=this.mouseup.bind(this),l=this.keydown.bind(this),c=this.keyup.bind(this);this.domElement.addEventListener("contextmenu",Ry),this.domElement.addEventListener("mousemove",a),this.domElement.addEventListener("mousedown",s),this.domElement.addEventListener("mouseup",A),window.addEventListener("keydown",l),window.addEventListener("keyup",c),this.updateMovementVector(),this.updateRotationVector()}}function Ry(e){e.preventDefault()}var Py={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor = opacity * texel;\n\n\t\t}"};class Ly{constructor(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}const qy=new lr(-1,1,1,-1,0,1),Dy=new dn;Dy.setAttribute("position",new on([-1,3,0,-1,-1,0,3,-1,0],3)),Dy.setAttribute("uv",new on([0,2,0,0,2,0],2));class Iy{constructor(e){this._mesh=new Ln(Dy,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,qy)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}class Oy extends Ly{constructor(e,t){super(),this.textureID=void 0!==t?t:"tDiffuse",e instanceof kn?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=Bn.clone(e.uniforms),this.material=new kn({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new Iy(this.material)}render(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}}class By extends Ly{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,n){const r=e.getContext(),i=e.state;let o,a;i.buffers.color.setMask(!1),i.buffers.depth.setMask(!1),i.buffers.color.setLocked(!0),i.buffers.depth.setLocked(!0),this.inverse?(o=0,a=1):(o=1,a=0),i.buffers.stencil.setTest(!0),i.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),i.buffers.stencil.setFunc(r.ALWAYS,o,4294967295),i.buffers.stencil.setClear(a),i.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),i.buffers.color.setLocked(!1),i.buffers.depth.setLocked(!1),i.buffers.stencil.setLocked(!1),i.buffers.stencil.setFunc(r.EQUAL,1,4294967295),i.buffers.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),i.buffers.stencil.setLocked(!0)}}class ky extends Ly{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class Ny{constructor(e,t){if(this.renderer=e,void 0===t){const n={minFilter:R,magFilter:R,format:k},r=e.getSize(new me);this._pixelRatio=e.getPixelRatio(),this._width=r.width,this._height=r.height,(t=new De(this._width*this._pixelRatio,this._height*this._pixelRatio,n)).texture.name="EffectComposer.rt1"}else this._pixelRatio=1,this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],void 0===Py&&console.error("THREE.EffectComposer relies on CopyShader"),void 0===Oy&&console.error("THREE.EffectComposer relies on ShaderPass"),this.copyPass=new Oy(Py),this.clock=new CA}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);-1!==t&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t1?n-1:0),i=1;i=0&&i<1?(s=o,A=a):i>=1&&i<2?(s=a,A=o):i>=2&&i<3?(A=o,l=a):i>=3&&i<4?(A=a,l=o):i>=4&&i<5?(s=a,l=o):i>=5&&i<6&&(s=o,l=a);var c=n-o/2;return r(s+c,A+c,l+c)}var ex={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var tx=/^#[a-fA-F0-9]{6}$/,nx=/^#[a-fA-F0-9]{8}$/,rx=/^#[a-fA-F0-9]{3}$/,ix=/^#[a-fA-F0-9]{4}$/,ox=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,ax=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,sx=/^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,Ax=/^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;function lx(e){if("string"!=typeof e)throw new Zy(3);var t=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return ex[t]?"#"+ex[t]:e}(e);if(t.match(tx))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(nx)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(rx))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(ix)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var i=ox.exec(t);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var o=ax.exec(t.substring(0,50));if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10),alpha:parseFloat(""+o[4])};var a=sx.exec(t);if(a){var s="rgb("+$y(parseInt(""+a[1],10),parseInt(""+a[2],10)/100,parseInt(""+a[3],10)/100)+")",A=ox.exec(s);if(!A)throw new Zy(4,t,s);return{red:parseInt(""+A[1],10),green:parseInt(""+A[2],10),blue:parseInt(""+A[3],10)}}var l=Ax.exec(t.substring(0,50));if(l){var c="rgb("+$y(parseInt(""+l[1],10),parseInt(""+l[2],10)/100,parseInt(""+l[3],10)/100)+")",u=ox.exec(c);if(!u)throw new Zy(4,t,c);return{red:parseInt(""+u[1],10),green:parseInt(""+u[2],10),blue:parseInt(""+u[3],10),alpha:parseFloat(""+l[4])}}throw new Zy(5)}var cx=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function ux(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function hx(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return cx("#"+ux(e)+ux(t)+ux(n));if("object"==typeof e&&void 0===t&&void 0===n)return cx("#"+ux(e.red)+ux(e.green)+ux(e.blue));throw new Zy(6)}function dx(e,t,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=t?e.apply(this,r):dx(e,t,r)}}function fx(e){return dx(e,e.length,[])}function px(e,t){if("transparent"===t)return t;var n,r,i,o=lx(t),a="number"==typeof o.alpha?o.alpha:1;return function(e,t,n,r){if("string"==typeof e&&"number"==typeof t){var i=lx(e);return"rgba("+i.red+","+i.green+","+i.blue+","+t+")"}if("number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r)return r>=1?hx(e,t,n):"rgba("+e+","+t+","+n+","+r+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?hx(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new Zy(7)}(Fy({},o,{alpha:(n=0,r=1,i=(100*a+100*parseFloat(e))/100,Math.max(n,Math.min(r,i)))}))}var mx=fx(px);function gx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vx(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||xx(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yx(e){return function(e){if(Array.isArray(e))return bx(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||xx(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xx(e,t){if(e){if("string"==typeof e)return bx(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bx(e,t):void 0}}function bx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=arguments.length,i=new Array(r>3?r-3:0),o=3;o2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=e.camera;if(t){var o=new _x.Vector3(0,0,0),a=2*Math.max.apply(Math,yx(Object.entries(t).map((function(e){var t=vx(e,2),n=t[0],r=t[1];return Math.max.apply(Math,yx(r.map((function(e){return Math.abs(o[n]-e)}))))})))),s=(1-2*r/e.height)*i.fov,A=a/Math.atan(s*Math.PI/180),l=A/i.aspect,c=Math.max(A,l);if(c>0){var u=o.clone().sub(i.position).normalize().multiplyScalar(-c);this.cameraPosition(u,o,n)}}return this},getBbox:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=new _x.Box3(new _x.Vector3(0,0,0),new _x.Vector3(0,0,0)),r=e.objects.filter(t);return r.length?(r.forEach((function(e){return n.expandByObject(e)})),Object.assign.apply(Object,yx(["x","y","z"].map((function(e){return gx({},e,[n.min[e],n.max[e]])}))))):null},getScreenCoords:function(e,t,n,r){var i=new _x.Vector3(t,n,r);return i.project(this.camera()),{x:(i.x+1)*e.width/2,y:-(i.y-1)*e.height/2}},getSceneCoords:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=new _x.Vector2(t/e.width*2-1,-n/e.height*2+1),o=new _x.Raycaster;return o.setFromCamera(i,e.camera),Object.assign({},o.ray.at(r,new _x.Vector3))},intersectingObjects:function(e,t,n){var r=new _x.Vector2(t/e.width*2-1,-n/e.height*2+1),i=new _x.Raycaster;return i.params.Line.threshold=e.lineHoverPrecision,i.setFromCamera(r,e.camera),i.intersectObjects(e.objects,!0)},renderer:function(e){return e.renderer},scene:function(e){return e.scene},camera:function(e){return e.camera},postProcessingComposer:function(e){return e.postProcessingComposer},controls:function(e){return e.controls},tbControls:function(e){return e.controls}},stateInit:function(){return{scene:new _x.Scene,camera:new _x.PerspectiveCamera,clock:new _x.Clock}},init:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.controlType,i=void 0===r?"trackball":r,o=n.rendererConfig,a=void 0===o?{}:o,s=n.extraRenderers,A=void 0===s?[]:s,l=n.waitForLoadComplete,c=void 0===l||l;e.innerHTML="",e.appendChild(t.container=document.createElement("div")),t.container.className="scene-container",t.container.style.position="relative",t.container.appendChild(t.navInfo=document.createElement("div")),t.navInfo.className="scene-nav-info",t.navInfo.textContent={orbit:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",trackball:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",fly:"WASD: move, R|F: up | down, Q|E: roll, up|down: pitch, left|right: yaw"}[i]||"",t.navInfo.style.display=t.showNavInfo?null:"none",t.toolTipElem=document.createElement("div"),t.toolTipElem.classList.add("scene-tooltip"),t.container.appendChild(t.toolTipElem),t.pointerPos=new _x.Vector2,t.pointerPos.x=-2,t.pointerPos.y=-2,["pointermove","pointerdown"].forEach((function(e){return t.container.addEventListener(e,(function(n){if("pointerdown"===e&&(t.isPointerPressed=!0),!t.isPointerDragging&&"pointermove"===n.type&&(n.pressure>0||t.isPointerPressed)&&("touch"!==n.pointerType||void 0===n.movementX||[n.movementX,n.movementY].some((function(e){return Math.abs(e)>1})))&&(t.isPointerDragging=!0),t.enablePointerInteraction){var r=(i=t.container,o=i.getBoundingClientRect(),a=window.pageXOffset||document.documentElement.scrollLeft,s=window.pageYOffset||document.documentElement.scrollTop,{top:o.top+s,left:o.left+a});t.pointerPos.x=n.pageX-r.left,t.pointerPos.y=n.pageY-r.top,t.toolTipElem.style.top="".concat(t.pointerPos.y,"px"),t.toolTipElem.style.left="".concat(t.pointerPos.x,"px"),t.toolTipElem.style.transform="translate(-".concat(t.pointerPos.x/t.width*100,"%, 21px)")}var i,o,a,s}),{passive:!0})})),t.container.addEventListener("pointerup",(function(e){t.isPointerPressed=!1,t.isPointerDragging&&(t.isPointerDragging=!1,!t.clickAfterDrag)||requestAnimationFrame((function(){0===e.button&&t.onClick(t.hoverObj||null,e,t.intersectionPoint),2===e.button&&t.onRightClick&&t.onRightClick(t.hoverObj||null,e,t.intersectionPoint)}))}),{passive:!0,capture:!0}),t.container.addEventListener("contextmenu",(function(e){t.onRightClick&&e.preventDefault()})),t.renderer=new _x.WebGLRenderer(Object.assign({antialias:!0,alpha:!0},a)),t.renderer.setPixelRatio(Math.min(2,window.devicePixelRatio)),t.container.appendChild(t.renderer.domElement),t.extraRenderers=A,t.extraRenderers.forEach((function(e){e.domElement.style.position="absolute",e.domElement.style.top="0px",e.domElement.style.pointerEvents="none",t.container.appendChild(e.domElement)})),t.postProcessingComposer=new Ny(t.renderer),t.postProcessingComposer.addPass(new Uy(t.scene,t.camera)),t.controls=new{trackball:_y,orbit:Ey,fly:Cy}[i](t.camera,t.renderer.domElement),"fly"===i&&(t.controls.movementSpeed=300,t.controls.rollSpeed=Math.PI/6,t.controls.dragToLook=!0),"trackball"!==i&&"orbit"!==i||(t.controls.minDistance=.1,t.controls.maxDistance=t.skyRadius,t.controls.addEventListener("start",(function(){t.controlsEngaged=!0})),t.controls.addEventListener("change",(function(){t.controlsEngaged&&(t.controlsDragging=!0)})),t.controls.addEventListener("end",(function(){t.controlsEngaged=!1,t.controlsDragging=!1}))),[t.renderer,t.postProcessingComposer].concat(yx(t.extraRenderers)).forEach((function(e){return e.setSize(t.width,t.height)})),t.camera.aspect=t.width/t.height,t.camera.updateProjectionMatrix(),t.camera.position.z=1e3,t.scene.add(t.skysphere=new _x.Mesh),t.skysphere.visible=!1,t.loadComplete=t.scene.visible=!c,window.scene=t.scene},update:function(e,t){if(e.width&&e.height&&(t.hasOwnProperty("width")||t.hasOwnProperty("height"))&&(e.container.style.width=e.width,e.container.style.height=e.height,[e.renderer,e.postProcessingComposer].concat(yx(e.extraRenderers)).forEach((function(t){return t.setSize(e.width,e.height)})),e.camera.aspect=e.width/e.height,e.camera.updateProjectionMatrix()),t.hasOwnProperty("skyRadius")&&e.skyRadius&&(e.controls.hasOwnProperty("maxDistance")&&t.skyRadius&&(e.controls.maxDistance=e.skyRadius),e.camera.far=2.5*e.skyRadius,e.camera.updateProjectionMatrix(),e.skysphere.geometry=new _x.SphereGeometry(e.skyRadius)),t.hasOwnProperty("backgroundColor")){var n=lx(e.backgroundColor).alpha;void 0===n&&(n=1),e.renderer.setClearColor(new _x.Color(mx(1,e.backgroundColor)),n)}function r(){e.loadComplete=e.scene.visible=!0}t.hasOwnProperty("backgroundImageUrl")&&(e.backgroundImageUrl?(new _x.TextureLoader).load(e.backgroundImageUrl,(function(t){e.skysphere.material=new _x.MeshBasicMaterial({map:t,side:_x.BackSide}),e.skysphere.visible=!0,e.onBackgroundImageLoaded&&setTimeout(e.onBackgroundImageLoaded),!e.loadComplete&&r()})):(e.skysphere.visible=!1,e.skysphere.material.map=null,!e.loadComplete&&r())),t.hasOwnProperty("showNavInfo")&&(e.navInfo.style.display=e.showNavInfo?null:"none"),t.hasOwnProperty("objects")&&((t.objects||[]).forEach((function(t){return e.scene.remove(t)})),e.objects.forEach((function(t){return e.scene.add(t)})))}});function Mx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Sx(e){for(var t=1;t=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}function Cx(e){return function(e){if(Array.isArray(e))return Rx(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Rx(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rx(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rx(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?i-1:0),a=1;a1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=o();if(void 0===t.lat&&void 0===t.lng&&void 0===t.altitude)return r;var i=Object.assign({},r,t);if(["lat","lng","altitude"].forEach((function(e){return i[e]=+i[e]})),n){for(;r.lng-i.lng>180;)r.lng-=360;for(;r.lng-i.lng<-180;)r.lng+=360;new Sl.Tween(r).to(i,n).easing(Sl.Easing.Cubic.InOut).onUpdate(a).start()}else a(i);return this;function o(){return e.globe.toGeoCoords(e.renderObjs.cameraPosition())}function a(t){var n=t.lat,r=t.lng,i=t.altitude;e.renderObjs.cameraPosition(e.globe.getCoords(n,r,i))}},getScreenCoords:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),sb;function t(t,n,r,i,s){for(var A=t[n],l=0;l0?", expected one of type ["+s.join(", ")+"]":"")+".")}))},shape:function(e){return s((function(t,n,r,i,o){var s=t[n],A=u(s);if("object"!==A)return new a("Invalid "+i+" `"+o+"` of type `"+A+"` supplied to `"+r+"`, expected `object`.");for(var c in e){var d=e[c];if("function"!=typeof d)return l(r,i,o,c,h(d));var f=d(s,c,r,i,o+"."+c,ib);if(f)return f}return null}))},exact:function(e){return s((function(t,n,r,i,o){var s=t[n],A=u(s);if("object"!==A)return new a("Invalid "+i+" `"+o+"` of type `"+A+"` supplied to `"+r+"`, expected `object`.");var c=rb({},t[n],e);for(var d in c){var f=e[d];if(ob(e,d)&&"function"!=typeof f)return l(r,i,o,d,h(f));if(!f)return new a("Invalid "+i+" `"+o+"` key `"+d+"` supplied to `"+r+"`.\nBad object: "+JSON.stringify(t[n],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var p=f(s,d,r,i,o+"."+d,ib);if(p)return p}return null}))}};function o(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function a(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function s(e){var n={},i=0;function o(o,s,A,l,c,u,h){if(l=l||r,u=u||A,h!==ib){if(t){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}if("undefined"!=typeof console){var f=l+":"+A;!n[f]&&i<3&&(eb("You are manually calling a React.PropTypes validation function for the `"+u+"` prop on `"+l+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),n[f]=!0,i++)}}return null==s[A]?o?null===s[A]?new a("The "+c+" `"+u+"` is marked as required in `"+l+"`, but its value is `null`."):new a("The "+c+" `"+u+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:e(s,A,l,c,u)}var s=o.bind(null,!1);return s.isRequired=o.bind(null,!0),s}function A(e){return s((function(t,n,r,i,o,s){var A=t[n];return u(A)!==e?new a("Invalid "+i+" `"+o+"` of type `"+h(A)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function l(e,t,n,r,i){return new a((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+i+"`.")}function c(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(c);if(null===t||e(t))return!0;var r=function(e){var t=e&&(n&&e[n]||e["@@iterator"]);if("function"==typeof t)return t}(t);if(!r)return!1;var i,o=r.call(t);if(r!==t.entries){for(;!(i=o.next()).done;)if(!c(i.value))return!1}else for(;!(i=o.next()).done;){var a=i.value;if(a&&!c(a[1]))return!1}return!0;default:return!1}}function u(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function h(e){if(null==e)return""+e;var t=u(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function d(e){var t=h(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return a.prototype=Error.prototype,i.checkPropTypes=ab,i.resetWarningCache=ab.resetWarningCache,i.PropTypes=i,i}(Ab.isElement,!0);var lb=Ux.exports,cb={width:lb.number,height:lb.number,backgroundColor:lb.string,backgroundImageUrl:lb.string,globeImageUrl:lb.string,bumpImageUrl:lb.string,showGlobe:lb.bool,showGraticules:lb.bool,showAtmosphere:lb.bool,atmosphereColor:lb.string,atmosphereAltitude:lb.number,globeMaterial:lb.object,onGlobeReady:lb.func,onGlobeClick:lb.func,onGlobeRightClick:lb.func,pointsData:lb.arrayOf(lb.object),pointLat:lb.oneOfType([lb.number,lb.string,lb.func]),pointLng:lb.oneOfType([lb.number,lb.string,lb.func]),pointColor:lb.oneOfType([lb.string,lb.func]),pointAltitude:lb.oneOfType([lb.number,lb.string,lb.func]),pointRadius:lb.oneOfType([lb.number,lb.string,lb.func]),pointResolution:lb.number,pointsMerge:lb.bool,pointsTransitionDuration:lb.number,pointLabel:lb.oneOfType([lb.string,lb.func]),onPointClick:lb.func,onPointRightClick:lb.func,onPointHover:lb.func,arcsData:lb.arrayOf(lb.object),arcStartLat:lb.oneOfType([lb.number,lb.string,lb.func]),arcStartLng:lb.oneOfType([lb.number,lb.string,lb.func]),arcEndLat:lb.oneOfType([lb.number,lb.string,lb.func]),arcEndLng:lb.oneOfType([lb.number,lb.string,lb.func]),arcColor:lb.oneOfType([lb.string,lb.arrayOf(lb.string),lb.func]),arcAltitude:lb.oneOfType([lb.number,lb.string,lb.func]),arcAltitudeAutoScale:lb.oneOfType([lb.number,lb.string,lb.func]),arcStroke:lb.oneOfType([lb.number,lb.string,lb.func]),arcCurveResolution:lb.number,arcCircularResolution:lb.number,arcDashLength:lb.oneOfType([lb.number,lb.string,lb.func]),arcDashGap:lb.oneOfType([lb.number,lb.string,lb.func]),arcDashInitialGap:lb.oneOfType([lb.number,lb.string,lb.func]),arcDashAnimateTime:lb.oneOfType([lb.number,lb.string,lb.func]),arcsTransitionDuration:lb.number,arcLabel:lb.oneOfType([lb.string,lb.func]),onArcClick:lb.func,onArcRightClick:lb.func,onArcHover:lb.func,polygonsData:lb.arrayOf(lb.object),polygonGeoJsonGeometry:lb.oneOfType([lb.string,lb.func]),polygonCapColor:lb.oneOfType([lb.string,lb.func]),polygonCapMaterial:lb.oneOfType([lb.object,lb.string,lb.func]),polygonSideColor:lb.oneOfType([lb.string,lb.func]),polygonSideMaterial:lb.oneOfType([lb.object,lb.string,lb.func]),polygonStrokeColor:lb.oneOfType([lb.string,lb.func]),polygonAltitude:lb.oneOfType([lb.number,lb.string,lb.func]),polygonCapCurvatureResolution:lb.oneOfType([lb.number,lb.string,lb.func]),polygonsTransitionDuration:lb.number,polygonLabel:lb.oneOfType([lb.string,lb.func]),onPolygonClick:lb.func,onPolygonRightClick:lb.func,onPolygonHover:lb.func,pathsData:lb.array,pathPoints:lb.oneOfType([lb.array,lb.string,lb.func]),pathPointLat:lb.oneOfType([lb.number,lb.string,lb.func]),pathPointLng:lb.oneOfType([lb.number,lb.string,lb.func]),pathPointAlt:lb.oneOfType([lb.number,lb.string,lb.func]),pathResolution:lb.number,pathColor:lb.oneOfType([lb.string,lb.arrayOf(lb.string),lb.func]),pathStroke:lb.oneOfType([lb.number,lb.string,lb.func]),pathDashLength:lb.oneOfType([lb.number,lb.string,lb.func]),pathDashGap:lb.oneOfType([lb.number,lb.string,lb.func]),pathDashInitialGap:lb.oneOfType([lb.number,lb.string,lb.func]),pathDashAnimateTime:lb.oneOfType([lb.number,lb.string,lb.func]),pathTransitionDuration:lb.number,pathLabel:lb.oneOfType([lb.string,lb.func]),onPathClick:lb.func,onPathRightClick:lb.func,onPathHover:lb.func,hexBinPointsData:lb.arrayOf(lb.object),hexBinPointLat:lb.oneOfType([lb.number,lb.string,lb.func]),hexBinPointLng:lb.oneOfType([lb.number,lb.string,lb.func]),hexBinPointWeight:lb.oneOfType([lb.number,lb.string,lb.func]),hexBinResolution:lb.number,hexMargin:lb.oneOfType([lb.number,lb.func]),hexTopColor:lb.func,hexSideColor:lb.func,hexAltitude:lb.oneOfType([lb.number,lb.func]),hexTopCurvatureResolution:lb.number,hexBinMerge:lb.bool,hexTransitionDuration:lb.number,hexLabel:lb.oneOfType([lb.string,lb.func]),onHexClick:lb.func,onHexRightClick:lb.func,onHexHover:lb.func,hexPolygonsData:lb.arrayOf(lb.object),hexPolygonGeoJsonGeometry:lb.oneOfType([lb.string,lb.func]),hexPolygonColor:lb.oneOfType([lb.string,lb.func]),hexPolygonAltitude:lb.oneOfType([lb.number,lb.string,lb.func]),hexPolygonResolution:lb.oneOfType([lb.number,lb.string,lb.func]),hexPolygonMargin:lb.oneOfType([lb.number,lb.string,lb.func]),hexPolygonCurvatureResolution:lb.oneOfType([lb.number,lb.string,lb.func]),hexPolygonsTransitionDuration:lb.number,hexPolygonLabel:lb.oneOfType([lb.string,lb.func]),onHexPolygonClick:lb.func,onHexPolygonRightClick:lb.func,onHexPolygonHover:lb.func,tilesData:lb.arrayOf(lb.object),tileLat:lb.oneOfType([lb.number,lb.string,lb.func]),tileLng:lb.oneOfType([lb.number,lb.string,lb.func]),tileAltitude:lb.oneOfType([lb.number,lb.string,lb.func]),tileWidth:lb.oneOfType([lb.number,lb.string,lb.func]),tileHeight:lb.oneOfType([lb.number,lb.string,lb.func]),tileUseGlobeProjection:lb.oneOfType([lb.bool,lb.string,lb.func]),tileMaterial:lb.oneOfType([lb.object,lb.string,lb.func]),tileCurvatureResolution:lb.oneOfType([lb.number,lb.string,lb.func]),tilesTransitionDuration:lb.number,tileLabel:lb.oneOfType([lb.string,lb.func]),onTileClick:lb.func,onTileRightClick:lb.func,onTileHover:lb.func,ringsData:lb.arrayOf(lb.object),ringLat:lb.oneOfType([lb.number,lb.string,lb.func]),ringLng:lb.oneOfType([lb.number,lb.string,lb.func]),ringAltitude:lb.oneOfType([lb.number,lb.string,lb.func]),ringColor:lb.oneOfType([lb.string,lb.arrayOf(lb.string),lb.func]),ringResolution:lb.number,ringMaxRadius:lb.oneOfType([lb.number,lb.string,lb.func]),ringPropagationSpeed:lb.oneOfType([lb.number,lb.string,lb.func]),ringRepeatPeriod:lb.oneOfType([lb.number,lb.string,lb.func]),labelsData:lb.arrayOf(lb.object),labelLat:lb.oneOfType([lb.number,lb.string,lb.func]),labelLng:lb.oneOfType([lb.number,lb.string,lb.func]),labelAltitude:lb.oneOfType([lb.number,lb.string,lb.func]),labelRotation:lb.oneOfType([lb.number,lb.string,lb.func]),labelText:lb.oneOfType([lb.string,lb.func]),labelSize:lb.oneOfType([lb.number,lb.string,lb.func]),labelTypeFace:lb.object,labelColor:lb.oneOfType([lb.string,lb.func]),labelResolution:lb.number,labelIncludeDot:lb.oneOfType([lb.bool,lb.string,lb.func]),labelDotRadius:lb.oneOfType([lb.number,lb.string,lb.func]),labelDotOrientation:lb.oneOfType([lb.string,lb.func]),labelsTransitionDuration:lb.number,labelLabel:lb.oneOfType([lb.string,lb.func]),onLabelClick:lb.func,onLabelRightClick:lb.func,onLabelHover:lb.func,customLayerData:lb.arrayOf(lb.object),customThreeObject:lb.oneOfType([lb.object,lb.string,lb.func]),customThreeObjectUpdate:lb.oneOfType([lb.string,lb.func]),customLayerLabel:lb.oneOfType([lb.string,lb.func]),onCustomLayerClick:lb.func,onCustomLayerRightClick:lb.func,onCustomLayerHover:lb.func,enablePointerInteraction:lb.bool,pointerEventsFilter:lb.func,lineHoverPrecision:lb.number,onZoom:lb.func},ub=function(t,r){var i="object"===c(r)?r:{wrapperElementType:r,methodNames:(arguments.length<=2?void 0:arguments[2])||void 0,initPropNames:(arguments.length<=3?void 0:arguments[3])||void 0},o=i.wrapperElementType,a=void 0===o?"div":o,A=i.nodeMapper,d=void 0===A?function(e){return e}:A,f=i.methodNames,p=void 0===f?[]:f,m=i.initPropNames,g=void 0===m?[]:m;return e.forwardRef((function(r,i){var o=e.useRef(),A=u(e.useState({}),2),c=A[0],f=A[1];e.useEffect((function(){return f(r)}));var m=e.useMemo((function(){var e=l(g.filter((function(e){return r.hasOwnProperty(e)})).map((function(e){return[e,r[e]]})));return t(e)}),[]);e.useLayoutEffect((function(){m(d(o.current))}),[]),e.useEffect((function(){return m._destructor instanceof Function?m._destructor:void 0}),[]);var v=e.useCallback((function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r