Files
wavelog/assets/js/globe/globe.gl.min.js

36 lines
1.0 MiB
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Version 2.32.2 globe.gl - https://github.com/vasturiano/globe.gl
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Globe=e()}(this,(function(){"use strict";function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function e(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function n(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function r(t,e,r){return(e=n(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function a(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t)||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(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}(".scene-container .clickable {\n cursor: pointer;\n}");const s="161",A={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},l=0,c=1,u=2,h=3,d=1,f=2,p=3,m=0,g=1,v=100,_=0,y=1,x=2,b=0,M=1,w=2,E=3,S=4,T=5,C=6,R=301,P=302,L=306,D=1e3,O=1001,I=1002,q=1003,U=1005,N=1006,B=1007,k=1008,F=1009,z=1012,G=1013,H=1014,j=1015,V=1016,W=1020,X=1023,Q=1026,Y=1027,Z=33776,K=33777,J=33778,$=33779,tt=36492,et=3001,nt="",rt="srgb",it="srgb-linear",at="display-p3",ot="display-p3-linear",st="linear",At="srgb",lt="rec709",ct="p3",ut=7680,ht=35044,dt="300 es",ft=1035,pt=2e3,mt=2001;class gt{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)}hasEventListener(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)}removeEventListener(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}dispatchEvent(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,r=n.length;e<r;e++)n[e].call(this,t);t.target=null}}}const vt=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let _t=1234567;const yt=Math.PI/180,xt=180/Math.PI;function bt(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(vt[255&t]+vt[t>>8&255]+vt[t>>16&255]+vt[t>>24&255]+"-"+vt[255&e]+vt[e>>8&255]+"-"+vt[e>>16&15|64]+vt[e>>24&255]+"-"+vt[63&n|128]+vt[n>>8&255]+"-"+vt[n>>16&255]+vt[n>>24&255]+vt[255&r]+vt[r>>8&255]+vt[r>>16&255]+vt[r>>24&255]).toLowerCase()}function Mt(t,e,n){return Math.max(e,Math.min(n,t))}function wt(t,e){return(t%e+e)%e}function Et(t,e,n){return(1-n)*t+n*e}function St(t){return 0==(t&t-1)&&0!==t}function Tt(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Ct(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Rt(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(4294967295*t);case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int32Array:return Math.round(2147483647*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}}const Pt={DEG2RAD:yt,RAD2DEG:xt,generateUUID:bt,clamp:Mt,euclideanModulo:wt,mapLinear:function(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)},inverseLerp:function(t,e,n){return t!==e?(n-t)/(e-t):0},lerp:Et,damp:function(t,e,n,r){return Et(t,e,1-Math.exp(-n*r))},pingpong:function(t,e=1){return e-Math.abs(wt(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){void 0!==t&&(_t=t);let e=_t+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*yt},radToDeg:function(t){return t*xt},isPowerOfTwo:St,ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:Tt,setQuaternionFromProperEuler:function(t,e,n,r,i){const a=Math.cos,o=Math.sin,s=a(n/2),A=o(n/2),l=a((e+r)/2),c=o((e+r)/2),u=a((e-r)/2),h=o((e-r)/2),d=a((r-e)/2),f=o((r-e)/2);switch(i){case"XYX":t.set(s*c,A*u,A*h,s*l);break;case"YZY":t.set(A*h,s*c,A*u,s*l);break;case"ZXZ":t.set(A*u,A*h,s*c,s*l);break;case"XZX":t.set(s*c,A*f,A*d,s*l);break;case"YXY":t.set(A*d,s*c,A*f,s*l);break;case"ZYZ":t.set(A*f,A*d,s*c,s*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:Rt,denormalize:Ct};class Lt{constructor(t=0,e=0){Lt.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,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=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.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}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Mt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),r=Math.sin(e),i=this.x-t.x,a=this.y-t.y;return this.x=i*n-a*r+t.x,this.y=i*r+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Dt{constructor(t,e,n,r,i,a,o,s,A){Dt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==t&&this.set(t,e,n,r,i,a,o,s,A)}set(t,e,n,r,i,a,o,s,A){const l=this.elements;return l[0]=t,l[1]=r,l[2]=o,l[3]=e,l[4]=i,l[5]=s,l[6]=n,l[7]=a,l[8]=A,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,i=this.elements,a=n[0],o=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],_=r[7],y=r[2],x=r[5],b=r[8];return i[0]=a*f+o*g+s*y,i[3]=a*p+o*v+s*x,i[6]=a*m+o*_+s*b,i[1]=A*f+l*g+c*y,i[4]=A*p+l*v+c*x,i[7]=A*m+l*_+c*b,i[2]=u*f+h*g+d*y,i[5]=u*p+h*v+d*x,i[8]=u*m+h*_+d*b,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],A=t[7],l=t[8];return e*a*l-e*o*A-n*i*l+n*o*s+r*i*A-r*a*s}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],A=t[7],l=t[8],c=l*a-o*A,u=o*s-l*i,h=A*i-a*s,d=e*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 t[0]=c*f,t[1]=(r*A-l*n)*f,t[2]=(o*n-r*a)*f,t[3]=u*f,t[4]=(l*e-r*s)*f,t[5]=(r*i-o*e)*f,t[6]=h*f,t[7]=(n*s-A*e)*f,t[8]=(a*e-n*i)*f,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,r,i,a,o){const s=Math.cos(i),A=Math.sin(i);return this.set(n*s,n*A,-n*(s*a+A*o)+a+t,-r*A,r*s,-r*(-A*a+s*o)+o+e,0,0,1),this}scale(t,e){return this.premultiply(Ot.makeScale(t,e)),this}rotate(t){return this.premultiply(Ot.makeRotation(-t)),this}translate(t,e){return this.premultiply(Ot.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}const Ot=new Dt;function It(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}function qt(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function Ut(){const t=qt("canvas");return t.style.display="block",t}const Nt={};function Bt(t){t in Nt||(Nt[t]=!0,console.warn(t))}const kt=(new Dt).set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),Ft=(new Dt).set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),zt={[it]:{transfer:st,primaries:lt,toReference:t=>t,fromReference:t=>t},[rt]:{transfer:At,primaries:lt,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[ot]:{transfer:st,primaries:ct,toReference:t=>t.applyMatrix3(Ft),fromReference:t=>t.applyMatrix3(kt)},[at]:{transfer:At,primaries:ct,toReference:t=>t.convertSRGBToLinear().applyMatrix3(Ft),fromReference:t=>t.applyMatrix3(kt).convertLinearToSRGB()}},Gt=new Set([it,ot]),Ht={enabled:!0,_workingColorSpace:it,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!Gt.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,e,n){if(!1===this.enabled||e===n||!e||!n)return t;const r=zt[e].toReference;return(0,zt[n].fromReference)(r(t))},fromWorkingColorSpace:function(t,e){return this.convert(t,this._workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this._workingColorSpace)},getPrimaries:function(t){return zt[t].primaries},getTransfer:function(t){return t===nt?st:zt[t].transfer}};function jt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Vt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}let Wt;class Xt{static getDataURL(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===Wt&&(Wt=qt("canvas")),Wt.width=t.width,Wt.height=t.height;const n=Wt.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Wt}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=qt("canvas");e.width=t.width,e.height=t.height;const n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);const r=n.getImageData(0,0,t.width,t.height),i=r.data;for(let t=0;t<i.length;t++)i[t]=255*jt(i[t]/255);return n.putImageData(r,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*jt(e[t]/255)):e[t]=jt(e[t]);return{data:e,width:t.width,height:t.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}}let Qt=0;class Yt{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Qt++}),this.uuid=bt(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(null!==r){let t;if(Array.isArray(r)){t=[];for(let e=0,n=r.length;e<n;e++)r[e].isDataTexture?t.push(Zt(r[e].image)):t.push(Zt(r[e]))}else t=Zt(r);n.url=t}return e||(t.images[this.uuid]=n),n}}function Zt(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?Xt.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Kt=0;class Jt extends gt{constructor(t=Jt.DEFAULT_IMAGE,e=Jt.DEFAULT_MAPPING,n=1001,r=1001,i=1006,a=1008,o=1023,s=1009,A=Jt.DEFAULT_ANISOTROPY,l=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Kt++}),this.uuid=bt(),this.name="",this.source=new Yt(t),this.mipmaps=[],this.mapping=e,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=a,this.anisotropy=A,this.format=o,this.internalFormat=null,this.type=s,this.offset=new Lt(0,0),this.repeat=new Lt(1,1),this.center=new Lt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Dt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,"string"==typeof l?this.colorSpace=l:(Bt("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=l===et?rt:nt),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t=null){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.channel=t.channel,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.colorSpace=t.colorSpace,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),e||(t.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case D:t.x=t.x-Math.floor(t.x);break;case O:t.x=t.x<0?0:1;break;case I:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case D:t.y=t.y-Math.floor(t.y);break;case O:t.y=t.y<0?0:1;break;case I:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return Bt("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===rt?et:3e3}set encoding(t){Bt("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=t===et?rt:nt}}Jt.DEFAULT_IMAGE=null,Jt.DEFAULT_MAPPING=300,Jt.DEFAULT_ANISOTROPY=1;class $t{constructor(t=0,e=0,n=0,r=1){$t.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,i=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*e+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*e+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*e+a[7]*n+a[11]*r+a[15]*i,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,r,i;const a=.01,o=.1,s=t.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)<a&&Math.abs(c-f)<a&&Math.abs(d-p)<a){if(Math.abs(l+u)<o&&Math.abs(c+f)<o&&Math.abs(d+p)<o&&Math.abs(A+h+m-3)<o)return this.set(1,0,0,0),this;e=Math.PI;const t=(A+1)/2,s=(h+1)/2,g=(m+1)/2,v=(l+u)/4,_=(c+f)/4,y=(d+p)/4;return t>s&&t>g?t<a?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(t),r=v/n,i=_/n):s>g?s<a?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(s),n=v/r,i=y/r):g<a?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(g),n=_/i,r=y/i),this.set(n,r,i,e),this}let g=Math.sqrt((p-d)*(p-d)+(c-f)*(c-f)+(u-l)*(u-l));return Math.abs(g)<.001&&(g=1),this.x=(p-d)/g,this.y=(c-f)/g,this.z=(u-l)/g,this.w=Math.acos((A+h+m-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class te extends gt{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new $t(0,0,t,e),this.scissorTest=!1,this.viewport=new $t(0,0,t,e);const r={width:t,height:e,depth:1};void 0!==n.encoding&&(Bt("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===et?rt:nt),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:N,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},n),this.texture=new Jt(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=n.generateMipmaps,this.texture.internalFormat=n.internalFormat,this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}setSize(t,e,n=1){this.width===t&&this.height===e&&this.depth===n||(this.width=t,this.height=e,this.depth=n,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.isRenderTargetTexture=!0;const e=Object.assign({},t.texture.image);return this.texture.source=new Yt(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ee extends te{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}}class ne extends Jt{constructor(t=null,e=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:r},this.magFilter=q,this.minFilter=q,this.wrapR=O,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class re extends Jt{constructor(t=null,e=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:r},this.magFilter=q,this.minFilter=q,this.wrapR=O,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ie{constructor(t=0,e=0,n=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=r}static slerpFlat(t,e,n,r,i,a,o){let s=n[r+0],A=n[r+1],l=n[r+2],c=n[r+3];const u=i[a+0],h=i[a+1],d=i[a+2],f=i[a+3];if(0===o)return t[e+0]=s,t[e+1]=A,t[e+2]=l,void(t[e+3]=c);if(1===o)return t[e+0]=u,t[e+1]=h,t[e+2]=d,void(t[e+3]=f);if(c!==f||s!==u||A!==h||l!==d){let t=1-o;const e=s*u+A*h+l*d+c*f,n=e>=0?1:-1,r=1-e*e;if(r>Number.EPSILON){const i=Math.sqrt(r),a=Math.atan2(i,e*n);t=Math.sin(t*a)/i,o=Math.sin(o*a)/i}const i=o*n;if(s=s*t+u*i,A=A*t+h*i,l=l*t+d*i,c=c*t+f*i,t===1-o){const t=1/Math.sqrt(s*s+A*A+l*l+c*c);s*=t,A*=t,l*=t,c*=t}}t[e]=s,t[e+1]=A,t[e+2]=l,t[e+3]=c}static multiplyQuaternionsFlat(t,e,n,r,i,a){const o=n[r],s=n[r+1],A=n[r+2],l=n[r+3],c=i[a],u=i[a+1],h=i[a+2],d=i[a+3];return t[e]=o*d+l*c+s*h-A*u,t[e+1]=s*d+l*u+A*c-o*h,t[e+2]=A*d+l*h+o*u-s*c,t[e+3]=l*d-o*c-s*u-A*h,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t._x,r=t._y,i=t._z,a=t._order,o=Math.cos,s=Math.sin,A=o(n/2),l=o(r/2),c=o(i/2),u=s(n/2),h=s(r/2),d=s(i/2);switch(a){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: "+a)}return!0===e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],r=e[4],i=e[8],a=e[1],o=e[5],s=e[9],A=e[2],l=e[6],c=e[10],u=n+o+c;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(l-s)*t,this._y=(i-A)*t,this._z=(a-r)*t}else if(n>o&&n>c){const t=2*Math.sqrt(1+n-o-c);this._w=(l-s)/t,this._x=.25*t,this._y=(r+a)/t,this._z=(i+A)/t}else if(o>c){const t=2*Math.sqrt(1+o-n-c);this._w=(i-A)/t,this._x=(r+a)/t,this._y=.25*t,this._z=(s+l)/t}else{const t=2*Math.sqrt(1+c-n-o);this._w=(a-r)/t,this._x=(i+A)/t,this._y=(s+l)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Mt(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const r=Math.min(1,e/n);return this.slerp(t,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(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,r=t._y,i=t._z,a=t._w,o=e._x,s=e._y,A=e._z,l=e._w;return this._x=n*l+a*o+r*A-i*s,this._y=r*l+a*s+i*o-n*A,this._z=i*l+a*A+n*s-r*o,this._w=a*l-n*o-r*s-i*A,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,r=this._y,i=this._z,a=this._w;let o=a*t._w+n*t._x+r*t._y+i*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;const s=1-o*o;if(s<=Number.EPSILON){const t=1-e;return this._w=t*a+e*this._w,this._x=t*n+e*this._x,this._y=t*r+e*this._y,this._z=t*i+e*this._z,this.normalize(),this}const A=Math.sqrt(s),l=Math.atan2(A,o),c=Math.sin((1-e)*l)/A,u=Math.sin(e*l)/A;return this._w=a*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(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=Math.random(),e=Math.sqrt(1-t),n=Math.sqrt(t),r=2*Math.PI*Math.random(),i=2*Math.PI*Math.random();return this.set(e*Math.cos(r),n*Math.sin(i),n*Math.cos(i),e*Math.sin(r))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class ae{constructor(t=0,e=0,n=0){ae.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(se.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(se.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6]*r,this.y=i[1]*e+i[4]*n+i[7]*r,this.z=i[2]*e+i[5]*n+i[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,r=this.z,i=t.elements,a=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(t){const e=this.x,n=this.y,r=this.z,i=t.x,a=t.y,o=t.z,s=t.w,A=2*(a*r-o*n),l=2*(o*e-i*r),c=2*(i*n-a*e);return this.x=e+s*A+a*c-o*l,this.y=n+s*l+o*A-i*c,this.z=r+s*c+i*l-a*A,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,r=this.z,i=t.elements;return this.x=i[0]*e+i[4]*n+i[8]*r,this.y=i[1]*e+i[5]*n+i[9]*r,this.z=i[2]*e+i[6]*n+i[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,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=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,r=t.y,i=t.z,a=e.x,o=e.y,s=e.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return oe.copy(this).projectOnVector(t),this.sub(oe)}reflect(t){return this.sub(oe.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(Mt(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,n=Math.sqrt(1-t**2);return this.x=n*Math.cos(e),this.y=n*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const oe=new ae,se=new ie;class Ae{constructor(t=new ae(1/0,1/0,1/0),e=new ae(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(ce.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(ce.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const n=ce.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const n=t.geometry;if(void 0!==n){const r=n.getAttribute("position");if(!0===e&&void 0!==r&&!0!==t.isInstancedMesh)for(let e=0,n=r.count;e<n;e++)!0===t.isMesh?t.getVertexPosition(e,ce):ce.fromBufferAttribute(r,e),ce.applyMatrix4(t.matrixWorld),this.expandByPoint(ce);else void 0!==t.boundingBox?(null===t.boundingBox&&t.computeBoundingBox(),ue.copy(t.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),ue.copy(n.boundingBox)),ue.applyMatrix4(t.matrixWorld),this.union(ue)}const r=t.children;for(let t=0,n=r.length;t<n;t++)this.expandByObject(r[t],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,ce),ce.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(ve),_e.subVectors(this.max,ve),he.subVectors(t.a,ve),de.subVectors(t.b,ve),fe.subVectors(t.c,ve),pe.subVectors(de,he),me.subVectors(fe,de),ge.subVectors(he,fe);let e=[0,-pe.z,pe.y,0,-me.z,me.y,0,-ge.z,ge.y,pe.z,0,-pe.x,me.z,0,-me.x,ge.z,0,-ge.x,-pe.y,pe.x,0,-me.y,me.x,0,-ge.y,ge.x,0];return!!be(e,he,de,fe,_e)&&(e=[1,0,0,0,1,0,0,0,1],!!be(e,he,de,fe,_e)&&(ye.crossVectors(pe,me),e=[ye.x,ye.y,ye.z],be(e,he,de,fe,_e)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,ce).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=.5*this.getSize(ce).length()),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(le[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),le[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),le[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),le[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),le[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),le[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),le[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),le[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(le)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const le=[new ae,new ae,new ae,new ae,new ae,new ae,new ae,new ae],ce=new ae,ue=new Ae,he=new ae,de=new ae,fe=new ae,pe=new ae,me=new ae,ge=new ae,ve=new ae,_e=new ae,ye=new ae,xe=new ae;function be(t,e,n,r,i){for(let a=0,o=t.length-3;a<=o;a+=3){xe.fromArray(t,a);const o=i.x*Math.abs(xe.x)+i.y*Math.abs(xe.y)+i.z*Math.abs(xe.z),s=e.dot(xe),A=n.dot(xe),l=r.dot(xe);if(Math.max(-Math.max(s,A,l),Math.min(s,A,l))>o)return!1}return!0}const Me=new Ae,we=new ae,Ee=new ae;class Se{constructor(t=new ae,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):Me.setFromPoints(t).getCenter(n);let r=0;for(let e=0,i=t.length;e<i;e++)r=Math.max(r,n.distanceToSquared(t[e]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;we.subVectors(t,this.center);const e=we.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.addScaledVector(we,n/t),this.radius+=n}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(!0===this.center.equals(t.center)?this.radius=Math.max(this.radius,t.radius):(Ee.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(we.copy(t.center).add(Ee)),this.expandByPoint(we.copy(t.center).sub(Ee))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Te=new ae,Ce=new ae,Re=new ae,Pe=new ae,Le=new ae,De=new ae,Oe=new ae;class Ie{constructor(t=new ae,e=new ae(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Te)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=Te.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Te.copy(this.origin).addScaledVector(this.direction,e),Te.distanceToSquared(t))}distanceSqToSegment(t,e,n,r){Ce.copy(t).add(e).multiplyScalar(.5),Re.copy(e).sub(t).normalize(),Pe.copy(this.origin).sub(Ce);const i=.5*t.distanceTo(e),a=-this.direction.dot(Re),o=Pe.dot(this.direction),s=-Pe.dot(Re),A=Pe.lengthSq(),l=Math.abs(1-a*a);let c,u,h,d;if(l>0)if(c=a*s-o,u=a*o-s,d=i*l,c>=0)if(u>=-d)if(u<=d){const t=1/l;c*=t,u*=t,h=c*(c+a*u+2*o)+u*(a*c+u+2*s)+A}else u=i,c=Math.max(0,-(a*u+o)),h=-c*c+u*(u+2*s)+A;else u=-i,c=Math.max(0,-(a*u+o)),h=-c*c+u*(u+2*s)+A;else u<=-d?(c=Math.max(0,-(-a*i+o)),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,-(a*i+o)),u=c>0?i:Math.min(Math.max(-i,-s),i),h=-c*c+u*(u+2*s)+A);else u=a>0?-i:i,c=Math.max(0,-(a*u+o)),h=-c*c+u*(u+2*s)+A;return n&&n.copy(this.origin).addScaledVector(this.direction,c),r&&r.copy(Ce).addScaledVector(Re,u),h}intersectSphere(t,e){Te.subVectors(t.center,this.origin);const n=Te.dot(this.direction),r=Te.dot(Te)-n*n,i=t.radius*t.radius;if(r>i)return null;const a=Math.sqrt(i-r),o=n-a,s=n+a;return s<0?null:o<0?this.at(s,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,r,i,a,o,s;const A=1/this.direction.x,l=1/this.direction.y,c=1/this.direction.z,u=this.origin;return A>=0?(n=(t.min.x-u.x)*A,r=(t.max.x-u.x)*A):(n=(t.max.x-u.x)*A,r=(t.min.x-u.x)*A),l>=0?(i=(t.min.y-u.y)*l,a=(t.max.y-u.y)*l):(i=(t.max.y-u.y)*l,a=(t.min.y-u.y)*l),n>a||i>r?null:((i>n||isNaN(n))&&(n=i),(a<r||isNaN(r))&&(r=a),c>=0?(o=(t.min.z-u.z)*c,s=(t.max.z-u.z)*c):(o=(t.max.z-u.z)*c,s=(t.min.z-u.z)*c),n>s||o>r?null:((o>n||n!=n)&&(n=o),(s<r||r!=r)&&(r=s),r<0?null:this.at(n>=0?n:r,e)))}intersectsBox(t){return null!==this.intersectBox(t,Te)}intersectTriangle(t,e,n,r,i){Le.subVectors(e,t),De.subVectors(n,t),Oe.crossVectors(Le,De);let a,o=this.direction.dot(Oe);if(o>0){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}Pe.subVectors(this.origin,t);const s=a*this.direction.dot(De.crossVectors(Pe,De));if(s<0)return null;const A=a*this.direction.dot(Le.cross(Pe));if(A<0)return null;if(s+A>o)return null;const l=-a*Pe.dot(Oe);return l<0?null:this.at(l/o,i)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class qe{constructor(t,e,n,r,i,a,o,s,A,l,c,u,h,d,f,p){qe.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,n,r,i,a,o,s,A,l,c,u,h,d,f,p)}set(t,e,n,r,i,a,o,s,A,l,c,u,h,d,f,p){const m=this.elements;return m[0]=t,m[4]=e,m[8]=n,m[12]=r,m[1]=i,m[5]=a,m[9]=o,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 qe).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,r=1/Ue.setFromMatrixColumn(t,0).length(),i=1/Ue.setFromMatrixColumn(t,1).length(),a=1/Ue.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*i,e[5]=n[5]*i,e[6]=n[6]*i,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.elements,n=t.x,r=t.y,i=t.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),A=Math.sin(r),l=Math.cos(i),c=Math.sin(i);if("XYZ"===t.order){const t=a*l,n=a*c,r=o*l,i=o*c;e[0]=s*l,e[4]=-s*c,e[8]=A,e[1]=n+r*A,e[5]=t-i*A,e[9]=-o*s,e[2]=i-t*A,e[6]=r+n*A,e[10]=a*s}else if("YXZ"===t.order){const t=s*l,n=s*c,r=A*l,i=A*c;e[0]=t+i*o,e[4]=r*o-n,e[8]=a*A,e[1]=a*c,e[5]=a*l,e[9]=-o,e[2]=n*o-r,e[6]=i+t*o,e[10]=a*s}else if("ZXY"===t.order){const t=s*l,n=s*c,r=A*l,i=A*c;e[0]=t-i*o,e[4]=-a*c,e[8]=r+n*o,e[1]=n+r*o,e[5]=a*l,e[9]=i-t*o,e[2]=-a*A,e[6]=o,e[10]=a*s}else if("ZYX"===t.order){const t=a*l,n=a*c,r=o*l,i=o*c;e[0]=s*l,e[4]=r*A-n,e[8]=t*A+i,e[1]=s*c,e[5]=i*A+t,e[9]=n*A-r,e[2]=-A,e[6]=o*s,e[10]=a*s}else if("YZX"===t.order){const t=a*s,n=a*A,r=o*s,i=o*A;e[0]=s*l,e[4]=i-t*c,e[8]=r*c+n,e[1]=c,e[5]=a*l,e[9]=-o*l,e[2]=-A*l,e[6]=n*c+r,e[10]=t-i*c}else if("XZY"===t.order){const t=a*s,n=a*A,r=o*s,i=o*A;e[0]=s*l,e[4]=-c,e[8]=A*l,e[1]=t*c+i,e[5]=a*l,e[9]=n*c-r,e[2]=r*c-n,e[6]=o*l,e[10]=i*c+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Be,t,ke)}lookAt(t,e,n){const r=this.elements;return Ge.subVectors(t,e),0===Ge.lengthSq()&&(Ge.z=1),Ge.normalize(),Fe.crossVectors(n,Ge),0===Fe.lengthSq()&&(1===Math.abs(n.z)?Ge.x+=1e-4:Ge.z+=1e-4,Ge.normalize(),Fe.crossVectors(n,Ge)),Fe.normalize(),ze.crossVectors(Ge,Fe),r[0]=Fe.x,r[4]=ze.x,r[8]=Ge.x,r[1]=Fe.y,r[5]=ze.y,r[9]=Ge.y,r[2]=Fe.z,r[6]=ze.z,r[10]=Ge.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,r=e.elements,i=this.elements,a=n[0],o=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],_=n[11],y=n[15],x=r[0],b=r[4],M=r[8],w=r[12],E=r[1],S=r[5],T=r[9],C=r[13],R=r[2],P=r[6],L=r[10],D=r[14],O=r[3],I=r[7],q=r[11],U=r[15];return i[0]=a*x+o*E+s*R+A*O,i[4]=a*b+o*S+s*P+A*I,i[8]=a*M+o*T+s*L+A*q,i[12]=a*w+o*C+s*D+A*U,i[1]=l*x+c*E+u*R+h*O,i[5]=l*b+c*S+u*P+h*I,i[9]=l*M+c*T+u*L+h*q,i[13]=l*w+c*C+u*D+h*U,i[2]=d*x+f*E+p*R+m*O,i[6]=d*b+f*S+p*P+m*I,i[10]=d*M+f*T+p*L+m*q,i[14]=d*w+f*C+p*D+m*U,i[3]=g*x+v*E+_*R+y*O,i[7]=g*b+v*S+_*P+y*I,i[11]=g*M+v*T+_*L+y*q,i[15]=g*w+v*C+_*D+y*U,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],r=t[8],i=t[12],a=t[1],o=t[5],s=t[9],A=t[13],l=t[2],c=t[6],u=t[10],h=t[14];return t[3]*(+i*s*c-r*A*c-i*o*u+n*A*u+r*o*h-n*s*h)+t[7]*(+e*s*h-e*A*u+i*a*u-r*a*h+r*A*l-i*s*l)+t[11]*(+e*A*c-e*o*h-i*a*c+n*a*h+i*o*l-n*A*l)+t[15]*(-r*o*l-e*s*c+e*o*u+r*a*c-n*a*u+n*s*l)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],A=t[7],l=t[8],c=t[9],u=t[10],h=t[11],d=t[12],f=t[13],p=t[14],m=t[15],g=c*p*A-f*u*A+f*s*h-o*p*h-c*s*m+o*u*m,v=d*u*A-l*p*A-d*s*h+a*p*h+l*s*m-a*u*m,_=l*f*A-d*c*A+d*o*h-a*f*h-l*o*m+a*c*m,y=d*c*s-l*f*s-d*o*u+a*f*u+l*o*p-a*c*p,x=e*g+n*v+r*_+i*y;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const b=1/x;return t[0]=g*b,t[1]=(f*u*i-c*p*i-f*r*h+n*p*h+c*r*m-n*u*m)*b,t[2]=(o*p*i-f*s*i+f*r*A-n*p*A-o*r*m+n*s*m)*b,t[3]=(c*s*i-o*u*i-c*r*A+n*u*A+o*r*h-n*s*h)*b,t[4]=v*b,t[5]=(l*p*i-d*u*i+d*r*h-e*p*h-l*r*m+e*u*m)*b,t[6]=(d*s*i-a*p*i-d*r*A+e*p*A+a*r*m-e*s*m)*b,t[7]=(a*u*i-l*s*i+l*r*A-e*u*A-a*r*h+e*s*h)*b,t[8]=_*b,t[9]=(d*c*i-l*f*i-d*n*h+e*f*h+l*n*m-e*c*m)*b,t[10]=(a*f*i-d*o*i+d*n*A-e*f*A-a*n*m+e*o*m)*b,t[11]=(l*o*i-a*c*i-l*n*A+e*c*A+a*n*h-e*o*h)*b,t[12]=y*b,t[13]=(l*f*r-d*c*r+d*n*u-e*f*u-l*n*p+e*c*p)*b,t[14]=(d*o*r-a*f*r-d*n*s+e*f*s+a*n*p-e*o*p)*b,t[15]=(a*c*r-l*o*r+l*n*s-e*c*s-a*n*u+e*o*u)*b,this}scale(t){const e=this.elements,n=t.x,r=t.y,i=t.z;return e[0]*=n,e[4]*=r,e[8]*=i,e[1]*=n,e[5]*=r,e[9]*=i,e[2]*=n,e[6]*=r,e[10]*=i,e[3]*=n,e[7]*=r,e[11]*=i,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),r=Math.sin(e),i=1-n,a=t.x,o=t.y,s=t.z,A=i*a,l=i*o;return this.set(A*a+n,A*o-r*s,A*s+r*o,0,A*o+r*s,l*o+n,l*s-r*a,0,A*s-r*o,l*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,r,i,a){return this.set(1,n,i,0,t,1,a,0,e,r,1,0,0,0,0,1),this}compose(t,e,n){const r=this.elements,i=e._x,a=e._y,o=e._z,s=e._w,A=i+i,l=a+a,c=o+o,u=i*A,h=i*l,d=i*c,f=a*l,p=a*c,m=o*c,g=s*A,v=s*l,_=s*c,y=n.x,x=n.y,b=n.z;return r[0]=(1-(f+m))*y,r[1]=(h+_)*y,r[2]=(d-v)*y,r[3]=0,r[4]=(h-_)*x,r[5]=(1-(u+m))*x,r[6]=(p+g)*x,r[7]=0,r[8]=(d+v)*b,r[9]=(p-g)*b,r[10]=(1-(u+f))*b,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,n){const r=this.elements;let i=Ue.set(r[0],r[1],r[2]).length();const a=Ue.set(r[4],r[5],r[6]).length(),o=Ue.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),t.x=r[12],t.y=r[13],t.z=r[14],Ne.copy(this);const s=1/i,A=1/a,l=1/o;return Ne.elements[0]*=s,Ne.elements[1]*=s,Ne.elements[2]*=s,Ne.elements[4]*=A,Ne.elements[5]*=A,Ne.elements[6]*=A,Ne.elements[8]*=l,Ne.elements[9]*=l,Ne.elements[10]*=l,e.setFromRotationMatrix(Ne),n.x=i,n.y=a,n.z=o,this}makePerspective(t,e,n,r,i,a,o=2e3){const s=this.elements,A=2*i/(e-t),l=2*i/(n-r),c=(e+t)/(e-t),u=(n+r)/(n-r);let h,d;if(o===pt)h=-(a+i)/(a-i),d=-2*a*i/(a-i);else{if(o!==mt)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);h=-a/(a-i),d=-a*i/(a-i)}return s[0]=A,s[4]=0,s[8]=c,s[12]=0,s[1]=0,s[5]=l,s[9]=u,s[13]=0,s[2]=0,s[6]=0,s[10]=h,s[14]=d,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this}makeOrthographic(t,e,n,r,i,a,o=2e3){const s=this.elements,A=1/(e-t),l=1/(n-r),c=1/(a-i),u=(e+t)*A,h=(n+r)*l;let d,f;if(o===pt)d=(a+i)*c,f=-2*c;else{if(o!==mt)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);d=i*c,f=-1*c}return s[0]=2*A,s[4]=0,s[8]=0,s[12]=-u,s[1]=0,s[5]=2*l,s[9]=0,s[13]=-h,s[2]=0,s[6]=0,s[10]=f,s[14]=-d,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const Ue=new ae,Ne=new qe,Be=new ae(0,0,0),ke=new ae(1,1,1),Fe=new ae,ze=new ae,Ge=new ae,He=new qe,je=new ie;class Ve{constructor(t=0,e=0,n=0,r=Ve.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=e,this._z=n,this._order=r}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,r=this._order){return this._x=t,this._y=e,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e=this._order,n=!0){const r=t.elements,i=r[0],a=r[4],o=r[8],s=r[1],A=r[5],l=r[9],c=r[2],u=r[6],h=r[10];switch(e){case"XYZ":this._y=Math.asin(Mt(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,h),this._z=Math.atan2(-a,i)):(this._x=Math.atan2(u,A),this._z=0);break;case"YXZ":this._x=Math.asin(-Mt(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,h),this._z=Math.atan2(s,A)):(this._y=Math.atan2(-c,i),this._z=0);break;case"ZXY":this._x=Math.asin(Mt(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-c,h),this._z=Math.atan2(-a,A)):(this._y=0,this._z=Math.atan2(s,i));break;case"ZYX":this._y=Math.asin(-Mt(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(-a,A));break;case"YZX":this._z=Math.asin(Mt(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(o,h));break;case"XZY":this._z=Math.asin(-Mt(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(u,A),this._y=Math.atan2(o,i)):(this._x=Math.atan2(-l,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!0===n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return He.makeRotationFromQuaternion(t),this.setFromRotationMatrix(He,e,n)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return je.setFromEuler(this),this.setFromQuaternion(je,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Ve.DEFAULT_ORDER="XYZ";class We{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return 0!=(this.mask&t.mask)}isEnabled(t){return 0!=(this.mask&(1<<t|0))}}let Xe=0;const Qe=new ae,Ye=new ie,Ze=new qe,Ke=new ae,Je=new ae,$e=new ae,tn=new ie,en=new ae(1,0,0),nn=new ae(0,1,0),rn=new ae(0,0,1),an={type:"added"},on={type:"removed"};class sn extends gt{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Xe++}),this.uuid=bt(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=sn.DEFAULT_UP.clone();const t=new ae,e=new Ve,n=new ie,r=new ae(1,1,1);e._onChange((function(){n.setFromEuler(e,!1)})),n._onChange((function(){e.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new qe},normalMatrix:{value:new Dt}}),this.matrix=new qe,this.matrixWorld=new qe,this.matrixAutoUpdate=sn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=sn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new We,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Ye.setFromAxisAngle(t,e),this.quaternion.multiply(Ye),this}rotateOnWorldAxis(t,e){return Ye.setFromAxisAngle(t,e),this.quaternion.premultiply(Ye),this}rotateX(t){return this.rotateOnAxis(en,t)}rotateY(t){return this.rotateOnAxis(nn,t)}rotateZ(t){return this.rotateOnAxis(rn,t)}translateOnAxis(t,e){return Qe.copy(t).applyQuaternion(this.quaternion),this.position.add(Qe.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(en,t)}translateY(t){return this.translateOnAxis(nn,t)}translateZ(t){return this.translateOnAxis(rn,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(Ze.copy(this.matrixWorld).invert())}lookAt(t,e,n){t.isVector3?Ke.copy(t):Ke.set(t,e,n);const r=this.parent;this.updateWorldMatrix(!0,!1),Je.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ze.lookAt(Je,Ke,this.up):Ze.lookAt(Ke,Je,this.up),this.quaternion.setFromRotationMatrix(Ze),r&&(Ze.extractRotation(r.matrixWorld),Ye.setFromRotationMatrix(Ze),this.quaternion.premultiply(Ye.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(an)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(on)),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){return this.remove(...this.children)}attach(t){return this.updateWorldMatrix(!0,!1),Ze.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Ze.multiply(t.parent.matrixWorld)),t.applyMatrix4(Ze),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let n=0,r=this.children.length;n<r;n++){const r=this.children[n].getObjectByProperty(t,e);if(void 0!==r)return r}}getObjectsByProperty(t,e,n=[]){this[t]===e&&n.push(this);const r=this.children;for(let i=0,a=r.length;i<a;i++)r[i].getObjectsByProperty(t,e,n);return n}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Je,t,$e),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Je,tn,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let n=0,r=e.length;n<r;n++)e[n].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,r=e.length;n<r;n++){const r=e[n];!0!==r.matrixWorldAutoUpdate&&!0!==t||r.updateMatrixWorld(t)}}updateWorldMatrix(t,e){const n=this.parent;if(!0===t&&null!==n&&!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const t=this.children;for(let e=0,n=t.length;e<n;e++){const n=t[e];!0===n.matrixWorldAutoUpdate&&n.updateWorldMatrix(!1,!0)}}}toJSON(t){const e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const r={};function i(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.visibility=this._visibility,r.active=this._active,r.bounds=this._bounds.map((t=>({boxInitialized:t.boxInitialized,boxMin:t.box.min.toArray(),boxMax:t.box.max.toArray(),sphereInitialized:t.sphereInitialized,sphereRadius:t.sphere.radius,sphereCenter:t.sphere.center.toArray()}))),r.maxGeometryCount=this._maxGeometryCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.geometryCount=this._geometryCount,r.matricesTexture=this._matricesTexture.toJSON(t),null!==this.boundingSphere&&(r.boundingSphere={center:r.boundingSphere.center.toArray(),radius:r.boundingSphere.radius}),null!==this.boundingBox&&(r.boundingBox={min:r.boundingBox.min.toArray(),max:r.boundingBox.max.toArray()})),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,r=n.length;e<r;e++){const r=n[e];i(t.shapes,r)}else i(t.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(t.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let n=0,r=this.material.length;n<r;n++)e.push(i(t.materials,this.material[n]));r.material=e}else r.material=i(t.materials,this.material);if(this.children.length>0){r.children=[];for(let e=0;e<this.children.length;e++)r.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){r.animations=[];for(let e=0;e<this.animations.length;e++){const n=this.animations[e];r.animations.push(i(t.animations,n))}}if(e){const e=a(t.geometries),r=a(t.materials),i=a(t.textures),o=a(t.images),s=a(t.shapes),A=a(t.skeletons),l=a(t.animations),c=a(t.nodes);e.length>0&&(n.geometries=e),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),A.length>0&&(n.skeletons=A),l.length>0&&(n.animations=l),c.length>0&&(n.nodes=c)}return n.object=r,n;function a(t){const e=[];for(const n in t){const r=t[n];delete r.metadata,e.push(r)}return e}}clone(t){return(new this.constructor).copy(this,t)}copy(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.animations=t.animations.slice(),this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e<t.children.length;e++){const n=t.children[e];this.add(n.clone())}return this}}sn.DEFAULT_UP=new ae(0,1,0),sn.DEFAULT_MATRIX_AUTO_UPDATE=!0,sn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const An=new ae,ln=new ae,cn=new ae,un=new ae,hn=new ae,dn=new ae,fn=new ae,pn=new ae,mn=new ae,gn=new ae;class vn{constructor(t=new ae,e=new ae,n=new ae){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,r){r.subVectors(n,e),An.subVectors(t,e),r.cross(An);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(t,e,n,r,i){An.subVectors(r,e),ln.subVectors(n,e),cn.subVectors(t,e);const a=An.dot(An),o=An.dot(ln),s=An.dot(cn),A=ln.dot(ln),l=ln.dot(cn),c=a*A-o*o;if(0===c)return i.set(0,0,0),null;const u=1/c,h=(A*s-o*l)*u,d=(a*l-o*s)*u;return i.set(1-h-d,d,h)}static containsPoint(t,e,n,r){return null!==this.getBarycoord(t,e,n,r,un)&&(un.x>=0&&un.y>=0&&un.x+un.y<=1)}static getInterpolation(t,e,n,r,i,a,o,s){return null===this.getBarycoord(t,e,n,r,un)?(s.x=0,s.y=0,"z"in s&&(s.z=0),"w"in s&&(s.w=0),null):(s.setScalar(0),s.addScaledVector(i,un.x),s.addScaledVector(a,un.y),s.addScaledVector(o,un.z),s)}static isFrontFacing(t,e,n,r){return An.subVectors(n,e),ln.subVectors(t,e),An.cross(ln).dot(r)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,n,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,r),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return An.subVectors(this.c,this.b),ln.subVectors(this.a,this.b),.5*An.cross(ln).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return vn.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return vn.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,r,i){return vn.getInterpolation(t,this.a,this.b,this.c,e,n,r,i)}containsPoint(t){return vn.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return vn.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const n=this.a,r=this.b,i=this.c;let a,o;hn.subVectors(r,n),dn.subVectors(i,n),pn.subVectors(t,n);const s=hn.dot(pn),A=dn.dot(pn);if(s<=0&&A<=0)return e.copy(n);mn.subVectors(t,r);const l=hn.dot(mn),c=dn.dot(mn);if(l>=0&&c<=l)return e.copy(r);const u=s*c-l*A;if(u<=0&&s>=0&&l<=0)return a=s/(s-l),e.copy(n).addScaledVector(hn,a);gn.subVectors(t,i);const h=hn.dot(gn),d=dn.dot(gn);if(d>=0&&h<=d)return e.copy(i);const f=h*A-s*d;if(f<=0&&A>=0&&d<=0)return o=A/(A-d),e.copy(n).addScaledVector(dn,o);const p=l*d-h*c;if(p<=0&&c-l>=0&&h-d>=0)return fn.subVectors(i,r),o=(c-l)/(c-l+(h-d)),e.copy(r).addScaledVector(fn,o);const m=1/(p+f+u);return a=f*m,o=u*m,e.copy(n).addScaledVector(hn,a).addScaledVector(dn,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const _n={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},yn={h:0,s:0,l:0},xn={h:0,s:0,l:0};function bn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}let Mn=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(void 0===e&&void 0===n){const e=t;e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=rt){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,Ht.toWorkingColorSpace(this,e),this}setRGB(t,e,n,r=Ht.workingColorSpace){return this.r=t,this.g=e,this.b=n,Ht.toWorkingColorSpace(this,r),this}setHSL(t,e,n,r=Ht.workingColorSpace){if(t=wt(t,1),e=Mt(e,0,1),n=Mt(n,0,1),0===e)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+e):n+e-n*e,i=2*n-r;this.r=bn(i,r,t+1/3),this.g=bn(i,r,t),this.b=bn(i,r,t-1/3)}return Ht.toWorkingColorSpace(this,r),this}setStyle(t,e=rt){function n(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let i;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(i=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(255,parseInt(i[1],10))/255,Math.min(255,parseInt(i[2],10))/255,Math.min(255,parseInt(i[3],10))/255,e);if(i=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setRGB(Math.min(100,parseInt(i[1],10))/100,Math.min(100,parseInt(i[2],10))/100,Math.min(100,parseInt(i[3],10))/100,e);break;case"hsl":case"hsla":if(i=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(i[4]),this.setHSL(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){const n=r[1],i=n.length;if(3===i)return this.setRGB(parseInt(n.charAt(0),16)/15,parseInt(n.charAt(1),16)/15,parseInt(n.charAt(2),16)/15,e);if(6===i)return this.setHex(parseInt(n,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=rt){const n=_n[t.toLowerCase()];return void 0!==n?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=jt(t.r),this.g=jt(t.g),this.b=jt(t.b),this}copyLinearToSRGB(t){return this.r=Vt(t.r),this.g=Vt(t.g),this.b=Vt(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=rt){return Ht.fromWorkingColorSpace(wn.copy(this),t),65536*Math.round(Mt(255*wn.r,0,255))+256*Math.round(Mt(255*wn.g,0,255))+Math.round(Mt(255*wn.b,0,255))}getHexString(t=rt){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Ht.workingColorSpace){Ht.fromWorkingColorSpace(wn.copy(this),e);const n=wn.r,r=wn.g,i=wn.b,a=Math.max(n,r,i),o=Math.min(n,r,i);let s,A;const l=(o+a)/2;if(o===a)s=0,A=0;else{const t=a-o;switch(A=l<=.5?t/(a+o):t/(2-a-o),a){case n:s=(r-i)/t+(r<i?6:0);break;case r:s=(i-n)/t+2;break;case i:s=(n-r)/t+4}s/=6}return t.h=s,t.s=A,t.l=l,t}getRGB(t,e=Ht.workingColorSpace){return Ht.fromWorkingColorSpace(wn.copy(this),e),t.r=wn.r,t.g=wn.g,t.b=wn.b,t}getStyle(t=rt){Ht.fromWorkingColorSpace(wn.copy(this),t);const e=wn.r,n=wn.g,r=wn.b;return t!==rt?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(255*e)},${Math.round(255*n)},${Math.round(255*r)})`}offsetHSL(t,e,n){return this.getHSL(yn),this.setHSL(yn.h+t,yn.s+e,yn.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(yn),t.getHSL(xn);const n=Et(yn.h,xn.h,e),r=Et(yn.s,xn.s,e),i=Et(yn.l,xn.l,e);return this.setHSL(n,r,i),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,n=this.g,r=this.b,i=t.elements;return this.r=i[0]*e+i[3]*n+i[6]*r,this.g=i[1]*e+i[4]*n+i[7]*r,this.b=i[2]*e+i[5]*n+i[8]*r,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const wn=new Mn;Mn.NAMES=_n;let En=0;class Sn extends gt{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:En++}),this.uuid=bt(),this.name="",this.type="Material",this.blending=1,this.side=m,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=v,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Mn(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ut,this.stencilZFail=ut,this.stencilZPass=ut,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.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}const r=this[e];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`)}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};function r(t){const e=[];for(const n in t){const r=t[n];delete r.metadata,e.push(r)}return e}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(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).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(t).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(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),this.side!==m&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),204!==this.blendSrc&&(n.blendSrc=this.blendSrc),205!==this.blendDst&&(n.blendDst=this.blendDst),this.blendEquation!==v&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ut&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ut&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ut&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==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),void 0!==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.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),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=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),e){const e=r(t.textures),i=r(t.images);e.length>0&&(n.textures=e),i.length>0&&(n.images=i)}return n}clone(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let r=0;r!==t;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}class Tn extends Sn{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Mn(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=_,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}const Cn=new ae,Rn=new Lt;class Pn{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=n,this.usage=ht,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=j,this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}get updateRange(){return Bt("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[t+r]=e.array[n+r];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,n=this.count;e<n;e++)Rn.fromBufferAttribute(this,e),Rn.applyMatrix3(t),this.setXY(e,Rn.x,Rn.y);else if(3===this.itemSize)for(let e=0,n=this.count;e<n;e++)Cn.fromBufferAttribute(this,e),Cn.applyMatrix3(t),this.setXYZ(e,Cn.x,Cn.y,Cn.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Cn.fromBufferAttribute(this,e),Cn.applyMatrix4(t),this.setXYZ(e,Cn.x,Cn.y,Cn.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Cn.fromBufferAttribute(this,e),Cn.applyNormalMatrix(t),this.setXYZ(e,Cn.x,Cn.y,Cn.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Cn.fromBufferAttribute(this,e),Cn.transformDirection(t),this.setXYZ(e,Cn.x,Cn.y,Cn.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Ct(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Rt(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Ct(e,this.array)),e}setX(t,e){return this.normalized&&(e=Rt(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Ct(e,this.array)),e}setY(t,e){return this.normalized&&(e=Rt(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Ct(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Rt(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Ct(e,this.array)),e}setW(t,e){return this.normalized&&(e=Rt(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,r){return t*=this.itemSize,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array),r=Rt(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this}setXYZW(t,e,n,r,i){return t*=this.itemSize,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array),r=Rt(r,this.array),i=Rt(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=i,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==ht&&(t.usage=this.usage),t}}class Ln extends Pn{constructor(t,e,n){super(new Uint16Array(t),e,n)}}class Dn extends Pn{constructor(t,e,n){super(new Uint32Array(t),e,n)}}class On extends Pn{constructor(t,e,n){super(new Float32Array(t),e,n)}}let In=0;const qn=new qe,Un=new sn,Nn=new ae,Bn=new Ae,kn=new Ae,Fn=new ae;class zn extends gt{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:In++}),this.uuid=bt(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(It(t)?Dn:Ln)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new Dt).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(t),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(t){return qn.makeRotationFromQuaternion(t),this.applyMatrix4(qn),this}rotateX(t){return qn.makeRotationX(t),this.applyMatrix4(qn),this}rotateY(t){return qn.makeRotationY(t),this.applyMatrix4(qn),this}rotateZ(t){return qn.makeRotationZ(t),this.applyMatrix4(qn),this}translate(t,e,n){return qn.makeTranslation(t,e,n),this.applyMatrix4(qn),this}scale(t,e,n){return qn.makeScale(t,e,n),this.applyMatrix4(qn),this}lookAt(t){return Un.lookAt(t),Un.updateMatrix(),this.applyMatrix4(Un.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Nn).negate(),this.translate(Nn.x,Nn.y,Nn.z),this}setFromPoints(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];e.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new On(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Ae);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingBox.set(new ae(-1/0,-1/0,-1/0),new ae(1/0,1/0,1/0));if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];Bn.setFromBufferAttribute(n),this.morphTargetsRelative?(Fn.addVectors(this.boundingBox.min,Bn.min),this.boundingBox.expandByPoint(Fn),Fn.addVectors(this.boundingBox.max,Bn.max),this.boundingBox.expandByPoint(Fn)):(this.boundingBox.expandByPoint(Bn.min),this.boundingBox.expandByPoint(Bn.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Se);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)return console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".',this),void this.boundingSphere.set(new ae,1/0);if(t){const n=this.boundingSphere.center;if(Bn.setFromBufferAttribute(t),e)for(let t=0,n=e.length;t<n;t++){const n=e[t];kn.setFromBufferAttribute(n),this.morphTargetsRelative?(Fn.addVectors(Bn.min,kn.min),Bn.expandByPoint(Fn),Fn.addVectors(Bn.max,kn.max),Bn.expandByPoint(Fn)):(Bn.expandByPoint(kn.min),Bn.expandByPoint(kn.max))}Bn.getCenter(n);let r=0;for(let e=0,i=t.count;e<i;e++)Fn.fromBufferAttribute(t,e),r=Math.max(r,n.distanceToSquared(Fn));if(e)for(let i=0,a=e.length;i<a;i++){const a=e[i],o=this.morphTargetsRelative;for(let e=0,i=a.count;e<i;e++)Fn.fromBufferAttribute(a,e),o&&(Nn.fromBufferAttribute(t,e),Fn.add(Nn)),r=Math.max(r,n.distanceToSquared(Fn))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=t.array,r=e.position.array,i=e.normal.array,a=e.uv.array,o=r.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Pn(new Float32Array(4*o),4));const s=this.getAttribute("tangent").array,A=[],l=[];for(let t=0;t<o;t++)A[t]=new ae,l[t]=new ae;const c=new ae,u=new ae,h=new ae,d=new Lt,f=new Lt,p=new Lt,m=new ae,g=new ae;function v(t,e,n){c.fromArray(r,3*t),u.fromArray(r,3*e),h.fromArray(r,3*n),d.fromArray(a,2*t),f.fromArray(a,2*e),p.fromArray(a,2*n),u.sub(c),h.sub(c),f.sub(d),p.sub(d);const i=1/(f.x*p.y-p.x*f.y);isFinite(i)&&(m.copy(u).multiplyScalar(p.y).addScaledVector(h,-f.y).multiplyScalar(i),g.copy(h).multiplyScalar(f.x).addScaledVector(u,-p.x).multiplyScalar(i),A[t].add(m),A[e].add(m),A[n].add(m),l[t].add(g),l[e].add(g),l[n].add(g))}let _=this.groups;0===_.length&&(_=[{start:0,count:n.length}]);for(let t=0,e=_.length;t<e;++t){const e=_[t],r=e.start;for(let t=r,i=r+e.count;t<i;t+=3)v(n[t+0],n[t+1],n[t+2])}const y=new ae,x=new ae,b=new ae,M=new ae;function w(t){b.fromArray(i,3*t),M.copy(b);const e=A[t];y.copy(e),y.sub(b.multiplyScalar(b.dot(e))).normalize(),x.crossVectors(M,e);const n=x.dot(l[t])<0?-1:1;s[4*t]=y.x,s[4*t+1]=y.y,s[4*t+2]=y.z,s[4*t+3]=n}for(let t=0,e=_.length;t<e;++t){const e=_[t],r=e.start;for(let t=r,i=r+e.count;t<i;t+=3)w(n[t+0]),w(n[t+1]),w(n[t+2])}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let n=this.getAttribute("normal");if(void 0===n)n=new Pn(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let t=0,e=n.count;t<e;t++)n.setXYZ(t,0,0,0);const r=new ae,i=new ae,a=new ae,o=new ae,s=new ae,A=new ae,l=new ae,c=new ae;if(t)for(let u=0,h=t.count;u<h;u+=3){const h=t.getX(u+0),d=t.getX(u+1),f=t.getX(u+2);r.fromBufferAttribute(e,h),i.fromBufferAttribute(e,d),a.fromBufferAttribute(e,f),l.subVectors(a,i),c.subVectors(r,i),l.cross(c),o.fromBufferAttribute(n,h),s.fromBufferAttribute(n,d),A.fromBufferAttribute(n,f),o.add(l),s.add(l),A.add(l),n.setXYZ(h,o.x,o.y,o.z),n.setXYZ(d,s.x,s.y,s.z),n.setXYZ(f,A.x,A.y,A.z)}else for(let t=0,o=e.count;t<o;t+=3)r.fromBufferAttribute(e,t+0),i.fromBufferAttribute(e,t+1),a.fromBufferAttribute(e,t+2),l.subVectors(a,i),c.subVectors(r,i),l.cross(c),n.setXYZ(t+0,l.x,l.y,l.z),n.setXYZ(t+1,l.x,l.y,l.z),n.setXYZ(t+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)Fn.fromBufferAttribute(t,e),Fn.normalize(),t.setXYZ(e,Fn.x,Fn.y,Fn.z)}toNonIndexed(){function t(t,e){const n=t.array,r=t.itemSize,i=t.normalized,a=new n.constructor(e.length*r);let o=0,s=0;for(let i=0,A=e.length;i<A;i++){o=t.isInterleavedBufferAttribute?e[i]*t.data.stride+t.offset:e[i]*r;for(let t=0;t<r;t++)a[s++]=n[o++]}return new Pn(a,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const e=new zn,n=this.index.array,r=this.attributes;for(const i in r){const a=t(r[i],n);e.setAttribute(i,a)}const i=this.morphAttributes;for(const r in i){const a=[],o=i[r];for(let e=0,r=o.length;e<r;e++){const r=t(o[e],n);a.push(r)}e.morphAttributes[r]=a}e.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let t=0,n=a.length;t<n;t++){const n=a[t];e.addGroup(n.start,n.count,n.materialIndex)}return e}toJSON(){const t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const r=n[e];t.data.attributes[e]=r.toJSON(t.data)}const r={};let i=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],a=[];for(let e=0,r=n.length;e<r;e++){const r=n[e];a.push(r.toJSON(t.data))}a.length>0&&(r[e]=a,i=!0)}i&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return null!==o&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return(new this.constructor).copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const r=t.attributes;for(const t in r){const n=r[t];this.setAttribute(t,n.clone(e))}const i=t.morphAttributes;for(const t in i){const n=[],r=i[t];for(let t=0,i=r.length;t<i;t++)n.push(r[t].clone(e));this.morphAttributes[t]=n}this.morphTargetsRelative=t.morphTargetsRelative;const a=t.groups;for(let t=0,e=a.length;t<e;t++){const e=a[t];this.addGroup(e.start,e.count,e.materialIndex)}const o=t.boundingBox;null!==o&&(this.boundingBox=o.clone());const s=t.boundingSphere;return null!==s&&(this.boundingSphere=s.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const Gn=new qe,Hn=new Ie,jn=new Se,Vn=new ae,Wn=new ae,Xn=new ae,Qn=new ae,Yn=new ae,Zn=new ae,Kn=new Lt,Jn=new Lt,$n=new Lt,tr=new ae,er=new ae,nr=new ae,rr=new ae,ir=new ae;class ar extends sn{constructor(t=new zn,e=new Tn){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}getVertexPosition(t,e){const n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,a=n.morphTargetsRelative;e.fromBufferAttribute(r,t);const o=this.morphTargetInfluences;if(i&&o){Zn.set(0,0,0);for(let n=0,r=i.length;n<r;n++){const r=o[n],s=i[n];0!==r&&(Yn.fromBufferAttribute(s,t),a?Zn.addScaledVector(Yn,r):Zn.addScaledVector(Yn.sub(e),r))}e.add(Zn)}return e}raycast(t,e){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0!==r){if(null===n.boundingSphere&&n.computeBoundingSphere(),jn.copy(n.boundingSphere),jn.applyMatrix4(i),Hn.copy(t.ray).recast(t.near),!1===jn.containsPoint(Hn.origin)){if(null===Hn.intersectSphere(jn,Vn))return;if(Hn.origin.distanceToSquared(Vn)>(t.far-t.near)**2)return}Gn.copy(i).invert(),Hn.copy(t.ray).applyMatrix4(Gn),null!==n.boundingBox&&!1===Hn.intersectsBox(n.boundingBox)||this._computeIntersections(t,e,Hn)}}_computeIntersections(t,e,n){let r;const i=this.geometry,a=this.material,o=i.index,s=i.attributes.position,A=i.attributes.uv,l=i.attributes.uv1,c=i.attributes.normal,u=i.groups,h=i.drawRange;if(null!==o)if(Array.isArray(a))for(let i=0,s=u.length;i<s;i++){const s=u[i],d=a[s.materialIndex];for(let i=Math.max(s.start,h.start),a=Math.min(o.count,Math.min(s.start+s.count,h.start+h.count));i<a;i+=3){r=or(this,d,t,n,A,l,c,o.getX(i),o.getX(i+1),o.getX(i+2)),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=s.materialIndex,e.push(r))}}else{for(let i=Math.max(0,h.start),s=Math.min(o.count,h.start+h.count);i<s;i+=3){r=or(this,a,t,n,A,l,c,o.getX(i),o.getX(i+1),o.getX(i+2)),r&&(r.faceIndex=Math.floor(i/3),e.push(r))}}else if(void 0!==s)if(Array.isArray(a))for(let i=0,o=u.length;i<o;i++){const o=u[i],d=a[o.materialIndex];for(let i=Math.max(o.start,h.start),a=Math.min(s.count,Math.min(o.start+o.count,h.start+h.count));i<a;i+=3){r=or(this,d,t,n,A,l,c,i,i+1,i+2),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=o.materialIndex,e.push(r))}}else{for(let i=Math.max(0,h.start),o=Math.min(s.count,h.start+h.count);i<o;i+=3){r=or(this,a,t,n,A,l,c,i,i+1,i+2),r&&(r.faceIndex=Math.floor(i/3),e.push(r))}}}}function or(t,e,n,r,i,a,o,s,A,l){t.getVertexPosition(s,Wn),t.getVertexPosition(A,Xn),t.getVertexPosition(l,Qn);const c=function(t,e,n,r,i,a,o,s){let A;if(A=e.side===g?r.intersectTriangle(o,a,i,!0,s):r.intersectTriangle(i,a,o,e.side===m,s),null===A)return null;ir.copy(s),ir.applyMatrix4(t.matrixWorld);const l=n.ray.origin.distanceTo(ir);return l<n.near||l>n.far?null:{distance:l,point:ir.clone(),object:t}}(t,e,n,r,Wn,Xn,Qn,rr);if(c){i&&(Kn.fromBufferAttribute(i,s),Jn.fromBufferAttribute(i,A),$n.fromBufferAttribute(i,l),c.uv=vn.getInterpolation(rr,Wn,Xn,Qn,Kn,Jn,$n,new Lt)),a&&(Kn.fromBufferAttribute(a,s),Jn.fromBufferAttribute(a,A),$n.fromBufferAttribute(a,l),c.uv1=vn.getInterpolation(rr,Wn,Xn,Qn,Kn,Jn,$n,new Lt),c.uv2=c.uv1),o&&(tr.fromBufferAttribute(o,s),er.fromBufferAttribute(o,A),nr.fromBufferAttribute(o,l),c.normal=vn.getInterpolation(rr,Wn,Xn,Qn,tr,er,nr,new ae),c.normal.dot(r.direction)>0&&c.normal.multiplyScalar(-1));const t={a:s,b:A,c:l,normal:new ae,materialIndex:0};vn.getNormal(Wn,Xn,Qn,t.normal),c.face=t}return c}class sr extends zn{constructor(t=1,e=1,n=1,r=1,i=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:i,depthSegments:a};const o=this;r=Math.floor(r),i=Math.floor(i),a=Math.floor(a);const s=[],A=[],l=[],c=[];let u=0,h=0;function d(t,e,n,r,i,a,d,f,p,m,g){const v=a/p,_=d/m,y=a/2,x=d/2,b=f/2,M=p+1,w=m+1;let E=0,S=0;const T=new ae;for(let a=0;a<w;a++){const o=a*_-x;for(let s=0;s<M;s++){const u=s*v-y;T[t]=u*r,T[e]=o*i,T[n]=b,A.push(T.x,T.y,T.z),T[t]=0,T[e]=0,T[n]=f>0?1:-1,l.push(T.x,T.y,T.z),c.push(s/p),c.push(1-a/m),E+=1}}for(let t=0;t<m;t++)for(let e=0;e<p;e++){const n=u+e+M*t,r=u+e+M*(t+1),i=u+(e+1)+M*(t+1),a=u+(e+1)+M*t;s.push(n,r,a),s.push(r,i,a),S+=6}o.addGroup(h,S,g),h+=S,u+=E}d("z","y","x",-1,-1,n,e,t,a,i,0),d("z","y","x",1,-1,n,e,-t,a,i,1),d("x","z","y",1,1,t,n,e,r,a,2),d("x","z","y",1,-1,t,n,-e,r,a,3),d("x","y","z",1,-1,t,e,n,r,i,4),d("x","y","z",-1,-1,t,e,-n,r,i,5),this.setIndex(s),this.setAttribute("position",new On(A,3)),this.setAttribute("normal",new On(l,3)),this.setAttribute("uv",new On(c,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new sr(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function Ar(t){const e={};for(const n in t){e[n]={};for(const r in t[n]){const i=t[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][r]=null):e[n][r]=i.clone():Array.isArray(i)?e[n][r]=i.slice():e[n][r]=i}}return e}function lr(t){const e={};for(let n=0;n<t.length;n++){const r=Ar(t[n]);for(const t in r)e[t]=r[t]}return e}function cr(t){return null===t.getRenderTarget()?t.outputColorSpace:Ht.workingColorSpace}const ur={clone:Ar,merge:lr};class hr extends Sn{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1,clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Ar(t.uniforms),this.uniformsGroups=function(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const n in this.uniforms){const r=this.uniforms[n].value;r&&r.isTexture?e.uniforms[n]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[n]={type:"m4",value:r.toArray()}:e.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e.lights=this.lights,e.clipping=this.clipping;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e}}class dr extends sn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new qe,this.projectionMatrix=new qe,this.projectionMatrixInverse=new qe,this.coordinateSystem=pt}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this.coordinateSystem=t.coordinateSystem,this}getWorldDirection(t){return super.getWorldDirection(t).negate()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const fr=new ae,pr=new Lt,mr=new Lt;class gr extends dr{constructor(t=50,e=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){const e=.5*this.getFilmHeight()/t;this.fov=2*xt*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*yt*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*xt*Math.atan(Math.tan(.5*yt*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(t,e,n){fr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),e.set(fr.x,fr.y).multiplyScalar(-t/fr.z),fr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(fr.x,fr.y).multiplyScalar(-t/fr.z)}getViewSize(t,e){return this.getViewBounds(t,pr,mr),e.subVectors(mr,pr)}setViewOffset(t,e,n,r,i,a){this.aspect=t/e,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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*yt*this.fov)/this.zoom,n=2*e,r=this.aspect*n,i=-.5*r;const a=this.view;if(null!==this.view&&this.view.enabled){const t=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/t,e-=a.offsetY*n/o,r*=a.width/t,n*=a.height/o}const o=this.filmOffset;0!==o&&(i+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,e,e-n,t,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}const vr=-90;class _r extends sn{constructor(t,e,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new gr(vr,1,t,e);r.layers=this.layers,this.add(r);const i=new gr(vr,1,t,e);i.layers=this.layers,this.add(i);const a=new gr(vr,1,t,e);a.layers=this.layers,this.add(a);const o=new gr(vr,1,t,e);o.layers=this.layers,this.add(o);const s=new gr(vr,1,t,e);s.layers=this.layers,this.add(s);const A=new gr(vr,1,t,e);A.layers=this.layers,this.add(A)}updateCoordinateSystem(){const t=this.coordinateSystem,e=this.children.concat(),[n,r,i,a,o,s]=e;for(const t of e)this.remove(t);if(t===pt)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),s.up.set(0,1,0),s.lookAt(0,0,-1);else{if(t!==mt)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+t);n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),s.up.set(0,-1,0),s.lookAt(0,0,-1)}for(const t of e)this.add(t),t.updateMatrixWorld()}update(t,e){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==t.coordinateSystem&&(this.coordinateSystem=t.coordinateSystem,this.updateCoordinateSystem());const[i,a,o,s,A,l]=this.children,c=t.getRenderTarget(),u=t.getActiveCubeFace(),h=t.getActiveMipmapLevel(),d=t.xr.enabled;t.xr.enabled=!1;const f=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0,r),t.render(e,i),t.setRenderTarget(n,1,r),t.render(e,a),t.setRenderTarget(n,2,r),t.render(e,o),t.setRenderTarget(n,3,r),t.render(e,s),t.setRenderTarget(n,4,r),t.render(e,A),n.texture.generateMipmaps=f,t.setRenderTarget(n,5,r),t.render(e,l),t.setRenderTarget(c,u,h),t.xr.enabled=d,n.texture.needsPMREMUpdate=!0}}class yr extends Jt{constructor(t,e,n,r,i,a,o,s,A,l){super(t=void 0!==t?t:[],e=void 0!==e?e:R,n,r,i,a,o,s,A,l),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}class xr extends ee{constructor(t=1,e={}){super(t,t,e),this.isWebGLCubeRenderTarget=!0;const n={width:t,height:t,depth:1},r=[n,n,n,n,n,n];void 0!==e.encoding&&(Bt("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),e.colorSpace=e.encoding===et?rt:nt),this.texture=new yr(r,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:N}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.colorSpace=e.colorSpace,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.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 <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\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 <common>\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 sr(5,5,5),i=new hr({name:"CubemapFromEquirect",uniforms:Ar(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:g,blending:0});i.uniforms.tEquirect.value=e;const a=new ar(r,i),o=e.minFilter;e.minFilter===k&&(e.minFilter=N);return new _r(1,10,this).update(t,a),e.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(t,e,n,r){const i=t.getRenderTarget();for(let i=0;i<6;i++)t.setRenderTarget(this,i),t.clear(e,n,r);t.setRenderTarget(i)}}const br=new ae,Mr=new ae,wr=new Dt;class Er{constructor(t=new ae(1,0,0),e=0){this.isPlane=!0,this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,n,r){return this.normal.set(t,e,n),this.constant=r,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,n){const r=br.subVectors(n,e).cross(Mr.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(r,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(t).addScaledVector(this.normal,-this.distanceToPoint(t))}intersectLine(t,e){const n=t.delta(br),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const i=-(t.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:e.copy(t.start).addScaledVector(n,i)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||wr.getNormalMatrix(t),r=this.coplanarPoint(br).applyMatrix4(t),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const Sr=new Se,Tr=new ae;class Cr{constructor(t=new Er,e=new Er,n=new Er,r=new Er,i=new Er,a=new Er){this.planes=[t,e,n,r,i,a]}set(t,e,n,r,i,a){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t,e=2e3){const n=this.planes,r=t.elements,i=r[0],a=r[1],o=r[2],s=r[3],A=r[4],l=r[5],c=r[6],u=r[7],h=r[8],d=r[9],f=r[10],p=r[11],m=r[12],g=r[13],v=r[14],_=r[15];if(n[0].setComponents(s-i,u-A,p-h,_-m).normalize(),n[1].setComponents(s+i,u+A,p+h,_+m).normalize(),n[2].setComponents(s+a,u+l,p+d,_+g).normalize(),n[3].setComponents(s-a,u-l,p-d,_-g).normalize(),n[4].setComponents(s-o,u-c,p-f,_-v).normalize(),e===pt)n[5].setComponents(s+o,u+c,p+f,_+v).normalize();else{if(e!==mt)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+e);n[5].setComponents(o,c,f,v).normalize()}return this}intersectsObject(t){if(void 0!==t.boundingSphere)null===t.boundingSphere&&t.computeBoundingSphere(),Sr.copy(t.boundingSphere).applyMatrix4(t.matrixWorld);else{const e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere(),Sr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld)}return this.intersectsSphere(Sr)}intersectsSprite(t){return Sr.center.set(0,0,0),Sr.radius=.7071067811865476,Sr.applyMatrix4(t.matrixWorld),this.intersectsSphere(Sr)}intersectsSphere(t){const e=this.planes,n=t.center,r=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)<r)return!1}return!0}intersectsBox(t){const e=this.planes;for(let n=0;n<6;n++){const r=e[n];if(Tr.x=r.normal.x>0?t.max.x:t.min.x,Tr.y=r.normal.y>0?t.max.y:t.min.y,Tr.z=r.normal.z>0?t.max.z:t.min.z,r.distanceToPoint(Tr)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Rr(){let t=null,e=!1,n=null,r=null;function i(e,a){n(e,a),r=t.requestAnimationFrame(i)}return{start:function(){!0!==e&&null!==n&&(r=t.requestAnimationFrame(i),e=!0)},stop:function(){t.cancelAnimationFrame(r),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function Pr(t,e){const n=e.isWebGL2,r=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),r.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const n=r.get(e);n&&(t.deleteBuffer(n.buffer),r.delete(e))},update:function(e,i){if(e.isGLBufferAttribute){const t=r.get(e);return void((!t||t.version<e.version)&&r.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version}))}e.isInterleavedBufferAttribute&&(e=e.data);const a=r.get(e);if(void 0===a)r.set(e,function(e,r){const i=e.array,a=e.usage,o=i.byteLength,s=t.createBuffer();let A;if(t.bindBuffer(r,s),t.bufferData(r,i,a),e.onUploadCallback(),i instanceof Float32Array)A=t.FLOAT;else if(i instanceof Uint16Array)if(e.isFloat16BufferAttribute){if(!n)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");A=t.HALF_FLOAT}else A=t.UNSIGNED_SHORT;else if(i instanceof Int16Array)A=t.SHORT;else if(i instanceof Uint32Array)A=t.UNSIGNED_INT;else if(i instanceof Int32Array)A=t.INT;else if(i instanceof Int8Array)A=t.BYTE;else if(i instanceof Uint8Array)A=t.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);A=t.UNSIGNED_BYTE}return{buffer:s,type:A,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version,size:o}}(e,i));else if(a.version<e.version){if(a.size!==e.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function(e,r,i){const a=r.array,o=r._updateRange,s=r.updateRanges;if(t.bindBuffer(i,e),-1===o.count&&0===s.length&&t.bufferSubData(i,0,a),0!==s.length){for(let e=0,r=s.length;e<r;e++){const r=s[e];n?t.bufferSubData(i,r.start*a.BYTES_PER_ELEMENT,a,r.start,r.count):t.bufferSubData(i,r.start*a.BYTES_PER_ELEMENT,a.subarray(r.start,r.start+r.count))}r.clearUpdateRanges()}-1!==o.count&&(n?t.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a,o.offset,o.count):t.bufferSubData(i,o.offset*a.BYTES_PER_ELEMENT,a.subarray(o.offset,o.offset+o.count)),o.count=-1),r.onUploadCallback()}(a.buffer,e,i),a.version=e.version}}}}class Lr extends zn{constructor(t=1,e=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:r};const i=t/2,a=e/2,o=Math.floor(n),s=Math.floor(r),A=o+1,l=s+1,c=t/o,u=e/s,h=[],d=[],f=[],p=[];for(let t=0;t<l;t++){const e=t*u-a;for(let n=0;n<A;n++){const r=n*c-i;d.push(r,-e,0),f.push(0,0,1),p.push(n/o),p.push(1-t/s)}}for(let t=0;t<s;t++)for(let e=0;e<o;e++){const n=e+A*t,r=e+A*(t+1),i=e+1+A*(t+1),a=e+1+A*t;h.push(n,r,a),h.push(r,i,a)}this.setIndex(h),this.setAttribute("position",new On(d,3)),this.setAttribute("normal",new On(f,3)),this.setAttribute("uv",new On(p,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Lr(t.width,t.height,t.widthSegments,t.heightSegments)}}const Dr={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\tattribute float batchId;\n\tuniform highp sampler2D batchingTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( batchId );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float 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} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\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( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + 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 = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\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#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\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; }\nvec3 pow2( const in vec3 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 v ) { return dot( v, vec3( 0.3333333 ) ); }\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};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\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 luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, 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}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.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\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\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\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_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 ), cubeUV_m0, CUBEUV_MAX_MIP );\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_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 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, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\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#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 ) || defined( LAMBERT )\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 ) || defined( LAMBERT )\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:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef 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#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\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\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\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\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\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 ( LEGACY_LIGHTS )\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#else\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#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, 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 vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\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 vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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",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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\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\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\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( ( material.ior - 1.0 ) / ( material.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, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).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_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\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_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\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 dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\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\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}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\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#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, 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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\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:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\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, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( 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, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\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, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( 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, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\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 ], geometryNormal );\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, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, vMapUv );\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\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\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\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_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\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, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\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 ).xyz * 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 ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\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\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\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 = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).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( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\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 USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.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 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\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}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\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 depth, const in float near, const in float far ) {\n\treturn depth * ( 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 depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - 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_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\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, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#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\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\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\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:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#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\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:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\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, vSpotLightCoord[ 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\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\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, vSpecularMapUv );\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 saturate( 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}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\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\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\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 lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\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 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\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;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\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 <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#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 <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_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 USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\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 + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},Or={common:{diffuse:{value:new Mn(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Dt}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Dt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Dt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Dt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Dt},normalScale:{value:new Lt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Dt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Dt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Dt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Dt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Mn(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:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{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 Mn(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0},uvTransform:{value:new Dt}},sprite:{diffuse:{value:new Mn(16777215)},opacity:{value:1},center:{value:new Lt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Dt},alphaMap:{value:null},alphaMapTransform:{value:new Dt},alphaTest:{value:0}}},Ir={basic:{uniforms:lr([Or.common,Or.specularmap,Or.envmap,Or.aomap,Or.lightmap,Or.fog]),vertexShader:Dr.meshbasic_vert,fragmentShader:Dr.meshbasic_frag},lambert:{uniforms:lr([Or.common,Or.specularmap,Or.envmap,Or.aomap,Or.lightmap,Or.emissivemap,Or.bumpmap,Or.normalmap,Or.displacementmap,Or.fog,Or.lights,{emissive:{value:new Mn(0)}}]),vertexShader:Dr.meshlambert_vert,fragmentShader:Dr.meshlambert_frag},phong:{uniforms:lr([Or.common,Or.specularmap,Or.envmap,Or.aomap,Or.lightmap,Or.emissivemap,Or.bumpmap,Or.normalmap,Or.displacementmap,Or.fog,Or.lights,{emissive:{value:new Mn(0)},specular:{value:new Mn(1118481)},shininess:{value:30}}]),vertexShader:Dr.meshphong_vert,fragmentShader:Dr.meshphong_frag},standard:{uniforms:lr([Or.common,Or.envmap,Or.aomap,Or.lightmap,Or.emissivemap,Or.bumpmap,Or.normalmap,Or.displacementmap,Or.roughnessmap,Or.metalnessmap,Or.fog,Or.lights,{emissive:{value:new Mn(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Dr.meshphysical_vert,fragmentShader:Dr.meshphysical_frag},toon:{uniforms:lr([Or.common,Or.aomap,Or.lightmap,Or.emissivemap,Or.bumpmap,Or.normalmap,Or.displacementmap,Or.gradientmap,Or.fog,Or.lights,{emissive:{value:new Mn(0)}}]),vertexShader:Dr.meshtoon_vert,fragmentShader:Dr.meshtoon_frag},matcap:{uniforms:lr([Or.common,Or.bumpmap,Or.normalmap,Or.displacementmap,Or.fog,{matcap:{value:null}}]),vertexShader:Dr.meshmatcap_vert,fragmentShader:Dr.meshmatcap_frag},points:{uniforms:lr([Or.points,Or.fog]),vertexShader:Dr.points_vert,fragmentShader:Dr.points_frag},dashed:{uniforms:lr([Or.common,Or.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Dr.linedashed_vert,fragmentShader:Dr.linedashed_frag},depth:{uniforms:lr([Or.common,Or.displacementmap]),vertexShader:Dr.depth_vert,fragmentShader:Dr.depth_frag},normal:{uniforms:lr([Or.common,Or.bumpmap,Or.normalmap,Or.displacementmap,{opacity:{value:1}}]),vertexShader:Dr.meshnormal_vert,fragmentShader:Dr.meshnormal_frag},sprite:{uniforms:lr([Or.sprite,Or.fog]),vertexShader:Dr.sprite_vert,fragmentShader:Dr.sprite_frag},background:{uniforms:{uvTransform:{value:new Dt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Dr.background_vert,fragmentShader:Dr.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Dr.backgroundCube_vert,fragmentShader:Dr.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Dr.cube_vert,fragmentShader:Dr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Dr.equirect_vert,fragmentShader:Dr.equirect_frag},distanceRGBA:{uniforms:lr([Or.common,Or.displacementmap,{referencePosition:{value:new ae},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Dr.distanceRGBA_vert,fragmentShader:Dr.distanceRGBA_frag},shadow:{uniforms:lr([Or.lights,Or.fog,{color:{value:new Mn(0)},opacity:{value:1}}]),vertexShader:Dr.shadow_vert,fragmentShader:Dr.shadow_frag}};Ir.physical={uniforms:lr([Ir.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Dt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Dt},clearcoatNormalScale:{value:new Lt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Dt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Dt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Dt},sheen:{value:0},sheenColor:{value:new Mn(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Dt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Dt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Dt},transmissionSamplerSize:{value:new Lt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Dt},attenuationDistance:{value:0},attenuationColor:{value:new Mn(0)},specularColor:{value:new Mn(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Dt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Dt},anisotropyVector:{value:new Lt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Dt}}]),vertexShader:Dr.meshphysical_vert,fragmentShader:Dr.meshphysical_frag};const qr={r:0,b:0,g:0};function Ur(t,e,n,r,i,a,o){const s=new Mn(0);let A,l,c=!0===a?0:1,u=null,h=0,d=null;function f(e,n){e.getRGB(qr,cr(t)),r.buffers.color.setClear(qr.r,qr.g,qr.b,n,o)}return{getClearColor:function(){return s},setClearColor:function(t,e=1){s.set(t),c=e,f(s,c)},getClearAlpha:function(){return c},setClearAlpha:function(t){c=t,f(s,c)},render:function(a,p){let v=!1,_=!0===p.isScene?p.background:null;if(_&&_.isTexture){_=(p.backgroundBlurriness>0?n:e).get(_)}null===_?f(s,c):_&&_.isColor&&(f(_,1),v=!0);const y=t.xr.getEnvironmentBlendMode();"additive"===y?r.buffers.color.setClear(0,0,0,1,o):"alpha-blend"===y&&r.buffers.color.setClear(0,0,0,0,o),(t.autoClear||v)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),_&&(_.isCubeTexture||_.mapping===L)?(void 0===l&&(l=new ar(new sr(1,1,1),new hr({name:"BackgroundCubeMaterial",uniforms:Ar(Ir.backgroundCube.uniforms),vertexShader:Ir.backgroundCube.vertexShader,fragmentShader:Ir.backgroundCube.fragmentShader,side:g,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(l)),l.material.uniforms.envMap.value=_,l.material.uniforms.flipEnvMap.value=_.isCubeTexture&&!1===_.isRenderTargetTexture?-1:1,l.material.uniforms.backgroundBlurriness.value=p.backgroundBlurriness,l.material.uniforms.backgroundIntensity.value=p.backgroundIntensity,l.material.toneMapped=Ht.getTransfer(_.colorSpace)!==At,u===_&&h===_.version&&d===t.toneMapping||(l.material.needsUpdate=!0,u=_,h=_.version,d=t.toneMapping),l.layers.enableAll(),a.unshift(l,l.geometry,l.material,0,0,null)):_&&_.isTexture&&(void 0===A&&(A=new ar(new Lr(2,2),new hr({name:"BackgroundMaterial",uniforms:Ar(Ir.background.uniforms),vertexShader:Ir.background.vertexShader,fragmentShader:Ir.background.fragmentShader,side:m,depthTest:!1,depthWrite:!1,fog:!1})),A.geometry.deleteAttribute("normal"),Object.defineProperty(A.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(A)),A.material.uniforms.t2D.value=_,A.material.uniforms.backgroundIntensity.value=p.backgroundIntensity,A.material.toneMapped=Ht.getTransfer(_.colorSpace)!==At,!0===_.matrixAutoUpdate&&_.updateMatrix(),A.material.uniforms.uvTransform.value.copy(_.matrix),u===_&&h===_.version&&d===t.toneMapping||(A.material.needsUpdate=!0,u=_,h=_.version,d=t.toneMapping),A.layers.enableAll(),a.unshift(A,A.geometry,A.material,0,0,null))}}}function Nr(t,e,n,r){const i=t.getParameter(t.MAX_VERTEX_ATTRIBS),a=r.isWebGL2?null:e.get("OES_vertex_array_object"),o=r.isWebGL2||null!==a,s={},A=d(null);let l=A,c=!1;function u(e){return r.isWebGL2?t.bindVertexArray(e):a.bindVertexArrayOES(e)}function h(e){return r.isWebGL2?t.deleteVertexArray(e):a.deleteVertexArrayOES(e)}function d(t){const e=[],n=[],r=[];for(let t=0;t<i;t++)e[t]=0,n[t]=0,r[t]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:n,attributeDivisors:r,object:t,attributes:{},index:null}}function f(){const t=l.newAttributes;for(let e=0,n=t.length;e<n;e++)t[e]=0}function p(t){m(t,0)}function m(n,i){const a=l.newAttributes,o=l.enabledAttributes,s=l.attributeDivisors;if(a[n]=1,0===o[n]&&(t.enableVertexAttribArray(n),o[n]=1),s[n]!==i){(r.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),s[n]=i}}function g(){const e=l.newAttributes,n=l.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==e[r]&&(t.disableVertexAttribArray(r),n[r]=0)}function v(e,n,r,i,a,o,s){!0===s?t.vertexAttribIPointer(e,n,r,a,o):t.vertexAttribPointer(e,n,r,i,a,o)}function _(){y(),c=!0,l!==A&&(l=A,u(l.object))}function y(){A.geometry=null,A.program=null,A.wireframe=!1}return{setup:function(i,A,h,_,y){let x=!1;if(o){const e=function(e,n,i){const o=!0===i.wireframe;let A=s[e.id];void 0===A&&(A={},s[e.id]=A);let l=A[n.id];void 0===l&&(l={},A[n.id]=l);let c=l[o];void 0===c&&(c=d(r.isWebGL2?t.createVertexArray():a.createVertexArrayOES()),l[o]=c);return c}(_,h,A);l!==e&&(l=e,u(l.object)),x=function(t,e,n,r){const i=l.attributes,a=e.attributes;let o=0;const s=n.getAttributes();for(const e in s){if(s[e].location>=0){const n=i[e];let r=a[e];if(void 0===r&&("instanceMatrix"===e&&t.instanceMatrix&&(r=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(r=t.instanceColor)),void 0===n)return!0;if(n.attribute!==r)return!0;if(r&&n.data!==r.data)return!0;o++}}return l.attributesNum!==o||l.index!==r}(i,_,h,y),x&&function(t,e,n,r){const i={},a=e.attributes;let o=0;const s=n.getAttributes();for(const e in s){if(s[e].location>=0){let n=a[e];void 0===n&&("instanceMatrix"===e&&t.instanceMatrix&&(n=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(n=t.instanceColor));const r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[e]=r,o++}}l.attributes=i,l.attributesNum=o,l.index=r}(i,_,h,y)}else{const t=!0===A.wireframe;l.geometry===_.id&&l.program===h.id&&l.wireframe===t||(l.geometry=_.id,l.program=h.id,l.wireframe=t,x=!0)}null!==y&&n.update(y,t.ELEMENT_ARRAY_BUFFER),(x||c)&&(c=!1,function(i,a,o,s){if(!1===r.isWebGL2&&(i.isInstancedMesh||s.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;f();const A=s.attributes,l=o.getAttributes(),c=a.defaultAttributeValues;for(const e in l){const a=l[e];if(a.location>=0){let o=A[e];if(void 0===o&&("instanceMatrix"===e&&i.instanceMatrix&&(o=i.instanceMatrix),"instanceColor"===e&&i.instanceColor&&(o=i.instanceColor)),void 0!==o){const e=o.normalized,A=o.itemSize,l=n.get(o);if(void 0===l)continue;const c=l.buffer,u=l.type,h=l.bytesPerElement,d=!0===r.isWebGL2&&(u===t.INT||u===t.UNSIGNED_INT||o.gpuType===G);if(o.isInterleavedBufferAttribute){const n=o.data,r=n.stride,l=o.offset;if(n.isInstancedInterleavedBuffer){for(let t=0;t<a.locationSize;t++)m(a.location+t,n.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=n.meshPerAttribute*n.count)}else for(let t=0;t<a.locationSize;t++)p(a.location+t);t.bindBuffer(t.ARRAY_BUFFER,c);for(let t=0;t<a.locationSize;t++)v(a.location+t,A/a.locationSize,u,e,r*h,(l+A/a.locationSize*t)*h,d)}else{if(o.isInstancedBufferAttribute){for(let t=0;t<a.locationSize;t++)m(a.location+t,o.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=o.meshPerAttribute*o.count)}else for(let t=0;t<a.locationSize;t++)p(a.location+t);t.bindBuffer(t.ARRAY_BUFFER,c);for(let t=0;t<a.locationSize;t++)v(a.location+t,A/a.locationSize,u,e,A*h,A/a.locationSize*t*h,d)}}else if(void 0!==c){const n=c[e];if(void 0!==n)switch(n.length){case 2:t.vertexAttrib2fv(a.location,n);break;case 3:t.vertexAttrib3fv(a.location,n);break;case 4:t.vertexAttrib4fv(a.location,n);break;default:t.vertexAttrib1fv(a.location,n)}}}}g()}(i,A,h,_),null!==y&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n.get(y).buffer))},reset:_,resetDefaultState:y,dispose:function(){_();for(const t in s){const e=s[t];for(const t in e){const n=e[t];for(const t in n)h(n[t].object),delete n[t];delete e[t]}delete s[t]}},releaseStatesOfGeometry:function(t){if(void 0===s[t.id])return;const e=s[t.id];for(const t in e){const n=e[t];for(const t in n)h(n[t].object),delete n[t];delete e[t]}delete s[t.id]},releaseStatesOfProgram:function(t){for(const e in s){const n=s[e];if(void 0===n[t.id])continue;const r=n[t.id];for(const t in r)h(r[t].object),delete r[t];delete n[t.id]}},initAttributes:f,enableAttribute:p,disableUnusedAttributes:g}}function Br(t,e,n,r){const i=r.isWebGL2;let a;this.setMode=function(t){a=t},this.render=function(e,r){t.drawArrays(a,e,r),n.update(r,a,1)},this.renderInstances=function(r,o,s){if(0===s)return;let A,l;if(i)A=t,l="drawArraysInstanced";else if(A=e.get("ANGLE_instanced_arrays"),l="drawArraysInstancedANGLE",null===A)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");A[l](a,r,o,s),n.update(o,a,s)},this.renderMultiDraw=function(t,r,i){if(0===i)return;const o=e.get("WEBGL_multi_draw");if(null===o)for(let e=0;e<i;e++)this.render(t[e],r[e]);else{o.multiDrawArraysWEBGL(a,t,0,r,0,i);let e=0;for(let t=0;t<i;t++)e+=r[t];n.update(e,a,1)}}}function kr(t,e,n){let r;function i(e){if("highp"===e){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const a="undefined"!=typeof WebGL2RenderingContext&&"WebGL2RenderingContext"===t.constructor.name;let o=void 0!==n.precision?n.precision:"highp";const s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);const A=a||e.has("WEBGL_draw_buffers"),l=!0===n.logarithmicDepthBuffer,c=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),u=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=t.getParameter(t.MAX_TEXTURE_SIZE),d=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),f=t.getParameter(t.MAX_VERTEX_ATTRIBS),p=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),m=t.getParameter(t.MAX_VARYING_VECTORS),g=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),v=u>0,_=a||e.has("OES_texture_float");return{isWebGL2:a,drawBuffers:A,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");r=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:d,maxAttributes:f,maxVertexUniforms:p,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:_,floatVertexTextures:v&&_,maxSamples:a?t.getParameter(t.MAX_SAMPLES):0}}function Fr(t){const e=this;let n=null,r=0,i=!1,a=!1;const o=new Er,s=new Dt,A={value:null,needsUpdate:!1};function l(t,n,r,i){const a=null!==t?t.length:0;let l=null;if(0!==a){if(l=A.value,!0!==i||null===l){const e=r+4*a,i=n.matrixWorldInverse;s.getNormalMatrix(i),(null===l||l.length<e)&&(l=new Float32Array(e));for(let e=0,n=r;e!==a;++e,n+=4)o.copy(t[e]).applyMatrix4(i,s),o.normal.toArray(l,n),l[n+3]=o.constant}A.value=l,A.needsUpdate=!0}return e.numPlanes=a,e.numIntersection=0,l}this.uniform=A,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e){const n=0!==t.length||e||0!==r||i;return i=e,r=t.length,n},this.beginShadows=function(){a=!0,l(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(t,e){n=l(t,e,0)},this.setState=function(o,s,c){const u=o.clippingPlanes,h=o.clipIntersection,d=o.clipShadows,f=t.get(o);if(!i||null===u||0===u.length||a&&!d)a?l(null):function(){A.value!==n&&(A.value=n,A.needsUpdate=r>0);e.numPlanes=r,e.numIntersection=0}();else{const t=a?0:r,e=4*t;let i=f.clippingState||null;A.value=i,i=l(u,s,e,c);for(let t=0;t!==e;++t)i[t]=n[t];f.clippingState=i,this.numIntersection=h?this.numPlanes:0,this.numPlanes+=t}}}function zr(t){let e=new WeakMap;function n(t,e){return 303===e?t.mapping=R:304===e&&(t.mapping=P),t}function r(t){const n=t.target;n.removeEventListener("dispose",r);const i=e.get(n);void 0!==i&&(e.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const a=i.mapping;if(303===a||304===a){if(e.has(i)){return n(e.get(i).texture,i.mapping)}{const a=i.image;if(a&&a.height>0){const o=new xr(a.height);return o.fromEquirectangularTexture(t,i),e.set(i,o),i.addEventListener("dispose",r),n(o.texture,i.mapping)}return null}}}return i},dispose:function(){e=new WeakMap}}}class Gr extends dr{constructor(t=-1,e=1,n=1,r=-1,i=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=n,this.bottom=r,this.near=i,this.far=a,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,n,r,i,a){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=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=n-t,a=n+t,o=r+e,s=r-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=t*this.view.offsetX,a=i+t*this.view.width,o-=e*this.view.offsetY,s=o-e*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}const Hr=[.125,.215,.35,.446,.526,.582],jr=20,Vr=new Gr,Wr=new Mn;let Xr=null,Qr=0,Yr=0;const Zr=(1+Math.sqrt(5))/2,Kr=1/Zr,Jr=[new ae(1,1,1),new ae(-1,1,1),new ae(1,1,-1),new ae(-1,1,-1),new ae(0,Zr,Kr),new ae(0,Zr,-Kr),new ae(Kr,0,Zr),new ae(-Kr,0,Zr),new ae(Zr,Kr,0),new ae(-Zr,Kr,0)];class $r{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,r=100){Xr=this._renderer.getRenderTarget(),Qr=this._renderer.getActiveCubeFace(),Yr=this._renderer.getActiveMipmapLevel(),this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(t,n,r,i),e>0&&this._blur(i,0,0,e),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=ri(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=ni(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Xr,Qr,Yr),t.scissorTest=!1,ei(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===R||t.mapping===P?this._setSize(0===t.image.length?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Xr=this._renderer.getRenderTarget(),Qr=this._renderer.getActiveCubeFace(),Yr=this._renderer.getActiveMipmapLevel();const n=e||this._allocateTargets();return this._textureToCubeUV(t,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,n={magFilter:N,minFilter:N,generateMipmaps:!1,type:V,format:X,colorSpace:it,depthBuffer:!1},r=ti(t,e,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==e){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=ti(t,e,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(t){const e=[],n=[],r=[];let i=t;const a=t-4+1+Hr.length;for(let o=0;o<a;o++){const a=Math.pow(2,i);n.push(a);let s=1/a;o>t-4?s=Hr[o-t+4-1]:0===o&&(s=0),r.push(s);const A=1/(a-2),l=-A,c=1+A,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=6,d=6,f=3,p=2,m=1,g=new Float32Array(f*d*h),v=new Float32Array(p*d*h),_=new Float32Array(m*d*h);for(let t=0;t<h;t++){const e=t%3*2/3-1,n=t>2?0:-1,r=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];g.set(r,f*d*t),v.set(u,p*d*t);const i=[t,t,t,t,t,t];_.set(i,m*d*t)}const y=new zn;y.setAttribute("position",new Pn(g,f)),y.setAttribute("uv",new Pn(v,p)),y.setAttribute("faceIndex",new Pn(_,m)),e.push(y),i>4&&i--}return{lodPlanes:e,sizeLods:n,sigmas:r}}(r)),this._blurMaterial=function(t,e,n){const r=new Float32Array(jr),i=new ae(0,1,0),a=new hr({name:"SphericalGaussianBlur",defines:{n:jr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:ii(),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 <cube_uv_reflection_fragment>\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});return a}(r,t,e)}return r}_compileMaterial(t){const e=new ar(this._lodPlanes[0],t);this._renderer.compile(e,Vr)}_sceneToCubeUV(t,e,n,r){const i=new gr(90,1,e,n),a=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],s=this._renderer,A=s.autoClear,l=s.toneMapping;s.getClearColor(Wr),s.toneMapping=b,s.autoClear=!1;const c=new Tn({name:"PMREM.Background",side:g,depthWrite:!1,depthTest:!1}),u=new ar(new sr,c);let h=!1;const d=t.background;d?d.isColor&&(c.color.copy(d),t.background=null,h=!0):(c.color.copy(Wr),h=!0);for(let e=0;e<6;e++){const n=e%3;0===n?(i.up.set(0,a[e],0),i.lookAt(o[e],0,0)):1===n?(i.up.set(0,0,a[e]),i.lookAt(0,o[e],0)):(i.up.set(0,a[e],0),i.lookAt(0,0,o[e]));const A=this._cubeSize;ei(r,n*A,e>2?A:0,A,A),s.setRenderTarget(r),h&&s.render(u,i),s.render(t,i)}u.geometry.dispose(),u.material.dispose(),s.toneMapping=l,s.autoClear=A,t.background=d}_textureToCubeUV(t,e){const n=this._renderer,r=t.mapping===R||t.mapping===P;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=ri()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=ni());const i=r?this._cubemapMaterial:this._equirectMaterial,a=new ar(this._lodPlanes[0],i);i.uniforms.envMap.value=t;const o=this._cubeSize;ei(e,0,0,3*o,2*o),n.setRenderTarget(e),n.render(a,Vr)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;for(let e=1;e<this._lodPlanes.length;e++){const n=Math.sqrt(this._sigmas[e]*this._sigmas[e]-this._sigmas[e-1]*this._sigmas[e-1]),r=Jr[(e-1)%Jr.length];this._blur(t,e-1,e,n,r)}e.autoClear=n}_blur(t,e,n,r,i){const a=this._pingPongRenderTarget;this._halfBlur(t,a,e,n,r,"latitudinal",i),this._halfBlur(a,t,n,n,r,"longitudinal",i)}_halfBlur(t,e,n,r,i,a,o){const s=this._renderer,A=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");const l=new ar(this._lodPlanes[r],A),c=A.uniforms,u=this._sizeLods[n]-1,h=isFinite(i)?Math.PI/(2*u):2*Math.PI/39,d=i/h,f=isFinite(i)?1+Math.floor(3*d):jr;f>jr&&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 t=0;t<jr;++t){const e=t/d,n=Math.exp(-e*e/2);p.push(n),0===t?m+=n:t<f&&(m+=2*n)}for(let t=0;t<p.length;t++)p[t]=p[t]/m;c.envMap.value=t.texture,c.samples.value=f,c.weights.value=p,c.latitudinal.value="latitudinal"===a,o&&(c.poleAxis.value=o);const{_lodMax:g}=this;c.dTheta.value=h,c.mipInt.value=g-n;const v=this._sizeLods[r];ei(e,3*v*(r>g-4?r-g+4:0),4*(this._cubeSize-v),3*v,2*v),s.setRenderTarget(e),s.render(l,Vr)}}function ti(t,e,n){const r=new ee(t,e,n);return r.texture.mapping=L,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function ei(t,e,n,r,i){t.viewport.set(e,n,r,i),t.scissor.set(e,n,r,i)}function ni(){return new hr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ii(),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\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function ri(){return new hr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ii(),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 ii(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\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 ai(t){let e=new WeakMap,n=null;function r(t){const n=t.target;n.removeEventListener("dispose",r);const i=e.get(n);void 0!==i&&(e.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const a=i.mapping,o=303===a||304===a,s=a===R||a===P;if(o||s){if(i.isRenderTargetTexture&&!0===i.needsPMREMUpdate){i.needsPMREMUpdate=!1;let r=e.get(i);return null===n&&(n=new $r(t)),r=o?n.fromEquirectangular(i,r):n.fromCubemap(i,r),e.set(i,r),r.texture}if(e.has(i))return e.get(i).texture;{const a=i.image;if(o&&a&&a.height>0||s&&a&&function(t){let e=0;const n=6;for(let r=0;r<n;r++)void 0!==t[r]&&e++;return e===n}(a)){null===n&&(n=new $r(t));const a=o?n.fromEquirectangular(i):n.fromCubemap(i);return e.set(i,a),i.addEventListener("dispose",r),a.texture}return null}}}return i},dispose:function(){e=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function oi(t){const e={};function n(n){if(void 0!==e[n])return e[n];let r;switch(n){case"WEBGL_depth_texture":r=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=t.getExtension(n)}return e[n]=r,r}return{has:function(t){return null!==n(t)},init:function(t){t.isWebGL2?(n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance")):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture")},get:function(t){const e=n(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function si(t,e,n,r){const i={},a=new WeakMap;function o(t){const s=t.target;null!==s.index&&e.remove(s.index);for(const t in s.attributes)e.remove(s.attributes[t]);for(const t in s.morphAttributes){const n=s.morphAttributes[t];for(let t=0,r=n.length;t<r;t++)e.remove(n[t])}s.removeEventListener("dispose",o),delete i[s.id];const A=a.get(s);A&&(e.remove(A),a.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(t){const n=[],r=t.index,i=t.attributes.position;let o=0;if(null!==r){const t=r.array;o=r.version;for(let e=0,r=t.length;e<r;e+=3){const r=t[e+0],i=t[e+1],a=t[e+2];n.push(r,i,i,a,a,r)}}else{if(void 0===i)return;{const t=i.array;o=i.version;for(let e=0,r=t.length/3-1;e<r;e+=3){const t=e+0,r=e+1,i=e+2;n.push(t,r,r,i,i,t)}}}const s=new(It(n)?Dn:Ln)(n,1);s.version=o;const A=a.get(t);A&&e.remove(A),a.set(t,s)}return{get:function(t,e){return!0===i[e.id]||(e.addEventListener("dispose",o),i[e.id]=!0,n.memory.geometries++),e},update:function(n){const r=n.attributes;for(const n in r)e.update(r[n],t.ARRAY_BUFFER);const i=n.morphAttributes;for(const n in i){const r=i[n];for(let n=0,i=r.length;n<i;n++)e.update(r[n],t.ARRAY_BUFFER)}},getWireframeAttribute:function(t){const e=a.get(t);if(e){const n=t.index;null!==n&&e.version<n.version&&s(t)}else s(t);return a.get(t)}}}function Ai(t,e,n,r){const i=r.isWebGL2;let a,o,s;this.setMode=function(t){a=t},this.setIndex=function(t){o=t.type,s=t.bytesPerElement},this.render=function(e,r){t.drawElements(a,r,o,e*s),n.update(r,a,1)},this.renderInstances=function(r,A,l){if(0===l)return;let c,u;if(i)c=t,u="drawElementsInstanced";else if(c=e.get("ANGLE_instanced_arrays"),u="drawElementsInstancedANGLE",null===c)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[u](a,A,o,r*s,l),n.update(A,a,l)},this.renderMultiDraw=function(t,r,i){if(0===i)return;const A=e.get("WEBGL_multi_draw");if(null===A)for(let e=0;e<i;e++)this.render(t[e]/s,r[e]);else{A.multiDrawElementsWEBGL(a,r,0,o,t,0,i);let e=0;for(let t=0;t<i;t++)e+=r[t];n.update(e,a,1)}}}function li(t){const e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(n,r,i){switch(e.calls++,r){case t.TRIANGLES:e.triangles+=i*(n/3);break;case t.LINES:e.lines+=i*(n/2);break;case t.LINE_STRIP:e.lines+=i*(n-1);break;case t.LINE_LOOP:e.lines+=i*n;break;case t.POINTS:e.points+=i*n;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",r)}}}}function ci(t,e){return t[0]-e[0]}function ui(t,e){return Math.abs(e[1])-Math.abs(t[1])}function hi(t,e,n){const r={},i=new Float32Array(8),a=new WeakMap,o=new $t,s=[];for(let t=0;t<8;t++)s[t]=[t,0];return{update:function(A,l,c){const u=A.morphTargetInfluences;if(!0===e.isWebGL2){const h=l.morphAttributes.position||l.morphAttributes.normal||l.morphAttributes.color,d=void 0!==h?h.length:0;let f=a.get(l);if(void 0===f||f.count!==d){void 0!==f&&f.texture.dispose();const g=void 0!==l.morphAttributes.position,v=void 0!==l.morphAttributes.normal,_=void 0!==l.morphAttributes.color,y=l.morphAttributes.position||[],x=l.morphAttributes.normal||[],b=l.morphAttributes.color||[];let M=0;!0===g&&(M=1),!0===v&&(M=2),!0===_&&(M=3);let w=l.attributes.position.count*M,E=1;w>e.maxTextureSize&&(E=Math.ceil(w/e.maxTextureSize),w=e.maxTextureSize);const S=new Float32Array(w*E*4*d),T=new ne(S,w,E,d);T.type=j,T.needsUpdate=!0;const C=4*M;for(let P=0;P<d;P++){const L=y[P],D=x[P],O=b[P],I=w*E*4*P;for(let q=0;q<L.count;q++){const U=q*C;!0===g&&(o.fromBufferAttribute(L,q),S[I+U+0]=o.x,S[I+U+1]=o.y,S[I+U+2]=o.z,S[I+U+3]=0),!0===v&&(o.fromBufferAttribute(D,q),S[I+U+4]=o.x,S[I+U+5]=o.y,S[I+U+6]=o.z,S[I+U+7]=0),!0===_&&(o.fromBufferAttribute(O,q),S[I+U+8]=o.x,S[I+U+9]=o.y,S[I+U+10]=o.z,S[I+U+11]=4===O.itemSize?o.w:1)}}function R(){T.dispose(),a.delete(l),l.removeEventListener("dispose",R)}f={count:d,texture:T,size:new Lt(w,E)},a.set(l,f),l.addEventListener("dispose",R)}let p=0;for(let N=0;N<u.length;N++)p+=u[N];const m=l.morphTargetsRelative?1:1-p;c.getUniforms().setValue(t,"morphTargetBaseInfluence",m),c.getUniforms().setValue(t,"morphTargetInfluences",u),c.getUniforms().setValue(t,"morphTargetsTexture",f.texture,n),c.getUniforms().setValue(t,"morphTargetsTextureSize",f.size)}else{const B=void 0===u?0:u.length;let k=r[l.id];if(void 0===k||k.length!==B){k=[];for(let V=0;V<B;V++)k[V]=[V,0];r[l.id]=k}for(let W=0;W<B;W++){const X=k[W];X[0]=W,X[1]=u[W]}k.sort(ui);for(let Q=0;Q<8;Q++)Q<B&&k[Q][1]?(s[Q][0]=k[Q][0],s[Q][1]=k[Q][1]):(s[Q][0]=Number.MAX_SAFE_INTEGER,s[Q][1]=0);s.sort(ci);const F=l.morphAttributes.position,z=l.morphAttributes.normal;let G=0;for(let Y=0;Y<8;Y++){const Z=s[Y],K=Z[0],J=Z[1];K!==Number.MAX_SAFE_INTEGER&&J?(F&&l.getAttribute("morphTarget"+Y)!==F[K]&&l.setAttribute("morphTarget"+Y,F[K]),z&&l.getAttribute("morphNormal"+Y)!==z[K]&&l.setAttribute("morphNormal"+Y,z[K]),i[Y]=J,G+=J):(F&&!0===l.hasAttribute("morphTarget"+Y)&&l.deleteAttribute("morphTarget"+Y),z&&!0===l.hasAttribute("morphNormal"+Y)&&l.deleteAttribute("morphNormal"+Y),i[Y]=0)}const H=l.morphTargetsRelative?1:1-G;c.getUniforms().setValue(t,"morphTargetBaseInfluence",H),c.getUniforms().setValue(t,"morphTargetInfluences",i)}}}}function di(t,e,n,r){let i=new WeakMap;function a(t){const e=t.target;e.removeEventListener("dispose",a),n.remove(e.instanceMatrix),null!==e.instanceColor&&n.remove(e.instanceColor)}return{update:function(o){const s=r.render.frame,A=o.geometry,l=e.get(o,A);if(i.get(l)!==s&&(e.update(l),i.set(l,s)),o.isInstancedMesh&&(!1===o.hasEventListener("dispose",a)&&o.addEventListener("dispose",a),i.get(o)!==s&&(n.update(o.instanceMatrix,t.ARRAY_BUFFER),null!==o.instanceColor&&n.update(o.instanceColor,t.ARRAY_BUFFER),i.set(o,s))),o.isSkinnedMesh){const t=o.skeleton;i.get(t)!==s&&(t.update(),i.set(t,s))}return l},dispose:function(){i=new WeakMap}}}class fi extends Jt{constructor(t,e,n,r,i,a,o,s,A,l){if((l=void 0!==l?l:Q)!==Q&&l!==Y)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&l===Q&&(n=H),void 0===n&&l===Y&&(n=W),super(null,r,i,a,o,s,l,n,A),this.isDepthTexture=!0,this.image={width:t,height:e},this.magFilter=void 0!==o?o:q,this.minFilter=void 0!==s?s:q,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(t){return super.copy(t),this.compareFunction=t.compareFunction,this}toJSON(t){const e=super.toJSON(t);return null!==this.compareFunction&&(e.compareFunction=this.compareFunction),e}}const pi=new Jt,mi=new fi(1,1);mi.compareFunction=515;const gi=new ne,vi=new re,_i=new yr,yi=[],xi=[],bi=new Float32Array(16),Mi=new Float32Array(9),wi=new Float32Array(4);function Ei(t,e,n){const r=t[0];if(r<=0||r>0)return t;const i=e*n;let a=yi[i];if(void 0===a&&(a=new Float32Array(i),yi[i]=a),0!==e){r.toArray(a,0);for(let r=1,i=0;r!==e;++r)i+=n,t[r].toArray(a,i)}return a}function Si(t,e){if(t.length!==e.length)return!1;for(let n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}function Ti(t,e){for(let n=0,r=e.length;n<r;n++)t[n]=e[n]}function Ci(t,e){let n=xi[e];void 0===n&&(n=new Int32Array(e),xi[e]=n);for(let r=0;r!==e;++r)n[r]=t.allocateTextureUnit();return n}function Ri(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Pi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Si(n,e))return;t.uniform2fv(this.addr,e),Ti(n,e)}}function Li(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(Si(n,e))return;t.uniform3fv(this.addr,e),Ti(n,e)}}function Di(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Si(n,e))return;t.uniform4fv(this.addr,e),Ti(n,e)}}function Oi(t,e){const n=this.cache,r=e.elements;if(void 0===r){if(Si(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Ti(n,e)}else{if(Si(n,r))return;wi.set(r),t.uniformMatrix2fv(this.addr,!1,wi),Ti(n,r)}}function Ii(t,e){const n=this.cache,r=e.elements;if(void 0===r){if(Si(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Ti(n,e)}else{if(Si(n,r))return;Mi.set(r),t.uniformMatrix3fv(this.addr,!1,Mi),Ti(n,r)}}function qi(t,e){const n=this.cache,r=e.elements;if(void 0===r){if(Si(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Ti(n,e)}else{if(Si(n,r))return;bi.set(r),t.uniformMatrix4fv(this.addr,!1,bi),Ti(n,r)}}function Ui(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function Ni(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2i(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Si(n,e))return;t.uniform2iv(this.addr,e),Ti(n,e)}}function Bi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3i(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(Si(n,e))return;t.uniform3iv(this.addr,e),Ti(n,e)}}function ki(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4i(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Si(n,e))return;t.uniform4iv(this.addr,e),Ti(n,e)}}function Fi(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function zi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2ui(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Si(n,e))return;t.uniform2uiv(this.addr,e),Ti(n,e)}}function Gi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3ui(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(Si(n,e))return;t.uniform3uiv(this.addr,e),Ti(n,e)}}function Hi(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4ui(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Si(n,e))return;t.uniform4uiv(this.addr,e),Ti(n,e)}}function ji(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i);const a=this.type===t.SAMPLER_2D_SHADOW?mi:pi;n.setTexture2D(e||a,i)}function Vi(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(e||vi,i)}function Wi(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(e||_i,i)}function Xi(t,e,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(e||gi,i)}function Qi(t,e){t.uniform1fv(this.addr,e)}function Yi(t,e){const n=Ei(e,this.size,2);t.uniform2fv(this.addr,n)}function Zi(t,e){const n=Ei(e,this.size,3);t.uniform3fv(this.addr,n)}function Ki(t,e){const n=Ei(e,this.size,4);t.uniform4fv(this.addr,n)}function Ji(t,e){const n=Ei(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function $i(t,e){const n=Ei(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function ta(t,e){const n=Ei(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function ea(t,e){t.uniform1iv(this.addr,e)}function na(t,e){t.uniform2iv(this.addr,e)}function ra(t,e){t.uniform3iv(this.addr,e)}function ia(t,e){t.uniform4iv(this.addr,e)}function aa(t,e){t.uniform1uiv(this.addr,e)}function oa(t,e){t.uniform2uiv(this.addr,e)}function sa(t,e){t.uniform3uiv(this.addr,e)}function Aa(t,e){t.uniform4uiv(this.addr,e)}function la(t,e,n){const r=this.cache,i=e.length,a=Ci(n,i);Si(r,a)||(t.uniform1iv(this.addr,a),Ti(r,a));for(let t=0;t!==i;++t)n.setTexture2D(e[t]||pi,a[t])}function ca(t,e,n){const r=this.cache,i=e.length,a=Ci(n,i);Si(r,a)||(t.uniform1iv(this.addr,a),Ti(r,a));for(let t=0;t!==i;++t)n.setTexture3D(e[t]||vi,a[t])}function ua(t,e,n){const r=this.cache,i=e.length,a=Ci(n,i);Si(r,a)||(t.uniform1iv(this.addr,a),Ti(r,a));for(let t=0;t!==i;++t)n.setTextureCube(e[t]||_i,a[t])}function ha(t,e,n){const r=this.cache,i=e.length,a=Ci(n,i);Si(r,a)||(t.uniform1iv(this.addr,a),Ti(r,a));for(let t=0;t!==i;++t)n.setTexture2DArray(e[t]||gi,a[t])}class da{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.setValue=function(t){switch(t){case 5126:return Ri;case 35664:return Pi;case 35665:return Li;case 35666:return Di;case 35674:return Oi;case 35675:return Ii;case 35676:return qi;case 5124:case 35670:return Ui;case 35667:case 35671:return Ni;case 35668:case 35672:return Bi;case 35669:case 35673:return ki;case 5125:return Fi;case 36294:return zi;case 36295:return Gi;case 36296:return Hi;case 35678:case 36198:case 36298:case 36306:case 35682:return ji;case 35679:case 36299:case 36307:return Vi;case 35680:case 36300:case 36308:case 36293:return Wi;case 36289:case 36303:case 36311:case 36292:return Xi}}(e.type)}}class fa{constructor(t,e,n){this.id=t,this.addr=n,this.cache=[],this.type=e.type,this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Qi;case 35664:return Yi;case 35665:return Zi;case 35666:return Ki;case 35674:return Ji;case 35675:return $i;case 35676:return ta;case 5124:case 35670:return ea;case 35667:case 35671:return na;case 35668:case 35672:return ra;case 35669:case 35673:return ia;case 5125:return aa;case 36294:return oa;case 36295:return sa;case 36296:return Aa;case 35678:case 36198:case 36298:case 36306:case 35682:return la;case 35679:case 36299:case 36307:return ca;case 35680:case 36300:case 36308:case 36293:return ua;case 36289:case 36303:case 36311:case 36292:return ha}}(e.type)}}class pa{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,e,n){const r=this.seq;for(let i=0,a=r.length;i!==a;++i){const a=r[i];a.setValue(t,e[a.id],n)}}}const ma=/(\w+)(\])?(\[|\.)?/g;function ga(t,e){t.seq.push(e),t.map[e.id]=e}function va(t,e,n){const r=t.name,i=r.length;for(ma.lastIndex=0;;){const a=ma.exec(r),o=ma.lastIndex;let s=a[1];const A="]"===a[2],l=a[3];if(A&&(s|=0),void 0===l||"["===l&&o+2===i){ga(n,void 0===l?new da(s,t,e):new fa(s,t,e));break}{let t=n.map[s];void 0===t&&(t=new pa(s),ga(n,t)),n=t}}}class _a{constructor(t,e){this.seq=[],this.map={};const n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){const n=t.getActiveUniform(e,r);va(n,t.getUniformLocation(e,n.name),this)}}setValue(t,e,n,r){const i=this.map[e];void 0!==i&&i.setValue(t,n,r)}setOptional(t,e,n){const r=e[n];void 0!==r&&this.setValue(t,n,r)}static upload(t,e,n,r){for(let i=0,a=e.length;i!==a;++i){const a=e[i],o=n[a.id];!1!==o.needsUpdate&&a.setValue(t,o.value,r)}}static seqWithValue(t,e){const n=[];for(let r=0,i=t.length;r!==i;++r){const i=t[r];i.id in e&&n.push(i)}return n}}function ya(t,e,n){const r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),r}const xa=37297;let ba=0;function Ma(t,e,n){const r=t.getShaderParameter(e,t.COMPILE_STATUS),i=t.getShaderInfoLog(e).trim();if(r&&""===i)return"";const a=/ERROR: 0:(\d+)/.exec(i);if(a){const r=parseInt(a[1]);return n.toUpperCase()+"\n\n"+i+"\n\n"+function(t,e){const n=t.split("\n"),r=[],i=Math.max(e-6,0),a=Math.min(e+6,n.length);for(let t=i;t<a;t++){const i=t+1;r.push(`${i===e?">":" "} ${i}: ${n[t]}`)}return r.join("\n")}(t.getShaderSource(e),r)}return i}function wa(t,e){const n=function(t){const e=Ht.getPrimaries(Ht.workingColorSpace),n=Ht.getPrimaries(t);let r;switch(e===n?r="":e===ct&&n===lt?r="LinearDisplayP3ToLinearSRGB":e===lt&&n===ct&&(r="LinearSRGBToLinearDisplayP3"),t){case it:case ot:return[r,"LinearTransferOETF"];case rt:case at:return[r,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[r,"LinearTransferOETF"]}}(e);return`vec4 ${t}( vec4 value ) { return ${n[0]}( ${n[1]}( value ) ); }`}function Ea(t,e){let n;switch(e){case M:n="Linear";break;case w:n="Reinhard";break;case E:n="OptimizedCineon";break;case S:n="ACESFilmic";break;case C:n="AgX";break;case T:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Sa(t){return""!==t}function Ta(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Ca(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Ra=/^[ \t]*#include +<([\w\d./]+)>/gm;function Pa(t){return t.replace(Ra,Da)}const La=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function Da(t,e){let n=Dr[e];if(void 0===n){const t=La.get(e);if(void 0===t)throw new Error("Can not resolve #include <"+e+">");n=Dr[t],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,t)}return Pa(n)}const Oa=/#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 Ia(t){return t.replace(Oa,qa)}function qa(t,e,n,r){let i="";for(let t=parseInt(e);t<parseInt(n);t++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t);return i}function Ua(t){let e=`precision ${t.precision} float;\n\tprecision ${t.precision} int;\n\tprecision ${t.precision} sampler2D;\n\tprecision ${t.precision} samplerCube;\n\t`;return t.isWebGL2&&(e+=`precision ${t.precision} sampler3D;\n\t\tprecision ${t.precision} sampler2DArray;\n\t\tprecision ${t.precision} sampler2DShadow;\n\t\tprecision ${t.precision} samplerCubeShadow;\n\t\tprecision ${t.precision} sampler2DArrayShadow;\n\t\tprecision ${t.precision} isampler2D;\n\t\tprecision ${t.precision} isampler3D;\n\t\tprecision ${t.precision} isamplerCube;\n\t\tprecision ${t.precision} isampler2DArray;\n\t\tprecision ${t.precision} usampler2D;\n\t\tprecision ${t.precision} usampler3D;\n\t\tprecision ${t.precision} usamplerCube;\n\t\tprecision ${t.precision} usampler2DArray;\n\t\t`),"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function Na(t,e,n,r){const i=t.getContext(),a=n.defines;let o=n.vertexShader,s=n.fragmentShader;const A=function(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===d?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===f?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===p&&(e="SHADOWMAP_TYPE_VSM"),e}(n),l=function(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case R:case P:e="ENVMAP_TYPE_CUBE";break;case L:e="ENVMAP_TYPE_CUBE_UV"}return e}(n),c=function(t){let e="ENVMAP_MODE_REFLECTION";t.envMap&&t.envMapMode===P&&(e="ENVMAP_MODE_REFRACTION");return e}(n),u=function(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case _:e="ENVMAP_BLENDING_MULTIPLY";break;case y:e="ENVMAP_BLENDING_MIX";break;case x:e="ENVMAP_BLENDING_ADD"}return e}(n),h=function(t){const e=t.envMapCubeUVHeight;if(null===e)return null;const n=Math.log2(e)-2,r=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:r,maxMip:n}}(n),m=n.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.normalMapTangentSpace||t.clearcoatNormalMap||t.flatShading||t.alphaToCoverage||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Sa).join("\n")}(n),g=function(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Sa).join("\n")}(n),v=function(t){const e=[];for(const n in t){const r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}(a),M=i.createProgram();let w,E,S=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(w=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v].filter(Sa).join("\n"),w.length>0&&(w+="\n"),E=[m,"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v].filter(Sa).join("\n"),E.length>0&&(E+="\n")):(w=[Ua(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",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.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors&&n.isWebGL2?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",n.morphTargetsCount>0&&n.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0&&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.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",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_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#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(Sa).join("\n"),E=[m,Ua(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,v,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",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:"",h?"#define CUBEUV_TEXEL_WIDTH "+h.texelWidth:"",h?"#define CUBEUV_TEXEL_HEIGHT "+h.texelHeight:"",h?"#define CUBEUV_MAX_MIP "+h.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",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.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.useLegacyLights?"#define LEGACY_LIGHTS":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==b?"#define TONE_MAPPING":"",n.toneMapping!==b?Dr.tonemapping_pars_fragment:"",n.toneMapping!==b?Ea("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",Dr.colorspace_pars_fragment,wa("linearToOutputTexel",n.outputColorSpace),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Sa).join("\n")),o=Pa(o),o=Ta(o,n),o=Ca(o,n),s=Pa(s),s=Ta(s,n),s=Ca(s,n),o=Ia(o),s=Ia(s),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(S="#version 300 es\n",w=[g,"precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+w,E=["precision mediump sampler2DArray;","#define varying in",n.glslVersion===dt?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===dt?"":"#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"+E);const T=S+w+o,C=S+E+s,D=ya(i,i.VERTEX_SHADER,T),O=ya(i,i.FRAGMENT_SHADER,C);function I(e){if(t.debug.checkShaderErrors){const n=i.getProgramInfoLog(M).trim(),r=i.getShaderInfoLog(D).trim(),a=i.getShaderInfoLog(O).trim();let o=!0,s=!0;if(!1===i.getProgramParameter(M,i.LINK_STATUS))if(o=!1,"function"==typeof t.debug.onShaderError)t.debug.onShaderError(i,M,D,O);else{const t=Ma(i,D,"vertex"),r=Ma(i,O,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(M,i.VALIDATE_STATUS)+"\n\nMaterial Name: "+e.name+"\nMaterial Type: "+e.type+"\n\nProgram Info Log: "+n+"\n"+t+"\n"+r)}else""!==n?console.warn("THREE.WebGLProgram: Program Info Log:",n):""!==r&&""!==a||(s=!1);s&&(e.diagnostics={runnable:o,programLog:n,vertexShader:{log:r,prefix:w},fragmentShader:{log:a,prefix:E}})}i.deleteShader(D),i.deleteShader(O),q=new _a(i,M),U=function(t,e){const n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const r=t.getActiveAttrib(e,i),a=r.name;let o=1;r.type===t.FLOAT_MAT2&&(o=2),r.type===t.FLOAT_MAT3&&(o=3),r.type===t.FLOAT_MAT4&&(o=4),n[a]={type:r.type,location:t.getAttribLocation(e,a),locationSize:o}}return n}(i,M)}let q,U;i.attachShader(M,D),i.attachShader(M,O),void 0!==n.index0AttributeName?i.bindAttribLocation(M,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(M,0,"position"),i.linkProgram(M),this.getUniforms=function(){return void 0===q&&I(this),q},this.getAttributes=function(){return void 0===U&&I(this),U};let N=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===N&&(N=i.getProgramParameter(M,xa)),N},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(M),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=ba++,this.cacheKey=e,this.usedTimes=1,this.program=M,this.vertexShader=D,this.fragmentShader=O,this}let Ba=0;class ka{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,n=t.fragmentShader,r=this._getShaderStage(e),i=this._getShaderStage(n),a=this._getShaderCacheForMaterial(t);return!1===a.has(r)&&(a.add(r),r.usedTimes++),!1===a.has(i)&&(a.add(i),i.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const t of e)t.usedTimes--,0===t.usedTimes&&this.shaderCache.delete(t.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;let n=e.get(t);return void 0===n&&(n=new Set,e.set(t,n)),n}_getShaderStage(t){const e=this.shaderCache;let n=e.get(t);return void 0===n&&(n=new Fa(t),e.set(t,n)),n}}class Fa{constructor(t){this.id=Ba++,this.code=t,this.usedTimes=0}}function za(t,e,n,r,i,a,o){const s=new We,A=new ka,l=new Set,c=[],u=i.isWebGL2,h=i.logarithmicDepthBuffer,d=i.vertexTextures;let f=i.precision;const p={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function m(t){return l.add(t),0===t?"uv":`uv${t}`}return{getParameters:function(a,s,c,v,_){const y=v.fog,x=_.geometry,M=a.isMeshStandardMaterial?v.environment:null,w=(a.isMeshStandardMaterial?n:e).get(a.envMap||M),E=w&&w.mapping===L?w.image.height:null,S=p[a.type];null!==a.precision&&(f=i.getMaxPrecision(a.precision),f!==a.precision&&console.warn("THREE.WebGLProgram.getParameters:",a.precision,"not supported, using",f,"instead."));const T=x.morphAttributes.position||x.morphAttributes.normal||x.morphAttributes.color,C=void 0!==T?T.length:0;let R,P,D,O,I=0;if(void 0!==x.morphAttributes.position&&(I=1),void 0!==x.morphAttributes.normal&&(I=2),void 0!==x.morphAttributes.color&&(I=3),S){const t=Ir[S];R=t.vertexShader,P=t.fragmentShader}else R=a.vertexShader,P=a.fragmentShader,A.update(a),D=A.getVertexShaderID(a),O=A.getFragmentShaderID(a);const q=t.getRenderTarget(),U=!0===_.isInstancedMesh,N=!0===_.isBatchedMesh,B=!!a.map,k=!!a.matcap,F=!!w,z=!!a.aoMap,G=!!a.lightMap,H=!!a.bumpMap,j=!!a.normalMap,V=!!a.displacementMap,W=!!a.emissiveMap,X=!!a.metalnessMap,Q=!!a.roughnessMap,Y=a.anisotropy>0,Z=a.clearcoat>0,K=a.iridescence>0,J=a.sheen>0,$=a.transmission>0,tt=Y&&!!a.anisotropyMap,et=Z&&!!a.clearcoatMap,nt=Z&&!!a.clearcoatNormalMap,rt=Z&&!!a.clearcoatRoughnessMap,at=K&&!!a.iridescenceMap,ot=K&&!!a.iridescenceThicknessMap,st=J&&!!a.sheenColorMap,lt=J&&!!a.sheenRoughnessMap,ct=!!a.specularMap,ut=!!a.specularColorMap,ht=!!a.specularIntensityMap,dt=$&&!!a.transmissionMap,ft=$&&!!a.thicknessMap,pt=!!a.gradientMap,mt=!!a.alphaMap,gt=a.alphaTest>0,vt=!!a.alphaHash,_t=!!a.extensions;let yt=b;a.toneMapped&&(null!==q&&!0!==q.isXRRenderTarget||(yt=t.toneMapping));const xt={isWebGL2:u,shaderID:S,shaderType:a.type,shaderName:a.name,vertexShader:R,fragmentShader:P,defines:a.defines,customVertexShaderID:D,customFragmentShaderID:O,isRawShaderMaterial:!0===a.isRawShaderMaterial,glslVersion:a.glslVersion,precision:f,batching:N,instancing:U,instancingColor:U&&null!==_.instanceColor,supportsVertexTextures:d,outputColorSpace:null===q?t.outputColorSpace:!0===q.isXRRenderTarget?q.texture.colorSpace:it,alphaToCoverage:!!a.alphaToCoverage,map:B,matcap:k,envMap:F,envMapMode:F&&w.mapping,envMapCubeUVHeight:E,aoMap:z,lightMap:G,bumpMap:H,normalMap:j,displacementMap:d&&V,emissiveMap:W,normalMapObjectSpace:j&&1===a.normalMapType,normalMapTangentSpace:j&&0===a.normalMapType,metalnessMap:X,roughnessMap:Q,anisotropy:Y,anisotropyMap:tt,clearcoat:Z,clearcoatMap:et,clearcoatNormalMap:nt,clearcoatRoughnessMap:rt,iridescence:K,iridescenceMap:at,iridescenceThicknessMap:ot,sheen:J,sheenColorMap:st,sheenRoughnessMap:lt,specularMap:ct,specularColorMap:ut,specularIntensityMap:ht,transmission:$,transmissionMap:dt,thicknessMap:ft,gradientMap:pt,opaque:!1===a.transparent&&1===a.blending&&!1===a.alphaToCoverage,alphaMap:mt,alphaTest:gt,alphaHash:vt,combine:a.combine,mapUv:B&&m(a.map.channel),aoMapUv:z&&m(a.aoMap.channel),lightMapUv:G&&m(a.lightMap.channel),bumpMapUv:H&&m(a.bumpMap.channel),normalMapUv:j&&m(a.normalMap.channel),displacementMapUv:V&&m(a.displacementMap.channel),emissiveMapUv:W&&m(a.emissiveMap.channel),metalnessMapUv:X&&m(a.metalnessMap.channel),roughnessMapUv:Q&&m(a.roughnessMap.channel),anisotropyMapUv:tt&&m(a.anisotropyMap.channel),clearcoatMapUv:et&&m(a.clearcoatMap.channel),clearcoatNormalMapUv:nt&&m(a.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:rt&&m(a.clearcoatRoughnessMap.channel),iridescenceMapUv:at&&m(a.iridescenceMap.channel),iridescenceThicknessMapUv:ot&&m(a.iridescenceThicknessMap.channel),sheenColorMapUv:st&&m(a.sheenColorMap.channel),sheenRoughnessMapUv:lt&&m(a.sheenRoughnessMap.channel),specularMapUv:ct&&m(a.specularMap.channel),specularColorMapUv:ut&&m(a.specularColorMap.channel),specularIntensityMapUv:ht&&m(a.specularIntensityMap.channel),transmissionMapUv:dt&&m(a.transmissionMap.channel),thicknessMapUv:ft&&m(a.thicknessMap.channel),alphaMapUv:mt&&m(a.alphaMap.channel),vertexTangents:!!x.attributes.tangent&&(j||Y),vertexColors:a.vertexColors,vertexAlphas:!0===a.vertexColors&&!!x.attributes.color&&4===x.attributes.color.itemSize,pointsUvs:!0===_.isPoints&&!!x.attributes.uv&&(B||mt),fog:!!y,useFog:!0===a.fog,fogExp2:!!y&&y.isFogExp2,flatShading:!0===a.flatShading,sizeAttenuation:!0===a.sizeAttenuation,logarithmicDepthBuffer:h,skinning:!0===_.isSkinnedMesh,morphTargets:void 0!==x.morphAttributes.position,morphNormals:void 0!==x.morphAttributes.normal,morphColors:void 0!==x.morphAttributes.color,morphTargetsCount:C,morphTextureStride:I,numDirLights:s.directional.length,numPointLights:s.point.length,numSpotLights:s.spot.length,numSpotLightMaps:s.spotLightMap.length,numRectAreaLights:s.rectArea.length,numHemiLights:s.hemi.length,numDirLightShadows:s.directionalShadowMap.length,numPointLightShadows:s.pointShadowMap.length,numSpotLightShadows:s.spotShadowMap.length,numSpotLightShadowsWithMaps:s.numSpotLightShadowsWithMaps,numLightProbes:s.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:a.dithering,shadowMapEnabled:t.shadowMap.enabled&&c.length>0,shadowMapType:t.shadowMap.type,toneMapping:yt,useLegacyLights:t._useLegacyLights,decodeVideoTexture:B&&!0===a.map.isVideoTexture&&Ht.getTransfer(a.map.colorSpace)===At,premultipliedAlpha:a.premultipliedAlpha,doubleSided:2===a.side,flipSided:a.side===g,useDepthPacking:a.depthPacking>=0,depthPacking:a.depthPacking||0,index0AttributeName:a.index0AttributeName,extensionDerivatives:_t&&!0===a.extensions.derivatives,extensionFragDepth:_t&&!0===a.extensions.fragDepth,extensionDrawBuffers:_t&&!0===a.extensions.drawBuffers,extensionShaderTextureLOD:_t&&!0===a.extensions.shaderTextureLOD,extensionClipCullDistance:_t&&!0===a.extensions.clipCullDistance&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:_t&&!0===a.extensions.multiDraw&&r.has("WEBGL_multi_draw"),rendererExtensionFragDepth:u||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||r.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:a.customProgramCacheKey()};return xt.vertexUv1s=l.has(1),xt.vertexUv2s=l.has(2),xt.vertexUv3s=l.has(3),l.clear(),xt},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.customVertexShaderID),n.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputColorSpace),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.mapUv),t.push(e.alphaMapUv),t.push(e.lightMapUv),t.push(e.aoMapUv),t.push(e.bumpMapUv),t.push(e.normalMapUv),t.push(e.displacementMapUv),t.push(e.emissiveMapUv),t.push(e.metalnessMapUv),t.push(e.roughnessMapUv),t.push(e.anisotropyMapUv),t.push(e.clearcoatMapUv),t.push(e.clearcoatNormalMapUv),t.push(e.clearcoatRoughnessMapUv),t.push(e.iridescenceMapUv),t.push(e.iridescenceThicknessMapUv),t.push(e.sheenColorMapUv),t.push(e.sheenRoughnessMapUv),t.push(e.specularMapUv),t.push(e.specularColorMapUv),t.push(e.specularIntensityMapUv),t.push(e.transmissionMapUv),t.push(e.thicknessMapUv),t.push(e.combine),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numSpotLightMaps),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.numSpotLightShadowsWithMaps),t.push(e.numLightProbes),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(n,e),function(t,e){s.disableAll(),e.isWebGL2&&s.enable(0);e.supportsVertexTextures&&s.enable(1);e.instancing&&s.enable(2);e.instancingColor&&s.enable(3);e.matcap&&s.enable(4);e.envMap&&s.enable(5);e.normalMapObjectSpace&&s.enable(6);e.normalMapTangentSpace&&s.enable(7);e.clearcoat&&s.enable(8);e.iridescence&&s.enable(9);e.alphaTest&&s.enable(10);e.vertexColors&&s.enable(11);e.vertexAlphas&&s.enable(12);e.vertexUv1s&&s.enable(13);e.vertexUv2s&&s.enable(14);e.vertexUv3s&&s.enable(15);e.vertexTangents&&s.enable(16);e.anisotropy&&s.enable(17);e.alphaHash&&s.enable(18);e.batching&&s.enable(19);t.push(s.mask),s.disableAll(),e.fog&&s.enable(0);e.useFog&&s.enable(1);e.flatShading&&s.enable(2);e.logarithmicDepthBuffer&&s.enable(3);e.skinning&&s.enable(4);e.morphTargets&&s.enable(5);e.morphNormals&&s.enable(6);e.morphColors&&s.enable(7);e.premultipliedAlpha&&s.enable(8);e.shadowMapEnabled&&s.enable(9);e.useLegacyLights&&s.enable(10);e.doubleSided&&s.enable(11);e.flipSided&&s.enable(12);e.useDepthPacking&&s.enable(13);e.dithering&&s.enable(14);e.transmission&&s.enable(15);e.sheen&&s.enable(16);e.opaque&&s.enable(17);e.pointsUvs&&s.enable(18);e.decodeVideoTexture&&s.enable(19);e.alphaToCoverage&&s.enable(20);t.push(s.mask)}(n,e),n.push(t.outputColorSpace)),n.push(e.customProgramCacheKey),n.join()},getUniforms:function(t){const e=p[t.type];let n;if(e){const t=Ir[e];n=ur.clone(t.uniforms)}else n=t.uniforms;return n},acquireProgram:function(e,n){let r;for(let t=0,e=c.length;t<e;t++){const e=c[t];if(e.cacheKey===n){r=e,++r.usedTimes;break}}return void 0===r&&(r=new Na(t,n,e,a),c.push(r)),r},releaseProgram:function(t){if(0==--t.usedTimes){const e=c.indexOf(t);c[e]=c[c.length-1],c.pop(),t.destroy()}},releaseShaderCache:function(t){A.remove(t)},programs:c,dispose:function(){A.dispose()}}}function Ga(){let t=new WeakMap;return{get:function(e){let n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,r){t.get(e)[n]=r},dispose:function(){t=new WeakMap}}}function Ha(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function ja(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Va(){const t=[];let e=0;const n=[],r=[],i=[];function a(n,r,i,a,o,s){let A=t[e];return void 0===A?(A={id:n.id,object:n,geometry:r,material:i,groupOrder:a,renderOrder:n.renderOrder,z:o,group:s},t[e]=A):(A.id=n.id,A.object=n,A.geometry=r,A.material=i,A.groupOrder=a,A.renderOrder=n.renderOrder,A.z=o,A.group=s),e++,A}return{opaque:n,transmissive:r,transparent:i,init:function(){e=0,n.length=0,r.length=0,i.length=0},push:function(t,e,o,s,A,l){const c=a(t,e,o,s,A,l);o.transmission>0?r.push(c):!0===o.transparent?i.push(c):n.push(c)},unshift:function(t,e,o,s,A,l){const c=a(t,e,o,s,A,l);o.transmission>0?r.unshift(c):!0===o.transparent?i.unshift(c):n.unshift(c)},finish:function(){for(let n=e,r=t.length;n<r;n++){const e=t[n];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.group=null}},sort:function(t,e){n.length>1&&n.sort(t||Ha),r.length>1&&r.sort(e||ja),i.length>1&&i.sort(e||ja)}}}function Wa(){let t=new WeakMap;return{get:function(e,n){const r=t.get(e);let i;return void 0===r?(i=new Va,t.set(e,[i])):n>=r.length?(i=new Va,r.push(i)):i=r[n],i},dispose:function(){t=new WeakMap}}}function Xa(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new ae,color:new Mn};break;case"SpotLight":n={position:new ae,direction:new ae,color:new Mn,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new ae,color:new Mn,distance:0,decay:0};break;case"HemisphereLight":n={direction:new ae,skyColor:new Mn,groundColor:new Mn};break;case"RectAreaLight":n={color:new Mn,position:new ae,halfWidth:new ae,halfHeight:new ae}}return t[e.id]=n,n}}}let Qa=0;function Ya(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function Za(t,e){const n=new Xa,r=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Lt};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Lt,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let t=0;t<9;t++)i.probe.push(new ae);const a=new ae,o=new qe,s=new qe;return{setup:function(a,o){let s=0,A=0,l=0;for(let t=0;t<9;t++)i.probe[t].set(0,0,0);let c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,_=0,y=0;a.sort(Ya);const x=!0===o?Math.PI:1;for(let t=0,e=a.length;t<e;t++){const e=a[t],o=e.color,b=e.intensity,M=e.distance,w=e.shadow&&e.shadow.map?e.shadow.map.texture:null;if(e.isAmbientLight)s+=o.r*b*x,A+=o.g*b*x,l+=o.b*b*x;else if(e.isLightProbe){for(let t=0;t<9;t++)i.probe[t].addScaledVector(e.sh.coefficients[t],b);y++}else if(e.isDirectionalLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*x),e.castShadow){const t=e.shadow,n=r.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,i.directionalShadow[c]=n,i.directionalShadowMap[c]=w,i.directionalShadowMatrix[c]=e.shadow.matrix,p++}i.directional[c]=t,c++}else if(e.isSpotLight){const t=n.get(e);t.position.setFromMatrixPosition(e.matrixWorld),t.color.copy(o).multiplyScalar(b*x),t.distance=M,t.coneCos=Math.cos(e.angle),t.penumbraCos=Math.cos(e.angle*(1-e.penumbra)),t.decay=e.decay,i.spot[h]=t;const a=e.shadow;if(e.map&&(i.spotLightMap[v]=e.map,v++,a.updateMatrices(e),e.castShadow&&_++),i.spotLightMatrix[h]=a.matrix,e.castShadow){const t=r.get(e);t.shadowBias=a.bias,t.shadowNormalBias=a.normalBias,t.shadowRadius=a.radius,t.shadowMapSize=a.mapSize,i.spotShadow[h]=t,i.spotShadowMap[h]=w,g++}h++}else if(e.isRectAreaLight){const t=n.get(e);t.color.copy(o).multiplyScalar(b),t.halfWidth.set(.5*e.width,0,0),t.halfHeight.set(0,.5*e.height,0),i.rectArea[d]=t,d++}else if(e.isPointLight){const t=n.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*x),t.distance=e.distance,t.decay=e.decay,e.castShadow){const t=e.shadow,n=r.get(e);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,n.shadowCameraNear=t.camera.near,n.shadowCameraFar=t.camera.far,i.pointShadow[u]=n,i.pointShadowMap[u]=w,i.pointShadowMatrix[u]=e.shadow.matrix,m++}i.point[u]=t,u++}else if(e.isHemisphereLight){const t=n.get(e);t.skyColor.copy(e.color).multiplyScalar(b*x),t.groundColor.copy(e.groundColor).multiplyScalar(b*x),i.hemi[f]=t,f++}}d>0&&(e.isWebGL2?!0===t.has("OES_texture_float_linear")?(i.rectAreaLTC1=Or.LTC_FLOAT_1,i.rectAreaLTC2=Or.LTC_FLOAT_2):(i.rectAreaLTC1=Or.LTC_HALF_1,i.rectAreaLTC2=Or.LTC_HALF_2):!0===t.has("OES_texture_float_linear")?(i.rectAreaLTC1=Or.LTC_FLOAT_1,i.rectAreaLTC2=Or.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=Or.LTC_HALF_1,i.rectAreaLTC2=Or.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 b=i.hash;b.directionalLength===c&&b.pointLength===u&&b.spotLength===h&&b.rectAreaLength===d&&b.hemiLength===f&&b.numDirectionalShadows===p&&b.numPointShadows===m&&b.numSpotShadows===g&&b.numSpotMaps===v&&b.numLightProbes===y||(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.spotLightMatrix.length=g+v-_,i.spotLightMap.length=v,i.numSpotLightShadowsWithMaps=_,i.numLightProbes=y,b.directionalLength=c,b.pointLength=u,b.spotLength=h,b.rectAreaLength=d,b.hemiLength=f,b.numDirectionalShadows=p,b.numPointShadows=m,b.numSpotShadows=g,b.numSpotMaps=v,b.numLightProbes=y,i.version=Qa++)},setupView:function(t,e){let n=0,r=0,A=0,l=0,c=0;const u=e.matrixWorldInverse;for(let e=0,h=t.length;e<h;e++){const h=t[e];if(h.isDirectionalLight){const t=i.directional[n];t.direction.setFromMatrixPosition(h.matrixWorld),a.setFromMatrixPosition(h.target.matrixWorld),t.direction.sub(a),t.direction.transformDirection(u),n++}else if(h.isSpotLight){const t=i.spot[A];t.position.setFromMatrixPosition(h.matrixWorld),t.position.applyMatrix4(u),t.direction.setFromMatrixPosition(h.matrixWorld),a.setFromMatrixPosition(h.target.matrixWorld),t.direction.sub(a),t.direction.transformDirection(u),A++}else if(h.isRectAreaLight){const t=i.rectArea[l];t.position.setFromMatrixPosition(h.matrixWorld),t.position.applyMatrix4(u),s.identity(),o.copy(h.matrixWorld),o.premultiply(u),s.extractRotation(o),t.halfWidth.set(.5*h.width,0,0),t.halfHeight.set(0,.5*h.height,0),t.halfWidth.applyMatrix4(s),t.halfHeight.applyMatrix4(s),l++}else if(h.isPointLight){const t=i.point[r];t.position.setFromMatrixPosition(h.matrixWorld),t.position.applyMatrix4(u),r++}else if(h.isHemisphereLight){const t=i.hemi[c];t.direction.setFromMatrixPosition(h.matrixWorld),t.direction.transformDirection(u),c++}}},state:i}}function Ka(t,e){const n=new Za(t,e),r=[],i=[];return{init:function(){r.length=0,i.length=0},state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:function(t){n.setup(r,t)},setupLightsView:function(t){n.setupView(r,t)},pushLight:function(t){r.push(t)},pushShadow:function(t){i.push(t)}}}function Ja(t,e){let n=new WeakMap;return{get:function(r,i=0){const a=n.get(r);let o;return void 0===a?(o=new Ka(t,e),n.set(r,[o])):i>=a.length?(o=new Ka(t,e),a.push(o)):o=a[i],o},dispose:function(){n=new WeakMap}}}class $a extends Sn{constructor(t){super(),this.isMeshDepthMaterial=!0,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.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}class to extends Sn{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}function eo(t,e,n){let r=new Cr;const i=new Lt,a=new Lt,o=new $t,s=new $a({depthPacking:3201}),A=new to,l={},c=n.maxTextureSize,u={[m]:g,[g]:m,2:2},h=new hr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Lt},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\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}"}),f=h.clone();f.defines.HORIZONTAL_PASS=1;const v=new zn;v.setAttribute("position",new Pn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new ar(v,h),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=d;let x=this.type;function b(n,r){const a=e.update(_);h.defines.VSM_SAMPLES!==n.blurSamples&&(h.defines.VSM_SAMPLES=n.blurSamples,f.defines.VSM_SAMPLES=n.blurSamples,h.needsUpdate=!0,f.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new ee(i.x,i.y)),h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(r,null,a,h,_,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(r,null,a,f,_,null)}function M(e,n,r,i){let a=null;const o=!0===r.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(void 0!==o)a=o;else if(a=!0===r.isPointLight?A:s,t.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0){const t=a.uuid,e=n.uuid;let r=l[t];void 0===r&&(r={},l[t]=r);let i=r[e];void 0===i&&(i=a.clone(),r[e]=i,n.addEventListener("dispose",E)),a=i}if(a.visible=n.visible,a.wireframe=n.wireframe,a.side=i===p?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:u[n.side],a.alphaMap=n.alphaMap,a.alphaTest=n.alphaTest,a.map=n.map,a.clipShadows=n.clipShadows,a.clippingPlanes=n.clippingPlanes,a.clipIntersection=n.clipIntersection,a.displacementMap=n.displacementMap,a.displacementScale=n.displacementScale,a.displacementBias=n.displacementBias,a.wireframeLinewidth=n.wireframeLinewidth,a.linewidth=n.linewidth,!0===r.isPointLight&&!0===a.isMeshDistanceMaterial){t.properties.get(a).light=r}return a}function w(n,i,a,o,s){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===p)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);const r=e.update(n),A=n.material;if(Array.isArray(A)){const e=r.groups;for(let l=0,c=e.length;l<c;l++){const c=e[l],u=A[c.materialIndex];if(u&&u.visible){const e=M(n,u,o,s);n.onBeforeShadow(t,n,i,a,r,e,c),t.renderBufferDirect(a,null,r,e,n,c),n.onAfterShadow(t,n,i,a,r,e,c)}}}else if(A.visible){const e=M(n,A,o,s);n.onBeforeShadow(t,n,i,a,r,e,null),t.renderBufferDirect(a,null,r,e,n,null),n.onAfterShadow(t,n,i,a,r,e,null)}}const A=n.children;for(let t=0,e=A.length;t<e;t++)w(A[t],i,a,o,s)}function E(t){t.target.removeEventListener("dispose",E);for(const e in l){const n=l[e],r=t.target.uuid;if(r in n){n[r].dispose(),delete n[r]}}}this.render=function(e,n,s){if(!1===y.enabled)return;if(!1===y.autoUpdate&&!1===y.needsUpdate)return;if(0===e.length)return;const A=t.getRenderTarget(),l=t.getActiveCubeFace(),u=t.getActiveMipmapLevel(),h=t.state;h.setBlending(0),h.buffers.color.setClear(1,1,1,1),h.buffers.depth.setTest(!0),h.setScissorTest(!1);const d=x!==p&&this.type===p,f=x===p&&this.type!==p;for(let A=0,l=e.length;A<l;A++){const l=e[A],u=l.shadow;if(void 0===u){console.warn("THREE.WebGLShadowMap:",l,"has no shadow.");continue}if(!1===u.autoUpdate&&!1===u.needsUpdate)continue;i.copy(u.mapSize);const m=u.getFrameExtents();if(i.multiply(m),a.copy(u.mapSize),(i.x>c||i.y>c)&&(i.x>c&&(a.x=Math.floor(c/m.x),i.x=a.x*m.x,u.mapSize.x=a.x),i.y>c&&(a.y=Math.floor(c/m.y),i.y=a.y*m.y,u.mapSize.y=a.y)),null===u.map||!0===d||!0===f){const t=this.type!==p?{minFilter:q,magFilter:q}:{};null!==u.map&&u.map.dispose(),u.map=new ee(i.x,i.y,t),u.map.texture.name=l.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const g=u.getViewportCount();for(let t=0;t<g;t++){const e=u.getViewport(t);o.set(a.x*e.x,a.y*e.y,a.x*e.z,a.y*e.w),h.viewport(o),u.updateMatrices(l,t),r=u.getFrustum(),w(n,s,u.camera,l,this.type)}!0!==u.isPointLightShadow&&this.type===p&&b(u,s),u.needsUpdate=!1}x=this.type,y.needsUpdate=!1,t.setRenderTarget(A,l,u)}}function no(t,e,n){const r=n.isWebGL2;const i=new function(){let e=!1;const n=new $t;let r=null;const i=new $t(0,0,0,0);return{setMask:function(n){r===n||e||(t.colorMask(n,n,n,n),r=n)},setLocked:function(t){e=t},setClear:function(e,r,a,o,s){!0===s&&(e*=o,r*=o,a*=o),n.set(e,r,a,o),!1===i.equals(n)&&(t.clearColor(e,r,a,o),i.copy(n))},reset:function(){e=!1,r=null,i.set(-1,0,0,0)}}},a=new function(){let e=!1,n=null,r=null,i=null;return{setTest:function(e){e?j(t.DEPTH_TEST):V(t.DEPTH_TEST)},setMask:function(r){n===r||e||(t.depthMask(r),n=r)},setFunc:function(e){if(r!==e){switch(e){case 0:t.depthFunc(t.NEVER);break;case 1:t.depthFunc(t.ALWAYS);break;case 2:t.depthFunc(t.LESS);break;case 3:default:t.depthFunc(t.LEQUAL);break;case 4:t.depthFunc(t.EQUAL);break;case 5:t.depthFunc(t.GEQUAL);break;case 6:t.depthFunc(t.GREATER);break;case 7:t.depthFunc(t.NOTEQUAL)}r=e}},setLocked:function(t){e=t},setClear:function(e){i!==e&&(t.clearDepth(e),i=e)},reset:function(){e=!1,n=null,r=null,i=null}}},o=new function(){let e=!1,n=null,r=null,i=null,a=null,o=null,s=null,A=null,l=null;return{setTest:function(n){e||(n?j(t.STENCIL_TEST):V(t.STENCIL_TEST))},setMask:function(r){n===r||e||(t.stencilMask(r),n=r)},setFunc:function(e,n,o){r===e&&i===n&&a===o||(t.stencilFunc(e,n,o),r=e,i=n,a=o)},setOp:function(e,n,r){o===e&&s===n&&A===r||(t.stencilOp(e,n,r),o=e,s=n,A=r)},setLocked:function(t){e=t},setClear:function(e){l!==e&&(t.clearStencil(e),l=e)},reset:function(){e=!1,n=null,r=null,i=null,a=null,o=null,s=null,A=null,l=null}}},s=new WeakMap,A=new WeakMap;let l={},c={},u=new WeakMap,h=[],d=null,f=!1,p=null,m=null,_=null,y=null,x=null,b=null,M=null,w=new Mn(0,0,0),E=0,S=!1,T=null,C=null,R=null,P=null,L=null;const D=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let O=!1,I=0;const q=t.getParameter(t.VERSION);-1!==q.indexOf("WebGL")?(I=parseFloat(/^WebGL (\d)/.exec(q)[1]),O=I>=1):-1!==q.indexOf("OpenGL ES")&&(I=parseFloat(/^OpenGL ES (\d)/.exec(q)[1]),O=I>=2);let U=null,N={};const B=t.getParameter(t.SCISSOR_BOX),k=t.getParameter(t.VIEWPORT),F=(new $t).fromArray(B),z=(new $t).fromArray(k);function G(e,n,i,a){const o=new Uint8Array(4),s=t.createTexture();t.bindTexture(e,s),t.texParameteri(e,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(e,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let s=0;s<i;s++)!r||e!==t.TEXTURE_3D&&e!==t.TEXTURE_2D_ARRAY?t.texImage2D(n+s,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,o):t.texImage3D(n,0,t.RGBA,1,1,a,0,t.RGBA,t.UNSIGNED_BYTE,o);return s}const H={};function j(e){!0!==l[e]&&(t.enable(e),l[e]=!0)}function V(e){!1!==l[e]&&(t.disable(e),l[e]=!1)}H[t.TEXTURE_2D]=G(t.TEXTURE_2D,t.TEXTURE_2D,1),H[t.TEXTURE_CUBE_MAP]=G(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),r&&(H[t.TEXTURE_2D_ARRAY]=G(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),H[t.TEXTURE_3D]=G(t.TEXTURE_3D,t.TEXTURE_3D,1,1)),i.setClear(0,0,0,1),a.setClear(1),o.setClear(0),j(t.DEPTH_TEST),a.setFunc(3),Y(!1),Z(1),j(t.CULL_FACE),Q(0);const W={[v]:t.FUNC_ADD,101:t.FUNC_SUBTRACT,102:t.FUNC_REVERSE_SUBTRACT};if(r)W[103]=t.MIN,W[104]=t.MAX;else{const t=e.get("EXT_blend_minmax");null!==t&&(W[103]=t.MIN_EXT,W[104]=t.MAX_EXT)}const X={200:t.ZERO,201:t.ONE,202:t.SRC_COLOR,204:t.SRC_ALPHA,210:t.SRC_ALPHA_SATURATE,208:t.DST_COLOR,206:t.DST_ALPHA,203:t.ONE_MINUS_SRC_COLOR,205:t.ONE_MINUS_SRC_ALPHA,209:t.ONE_MINUS_DST_COLOR,207:t.ONE_MINUS_DST_ALPHA,211:t.CONSTANT_COLOR,212:t.ONE_MINUS_CONSTANT_COLOR,213:t.CONSTANT_ALPHA,214:t.ONE_MINUS_CONSTANT_ALPHA};function Q(e,n,r,i,a,o,s,A,l,c){if(0!==e){if(!1===f&&(j(t.BLEND),f=!0),5===e)a=a||n,o=o||r,s=s||i,n===m&&a===x||(t.blendEquationSeparate(W[n],W[a]),m=n,x=a),r===_&&i===y&&o===b&&s===M||(t.blendFuncSeparate(X[r],X[i],X[o],X[s]),_=r,y=i,b=o,M=s),!1!==A.equals(w)&&l===E||(t.blendColor(A.r,A.g,A.b,l),w.copy(A),E=l),p=e,S=!1;else if(e!==p||c!==S){if(m===v&&x===v||(t.blendEquation(t.FUNC_ADD),m=v,x=v),c)switch(e){case 1:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case 2:t.blendFunc(t.ONE,t.ONE);break;case 3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case 4:t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case 1:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case 2:t.blendFunc(t.SRC_ALPHA,t.ONE);break;case 3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case 4:t.blendFunc(t.ZERO,t.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}_=null,y=null,b=null,M=null,w.set(0,0,0),E=0,p=e,S=c}}else!0===f&&(V(t.BLEND),f=!1)}function Y(e){T!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),T=e)}function Z(e){0!==e?(j(t.CULL_FACE),e!==C&&(1===e?t.cullFace(t.BACK):2===e?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):V(t.CULL_FACE),C=e}function K(e,n,r){e?(j(t.POLYGON_OFFSET_FILL),P===n&&L===r||(t.polygonOffset(n,r),P=n,L=r)):V(t.POLYGON_OFFSET_FILL)}return{buffers:{color:i,depth:a,stencil:o},enable:j,disable:V,bindFramebuffer:function(e,n){return c[e]!==n&&(t.bindFramebuffer(e,n),c[e]=n,r&&(e===t.DRAW_FRAMEBUFFER&&(c[t.FRAMEBUFFER]=n),e===t.FRAMEBUFFER&&(c[t.DRAW_FRAMEBUFFER]=n)),!0)},drawBuffers:function(r,i){let a=h,o=!1;if(r)if(a=u.get(i),void 0===a&&(a=[],u.set(i,a)),r.isWebGLMultipleRenderTargets){const e=r.texture;if(a.length!==e.length||a[0]!==t.COLOR_ATTACHMENT0){for(let n=0,r=e.length;n<r;n++)a[n]=t.COLOR_ATTACHMENT0+n;a.length=e.length,o=!0}}else a[0]!==t.COLOR_ATTACHMENT0&&(a[0]=t.COLOR_ATTACHMENT0,o=!0);else a[0]!==t.BACK&&(a[0]=t.BACK,o=!0);o&&(n.isWebGL2?t.drawBuffers(a):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(a))},useProgram:function(e){return d!==e&&(t.useProgram(e),d=e,!0)},setBlending:Q,setMaterial:function(e,n){2===e.side?V(t.CULL_FACE):j(t.CULL_FACE);let r=e.side===g;n&&(r=!r),Y(r),1===e.blending&&!1===e.transparent?Q(0):Q(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.blendColor,e.blendAlpha,e.premultipliedAlpha),a.setFunc(e.depthFunc),a.setTest(e.depthTest),a.setMask(e.depthWrite),i.setMask(e.colorWrite);const s=e.stencilWrite;o.setTest(s),s&&(o.setMask(e.stencilWriteMask),o.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),o.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),K(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?j(t.SAMPLE_ALPHA_TO_COVERAGE):V(t.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:Y,setCullFace:Z,setLineWidth:function(e){e!==R&&(O&&t.lineWidth(e),R=e)},setPolygonOffset:K,setScissorTest:function(e){e?j(t.SCISSOR_TEST):V(t.SCISSOR_TEST)},activeTexture:function(e){void 0===e&&(e=t.TEXTURE0+D-1),U!==e&&(t.activeTexture(e),U=e)},bindTexture:function(e,n,r){void 0===r&&(r=null===U?t.TEXTURE0+D-1:U);let i=N[r];void 0===i&&(i={type:void 0,texture:void 0},N[r]=i),i.type===e&&i.texture===n||(U!==r&&(t.activeTexture(r),U=r),t.bindTexture(e,n||H[e]),i.type=e,i.texture=n)},unbindTexture:function(){const e=N[U];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexImage3D:function(){try{t.compressedTexImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},updateUBOMapping:function(e,n){let r=A.get(n);void 0===r&&(r=new WeakMap,A.set(n,r));let i=r.get(e);void 0===i&&(i=t.getUniformBlockIndex(n,e.name),r.set(e,i))},uniformBlockBinding:function(e,n){const r=A.get(n).get(e);s.get(n)!==r&&(t.uniformBlockBinding(n,r,e.__bindingPointIndex),s.set(n,r))},texStorage2D:function(){try{t.texStorage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texStorage3D:function(){try{t.texStorage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage2D:function(){try{t.texSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texSubImage3D:function(){try{t.texSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage2D:function(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},compressedTexSubImage3D:function(){try{t.compressedTexSubImage3D.apply(t,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(e){!1===F.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),F.copy(e))},viewport:function(e){!1===z.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),z.copy(e))},reset:function(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.blendColor(0,0,0,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),!0===r&&(t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null)),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),l={},U=null,N={},c={},u=new WeakMap,h=[],d=null,f=!1,p=null,m=null,_=null,y=null,x=null,b=null,M=null,w=new Mn(0,0,0),E=0,S=!1,T=null,C=null,R=null,P=null,L=null,F.set(0,0,t.canvas.width,t.canvas.height),z.set(0,0,t.canvas.width,t.canvas.height),i.reset(),a.reset(),o.reset()}}}function ro(t,e,n,r,i,a,o){const s=i.isWebGL2,A=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),c=new WeakMap;let u;const h=new WeakMap;let d=!1;try{d="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function f(t,e){return d?new OffscreenCanvas(t,e):qt("canvas")}function p(t,e,n,r){let i=1;if((t.width>r||t.height>r)&&(i=r/Math.max(t.width,t.height)),i<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const r=e?Tt:Math.floor,a=r(i*t.width),o=r(i*t.height);void 0===u&&(u=f(a,o));const s=n?f(a,o):u;s.width=a,s.height=o;return s.getContext("2d").drawImage(t,0,0,a,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+a+"x"+o+")."),s}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function m(t){return St(t.width)&&St(t.height)}function g(t,e){return t.generateMipmaps&&e&&t.minFilter!==q&&t.minFilter!==N}function v(e){t.generateMipmap(e)}function _(n,r,i,a,o=!1){if(!1===s)return r;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let A=r;if(r===t.RED&&(i===t.FLOAT&&(A=t.R32F),i===t.HALF_FLOAT&&(A=t.R16F),i===t.UNSIGNED_BYTE&&(A=t.R8)),r===t.RED_INTEGER&&(i===t.UNSIGNED_BYTE&&(A=t.R8UI),i===t.UNSIGNED_SHORT&&(A=t.R16UI),i===t.UNSIGNED_INT&&(A=t.R32UI),i===t.BYTE&&(A=t.R8I),i===t.SHORT&&(A=t.R16I),i===t.INT&&(A=t.R32I)),r===t.RG&&(i===t.FLOAT&&(A=t.RG32F),i===t.HALF_FLOAT&&(A=t.RG16F),i===t.UNSIGNED_BYTE&&(A=t.RG8)),r===t.RGBA){const e=o?st:Ht.getTransfer(a);i===t.FLOAT&&(A=t.RGBA32F),i===t.HALF_FLOAT&&(A=t.RGBA16F),i===t.UNSIGNED_BYTE&&(A=e===At?t.SRGB8_ALPHA8:t.RGBA8),i===t.UNSIGNED_SHORT_4_4_4_4&&(A=t.RGBA4),i===t.UNSIGNED_SHORT_5_5_5_1&&(A=t.RGB5_A1)}return A!==t.R16F&&A!==t.R32F&&A!==t.RG16F&&A!==t.RG32F&&A!==t.RGBA16F&&A!==t.RGBA32F||e.get("EXT_color_buffer_float"),A}function y(t,e,n){return!0===g(t,n)||t.isFramebufferTexture&&t.minFilter!==q&&t.minFilter!==N?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function x(e){return e===q||1004===e||e===U?t.NEAREST:t.LINEAR}function b(t){const e=t.target;e.removeEventListener("dispose",b),function(t){const e=r.get(t);if(void 0===e.__webglInit)return;const n=t.source,i=h.get(n);if(i){const r=i[e.__cacheKey];r.usedTimes--,0===r.usedTimes&&w(t),0===Object.keys(i).length&&h.delete(n)}r.remove(t)}(e),e.isVideoTexture&&c.delete(e)}function M(e){const n=e.target;n.removeEventListener("dispose",M),function(e){const n=e.texture,i=r.get(e),a=r.get(n);void 0!==a.__webglTexture&&(t.deleteTexture(a.__webglTexture),o.memory.textures--);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++){if(Array.isArray(i.__webglFramebuffer[e]))for(let n=0;n<i.__webglFramebuffer[e].length;n++)t.deleteFramebuffer(i.__webglFramebuffer[e][n]);else t.deleteFramebuffer(i.__webglFramebuffer[e]);i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer[e])}else{if(Array.isArray(i.__webglFramebuffer))for(let e=0;e<i.__webglFramebuffer.length;e++)t.deleteFramebuffer(i.__webglFramebuffer[e]);else t.deleteFramebuffer(i.__webglFramebuffer);if(i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&t.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer)for(let e=0;e<i.__webglColorRenderbuffer.length;e++)i.__webglColorRenderbuffer[e]&&t.deleteRenderbuffer(i.__webglColorRenderbuffer[e]);i.__webglDepthRenderbuffer&&t.deleteRenderbuffer(i.__webglDepthRenderbuffer)}if(e.isWebGLMultipleRenderTargets)for(let e=0,i=n.length;e<i;e++){const i=r.get(n[e]);i.__webglTexture&&(t.deleteTexture(i.__webglTexture),o.memory.textures--),r.remove(n[e])}r.remove(n),r.remove(e)}(n)}function w(e){const n=r.get(e);t.deleteTexture(n.__webglTexture);const i=e.source;delete h.get(i)[n.__cacheKey],o.memory.textures--}let E=0;function S(e,i){const a=r.get(e);if(e.isVideoTexture&&function(t){const e=o.render.frame;c.get(t)!==e&&(c.set(t,e),t.update())}(e),!1===e.isRenderTargetTexture&&e.version>0&&a.__version!==e.version){const t=e.image;if(null===t)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==t.complete)return void G(a,e,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.bindTexture(t.TEXTURE_2D,a.__webglTexture,t.TEXTURE0+i)}const T={[D]:t.REPEAT,[O]:t.CLAMP_TO_EDGE,[I]:t.MIRRORED_REPEAT},C={[q]:t.NEAREST,1004:t.NEAREST_MIPMAP_NEAREST,[U]:t.NEAREST_MIPMAP_LINEAR,[N]:t.LINEAR,[B]:t.LINEAR_MIPMAP_NEAREST,[k]:t.LINEAR_MIPMAP_LINEAR},R={512:t.NEVER,519:t.ALWAYS,513:t.LESS,515:t.LEQUAL,514:t.EQUAL,518:t.GEQUAL,516:t.GREATER,517:t.NOTEQUAL};function P(n,a,o){if(a.type!==j||!1!==e.has("OES_texture_float_linear")||a.magFilter!==N&&a.magFilter!==B&&a.magFilter!==U&&a.magFilter!==k&&a.minFilter!==N&&a.minFilter!==B&&a.minFilter!==U&&a.minFilter!==k||console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),o?(t.texParameteri(n,t.TEXTURE_WRAP_S,T[a.wrapS]),t.texParameteri(n,t.TEXTURE_WRAP_T,T[a.wrapT]),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,T[a.wrapR]),t.texParameteri(n,t.TEXTURE_MAG_FILTER,C[a.magFilter]),t.texParameteri(n,t.TEXTURE_MIN_FILTER,C[a.minFilter])):(t.texParameteri(n,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(n,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),n!==t.TEXTURE_3D&&n!==t.TEXTURE_2D_ARRAY||t.texParameteri(n,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),a.wrapS===O&&a.wrapT===O||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,t.TEXTURE_MAG_FILTER,x(a.magFilter)),t.texParameteri(n,t.TEXTURE_MIN_FILTER,x(a.minFilter)),a.minFilter!==q&&a.minFilter!==N&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),a.compareFunction&&(t.texParameteri(n,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(n,t.TEXTURE_COMPARE_FUNC,R[a.compareFunction])),!0===e.has("EXT_texture_filter_anisotropic")){const o=e.get("EXT_texture_filter_anisotropic");if(a.magFilter===q)return;if(a.minFilter!==U&&a.minFilter!==k)return;if(a.type===j&&!1===e.has("OES_texture_float_linear"))return;if(!1===s&&a.type===V&&!1===e.has("OES_texture_half_float_linear"))return;(a.anisotropy>1||r.get(a).__currentAnisotropy)&&(t.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function L(e,n){let r=!1;void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",b));const i=n.source;let a=h.get(i);void 0===a&&(a={},h.set(i,a));const s=function(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.wrapR||0),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.colorSpace),e.join()}(n);if(s!==e.__cacheKey){void 0===a[s]&&(a[s]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,r=!0),a[s].usedTimes++;const i=a[e.__cacheKey];void 0!==i&&(a[e.__cacheKey].usedTimes--,0===i.usedTimes&&w(n)),e.__cacheKey=s,e.__webglTexture=a[s].texture}return r}function G(e,o,A){let l=t.TEXTURE_2D;(o.isDataArrayTexture||o.isCompressedArrayTexture)&&(l=t.TEXTURE_2D_ARRAY),o.isData3DTexture&&(l=t.TEXTURE_3D);const c=L(e,o),u=o.source;n.bindTexture(l,e.__webglTexture,t.TEXTURE0+A);const h=r.get(u);if(u.version!==h.__version||!0===c){n.activeTexture(t.TEXTURE0+A);const e=Ht.getPrimaries(Ht.workingColorSpace),r=o.colorSpace===nt?null:Ht.getPrimaries(o.colorSpace),d=o.colorSpace===nt||e===r?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,o.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,o.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,d);const f=function(t){return!s&&(t.wrapS!==O||t.wrapT!==O||t.minFilter!==q&&t.minFilter!==N)}(o)&&!1===m(o.image);let x=p(o.image,f,!1,i.maxTextureSize);x=et(o,x);const b=m(x)||s,M=a.convert(o.format,o.colorSpace);let w,E=a.convert(o.type),S=_(o.internalFormat,M,E,o.colorSpace,o.isVideoTexture);P(l,o,b);const T=o.mipmaps,C=s&&!0!==o.isVideoTexture&&36196!==S,R=void 0===h.__version||!0===c,L=u.dataReady,D=y(o,x,b);if(o.isDepthTexture)S=t.DEPTH_COMPONENT,s?S=o.type===j?t.DEPTH_COMPONENT32F:o.type===H?t.DEPTH_COMPONENT24:o.type===W?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT16:o.type===j&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),o.format===Q&&S===t.DEPTH_COMPONENT&&o.type!==z&&o.type!==H&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),o.type=H,E=a.convert(o.type)),o.format===Y&&S===t.DEPTH_COMPONENT&&(S=t.DEPTH_STENCIL,o.type!==W&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),o.type=W,E=a.convert(o.type))),R&&(C?n.texStorage2D(t.TEXTURE_2D,1,S,x.width,x.height):n.texImage2D(t.TEXTURE_2D,0,S,x.width,x.height,0,M,E,null));else if(o.isDataTexture)if(T.length>0&&b){C&&R&&n.texStorage2D(t.TEXTURE_2D,D,S,T[0].width,T[0].height);for(let e=0,r=T.length;e<r;e++)w=T[e],C?L&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,w.width,w.height,M,E,w.data):n.texImage2D(t.TEXTURE_2D,e,S,w.width,w.height,0,M,E,w.data);o.generateMipmaps=!1}else C?(R&&n.texStorage2D(t.TEXTURE_2D,D,S,x.width,x.height),L&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,x.width,x.height,M,E,x.data)):n.texImage2D(t.TEXTURE_2D,0,S,x.width,x.height,0,M,E,x.data);else if(o.isCompressedTexture)if(o.isCompressedArrayTexture){C&&R&&n.texStorage3D(t.TEXTURE_2D_ARRAY,D,S,T[0].width,T[0].height,x.depth);for(let e=0,r=T.length;e<r;e++)w=T[e],o.format!==X?null!==M?C?L&&n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,w.width,w.height,x.depth,M,w.data,0,0):n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,e,S,w.width,w.height,x.depth,0,w.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):C?L&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,e,0,0,0,w.width,w.height,x.depth,M,E,w.data):n.texImage3D(t.TEXTURE_2D_ARRAY,e,S,w.width,w.height,x.depth,0,M,E,w.data)}else{C&&R&&n.texStorage2D(t.TEXTURE_2D,D,S,T[0].width,T[0].height);for(let e=0,r=T.length;e<r;e++)w=T[e],o.format!==X?null!==M?C?L&&n.compressedTexSubImage2D(t.TEXTURE_2D,e,0,0,w.width,w.height,M,w.data):n.compressedTexImage2D(t.TEXTURE_2D,e,S,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):C?L&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,w.width,w.height,M,E,w.data):n.texImage2D(t.TEXTURE_2D,e,S,w.width,w.height,0,M,E,w.data)}else if(o.isDataArrayTexture)C?(R&&n.texStorage3D(t.TEXTURE_2D_ARRAY,D,S,x.width,x.height,x.depth),L&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,x.width,x.height,x.depth,M,E,x.data)):n.texImage3D(t.TEXTURE_2D_ARRAY,0,S,x.width,x.height,x.depth,0,M,E,x.data);else if(o.isData3DTexture)C?(R&&n.texStorage3D(t.TEXTURE_3D,D,S,x.width,x.height,x.depth),L&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,x.width,x.height,x.depth,M,E,x.data)):n.texImage3D(t.TEXTURE_3D,0,S,x.width,x.height,x.depth,0,M,E,x.data);else if(o.isFramebufferTexture){if(R)if(C)n.texStorage2D(t.TEXTURE_2D,D,S,x.width,x.height);else{let e=x.width,r=x.height;for(let i=0;i<D;i++)n.texImage2D(t.TEXTURE_2D,i,S,e,r,0,M,E,null),e>>=1,r>>=1}}else if(T.length>0&&b){C&&R&&n.texStorage2D(t.TEXTURE_2D,D,S,T[0].width,T[0].height);for(let e=0,r=T.length;e<r;e++)w=T[e],C?L&&n.texSubImage2D(t.TEXTURE_2D,e,0,0,M,E,w):n.texImage2D(t.TEXTURE_2D,e,S,M,E,w);o.generateMipmaps=!1}else C?(R&&n.texStorage2D(t.TEXTURE_2D,D,S,x.width,x.height),L&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,M,E,x)):n.texImage2D(t.TEXTURE_2D,0,S,M,E,x);g(o,b)&&v(l),h.__version=u.version,o.onUpdate&&o.onUpdate(o)}e.__version=o.version}function Z(e,i,o,s,l,c){const u=a.convert(o.format,o.colorSpace),h=a.convert(o.type),d=_(o.internalFormat,u,h,o.colorSpace);if(!r.get(i).__hasExternalTextures){const e=Math.max(1,i.width>>c),r=Math.max(1,i.height>>c);l===t.TEXTURE_3D||l===t.TEXTURE_2D_ARRAY?n.texImage3D(l,c,d,e,r,i.depth,0,u,h,null):n.texImage2D(l,c,d,e,r,0,u,h,null)}n.bindFramebuffer(t.FRAMEBUFFER,e),tt(i)?A.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,s,l,r.get(o).__webglTexture,0,$(i)):(l===t.TEXTURE_2D||l>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&l<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,s,l,r.get(o).__webglTexture,c),n.bindFramebuffer(t.FRAMEBUFFER,null)}function K(e,n,r){if(t.bindRenderbuffer(t.RENDERBUFFER,e),n.depthBuffer&&!n.stencilBuffer){let i=!0===s?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(r||tt(n)){const e=n.depthTexture;e&&e.isDepthTexture&&(e.type===j?i=t.DEPTH_COMPONENT32F:e.type===H&&(i=t.DEPTH_COMPONENT24));const r=$(n);tt(n)?A.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,r,i,n.width,n.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,r,i,n.width,n.height)}else t.renderbufferStorage(t.RENDERBUFFER,i,n.width,n.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e)}else if(n.depthBuffer&&n.stencilBuffer){const i=$(n);r&&!1===tt(n)?t.renderbufferStorageMultisample(t.RENDERBUFFER,i,t.DEPTH24_STENCIL8,n.width,n.height):tt(n)?A.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,i,t.DEPTH24_STENCIL8,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,n.width,n.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e)}else{const e=!0===n.isWebGLMultipleRenderTargets?n.texture:[n.texture];for(let i=0;i<e.length;i++){const o=e[i],s=a.convert(o.format,o.colorSpace),l=a.convert(o.type),c=_(o.internalFormat,s,l,o.colorSpace),u=$(n);r&&!1===tt(n)?t.renderbufferStorageMultisample(t.RENDERBUFFER,u,c,n.width,n.height):tt(n)?A.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,u,c,n.width,n.height):t.renderbufferStorage(t.RENDERBUFFER,c,n.width,n.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function J(e){const i=r.get(e),a=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture&&!i.__autoAllocateDepthBuffer){if(a)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(t.FRAMEBUFFER,e),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),S(i.depthTexture,0);const a=r.get(i.depthTexture).__webglTexture,o=$(i);if(i.depthTexture.format===Q)tt(i)?A.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,a,0,o):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,a,0);else{if(i.depthTexture.format!==Y)throw new Error("Unknown depthTexture format");tt(i)?A.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,a,0,o):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,a,0)}}(i.__webglFramebuffer,e)}else if(a){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)n.bindFramebuffer(t.FRAMEBUFFER,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]=t.createRenderbuffer(),K(i.__webglDepthbuffer[r],e,!1)}else n.bindFramebuffer(t.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=t.createRenderbuffer(),K(i.__webglDepthbuffer,e,!1);n.bindFramebuffer(t.FRAMEBUFFER,null)}function $(t){return Math.min(i.maxSamples,t.samples)}function tt(t){const n=r.get(t);return s&&t.samples>0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function et(t,n){const r=t.colorSpace,i=t.format,a=t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||t.format===ft||r!==it&&r!==nt&&(Ht.getTransfer(r)===At?!1===s?!0===e.has("EXT_sRGB")&&i===X?(t.format=ft,t.minFilter=N,t.generateMipmaps=!1):n=Xt.sRGBToLinear(n):i===X&&a===F||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",r)),n}this.allocateTextureUnit=function(){const t=E;return t>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+i.maxTextures),E+=1,t},this.resetTextureUnits=function(){E=0},this.setTexture2D=S,this.setTexture2DArray=function(e,i){const a=r.get(e);e.version>0&&a.__version!==e.version?G(a,e,i):n.bindTexture(t.TEXTURE_2D_ARRAY,a.__webglTexture,t.TEXTURE0+i)},this.setTexture3D=function(e,i){const a=r.get(e);e.version>0&&a.__version!==e.version?G(a,e,i):n.bindTexture(t.TEXTURE_3D,a.__webglTexture,t.TEXTURE0+i)},this.setTextureCube=function(e,o){const A=r.get(e);e.version>0&&A.__version!==e.version?function(e,o,A){if(6!==o.image.length)return;const l=L(e,o),c=o.source;n.bindTexture(t.TEXTURE_CUBE_MAP,e.__webglTexture,t.TEXTURE0+A);const u=r.get(c);if(c.version!==u.__version||!0===l){n.activeTexture(t.TEXTURE0+A);const e=Ht.getPrimaries(Ht.workingColorSpace),r=o.colorSpace===nt?null:Ht.getPrimaries(o.colorSpace),h=o.colorSpace===nt||e===r?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,o.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,o.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,h);const d=o.isCompressedTexture||o.image[0].isCompressedTexture,f=o.image[0]&&o.image[0].isDataTexture,x=[];for(let t=0;t<6;t++)x[t]=d||f?f?o.image[t].image:o.image[t]:p(o.image[t],!1,!0,i.maxCubemapSize),x[t]=et(o,x[t]);const b=x[0],M=m(b)||s,w=a.convert(o.format,o.colorSpace),E=a.convert(o.type),S=_(o.internalFormat,w,E,o.colorSpace),T=s&&!0!==o.isVideoTexture,C=void 0===u.__version||!0===l,R=c.dataReady;let L,D=y(o,b,M);if(P(t.TEXTURE_CUBE_MAP,o,M),d){T&&C&&n.texStorage2D(t.TEXTURE_CUBE_MAP,D,S,b.width,b.height);for(let e=0;e<6;e++){L=x[e].mipmaps;for(let r=0;r<L.length;r++){const i=L[r];o.format!==X?null!==w?T?R&&n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,0,0,i.width,i.height,w,i.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,S,i.width,i.height,0,i.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,0,0,i.width,i.height,w,E,i.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r,S,i.width,i.height,0,w,E,i.data)}}}else{L=o.mipmaps,T&&C&&(L.length>0&&D++,n.texStorage2D(t.TEXTURE_CUBE_MAP,D,S,x[0].width,x[0].height));for(let e=0;e<6;e++)if(f){T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,x[e].width,x[e].height,w,E,x[e].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,S,x[e].width,x[e].height,0,w,E,x[e].data);for(let r=0;r<L.length;r++){const i=L[r].image[e].image;T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,0,0,i.width,i.height,w,E,i.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,S,i.width,i.height,0,w,E,i.data)}}else{T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,0,0,w,E,x[e]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,S,w,E,x[e]);for(let r=0;r<L.length;r++){const i=L[r];T?R&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,0,0,w,E,i.image[e]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+e,r+1,S,w,E,i.image[e])}}}g(o,M)&&v(t.TEXTURE_CUBE_MAP),u.__version=c.version,o.onUpdate&&o.onUpdate(o)}e.__version=o.version}(A,e,o):n.bindTexture(t.TEXTURE_CUBE_MAP,A.__webglTexture,t.TEXTURE0+o)},this.rebindTextures=function(e,n,i){const a=r.get(e);void 0!==n&&Z(a.__webglFramebuffer,e,e.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),void 0!==i&&J(e)},this.setupRenderTarget=function(e){const A=e.texture,l=r.get(e),c=r.get(A);e.addEventListener("dispose",M),!0!==e.isWebGLMultipleRenderTargets&&(void 0===c.__webglTexture&&(c.__webglTexture=t.createTexture()),c.__version=A.version,o.memory.textures++);const u=!0===e.isWebGLCubeRenderTarget,h=!0===e.isWebGLMultipleRenderTargets,d=m(e)||s;if(u){l.__webglFramebuffer=[];for(let e=0;e<6;e++)if(s&&A.mipmaps&&A.mipmaps.length>0){l.__webglFramebuffer[e]=[];for(let n=0;n<A.mipmaps.length;n++)l.__webglFramebuffer[e][n]=t.createFramebuffer()}else l.__webglFramebuffer[e]=t.createFramebuffer()}else{if(s&&A.mipmaps&&A.mipmaps.length>0){l.__webglFramebuffer=[];for(let e=0;e<A.mipmaps.length;e++)l.__webglFramebuffer[e]=t.createFramebuffer()}else l.__webglFramebuffer=t.createFramebuffer();if(h)if(i.drawBuffers){const n=e.texture;for(let e=0,i=n.length;e<i;e++){const i=r.get(n[e]);void 0===i.__webglTexture&&(i.__webglTexture=t.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(s&&e.samples>0&&!1===tt(e)){const r=h?A:[A];l.__webglMultisampledFramebuffer=t.createFramebuffer(),l.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,l.__webglMultisampledFramebuffer);for(let n=0;n<r.length;n++){const i=r[n];l.__webglColorRenderbuffer[n]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,l.__webglColorRenderbuffer[n]);const o=a.convert(i.format,i.colorSpace),s=a.convert(i.type),A=_(i.internalFormat,o,s,i.colorSpace,!0===e.isXRRenderTarget),c=$(e);t.renderbufferStorageMultisample(t.RENDERBUFFER,c,A,e.width,e.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+n,t.RENDERBUFFER,l.__webglColorRenderbuffer[n])}t.bindRenderbuffer(t.RENDERBUFFER,null),e.depthBuffer&&(l.__webglDepthRenderbuffer=t.createRenderbuffer(),K(l.__webglDepthRenderbuffer,e,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if(u){n.bindTexture(t.TEXTURE_CUBE_MAP,c.__webglTexture),P(t.TEXTURE_CUBE_MAP,A,d);for(let n=0;n<6;n++)if(s&&A.mipmaps&&A.mipmaps.length>0)for(let r=0;r<A.mipmaps.length;r++)Z(l.__webglFramebuffer[n][r],e,A,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,r);else Z(l.__webglFramebuffer[n],e,A,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);g(A,d)&&v(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(h){const i=e.texture;for(let a=0,o=i.length;a<o;a++){const o=i[a],s=r.get(o);n.bindTexture(t.TEXTURE_2D,s.__webglTexture),P(t.TEXTURE_2D,o,d),Z(l.__webglFramebuffer,e,o,t.COLOR_ATTACHMENT0+a,t.TEXTURE_2D,0),g(o,d)&&v(t.TEXTURE_2D)}n.unbindTexture()}else{let r=t.TEXTURE_2D;if((e.isWebGL3DRenderTarget||e.isWebGLArrayRenderTarget)&&(s?r=e.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),n.bindTexture(r,c.__webglTexture),P(r,A,d),s&&A.mipmaps&&A.mipmaps.length>0)for(let n=0;n<A.mipmaps.length;n++)Z(l.__webglFramebuffer[n],e,A,t.COLOR_ATTACHMENT0,r,n);else Z(l.__webglFramebuffer,e,A,t.COLOR_ATTACHMENT0,r,0);g(A,d)&&v(r),n.unbindTexture()}e.depthBuffer&&J(e)},this.updateRenderTargetMipmap=function(e){const i=m(e)||s,a=!0===e.isWebGLMultipleRenderTargets?e.texture:[e.texture];for(let o=0,s=a.length;o<s;o++){const s=a[o];if(g(s,i)){const i=e.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,a=r.get(s).__webglTexture;n.bindTexture(i,a),v(i),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(e){if(s&&e.samples>0&&!1===tt(e)){const i=e.isWebGLMultipleRenderTargets?e.texture:[e.texture],a=e.width,o=e.height;let s=t.COLOR_BUFFER_BIT;const A=[],c=e.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,u=r.get(e),h=!0===e.isWebGLMultipleRenderTargets;if(h)for(let e=0;e<i.length;e++)n.bindFramebuffer(t.FRAMEBUFFER,u.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,u.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,u.__webglMultisampledFramebuffer),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,u.__webglFramebuffer);for(let n=0;n<i.length;n++){A.push(t.COLOR_ATTACHMENT0+n),e.depthBuffer&&A.push(c);const d=void 0!==u.__ignoreDepthValues&&u.__ignoreDepthValues;if(!1===d&&(e.depthBuffer&&(s|=t.DEPTH_BUFFER_BIT),e.stencilBuffer&&(s|=t.STENCIL_BUFFER_BIT)),h&&t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,u.__webglColorRenderbuffer[n]),!0===d&&(t.invalidateFramebuffer(t.READ_FRAMEBUFFER,[c]),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[c])),h){const e=r.get(i[n]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0)}t.blitFramebuffer(0,0,a,o,0,0,a,o,s,t.NEAREST),l&&t.invalidateFramebuffer(t.READ_FRAMEBUFFER,A)}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),h)for(let e=0;e<i.length;e++){n.bindFramebuffer(t.FRAMEBUFFER,u.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.RENDERBUFFER,u.__webglColorRenderbuffer[e]);const a=r.get(i[e]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,u.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+e,t.TEXTURE_2D,a,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,u.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=J,this.setupFrameBufferTexture=Z,this.useMultisampledRTT=tt}function io(t,e,n){const r=n.isWebGL2;return{convert:function(n,i=""){let a;const o=Ht.getTransfer(i);if(n===F)return t.UNSIGNED_BYTE;if(1017===n)return t.UNSIGNED_SHORT_4_4_4_4;if(1018===n)return t.UNSIGNED_SHORT_5_5_5_1;if(1010===n)return t.BYTE;if(1011===n)return t.SHORT;if(n===z)return t.UNSIGNED_SHORT;if(n===G)return t.INT;if(n===H)return t.UNSIGNED_INT;if(n===j)return t.FLOAT;if(n===V)return r?t.HALF_FLOAT:(a=e.get("OES_texture_half_float"),null!==a?a.HALF_FLOAT_OES:null);if(1021===n)return t.ALPHA;if(n===X)return t.RGBA;if(1024===n)return t.LUMINANCE;if(1025===n)return t.LUMINANCE_ALPHA;if(n===Q)return t.DEPTH_COMPONENT;if(n===Y)return t.DEPTH_STENCIL;if(n===ft)return a=e.get("EXT_sRGB"),null!==a?a.SRGB_ALPHA_EXT:null;if(1028===n)return t.RED;if(1029===n)return t.RED_INTEGER;if(1030===n)return t.RG;if(1031===n)return t.RG_INTEGER;if(1033===n)return t.RGBA_INTEGER;if(n===Z||n===K||n===J||n===$)if(o===At){if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),null===a)return null;if(n===Z)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===K)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===J)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===$)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(a=e.get("WEBGL_compressed_texture_s3tc"),null===a)return null;if(n===Z)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===K)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===J)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===$)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===n||35841===n||35842===n||35843===n){if(a=e.get("WEBGL_compressed_texture_pvrtc"),null===a)return null;if(35840===n)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===n)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===n)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===n)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===n)return a=e.get("WEBGL_compressed_texture_etc1"),null!==a?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(37492===n||37496===n){if(a=e.get("WEBGL_compressed_texture_etc"),null===a)return null;if(37492===n)return o===At?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(37496===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}if(37808===n||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n){if(a=e.get("WEBGL_compressed_texture_astc"),null===a)return null;if(37808===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(37809===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(37810===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(37811===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(37812===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(37813===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(37814===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(37815===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(37816===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(37817===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(37818===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(37819===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(37820===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(37821===n)return o===At?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===tt||36494===n||36495===n){if(a=e.get("EXT_texture_compression_bptc"),null===a)return null;if(n===tt)return o===At?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(36494===n)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(36495===n)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(36283===n||36284===n||36285===n||36286===n){if(a=e.get("EXT_texture_compression_rgtc"),null===a)return null;if(n===tt)return a.COMPRESSED_RED_RGTC1_EXT;if(36284===n)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(36285===n)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(36286===n)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===W?r?t.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),null!==a?a.UNSIGNED_INT_24_8_WEBGL:null):void 0!==t[n]?t[n]:null}}}class ao extends gr{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}}let oo=class extends sn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const so={type:"move"};class Ao{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new oo,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new oo,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new ae,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new ae),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new oo,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new ae,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new ae),this._grip}dispatchEvent(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){const e=this._hand;if(e)for(const n of t.hand.values())this._getHandJoint(e,n)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(t,e,n){let r=null,i=null,a=null;const o=this._targetRay,s=this._grip,A=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState){if(A&&t.hand){a=!0;for(const r of t.hand.values()){const t=e.getJointPose(r,n),i=this._getHandJoint(A,r);null!==t&&(i.matrix.fromArray(t.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=t.radius),i.visible=null!==t}const r=A.joints["index-finger-tip"],i=A.joints["thumb-tip"],o=r.position.distanceTo(i.position),s=.02,l=.005;A.inputState.pinching&&o>s+l?(A.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!A.inputState.pinching&&o<=s-l&&(A.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==s&&t.gripSpace&&(i=e.getPose(t.gripSpace,n),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale),s.matrixWorldNeedsUpdate=!0,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));null!==o&&(r=e.getPose(t.targetRaySpace,n),null===r&&null!==i&&(r=i),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(so)))}return null!==o&&(o.visible=null!==r),null!==s&&(s.visible=null!==i),null!==A&&(A.visible=null!==a),this}_getHandJoint(t,e){if(void 0===t.joints[e.jointName]){const n=new oo;n.matrixAutoUpdate=!1,n.visible=!1,t.joints[e.jointName]=n,t.add(n)}return t.joints[e.jointName]}}class lo{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(t,e,n){if(null===this.texture){const r=new Jt;t.properties.get(r).__webglTexture=e.texture,e.depthNear==n.depthNear&&e.depthFar==n.depthFar||(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=r}}render(t,e){if(null!==this.texture){if(null===this.mesh){const t=e.cameras[0].viewport,n=new hr({extensions:{fragDepth:!0},vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepthEXT = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepthEXT = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new ar(new Lr(20,20),n)}t.render(this.mesh,e)}}reset(){this.texture=null,this.mesh=null}}class co extends gt{constructor(t,e){super();const n=this;let r=null,i=1,a=null,o="local-floor",s=1,A=null,l=null,c=null,u=null,h=null,d=null;const f=new lo,p=e.getContextAttributes();let m=null,g=null;const v=[],_=[],y=new Lt;let x=null;const b=new gr;b.layers.enable(1),b.viewport=new $t;const M=new gr;M.layers.enable(2),M.viewport=new $t;const w=[b,M],E=new ao;E.layers.enable(1),E.layers.enable(2);let S=null,T=null;function C(t){const e=_.indexOf(t.inputSource);if(-1===e)return;const n=v[e];void 0!==n&&(n.update(t.inputSource,t.frame,A||a),n.dispatchEvent({type:t.type,data:t.inputSource}))}function R(){r.removeEventListener("select",C),r.removeEventListener("selectstart",C),r.removeEventListener("selectend",C),r.removeEventListener("squeeze",C),r.removeEventListener("squeezestart",C),r.removeEventListener("squeezeend",C),r.removeEventListener("end",R),r.removeEventListener("inputsourceschange",P);for(let t=0;t<v.length;t++){const e=_[t];null!==e&&(_[t]=null,v[t].disconnect(e))}S=null,T=null,f.reset(),t.setRenderTarget(m),h=null,u=null,c=null,r=null,g=null,q.stop(),n.isPresenting=!1,t.setPixelRatio(x),t.setSize(y.width,y.height,!1),n.dispatchEvent({type:"sessionend"})}function P(t){for(let e=0;e<t.removed.length;e++){const n=t.removed[e],r=_.indexOf(n);r>=0&&(_[r]=null,v[r].disconnect(n))}for(let e=0;e<t.added.length;e++){const n=t.added[e];let r=_.indexOf(n);if(-1===r){for(let t=0;t<v.length;t++){if(t>=_.length){_.push(n),r=t;break}if(null===_[t]){_[t]=n,r=t;break}}if(-1===r)break}const i=v[r];i&&i.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=v[t];return void 0===e&&(e=new Ao,v[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=v[t];return void 0===e&&(e=new Ao,v[t]=e),e.getGripSpace()},this.getHand=function(t){let e=v[t];return void 0===e&&(e=new Ao,v[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){i=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){o=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return A||a},this.setReferenceSpace=function(t){A=t},this.getBaseLayer=function(){return null!==u?u:h},this.getBinding=function(){return c},this.getFrame=function(){return d},this.getSession=function(){return r},this.setSession=async function(l){if(r=l,null!==r){if(m=t.getRenderTarget(),r.addEventListener("select",C),r.addEventListener("selectstart",C),r.addEventListener("selectend",C),r.addEventListener("squeeze",C),r.addEventListener("squeezestart",C),r.addEventListener("squeezeend",C),r.addEventListener("end",R),r.addEventListener("inputsourceschange",P),!0!==p.xrCompatible&&await e.makeXRCompatible(),x=t.getPixelRatio(),t.getSize(y),void 0===r.renderState.layers||!1===t.capabilities.isWebGL2){const n={antialias:void 0!==r.renderState.layers||p.antialias,alpha:!0,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:i};h=new XRWebGLLayer(r,e,n),r.updateRenderState({baseLayer:h}),t.setPixelRatio(1),t.setSize(h.framebufferWidth,h.framebufferHeight,!1),g=new ee(h.framebufferWidth,h.framebufferHeight,{format:X,type:F,colorSpace:t.outputColorSpace,stencilBuffer:p.stencil})}else{let n=null,a=null,o=null;p.depth&&(o=p.stencil?e.DEPTH24_STENCIL8:e.DEPTH_COMPONENT24,n=p.stencil?Y:Q,a=p.stencil?W:H);const s={colorFormat:e.RGBA8,depthFormat:o,scaleFactor:i};c=new XRWebGLBinding(r,e),u=c.createProjectionLayer(s),r.updateRenderState({layers:[u]}),t.setPixelRatio(1),t.setSize(u.textureWidth,u.textureHeight,!1),g=new ee(u.textureWidth,u.textureHeight,{format:X,type:F,depthTexture:new fi(u.textureWidth,u.textureHeight,a,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:p.stencil,colorSpace:t.outputColorSpace,samples:p.antialias?4:0});t.properties.get(g).__ignoreDepthValues=u.ignoreDepthValues}g.isXRRenderTarget=!0,this.setFoveation(s),A=null,a=await r.requestReferenceSpace(o),q.setContext(r),q.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==r)return r.environmentBlendMode};const L=new ae,D=new ae;function O(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(null===r)return;null!==f.texture&&(t.near=f.depthNear,t.far=f.depthFar),E.near=M.near=b.near=t.near,E.far=M.far=b.far=t.far,S===E.near&&T===E.far||(r.updateRenderState({depthNear:E.near,depthFar:E.far}),S=E.near,T=E.far,b.near=S,b.far=T,M.near=S,M.far=T,b.updateProjectionMatrix(),M.updateProjectionMatrix(),t.updateProjectionMatrix());const e=t.parent,n=E.cameras;O(E,e);for(let t=0;t<n.length;t++)O(n[t],e);2===n.length?function(t,e,n){L.setFromMatrixPosition(e.matrixWorld),D.setFromMatrixPosition(n.matrixWorld);const r=L.distanceTo(D),i=e.projectionMatrix.elements,a=n.projectionMatrix.elements,o=i[14]/(i[10]-1),s=i[14]/(i[10]+1),A=(i[9]+1)/i[5],l=(i[9]-1)/i[5],c=(i[8]-1)/i[0],u=(a[8]+1)/a[0],h=o*c,d=o*u,f=r/(-c+u),p=f*-c;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(p),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert();const m=o+f,g=s+f,v=h-p,_=d+(r-p),y=A*s/g*m,x=l*s/g*m;t.projectionMatrix.makePerspective(v,_,y,x,m,g),t.projectionMatrixInverse.copy(t.projectionMatrix).invert()}(E,b,M):E.projectionMatrix.copy(b.projectionMatrix),function(t,e,n){null===n?t.matrix.copy(e.matrixWorld):(t.matrix.copy(n.matrixWorld),t.matrix.invert(),t.matrix.multiply(e.matrixWorld));t.matrix.decompose(t.position,t.quaternion,t.scale),t.updateMatrixWorld(!0),t.projectionMatrix.copy(e.projectionMatrix),t.projectionMatrixInverse.copy(e.projectionMatrixInverse),t.isPerspectiveCamera&&(t.fov=2*xt*Math.atan(1/t.projectionMatrix.elements[5]),t.zoom=1)}(t,E,e)},this.getCamera=function(){return E},this.getFoveation=function(){if(null!==u||null!==h)return s},this.setFoveation=function(t){s=t,null!==u&&(u.fixedFoveation=t),null!==h&&void 0!==h.fixedFoveation&&(h.fixedFoveation=t)},this.hasDepthSensing=function(){return null!==f.texture};let I=null;const q=new Rr;q.setAnimationLoop((function(e,i){if(l=i.getViewerPose(A||a),d=i,null!==l){const e=l.views;null!==h&&(t.setRenderTargetFramebuffer(g,h.framebuffer),t.setRenderTarget(g));let n=!1;e.length!==E.cameras.length&&(E.cameras.length=0,n=!0);for(let r=0;r<e.length;r++){const i=e[r];let a=null;if(null!==h)a=h.getViewport(i);else{const e=c.getViewSubImage(u,i);a=e.viewport,0===r&&(t.setRenderTargetTextures(g,e.colorTexture,u.ignoreDepthValues?void 0:e.depthStencilTexture),t.setRenderTarget(g))}let o=w[r];void 0===o&&(o=new gr,o.layers.enable(r),o.viewport=new $t,w[r]=o),o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),o.projectionMatrix.fromArray(i.projectionMatrix),o.projectionMatrixInverse.copy(o.projectionMatrix).invert(),o.viewport.set(a.x,a.y,a.width,a.height),0===r&&(E.matrix.copy(o.matrix),E.matrix.decompose(E.position,E.quaternion,E.scale)),!0===n&&E.cameras.push(o)}const i=r.enabledFeatures;if(i&&i.includes("depth-sensing")){const n=c.getDepthInformation(e[0]);n&&n.isValid&&n.texture&&f.init(t,n,r.renderState)}}for(let t=0;t<v.length;t++){const e=_[t],n=v[t];null!==e&&void 0!==n&&n.update(e,i,A||a)}f.render(t,E),I&&I(e,i),i.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:i}),d=null})),this.setAnimationLoop=function(t){I=t},this.dispose=function(){}}}function uo(t,e){function n(t,e){!0===t.matrixAutoUpdate&&t.updateMatrix(),e.value.copy(t.matrix)}function r(r,i){r.opacity.value=i.opacity,i.color&&r.diffuse.value.copy(i.color),i.emissive&&r.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(r.map.value=i.map,n(i.map,r.mapTransform)),i.alphaMap&&(r.alphaMap.value=i.alphaMap,n(i.alphaMap,r.alphaMapTransform)),i.bumpMap&&(r.bumpMap.value=i.bumpMap,n(i.bumpMap,r.bumpMapTransform),r.bumpScale.value=i.bumpScale,i.side===g&&(r.bumpScale.value*=-1)),i.normalMap&&(r.normalMap.value=i.normalMap,n(i.normalMap,r.normalMapTransform),r.normalScale.value.copy(i.normalScale),i.side===g&&r.normalScale.value.negate()),i.displacementMap&&(r.displacementMap.value=i.displacementMap,n(i.displacementMap,r.displacementMapTransform),r.displacementScale.value=i.displacementScale,r.displacementBias.value=i.displacementBias),i.emissiveMap&&(r.emissiveMap.value=i.emissiveMap,n(i.emissiveMap,r.emissiveMapTransform)),i.specularMap&&(r.specularMap.value=i.specularMap,n(i.specularMap,r.specularMapTransform)),i.alphaTest>0&&(r.alphaTest.value=i.alphaTest);const a=e.get(i).envMap;if(a&&(r.envMap.value=a,r.flipEnvMap.value=a.isCubeTexture&&!1===a.isRenderTargetTexture?-1:1,r.reflectivity.value=i.reflectivity,r.ior.value=i.ior,r.refractionRatio.value=i.refractionRatio),i.lightMap){r.lightMap.value=i.lightMap;const e=!0===t._useLegacyLights?Math.PI:1;r.lightMapIntensity.value=i.lightMapIntensity*e,n(i.lightMap,r.lightMapTransform)}i.aoMap&&(r.aoMap.value=i.aoMap,r.aoMapIntensity.value=i.aoMapIntensity,n(i.aoMap,r.aoMapTransform))}return{refreshFogUniforms:function(e,n){n.color.getRGB(e.fogColor.value,cr(t)),n.isFog?(e.fogNear.value=n.near,e.fogFar.value=n.far):n.isFogExp2&&(e.fogDensity.value=n.density)},refreshMaterialUniforms:function(t,i,a,o,s){i.isMeshBasicMaterial||i.isMeshLambertMaterial?r(t,i):i.isMeshToonMaterial?(r(t,i),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,i)):i.isMeshPhongMaterial?(r(t,i),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,i)):i.isMeshStandardMaterial?(r(t,i),function(t,r){t.metalness.value=r.metalness,r.metalnessMap&&(t.metalnessMap.value=r.metalnessMap,n(r.metalnessMap,t.metalnessMapTransform));t.roughness.value=r.roughness,r.roughnessMap&&(t.roughnessMap.value=r.roughnessMap,n(r.roughnessMap,t.roughnessMapTransform));const i=e.get(r).envMap;i&&(t.envMapIntensity.value=r.envMapIntensity)}(t,i),i.isMeshPhysicalMaterial&&function(t,e,r){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap,n(e.sheenColorMap,t.sheenColorMapTransform)),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap,n(e.sheenRoughnessMap,t.sheenRoughnessMapTransform)));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap,n(e.clearcoatMap,t.clearcoatMapTransform)),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap,n(e.clearcoatRoughnessMap,t.clearcoatRoughnessMapTransform)),e.clearcoatNormalMap&&(t.clearcoatNormalMap.value=e.clearcoatNormalMap,n(e.clearcoatNormalMap,t.clearcoatNormalMapTransform),t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),e.side===g&&t.clearcoatNormalScale.value.negate()));e.iridescence>0&&(t.iridescence.value=e.iridescence,t.iridescenceIOR.value=e.iridescenceIOR,t.iridescenceThicknessMinimum.value=e.iridescenceThicknessRange[0],t.iridescenceThicknessMaximum.value=e.iridescenceThicknessRange[1],e.iridescenceMap&&(t.iridescenceMap.value=e.iridescenceMap,n(e.iridescenceMap,t.iridescenceMapTransform)),e.iridescenceThicknessMap&&(t.iridescenceThicknessMap.value=e.iridescenceThicknessMap,n(e.iridescenceThicknessMap,t.iridescenceThicknessMapTransform)));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=r.texture,t.transmissionSamplerSize.value.set(r.width,r.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap,n(e.transmissionMap,t.transmissionMapTransform)),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap,n(e.thicknessMap,t.thicknessMapTransform)),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));e.anisotropy>0&&(t.anisotropyVector.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation)),e.anisotropyMap&&(t.anisotropyMap.value=e.anisotropyMap,n(e.anisotropyMap,t.anisotropyMapTransform)));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap,n(e.specularColorMap,t.specularColorMapTransform));e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap,n(e.specularIntensityMap,t.specularIntensityMapTransform))}(t,i,s)):i.isMeshMatcapMaterial?(r(t,i),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,i)):i.isMeshDepthMaterial?r(t,i):i.isMeshDistanceMaterial?(r(t,i),function(t,n){const r=e.get(n).light;t.referencePosition.value.setFromMatrixPosition(r.matrixWorld),t.nearDistance.value=r.shadow.camera.near,t.farDistance.value=r.shadow.camera.far}(t,i)):i.isMeshNormalMaterial?r(t,i):i.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform))}(t,i),i.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,i)):i.isPointsMaterial?function(t,e,r,i){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*r,t.scale.value=.5*i,e.map&&(t.map.value=e.map,n(e.map,t.uvTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,i,a,o):i.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map,n(e.map,t.mapTransform));e.alphaMap&&(t.alphaMap.value=e.alphaMap,n(e.alphaMap,t.alphaMapTransform));e.alphaTest>0&&(t.alphaTest.value=e.alphaTest)}(t,i):i.isShadowMaterial?(t.color.value.copy(i.color),t.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function ho(t,e,n,r){let i={},a={},o=[];const s=n.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function A(t,e,n,r){const i=t.value,a=e+"_"+n;if(void 0===r[a])return r[a]="number"==typeof i||"boolean"==typeof i?i:i.clone(),!0;{const t=r[a];if("number"==typeof i||"boolean"==typeof i){if(t!==i)return r[a]=i,!0}else if(!1===t.equals(i))return t.copy(i),!0}return!1}function l(t){const e={boundary:0,storage:0};return"number"==typeof t||"boolean"==typeof t?(e.boundary=4,e.storage=4):t.isVector2?(e.boundary=8,e.storage=8):t.isVector3||t.isColor?(e.boundary=16,e.storage=12):t.isVector4?(e.boundary=16,e.storage=16):t.isMatrix3?(e.boundary=48,e.storage=48):t.isMatrix4?(e.boundary=64,e.storage=64):t.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",t),e}function c(e){const n=e.target;n.removeEventListener("dispose",c);const r=o.indexOf(n.__bindingPointIndex);o.splice(r,1),t.deleteBuffer(i[n.id]),delete i[n.id],delete a[n.id]}return{bind:function(t,e){const n=e.program;r.uniformBlockBinding(t,n)},update:function(n,u){let h=i[n.id];void 0===h&&(!function(t){const e=t.uniforms;let n=0;const r=16;for(let t=0,i=e.length;t<i;t++){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let t=0,e=i.length;t<e;t++){const e=i[t],a=Array.isArray(e.value)?e.value:[e.value];for(let t=0,i=a.length;t<i;t++){const i=l(a[t]),o=n%r;0!==o&&r-o<i.boundary&&(n+=r-o),e.__data=new Float32Array(i.storage/Float32Array.BYTES_PER_ELEMENT),e.__offset=n,n+=i.storage}}}const i=n%r;i>0&&(n+=r-i);t.__size=n,t.__cache={}}(n),h=function(e){const n=function(){for(let t=0;t<s;t++)if(-1===o.indexOf(t))return o.push(t),t;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}();e.__bindingPointIndex=n;const r=t.createBuffer(),i=e.__size,a=e.usage;return t.bindBuffer(t.UNIFORM_BUFFER,r),t.bufferData(t.UNIFORM_BUFFER,i,a),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,n,r),r}(n),i[n.id]=h,n.addEventListener("dispose",c));const d=u.program;r.updateUBOMapping(n,d);const f=e.render.frame;a[n.id]!==f&&(!function(e){const n=i[e.id],r=e.uniforms,a=e.__cache;t.bindBuffer(t.UNIFORM_BUFFER,n);for(let e=0,n=r.length;e<n;e++){const n=Array.isArray(r[e])?r[e]:[r[e]];for(let r=0,i=n.length;r<i;r++){const i=n[r];if(!0===A(i,e,r,a)){const e=i.__offset,n=Array.isArray(i.value)?i.value:[i.value];let r=0;for(let a=0;a<n.length;a++){const o=n[a],s=l(o);"number"==typeof o||"boolean"==typeof o?(i.__data[0]=o,t.bufferSubData(t.UNIFORM_BUFFER,e+r,i.__data)):o.isMatrix3?(i.__data[0]=o.elements[0],i.__data[1]=o.elements[1],i.__data[2]=o.elements[2],i.__data[3]=0,i.__data[4]=o.elements[3],i.__data[5]=o.elements[4],i.__data[6]=o.elements[5],i.__data[7]=0,i.__data[8]=o.elements[6],i.__data[9]=o.elements[7],i.__data[10]=o.elements[8],i.__data[11]=0):(o.toArray(i.__data,r),r+=s.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(t.UNIFORM_BUFFER,e,i.__data)}}}t.bindBuffer(t.UNIFORM_BUFFER,null)}(n),a[n.id]=f)},dispose:function(){for(const e in i)t.deleteBuffer(i[e]);o=[],i={},a={}}}}class fo{constructor(t={}){const{canvas:e=Ut(),context:n=null,depth:r=!0,stencil:i=!0,alpha:a=!1,antialias:o=!1,premultipliedAlpha:A=!0,preserveDrawingBuffer:l=!1,powerPreference:c="default",failIfMajorPerformanceCaveat:u=!1}=t;let h;this.isWebGLRenderer=!0,h=null!==n?n.getContextAttributes().alpha:a;const d=new Uint32Array(4),f=new Int32Array(4);let p=null,v=null;const _=[],y=[];this.domElement=e,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=rt,this._useLegacyLights=!1,this.toneMapping=b,this.toneMappingExposure=1;const x=this;let M=!1,w=0,E=0,S=null,T=-1,C=null;const R=new $t,P=new $t;let L=null;const D=new Mn(0);let O=0,I=e.width,q=e.height,U=1,N=null,B=null;const G=new $t(0,0,I,q),Q=new $t(0,0,I,q);let Y=!1;const Z=new Cr;let K=!1,J=!1,$=null;const tt=new qe,et=new Lt,nt=new ae,at={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ot(){return null===S?U:1}let st,At,lt,ct,ut,ht,dt,ft,pt,mt,gt,vt,_t,yt,xt,bt,Mt,wt,Et,St,Ct,Rt,Pt,Dt,Ot=n;function It(t,n){for(let r=0;r<t.length;r++){const i=t[r],a=e.getContext(i,n);if(null!==a)return a}return null}try{const t={alpha:!0,depth:r,stencil:i,antialias:o,premultipliedAlpha:A,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine",`three.js r${s}`),e.addEventListener("webglcontextlost",Bt,!1),e.addEventListener("webglcontextrestored",kt,!1),e.addEventListener("webglcontextcreationerror",Ft,!1),null===Ot){const e=["webgl2","webgl","experimental-webgl"];if(!0===x.isWebGL1Renderer&&e.shift(),Ot=It(e,t),null===Ot)throw It(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}"undefined"!=typeof WebGLRenderingContext&&Ot instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),void 0===Ot.getShaderPrecisionFormat&&(Ot.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}function qt(){st=new oi(Ot),At=new kr(Ot,st,t),st.init(At),Rt=new io(Ot,st,At),lt=new no(Ot,st,At),ct=new li(Ot),ut=new Ga,ht=new ro(Ot,st,lt,ut,At,Rt,ct),dt=new zr(x),ft=new ai(x),pt=new Pr(Ot,At),Pt=new Nr(Ot,st,pt,At),mt=new si(Ot,pt,ct,Pt),gt=new di(Ot,mt,pt,ct),Et=new hi(Ot,At,ht),bt=new Fr(ut),vt=new za(x,dt,ft,st,At,Pt,bt),_t=new uo(x,ut),yt=new Wa,xt=new Ja(st,At),wt=new Ur(x,dt,ft,lt,gt,h,A),Mt=new eo(x,gt,At),Dt=new ho(Ot,ct,At,lt),St=new Br(Ot,st,ct,At),Ct=new Ai(Ot,st,ct,At),ct.programs=vt.programs,x.capabilities=At,x.extensions=st,x.properties=ut,x.renderLists=yt,x.shadowMap=Mt,x.state=lt,x.info=ct}qt();const Nt=new co(x,Ot);function Bt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),M=!0}function kt(){console.log("THREE.WebGLRenderer: Context Restored."),M=!1;const t=ct.autoReset,e=Mt.enabled,n=Mt.autoUpdate,r=Mt.needsUpdate,i=Mt.type;qt(),ct.autoReset=t,Mt.enabled=e,Mt.autoUpdate=n,Mt.needsUpdate=r,Mt.type=i}function Ft(t){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",t.statusMessage)}function zt(t){const e=t.target;e.removeEventListener("dispose",zt),function(t){(function(t){const e=ut.get(t).programs;void 0!==e&&(e.forEach((function(t){vt.releaseProgram(t)})),t.isShaderMaterial&&vt.releaseShaderCache(t))})(t),ut.remove(t)}(e)}function Gt(t,e,n){!0===t.transparent&&2===t.side&&!1===t.forceSinglePass?(t.side=g,t.needsUpdate=!0,Kt(t,e,n),t.side=m,t.needsUpdate=!0,Kt(t,e,n),t.side=2):Kt(t,e,n)}this.xr=Nt,this.getContext=function(){return Ot},this.getContextAttributes=function(){return Ot.getContextAttributes()},this.forceContextLoss=function(){const t=st.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=st.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return U},this.setPixelRatio=function(t){void 0!==t&&(U=t,this.setSize(I,q,!1))},this.getSize=function(t){return t.set(I,q)},this.setSize=function(t,n,r=!0){Nt.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(I=t,q=n,e.width=Math.floor(t*U),e.height=Math.floor(n*U),!0===r&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return t.set(I*U,q*U).floor()},this.setDrawingBufferSize=function(t,n,r){I=t,q=n,U=r,e.width=Math.floor(t*r),e.height=Math.floor(n*r),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return t.copy(R)},this.getViewport=function(t){return t.copy(G)},this.setViewport=function(t,e,n,r){t.isVector4?G.set(t.x,t.y,t.z,t.w):G.set(t,e,n,r),lt.viewport(R.copy(G).multiplyScalar(U).floor())},this.getScissor=function(t){return t.copy(Q)},this.setScissor=function(t,e,n,r){t.isVector4?Q.set(t.x,t.y,t.z,t.w):Q.set(t,e,n,r),lt.scissor(P.copy(Q).multiplyScalar(U).floor())},this.getScissorTest=function(){return Y},this.setScissorTest=function(t){lt.setScissorTest(Y=t)},this.setOpaqueSort=function(t){N=t},this.setTransparentSort=function(t){B=t},this.getClearColor=function(t){return t.copy(wt.getClearColor())},this.setClearColor=function(){wt.setClearColor.apply(wt,arguments)},this.getClearAlpha=function(){return wt.getClearAlpha()},this.setClearAlpha=function(){wt.setClearAlpha.apply(wt,arguments)},this.clear=function(t=!0,e=!0,n=!0){let r=0;if(t){let t=!1;if(null!==S){const e=S.texture.format;t=1033===e||1031===e||1029===e}if(t){const t=S.texture.type,e=t===F||t===H||t===z||t===W||1017===t||1018===t,n=wt.getClearColor(),r=wt.getClearAlpha(),i=n.r,a=n.g,o=n.b;e?(d[0]=i,d[1]=a,d[2]=o,d[3]=r,Ot.clearBufferuiv(Ot.COLOR,0,d)):(f[0]=i,f[1]=a,f[2]=o,f[3]=r,Ot.clearBufferiv(Ot.COLOR,0,f))}else r|=Ot.COLOR_BUFFER_BIT}e&&(r|=Ot.DEPTH_BUFFER_BIT),n&&(r|=Ot.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),Ot.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",Bt,!1),e.removeEventListener("webglcontextrestored",kt,!1),e.removeEventListener("webglcontextcreationerror",Ft,!1),yt.dispose(),xt.dispose(),ut.dispose(),dt.dispose(),ft.dispose(),gt.dispose(),Pt.dispose(),Dt.dispose(),vt.dispose(),Nt.dispose(),Nt.removeEventListener("sessionstart",jt),Nt.removeEventListener("sessionend",Vt),$&&($.dispose(),$=null),Wt.stop()},this.renderBufferDirect=function(t,e,n,r,i,a){null===e&&(e=at);const o=i.isMesh&&i.matrixWorld.determinant()<0,s=function(t,e,n,r,i){!0!==e.isScene&&(e=at);ht.resetTextureUnits();const a=e.fog,o=r.isMeshStandardMaterial?e.environment:null,s=null===S?x.outputColorSpace:!0===S.isXRRenderTarget?S.texture.colorSpace:it,A=(r.isMeshStandardMaterial?ft:dt).get(r.envMap||o),l=!0===r.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,c=!!n.attributes.tangent&&(!!r.normalMap||r.anisotropy>0),u=!!n.morphAttributes.position,h=!!n.morphAttributes.normal,d=!!n.morphAttributes.color;let f=b;r.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(f=x.toneMapping));const p=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,m=void 0!==p?p.length:0,g=ut.get(r),_=v.state.lights;if(!0===K&&(!0===J||t!==C)){const e=t===C&&r.id===T;bt.setState(r,t,e)}let y=!1;r.version===g.__version?g.needsLights&&g.lightsStateVersion!==_.state.version||g.outputColorSpace!==s||i.isBatchedMesh&&!1===g.batching?y=!0:i.isBatchedMesh||!0!==g.batching?i.isInstancedMesh&&!1===g.instancing?y=!0:i.isInstancedMesh||!0!==g.instancing?i.isSkinnedMesh&&!1===g.skinning?y=!0:i.isSkinnedMesh||!0!==g.skinning?i.isInstancedMesh&&!0===g.instancingColor&&null===i.instanceColor||i.isInstancedMesh&&!1===g.instancingColor&&null!==i.instanceColor||g.envMap!==A||!0===r.fog&&g.fog!==a?y=!0:void 0===g.numClippingPlanes||g.numClippingPlanes===bt.numPlanes&&g.numIntersection===bt.numIntersection?(g.vertexAlphas!==l||g.vertexTangents!==c||g.morphTargets!==u||g.morphNormals!==h||g.morphColors!==d||g.toneMapping!==f||!0===At.isWebGL2&&g.morphTargetsCount!==m)&&(y=!0):y=!0:y=!0:y=!0:y=!0:(y=!0,g.__version=r.version);let M=g.currentProgram;!0===y&&(M=Kt(r,e,i));let w=!1,E=!1,R=!1;const P=M.getUniforms(),L=g.uniforms;lt.useProgram(M.program)&&(w=!0,E=!0,R=!0);r.id!==T&&(T=r.id,E=!0);if(w||C!==t){P.setValue(Ot,"projectionMatrix",t.projectionMatrix),P.setValue(Ot,"viewMatrix",t.matrixWorldInverse);const e=P.map.cameraPosition;void 0!==e&&e.setValue(Ot,nt.setFromMatrixPosition(t.matrixWorld)),At.logarithmicDepthBuffer&&P.setValue(Ot,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&P.setValue(Ot,"isOrthographic",!0===t.isOrthographicCamera),C!==t&&(C=t,E=!0,R=!0)}if(i.isSkinnedMesh){P.setOptional(Ot,i,"bindMatrix"),P.setOptional(Ot,i,"bindMatrixInverse");const t=i.skeleton;t&&(At.floatVertexTextures?(null===t.boneTexture&&t.computeBoneTexture(),P.setValue(Ot,"boneTexture",t.boneTexture,ht)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}i.isBatchedMesh&&(P.setOptional(Ot,i,"batchingTexture"),P.setValue(Ot,"batchingTexture",i._matricesTexture,ht));const D=n.morphAttributes;(void 0!==D.position||void 0!==D.normal||void 0!==D.color&&!0===At.isWebGL2)&&Et.update(i,n,M);(E||g.receiveShadow!==i.receiveShadow)&&(g.receiveShadow=i.receiveShadow,P.setValue(Ot,"receiveShadow",i.receiveShadow));r.isMeshGouraudMaterial&&null!==r.envMap&&(L.envMap.value=A,L.flipEnvMap.value=A.isCubeTexture&&!1===A.isRenderTargetTexture?-1:1);E&&(P.setValue(Ot,"toneMappingExposure",x.toneMappingExposure),g.needsLights&&(I=R,(O=L).ambientLightColor.needsUpdate=I,O.lightProbe.needsUpdate=I,O.directionalLights.needsUpdate=I,O.directionalLightShadows.needsUpdate=I,O.pointLights.needsUpdate=I,O.pointLightShadows.needsUpdate=I,O.spotLights.needsUpdate=I,O.spotLightShadows.needsUpdate=I,O.rectAreaLights.needsUpdate=I,O.hemisphereLights.needsUpdate=I),a&&!0===r.fog&&_t.refreshFogUniforms(L,a),_t.refreshMaterialUniforms(L,r,U,q,$),_a.upload(Ot,Jt(g),L,ht));var O,I;r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(_a.upload(Ot,Jt(g),L,ht),r.uniformsNeedUpdate=!1);r.isSpriteMaterial&&P.setValue(Ot,"center",i.center);if(P.setValue(Ot,"modelViewMatrix",i.modelViewMatrix),P.setValue(Ot,"normalMatrix",i.normalMatrix),P.setValue(Ot,"modelMatrix",i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){const t=r.uniformsGroups;for(let e=0,n=t.length;e<n;e++)if(At.isWebGL2){const n=t[e];Dt.update(n,M),Dt.bind(n,M)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return M}(t,e,n,r,i);lt.setMaterial(r,o);let A=n.index,l=1;if(!0===r.wireframe){if(A=mt.getWireframeAttribute(n),void 0===A)return;l=2}const c=n.drawRange,u=n.attributes.position;let h=c.start*l,d=(c.start+c.count)*l;null!==a&&(h=Math.max(h,a.start*l),d=Math.min(d,(a.start+a.count)*l)),null!==A?(h=Math.max(h,0),d=Math.min(d,A.count)):null!=u&&(h=Math.max(h,0),d=Math.min(d,u.count));const f=d-h;if(f<0||f===1/0)return;let p;Pt.setup(i,r,s,n,A);let m=St;if(null!==A&&(p=pt.get(A),m=Ct,m.setIndex(p)),i.isMesh)!0===r.wireframe?(lt.setLineWidth(r.wireframeLinewidth*ot()),m.setMode(Ot.LINES)):m.setMode(Ot.TRIANGLES);else if(i.isLine){let t=r.linewidth;void 0===t&&(t=1),lt.setLineWidth(t*ot()),i.isLineSegments?m.setMode(Ot.LINES):i.isLineLoop?m.setMode(Ot.LINE_LOOP):m.setMode(Ot.LINE_STRIP)}else i.isPoints?m.setMode(Ot.POINTS):i.isSprite&&m.setMode(Ot.TRIANGLES);if(i.isBatchedMesh)m.renderMultiDraw(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount);else if(i.isInstancedMesh)m.renderInstances(h,f,i.count);else if(n.isInstancedBufferGeometry){const t=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,e=Math.min(n.instanceCount,t);m.renderInstances(h,f,e)}else m.render(h,f)},this.compile=function(t,e,n=null){null===n&&(n=t),v=xt.get(n),v.init(),y.push(v),n.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(v.pushLight(t),t.castShadow&&v.pushShadow(t))})),t!==n&&t.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(v.pushLight(t),t.castShadow&&v.pushShadow(t))})),v.setupLights(x._useLegacyLights);const r=new Set;return t.traverse((function(t){const e=t.material;if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++){const a=e[i];Gt(a,n,t),r.add(a)}else Gt(e,n,t),r.add(e)})),y.pop(),v=null,r},this.compileAsync=function(t,e,n=null){const r=this.compile(t,e,n);return new Promise((e=>{function n(){r.forEach((function(t){ut.get(t).currentProgram.isReady()&&r.delete(t)})),0!==r.size?setTimeout(n,10):e(t)}null!==st.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)}))};let Ht=null;function jt(){Wt.stop()}function Vt(){Wt.start()}const Wt=new Rr;function Xt(t,e,n,r){if(!1===t.visible)return;if(t.layers.test(e.layers))if(t.isGroup)n=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)v.pushLight(t),t.castShadow&&v.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||Z.intersectsSprite(t)){r&&nt.setFromMatrixPosition(t.matrixWorld).applyMatrix4(tt);const e=gt.update(t),i=t.material;i.visible&&p.push(t,e,i,n,nt.z,null)}}else if((t.isMesh||t.isLine||t.isPoints)&&(!t.frustumCulled||Z.intersectsObject(t))){const e=gt.update(t),i=t.material;if(r&&(void 0!==t.boundingSphere?(null===t.boundingSphere&&t.computeBoundingSphere(),nt.copy(t.boundingSphere.center)):(null===e.boundingSphere&&e.computeBoundingSphere(),nt.copy(e.boundingSphere.center)),nt.applyMatrix4(t.matrixWorld).applyMatrix4(tt)),Array.isArray(i)){const r=e.groups;for(let a=0,o=r.length;a<o;a++){const o=r[a],s=i[o.materialIndex];s&&s.visible&&p.push(t,e,s,n,nt.z,o)}}else i.visible&&p.push(t,e,i,n,nt.z,null)}const i=t.children;for(let t=0,a=i.length;t<a;t++)Xt(i[t],e,n,r)}function Qt(t,e,n,r){const i=t.opaque,a=t.transmissive,o=t.transparent;v.setupLightsView(n),!0===K&&bt.setGlobalState(x.clippingPlanes,n),a.length>0&&function(t,e,n,r){const i=!0===n.isScene?n.overrideMaterial:null;if(null!==i)return;const a=At.isWebGL2;null===$&&($=new ee(1,1,{generateMipmaps:!0,type:st.has("EXT_color_buffer_half_float")?V:F,minFilter:k,samples:a?4:0}));x.getDrawingBufferSize(et),a?$.setSize(et.x,et.y):$.setSize(Tt(et.x),Tt(et.y));const o=x.getRenderTarget();x.setRenderTarget($),x.getClearColor(D),O=x.getClearAlpha(),O<1&&x.setClearColor(16777215,.5);x.clear();const s=x.toneMapping;x.toneMapping=b,Yt(t,n,r),ht.updateMultisampleRenderTarget($),ht.updateRenderTargetMipmap($);let A=!1;for(let t=0,i=e.length;t<i;t++){const i=e[t],a=i.object,o=i.geometry,s=i.material,l=i.group;if(2===s.side&&a.layers.test(r.layers)){const t=s.side;s.side=g,s.needsUpdate=!0,Zt(a,n,r,o,s,l),s.side=t,s.needsUpdate=!0,A=!0}}!0===A&&(ht.updateMultisampleRenderTarget($),ht.updateRenderTargetMipmap($));x.setRenderTarget(o),x.setClearColor(D,O),x.toneMapping=s}(i,a,e,n),r&&lt.viewport(R.copy(r)),i.length>0&&Yt(i,e,n),a.length>0&&Yt(a,e,n),o.length>0&&Yt(o,e,n),lt.buffers.depth.setTest(!0),lt.buffers.depth.setMask(!0),lt.buffers.color.setMask(!0),lt.setPolygonOffset(!1)}function Yt(t,e,n){const r=!0===e.isScene?e.overrideMaterial:null;for(let i=0,a=t.length;i<a;i++){const a=t[i],o=a.object,s=a.geometry,A=null===r?a.material:r,l=a.group;o.layers.test(n.layers)&&Zt(o,e,n,s,A,l)}}function Zt(t,e,n,r,i,a){t.onBeforeRender(x,e,n,r,i,a),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),i.onBeforeRender(x,e,n,r,t,a),!0===i.transparent&&2===i.side&&!1===i.forceSinglePass?(i.side=g,i.needsUpdate=!0,x.renderBufferDirect(n,e,r,i,t,a),i.side=m,i.needsUpdate=!0,x.renderBufferDirect(n,e,r,i,t,a),i.side=2):x.renderBufferDirect(n,e,r,i,t,a),t.onAfterRender(x,e,n,r,i,a)}function Kt(t,e,n){!0!==e.isScene&&(e=at);const r=ut.get(t),i=v.state.lights,a=v.state.shadowsArray,o=i.state.version,s=vt.getParameters(t,i.state,a,e,n),A=vt.getProgramCacheKey(s);let l=r.programs;r.environment=t.isMeshStandardMaterial?e.environment:null,r.fog=e.fog,r.envMap=(t.isMeshStandardMaterial?ft:dt).get(t.envMap||r.environment),void 0===l&&(t.addEventListener("dispose",zt),l=new Map,r.programs=l);let c=l.get(A);if(void 0!==c){if(r.currentProgram===c&&r.lightsStateVersion===o)return te(t,s),c}else s.uniforms=vt.getUniforms(t),t.onBuild(n,s,x),t.onBeforeCompile(s,x),c=vt.acquireProgram(s,A),l.set(A,c),r.uniforms=s.uniforms;const u=r.uniforms;return(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(u.clippingPlanes=bt.uniform),te(t,s),r.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),r.lightsStateVersion=o,r.needsLights&&(u.ambientLightColor.value=i.state.ambient,u.lightProbe.value=i.state.probe,u.directionalLights.value=i.state.directional,u.directionalLightShadows.value=i.state.directionalShadow,u.spotLights.value=i.state.spot,u.spotLightShadows.value=i.state.spotShadow,u.rectAreaLights.value=i.state.rectArea,u.ltc_1.value=i.state.rectAreaLTC1,u.ltc_2.value=i.state.rectAreaLTC2,u.pointLights.value=i.state.point,u.pointLightShadows.value=i.state.pointShadow,u.hemisphereLights.value=i.state.hemi,u.directionalShadowMap.value=i.state.directionalShadowMap,u.directionalShadowMatrix.value=i.state.directionalShadowMatrix,u.spotShadowMap.value=i.state.spotShadowMap,u.spotLightMatrix.value=i.state.spotLightMatrix,u.spotLightMap.value=i.state.spotLightMap,u.pointShadowMap.value=i.state.pointShadowMap,u.pointShadowMatrix.value=i.state.pointShadowMatrix),r.currentProgram=c,r.uniformsList=null,c}function Jt(t){if(null===t.uniformsList){const e=t.currentProgram.getUniforms();t.uniformsList=_a.seqWithValue(e.seq,t.uniforms)}return t.uniformsList}function te(t,e){const n=ut.get(t);n.outputColorSpace=e.outputColorSpace,n.batching=e.batching,n.instancing=e.instancing,n.instancingColor=e.instancingColor,n.skinning=e.skinning,n.morphTargets=e.morphTargets,n.morphNormals=e.morphNormals,n.morphColors=e.morphColors,n.morphTargetsCount=e.morphTargetsCount,n.numClippingPlanes=e.numClippingPlanes,n.numIntersection=e.numClipIntersection,n.vertexAlphas=e.vertexAlphas,n.vertexTangents=e.vertexTangents,n.toneMapping=e.toneMapping}Wt.setAnimationLoop((function(t){Ht&&Ht(t)})),"undefined"!=typeof self&&Wt.setContext(self),this.setAnimationLoop=function(t){Ht=t,Nt.setAnimationLoop(t),null===t?Wt.stop():Wt.start()},Nt.addEventListener("sessionstart",jt),Nt.addEventListener("sessionend",Vt),this.render=function(t,e){if(void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===M)return;!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),!0===Nt.enabled&&!0===Nt.isPresenting&&(!0===Nt.cameraAutoUpdate&&Nt.updateCamera(e),e=Nt.getCamera()),!0===t.isScene&&t.onBeforeRender(x,t,e,S),v=xt.get(t,y.length),v.init(),y.push(v),tt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),Z.setFromProjectionMatrix(tt),J=this.localClippingEnabled,K=bt.init(this.clippingPlanes,J),p=yt.get(t,_.length),p.init(),_.push(p),Xt(t,e,0,x.sortObjects),p.finish(),!0===x.sortObjects&&p.sort(N,B),this.info.render.frame++,!0===K&&bt.beginShadows();const n=v.state.shadowsArray;if(Mt.render(n,t,e),!0===K&&bt.endShadows(),!0===this.info.autoReset&&this.info.reset(),!1!==Nt.enabled&&!1!==Nt.isPresenting&&!1!==Nt.hasDepthSensing()||wt.render(p,t),v.setupLights(x._useLegacyLights),e.isArrayCamera){const n=e.cameras;for(let e=0,r=n.length;e<r;e++){const r=n[e];Qt(p,t,r,r.viewport)}}else Qt(p,t,e);null!==S&&(ht.updateMultisampleRenderTarget(S),ht.updateRenderTargetMipmap(S)),!0===t.isScene&&t.onAfterRender(x,t,e),Pt.resetDefaultState(),T=-1,C=null,y.pop(),v=y.length>0?y[y.length-1]:null,_.pop(),p=_.length>0?_[_.length-1]:null},this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return E},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(t,e,n){ut.get(t.texture).__webglTexture=e,ut.get(t.depthTexture).__webglTexture=n;const r=ut.get(t);r.__hasExternalTextures=!0,r.__hasExternalTextures&&(r.__autoAllocateDepthBuffer=void 0===n,r.__autoAllocateDepthBuffer||!0===st.has("WEBGL_multisampled_render_to_texture")&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),r.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(t,e){const n=ut.get(t);n.__webglFramebuffer=e,n.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,n=0){S=t,w=e,E=n;let r=!0,i=null,a=!1,o=!1;if(t){const s=ut.get(t);void 0!==s.__useDefaultFramebuffer?(lt.bindFramebuffer(Ot.FRAMEBUFFER,null),r=!1):void 0===s.__webglFramebuffer?ht.setupRenderTarget(t):s.__hasExternalTextures&&ht.rebindTextures(t,ut.get(t.texture).__webglTexture,ut.get(t.depthTexture).__webglTexture);const A=t.texture;(A.isData3DTexture||A.isDataArrayTexture||A.isCompressedArrayTexture)&&(o=!0);const l=ut.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(i=Array.isArray(l[e])?l[e][n]:l[e],a=!0):i=At.isWebGL2&&t.samples>0&&!1===ht.useMultisampledRTT(t)?ut.get(t).__webglMultisampledFramebuffer:Array.isArray(l)?l[n]:l,R.copy(t.viewport),P.copy(t.scissor),L=t.scissorTest}else R.copy(G).multiplyScalar(U).floor(),P.copy(Q).multiplyScalar(U).floor(),L=Y;if(lt.bindFramebuffer(Ot.FRAMEBUFFER,i)&&At.drawBuffers&&r&&lt.drawBuffers(t,i),lt.viewport(R),lt.scissor(P),lt.setScissorTest(L),a){const r=ut.get(t.texture);Ot.framebufferTexture2D(Ot.FRAMEBUFFER,Ot.COLOR_ATTACHMENT0,Ot.TEXTURE_CUBE_MAP_POSITIVE_X+e,r.__webglTexture,n)}else if(o){const r=ut.get(t.texture),i=e||0;Ot.framebufferTextureLayer(Ot.FRAMEBUFFER,Ot.COLOR_ATTACHMENT0,r.__webglTexture,n||0,i)}T=-1},this.readRenderTargetPixels=function(t,e,n,r,i,a,o){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=ut.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){lt.bindFramebuffer(Ot.FRAMEBUFFER,s);try{const o=t.texture,s=o.format,A=o.type;if(s!==X&&Rt.convert(s)!==Ot.getParameter(Ot.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const l=A===V&&(st.has("EXT_color_buffer_half_float")||At.isWebGL2&&st.has("EXT_color_buffer_float"));if(!(A===F||Rt.convert(A)===Ot.getParameter(Ot.IMPLEMENTATION_COLOR_READ_TYPE)||A===j&&(At.isWebGL2||st.has("OES_texture_float")||st.has("WEBGL_color_buffer_float"))||l))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");e>=0&&e<=t.width-r&&n>=0&&n<=t.height-i&&Ot.readPixels(e,n,r,i,Rt.convert(s),Rt.convert(A),a)}finally{const t=null!==S?ut.get(S).__webglFramebuffer:null;lt.bindFramebuffer(Ot.FRAMEBUFFER,t)}}},this.copyFramebufferToTexture=function(t,e,n=0){const r=Math.pow(2,-n),i=Math.floor(e.image.width*r),a=Math.floor(e.image.height*r);ht.setTexture2D(e,0),Ot.copyTexSubImage2D(Ot.TEXTURE_2D,n,0,0,t.x,t.y,i,a),lt.unbindTexture()},this.copyTextureToTexture=function(t,e,n,r=0){const i=e.image.width,a=e.image.height,o=Rt.convert(n.format),s=Rt.convert(n.type);ht.setTexture2D(n,0),Ot.pixelStorei(Ot.UNPACK_FLIP_Y_WEBGL,n.flipY),Ot.pixelStorei(Ot.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),Ot.pixelStorei(Ot.UNPACK_ALIGNMENT,n.unpackAlignment),e.isDataTexture?Ot.texSubImage2D(Ot.TEXTURE_2D,r,t.x,t.y,i,a,o,s,e.image.data):e.isCompressedTexture?Ot.compressedTexSubImage2D(Ot.TEXTURE_2D,r,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,o,e.mipmaps[0].data):Ot.texSubImage2D(Ot.TEXTURE_2D,r,t.x,t.y,o,s,e.image),0===r&&n.generateMipmaps&&Ot.generateMipmap(Ot.TEXTURE_2D),lt.unbindTexture()},this.copyTextureToTexture3D=function(t,e,n,r,i=0){if(x.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const a=t.max.x-t.min.x+1,o=t.max.y-t.min.y+1,s=t.max.z-t.min.z+1,A=Rt.convert(r.format),l=Rt.convert(r.type);let c;if(r.isData3DTexture)ht.setTexture3D(r,0),c=Ot.TEXTURE_3D;else{if(!r.isDataArrayTexture&&!r.isCompressedArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");ht.setTexture2DArray(r,0),c=Ot.TEXTURE_2D_ARRAY}Ot.pixelStorei(Ot.UNPACK_FLIP_Y_WEBGL,r.flipY),Ot.pixelStorei(Ot.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),Ot.pixelStorei(Ot.UNPACK_ALIGNMENT,r.unpackAlignment);const u=Ot.getParameter(Ot.UNPACK_ROW_LENGTH),h=Ot.getParameter(Ot.UNPACK_IMAGE_HEIGHT),d=Ot.getParameter(Ot.UNPACK_SKIP_PIXELS),f=Ot.getParameter(Ot.UNPACK_SKIP_ROWS),p=Ot.getParameter(Ot.UNPACK_SKIP_IMAGES),m=n.isCompressedTexture?n.mipmaps[i]:n.image;Ot.pixelStorei(Ot.UNPACK_ROW_LENGTH,m.width),Ot.pixelStorei(Ot.UNPACK_IMAGE_HEIGHT,m.height),Ot.pixelStorei(Ot.UNPACK_SKIP_PIXELS,t.min.x),Ot.pixelStorei(Ot.UNPACK_SKIP_ROWS,t.min.y),Ot.pixelStorei(Ot.UNPACK_SKIP_IMAGES,t.min.z),n.isDataTexture||n.isData3DTexture?Ot.texSubImage3D(c,i,e.x,e.y,e.z,a,o,s,A,l,m.data):n.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),Ot.compressedTexSubImage3D(c,i,e.x,e.y,e.z,a,o,s,A,m.data)):Ot.texSubImage3D(c,i,e.x,e.y,e.z,a,o,s,A,l,m),Ot.pixelStorei(Ot.UNPACK_ROW_LENGTH,u),Ot.pixelStorei(Ot.UNPACK_IMAGE_HEIGHT,h),Ot.pixelStorei(Ot.UNPACK_SKIP_PIXELS,d),Ot.pixelStorei(Ot.UNPACK_SKIP_ROWS,f),Ot.pixelStorei(Ot.UNPACK_SKIP_IMAGES,p),0===i&&r.generateMipmaps&&Ot.generateMipmap(c),lt.unbindTexture()},this.initTexture=function(t){t.isCubeTexture?ht.setTextureCube(t,0):t.isData3DTexture?ht.setTexture3D(t,0):t.isDataArrayTexture||t.isCompressedArrayTexture?ht.setTexture2DArray(t,0):ht.setTexture2D(t,0),lt.unbindTexture()},this.resetState=function(){w=0,E=0,S=null,lt.reset(),Pt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return pt}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(t){this._outputColorSpace=t;const e=this.getContext();e.drawingBufferColorSpace=t===at?"display-p3":"srgb",e.unpackColorSpace=Ht.workingColorSpace===ot?"display-p3":"srgb"}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===rt?et:3e3}set outputEncoding(t){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=t===et?rt:it}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(t){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=t}}(class extends fo{}).prototype.isWebGL1Renderer=!0;class po{constructor(t,e){this.isInterleavedBuffer=!0,this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=ht,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=bt()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}get updateRange(){return Bt("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,n){t*=this.stride,n*=e.stride;for(let r=0,i=this.stride;r<i;r++)this.array[t+r]=e.array[n+r];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=bt()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(e,this.stride);return n.setUsage(this.usage),n}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=bt()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const mo=new ae;class go{constructor(t,e,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,n=this.data.count;e<n;e++)mo.fromBufferAttribute(this,e),mo.applyMatrix4(t),this.setXYZ(e,mo.x,mo.y,mo.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)mo.fromBufferAttribute(this,e),mo.applyNormalMatrix(t),this.setXYZ(e,mo.x,mo.y,mo.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)mo.fromBufferAttribute(this,e),mo.transformDirection(t),this.setXYZ(e,mo.x,mo.y,mo.z);return this}getComponent(t,e){let n=this.array[t*this.data.stride+this.offset+e];return this.normalized&&(n=Ct(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Rt(n,this.array)),this.data.array[t*this.data.stride+this.offset+e]=n,this}setX(t,e){return this.normalized&&(e=Rt(e,this.array)),this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.normalized&&(e=Rt(e,this.array)),this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.normalized&&(e=Rt(e,this.array)),this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.normalized&&(e=Rt(e,this.array)),this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){let e=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(e=Ct(e,this.array)),e}getY(t){let e=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(e=Ct(e,this.array)),e}getZ(t){let e=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(e=Ct(e,this.array)),e}getW(t){let e=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(e=Ct(e,this.array)),e}setXY(t,e,n){return t=t*this.data.stride+this.offset,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this}setXYZ(t,e,n,r){return t=t*this.data.stride+this.offset,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array),r=Rt(r,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this}setXYZW(t,e,n,r,i){return t=t*this.data.stride+this.offset,this.normalized&&(e=Rt(e,this.array),n=Rt(n,this.array),r=Rt(r,this.array),i=Rt(i,this.array)),this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=r,this.data.array[t+3]=i,this}clone(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return new Pn(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new go(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class vo extends Pn{constructor(t,e,n,r=1){super(t,e,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}class _o extends Sn{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Mn(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}const yo=new ae,xo=new ae,bo=new qe,Mo=new Ie,wo=new Se;class Eo extends sn{constructor(t=new zn,e=new _o){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,n=[0];for(let t=1,r=e.count;t<r;t++)yo.fromBufferAttribute(e,t-1),xo.fromBufferAttribute(e,t),n[t]=n[t-1],n[t]+=yo.distanceTo(xo);t.setAttribute("lineDistance",new On(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,e){const n=this.geometry,r=this.matrixWorld,i=t.params.Line.threshold,a=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),wo.copy(n.boundingSphere),wo.applyMatrix4(r),wo.radius+=i,!1===t.ray.intersectsSphere(wo))return;bo.copy(r).invert(),Mo.copy(t.ray).applyMatrix4(bo);const o=i/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,A=new ae,l=new ae,c=new ae,u=new ae,h=this.isLineSegments?2:1,d=n.index,f=n.attributes.position;if(null!==d){for(let n=Math.max(0,a.start),r=Math.min(d.count,a.start+a.count)-1;n<r;n+=h){const r=d.getX(n),i=d.getX(n+1);A.fromBufferAttribute(f,r),l.fromBufferAttribute(f,i);if(Mo.distanceSqToSegment(A,l,u,c)>s)continue;u.applyMatrix4(this.matrixWorld);const a=t.ray.origin.distanceTo(u);a<t.near||a>t.far||e.push({distance:a,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,a.start),r=Math.min(f.count,a.start+a.count)-1;n<r;n+=h){A.fromBufferAttribute(f,n),l.fromBufferAttribute(f,n+1);if(Mo.distanceSqToSegment(A,l,u,c)>s)continue;u.applyMatrix4(this.matrixWorld);const r=t.ray.origin.distanceTo(u);r<t.near||r>t.far||e.push({distance:r,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,e=Object.keys(t);if(e.length>0){const n=t[e[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,e=n.length;t<e;t++){const e=n[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[e]=t}}}}}const So=new ae,To=new ae;class Co extends Eo{constructor(t,e){super(t,e),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(null===t.index){const e=t.attributes.position,n=[];for(let t=0,r=e.count;t<r;t+=2)So.fromBufferAttribute(e,t),To.fromBufferAttribute(e,t+1),n[t]=0===t?0:n[t-1],n[t+1]=n[t]+So.distanceTo(To);t.setAttribute("lineDistance",new On(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Ro{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)}getPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e}getSpacedPoints(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,r=this.getPoint(0),i=0;e.push(0);for(let a=1;a<=t;a++)n=this.getPoint(a/t),i+=n.distanceTo(r),e.push(i),r=n;return this.cacheArcLengths=e,e}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,e){const n=this.getLengths();let r=0;const i=n.length;let a;a=e||t*n[i-1];let o,s=0,A=i-1;for(;s<=A;)if(r=Math.floor(s+(A-s)/2),o=n[r]-a,o<0)s=r+1;else{if(!(o>0)){A=r;break}A=r-1}if(r=A,n[r]===a)return r/(i-1);const l=n[r];return(r+(a-l)/(n[r+1]-l))/(i-1)}getTangent(t,e){const n=1e-4;let r=t-n,i=t+n;r<0&&(r=0),i>1&&(i=1);const a=this.getPoint(r),o=this.getPoint(i),s=e||(a.isVector2?new Lt:new ae);return s.copy(o).sub(a).normalize(),s}getTangentAt(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)}computeFrenetFrames(t,e){const n=new ae,r=[],i=[],a=[],o=new ae,s=new qe;for(let e=0;e<=t;e++){const n=e/t;r[e]=this.getTangentAt(n,new ae)}i[0]=new ae,a[0]=new ae;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),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(let e=1;e<=t;e++){if(i[e]=i[e-1].clone(),a[e]=a[e-1].clone(),o.crossVectors(r[e-1],r[e]),o.length()>Number.EPSILON){o.normalize();const t=Math.acos(Mt(r[e-1].dot(r[e]),-1,1));i[e].applyMatrix4(s.makeRotationAxis(o,t))}a[e].crossVectors(r[e],i[e])}if(!0===e){let e=Math.acos(Mt(i[0].dot(i[t]),-1,1));e/=t,r[0].dot(o.crossVectors(i[0],i[t]))>0&&(e=-e);for(let n=1;n<=t;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],e*n)),a[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:a}}clone(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class Po extends Ro{constructor(t=0,e=0,n=1,r=1,i=0,a=2*Math.PI,o=!1,s=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s}getPoint(t,e){const n=e||new Lt,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const a=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=a?0:r),!0!==this.aClockwise||a||(i===r?i=-r:i-=r);const o=this.aStartAngle+t*i;let s=this.aX+this.xRadius*Math.cos(o),A=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){const t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),n=s-this.aX,r=A-this.aY;s=n*t-r*e+this.aX,A=n*e+r*t+this.aY}return n.set(s,A)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}function Lo(){let t=0,e=0,n=0,r=0;function i(i,a,o,s){t=i,e=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(t,e,n,r,a){i(e,n,a*(n-t),a*(r-e))},initNonuniformCatmullRom:function(t,e,n,r,a,o,s){let A=(e-t)/a-(n-t)/(a+o)+(n-e)/o,l=(n-e)/o-(r-e)/(o+s)+(r-n)/s;A*=o,l*=o,i(e,n,A,l)},calc:function(i){const a=i*i;return t+e*i+n*a+r*(a*i)}}}const Do=new ae,Oo=new Lo,Io=new Lo,qo=new Lo;function Uo(t,e,n,r,i){const a=.5*(r-e),o=.5*(i-n),s=t*t;return(2*n-2*r+a+o)*(t*s)+(-3*n+3*r-2*a-o)*s+a*t+n}function No(t,e,n,r){return function(t,e){const n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,r)}function Bo(t,e,n,r,i){return function(t,e){const n=1-t;return n*n*n*e}(t,e)+function(t,e){const n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,r)+function(t,e){return t*t*t*e}(t,i)}class ko extends Ro{constructor(t=new Lt,e=new Lt,n=new Lt,r=new Lt){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=n,this.v3=r}getPoint(t,e=new Lt){const n=e,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Bo(t,r.x,i.x,a.x,o.x),Bo(t,r.y,i.y,a.y,o.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class Fo extends Ro{constructor(t=new ae,e=new ae,n=new ae,r=new ae){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=n,this.v3=r}getPoint(t,e=new ae){const n=e,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(Bo(t,r.x,i.x,a.x,o.x),Bo(t,r.y,i.y,a.y,o.y),Bo(t,r.z,i.z,a.z,o.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}class zo extends Ro{constructor(t=new Lt,e=new Lt){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new Lt){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new Lt){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Go extends Ro{constructor(t=new Lt,e=new Lt,n=new Lt){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new Lt){const n=e,r=this.v0,i=this.v1,a=this.v2;return n.set(No(t,r.x,i.x,a.x),No(t,r.y,i.y,a.y)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Ho extends Ro{constructor(t=new ae,e=new ae,n=new ae){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=n}getPoint(t,e=new ae){const n=e,r=this.v0,i=this.v1,a=this.v2;return n.set(No(t,r.x,i.x,a.x),No(t,r.y,i.y,a.y),No(t,r.z,i.z,a.z)),n}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class jo extends Ro{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,e=new Lt){const n=e,r=this.points,i=(r.length-1)*t,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],A=r[a],l=r[a>r.length-2?r.length-1:a+1],c=r[a>r.length-3?r.length-1:a+2];return n.set(Uo(o,s.x,A.x,l.x,c.x),Uo(o,s.y,A.y,l.y,c.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new Lt).fromArray(n))}return this}}var Vo=Object.freeze({__proto__:null,ArcCurve:class extends Po{constructor(t,e,n,r,i,a){super(t,e,n,n,r,i,a),this.isArcCurve=!0,this.type="ArcCurve"}},CatmullRomCurve3:class extends Ro{constructor(t=[],e=!1,n="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=n,this.tension=r}getPoint(t,e=new ae){const n=e,r=this.points,i=r.length,a=(i-(this.closed?0:1))*t;let o,s,A=Math.floor(a),l=a-A;this.closed?A+=A>0?0:(Math.floor(Math.abs(A)/i)+1)*i:0===l&&A===i-1&&(A=i-2,l=1),this.closed||A>0?o=r[(A-1)%i]:(Do.subVectors(r[0],r[1]).add(r[0]),o=Do);const c=r[A%i],u=r[(A+1)%i];if(this.closed||A+2<i?s=r[(A+2)%i]:(Do.subVectors(r[i-1],r[i-2]).add(r[i-1]),s=Do),"centripetal"===this.curveType||"chordal"===this.curveType){const t="chordal"===this.curveType?.5:.25;let e=Math.pow(o.distanceToSquared(c),t),n=Math.pow(c.distanceToSquared(u),t),r=Math.pow(u.distanceToSquared(s),t);n<1e-4&&(n=1),e<1e-4&&(e=n),r<1e-4&&(r=n),Oo.initNonuniformCatmullRom(o.x,c.x,u.x,s.x,e,n,r),Io.initNonuniformCatmullRom(o.y,c.y,u.y,s.y,e,n,r),qo.initNonuniformCatmullRom(o.z,c.z,u.z,s.z,e,n,r)}else"catmullrom"===this.curveType&&(Oo.initCatmullRom(o.x,c.x,u.x,s.x,this.tension),Io.initCatmullRom(o.y,c.y,u.y,s.y,this.tension),qo.initCatmullRom(o.z,c.z,u.z,s.z,this.tension));return n.set(Oo.calc(l),Io.calc(l),qo.calc(l)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new ae).fromArray(n))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}},CubicBezierCurve:ko,CubicBezierCurve3:Fo,EllipseCurve:Po,LineCurve:zo,LineCurve3:class extends Ro{constructor(t=new ae,e=new ae){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=e}getPoint(t,e=new ae){const n=e;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e=new ae){return e.subVectors(this.v2,this.v1).normalize()}getTangentAt(t,e){return this.getTangent(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},QuadraticBezierCurve:Go,QuadraticBezierCurve3:Ho,SplineCurve:jo});class Wo extends Ro{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);if(!t.equals(e)){const n=!0===t.isVector2?"LineCurve":"LineCurve3";this.curves.push(new Vo[n](e,t))}return this}getPoint(t,e){const n=t*this.getLength(),r=this.getCurveLengths();let i=0;for(;i<r.length;){if(r[i]>=n){const t=r[i]-n,a=this.curves[i],o=a.getLength(),s=0===o?0:1-t/o;return a.getPointAt(s,e)}i++}return null}getLength(){const t=this.getCurveLengths();return t[t.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 t=[];let e=0;for(let n=0,r=this.curves.length;n<r;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let n;for(let r=0,i=this.curves;r<i.length;r++){const a=i[r],o=a.isEllipseCurve?2*t:a.isLineCurve||a.isLineCurve3?1:a.isSplineCurve?t*a.points.length:t,s=a.getPoints(o);for(let t=0;t<s.length;t++){const r=s[t];n&&n.equals(r)||(e.push(r),n=r)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push(n.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,n=this.curves.length;e<n;e++){const n=this.curves[e];t.curves.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push((new Vo[n.type]).fromJSON(n))}return this}}let Xo=class extends Wo{constructor(t){super(),this.type="Path",this.currentPoint=new Lt,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const n=new zo(this.currentPoint.clone(),new Lt(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,n,r){const i=new Go(this.currentPoint.clone(),new Lt(t,e),new Lt(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}bezierCurveTo(t,e,n,r,i,a){const o=new ko(this.currentPoint.clone(),new Lt(t,e),new Lt(n,r),new Lt(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),n=new jo(e);return this.curves.push(n),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,n,r,i,a){const o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(t+o,e+s,n,r,i,a),this}absarc(t,e,n,r,i,a){return this.absellipse(t,e,n,n,r,i,a),this}ellipse(t,e,n,r,i,a,o,s){const A=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(t+A,e+l,n,r,i,a,o,s),this}absellipse(t,e,n,r,i,a,o,s){const A=new Po(t,e,n,r,i,a,o,s);if(this.curves.length>0){const t=A.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(A);const l=A.getPoint(1);return this.currentPoint.copy(l),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}};class Qo extends zn{constructor(t=1,e=32,n=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},e=Math.max(3,e);const i=[],a=[],o=[],s=[],A=new ae,l=new Lt;a.push(0,0,0),o.push(0,0,1),s.push(.5,.5);for(let i=0,c=3;i<=e;i++,c+=3){const u=n+i/e*r;A.x=t*Math.cos(u),A.y=t*Math.sin(u),a.push(A.x,A.y,A.z),o.push(0,0,1),l.x=(a[c]/t+1)/2,l.y=(a[c+1]/t+1)/2,s.push(l.x,l.y)}for(let t=1;t<=e;t++)i.push(t,t+1,0);this.setIndex(i),this.setAttribute("position",new On(a,3)),this.setAttribute("normal",new On(o,3)),this.setAttribute("uv",new On(s,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Qo(t.radius,t.segments,t.thetaStart,t.thetaLength)}}class Yo extends zn{constructor(t=1,e=1,n=1,r=32,i=1,a=!1,o=0,s=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:r,heightSegments:i,openEnded:a,thetaStart:o,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,a=new Lt,f=new ae;let g=0;const v=!0===n?t:e,_=!0===n?1:-1;for(let t=1;t<=r;t++)c.push(0,p*_,0),u.push(0,_,0),h.push(.5,.5),d++;const y=d;for(let t=0;t<=r;t++){const e=t/r*s+o,n=Math.cos(e),i=Math.sin(e);f.x=v*i,f.y=p*_,f.z=v*n,c.push(f.x,f.y,f.z),u.push(0,_,0),a.x=.5*n+.5,a.y=.5*i*_+.5,h.push(a.x,a.y),d++}for(let t=0;t<r;t++){const e=i+t,r=y+t;!0===n?l.push(r,r+1,e):l.push(r+1,r,e),g+=3}A.addGroup(m,g,!0===n?1:2),m+=g}!function(){const a=new ae,g=new ae;let v=0;const _=(e-t)/n;for(let A=0;A<=i;A++){const l=[],m=A/i,v=m*(e-t)+t;for(let t=0;t<=r;t++){const e=t/r,i=e*s+o,A=Math.sin(i),f=Math.cos(i);g.x=v*A,g.y=-m*n+p,g.z=v*f,c.push(g.x,g.y,g.z),a.set(A,_,f).normalize(),u.push(a.x,a.y,a.z),h.push(e,1-m),l.push(d++)}f.push(l)}for(let t=0;t<r;t++)for(let e=0;e<i;e++){const n=f[e][t],r=f[e+1][t],i=f[e+1][t+1],a=f[e][t+1];l.push(n,r,a),l.push(r,i,a),v+=6}A.addGroup(m,v,0),m+=v}(),!1===a&&(t>0&&g(!0),e>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))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Yo(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Zo extends Xo{constructor(t){super(t),this.uuid=bt(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let n=0,r=this.holes.length;n<r;n++)e[n]=this.holes[n].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push(n.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,n=this.holes.length;e<n;e++){const n=this.holes[e];t.holes.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push((new Xo).fromJSON(n))}return this}}const Ko=function(t,e,n=2){const r=e&&e.length,i=r?e[0]*n:t.length;let a=Jo(t,0,i,n,!0);const o=[];if(!a||a.next===a.prev)return o;let s,A,l,c,u,h,d;if(r&&(a=function(t,e,n,r){const i=[];let a,o,s,A,l;for(a=0,o=e.length;a<o;a++)s=e[a]*r,A=a<o-1?e[a+1]*r:t.length,l=Jo(t,s,A,r,!1),l===l.next&&(l.steiner=!0),i.push(ls(l));for(i.sort(as),a=0;a<i.length;a++)n=os(i[a],n);return n}(t,e,a,n)),t.length>80*n){s=l=t[0],A=c=t[1];for(let e=n;e<i;e+=n)u=t[e],h=t[e+1],u<s&&(s=u),h<A&&(A=h),u>l&&(l=u),h>c&&(c=h);d=Math.max(l-s,c-A),d=0!==d?32767/d:0}return ts(a,o,n,s,A,d,0),o};function Jo(t,e,n,r,i){let a,o;if(i===function(t,e,n,r){let i=0;for(let a=e,o=n-r;a<n;a+=r)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}(t,e,n,r)>0)for(a=e;a<n;a+=r)o=_s(a,t[a],t[a+1],o);else for(a=n-r;a>=e;a-=r)o=_s(a,t[a],t[a+1],o);return o&&ds(o,o.next)&&(ys(o),o=o.next),o}function $o(t,e){if(!t)return t;e||(e=t);let n,r=t;do{if(n=!1,r.steiner||!ds(r,r.next)&&0!==hs(r.prev,r,r.next))r=r.next;else{if(ys(r),r=e=r.prev,r===r.next)break;n=!0}}while(n||r!==e);return e}function ts(t,e,n,r,i,a,o){if(!t)return;!o&&a&&function(t,e,n,r){let i=t;do{0===i.z&&(i.z=As(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){let e,n,r,i,a,o,s,A,l=1;do{for(n=t,t=null,a=null,o=0;n;){for(o++,r=n,s=0,e=0;e<l&&(s++,r=r.nextZ,r);e++);for(A=l;s>0||A>0&&r;)0!==s&&(0===A||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,A--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1)}(i)}(t,r,i,a);let s,A,l=t;for(;t.prev!==t.next;)if(s=t.prev,A=t.next,a?ns(t,r,i,a):es(t))e.push(s.i/n|0),e.push(t.i/n|0),e.push(A.i/n|0),ys(t),t=A.next,l=A.next;else if((t=A)===l){o?1===o?ts(t=rs($o(t),e,n),e,n,r,i,a,2):2===o&&is(t,e,n,r,i,a):ts($o(t),e,n,r,i,a,1);break}}function es(t){const e=t.prev,n=t,r=t.next;if(hs(e,n,r)>=0)return!1;const i=e.x,a=n.x,o=r.x,s=e.y,A=n.y,l=r.y,c=i<a?i<o?i:o:a<o?a:o,u=s<A?s<l?s:l:A<l?A:l,h=i>a?i>o?i:o:a>o?a:o,d=s>A?s>l?s:l:A>l?A:l;let f=r.next;for(;f!==e;){if(f.x>=c&&f.x<=h&&f.y>=u&&f.y<=d&&cs(i,s,a,A,o,l,f.x,f.y)&&hs(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function ns(t,e,n,r){const i=t.prev,a=t,o=t.next;if(hs(i,a,o)>=0)return!1;const s=i.x,A=a.x,l=o.x,c=i.y,u=a.y,h=o.y,d=s<A?s<l?s:l:A<l?A:l,f=c<u?c<h?c:h:u<h?u:h,p=s>A?s>l?s:l:A>l?A:l,m=c>u?c>h?c:h:u>h?u:h,g=As(d,f,e,n,r),v=As(p,m,e,n,r);let _=t.prevZ,y=t.nextZ;for(;_&&_.z>=g&&y&&y.z<=v;){if(_.x>=d&&_.x<=p&&_.y>=f&&_.y<=m&&_!==i&&_!==o&&cs(s,c,A,u,l,h,_.x,_.y)&&hs(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,y.x>=d&&y.x<=p&&y.y>=f&&y.y<=m&&y!==i&&y!==o&&cs(s,c,A,u,l,h,y.x,y.y)&&hs(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;_&&_.z>=g;){if(_.x>=d&&_.x<=p&&_.y>=f&&_.y<=m&&_!==i&&_!==o&&cs(s,c,A,u,l,h,_.x,_.y)&&hs(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;y&&y.z<=v;){if(y.x>=d&&y.x<=p&&y.y>=f&&y.y<=m&&y!==i&&y!==o&&cs(s,c,A,u,l,h,y.x,y.y)&&hs(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function rs(t,e,n){let r=t;do{const i=r.prev,a=r.next.next;!ds(i,a)&&fs(i,r,r.next,a)&&gs(i,a)&&gs(a,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(a.i/n|0),ys(r),ys(r.next),r=t=a),r=r.next}while(r!==t);return $o(r)}function is(t,e,n,r,i,a){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&us(o,t)){let s=vs(o,t);return o=$o(o,o.next),s=$o(s,s.next),ts(o,e,n,r,i,a,0),void ts(s,e,n,r,i,a,0)}t=t.next}o=o.next}while(o!==t)}function as(t,e){return t.x-e.x}function os(t,e){const n=function(t,e){let n,r=e,i=-1/0;const a=t.x,o=t.y;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){const t=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(t<=a&&t>i&&(i=t,n=r.x<r.next.x?r:r.next,t===a))return n}r=r.next}while(r!==e);if(!n)return null;const s=n,A=n.x,l=n.y;let c,u=1/0;r=n;do{a>=r.x&&r.x>=A&&a!==r.x&&cs(o<l?a:i,o,A,l,o<l?i:a,o,r.x,r.y)&&(c=Math.abs(o-r.y)/(a-r.x),gs(r,t)&&(c<u||c===u&&(r.x>n.x||r.x===n.x&&ss(n,r)))&&(n=r,u=c)),r=r.next}while(r!==s);return n}(t,e);if(!n)return e;const r=vs(n,t);return $o(r,r.next),$o(n,n.next)}function ss(t,e){return hs(t.prev,t,e.prev)<0&&hs(e.next,t,t.next)<0}function As(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ls(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function cs(t,e,n,r,i,a,o,s){return(i-o)*(e-s)>=(t-o)*(a-s)&&(t-o)*(r-s)>=(n-o)*(e-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function us(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&fs(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(gs(t,e)&&gs(e,t)&&function(t,e){let n=t,r=!1;const i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(hs(t.prev,t,e.prev)||hs(t,e.prev,e))||ds(t,e)&&hs(t.prev,t,t.next)>0&&hs(e.prev,e,e.next)>0)}function hs(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function ds(t,e){return t.x===e.x&&t.y===e.y}function fs(t,e,n,r){const i=ms(hs(t,e,n)),a=ms(hs(t,e,r)),o=ms(hs(n,r,t)),s=ms(hs(n,r,e));return i!==a&&o!==s||(!(0!==i||!ps(t,n,e))||(!(0!==a||!ps(t,r,e))||(!(0!==o||!ps(n,t,r))||!(0!==s||!ps(n,e,r)))))}function ps(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function ms(t){return t>0?1:t<0?-1:0}function gs(t,e){return hs(t.prev,t,t.next)<0?hs(t,e,t.next)>=0&&hs(t,t.prev,e)>=0:hs(t,e,t.prev)<0||hs(t,t.next,e)<0}function vs(t,e){const n=new xs(t.i,t.x,t.y),r=new xs(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function _s(t,e,n,r){const i=new xs(t,e,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 ys(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function xs(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}class bs{static area(t){const e=t.length;let n=0;for(let r=e-1,i=0;i<e;r=i++)n+=t[r].x*t[i].y-t[i].x*t[r].y;return.5*n}static isClockWise(t){return bs.area(t)<0}static triangulateShape(t,e){const n=[],r=[],i=[];Ms(t),ws(n,t);let a=t.length;e.forEach(Ms);for(let t=0;t<e.length;t++)r.push(a),a+=e[t].length,ws(n,e[t]);const o=Ko(n,r);for(let t=0;t<o.length;t+=3)i.push(o.slice(t,t+3));return i}}function Ms(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function ws(t,e){for(let n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}class Es extends zn{constructor(t=new Zo([new Lt(.5,.5),new Lt(-.5,.5),new Lt(-.5,-.5),new Lt(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const n=this,r=[],i=[];for(let e=0,n=t.length;e<n;e++){a(t[e])}function a(t){const a=[],o=void 0!==e.curveSegments?e.curveSegments:12,s=void 0!==e.steps?e.steps:1,A=void 0!==e.depth?e.depth:1;let l=void 0===e.bevelEnabled||e.bevelEnabled,c=void 0!==e.bevelThickness?e.bevelThickness:.2,u=void 0!==e.bevelSize?e.bevelSize:c-.1,h=void 0!==e.bevelOffset?e.bevelOffset:0,d=void 0!==e.bevelSegments?e.bevelSegments:3;const f=e.extrudePath,p=void 0!==e.UVGenerator?e.UVGenerator:Ss;let m,g,v,_,y,x=!1;f&&(m=f.getSpacedPoints(s),x=!0,l=!1,g=f.computeFrenetFrames(s,!1),v=new ae,_=new ae,y=new ae),l||(d=0,c=0,u=0,h=0);const b=t.extractPoints(o);let M=b.shape;const w=b.holes;if(!bs.isClockWise(M)){M=M.reverse();for(let t=0,e=w.length;t<e;t++){const e=w[t];bs.isClockWise(e)&&(w[t]=e.reverse())}}const E=bs.triangulateShape(M,w),S=M;for(let t=0,e=w.length;t<e;t++){const e=w[t];M=M.concat(e)}function T(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().addScaledVector(e,n)}const C=M.length,R=E.length;function P(t,e,n){let r,i,a;const o=t.x-e.x,s=t.y-e.y,A=n.x-t.x,l=n.y-t.y,c=o*o+s*s,u=o*l-s*A;if(Math.abs(u)>Number.EPSILON){const u=Math.sqrt(c),h=Math.sqrt(A*A+l*l),d=e.x-s/u,f=e.y+o/u,p=((n.x-l/h-d)*l-(n.y+A/h-f)*A)/(o*l-s*A);r=d+o*p-t.x,i=f+s*p-t.y;const m=r*r+i*i;if(m<=2)return new Lt(r,i);a=Math.sqrt(m/2)}else{let t=!1;o>Number.EPSILON?A>Number.EPSILON&&(t=!0):o<-Number.EPSILON?A<-Number.EPSILON&&(t=!0):Math.sign(s)===Math.sign(l)&&(t=!0),t?(r=-s,i=o,a=Math.sqrt(c)):(r=o,i=s,a=Math.sqrt(c/2))}return new Lt(r/a,i/a)}const L=[];for(let t=0,e=S.length,n=e-1,r=t+1;t<e;t++,n++,r++)n===e&&(n=0),r===e&&(r=0),L[t]=P(S[t],S[n],S[r]);const D=[];let O,I=L.concat();for(let t=0,e=w.length;t<e;t++){const e=w[t];O=[];for(let t=0,n=e.length,r=n-1,i=t+1;t<n;t++,r++,i++)r===n&&(r=0),i===n&&(i=0),O[t]=P(e[t],e[r],e[i]);D.push(O),I=I.concat(O)}for(let t=0;t<d;t++){const e=t/d,n=c*Math.cos(e*Math.PI/2),r=u*Math.sin(e*Math.PI/2)+h;for(let t=0,e=S.length;t<e;t++){const e=T(S[t],L[t],r);N(e.x,e.y,-n)}for(let t=0,e=w.length;t<e;t++){const e=w[t];O=D[t];for(let t=0,i=e.length;t<i;t++){const i=T(e[t],O[t],r);N(i.x,i.y,-n)}}}const q=u+h;for(let t=0;t<C;t++){const e=l?T(M[t],I[t],q):M[t];x?(_.copy(g.normals[0]).multiplyScalar(e.x),v.copy(g.binormals[0]).multiplyScalar(e.y),y.copy(m[0]).add(_).add(v),N(y.x,y.y,y.z)):N(e.x,e.y,0)}for(let t=1;t<=s;t++)for(let e=0;e<C;e++){const n=l?T(M[e],I[e],q):M[e];x?(_.copy(g.normals[t]).multiplyScalar(n.x),v.copy(g.binormals[t]).multiplyScalar(n.y),y.copy(m[t]).add(_).add(v),N(y.x,y.y,y.z)):N(n.x,n.y,A/s*t)}for(let t=d-1;t>=0;t--){const e=t/d,n=c*Math.cos(e*Math.PI/2),r=u*Math.sin(e*Math.PI/2)+h;for(let t=0,e=S.length;t<e;t++){const e=T(S[t],L[t],r);N(e.x,e.y,A+n)}for(let t=0,e=w.length;t<e;t++){const e=w[t];O=D[t];for(let t=0,i=e.length;t<i;t++){const i=T(e[t],O[t],r);x?N(i.x,i.y+m[s-1].y,m[s-1].x+n):N(i.x,i.y,A+n)}}}function U(t,e){let n=t.length;for(;--n>=0;){const r=n;let i=n-1;i<0&&(i=t.length-1);for(let t=0,n=s+2*d;t<n;t++){const n=C*t,a=C*(t+1);k(e+r+n,e+i+n,e+i+a,e+r+a)}}}function N(t,e,n){a.push(t),a.push(e),a.push(n)}function B(t,e,i){F(t),F(e),F(i);const a=r.length/3,o=p.generateTopUV(n,r,a-3,a-2,a-1);z(o[0]),z(o[1]),z(o[2])}function k(t,e,i,a){F(t),F(e),F(a),F(e),F(i),F(a);const o=r.length/3,s=p.generateSideWallUV(n,r,o-6,o-3,o-2,o-1);z(s[0]),z(s[1]),z(s[3]),z(s[1]),z(s[2]),z(s[3])}function F(t){r.push(a[3*t+0]),r.push(a[3*t+1]),r.push(a[3*t+2])}function z(t){i.push(t.x),i.push(t.y)}!function(){const t=r.length/3;if(l){let t=0,e=C*t;for(let t=0;t<R;t++){const n=E[t];B(n[2]+e,n[1]+e,n[0]+e)}t=s+2*d,e=C*t;for(let t=0;t<R;t++){const n=E[t];B(n[0]+e,n[1]+e,n[2]+e)}}else{for(let t=0;t<R;t++){const e=E[t];B(e[2],e[1],e[0])}for(let t=0;t<R;t++){const e=E[t];B(e[0]+C*s,e[1]+C*s,e[2]+C*s)}}n.addGroup(t,r.length/3-t,0)}(),function(){const t=r.length/3;let e=0;U(S,e),e+=S.length;for(let t=0,n=w.length;t<n;t++){const n=w[t];U(n,e),e+=n.length}n.addGroup(t,r.length/3-t,1)}()}this.setAttribute("position",new On(r,3)),this.setAttribute("uv",new On(i,2)),this.computeVertexNormals()}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return function(t,e,n){if(n.shapes=[],Array.isArray(t))for(let e=0,r=t.length;e<r;e++){const r=t[e];n.shapes.push(r.uuid)}else n.shapes.push(t.uuid);n.options=Object.assign({},e),void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON());return n}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){const n=[];for(let r=0,i=t.shapes.length;r<i;r++){const i=e[t.shapes[r]];n.push(i)}const r=t.options.extrudePath;return void 0!==r&&(t.options.extrudePath=(new Vo[r.type]).fromJSON(r)),new Es(n,t.options)}}const Ss={generateTopUV:function(t,e,n,r,i){const a=e[3*n],o=e[3*n+1],s=e[3*r],A=e[3*r+1],l=e[3*i],c=e[3*i+1];return[new Lt(a,o),new Lt(s,A),new Lt(l,c)]},generateSideWallUV:function(t,e,n,r,i,a){const o=e[3*n],s=e[3*n+1],A=e[3*n+2],l=e[3*r],c=e[3*r+1],u=e[3*r+2],h=e[3*i],d=e[3*i+1],f=e[3*i+2],p=e[3*a],m=e[3*a+1],g=e[3*a+2];return Math.abs(s-c)<Math.abs(o-l)?[new Lt(o,1-A),new Lt(l,1-u),new Lt(h,1-f),new Lt(p,1-g)]:[new Lt(s,1-A),new Lt(c,1-u),new Lt(d,1-f),new Lt(m,1-g)]}};class Ts extends zn{constructor(t=1,e=32,n=16,r=0,i=2*Math.PI,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:a,thetaLength:o},e=Math.max(3,Math.floor(e)),n=Math.max(2,Math.floor(n));const s=Math.min(a+o,Math.PI);let A=0;const l=[],c=new ae,u=new ae,h=[],d=[],f=[],p=[];for(let h=0;h<=n;h++){const m=[],g=h/n;let v=0;0===h&&0===a?v=.5/e:h===n&&s===Math.PI&&(v=-.5/e);for(let n=0;n<=e;n++){const s=n/e;c.x=-t*Math.cos(r+s*i)*Math.sin(a+g*o),c.y=t*Math.cos(a+g*o),c.z=t*Math.sin(r+s*i)*Math.sin(a+g*o),d.push(c.x,c.y,c.z),u.copy(c).normalize(),f.push(u.x,u.y,u.z),p.push(s+v,1-g),m.push(A++)}l.push(m)}for(let t=0;t<n;t++)for(let r=0;r<e;r++){const e=l[t][r+1],i=l[t][r],o=l[t+1][r],A=l[t+1][r+1];(0!==t||a>0)&&h.push(e,i,A),(t!==n-1||s<Math.PI)&&h.push(i,o,A)}this.setIndex(h),this.setAttribute("position",new On(d,3)),this.setAttribute("normal",new On(f,3)),this.setAttribute("uv",new On(p,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new Ts(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class Cs extends zn{constructor(t=new Ho(new ae(-1,-1,0),new ae(-1,1,0),new ae(1,1,0)),e=64,n=1,r=8,i=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:r,closed:i};const a=t.computeFrenetFrames(e,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const o=new ae,s=new ae,A=new Lt;let l=new ae;const c=[],u=[],h=[],d=[];function f(i){l=t.getPointAt(i/e,l);const A=a.normals[i],h=a.binormals[i];for(let t=0;t<=r;t++){const e=t/r*Math.PI*2,i=Math.sin(e),a=-Math.cos(e);s.x=a*A.x+i*h.x,s.y=a*A.y+i*h.y,s.z=a*A.z+i*h.z,s.normalize(),u.push(s.x,s.y,s.z),o.x=l.x+n*s.x,o.y=l.y+n*s.y,o.z=l.z+n*s.z,c.push(o.x,o.y,o.z)}}!function(){for(let t=0;t<e;t++)f(t);f(!1===i?e:0),function(){for(let t=0;t<=e;t++)for(let n=0;n<=r;n++)A.x=t/e,A.y=n/r,h.push(A.x,A.y)}(),function(){for(let t=1;t<=e;t++)for(let e=1;e<=r;e++){const n=(r+1)*(t-1)+(e-1),i=(r+1)*t+(e-1),a=(r+1)*t+e,o=(r+1)*(t-1)+e;d.push(n,i,o),d.push(i,a,o)}}()}(),this.setIndex(d),this.setAttribute("position",new On(c,3)),this.setAttribute("normal",new On(u,3)),this.setAttribute("uv",new On(h,2))}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}toJSON(){const t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new Cs((new Vo[t.path.type]).fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}function Rs(t,e,n){const r=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return!0!==n.has(r)&&!0!==n.has(i)&&(n.add(r),n.add(i),!0)}class Ps extends Sn{constructor(t){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Mn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Mn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=_,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}const Ls={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class Ds{constructor(t,e,n){const r=this;let i,a=!1,o=0,s=0;const A=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){s++,!1===a&&void 0!==r.onStart&&r.onStart(t,o,s),a=!0},this.itemEnd=function(t){o++,void 0!==r.onProgress&&r.onProgress(t,o,s),o===s&&(a=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(t){void 0!==r.onError&&r.onError(t)},this.resolveURL=function(t){return i?i(t):t},this.setURLModifier=function(t){return i=t,this},this.addHandler=function(t,e){return A.push(t,e),this},this.removeHandler=function(t){const e=A.indexOf(t);return-1!==e&&A.splice(e,2),this},this.getHandler=function(t){for(let e=0,n=A.length;e<n;e+=2){const n=A[e],r=A[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return r}return null}}}const Os=new Ds;class Is{constructor(t){this.manager=void 0!==t?t:Os,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const n=this;return new Promise((function(r,i){n.load(t,r,e,i)}))}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}Is.DEFAULT_MATERIAL_NAME="__DEFAULT";class qs extends Is{constructor(t){super(t)}load(t,e,n,r){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const i=this,a=Ls.get(t);if(void 0!==a)return i.manager.itemStart(t),setTimeout((function(){e&&e(a),i.manager.itemEnd(t)}),0),a;const o=qt("img");function s(){l(),Ls.add(t,this),e&&e(this),i.manager.itemEnd(t)}function A(e){l(),r&&r(e),i.manager.itemError(t),i.manager.itemEnd(t)}function l(){o.removeEventListener("load",s,!1),o.removeEventListener("error",A,!1)}return o.addEventListener("load",s,!1),o.addEventListener("error",A,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(t),o.src=t,o}}class Us extends Is{constructor(t){super(t)}load(t,e,n,r){const i=new Jt,a=new qs(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,(function(t){i.image=t,i.needsUpdate=!0,void 0!==e&&e(i)}),n,r),i}}class Ns extends sn{constructor(t,e=1){super(),this.isLight=!0,this.type="Light",this.color=new Mn(t),this.intensity=e}dispose(){}copy(t,e){return super.copy(t,e),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}const Bs=new qe,ks=new ae,Fs=new ae;class zs{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Lt(512,512),this.map=null,this.mapPass=null,this.matrix=new qe,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Cr,this._frameExtents=new Lt(1,1),this._viewportCount=1,this._viewports=[new $t(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,n=this.matrix;ks.setFromMatrixPosition(t.matrixWorld),e.position.copy(ks),Fs.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Fs),e.updateMatrixWorld(),Bs.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Bs),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Bs)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class Gs extends zs{constructor(){super(new Gr(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Hs{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=js(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=js();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function js(){return("undefined"==typeof performance?Date:performance).now()}class Vs extends po{constructor(t,e,n=1){super(t,e),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){const e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}function Ws(t,e){return t.distance-e.distance}function Xs(t,e,n,r){if(t.layers.test(e.layers)&&t.raycast(e,n),!0===r){const r=t.children;for(let t=0,i=r.length;t<i;t++)Xs(r[t],e,n,!0)}}class Qs{constructor(t=1,e=0,n=0){return this.radius=t,this.phi=e,this.theta=n,this}set(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){const t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(Mt(e/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}const Ys=new ae,Zs=new ae;class Ks{constructor(){this.type="ShapePath",this.color=new Mn,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new Xo,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,n,r){return this.currentPath.quadraticCurveTo(t,e,n,r),this}bezierCurveTo(t,e,n,r,i,a){return this.currentPath.bezierCurveTo(t,e,n,r,i,a),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t){function e(t,e){const n=e.length;let r=!1;for(let i=n-1,a=0;a<n;i=a++){let n=e[i],o=e[a],s=o.x-n.x,A=o.y-n.y;if(Math.abs(A)>Number.EPSILON){if(A<0&&(n=e[a],s=-s,o=e[i],A=-A),t.y<n.y||t.y>o.y)continue;if(t.y===n.y){if(t.x===n.x)return!0}else{const e=A*(t.x-n.x)-s*(t.y-n.y);if(0===e)return!0;if(e<0)continue;r=!r}}else{if(t.y!==n.y)continue;if(o.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=o.x)return!0}}return r}const n=bs.isClockWise,r=this.subPaths;if(0===r.length)return[];let i,a,o;const s=[];if(1===r.length)return a=r[0],o=new Zo,o.curves=a.curves,s.push(o),s;let A=!n(r[0].getPoints());A=t?!A:A;const l=[],c=[];let u,h,d=[],f=0;c[f]=void 0,d[f]=[];for(let e=0,o=r.length;e<o;e++)a=r[e],u=a.getPoints(),i=n(u),i=t?!i:i,i?(!A&&c[f]&&f++,c[f]={s:new Zo,p:u},c[f].s.curves=a.curves,A&&f++,d[f]=[]):d[f].push({h:a,p:u[0]});if(!c[0])return function(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n],i=new Zo;i.curves=r.curves,e.push(i)}return e}(r);if(c.length>1){let t=!1,n=0;for(let t=0,e=c.length;t<e;t++)l[t]=[];for(let r=0,i=c.length;r<i;r++){const i=d[r];for(let a=0;a<i.length;a++){const o=i[a];let s=!0;for(let i=0;i<c.length;i++)e(o.p,c[i].p)&&(r!==i&&n++,s?(s=!1,l[i].push(o)):t=!0);s&&l[r].push(o)}}n>0&&!1===t&&(d=l)}for(let t=0,e=c.length;t<e;t++){o=c[t].s,s.push(o),h=d[t];for(let t=0,e=h.length;t<e;t++)o.holes.push(h[t].h)}return s}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:s}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=s);const Js=new ae,$s=new qe,tA=new qe,eA=new ae,nA=new ae;function rA(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var iA="object"==typeof global&&global&&global.Object===Object&&global,aA="object"==typeof self&&self&&self.Object===Object&&self,oA=iA||aA||Function("return this")(),sA=function(){return oA.Date.now()},AA=/\s/;var lA=/^\s+/;function cA(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&AA.test(t.charAt(e)););return e}(t)+1).replace(lA,""):t}var uA=oA.Symbol,hA=Object.prototype,dA=hA.hasOwnProperty,fA=hA.toString,pA=uA?uA.toStringTag:void 0;var mA=Object.prototype.toString;var gA="[object Null]",vA="[object Undefined]",_A=uA?uA.toStringTag:void 0;function yA(t){return null==t?void 0===t?vA:gA:_A&&_A in Object(t)?function(t){var e=dA.call(t,pA),n=t[pA];try{t[pA]=void 0;var r=!0}catch(t){}var i=fA.call(t);return r&&(e?t[pA]=n:delete t[pA]),i}(t):function(t){return mA.call(t)}(t)}var xA="[object Symbol]";var bA=NaN,MA=/^[-+]0x[0-9a-f]+$/i,wA=/^0b[01]+$/i,EA=/^0o[0-7]+$/i,SA=parseInt;function TA(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&yA(t)==xA}(t))return bA;if(rA(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=rA(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=cA(t);var n=wA.test(t);return n||EA.test(t)?SA(t.slice(2),n?2:8):MA.test(t)?bA:+t}var CA="Expected a function",RA=Math.max,PA=Math.min;function LA(t,e,n){var r,i,a,o,s,A,l=0,c=!1,u=!1,h=!0;if("function"!=typeof t)throw new TypeError(CA);function d(e){var n=r,a=i;return r=i=void 0,l=e,o=t.apply(a,n)}function f(t){var n=t-A;return void 0===A||n>=e||n<0||u&&t-l>=a}function p(){var t=sA();if(f(t))return m(t);s=setTimeout(p,function(t){var n=e-(t-A);return u?PA(n,a-(t-l)):n}(t))}function m(t){return s=void 0,h&&r?d(t):(r=i=void 0,o)}function g(){var t=sA(),n=f(t);if(r=arguments,i=this,A=t,n){if(void 0===s)return function(t){return l=t,s=setTimeout(p,e),c?d(t):o}(A);if(u)return clearTimeout(s),s=setTimeout(p,e),d(A)}return void 0===s&&(s=setTimeout(p,e)),o}return e=TA(e)||0,rA(n)&&(c=!!n.leading,a=(u="maxWait"in n)?RA(TA(n.maxWait)||0,e):a,h="trailing"in n?!!n.trailing:h),g.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=A=i=s=void 0},g.flush=function(){return void 0===s?o:m(sA())},g}function DA(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(i=r.key,a=void 0,"symbol"==typeof(a=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(i,"string"))?a:String(a)),r)}var i,a}function OA(t,e,n){return e&&DA(t.prototype,e),n&&DA(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function IA(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return qA(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qA(t,e)}(t,e)||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 qA(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var UA=OA((function t(e,n){var r=n.default,i=void 0===r?null:r,a=n.triggerUpdate,o=void 0===a||a,s=n.onChange,A=void 0===s?function(t,e){}:s;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=e,this.defaultVal=i,this.triggerUpdate=o,this.onChange=A}));function NA(t){var e=t.stateInit,n=void 0===e?function(){return{}}:e,r=t.props,i=void 0===r?{}:r,a=t.methods,o=void 0===a?{}:a,s=t.aliases,A=void 0===s?{}:s,l=t.init,c=void 0===l?function(){}:l,u=t.update,h=void 0===u?function(){}:u,d=Object.keys(i).map((function(t){return new UA(t,i[t])}));return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},n instanceof Function?n(t):n,{initialised:!1}),r={};function i(e){return a(e,t),s(),i}var a=function(t,n){c.call(i,t,e,n),e.initialised=!0},s=LA((function(){e.initialised&&(h.call(i,e,r),r={})}),1);return d.forEach((function(t){i[t.name]=function(t){var n=t.name,a=t.triggerUpdate,o=void 0!==a&&a,A=t.onChange,l=void 0===A?function(t,e){}:A,c=t.defaultVal,u=void 0===c?null:c;return function(t){var a=e[n];if(!arguments.length)return a;var A=void 0===t?u:t;return e[n]=A,l.call(i,A,e,a),!r.hasOwnProperty(n)&&(r[n]=a),o&&s(),i}}(t)})),Object.keys(o).forEach((function(t){i[t]=function(){for(var n,r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return(n=o[t]).call.apply(n,[i,e].concat(a))}})),Object.entries(A).forEach((function(t){var e=IA(t,2),n=e[0],r=e[1];return i[n]=i[r]})),i.resetProps=function(){return d.forEach((function(t){i[t.name](t.defaultVal)})),i},i.resetProps(),e._rerender=s,i}}var BA,kA=Object.freeze({Linear:Object.freeze({None:function(t){return t},In:function(t){return this.None(t)},Out:function(t){return this.None(t)},InOut:function(t){return this.None(t)}}),Quadratic:Object.freeze({In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}}),Cubic:Object.freeze({In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}}),Quartic:Object.freeze({In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}}),Quintic:Object.freeze({In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}}),Sinusoidal:Object.freeze({In:function(t){return 1-Math.sin((1-t)*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.sin(Math.PI*(.5-t)))}}),Exponential:Object.freeze({In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}}),Circular:Object.freeze({In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}}),Elastic:Object.freeze({In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(t){var e=1.70158;return 1===t?1:t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return 0===t?0:--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}}),Bounce:Object.freeze({In:function(t){return 1-kA.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*kA.Bounce.In(2*t):.5*kA.Bounce.Out(2*t-1)+.5}}),generatePow:function(t){return void 0===t&&(t=4),t=(t=t<Number.EPSILON?Number.EPSILON:t)>1e4?1e4:t,{In:function(e){return Math.pow(e,t)},Out:function(e){return 1-Math.pow(1-e,t)},InOut:function(e){return e<.5?Math.pow(2*e,t)/2:(1-Math.pow(2-2*e,t))/2+.5}}}}),FA=function(){return performance.now()},zA=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,e){void 0===t&&(t=FA()),void 0===e&&(e=!1);var n=Object.keys(this._tweens);if(0===n.length)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<n.length;r++){var i=this._tweens[n[r]],a=!e;i&&!1===i.update(t,a)&&!e&&delete this._tweens[n[r]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0},t}(),GA={Linear:function(t,e){var n=t.length-1,r=n*e,i=Math.floor(r),a=GA.Utils.Linear;return e<0?a(t[0],t[1],r):e>1?a(t[n],t[n-1],n-r):a(t[i],t[i+1>n?n:i+1],r-i)},Bezier:function(t,e){for(var n=0,r=t.length-1,i=Math.pow,a=GA.Utils.Bernstein,o=0;o<=r;o++)n+=i(1-e,r-o)*i(e,o)*t[o]*a(r,o);return n},CatmullRom:function(t,e){var n=t.length-1,r=n*e,i=Math.floor(r),a=GA.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(i=Math.floor(r=n*(1+e))),a(t[(i-1+n)%n],t[i],t[(i+1)%n],t[(i+2)%n],r-i)):e<0?t[0]-(a(t[0],t[0],t[1],t[1],-r)-t[0]):e>1?t[n]-(a(t[n],t[n],t[n-1],t[n-1],r-n)-t[n]):a(t[i?i-1:0],t[i],t[n<i+1?n:i+1],t[n<i+2?n:i+2],r-i)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=GA.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:(BA=[1],function(t){var e=1;if(BA[t])return BA[t];for(var n=t;n>1;n--)e*=n;return BA[t]=e,e}),CatmullRom:function(t,e,n,r,i){var a=.5*(n-t),o=.5*(r-e),s=i*i;return(2*e-2*n+a+o)*(i*s)+(-3*e+3*n-2*a-o)*s+a*i+e}}},HA=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),jA=new zA,VA=function(){function t(t,e){void 0===e&&(e=jA),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=kA.Linear.None,this._interpolationFunction=GA.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=HA.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.getDuration=function(){return this._duration},t.prototype.to=function(t,e){if(void 0===e&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},t.prototype.duration=function(t){return void 0===t&&(t=1e3),this._duration=t<0?0:t,this},t.prototype.dynamic=function(t){return void 0===t&&(t=!1),this._isDynamic=t,this},t.prototype.start=function(t,e){if(void 0===t&&(t=FA()),void 0===e&&(e=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var n in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var r={};for(var i in this._valuesEnd)r[i]=this._valuesEnd[i];this._valuesEnd=r}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},t.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},t.prototype._setupProperties=function(t,e,n,r,i){for(var a in n){var o=t[a],s=Array.isArray(o),A=s?"array":typeof o,l=!s&&Array.isArray(n[a]);if("undefined"!==A&&"function"!==A){if(l){if(0===(m=n[a]).length)continue;for(var c=[o],u=0,h=m.length;u<h;u+=1){var d=this._handleRelativeValue(o,m[u]);if(isNaN(d)){l=!1,console.warn("Found invalid interpolation list. Skipping.");break}c.push(d)}l&&(n[a]=c)}if("object"!==A&&!s||!o||l)(void 0===e[a]||i)&&(e[a]=o),s||(e[a]*=1),r[a]=l?n[a].slice().reverse():e[a]||0;else{e[a]=s?[]:{};var f=o;for(var p in f)e[a][p]=f[p];r[a]=s?[]:{};var m=n[a];if(!this._isDynamic){var g={};for(var p in m)g[p]=m[p];n[a]=m=g}this._setupProperties(f,e[a],m,r[a],i)}}}},t.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},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=FA()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=FA()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return void 0===t&&(t=jA),this._group=t,this},t.prototype.delay=function(t){return void 0===t&&(t=0),this._delayTime=t,this},t.prototype.repeat=function(t){return void 0===t&&(t=0),this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return void 0===t&&(t=!1),this._yoyo=t,this},t.prototype.easing=function(t){return void 0===t&&(t=kA.Linear.None),this._easingFunction=t,this},t.prototype.interpolation=function(t){return void 0===t&&(t=GA.Linear),this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(t,e){var n,r,i=this;if(void 0===t&&(t=FA()),void 0===e&&(e=!0),this._isPaused)return!0;var a=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>a)return!1;e&&this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var o=t-this._startTime,s=this._duration+(null!==(n=this._repeatDelayTime)&&void 0!==n?n:this._delayTime),A=this._duration+this._repeat*s,l=function(){if(0===i._duration)return 1;if(o>A)return 1;var t=Math.trunc(o/s),e=o-t*s,n=Math.min(e/i._duration,1);return 0===n&&o===i._duration?1:n}(),c=this._easingFunction(l);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,c),this._onUpdateCallback&&this._onUpdateCallback(this._object,l),0===this._duration||o>=this._duration){if(this._repeat>0){var u=Math.min(Math.trunc((o-this._duration)/s)+1,this._repeat);for(r in isFinite(this._repeat)&&(this._repeat-=u),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[r]||(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=s*u,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var h=0,d=this._chainedTweens.length;h<d;h++)this._chainedTweens[h].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,n,r){for(var i in n)if(void 0!==e[i]){var a=e[i]||0,o=n[i],s=Array.isArray(t[i]),A=Array.isArray(o);!s&&A?t[i]=this._interpolationFunction(o,r):"object"==typeof o&&o?this._updateProperties(t[i],a,o,r):"number"==typeof(o=this._handleRelativeValue(a,o))&&(t[i]=a+(o-a)*r)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],n=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof n?this._valuesStartRepeat[t]+parseFloat(n):this._valuesEnd[t],this._valuesEnd[t]=e},t}(),WA=jA;WA.getAll.bind(WA),WA.removeAll.bind(WA),WA.add.bind(WA),WA.remove.bind(WA);var XA=WA.update.bind(WA);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function QA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var YA={exports:{}};function ZA(t,e,n){n=n||2;var r,i,a,o,s,A,l,c=e&&e.length,u=c?e[0]*n:t.length,h=KA(t,0,u,n,!0),d=[];if(!h||h.next===h.prev)return d;if(c&&(h=function(t,e,n,r){var i,a,o,s=[];for(i=0,a=e.length;i<a;i++)(o=KA(t,e[i]*r,i<a-1?e[i+1]*r:t.length,r,!1))===o.next&&(o.steiner=!0),s.push(Al(o));for(s.sort(il),i=0;i<s.length;i++)n=al(s[i],n);return n}(t,e,h,n)),t.length>80*n){r=a=t[0],i=o=t[1];for(var f=n;f<u;f+=n)(s=t[f])<r&&(r=s),(A=t[f+1])<i&&(i=A),s>a&&(a=s),A>o&&(o=A);l=0!==(l=Math.max(a-r,o-i))?32767/l:0}return $A(h,d,n,r,i,l,0),d}function KA(t,e,n,r,i){var a,o;if(i===xl(t,e,n,r)>0)for(a=e;a<n;a+=r)o=vl(a,t[a],t[a+1],o);else for(a=n-r;a>=e;a-=r)o=vl(a,t[a],t[a+1],o);return o&&hl(o,o.next)&&(_l(o),o=o.next),o}function JA(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!hl(r,r.next)&&0!==ul(r.prev,r,r.next))r=r.next;else{if(_l(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function $A(t,e,n,r,i,a,o){if(t){!o&&a&&function(t,e,n,r){var i=t;do{0===i.z&&(i.z=sl(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,a,o,s,A,l=1;do{for(n=t,t=null,a=null,o=0;n;){for(o++,r=n,s=0,e=0;e<l&&(s++,r=r.nextZ);e++);for(A=l;s>0||A>0&&r;)0!==s&&(0===A||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,A--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;n=r}a.nextZ=null,l*=2}while(o>1)}(i)}(t,r,i,a);for(var s,A,l=t;t.prev!==t.next;)if(s=t.prev,A=t.next,a?el(t,r,i,a):tl(t))e.push(s.i/n|0),e.push(t.i/n|0),e.push(A.i/n|0),_l(t),t=A.next,l=A.next;else if((t=A)===l){o?1===o?$A(t=nl(JA(t),e,n),e,n,r,i,a,2):2===o&&rl(t,e,n,r,i,a):$A(JA(t),e,n,r,i,a,1);break}}}function tl(t){var e=t.prev,n=t,r=t.next;if(ul(e,n,r)>=0)return!1;for(var i=e.x,a=n.x,o=r.x,s=e.y,A=n.y,l=r.y,c=i<a?i<o?i:o:a<o?a:o,u=s<A?s<l?s:l:A<l?A:l,h=i>a?i>o?i:o:a>o?a:o,d=s>A?s>l?s:l:A>l?A:l,f=r.next;f!==e;){if(f.x>=c&&f.x<=h&&f.y>=u&&f.y<=d&&ll(i,s,a,A,o,l,f.x,f.y)&&ul(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function el(t,e,n,r){var i=t.prev,a=t,o=t.next;if(ul(i,a,o)>=0)return!1;for(var s=i.x,A=a.x,l=o.x,c=i.y,u=a.y,h=o.y,d=s<A?s<l?s:l:A<l?A:l,f=c<u?c<h?c:h:u<h?u:h,p=s>A?s>l?s:l:A>l?A:l,m=c>u?c>h?c:h:u>h?u:h,g=sl(d,f,e,n,r),v=sl(p,m,e,n,r),_=t.prevZ,y=t.nextZ;_&&_.z>=g&&y&&y.z<=v;){if(_.x>=d&&_.x<=p&&_.y>=f&&_.y<=m&&_!==i&&_!==o&&ll(s,c,A,u,l,h,_.x,_.y)&&ul(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,y.x>=d&&y.x<=p&&y.y>=f&&y.y<=m&&y!==i&&y!==o&&ll(s,c,A,u,l,h,y.x,y.y)&&ul(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;_&&_.z>=g;){if(_.x>=d&&_.x<=p&&_.y>=f&&_.y<=m&&_!==i&&_!==o&&ll(s,c,A,u,l,h,_.x,_.y)&&ul(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;y&&y.z<=v;){if(y.x>=d&&y.x<=p&&y.y>=f&&y.y<=m&&y!==i&&y!==o&&ll(s,c,A,u,l,h,y.x,y.y)&&ul(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function nl(t,e,n){var r=t;do{var i=r.prev,a=r.next.next;!hl(i,a)&&dl(i,r,r.next,a)&&ml(i,a)&&ml(a,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(a.i/n|0),_l(r),_l(r.next),r=t=a),r=r.next}while(r!==t);return JA(r)}function rl(t,e,n,r,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&cl(o,s)){var A=gl(o,s);return o=JA(o,o.next),A=JA(A,A.next),$A(o,e,n,r,i,a,0),void $A(A,e,n,r,i,a,0)}s=s.next}o=o.next}while(o!==t)}function il(t,e){return t.x-e.x}function al(t,e){var n=function(t,e){var n,r=e,i=t.x,a=t.y,o=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var s=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>o&&(o=s,n=r.x<r.next.x?r:r.next,s===i))return n}r=r.next}while(r!==e);if(!n)return null;var A,l=n,c=n.x,u=n.y,h=1/0;r=n;do{i>=r.x&&r.x>=c&&i!==r.x&&ll(a<u?i:o,a,c,u,a<u?o:i,a,r.x,r.y)&&(A=Math.abs(a-r.y)/(i-r.x),ml(r,t)&&(A<h||A===h&&(r.x>n.x||r.x===n.x&&ol(n,r)))&&(n=r,h=A)),r=r.next}while(r!==l);return n}(t,e);if(!n)return e;var r=gl(n,t);return JA(r,r.next),JA(n,n.next)}function ol(t,e){return ul(t.prev,t,e.prev)<0&&ul(e.next,t,t.next)<0}function sl(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Al(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function ll(t,e,n,r,i,a,o,s){return(i-o)*(e-s)>=(t-o)*(a-s)&&(t-o)*(r-s)>=(n-o)*(e-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function cl(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&dl(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(ml(t,e)&&ml(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(ul(t.prev,t,e.prev)||ul(t,e.prev,e))||hl(t,e)&&ul(t.prev,t,t.next)>0&&ul(e.prev,e,e.next)>0)}function ul(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function hl(t,e){return t.x===e.x&&t.y===e.y}function dl(t,e,n,r){var i=pl(ul(t,e,n)),a=pl(ul(t,e,r)),o=pl(ul(n,r,t)),s=pl(ul(n,r,e));return i!==a&&o!==s||(!(0!==i||!fl(t,n,e))||(!(0!==a||!fl(t,r,e))||(!(0!==o||!fl(n,t,r))||!(0!==s||!fl(n,e,r)))))}function fl(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function pl(t){return t>0?1:t<0?-1:0}function ml(t,e){return ul(t.prev,t,t.next)<0?ul(t,e,t.next)>=0&&ul(t,t.prev,e)>=0:ul(t,e,t.prev)<0||ul(t,t.next,e)<0}function gl(t,e){var n=new yl(t.i,t.x,t.y),r=new yl(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function vl(t,e,n,r){var i=new yl(t,e,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 _l(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function yl(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function xl(t,e,n,r){for(var i=0,a=e,o=n-r;a<n;a+=r)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}YA.exports=ZA,YA.exports.default=ZA,ZA.deviation=function(t,e,n,r){var i=e&&e.length,a=i?e[0]*n:t.length,o=Math.abs(xl(t,0,a,n));if(i)for(var s=0,A=e.length;s<A;s++){var l=e[s]*n,c=s<A-1?e[s+1]*n:t.length;o-=Math.abs(xl(t,l,c,n))}var u=0;for(s=0;s<r.length;s+=3){var h=r[s]*n,d=r[s+1]*n,f=r[s+2]*n;u+=Math.abs((t[h]-t[f])*(t[d+1]-t[h+1])-(t[h]-t[d])*(t[f+1]-t[h+1]))}return 0===o&&0===u?0:Math.abs((u-o)/o)},ZA.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)n.vertices.push(t[i][a][o]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n};var bl=QA(YA.exports);function Ml(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function wl(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function El(t){let e,n,r;function i(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<0?i=e+1:a=e}while(i<a)}return i}return 2!==t.length?(e=Ml,n=(e,n)=>Ml(t(e),n),r=(e,n)=>t(e)-n):(e=t===Ml||t===wl?t:Sl,n=t,r=t),{left:i,center:function(t,e,n=0,a=t.length){const o=i(t,e,n,a-1);return o>n&&r(t[o-1],e)>-r(t[o],e)?o-1:o},right:function(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<=0?i=e+1:a=e}while(i<a)}return i}}}function Sl(){return 0}const Tl=El(Ml).right;function Cl(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(void 0===n?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)))}return[n,r]}El((function(t){return null===t?NaN:+t})).center;class Rl{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const i=e[r],a=t+i,o=Math.abs(t)<Math.abs(i)?t-(a-i):i-(a-t);o&&(e[n++]=o),t=a}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,i=this._n,a=0;if(i>0){for(a=t[--i];i>0&&(e=a,n=t[--i],a=e+n,r=n-(a-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=a+n,n==e-a&&(a=e))}return a}}const Pl=Math.sqrt(50),Ll=Math.sqrt(10),Dl=Math.sqrt(2);function Ol(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=Pl?10:a>=Ll?5:a>=Dl?2:1;let s,A,l;return i<0?(l=Math.pow(10,-i)/o,s=Math.round(t*l),A=Math.round(e*l),s/l<t&&++s,A/l>e&&--A,l=-l):(l=Math.pow(10,i)*o,s=Math.round(t/l),A=Math.round(e/l),s*l<t&&++s,A*l>e&&--A),A<s&&.5<=n&&n<2?Ol(t,e,2*n):[s,A,l]}function Il(t,e,n){return Ol(t=+t,e=+e,n=+n)[2]}function ql(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function Ul(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a}var Nl=1e-6,Bl=1e-12,kl=Math.PI,Fl=kl/2,zl=kl/4,Gl=2*kl,Hl=180/kl,jl=kl/180,Vl=Math.abs,Wl=Math.atan,Xl=Math.atan2,Ql=Math.cos,Yl=Math.ceil,Zl=Math.hypot,Kl=Math.sin,Jl=Math.sign||function(t){return t>0?1:t<0?-1:0},$l=Math.sqrt;function tc(t){return t>1?Fl:t<-1?-Fl:Math.asin(t)}function ec(t){return(t=Kl(t/2))*t}function nc(){}function rc(t,e){t&&ac.hasOwnProperty(t.type)&&ac[t.type](t,e)}var ic={Feature:function(t,e){rc(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)rc(n[r].geometry,e)}},ac={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){oc(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)oc(n[r],e,0)},Polygon:function(t,e){sc(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)sc(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)rc(n[r],e)}};function oc(t,e,n){var r,i=-1,a=t.length-n;for(e.lineStart();++i<a;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function sc(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)oc(t[n],e,1);e.polygonEnd()}function Ac(t,e){t&&ic.hasOwnProperty(t.type)?ic[t.type](t,e):rc(t,e)}var lc,cc,uc,hc,dc,fc,pc,mc,gc,vc,_c,yc,xc,bc,Mc,wc,Ec=new Rl,Sc=new Rl,Tc={point:nc,lineStart:nc,lineEnd:nc,polygonStart:function(){Ec=new Rl,Tc.lineStart=Cc,Tc.lineEnd=Rc},polygonEnd:function(){var t=+Ec;Sc.add(t<0?Gl+t:t),this.lineStart=this.lineEnd=this.point=nc},sphere:function(){Sc.add(Gl)}};function Cc(){Tc.point=Pc}function Rc(){Lc(lc,cc)}function Pc(t,e){Tc.point=Lc,lc=t,cc=e,uc=t*=jl,hc=Ql(e=(e*=jl)/2+zl),dc=Kl(e)}function Lc(t,e){var n=(t*=jl)-uc,r=n>=0?1:-1,i=r*n,a=Ql(e=(e*=jl)/2+zl),o=Kl(e),s=dc*o,A=hc*a+s*Ql(i),l=s*r*Kl(i);Ec.add(Xl(l,A)),uc=t,hc=a,dc=o}function Dc(t){return[Xl(t[1],t[0]),tc(t[2])]}function Oc(t){var e=t[0],n=t[1],r=Ql(n);return[r*Ql(e),r*Kl(e),Kl(n)]}function Ic(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function qc(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Uc(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Nc(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Bc(t){var e=$l(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var kc,Fc,zc,Gc,Hc,jc,Vc,Wc,Xc,Qc,Yc,Zc,Kc,Jc,$c,tu,eu={point:nu,lineStart:iu,lineEnd:au,polygonStart:function(){eu.point=ou,eu.lineStart=su,eu.lineEnd=Au,bc=new Rl,Tc.polygonStart()},polygonEnd:function(){Tc.polygonEnd(),eu.point=nu,eu.lineStart=iu,eu.lineEnd=au,Ec<0?(fc=-(mc=180),pc=-(gc=90)):bc>Nl?gc=90:bc<-Nl&&(pc=-90),wc[0]=fc,wc[1]=mc},sphere:function(){fc=-(mc=180),pc=-(gc=90)}};function nu(t,e){Mc.push(wc=[fc=t,mc=t]),e<pc&&(pc=e),e>gc&&(gc=e)}function ru(t,e){var n=Oc([t*jl,e*jl]);if(xc){var r=qc(xc,n),i=qc([r[1],-r[0],0],r);Bc(i),i=Dc(i);var a,o=t-vc,s=o>0?1:-1,A=i[0]*Hl*s,l=Vl(o)>180;l^(s*vc<A&&A<s*t)?(a=i[1]*Hl)>gc&&(gc=a):l^(s*vc<(A=(A+360)%360-180)&&A<s*t)?(a=-i[1]*Hl)<pc&&(pc=a):(e<pc&&(pc=e),e>gc&&(gc=e)),l?t<vc?lu(fc,t)>lu(fc,mc)&&(mc=t):lu(t,mc)>lu(fc,mc)&&(fc=t):mc>=fc?(t<fc&&(fc=t),t>mc&&(mc=t)):t>vc?lu(fc,t)>lu(fc,mc)&&(mc=t):lu(t,mc)>lu(fc,mc)&&(fc=t)}else Mc.push(wc=[fc=t,mc=t]);e<pc&&(pc=e),e>gc&&(gc=e),xc=n,vc=t}function iu(){eu.point=ru}function au(){wc[0]=fc,wc[1]=mc,eu.point=nu,xc=null}function ou(t,e){if(xc){var n=t-vc;bc.add(Vl(n)>180?n+(n>0?360:-360):n)}else _c=t,yc=e;Tc.point(t,e),ru(t,e)}function su(){Tc.lineStart()}function Au(){ou(_c,yc),Tc.lineEnd(),Vl(bc)>Nl&&(fc=-(mc=180)),wc[0]=fc,wc[1]=mc,xc=null}function lu(t,e){return(e-=t)<0?e+360:e}function cu(t,e){return t[0]-e[0]}function uu(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}function hu(t){var e,n,r,i,a,o,s;if(gc=mc=-(fc=pc=1/0),Mc=[],Ac(t,eu),n=Mc.length){for(Mc.sort(cu),e=1,a=[r=Mc[0]];e<n;++e)uu(r,(i=Mc[e])[0])||uu(r,i[1])?(lu(r[0],i[1])>lu(r[0],r[1])&&(r[1]=i[1]),lu(i[0],r[1])>lu(r[0],r[1])&&(r[0]=i[0])):a.push(r=i);for(o=-1/0,e=0,r=a[n=a.length-1];e<=n;r=i,++e)i=a[e],(s=lu(r[1],i[0]))>o&&(o=s,fc=i[0],mc=r[1])}return Mc=wc=null,fc===1/0||pc===1/0?[[NaN,NaN],[NaN,NaN]]:[[fc,pc],[mc,gc]]}var du={sphere:nc,point:fu,lineStart:mu,lineEnd:_u,polygonStart:function(){du.lineStart=yu,du.lineEnd=xu},polygonEnd:function(){du.lineStart=mu,du.lineEnd=_u}};function fu(t,e){t*=jl;var n=Ql(e*=jl);pu(n*Ql(t),n*Kl(t),Kl(e))}function pu(t,e,n){++kc,zc+=(t-zc)/kc,Gc+=(e-Gc)/kc,Hc+=(n-Hc)/kc}function mu(){du.point=gu}function gu(t,e){t*=jl;var n=Ql(e*=jl);Jc=n*Ql(t),$c=n*Kl(t),tu=Kl(e),du.point=vu,pu(Jc,$c,tu)}function vu(t,e){t*=jl;var n=Ql(e*=jl),r=n*Ql(t),i=n*Kl(t),a=Kl(e),o=Xl($l((o=$c*a-tu*i)*o+(o=tu*r-Jc*a)*o+(o=Jc*i-$c*r)*o),Jc*r+$c*i+tu*a);Fc+=o,jc+=o*(Jc+(Jc=r)),Vc+=o*($c+($c=i)),Wc+=o*(tu+(tu=a)),pu(Jc,$c,tu)}function _u(){du.point=fu}function yu(){du.point=bu}function xu(){Mu(Zc,Kc),du.point=fu}function bu(t,e){Zc=t,Kc=e,t*=jl,e*=jl,du.point=Mu;var n=Ql(e);Jc=n*Ql(t),$c=n*Kl(t),tu=Kl(e),pu(Jc,$c,tu)}function Mu(t,e){t*=jl;var n=Ql(e*=jl),r=n*Ql(t),i=n*Kl(t),a=Kl(e),o=$c*a-tu*i,s=tu*r-Jc*a,A=Jc*i-$c*r,l=Zl(o,s,A),c=tc(l),u=l&&-c/l;Xc.add(u*o),Qc.add(u*s),Yc.add(u*A),Fc+=c,jc+=c*(Jc+(Jc=r)),Vc+=c*($c+($c=i)),Wc+=c*(tu+(tu=a)),pu(Jc,$c,tu)}function wu(t){kc=Fc=zc=Gc=Hc=jc=Vc=Wc=0,Xc=new Rl,Qc=new Rl,Yc=new Rl,Ac(t,du);var e=+Xc,n=+Qc,r=+Yc,i=Zl(e,n,r);return i<Bl&&(e=jc,n=Vc,r=Wc,Fc<Nl&&(e=zc,n=Gc,r=Hc),(i=Zl(e,n,r))<Bl)?[NaN,NaN]:[Xl(n,e)*Hl,tc(r/i)*Hl]}function Eu(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function Su(t,e){return Vl(t)>kl&&(t-=Math.round(t/Gl)*Gl),[t,e]}function Tu(t,e,n){return(t%=Gl)?e||n?Eu(Ru(t),Pu(e,n)):Ru(t):e||n?Pu(e,n):Su}function Cu(t){return function(e,n){return Vl(e+=t)>kl&&(e-=Math.round(e/Gl)*Gl),[e,n]}}function Ru(t){var e=Cu(t);return e.invert=Cu(-t),e}function Pu(t,e){var n=Ql(t),r=Kl(t),i=Ql(e),a=Kl(e);function o(t,e){var o=Ql(e),s=Ql(t)*o,A=Kl(t)*o,l=Kl(e),c=l*n+s*r;return[Xl(A*i-c*a,s*n-l*r),tc(c*i+A*a)]}return o.invert=function(t,e){var o=Ql(e),s=Ql(t)*o,A=Kl(t)*o,l=Kl(e),c=l*i-A*a;return[Xl(A*i+l*a,s*n+c*r),tc(c*n-s*r)]},o}function Lu(t,e){(e=Oc(e))[0]-=t,Bc(e);var n,r=(n=-e[1])>1?0:n<-1?kl:Math.acos(n);return((-e[2]<0?-r:r)+Gl-Nl)%Gl}function Du(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:nc,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function Ou(t,e){return Vl(t[0]-e[0])<Nl&&Vl(t[1]-e[1])<Nl}function Iu(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function qu(t,e,n,r,i){var a,o,s=[],A=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],o=t[e];if(Ou(r,o)){if(!r[2]&&!o[2]){for(i.lineStart(),a=0;a<e;++a)i.point((r=t[a])[0],r[1]);return void i.lineEnd()}o[0]+=2*Nl}s.push(n=new Iu(r,t,null,!0)),A.push(n.o=new Iu(r,null,n,!1)),s.push(n=new Iu(o,t,null,!1)),A.push(n.o=new Iu(o,null,n,!0))}})),s.length){for(A.sort(e),Uu(s),Uu(A),a=0,o=A.length;a<o;++a)A[a].e=n=!n;for(var l,c,u=s[0];;){for(var h=u,d=!0;h.v;)if((h=h.n)===u)return;l=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(a=0,o=l.length;a<o;++a)i.point((c=l[a])[0],c[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(d)for(l=h.p.z,a=l.length-1;a>=0;--a)i.point((c=l[a])[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 Uu(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function Nu(t){return Vl(t[0])<=kl?t[0]:Jl(t[0])*((Vl(t[0])+kl)%Gl-kl)}function Bu(t,e){var n=Nu(e),r=e[1],i=Kl(r),a=[Kl(n),-Ql(n),0],o=0,s=0,A=new Rl;1===i?r=Fl+Nl:-1===i&&(r=-Fl-Nl);for(var l=0,c=t.length;l<c;++l)if(h=(u=t[l]).length)for(var u,h,d=u[h-1],f=Nu(d),p=d[1]/2+zl,m=Kl(p),g=Ql(p),v=0;v<h;++v,f=y,m=b,g=M,d=_){var _=u[v],y=Nu(_),x=_[1]/2+zl,b=Kl(x),M=Ql(x),w=y-f,E=w>=0?1:-1,S=E*w,T=S>kl,C=m*b;if(A.add(Xl(C*E*Kl(S),g*M+C*Ql(S))),o+=T?w+E*Gl:w,T^f>=n^y>=n){var R=qc(Oc(d),Oc(_));Bc(R);var P=qc(a,R);Bc(P);var L=(T^w>=0?-1:1)*tc(P[2]);(r>L||r===L&&(R[0]||R[1]))&&(s+=T^w>=0?1:-1)}}return(o<-Nl||o<Nl&&A<-Bl)^1&s}function ku(t,e,n,r){return function(i){var a,o,s,A=e(i),l=Du(),c=e(l),u=!1,h={point:d,lineStart:p,lineEnd:m,polygonStart:function(){h.point=g,h.lineStart=v,h.lineEnd=_,o=[],a=[]},polygonEnd:function(){h.point=d,h.lineStart=p,h.lineEnd=m,o=ql(o);var t=Bu(a,r);o.length?(u||(i.polygonStart(),u=!0),qu(o,zu,t,n,i)):t&&(u||(i.polygonStart(),u=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),u&&(i.polygonEnd(),u=!1),o=a=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(e,n){t(e,n)&&i.point(e,n)}function f(t,e){A.point(t,e)}function p(){h.point=f,A.lineStart()}function m(){h.point=d,A.lineEnd()}function g(t,e){s.push([t,e]),c.point(t,e)}function v(){c.lineStart(),s=[]}function _(){g(s[0][0],s[0][1]),c.lineEnd();var t,e,n,r,A=c.clean(),h=l.result(),d=h.length;if(s.pop(),a.push(s),s=null,d)if(1&A){if((e=(n=h[0]).length-1)>0){for(u||(i.polygonStart(),u=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else d>1&&2&A&&h.push(h.pop().concat(h.shift())),o.push(h.filter(Fu))}return h}}function Fu(t){return t.length>1}function zu(t,e){return((t=t.x)[0]<0?t[1]-Fl-Nl:Fl-t[1])-((e=e.x)[0]<0?e[1]-Fl-Nl:Fl-e[1])}Su.invert=Su;var Gu=ku((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?kl:-kl,A=Vl(a-n);Vl(A-kl)<Nl?(t.point(n,r=(r+o)/2>0?Fl:-Fl),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(a,r),e=0):i!==s&&A>=kl&&(Vl(n-i)<Nl&&(n-=i*Nl),Vl(a-s)<Nl&&(a-=s*Nl),r=function(t,e,n,r){var i,a,o=Kl(t-n);return Vl(o)>Nl?Wl((Kl(e)*(a=Ql(r))*Kl(n)-Kl(r)*(i=Ql(e))*Kl(t))/(i*a*o)):(e+r)/2}(n,r,a,o),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=a,r=o),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*Fl,r.point(-kl,i),r.point(0,i),r.point(kl,i),r.point(kl,0),r.point(kl,-i),r.point(0,-i),r.point(-kl,-i),r.point(-kl,0),r.point(-kl,i);else if(Vl(t[0]-e[0])>Nl){var a=t[0]<e[0]?kl:-kl;i=n*a/2,r.point(-a,i),r.point(0,i),r.point(a,i)}else r.point(e[0],e[1])}),[-kl,-Fl]);function Hu(t){var e=Ql(t),n=6*jl,r=e>0,i=Vl(e)>Nl;function a(t,n){return Ql(t)*Ql(n)>e}function o(t,n,r){var i=[1,0,0],a=qc(Oc(t),Oc(n)),o=Ic(a,a),s=a[0],A=o-s*s;if(!A)return!r&&t;var l=e*o/A,c=-e*s/A,u=qc(i,a),h=Nc(i,l);Uc(h,Nc(a,c));var d=u,f=Ic(h,d),p=Ic(d,d),m=f*f-p*(Ic(h,h)-1);if(!(m<0)){var g=$l(m),v=Nc(d,(-f-g)/p);if(Uc(v,h),v=Dc(v),!r)return v;var _,y=t[0],x=n[0],b=t[1],M=n[1];x<y&&(_=y,y=x,x=_);var w=x-y,E=Vl(w-kl)<Nl;if(!E&&M<b&&(_=b,b=M,M=_),E||w<Nl?E?b+M>0^v[1]<(Vl(v[0]-y)<Nl?b:M):b<=v[1]&&v[1]<=M:w>kl^(y<=v[0]&&v[0]<=x)){var S=Nc(d,(-f+g)/p);return Uc(S,h),[v,Dc(S)]}}}function s(e,n){var i=r?t:kl-t,a=0;return e<-i?a|=1:e>i&&(a|=2),n<-i?a|=4:n>i&&(a|=8),a}return ku(a,(function(t){var e,n,A,l,c;return{lineStart:function(){l=A=!1,c=1},point:function(u,h){var d,f=[u,h],p=a(u,h),m=r?p?0:s(u,h):p?s(u+(u<0?kl:-kl),h):0;if(!e&&(l=A=p)&&t.lineStart(),p!==A&&(!(d=o(e,f))||Ou(e,d)||Ou(f,d))&&(f[2]=1),p!==A)c=0,p?(t.lineStart(),d=o(f,e),t.point(d[0],d[1])):(d=o(e,f),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(i&&e&&r^p){var g;m&n||!(g=o(f,e,!0))||(c=0,r?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1],3)))}!p||e&&Ou(e,f)||t.point(f[0],f[1]),e=f,A=p,n=m},lineEnd:function(){A&&t.lineEnd(),e=null},clean:function(){return c|(l&&A)<<1}}}),(function(e,r,i,a){!function(t,e,n,r,i,a){if(n){var o=Ql(e),s=Kl(e),A=r*n;null==i?(i=e+r*Gl,a=e-A/2):(i=Lu(o,i),a=Lu(o,a),(r>0?i<a:i>a)&&(i+=r*Gl));for(var l,c=i;r>0?c>a:c<a;c-=A)l=Dc([o,-s*Ql(c),-s*Kl(c)]),t.point(l[0],l[1])}}(a,t,n,i,e,r)}),r?[0,-t]:[-kl,t-kl])}var ju,Vu,Wu,Xu,Qu=1e9,Yu=-Qu;function Zu(t,e,n,r){function i(i,a){return t<=i&&i<=n&&e<=a&&a<=r}function a(i,a,s,l){var c=0,u=0;if(null==i||(c=o(i,s))!==(u=o(a,s))||A(i,a)<0^s>0)do{l.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+s+4)%4)!==u);else l.point(a[0],a[1])}function o(r,i){return Vl(r[0]-t)<Nl?i>0?0:3:Vl(r[0]-n)<Nl?i>0?2:1:Vl(r[1]-e)<Nl?i>0?1:0:i>0?3:2}function s(t,e){return A(t.x,e.x)}function A(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(o){var A,l,c,u,h,d,f,p,m,g,v,_=o,y=Du(),x={point:b,lineStart:function(){x.point=M,l&&l.push(c=[]);g=!0,m=!1,f=p=NaN},lineEnd:function(){A&&(M(u,h),d&&m&&y.rejoin(),A.push(y.result()));x.point=b,m&&_.lineEnd()},polygonStart:function(){_=y,A=[],l=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var a,o,s=l[n],A=1,c=s.length,u=s[0],h=u[0],d=u[1];A<c;++A)a=h,o=d,h=(u=s[A])[0],d=u[1],o<=r?d>r&&(h-a)*(r-o)>(d-o)*(t-a)&&++e:d<=r&&(h-a)*(r-o)<(d-o)*(t-a)&&--e;return e}(),n=v&&e,i=(A=ql(A)).length;(n||i)&&(o.polygonStart(),n&&(o.lineStart(),a(null,null,1,o),o.lineEnd()),i&&qu(A,s,e,a,o),o.polygonEnd());_=o,A=l=c=null}};function b(t,e){i(t,e)&&_.point(t,e)}function M(a,o){var s=i(a,o);if(l&&c.push([a,o]),g)u=a,h=o,d=s,g=!1,s&&(_.lineStart(),_.point(a,o));else if(s&&m)_.point(a,o);else{var A=[f=Math.max(Yu,Math.min(Qu,f)),p=Math.max(Yu,Math.min(Qu,p))],y=[a=Math.max(Yu,Math.min(Qu,a)),o=Math.max(Yu,Math.min(Qu,o))];!function(t,e,n,r,i,a){var o,s=t[0],A=t[1],l=0,c=1,u=e[0]-s,h=e[1]-A;if(o=n-s,u||!(o>0)){if(o/=u,u<0){if(o<l)return;o<c&&(c=o)}else if(u>0){if(o>c)return;o>l&&(l=o)}if(o=i-s,u||!(o<0)){if(o/=u,u<0){if(o>c)return;o>l&&(l=o)}else if(u>0){if(o<l)return;o<c&&(c=o)}if(o=r-A,h||!(o>0)){if(o/=h,h<0){if(o<l)return;o<c&&(c=o)}else if(h>0){if(o>c)return;o>l&&(l=o)}if(o=a-A,h||!(o<0)){if(o/=h,h<0){if(o>c)return;o>l&&(l=o)}else if(h>0){if(o<l)return;o<c&&(c=o)}return l>0&&(t[0]=s+l*u,t[1]=A+l*h),c<1&&(e[0]=s+c*u,e[1]=A+c*h),!0}}}}}(A,y,t,e,n,r)?s&&(_.lineStart(),_.point(a,o),v=!1):(m||(_.lineStart(),_.point(A[0],A[1])),_.point(y[0],y[1]),s||_.lineEnd(),v=!1)}f=a,p=o,m=s}return x}}var Ku={sphere:nc,point:nc,lineStart:function(){Ku.point=$u,Ku.lineEnd=Ju},lineEnd:nc,polygonStart:nc,polygonEnd:nc};function Ju(){Ku.point=Ku.lineEnd=nc}function $u(t,e){Vu=t*=jl,Wu=Kl(e*=jl),Xu=Ql(e),Ku.point=th}function th(t,e){t*=jl;var n=Kl(e*=jl),r=Ql(e),i=Vl(t-Vu),a=Ql(i),o=r*Kl(i),s=Xu*n-Wu*r*a,A=Wu*n+Xu*r*a;ju.add(Xl($l(o*o+s*s),A)),Vu=t,Wu=n,Xu=r}var eh=[null,null],nh={type:"LineString",coordinates:eh};function rh(t,e){return eh[0]=t,eh[1]=e,function(t){return ju=new Rl,Ac(t,Ku),+ju}(nh)}var ih={Feature:function(t,e){return oh(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)if(oh(n[r].geometry,e))return!0;return!1}},ah={Sphere:function(){return!0},Point:function(t,e){return sh(t.coordinates,e)},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(sh(n[r],e))return!0;return!1},LineString:function(t,e){return Ah(t.coordinates,e)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(Ah(n[r],e))return!0;return!1},Polygon:function(t,e){return lh(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)if(lh(n[r],e))return!0;return!1},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)if(oh(n[r],e))return!0;return!1}};function oh(t,e){return!(!t||!ah.hasOwnProperty(t.type))&&ah[t.type](t,e)}function sh(t,e){return 0===rh(t,e)}function Ah(t,e){for(var n,r,i,a=0,o=t.length;a<o;a++){if(0===(r=rh(t[a],e)))return!0;if(a>0&&(i=rh(t[a],t[a-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<Bl*i)return!0;n=r}return!1}function lh(t,e){return!!Bu(t.map(ch),uh(e))}function ch(t){return(t=t.map(uh)).pop(),t}function uh(t){return[t[0]*jl,t[1]*jl]}function hh(t,e,n){var r=Ul(t,e-Nl,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function dh(t,e,n){var r=Ul(t,e-Nl,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function fh(){return function(){var t,e,n,r,i,a,o,s,A,l,c,u,h=10,d=h,f=90,p=360,m=2.5;function g(){return{type:"MultiLineString",coordinates:v()}}function v(){return Ul(Yl(r/f)*f,n,f).map(c).concat(Ul(Yl(s/p)*p,o,p).map(u)).concat(Ul(Yl(e/h)*h,t,h).filter((function(t){return Vl(t%f)>Nl})).map(A)).concat(Ul(Yl(a/d)*d,i,d).filter((function(t){return Vl(t%p)>Nl})).map(l))}return g.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))},g.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(u(o).slice(1),c(n).reverse().slice(1),u(s).reverse().slice(1))]}},g.extent=function(t){return arguments.length?g.extentMajor(t).extentMinor(t):g.extentMinor()},g.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],r>n&&(t=r,r=n,n=t),s>o&&(t=s,s=o,o=t),g.precision(m)):[[r,s],[n,o]]},g.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],a=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),a>i&&(n=a,a=i,i=n),g.precision(m)):[[e,a],[t,i]]},g.step=function(t){return arguments.length?g.stepMajor(t).stepMinor(t):g.stepMinor()},g.stepMajor=function(t){return arguments.length?(f=+t[0],p=+t[1],g):[f,p]},g.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],g):[h,d]},g.precision=function(h){return arguments.length?(m=+h,A=hh(a,i,90),l=dh(e,t,m),c=hh(s,o,90),u=dh(r,n,m),g):m},g.extentMajor([[-180,-90+Nl],[180,90-Nl]]).extentMinor([[-180,-80-Nl],[180,80+Nl]])}()()}function ph(t,e){var n=t[0]*jl,r=t[1]*jl,i=e[0]*jl,a=e[1]*jl,o=Ql(r),s=Kl(r),A=Ql(a),l=Kl(a),c=o*Ql(n),u=o*Kl(n),h=A*Ql(i),d=A*Kl(i),f=2*tc($l(ec(a-r)+o*A*ec(i-n))),p=Kl(f),m=f?function(t){var e=Kl(t*=f)/p,n=Kl(f-t)/p,r=n*c+e*h,i=n*u+e*d,a=n*s+e*l;return[Xl(i,r)*Hl,Xl(a,$l(r*r+i*i))*Hl]}:function(){return[n*Hl,r*Hl]};return m.distance=f,m}var mh=t=>t,gh=1/0,vh=gh,_h=-gh,yh=_h;var xh={point:function(t,e){t<gh&&(gh=t);t>_h&&(_h=t);e<vh&&(vh=e);e>yh&&(yh=e)},lineStart:nc,lineEnd:nc,polygonStart:nc,polygonEnd:nc,result:function(){var t=[[gh,vh],[_h,yh]];return _h=yh=-(vh=gh=1/0),t}};function bh(t){return function(e){var n=new Mh;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Mh(){}function wh(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),Ac(n,t.stream(xh)),e(xh.result()),null!=r&&t.clipExtent(r),t}function Eh(t,e,n){return wh(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],a=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),o=+e[0][0]+(r-a*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-a*(n[1][1]+n[0][1]))/2;t.scale(150*a).translate([o,s])}),n)}Mh.prototype={constructor:Mh,point:function(t,e){this.stream.point(t,e)},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 Sh=16,Th=Ql(30*jl);function Ch(t,e){return+e?function(t,e){function n(r,i,a,o,s,A,l,c,u,h,d,f,p,m){var g=l-r,v=c-i,_=g*g+v*v;if(_>4*e&&p--){var y=o+h,x=s+d,b=A+f,M=$l(y*y+x*x+b*b),w=tc(b/=M),E=Vl(Vl(b)-1)<Nl||Vl(a-u)<Nl?(a+u)/2:Xl(x,y),S=t(E,w),T=S[0],C=S[1],R=T-r,P=C-i,L=v*R-g*P;(L*L/_>e||Vl((g*R+v*P)/_-.5)>.3||o*h+s*d+A*f<Th)&&(n(r,i,a,o,s,A,T,C,E,y/=M,x/=M,b,p,m),m.point(T,C),n(T,C,E,y,x,b,l,c,u,h,d,f,p,m))}}return function(e){var r,i,a,o,s,A,l,c,u,h,d,f,p={point:m,lineStart:g,lineEnd:_,polygonStart:function(){e.polygonStart(),p.lineStart=y},polygonEnd:function(){e.polygonEnd(),p.lineStart=g}};function m(n,r){n=t(n,r),e.point(n[0],n[1])}function g(){c=NaN,p.point=v,e.lineStart()}function v(r,i){var a=Oc([r,i]),o=t(r,i);n(c,u,l,h,d,f,c=o[0],u=o[1],l=r,h=a[0],d=a[1],f=a[2],Sh,e),e.point(c,u)}function _(){p.point=m,e.lineEnd()}function y(){g(),p.point=x,p.lineEnd=b}function x(t,e){v(r=t,e),i=c,a=u,o=h,s=d,A=f,p.point=v}function b(){n(c,u,l,h,d,f,i,a,r,o,s,A,Sh,e),p.lineEnd=_,_()}return p}}(t,e):function(t){return bh({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var Rh=bh({point:function(t,e){this.stream.point(t*jl,e*jl)}});function Ph(t,e,n,r,i,a){if(!a)return function(t,e,n,r,i){function a(a,o){return[e+t*(a*=r),n-t*(o*=i)]}return a.invert=function(a,o){return[(a-e)/t*r,(n-o)/t*i]},a}(t,e,n,r,i);var o=Ql(a),s=Kl(a),A=o*t,l=s*t,c=o/t,u=s/t,h=(s*n-o*e)/t,d=(s*e+o*n)/t;function f(t,a){return[A*(t*=r)-l*(a*=i)+e,n-l*t-A*a]}return f.invert=function(t,e){return[r*(c*t-u*e+h),i*(d-u*t-c*e)]},f}function Lh(t){return function(t){var e,n,r,i,a,o,s,A,l,c,u=150,h=480,d=250,f=0,p=0,m=0,g=0,v=0,_=0,y=1,x=1,b=null,M=Gu,w=null,E=mh,S=.5;function T(t){return A(t[0]*jl,t[1]*jl)}function C(t){return(t=A.invert(t[0],t[1]))&&[t[0]*Hl,t[1]*Hl]}function R(){var t=Ph(u,0,0,y,x,_).apply(null,e(f,p)),r=Ph(u,h-t[0],d-t[1],y,x,_);return n=Tu(m,g,v),s=Eu(e,r),A=Eu(n,s),o=Ch(s,S),P()}function P(){return l=c=null,T}return T.stream=function(t){return l&&c===t?l:l=Rh(function(t){return bh({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(M(o(E(c=t)))))},T.preclip=function(t){return arguments.length?(M=t,b=void 0,P()):M},T.postclip=function(t){return arguments.length?(E=t,w=r=i=a=null,P()):E},T.clipAngle=function(t){return arguments.length?(M=+t?Hu(b=t*jl):(b=null,Gu),P()):b*Hl},T.clipExtent=function(t){return arguments.length?(E=null==t?(w=r=i=a=null,mh):Zu(w=+t[0][0],r=+t[0][1],i=+t[1][0],a=+t[1][1]),P()):null==w?null:[[w,r],[i,a]]},T.scale=function(t){return arguments.length?(u=+t,R()):u},T.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],R()):[h,d]},T.center=function(t){return arguments.length?(f=t[0]%360*jl,p=t[1]%360*jl,R()):[f*Hl,p*Hl]},T.rotate=function(t){return arguments.length?(m=t[0]%360*jl,g=t[1]%360*jl,v=t.length>2?t[2]%360*jl:0,R()):[m*Hl,g*Hl,v*Hl]},T.angle=function(t){return arguments.length?(_=t%360*jl,R()):_*Hl},T.reflectX=function(t){return arguments.length?(y=t?-1:1,R()):y<0},T.reflectY=function(t){return arguments.length?(x=t?-1:1,R()):x<0},T.precision=function(t){return arguments.length?(o=Ch(s,S=t*t),P()):$l(S)},T.fitExtent=function(t,e){return Eh(T,t,e)},T.fitSize=function(t,e){return function(t,e,n){return Eh(t,[[0,0],e],n)}(T,t,e)},T.fitWidth=function(t,e){return function(t,e,n){return wh(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),a=(r-i*(n[1][0]+n[0][0]))/2,o=-i*n[0][1];t.scale(150*i).translate([a,o])}),n)}(T,t,e)},T.fitHeight=function(t,e){return function(t,e,n){return wh(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),a=-i*n[0][0],o=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([a,o])}),n)}(T,t,e)},function(){return e=t.apply(this,arguments),T.invert=e.invert&&C,R()}}((function(){return t}))()}function Dh(t,e){var n=Ql(e),r=1+Ql(t)*n;return[n*Kl(t)/r,Kl(e)/r]}function Oh(){return Lh(Dh).scale(250).clipAngle(142)}function Ih(t,e,n){return e=Bh(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,qh()?Reflect.construct(e,n||[],Bh(t).constructor):e.apply(t,n))}function qh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(qh=function(){return!!t})()}function Uh(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function Nh(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Uh(r.key),r)}}function Bh(t){return Bh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Bh(t)}function kh(t,e){return kh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kh(t,e)}function Fh(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||zh(t,e)||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 zh(t,e){if(t){if("string"==typeof t)return Gh(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gh(t,e):void 0}}function Gh(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}Dh.invert=function(t){return function(e,n){var r=$l(e*e+n*n),i=t(r),a=Kl(i),o=Ql(i);return[Xl(e*a,r*o),tc(r&&n*a/r)]}}((function(t){return 2*Wl(t)}));var Hh=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=[],n=null;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(r){if(n){var i=180*rh(r,n)/Math.PI;if(i>t)for(var a=ph(n,r),o=1/Math.ceil(i/t),s=o;s<1;)e.push(a(s)),s+=o}e.push(n=r)})),e},jh="undefined"!=typeof window&&window.THREE?window.THREE:{BufferGeometry:zn,Float32BufferAttribute:On},Vh=(new jh.BufferGeometry).setAttribute?"setAttribute":"addAttribute",Wh=function(t){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Ih(this,e)).type="GeoJsonGeometry",n.parameters={geoJson:t,radius:r,resolution:i};var a=({Point:l,MultiPoint:function(t,e){var n={vertices:[],indices:[]};return t.map((function(t){return l(t,e)})).forEach((function(t){var e=Fh(t,1)[0];Xh(n,e)})),[n]},LineString:c,MultiLineString:function(t,e){var n={vertices:[],indices:[]};return t.map((function(t){return c(t,e)})).forEach((function(t){var e=Fh(t,1)[0];Xh(n,e)})),[n]},Polygon:u,MultiPolygon:function(t,e){var n={vertices:[],indices:[]},r={vertices:[],indices:[]};t.map((function(t){return u(t,e)})).forEach((function(t){var e=Fh(t,2),i=e[0],a=e[1];Xh(n,i),a&&Xh(r,a)}));var i=[n];return r.vertices.length&&i.push(r),i}}[t.type]||function(){return[]})(t.coordinates,r),o=[],s=[],A=0;function l(t,e){return[{vertices:Yh(t[1],t[0],e),indices:[]}]}function c(t,e){for(var n=Hh(t,i).map((function(t){var n=Fh(t,2),r=n[0];return Yh(n[1],r,e)})),r=bl.flatten([n]).vertices,a=Math.round(r.length/3),o=[],s=1;s<a;s++)o.push(s-1,s);return[{vertices:r,indices:o}]}function u(t,e){for(var n=t.map((function(t){return Hh(t,i).map((function(t){var n=Fh(t,2),r=n[0];return Yh(n[1],r,e)}))})),r=bl.flatten(n),a=r.vertices,o=r.holes,s=o[0]||1/0,A=a.slice(0,3*s),l=a.slice(3*s),c=new Set(o),u=Math.round(a.length/3),h=[],d=[],f=1;f<u;f++)c.has(f)||(f<s?h.push(f-1,f):d.push(f-1-s,f-s));var p=[{indices:h,vertices:A}];return o.length&&p.push({indices:d,vertices:l}),p}return a.forEach((function(t){var e=o.length;Xh({indices:o,vertices:s},t),n.addGroup(e,o.length-e,A++)})),o.length&&n.setIndex(o),s.length&&n[Vh]("position",new jh.Float32BufferAttribute(s,3)),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&kh(t,e)}(e,t),n=e,r&&Nh(n.prototype,r),i&&Nh(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(jh.BufferGeometry);function Xh(t,e){var n=Math.round(t.vertices.length/3);Qh(t.vertices,e.vertices),Qh(t.indices,e.indices.map((function(t){return t+n})))}function Qh(t,e){var n,r=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=zh(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},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 a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;t.push(i)}}catch(t){r.e(t)}finally{r.f()}}function Yh(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-t)*Math.PI/180,i=(90-e)*Math.PI/180;return[n*Math.sin(r)*Math.cos(i),n*Math.cos(r),n*Math.sin(r)*Math.sin(i)]}function Zh(t){let e,n,r,i=-1,a=0;for(let o=0;o<t.length;++o){const s=t[o];if(void 0===e&&(e=s.array.constructor),e!==s.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===n&&(n=s.itemSize),n!==s.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===r&&(r=s.normalized),r!==s.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(-1===i&&(i=s.gpuType),i!==s.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;a+=s.count*n}const o=new e(a),s=new Pn(o,n,r);let A=0;for(let e=0;e<t.length;++e){const r=t[e];if(r.isInterleavedBufferAttribute){const t=A/n;for(let e=0,i=r.count;e<i;e++)for(let i=0;i<n;i++){const n=r.getComponent(e,i);s.setComponent(e+t,i,n)}}else o.set(r.array,A);A+=r.count*n}return void 0!==i&&(s.gpuType=i),s}function Kh(t){const e=t.data.array.constructor,n=t.count,r=t.itemSize,i=t.normalized,a=new e(n*r);let o;o=t.isInstancedInterleavedBufferAttribute?new vo(a,r,i,t.meshPerAttribute):new Pn(a,r,i);for(let e=0;e<n;e++)o.setX(e,t.getX(e)),r>=2&&o.setY(e,t.getY(e)),r>=3&&o.setZ(e,t.getZ(e)),r>=4&&o.setW(e,t.getW(e));return o}var Jh=Object.freeze({__proto__:null,computeMikkTSpaceTangents:function(t,e,n=!0){if(!e||!e.isReady)throw new Error("BufferGeometryUtils: Initialized MikkTSpace library required.");if(!t.hasAttribute("position")||!t.hasAttribute("normal")||!t.hasAttribute("uv"))throw new Error('BufferGeometryUtils: Tangents require "position", "normal", and "uv" attributes.');function r(t){if(t.normalized||t.isInterleavedBufferAttribute){const e=new Float32Array(t.count*t.itemSize);for(let n=0,r=0;n<t.count;n++)e[r++]=t.getX(n),e[r++]=t.getY(n),t.itemSize>2&&(e[r++]=t.getZ(n));return e}return t.array instanceof Float32Array?t.array:new Float32Array(t.array)}const i=t.index?t.toNonIndexed():t,a=e.generateTangents(r(i.attributes.position),r(i.attributes.normal),r(i.attributes.uv));if(n)for(let t=3;t<a.length;t+=4)a[t]*=-1;return i.setAttribute("tangent",new Pn(a,4)),t!==i&&t.copy(i),t},computeMorphedAttributes:function(t){const e=new ae,n=new ae,r=new ae,i=new ae,a=new ae,o=new ae,s=new ae,A=new ae,l=new ae;function c(t,c,u,h,d,f,p,m){e.fromBufferAttribute(c,d),n.fromBufferAttribute(c,f),r.fromBufferAttribute(c,p);const g=t.morphTargetInfluences;if(u&&g){s.set(0,0,0),A.set(0,0,0),l.set(0,0,0);for(let t=0,c=u.length;t<c;t++){const c=g[t],m=u[t];0!==c&&(i.fromBufferAttribute(m,d),a.fromBufferAttribute(m,f),o.fromBufferAttribute(m,p),h?(s.addScaledVector(i,c),A.addScaledVector(a,c),l.addScaledVector(o,c)):(s.addScaledVector(i.sub(e),c),A.addScaledVector(a.sub(n),c),l.addScaledVector(o.sub(r),c)))}e.add(s),n.add(A),r.add(l)}t.isSkinnedMesh&&(t.applyBoneTransform(d,e),t.applyBoneTransform(f,n),t.applyBoneTransform(p,r)),m[3*d+0]=e.x,m[3*d+1]=e.y,m[3*d+2]=e.z,m[3*f+0]=n.x,m[3*f+1]=n.y,m[3*f+2]=n.z,m[3*p+0]=r.x,m[3*p+1]=r.y,m[3*p+2]=r.z}const u=t.geometry,h=t.material;let d,f,p;const m=u.index,g=u.attributes.position,v=u.morphAttributes.position,_=u.morphTargetsRelative,y=u.attributes.normal,x=u.morphAttributes.position,b=u.groups,M=u.drawRange;let w,E,S,T,C,R,P;const L=new Float32Array(g.count*g.itemSize),D=new Float32Array(y.count*y.itemSize);if(null!==m)if(Array.isArray(h))for(w=0,S=b.length;w<S;w++)for(C=b[w],R=Math.max(C.start,M.start),P=Math.min(C.start+C.count,M.start+M.count),E=R,T=P;E<T;E+=3)d=m.getX(E),f=m.getX(E+1),p=m.getX(E+2),c(t,g,v,_,d,f,p,L),c(t,y,x,_,d,f,p,D);else for(R=Math.max(0,M.start),P=Math.min(m.count,M.start+M.count),w=R,S=P;w<S;w+=3)d=m.getX(w),f=m.getX(w+1),p=m.getX(w+2),c(t,g,v,_,d,f,p,L),c(t,y,x,_,d,f,p,D);else if(Array.isArray(h))for(w=0,S=b.length;w<S;w++)for(C=b[w],R=Math.max(C.start,M.start),P=Math.min(C.start+C.count,M.start+M.count),E=R,T=P;E<T;E+=3)d=E,f=E+1,p=E+2,c(t,g,v,_,d,f,p,L),c(t,y,x,_,d,f,p,D);else for(R=Math.max(0,M.start),P=Math.min(g.count,M.start+M.count),w=R,S=P;w<S;w+=3)d=w,f=w+1,p=w+2,c(t,g,v,_,d,f,p,L),c(t,y,x,_,d,f,p,D);return{positionAttribute:g,normalAttribute:y,morphedPositionAttribute:new On(L,3),morphedNormalAttribute:new On(D,3)}},deepCloneAttribute:function(t){return t.isInstancedInterleavedBufferAttribute||t.isInterleavedBufferAttribute?Kh(t):t.isInstancedBufferAttribute?(new vo).copy(t):(new Pn).copy(t)},deinterleaveAttribute:Kh,deinterleaveGeometry:function(t){const e=t.attributes,n=t.morphTargets,r=new Map;for(const t in e){const n=e[t];n.isInterleavedBufferAttribute&&(r.has(n)||r.set(n,Kh(n)),e[t]=r.get(n))}for(const t in n){const e=n[t];e.isInterleavedBufferAttribute&&(r.has(e)||r.set(e,Kh(e)),n[t]=r.get(e))}},estimateBytesUsed:function(t){let e=0;for(const n in t.attributes){const r=t.getAttribute(n);e+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT}const n=t.getIndex();return e+=n?n.count*n.itemSize*n.array.BYTES_PER_ELEMENT:0,e},interleaveAttributes:function(t){let e,n=0,r=0;for(let i=0,a=t.length;i<a;++i){const a=t[i];if(void 0===e&&(e=a.array.constructor),e!==a.array.constructor)return console.error("AttributeBuffers of different types cannot be interleaved"),null;n+=a.array.length,r+=a.itemSize}const i=new po(new e(n),r);let a=0;const o=[],s=["getX","getY","getZ","getW"],A=["setX","setY","setZ","setW"];for(let e=0,n=t.length;e<n;e++){const n=t[e],r=n.itemSize,l=n.count,c=new go(i,r,a,n.normalized);o.push(c),a+=r;for(let t=0;t<l;t++)for(let e=0;e<r;e++)c[A[e]](t,n[s[e]](t))}return o},mergeAttributes:Zh,mergeGeometries:function(t,e=!1){const n=null!==t[0].index,r=new Set(Object.keys(t[0].attributes)),i=new Set(Object.keys(t[0].morphAttributes)),a={},o={},s=t[0].morphTargetsRelative,A=new zn;let l=0;for(let c=0;c<t.length;++c){const u=t[c];let h=0;if(n!==(null!==u.index))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const t in u.attributes){if(!r.has(t))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+'. All geometries must have compatible attributes; make sure "'+t+'" attribute exists among all geometries, or in none of them.'),null;void 0===a[t]&&(a[t]=[]),a[t].push(u.attributes[t]),h++}if(h!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". Make sure all geometries have the same number of attributes."),null;if(s!==u.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const t in u.morphAttributes){if(!i.has(t))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". .morphAttributes must be consistent throughout all geometries."),null;void 0===o[t]&&(o[t]=[]),o[t].push(u.morphAttributes[t])}if(e){let t;if(n)t=u.index.count;else{if(void 0===u.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+c+". The geometry must have either an index or a position attribute"),null;t=u.attributes.position.count}A.addGroup(l,t,c),l+=t}}if(n){let e=0;const n=[];for(let r=0;r<t.length;++r){const i=t[r].index;for(let t=0;t<i.count;++t)n.push(i.getX(t)+e);e+=t[r].attributes.position.count}A.setIndex(n)}for(const t in a){const e=Zh(a[t]);if(!e)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" attribute."),null;A.setAttribute(t,e)}for(const t in o){const e=o[t][0].length;if(0===e)break;A.morphAttributes=A.morphAttributes||{},A.morphAttributes[t]=[];for(let n=0;n<e;++n){const e=[];for(let r=0;r<o[t].length;++r)e.push(o[t][r][n]);const r=Zh(e);if(!r)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+t+" morphAttribute."),null;A.morphAttributes[t].push(r)}}return A},mergeGroups:function(t){if(0===t.groups.length)return console.warn("THREE.BufferGeometryUtils.mergeGroups(): No groups are defined. Nothing to merge."),t;let e=t.groups;if(e=e.sort(((t,e)=>t.materialIndex!==e.materialIndex?t.materialIndex-e.materialIndex:t.start-e.start)),null===t.getIndex()){const e=t.getAttribute("position"),n=[];for(let t=0;t<e.count;t+=3)n.push(t,t+1,t+2);t.setIndex(n)}const n=t.getIndex(),r=[];for(let t=0;t<e.length;t++){const i=e[t],a=i.start,o=a+i.count;for(let t=a;t<o;t++)r.push(n.getX(t))}t.dispose(),t.setIndex(r);let i=0;for(let t=0;t<e.length;t++){const n=e[t];n.start=i,i+=n.count}let a=e[0];t.groups=[a];for(let n=1;n<e.length;n++){const r=e[n];a.materialIndex===r.materialIndex?a.count+=r.count:(a=r,t.groups.push(a))}return t},mergeVertices:function(t,e=1e-4){e=Math.max(e,Number.EPSILON);const n={},r=t.getIndex(),i=t.getAttribute("position"),a=r?r.count:i.count;let o=0;const s=Object.keys(t.attributes),A={},l={},c=[],u=["getX","getY","getZ","getW"],h=["setX","setY","setZ","setW"];for(let e=0,n=s.length;e<n;e++){const n=s[e],r=t.attributes[n];A[n]=new Pn(new r.array.constructor(r.count*r.itemSize),r.itemSize,r.normalized);const i=t.morphAttributes[n];i&&(l[n]=new Pn(new i.array.constructor(i.count*i.itemSize),i.itemSize,i.normalized))}const d=.5*e,f=Math.log10(1/e),p=Math.pow(10,f),m=d*p;for(let e=0;e<a;e++){const i=r?r.getX(e):e;let a="";for(let e=0,n=s.length;e<n;e++){const n=s[e],r=t.getAttribute(n),o=r.itemSize;for(let t=0;t<o;t++)a+=~~(r[u[t]](i)*p+m)+","}if(a in n)c.push(n[a]);else{for(let e=0,n=s.length;e<n;e++){const n=s[e],r=t.getAttribute(n),a=t.morphAttributes[n],c=r.itemSize,d=A[n],f=l[n];for(let t=0;t<c;t++){const e=u[t],n=h[t];if(d[n](o,r[e](i)),a)for(let t=0,r=a.length;t<r;t++)f[t][n](o,a[t][e](i))}}n[a]=o,c.push(o),o++}}const g=t.clone();for(const e in t.attributes){const t=A[e];if(g.setAttribute(e,new Pn(t.array.slice(0,o*t.itemSize),t.itemSize,t.normalized)),e in l)for(let t=0;t<l[e].length;t++){const n=l[e][t];g.morphAttributes[e][t]=new Pn(n.array.slice(0,o*n.itemSize),n.itemSize,n.normalized)}}return g.setIndex(c),g},toCreasedNormals:function(t,e=Math.PI/3){const n=Math.cos(e),r=100*(1+1e-10),i=[new ae,new ae,new ae],a=new ae,o=new ae,s=new ae,A=new ae;function l(t){return`${~~(t.x*r)},${~~(t.y*r)},${~~(t.z*r)}`}const c=t.index?t.toNonIndexed():t,u=c.attributes.position,h={};for(let t=0,e=u.count/3;t<e;t++){const e=3*t,n=i[0].fromBufferAttribute(u,e+0),r=i[1].fromBufferAttribute(u,e+1),s=i[2].fromBufferAttribute(u,e+2);a.subVectors(s,r),o.subVectors(n,r);const A=(new ae).crossVectors(a,o).normalize();for(let t=0;t<3;t++){const e=l(i[t]);e in h||(h[e]=[]),h[e].push(A)}}const d=new Float32Array(3*u.count),f=new Pn(d,3,!1);for(let t=0,e=u.count/3;t<e;t++){const e=3*t,r=i[0].fromBufferAttribute(u,e+0),c=i[1].fromBufferAttribute(u,e+1),d=i[2].fromBufferAttribute(u,e+2);a.subVectors(d,c),o.subVectors(r,c),s.crossVectors(a,o).normalize();for(let t=0;t<3;t++){const r=h[l(i[t])];A.set(0,0,0);for(let t=0,e=r.length;t<e;t++){const e=r[t];s.dot(e)>n&&A.add(e)}A.normalize(),f.setXYZ(e+t,A.x,A.y,A.z)}}return c.setAttribute("normal",f),c},toTrianglesDrawMode:function(t,e){if(0===e)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(2===e||1===e){let n=t.getIndex();if(null===n){const e=[],r=t.getAttribute("position");if(void 0===r)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(let t=0;t<r.count;t++)e.push(t);t.setIndex(e),n=t.getIndex()}const r=n.count-2,i=[];if(2===e)for(let t=1;t<=r;t++)i.push(n.getX(0)),i.push(n.getX(t)),i.push(n.getX(t+1));else for(let t=0;t<r;t++)t%2==0?(i.push(n.getX(t)),i.push(n.getX(t+1)),i.push(n.getX(t+2))):(i.push(n.getX(t+2)),i.push(n.getX(t+1)),i.push(n.getX(t)));i.length/3!==r&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const a=t.clone();return a.setIndex(i),a.clearGroups(),a}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),t}}),$h=function(t){return"function"==typeof t?t:"string"==typeof t?function(e){return e[t]}:function(e){return t}};function td(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ed(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function nd(){}var rd=.7,id=1/rd,ad="\\s*([+-]?\\d+)\\s*",od="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",sd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ad=/^#([0-9a-f]{3,8})$/,ld=new RegExp(`^rgb\\(${ad},${ad},${ad}\\)$`),cd=new RegExp(`^rgb\\(${sd},${sd},${sd}\\)$`),ud=new RegExp(`^rgba\\(${ad},${ad},${ad},${od}\\)$`),hd=new RegExp(`^rgba\\(${sd},${sd},${sd},${od}\\)$`),dd=new RegExp(`^hsl\\(${od},${sd},${sd}\\)$`),fd=new RegExp(`^hsla\\(${od},${sd},${sd},${od}\\)$`),pd={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};function md(){return this.rgb().formatHex()}function gd(){return this.rgb().formatRgb()}function vd(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ad.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?_d(e):3===n?new bd(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?yd(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?yd(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ld.exec(t))?new bd(e[1],e[2],e[3],1):(e=cd.exec(t))?new bd(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ud.exec(t))?yd(e[1],e[2],e[3],e[4]):(e=hd.exec(t))?yd(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=dd.exec(t))?Cd(e[1],e[2]/100,e[3]/100,1):(e=fd.exec(t))?Cd(e[1],e[2]/100,e[3]/100,e[4]):pd.hasOwnProperty(t)?_d(pd[t]):"transparent"===t?new bd(NaN,NaN,NaN,0):null}function _d(t){return new bd(t>>16&255,t>>8&255,255&t,1)}function yd(t,e,n,r){return r<=0&&(t=e=n=NaN),new bd(t,e,n,r)}function xd(t,e,n,r){return 1===arguments.length?((i=t)instanceof nd||(i=vd(i)),i?new bd((i=i.rgb()).r,i.g,i.b,i.opacity):new bd):new bd(t,e,n,null==r?1:r);var i}function bd(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Md(){return`#${Td(this.r)}${Td(this.g)}${Td(this.b)}`}function wd(){const t=Ed(this.opacity);return`${1===t?"rgb(":"rgba("}${Sd(this.r)}, ${Sd(this.g)}, ${Sd(this.b)}${1===t?")":`, ${t})`}`}function Ed(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Sd(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Td(t){return((t=Sd(t))<16?"0":"")+t.toString(16)}function Cd(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Pd(t,e,n,r)}function Rd(t){if(t instanceof Pd)return new Pd(t.h,t.s,t.l,t.opacity);if(t instanceof nd||(t=vd(t)),!t)return new Pd;if(t instanceof Pd)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,A=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=A<.5?a+i:2-a-i,o*=60):s=A>0&&A<1?0:o,new Pd(o,s,A,t.opacity)}function Pd(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Ld(t){return(t=(t||0)%360)<0?t+360:t}function Dd(t){return Math.max(0,Math.min(1,t||0))}function Od(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Id(t){return Id="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Id(t)}td(nd,vd,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:md,formatHex:md,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Rd(this).formatHsl()},formatRgb:gd,toString:gd}),td(bd,xd,ed(nd,{brighter(t){return t=null==t?id:Math.pow(id,t),new bd(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?rd:Math.pow(rd,t),new bd(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new bd(Sd(this.r),Sd(this.g),Sd(this.b),Ed(this.opacity))},displayable(){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:Md,formatHex:Md,formatHex8:function(){return`#${Td(this.r)}${Td(this.g)}${Td(this.b)}${Td(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:wd,toString:wd})),td(Pd,(function(t,e,n,r){return 1===arguments.length?Rd(t):new Pd(t,e,n,null==r?1:r)}),ed(nd,{brighter(t){return t=null==t?id:Math.pow(id,t),new Pd(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?rd:Math.pow(rd,t),new Pd(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new bd(Od(t>=240?t-240:t+120,i,r),Od(t,i,r),Od(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Pd(Ld(this.h),Dd(this.s),Dd(this.l),Ed(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ed(this.opacity);return`${1===t?"hsl(":"hsla("}${Ld(this.h)}, ${100*Dd(this.s)}%, ${100*Dd(this.l)}%${1===t?")":`, ${t})`}`}}));var qd=/^\s+/,Ud=/\s+$/;function Nd(t,e){if(e=e||{},(t=t||"")instanceof Nd)return t;if(!(this instanceof Nd))return new Nd(t,e);var n=function(t){var e={r:0,g:0,b:0},n=1,r=null,i=null,a=null,o=!1,s=!1;"string"==typeof t&&(t=function(t){t=t.replace(qd,"").replace(Ud,"").toLowerCase();var e,n=!1;if(tf[t])t=tf[t],n=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=ff.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=ff.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=ff.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=ff.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=ff.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=ff.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=ff.hex8.exec(t))return{r:of(e[1]),g:of(e[2]),b:of(e[3]),a:cf(e[4]),format:n?"name":"hex8"};if(e=ff.hex6.exec(t))return{r:of(e[1]),g:of(e[2]),b:of(e[3]),format:n?"name":"hex"};if(e=ff.hex4.exec(t))return{r:of(e[1]+""+e[1]),g:of(e[2]+""+e[2]),b:of(e[3]+""+e[3]),a:cf(e[4]+""+e[4]),format:n?"name":"hex8"};if(e=ff.hex3.exec(t))return{r:of(e[1]+""+e[1]),g:of(e[2]+""+e[2]),b:of(e[3]+""+e[3]),format:n?"name":"hex"};return!1}(t));"object"==Id(t)&&(pf(t.r)&&pf(t.g)&&pf(t.b)?(A=t.r,l=t.g,c=t.b,e={r:255*rf(A,255),g:255*rf(l,255),b:255*rf(c,255)},o=!0,s="%"===String(t.r).substr(-1)?"prgb":"rgb"):pf(t.h)&&pf(t.s)&&pf(t.v)?(r=Af(t.s),i=Af(t.v),e=function(t,e,n){t=6*rf(t,360),e=rf(e,100),n=rf(n,100);var r=Math.floor(t),i=t-r,a=n*(1-e),o=n*(1-i*e),s=n*(1-(1-i)*e),A=r%6,l=[n,o,a,a,s,n][A],c=[s,n,n,o,a,a][A],u=[a,a,s,n,n,o][A];return{r:255*l,g:255*c,b:255*u}}(t.h,r,i),o=!0,s="hsv"):pf(t.h)&&pf(t.s)&&pf(t.l)&&(r=Af(t.s),a=Af(t.l),e=function(t,e,n){var r,i,a;function o(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}if(t=rf(t,360),e=rf(e,100),n=rf(n,100),0===e)r=i=a=n;else{var s=n<.5?n*(1+e):n+e-n*e,A=2*n-s;r=o(A,s,t+1/3),i=o(A,s,t),a=o(A,s,t-1/3)}return{r:255*r,g:255*i,b:255*a}}(t.h,r,a),o=!0,s="hsl"),t.hasOwnProperty("a")&&(n=t.a));var A,l,c;return n=nf(n),{ok:o,format:t.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:n}}(t);this._originalInput=t,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||n.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function Bd(t,e,n){t=rf(t,255),e=rf(e,255),n=rf(n,255);var r,i,a=Math.max(t,e,n),o=Math.min(t,e,n),s=(a+o)/2;if(a==o)r=i=0;else{var A=a-o;switch(i=s>.5?A/(2-a-o):A/(a+o),a){case t:r=(e-n)/A+(e<n?6:0);break;case e:r=(n-t)/A+2;break;case n:r=(t-e)/A+4}r/=6}return{h:r,s:i,l:s}}function kd(t,e,n){t=rf(t,255),e=rf(e,255),n=rf(n,255);var r,i,a=Math.max(t,e,n),o=Math.min(t,e,n),s=a,A=a-o;if(i=0===a?0:A/a,a==o)r=0;else{switch(a){case t:r=(e-n)/A+(e<n?6:0);break;case e:r=(n-t)/A+2;break;case n:r=(t-e)/A+4}r/=6}return{h:r,s:i,v:s}}function Fd(t,e,n,r){var i=[sf(Math.round(t).toString(16)),sf(Math.round(e).toString(16)),sf(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function zd(t,e,n,r){return[sf(lf(r)),sf(Math.round(t).toString(16)),sf(Math.round(e).toString(16)),sf(Math.round(n).toString(16))].join("")}function Gd(t,e){e=0===e?0:e||10;var n=Nd(t).toHsl();return n.s-=e/100,n.s=af(n.s),Nd(n)}function Hd(t,e){e=0===e?0:e||10;var n=Nd(t).toHsl();return n.s+=e/100,n.s=af(n.s),Nd(n)}function jd(t){return Nd(t).desaturate(100)}function Vd(t,e){e=0===e?0:e||10;var n=Nd(t).toHsl();return n.l+=e/100,n.l=af(n.l),Nd(n)}function Wd(t,e){e=0===e?0:e||10;var n=Nd(t).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-e/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-e/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-e/100*255))),Nd(n)}function Xd(t,e){e=0===e?0:e||10;var n=Nd(t).toHsl();return n.l-=e/100,n.l=af(n.l),Nd(n)}function Qd(t,e){var n=Nd(t).toHsl(),r=(n.h+e)%360;return n.h=r<0?360+r:r,Nd(n)}function Yd(t){var e=Nd(t).toHsl();return e.h=(e.h+180)%360,Nd(e)}function Zd(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var n=Nd(t).toHsl(),r=[Nd(t)],i=360/e,a=1;a<e;a++)r.push(Nd({h:(n.h+a*i)%360,s:n.s,l:n.l}));return r}function Kd(t){var e=Nd(t).toHsl(),n=e.h;return[Nd(t),Nd({h:(n+72)%360,s:e.s,l:e.l}),Nd({h:(n+216)%360,s:e.s,l:e.l})]}function Jd(t,e,n){e=e||6,n=n||30;var r=Nd(t).toHsl(),i=360/n,a=[Nd(t)];for(r.h=(r.h-(i*e>>1)+720)%360;--e;)r.h=(r.h+i)%360,a.push(Nd(r));return a}function $d(t,e){e=e||6;for(var n=Nd(t).toHsv(),r=n.h,i=n.s,a=n.v,o=[],s=1/e;e--;)o.push(Nd({h:r,s:i,v:a})),a=(a+s)%1;return o}Nd.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 t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,n,r=this.toRgb();return t=r.r/255,e=r.g/255,n=r.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(t){return this._a=nf(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=kd(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=kd(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+n+"%, "+r+"%)":"hsva("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=Bd(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=Bd(this._r,this._g,this._b),e=Math.round(360*t.h),n=Math.round(100*t.s),r=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+n+"%, "+r+"%)":"hsla("+e+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return Fd(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,n,r,i){var a=[sf(Math.round(t).toString(16)),sf(Math.round(e).toString(16)),sf(Math.round(n).toString(16)),sf(lf(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,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*rf(this._r,255))+"%",g:Math.round(100*rf(this._g,255))+"%",b:Math.round(100*rf(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*rf(this._r,255))+"%, "+Math.round(100*rf(this._g,255))+"%, "+Math.round(100*rf(this._b,255))+"%)":"rgba("+Math.round(100*rf(this._r,255))+"%, "+Math.round(100*rf(this._g,255))+"%, "+Math.round(100*rf(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(ef[Fd(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+zd(this._r,this._g,this._b,this._a),n=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var i=Nd(t);n="#"+zd(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+n+")"},toString:function(t){var e=!!t;t=t||this._format;var n=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(n=this.toRgbString()),"prgb"===t&&(n=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(n=this.toHexString()),"hex3"===t&&(n=this.toHexString(!0)),"hex4"===t&&(n=this.toHex8String(!0)),"hex8"===t&&(n=this.toHex8String()),"name"===t&&(n=this.toName()),"hsl"===t&&(n=this.toHslString()),"hsv"===t&&(n=this.toHsvString()),n||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return Nd(this.toString())},_applyModification:function(t,e){var n=t.apply(null,[this].concat([].slice.call(e)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(Vd,arguments)},brighten:function(){return this._applyModification(Wd,arguments)},darken:function(){return this._applyModification(Xd,arguments)},desaturate:function(){return this._applyModification(Gd,arguments)},saturate:function(){return this._applyModification(Hd,arguments)},greyscale:function(){return this._applyModification(jd,arguments)},spin:function(){return this._applyModification(Qd,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(Jd,arguments)},complement:function(){return this._applyCombination(Yd,arguments)},monochromatic:function(){return this._applyCombination($d,arguments)},splitcomplement:function(){return this._applyCombination(Kd,arguments)},triad:function(){return this._applyCombination(Zd,[3])},tetrad:function(){return this._applyCombination(Zd,[4])}},Nd.fromRatio=function(t,e){if("object"==Id(t)){var n={};for(var r in t)t.hasOwnProperty(r)&&(n[r]="a"===r?t[r]:Af(t[r]));t=n}return Nd(t,e)},Nd.equals=function(t,e){return!(!t||!e)&&Nd(t).toRgbString()==Nd(e).toRgbString()},Nd.random=function(){return Nd.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},Nd.mix=function(t,e,n){n=0===n?0:n||50;var r=Nd(t).toRgb(),i=Nd(e).toRgb(),a=n/100;return Nd({r:(i.r-r.r)*a+r.r,g:(i.g-r.g)*a+r.g,b:(i.b-r.b)*a+r.b,a:(i.a-r.a)*a+r.a})},
// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
// Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
Nd.readability=function(t,e){var n=Nd(t),r=Nd(e);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},Nd.isReadable=function(t,e,n){var r,i,a=Nd.readability(t,e);switch(i=!1,(r=function(t){var e,n;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==n&&"large"!==n&&(n="small");return{level:e,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},Nd.mostReadable=function(t,e,n){var r,i,a,o,s=null,A=0;i=(n=n||{}).includeFallbackColors,a=n.level,o=n.size;for(var l=0;l<e.length;l++)(r=Nd.readability(t,e[l]))>A&&(A=r,s=Nd(e[l]));return Nd.isReadable(t,s,{level:a,size:o})||!i?s:(n.includeFallbackColors=!1,Nd.mostReadable(t,["#fff","#000"],n))};var tf=Nd.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"},ef=Nd.hexNames=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[t[n]]=n);return e}(tf);function nf(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function rf(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),n&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function af(t){return Math.min(1,Math.max(0,t))}function of(t){return parseInt(t,16)}function sf(t){return 1==t.length?"0"+t:""+t}function Af(t){return t<=1&&(t=100*t+"%"),t}function lf(t){return Math.round(255*parseFloat(t)).toString(16)}function cf(t){return of(t)/255}var uf,hf,df,ff=(hf="[\\s|\\(]+("+(uf="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+uf+")[,|\\s]+("+uf+")\\s*\\)?",df="[\\s|\\(]+("+uf+")[,|\\s]+("+uf+")[,|\\s]+("+uf+")[,|\\s]+("+uf+")\\s*\\)?",{CSS_UNIT:new RegExp(uf),rgb:new RegExp("rgb"+hf),rgba:new RegExp("rgba"+df),hsl:new RegExp("hsl"+hf),hsla:new RegExp("hsla"+df),hsv:new RegExp("hsv"+hf),hsva:new RegExp("hsva"+df),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 pf(t){return!!ff.CSS_UNIT.exec(t)}function mf(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function gf(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||_f(t,e)||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 vf(t){return function(t){if(Array.isArray(t))return yf(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_f(t)||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 _f(t,e){if(t){if("string"==typeof t)return yf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yf(t,e):void 0}}function yf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function xf(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var bf=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=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=(e instanceof Array?e.length?e:[void 0]:[e]).map((function(t){return{keyAccessor:t,isProp:!(t instanceof Function)}})),a=t.reduce((function(t,e){var r=t,a=e;return i.forEach((function(t,e){var o,s=t.keyAccessor;if(t.isProp){var A=a,l=A[s],c=mf(A,[s].map(xf));o=l,a=c}else o=s(a,e);e+1<i.length?(r.hasOwnProperty(o)||(r[o]={}),r=r[o]):n?(r.hasOwnProperty(o)||(r[o]=[]),r[o].push(a)):r[o]=a})),t}),{});n instanceof Function&&function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;r===i.length?Object.keys(e).forEach((function(t){return e[t]=n(e[t])})):Object.values(e).forEach((function(e){return t(e,r+1)}))}(a);var o=a;return r&&(o=[],function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];n.length===i.length?o.push({keys:n,vals:e}):Object.entries(e).forEach((function(e){var r=gf(e,2),i=r[0],a=r[1];return t(a,[].concat(vf(n),[i]))}))}(a),e instanceof Array&&0===e.length&&1===o.length&&(o[0].keys=[])),o};function Mf(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function wf(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ef(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Sf(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Cf(t,e)||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 Tf(t){return function(t){if(Array.isArray(t))return Rf(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Cf(t)||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 Cf(t,e){if(t){if("string"==typeof t)return Rf(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rf(t,e):void 0}}function Rf(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Pf=["createObj","updateObj","exitObj","objBindAttr","dataBindAttr"];function Lf(t,e,n){var r=n.objBindAttr,i=void 0===r?"__obj":r,a=n.dataBindAttr,o=void 0===a?"__data":a,s=n.idAccessor,A=n.purge,l=void 0!==A&&A,c=function(t){return t.hasOwnProperty(o)},u=e.filter((function(t){return!c(t)})),h=e.filter(c).map((function(t){return t[o]})),d=l?{enter:t,exit:h,update:[]}:function(t,e,n){var r={enter:[],update:[],exit:[]};if(n){var i=bf(t,n,!1),a=bf(e,n,!1),o=Object.assign({},i,a);Object.entries(o).forEach((function(t){var e=Sf(t,2),n=e[0],o=e[1],s=i.hasOwnProperty(n)?a.hasOwnProperty(n)?"update":"exit":"enter";r[s].push("update"===s?[i[n],a[n]]:o)}))}else{var s=new Set(t),A=new Set(e);new Set([].concat(Tf(s),Tf(A))).forEach((function(t){var e=s.has(t)?A.has(t)?"update":"exit":"enter";r[e].push("update"===e?[t,t]:t)}))}return r}(h,t,s);return d.update=d.update.map((function(t){var e=Sf(t,2),n=e[0],r=e[1];return n!==r&&(r[i]=n[i],r[i][o]=r),r})),d.exit=d.exit.concat(u.map((function(t){return wf({},i,t)}))),d}function Df(t,e,n,r,i){var a=i.createObj,o=void 0===a?function(t){return{}}:a,s=i.updateObj,A=void 0===s?function(t,e){}:s,l=i.exitObj,c=void 0===l?function(t){}:l,u=i.objBindAttr,h=void 0===u?"__obj":u,d=i.dataBindAttr,f=void 0===d?"__data":d,p=Ef(i,Pf),m=Lf(t,e,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Mf(Object(n),!0).forEach((function(e){wf(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mf(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({objBindAttr:h,dataBindAttr:f},p)),g=m.enter,v=m.update;m.exit.forEach((function(t){var e=t[h];delete t[h],c(e),r(e)}));var _=function(t){var e=[];return t.forEach((function(t){var n=o(t);n&&(n[f]=t,t[h]=n,e.push(n))})),e}(g);!function(t){t.forEach((function(t){var e=t[h];e&&(e[f]=t,A(e,t))}))}([].concat(Tf(g),Tf(v))),_.forEach(n)}var Of={exports:{}};!function(t,e){t.exports=function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var r=n(1),i=function(){function t(t,e,n){void 0===t&&(t=NaN),void 0===e&&(e=NaN),void 0===n&&(n=!1),this._minFPS=e,this._maxFPS=t,this._timeScale=1,this._currentTick=0,this._currentTime=0,this._tickDeltaTime=0,this._isRunning=!1,this._maxInterval=isNaN(this._minFPS)?NaN:1e3/this._minFPS,this._minInterval=isNaN(this._maxFPS)?NaN:1e3/this._maxFPS,this._onResume=new r.default,this._onPause=new r.default,this._onTick=new r.default,this._onTickOncePerFrame=new r.default,n||this.resume()}return t.prototype.updateOnce=function(t){t(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},t.prototype.resume=function(){this._isRunning||(this._isRunning=!0,this._lastTimeUpdated=this.getTimer(),this._onResume.dispatch(),this.animateOnce())},t.prototype.pause=function(){this._isRunning&&(this._isRunning=!1,this._onPause.dispatch(),window.cancelAnimationFrame(this._animationFrameHandle))},t.prototype.dispose=function(){this.pause(),this._onResume.removeAll(),this._onPause.removeAll(),this._onTick.removeAll()},Object.defineProperty(t.prototype,"currentTick",{get:function(){return this._currentTick},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentTimeSeconds",{get:function(){return this._currentTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tickDeltaTimeSeconds",{get:function(){return this._tickDeltaTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"timeScale",{get:function(){return this._timeScale},set:function(t){this._timeScale!==t&&(this._timeScale=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onResume",{get:function(){return this._onResume},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onPause",{get:function(){return this._onPause},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onTick",{get:function(){return this._onTick},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onTickOncePerFrame",{get:function(){return this._onTickOncePerFrame},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRunning",{get:function(){return this._isRunning},enumerable:!0,configurable:!0}),t.prototype.animateOnce=function(){var t=this;this._animationFrameHandle=window.requestAnimationFrame((function(){return t.onFrame()}))},t.prototype.onFrame=function(){if(this._now=this.getTimer(),this._frameDeltaTime=this._now-this._lastTimeUpdated,isNaN(this._minInterval)||this._frameDeltaTime>=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()},t.prototype.update=function(t,e){void 0===e&&(e=!0),this._currentTick++,this._currentTime+=t,this._tickDeltaTime=t,this._onTick.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick),e&&this._onTickOncePerFrame.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},t.prototype.getTimer=function(){return Date.now()},t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,n){!function(e,n){t.exports=n()}(0,(function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e){var n=function(){function t(){this.functions=[]}return t.prototype.add=function(t){return-1===this.functions.indexOf(t)&&(this.functions.push(t),!0)},t.prototype.remove=function(t){var e=this.functions.indexOf(t);return e>-1&&(this.functions.splice(e,1),!0)},t.prototype.removeAll=function(){return this.functions.length>0&&(this.functions.length=0,!0)},t.prototype.dispatch=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.functions.concat().forEach((function(e){e.apply(void 0,t)}))},Object.defineProperty(t.prototype,"numItems",{get:function(){return this.functions.length},enumerable:!0,configurable:!0}),t}();Object.defineProperty(e,"__esModule",{value:!0}),e.default=n}])}))}])}(Of);var If=QA(Of.exports);function qf(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}var Uf=t=>()=>t;function Nf(t){return 1==(t=+t)?Bf:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Uf(isNaN(e)?n:e)}}function Bf(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Uf(isNaN(t)?e:t)}var kf=function t(e){var n=Nf(e);function r(t,e){var r=n((t=xd(t)).r,(e=xd(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),o=Bf(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=o(e),t+""}}return r.gamma=t,r}(1);function Ff(t,e){e||(e=[]);var n,r=t?Math.min(e.length,t.length):0,i=e.slice();return function(a){for(n=0;n<r;++n)i[n]=t[n]*(1-a)+e[n]*a;return i}}function zf(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Gf(t,e){return(zf(e)?Ff:Hf)(t,e)}function Hf(t,e){var n,r=e?e.length:0,i=t?Math.min(r,t.length):0,a=new Array(i),o=new Array(r);for(n=0;n<i;++n)a[n]=Zf(t[n],e[n]);for(;n<r;++n)o[n]=e[n];return function(t){for(n=0;n<i;++n)o[n]=a[n](t);return o}}function jf(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function Vf(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Wf(t,e){var n,r={},i={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?r[n]=Zf(t[n],e[n]):i[n]=e[n];return function(t){for(n in r)i[n]=r[n](t);return i}}var Xf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Qf=new RegExp(Xf.source,"g");function Yf(t,e){var n,r,i,a=Xf.lastIndex=Qf.lastIndex=0,o=-1,s=[],A=[];for(t+="",e+="";(n=Xf.exec(t))&&(r=Qf.exec(e));)(i=r.index)>a&&(i=e.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(n=n[0])===(r=r[0])?s[o]?s[o]+=r:s[++o]=r:(s[++o]=null,A.push({i:o,x:Vf(n,r)})),a=Qf.lastIndex;return a<e.length&&(i=e.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?A[0]?function(t){return function(e){return t(e)+""}}(A[0].x):function(t){return function(){return t}}(e):(e=A.length,function(t){for(var n,r=0;r<e;++r)s[(n=A[r]).i]=n.x(t);return s.join("")})}function Zf(t,e){var n,r=typeof e;return null==e||"boolean"===r?Uf(e):("number"===r?Vf:"string"===r?(n=vd(e))?(e=n,kf):Yf:e instanceof vd?kf:e instanceof Date?jf:zf(e)?Ff:Array.isArray(e)?Hf:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Wf:Vf)(t,e)}function Kf(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Jf(t){return+t}var $f=[0,1];function tp(t){return t}function ep(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:(n=isNaN(e)?NaN:.5,function(){return n});var n}function np(t,e,n){var r=t[0],i=t[1],a=e[0],o=e[1];return i<r?(r=ep(i,r),a=n(o,a)):(r=ep(r,i),a=n(a,o)),function(t){return a(r(t))}}function rp(t,e,n){var r=Math.min(t.length,e.length)-1,i=new Array(r),a=new Array(r),o=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<r;)i[o]=ep(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(e){var n=Tl(t,e,1,r)-1;return a[n](i[n](e))}}function ip(){var t,e,n,r,i,a,o=$f,s=$f,A=Zf,l=tp;function c(){var t=Math.min(o.length,s.length);return l!==tp&&(l=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(o[0],o[t-1])),r=t>2?rp:np,i=a=null,u}function u(e){return null==e||isNaN(e=+e)?n:(i||(i=r(o.map(t),s,A)))(t(l(e)))}return u.invert=function(n){return l(e((a||(a=r(s,o.map(t),Vf)))(n)))},u.domain=function(t){return arguments.length?(o=Array.from(t,Jf),c()):o.slice()},u.range=function(t){return arguments.length?(s=Array.from(t),c()):s.slice()},u.rangeRound=function(t){return s=Array.from(t),A=Kf,c()},u.clamp=function(t){return arguments.length?(l=!!t||tp,c()):l!==tp},u.interpolate=function(t){return arguments.length?(A=t,c()):A},u.unknown=function(t){return arguments.length?(n=t,u):n},function(n,r){return t=n,e=r,c()}}function ap(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function op(t){return(t=ap(Math.abs(t)))?t[1]:NaN}var sp,Ap=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function lp(t){if(!(e=Ap.exec(t)))throw new Error("invalid format: "+t);var e;return new cp({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function cp(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function up(t,e){var n=ap(t,e);if(!n)return t+"";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")}lp.prototype=cp.prototype,cp.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 hp={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>up(100*t,e),r:up,s:function(t,e){var n=ap(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(sp=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+ap(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function dp(t){return t}var fp,pp,mp,gp=Array.prototype.map,vp=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function _p(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?dp:(e=gp.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],o=0,s=e[0],A=0;i>0&&s>0&&(A+s+1>r&&(s=Math.max(1,r-A)),a.push(t.substring(i-=s,i+s)),!((A+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",o=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?dp:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(gp.call(t.numerals,String)),A=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function u(t){var e=(t=lp(t)).fill,n=t.align,u=t.sign,h=t.symbol,d=t.zero,f=t.width,p=t.comma,m=t.precision,g=t.trim,v=t.type;"n"===v?(p=!0,v="g"):hp[v]||(void 0===m&&(m=12),g=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var _="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",y="$"===h?a:/[%p]/.test(v)?A:"",x=hp[v],b=/[defgprs%]/.test(v);function M(t){var i,a,A,h=_,M=y;if("c"===v)M=x(t)+M,t="";else{var w=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:x(Math.abs(t),m),g&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),w&&0==+t&&"+"!==u&&(w=!1),h=(w?"("===u?u:l:"-"===u||"("===u?"":u)+h,M=("s"===v?vp[8+sp/3]:"")+M+(w&&"("===u?")":""),b)for(i=-1,a=t.length;++i<a;)if(48>(A=t.charCodeAt(i))||A>57){M=(46===A?o+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}p&&!d&&(t=r(t,1/0));var E=h.length+t.length+M.length,S=E<f?new Array(f-E+1).join(e):"";switch(p&&d&&(t=r(S+t,S.length?f-M.length:1/0),S=""),n){case"<":t=h+t+M+S;break;case"=":t=h+S+t+M;break;case"^":t=S.slice(0,E=S.length>>1)+h+t+M+S.slice(E);break;default:t=S+h+t+M}return s(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),M.toString=function(){return t+""},M}return{format:u,formatPrefix:function(t,e){var n=u(((t=lp(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(op(e)/3))),i=Math.pow(10,-r),a=vp[8+r/3];return function(t){return n(i*t)+a}}}}function yp(t,e,n,r){var i,a=function(t,e,n){n=+n;const r=(e=+e)<(t=+t),i=r?Il(e,t,n):Il(t,e,n);return(r?-1:1)*(i<0?1/-i:i)}(t,e,n);switch((r=lp(null==r?",f":r)).type){case"s":var o=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(op(e)/3)))-op(Math.abs(t)))}(a,o))||(r.precision=i),mp(r,o);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,op(e)-op(t))+1}(a,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-op(Math.abs(t)))}(a))||(r.precision=i-2*("%"===r.type))}return pp(r)}function xp(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[i,a,o]=r?Ol(e,t,n):Ol(t,e,n);if(!(a>=i))return[];const s=a-i+1,A=new Array(s);if(r)if(o<0)for(let t=0;t<s;++t)A[t]=(a-t)/-o;else for(let t=0;t<s;++t)A[t]=(a-t)*o;else if(o<0)for(let t=0;t<s;++t)A[t]=(i+t)/-o;else for(let t=0;t<s;++t)A[t]=(i+t)*o;return A}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return yp(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,a=e(),o=0,s=a.length-1,A=a[o],l=a[s],c=10;for(l<A&&(i=A,A=l,l=i,i=o,o=s,s=i);c-- >0;){if((i=Il(A,l,n))===r)return a[o]=A,a[s]=l,e(a);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 t},t}function bp(){var t=ip()(tp,tp);return t.copy=function(){return e=t,bp().domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());var e},qf.apply(t,arguments),xp(t)}fp=_p({thousands:",",grouping:[3],currency:["$",""]}),pp=fp.format,mp=fp.formatPrefix;const Mp=134217729,wp=33306690738754706e-32;function Ep(t,e,n,r,i){let a,o,s,A,l=e[0],c=r[0],u=0,h=0;c>l==c>-l?(a=l,l=e[++u]):(a=c,c=r[++h]);let d=0;if(u<t&&h<n)for(c>l==c>-l?(o=l+a,s=a-(o-l),l=e[++u]):(o=c+a,s=a-(o-c),c=r[++h]),a=o,0!==s&&(i[d++]=s);u<t&&h<n;)c>l==c>-l?(o=a+l,A=o-a,s=a-(o-A)+(l-A),l=e[++u]):(o=a+c,A=o-a,s=a-(o-A)+(c-A),c=r[++h]),a=o,0!==s&&(i[d++]=s);for(;u<t;)o=a+l,A=o-a,s=a-(o-A)+(l-A),l=e[++u],a=o,0!==s&&(i[d++]=s);for(;h<n;)o=a+c,A=o-a,s=a-(o-A)+(c-A),c=r[++h],a=o,0!==s&&(i[d++]=s);return 0===a&&0!==d||(i[d++]=a),d}function Sp(t){return new Float64Array(t)}const Tp=22204460492503146e-32,Cp=11093356479670487e-47,Rp=Sp(4),Pp=Sp(8),Lp=Sp(12),Dp=Sp(16),Op=Sp(4);function Ip(t,e,n,r,i,a){const o=(e-a)*(n-i),s=(t-i)*(r-a),A=o-s,l=Math.abs(o+s);return Math.abs(A)>=33306690738754716e-32*l?A:-function(t,e,n,r,i,a,o){let s,A,l,c,u,h,d,f,p,m,g,v,_,y,x,b,M,w;const E=t-i,S=n-i,T=e-a,C=r-a;y=E*C,h=Mp*E,d=h-(h-E),f=E-d,h=Mp*C,p=h-(h-C),m=C-p,x=f*m-(y-d*p-f*p-d*m),b=T*S,h=Mp*T,d=h-(h-T),f=T-d,h=Mp*S,p=h-(h-S),m=S-p,M=f*m-(b-d*p-f*p-d*m),g=x-M,u=x-g,Rp[0]=x-(g+u)+(u-M),v=y+g,u=v-y,_=y-(v-u)+(g-u),g=_-b,u=_-g,Rp[1]=_-(g+u)+(u-b),w=v+g,u=w-v,Rp[2]=v-(w-u)+(g-u),Rp[3]=w;let R=function(t,e){let n=e[0];for(let r=1;r<t;r++)n+=e[r];return n}(4,Rp),P=Tp*o;if(R>=P||-R>=P)return R;if(u=t-E,s=t-(E+u)+(u-i),u=n-S,l=n-(S+u)+(u-i),u=e-T,A=e-(T+u)+(u-a),u=r-C,c=r-(C+u)+(u-a),0===s&&0===A&&0===l&&0===c)return R;if(P=Cp*o+wp*Math.abs(R),R+=E*c+C*s-(T*l+S*A),R>=P||-R>=P)return R;y=s*C,h=Mp*s,d=h-(h-s),f=s-d,h=Mp*C,p=h-(h-C),m=C-p,x=f*m-(y-d*p-f*p-d*m),b=A*S,h=Mp*A,d=h-(h-A),f=A-d,h=Mp*S,p=h-(h-S),m=S-p,M=f*m-(b-d*p-f*p-d*m),g=x-M,u=x-g,Op[0]=x-(g+u)+(u-M),v=y+g,u=v-y,_=y-(v-u)+(g-u),g=_-b,u=_-g,Op[1]=_-(g+u)+(u-b),w=v+g,u=w-v,Op[2]=v-(w-u)+(g-u),Op[3]=w;const L=Ep(4,Rp,4,Op,Pp);y=E*c,h=Mp*E,d=h-(h-E),f=E-d,h=Mp*c,p=h-(h-c),m=c-p,x=f*m-(y-d*p-f*p-d*m),b=T*l,h=Mp*T,d=h-(h-T),f=T-d,h=Mp*l,p=h-(h-l),m=l-p,M=f*m-(b-d*p-f*p-d*m),g=x-M,u=x-g,Op[0]=x-(g+u)+(u-M),v=y+g,u=v-y,_=y-(v-u)+(g-u),g=_-b,u=_-g,Op[1]=_-(g+u)+(u-b),w=v+g,u=w-v,Op[2]=v-(w-u)+(g-u),Op[3]=w;const D=Ep(L,Pp,4,Op,Lp);y=s*c,h=Mp*s,d=h-(h-s),f=s-d,h=Mp*c,p=h-(h-c),m=c-p,x=f*m-(y-d*p-f*p-d*m),b=A*l,h=Mp*A,d=h-(h-A),f=A-d,h=Mp*l,p=h-(h-l),m=l-p,M=f*m-(b-d*p-f*p-d*m),g=x-M,u=x-g,Op[0]=x-(g+u)+(u-M),v=y+g,u=v-y,_=y-(v-u)+(g-u),g=_-b,u=_-g,Op[1]=_-(g+u)+(u-b),w=v+g,u=w-v,Op[2]=v-(w-u)+(g-u),Op[3]=w;const O=Ep(D,Lp,4,Op,Dp);return Dp[O-1]}(t,e,n,r,i,a,l)}const qp=Math.pow(2,-52),Up=new Uint32Array(512);class Np{static from(t,e=Hp,n=jp){const r=t.length,i=new Float64Array(2*r);for(let a=0;a<r;a++){const r=t[a];i[2*a]=e(r),i[2*a+1]=n(r)}return new Np(i)}constructor(t){const e=t.length>>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:r,_hullHash:i}=this,a=t.length>>1;let o=1/0,s=1/0,A=-1/0,l=-1/0;for(let e=0;e<a;e++){const n=t[2*e],r=t[2*e+1];n<o&&(o=n),r<s&&(s=r),n>A&&(A=n),r>l&&(l=r),this._ids[e]=e}const c=(o+A)/2,u=(s+l)/2;let h,d,f;for(let e=0,n=1/0;e<a;e++){const r=Bp(c,u,t[2*e],t[2*e+1]);r<n&&(h=e,n=r)}const p=t[2*h],m=t[2*h+1];for(let e=0,n=1/0;e<a;e++){if(e===h)continue;const r=Bp(p,m,t[2*e],t[2*e+1]);r<n&&r>0&&(d=e,n=r)}let g=t[2*d],v=t[2*d+1],_=1/0;for(let e=0;e<a;e++){if(e===h||e===d)continue;const n=Fp(p,m,g,v,t[2*e],t[2*e+1]);n<_&&(f=e,_=n)}let y=t[2*f],x=t[2*f+1];if(_===1/0){for(let e=0;e<a;e++)this._dists[e]=t[2*e]-t[0]||t[2*e+1]-t[1];zp(this._ids,this._dists,0,a-1);const e=new Uint32Array(a);let n=0;for(let t=0,r=-1/0;t<a;t++){const i=this._ids[t],a=this._dists[i];a>r&&(e[n++]=i,r=a)}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(Ip(p,m,g,v,y,x)<0){const t=d,e=g,n=v;d=f,g=y,v=x,f=t,y=e,x=n}const b=function(t,e,n,r,i,a){const o=n-t,s=r-e,A=i-t,l=a-e,c=o*o+s*s,u=A*A+l*l,h=.5/(o*l-s*A);return{x:t+(l*c-s*u)*h,y:e+(o*u-A*c)*h}}(p,m,g,v,y,x);this._cx=b.x,this._cy=b.y;for(let e=0;e<a;e++)this._dists[e]=Bp(t[2*e],t[2*e+1],b.x,b.y);zp(this._ids,this._dists,0,a-1),this._hullStart=h;let M=3;n[h]=e[f]=d,n[d]=e[h]=f,n[f]=e[d]=h,r[h]=0,r[d]=1,r[f]=2,i.fill(-1),i[this._hashKey(p,m)]=h,i[this._hashKey(g,v)]=d,i[this._hashKey(y,x)]=f,this.trianglesLen=0,this._addTriangle(h,d,f,-1,-1,-1);for(let a,o,s=0;s<this._ids.length;s++){const A=this._ids[s],l=t[2*A],c=t[2*A+1];if(s>0&&Math.abs(l-a)<=qp&&Math.abs(c-o)<=qp)continue;if(a=l,o=c,A===h||A===d||A===f)continue;let u=0;for(let t=0,e=this._hashKey(l,c);t<this._hashSize&&(u=i[(e+t)%this._hashSize],-1===u||u===n[u]);t++);u=e[u];let p,m=u;for(;p=n[m],Ip(l,c,t[2*m],t[2*m+1],t[2*p],t[2*p+1])>=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],Ip(l,c,t[2*v],t[2*v+1],t[2*p],t[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=e[m],Ip(l,c,t[2*p],t[2*p+1],t[2*m],t[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=e[A]=m,n[m]=e[v]=A,n[A]=v,i[this._hashKey(l,c)]=A,i[this._hashKey(t[2*m],t[2*m+1])]=m}this.hull=new Uint32Array(M);for(let t=0,e=this._hullStart;t<M;t++)this.hull[t]=e,e=n[e];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,e){return Math.floor(function(t,e){const n=t/(Math.abs(t)+Math.abs(e));return(e>0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:r}=this;let i=0,a=0;for(;;){const o=n[t],s=t-t%3;if(a=s+(t+2)%3,-1===o){if(0===i)break;t=Up[--i];continue}const A=o-o%3,l=s+(t+1)%3,c=A+(o+2)%3,u=e[a],h=e[t],d=e[l],f=e[c];if(kp(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])){e[t]=f,e[o]=u;const r=n[c];if(-1===r){let e=this._hullStart;do{if(this._hullTri[e]===c){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,r),this._link(o,n[a]),this._link(a,c);const s=A+(o+1)%3;i<Up.length&&(Up[i++]=s)}else{if(0===i)break;t=Up[--i]}}return a}_link(t,e){this._halfedges[t]=e,-1!==e&&(this._halfedges[e]=t)}_addTriangle(t,e,n,r,i,a){const o=this.trianglesLen;return this._triangles[o]=t,this._triangles[o+1]=e,this._triangles[o+2]=n,this._link(o,r),this._link(o+1,i),this._link(o+2,a),this.trianglesLen+=3,o}}function Bp(t,e,n,r){const i=t-n,a=e-r;return i*i+a*a}function kp(t,e,n,r,i,a,o,s){const A=t-o,l=e-s,c=n-o,u=r-s,h=i-o,d=a-s,f=c*c+u*u,p=h*h+d*d;return A*(u*p-f*d)-l*(c*p-f*h)+(A*A+l*l)*(c*d-u*h)<0}function Fp(t,e,n,r,i,a){const o=n-t,s=r-e,A=i-t,l=a-e,c=o*o+s*s,u=A*A+l*l,h=.5/(o*l-s*A),d=(l*c-s*u)*h,f=(o*u-A*c)*h;return d*d+f*f}function zp(t,e,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const r=t[i],a=e[r];let o=i-1;for(;o>=n&&e[t[o]]>a;)t[o+1]=t[o--];t[o+1]=r}else{let i=n+1,a=r;Gp(t,n+r>>1,i),e[t[n]]>e[t[r]]&&Gp(t,n,r),e[t[i]]>e[t[r]]&&Gp(t,i,r),e[t[n]]>e[t[i]]&&Gp(t,n,i);const o=t[i],s=e[o];for(;;){do{i++}while(e[t[i]]<s);do{a--}while(e[t[a]]>s);if(a<i)break;Gp(t,i,a)}t[n+1]=t[a],t[a]=o,r-i+1>=a-n?(zp(t,e,i,r),zp(t,e,n,a-1)):(zp(t,e,n,a-1),zp(t,e,i,r))}}function Gp(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Hp(t){return t[0]}function jp(t){return t[1]}function Vp(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var r,i=function(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}(t),a="Feature"===(r=e).type?r.geometry:r,o=a.type,s=e.bbox,A=a.coordinates;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(i,s))return!1;"Polygon"===o&&(A=[A]);for(var l=!1,c=0;c<A.length&&!l;c++)if(Wp(i,A[c][0],n.ignoreBoundary)){for(var u=!1,h=1;h<A[c].length&&!u;)Wp(i,A[c][h],!n.ignoreBoundary)&&(u=!0),h++;u||(l=!0)}return l}function Wp(t,e,n){var r=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var i=0,a=e.length-1;i<e.length;a=i++){var o=e[i][0],s=e[i][1],A=e[a][0],l=e[a][1];if(t[1]*(o-A)+s*(A-t[0])+l*(t[0]-o)==0&&(o-t[0])*(A-t[0])<=0&&(s-t[1])*(l-t[1])<=0)return!n;s>t[1]!=l>t[1]&&t[0]<(A-o)*(t[1]-s)/(l-s)+o&&(r=!r)}return r}const Xp=1e-6;class Qp{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){const r=(t=+t)+(n=+n),i=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>Xp||Math.abs(this._y1-i)>Xp)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,e,n,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class Yp{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class Zp{constructor(t,[e,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(e=+e)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=e,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:r}=this;let i,a;const o=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let r,s,A=0,l=0,c=n.length;A<c;A+=3,l+=2){const c=2*n[A],u=2*n[A+1],h=2*n[A+2],d=t[c],f=t[c+1],p=t[u],m=t[u+1],g=t[h],v=t[h+1],_=p-d,y=m-f,x=g-d,b=v-f,M=2*(_*b-y*x);if(Math.abs(M)<1e-9){if(void 0===i){i=a=0;for(const n of e)i+=t[2*n],a+=t[2*n+1];i/=e.length,a/=e.length}const n=1e9*Math.sign((i-d)*b-(a-f)*x);r=(d+g)/2-n*b,s=(f+v)/2+n*x}else{const t=1/M,e=_*_+y*y,n=x*x+b*b;r=d+(b*e-y*n)*t,s=f+(_*n-x*e)*t}o[l]=r,o[l+1]=s}let s,A,l,c=e[e.length-1],u=4*c,h=t[2*c],d=t[2*c+1];r.fill(0);for(let n=0;n<e.length;++n)c=e[n],s=u,A=h,l=d,u=4*c,h=t[2*c],d=t[2*c+1],r[s+2]=r[u]=l-d,r[s+3]=r[u+1]=h-A}render(t){const e=null==t?t=new Qp:void 0,{delaunay:{halfedges:n,inedges:r,hull:i},circumcenters:a,vectors:o}=this;if(i.length<=1)return null;for(let e=0,r=n.length;e<r;++e){const r=n[e];if(r<e)continue;const i=2*Math.floor(e/3),o=2*Math.floor(r/3),s=a[i],A=a[i+1],l=a[o],c=a[o+1];this._renderSegment(s,A,l,c,t)}let s,A=i[i.length-1];for(let e=0;e<i.length;++e){s=A,A=i[e];const n=2*Math.floor(r[A]/3),l=a[n],c=a[n+1],u=4*s,h=this._project(l,c,o[u+2],o[u+3]);h&&this._renderSegment(l,c,h[0],h[1],t)}return e&&e.value()}renderBounds(t){const e=null==t?t=new Qp:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),e&&e.value()}renderCell(t,e){const n=null==e?e=new Qp:void 0,r=this._clip(t);if(null===r||!r.length)return;e.moveTo(r[0],r[1]);let i=r.length;for(;r[0]===r[i-2]&&r[1]===r[i-1]&&i>1;)i-=2;for(let t=2;t<i;t+=2)r[t]===r[t-2]&&r[t+1]===r[t-1]||e.lineTo(r[t],r[t+1]);return e.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let e=0,n=t.length/2;e<n;++e){const t=this.cellPolygon(e);t&&(t.index=e,yield t)}}cellPolygon(t){const e=new Yp;return this.renderCell(t,e),e.value()}_renderSegment(t,e,n,r,i){let a;const o=this._regioncode(t,e),s=this._regioncode(n,r);0===o&&0===s?(i.moveTo(t,e),i.lineTo(n,r)):(a=this._clipSegment(t,e,n,r,o,s))&&(i.moveTo(a[0],a[1]),i.lineTo(a[2],a[3]))}contains(t,e,n){return(e=+e)==e&&(n=+n)==n&&this.delaunay._step(t,e,n)===t}*neighbors(t){const e=this._clip(t);if(e)for(const n of this.delaunay.neighbors(t)){const t=this._clip(n);if(t)t:for(let r=0,i=e.length;r<i;r+=2)for(let a=0,o=t.length;a<o;a+=2)if(e[r]===t[a]&&e[r+1]===t[a+1]&&e[(r+2)%i]===t[(a+o-2)%o]&&e[(r+3)%i]===t[(a+o-1)%o]){yield n;break t}}}_cell(t){const{circumcenters:e,delaunay:{inedges:n,halfedges:r,triangles:i}}=this,a=n[t];if(-1===a)return null;const o=[];let s=a;do{const n=Math.floor(s/3);if(o.push(e[2*n],e[2*n+1]),s=s%3==2?s-2:s+1,i[s]!==t)break;s=r[s]}while(s!==a&&-1!==s);return o}_clip(t){if(0===t&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const e=this._cell(t);if(null===e)return null;const{vectors:n}=this,r=4*t;return this._simplify(n[r]||n[r+1]?this._clipInfinite(t,e,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(t,e))}_clipFinite(t,e){const n=e.length;let r,i,a,o,s=null,A=e[n-2],l=e[n-1],c=this._regioncode(A,l),u=0;for(let h=0;h<n;h+=2)if(r=A,i=l,A=e[h],l=e[h+1],a=c,c=this._regioncode(A,l),0===a&&0===c)o=u,u=0,s?s.push(A,l):s=[A,l];else{let e,n,h,d,f;if(0===a){if(null===(e=this._clipSegment(r,i,A,l,a,c)))continue;[n,h,d,f]=e}else{if(null===(e=this._clipSegment(A,l,r,i,c,a)))continue;[d,f,n,h]=e,o=u,u=this._edgecode(n,h),o&&u&&this._edge(t,o,u,s,s.length),s?s.push(n,h):s=[n,h]}o=u,u=this._edgecode(d,f),o&&u&&this._edge(t,o,u,s,s.length),s?s.push(d,f):s=[d,f]}if(s)o=u,u=this._edgecode(s[0],s[1]),o&&u&&this._edge(t,o,u,s,s.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return s}_clipSegment(t,e,n,r,i,a){const o=i<a;for(o&&([t,e,n,r,i,a]=[n,r,t,e,a,i]);;){if(0===i&&0===a)return o?[n,r,t,e]:[t,e,n,r];if(i&a)return null;let s,A,l=i||a;8&l?(s=t+(n-t)*(this.ymax-e)/(r-e),A=this.ymax):4&l?(s=t+(n-t)*(this.ymin-e)/(r-e),A=this.ymin):2&l?(A=e+(r-e)*(this.xmax-t)/(n-t),s=this.xmax):(A=e+(r-e)*(this.xmin-t)/(n-t),s=this.xmin),i?(t=s,e=A,i=this._regioncode(t,e)):(n=s,r=A,a=this._regioncode(n,r))}}_clipInfinite(t,e,n,r,i,a){let o,s=Array.from(e);if((o=this._project(s[0],s[1],n,r))&&s.unshift(o[0],o[1]),(o=this._project(s[s.length-2],s[s.length-1],i,a))&&s.push(o[0],o[1]),s=this._clipFinite(t,s))for(let e,n=0,r=s.length,i=this._edgecode(s[r-2],s[r-1]);n<r;n+=2)e=i,i=this._edgecode(s[n],s[n+1]),e&&i&&(n=this._edge(t,e,i,s,n),r=s.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(t,e,n,r,i){for(;e!==n;){let n,a;switch(e){case 5:e=4;continue;case 4:e=6,n=this.xmax,a=this.ymin;break;case 6:e=2;continue;case 2:e=10,n=this.xmax,a=this.ymax;break;case 10:e=8;continue;case 8:e=9,n=this.xmin,a=this.ymax;break;case 9:e=1;continue;case 1:e=5,n=this.xmin,a=this.ymin}r[i]===n&&r[i+1]===a||!this.contains(t,n,a)||(r.splice(i,0,n,a),i+=2)}return i}_project(t,e,n,r){let i,a,o,s=1/0;if(r<0){if(e<=this.ymin)return null;(i=(this.ymin-e)/r)<s&&(o=this.ymin,a=t+(s=i)*n)}else if(r>0){if(e>=this.ymax)return null;(i=(this.ymax-e)/r)<s&&(o=this.ymax,a=t+(s=i)*n)}if(n>0){if(t>=this.xmax)return null;(i=(this.xmax-t)/n)<s&&(a=this.xmax,o=e+(s=i)*r)}else if(n<0){if(t<=this.xmin)return null;(i=(this.xmin-t)/n)<s&&(a=this.xmin,o=e+(s=i)*r)}return[a,o]}_edgecode(t,e){return(t===this.xmin?1:t===this.xmax?2:0)|(e===this.ymin?4:e===this.ymax?8:0)}_regioncode(t,e){return(t<this.xmin?1:t>this.xmax?2:0)|(e<this.ymin?4:e>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let e=0;e<t.length;e+=2){const n=(e+2)%t.length,r=(e+4)%t.length;(t[e]===t[n]&&t[n]===t[r]||t[e+1]===t[n+1]&&t[n+1]===t[r+1])&&(t.splice(n,2),e-=2)}t.length||(t=null)}return t}}const Kp=2*Math.PI,Jp=Math.pow;function $p(t){return t[0]}function tm(t){return t[1]}function em(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class nm{static from(t,e=$p,n=tm,r){return new nm("length"in t?function(t,e,n,r){const i=t.length,a=new Float64Array(2*i);for(let o=0;o<i;++o){const i=t[o];a[2*o]=e.call(r,i,o,t),a[2*o+1]=n.call(r,i,o,t)}return a}(t,e,n,r):Float64Array.from(function*(t,e,n,r){let i=0;for(const a of t)yield e.call(r,a,i,t),yield n.call(r,a,i,t),++i}(t,e,n,r)))}constructor(t){this._delaunator=new Np(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t<e.length;t+=3){const r=2*e[t],i=2*e[t+1],a=2*e[t+2];if((n[a]-n[r])*(n[i+1]-n[r+1])-(n[i]-n[r])*(n[a+1]-n[r+1])>1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},((t,e)=>e)).sort(((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]));const t=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let t=0,n=e.length/2;t<n;++t){const n=em(e[2*t],e[2*t+1],i);e[2*t]=n[0],e[2*t+1]=n[1]}this._delaunator=new Np(e)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,a=this.inedges.fill(-1),o=this._hullIndex.fill(-1);for(let t=0,e=n.length;t<e;++t){const e=i[t%3==2?t-2:t+1];-1!==n[t]&&-1!==a[e]||(a[e]=t)}for(let t=0,e=r.length;t<e;++t)o[r[t]]=t;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],a[r[0]]=1,2===r.length&&(a[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new Zp(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:r,halfedges:i,triangles:a,collinear:o}=this;if(o){const e=o.indexOf(t);return e>0&&(yield o[e-1]),void(e<o.length-1&&(yield o[e+1]))}const s=e[t];if(-1===s)return;let A=s,l=-1;do{if(yield l=a[A],A=A%3==2?A-2:A+1,a[A]!==t)return;if(A=i[A],-1===A){const e=n[(r[t]+1)%n.length];return void(e!==l&&(yield e))}}while(A!==s)}find(t,e,n=0){if((t=+t)!=t||(e=+e)!=e)return-1;const r=n;let i;for(;(i=this._step(n,t,e))>=0&&i!==n&&i!==r;)n=i;return i}_step(t,e,n){const{inedges:r,hull:i,_hullIndex:a,halfedges:o,triangles:s,points:A}=this;if(-1===r[t]||!A.length)return(t+1)%(A.length>>1);let l=t,c=Jp(e-A[2*t],2)+Jp(n-A[2*t+1],2);const u=r[t];let h=u;do{let r=s[h];const u=Jp(e-A[2*r],2)+Jp(n-A[2*r+1],2);if(u<c&&(c=u,l=r),h=h%3==2?h-2:h+1,s[h]!==t)break;if(h=o[h],-1===h){if(h=i[(a[t]+1)%i.length],h!==r&&Jp(e-A[2*h],2)+Jp(n-A[2*h+1],2)<c)return h;break}}while(h!==u);return l}render(t){const e=null==t?t=new Qp:void 0,{points:n,halfedges:r,triangles:i}=this;for(let e=0,a=r.length;e<a;++e){const a=r[e];if(a<e)continue;const o=2*i[e],s=2*i[a];t.moveTo(n[o],n[o+1]),t.lineTo(n[s],n[s+1])}return this.renderHull(t),e&&e.value()}renderPoints(t,e){void 0!==e||t&&"function"==typeof t.moveTo||(e=t,t=null),e=null==e?2:+e;const n=null==t?t=new Qp:void 0,{points:r}=this;for(let n=0,i=r.length;n<i;n+=2){const i=r[n],a=r[n+1];t.moveTo(i+e,a),t.arc(i,a,e,0,Kp)}return n&&n.value()}renderHull(t){const e=null==t?t=new Qp:void 0,{hull:n,points:r}=this,i=2*n[0],a=n.length;t.moveTo(r[i],r[i+1]);for(let e=1;e<a;++e){const i=2*n[e];t.lineTo(r[i],r[i+1])}return t.closePath(),e&&e.value()}hullPolygon(){const t=new Yp;return this.renderHull(t),t.value()}renderTriangle(t,e){const n=null==e?e=new Qp:void 0,{points:r,triangles:i}=this,a=2*i[t*=3],o=2*i[t+1],s=2*i[t+2];return e.moveTo(r[a],r[a+1]),e.lineTo(r[o],r[o+1]),e.lineTo(r[s],r[s+1]),e.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:t}=this;for(let e=0,n=t.length/3;e<n;++e)yield this.trianglePolygon(e)}trianglePolygon(t){const e=new Yp;return this.renderTriangle(t,e),e.value()}}const rm=Math.PI,im=rm/2,am=180/rm,om=rm/180,sm=Math.atan2,Am=Math.cos,lm=Math.max,cm=Math.min,um=Math.sin,hm=Math.sign||function(t){return t>0?1:t<0?-1:0},dm=Math.sqrt;function fm(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function pm(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function mm(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function gm(t){var e=dm(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);return[t[0]/e,t[1]/e,t[2]/e]}function vm(t){return[sm(t[1],t[0])*am,(e=lm(-1,cm(1,t[2])),(e>1?im:e<-1?-im:Math.asin(e))*am)];var e}function _m(t){const e=t[0]*om,n=t[1]*om,r=Am(n);return[r*Am(e),r*um(e),um(n)]}function ym(t){return fm((t=t.map((t=>_m(t))))[0],pm(t[2],t[1]))}function xm(t){const e=function(t){if(t.length<2)return{};let e=0;for(;isNaN(t[e][0]+t[e][1])&&e++<t.length;);const n=function(t){function e(e){return(e=t(e[0]*jl,e[1]*jl))[0]*=Hl,e[1]*=Hl,e}return t=Tu(t[0]*jl,t[1]*jl,t.length>2?t[2]*jl:0),e.invert=function(e){return(e=t.invert(e[0]*jl,e[1]*jl))[0]*=Hl,e[1]*=Hl,e},e}(t[e]),r=Oh().translate([0,0]).scale(1).rotate(n.invert([180,0]));t=t.map(r);const i=[];let a=1;for(let e=0,n=t.length;e<n;e++){let n=t[e][0]**2+t[e][1]**2;!isFinite(n)||n>1e32?i.push(e):n>a&&(a=n)}const o=1e6*dm(a);i.forEach((e=>t[e]=[o,0])),t.push([0,o]),t.push([-o,0]),t.push([0,-o]);const s=nm.from(t);s.projection=r;const{triangles:A,halfedges:l,inedges:c}=s;for(let n=0,r=l.length;n<r;n++)if(l[n]<0){const t=n%3==2?n-2:n+1,r=n%3==0?n+2:n-1,i=l[t],a=l[r];l[i]=a,l[a]=i,l[t]=l[r]=-1,A[n]=A[t]=A[r]=e,c[A[i]]=i%3==0?i+2:i-1,c[A[a]]=a%3==0?a+2:a-1,n+=2-n%3}else A[n]>t.length-3-1&&(A[n]=e);return s}(t),n=function(t){const{triangles:e}=t;if(!e)return[];const n=[];for(let t=0,r=e.length/3;t<r;t++){const r=e[3*t],i=e[3*t+1],a=e[3*t+2];r!==i&&i!==a&&n.push([r,a,i])}return n}(e),r=function(t,e){const n=new Set;return 2===e.length?[[0,1]]:(t.forEach((t=>{if(t[0]!==t[1]&&!(ym(t.map((t=>e[t])))<0))for(let e,r=0;r<3;r++)e=(r+1)%3,n.add(Cl([t[r],t[e]]).join("-"))})),Array.from(n,(t=>t.split("-").map(Number))))}(n,t),i=function(t,e){const n=[];t.forEach((t=>{for(let e=0;e<3;e++){const r=t[e],i=t[(e+1)%3];n[r]=n[r]||[],n[r].push(i)}})),0===t.length&&(2===e?(n[0]=[1],n[1]=[0]):1===e&&(n[0]=[]));return n}(n,t.length),a=function(t,e){function n(t,e){let n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return n*n+r*r+i*i}return function(r,i,a){void 0===a&&(a=0);let o,s,A=a;const l=_m([r,i]);do{o=a,a=null,s=n(l,_m(e[o])),t[o].forEach((t=>{let r=n(l,_m(e[t]));if(r<s)return s=r,a=t,void(A=t)}))}while(null!==a);return A}}(i,t),o=function(t,e){return t.map((t=>{const n=t.map((t=>e[t])).map(_m);return vm(gm(mm(mm(pm(n[1],n[0]),pm(n[2],n[1])),pm(n[0],n[2]))))}))}(n,t),{polygons:s,centers:A}=function(t,e,n){const r=[],i=t.slice();if(0===e.length){if(n.length<2)return{polygons:r,centers:i};if(2===n.length){const t=_m(n[0]),e=_m(n[1]),a=gm(mm(t,e)),s=gm(pm(t,e)),A=pm(a,s),l=[a,pm(a,A),pm(pm(a,A),A),pm(pm(pm(a,A),A),A)].map(vm).map(o);return r.push(l),r.push(l.slice().reverse()),{polygons:r,centers:i}}}e.forEach(((t,e)=>{for(let n=0;n<3;n++){const i=t[n],a=t[(n+1)%3],o=t[(n+2)%3];r[i]=r[i]||[],r[i].push([a,o,e,[i,a,o]])}}));const a=r.map((t=>{const e=[t[0][2]];let r=t[0][1];for(let n=1;n<t.length;n++)for(let n=0;n<t.length;n++)if(t[n][0]==r){r=t[n][1],e.push(t[n][2]);break}if(e.length>2)return e;if(2==e.length){const r=bm(n[t[0][3][0]],n[t[0][3][1]],i[e[0]]),a=bm(n[t[0][3][2]],n[t[0][3][0]],i[e[0]]),s=o(r),A=o(a);return[e[0],A,e[1],s]}}));function o(t){let n=-1;return i.slice(e.length,1/0).forEach(((r,i)=>{r[0]===t[0]&&r[1]===t[1]&&(n=i+e.length)})),n<0&&(n=i.length,i.push(t)),n}return{polygons:a,centers:i}}(o,n,t),l=function(t){const e=[];return t.forEach((t=>{if(!t)return;let n=t[t.length-1];for(let r of t)r>n&&e.push([n,r]),n=r})),e}(s),c=function(t,e){const n=new Set,r=[];t.map((t=>{if(!(ym(t.map((t=>e[t>e.length?0:t])))>1e-12))for(let e=0;e<3;e++){let r=[t[e],t[(e+1)%3]],i=`${r[0]}-${r[1]}`;n.has(i)?n.delete(i):n.add(`${r[1]}-${r[0]}`)}}));const i=new Map;let a;if(n.forEach((t=>{t=t.split("-").map(Number),i.set(t[0],t[1]),a=t[0]})),void 0===a)return r;let o=a;do{r.push(o);let t=i.get(o);i.set(o,-1),o=t}while(o>-1&&o!==a);return r}(n,t),u=function(t,e){return function(n){const r=new Map,i=new Map;return t.forEach(((t,e)=>{const a=t.join("-");r.set(a,n[e]),i.set(a,!0)})),e.forEach((t=>{let e=0,n=-1;for(let i=0;i<3;i++){let a=Cl([t[i],t[(i+1)%3]]).join("-");r.get(a)>e&&(e=r.get(a),n=a)}i.set(n,!1)})),t.map((t=>i.get(t.join("-"))))}}(r,n);return{delaunay:e,edges:r,triangles:n,centers:A,neighbors:i,polygons:s,mesh:l,hull:c,urquhart:u,find:a}}function bm(t,e,n){t=_m(t),e=_m(e),n=_m(n);const r=hm(fm(pm(e,t),n));return vm(gm(mm(t,e)).map((t=>r*t)))}function Mm(t,e,n){return e=Tm(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,wm()?Reflect.construct(e,n||[],Tm(t).constructor):e.apply(t,n))}function wm(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(wm=function(){return!!t})()}function Em(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function Sm(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Em(r.key),r)}}function Tm(t){return Tm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Tm(t)}function Cm(t,e){return Cm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Cm(t,e)}function Rm(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Lm(t,e)||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 Pm(t){return function(t){if(Array.isArray(t))return Dm(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Lm(t)||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 Lm(t,e){if(t){if("string"==typeof t)return Dm(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dm(t,e):void 0}}function Dm(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Om(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).resolution,n=void 0===e?1/0:e,r=function(t,e){return t.map((function(t){var n,r=[];return t.forEach((function(t){if(n){var i=180*rh(t,n)/Math.PI;if(i>e)for(var a=ph(n,t),o=1/Math.ceil(i/e),s=o;s<1;)r.push(a(s)),s+=o}r.push(n=t)})),r}))}(t,n),i=ql(r),a=function(t,e){var n={type:"Polygon",coordinates:t},r=hu(n),i=Rm(r,2),a=Rm(i[0],2),o=a[0],s=a[1],A=Rm(i[1],2),l=A[0],c=A[1];if(Math.min(Math.abs(l-o),Math.abs(c-s))<e)return[];var u=o>l||c>=89||s<=-89;return function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.minLng,r=e.maxLng,i=e.minLat,a=e.maxLat,o=Math.round(Math.pow(360/t,2)/Math.PI),s=(1+Math.sqrt(5))/2,A=function(t){return t/s*360%360-180},l=function(t){return Math.acos(2*t/o-1)/Math.PI*180-90},c=function(t){return o*(Math.cos((t+90)*Math.PI/180)+1)/2},u=[void 0!==a?Math.ceil(c(a)):0,void 0!==i?Math.floor(c(i)):o-1],h=void 0===n&&void 0===r?function(){return!0}:void 0===n?function(t){return t<=r}:void 0===r?function(t){return t>=n}:r>=n?function(t){return t>=n&&t<=r}:function(t){return t>=n||t<=r},d=[],f=u[0];f<=u[1];f++){var p=A(f);h(p)&&d.push([p,l(f)])}return d}(e,{minLng:o,maxLng:l,minLat:s,maxLat:c}).filter((function(t){return Im(t,n,u)}))}(t,n),o=[].concat(Pm(i),Pm(a)),s={type:"Polygon",coordinates:t},A=Rm(hu(s),2),l=Rm(A[0],2),c=l[0],u=l[1],h=Rm(A[1],2),d=h[0],f=h[1],p=c>d||f>=89||u<=-89,m=[];if(p){var g=function(t){const e=function(t){if(e.delaunay=null,e._data=t,"object"==typeof e._data&&"FeatureCollection"===e._data.type&&(e._data=e._data.features),"object"==typeof e._data){const t=e._data.map((t=>[e._vx(t),e._vy(t),t])).filter((t=>isFinite(t[0]+t[1])));e.points=t.map((t=>[t[0],t[1]])),e.valid=t.map((t=>t[2])),e.delaunay=xm(e.points)}return e};return e._vx=function(t){return"object"==typeof t&&"type"in t?wu(t)[0]:0 in t?t[0]:void 0},e._vy=function(t){return"object"==typeof t&&"type"in t?wu(t)[1]:1 in t?t[1]:void 0},e.x=function(t){return t?(e._vx=t,e):e._vx},e.y=function(t){return t?(e._vy=t,e):e._vy},e.polygons=function(t){if(void 0!==t&&e(t),!e.delaunay)return!1;const n={type:"FeatureCollection",features:[]};return 0===e.valid.length||(e.delaunay.polygons.forEach(((t,r)=>n.features.push({type:"Feature",geometry:t?{type:"Polygon",coordinates:[[...t,t[0]].map((t=>e.delaunay.centers[t]))]}:null,properties:{site:e.valid[r],sitecoordinates:e.points[r],neighbours:e.delaunay.neighbors[r]}}))),1===e.valid.length&&n.features.push({type:"Feature",geometry:{type:"Sphere"},properties:{site:e.valid[0],sitecoordinates:e.points[0],neighbours:[]}})),n},e.triangles=function(t){return void 0!==t&&e(t),!!e.delaunay&&{type:"FeatureCollection",features:e.delaunay.triangles.map(((t,n)=>((t=t.map((t=>e.points[t]))).center=e.delaunay.centers[n],t))).filter((t=>ym(t)>0)).map((t=>({type:"Feature",properties:{circumcenter:t.center},geometry:{type:"Polygon",coordinates:[[...t,t[0]]]}})))}},e.links=function(t){if(void 0!==t&&e(t),!e.delaunay)return!1;const n=e.delaunay.edges.map((t=>rh(e.points[t[0]],e.points[t[1]]))),r=e.delaunay.urquhart(n);return{type:"FeatureCollection",features:e.delaunay.edges.map(((t,i)=>({type:"Feature",properties:{source:e.valid[t[0]],target:e.valid[t[1]],length:n[i],urquhart:!!r[i]},geometry:{type:"LineString",coordinates:[e.points[t[0]],e.points[t[1]]]}})))}},e.mesh=function(t){return void 0!==t&&e(t),!!e.delaunay&&{type:"MultiLineString",coordinates:e.delaunay.edges.map((t=>[e.points[t[0]],e.points[t[1]]]))}},e.cellMesh=function(t){if(void 0!==t&&e(t),!e.delaunay)return!1;const{centers:n,polygons:r}=e.delaunay,i=[];for(const t of r)if(t)for(let e=t.length,r=t[e-1],a=t[0],o=0;o<e;r=a,a=t[++o])a>r&&i.push([n[r],n[a]]);return{type:"MultiLineString",coordinates:i}},e._found=void 0,e.find=function(t,n,r){if(e._found=e.delaunay.find(t,n,e._found),!r||rh([t,n],e.points[e._found])<r)return e._found},e.hull=function(t){void 0!==t&&e(t);const n=e.delaunay.hull,r=e.points;return 0===n.length?null:{type:"Polygon",coordinates:[[...n.map((t=>r[t])),r[n[0]]]]}},t?e(t):e}(o).triangles(),v=new Map(o.map((function(t,e){var n=Rm(t,2),r=n[0],i=n[1];return["".concat(r,"-").concat(i),e]})));g.features.forEach((function(t){var e,n=t.geometry.coordinates[0].slice(0,3).reverse(),r=[];if(n.forEach((function(t){var e=Rm(t,2),n=e[0],i=e[1],a="".concat(n,"-").concat(i);v.has(a)&&r.push(v.get(a))})),3===r.length){if(r.some((function(t){return t<i.length})))if(!Im(t.properties.circumcenter,s,p))return;(e=m).push.apply(e,r)}}))}else if(a.length)for(var _=Np.from(o),y=function(t){var e,n=[2,1,0].map((function(e){return _.triangles[t+e]})),r=n.map((function(t){return o[t]}));if(n.some((function(t){return t<i.length}))){var a=[0,1].map((function(t){return function(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(a=+a)>=a&&(++n,r+=a)}if(n)return r/n}(r,(function(e){return e[t]}))}));if(!Im(a,s,p))return 1}(e=m).push.apply(e,Pm(n))},x=0,b=_.triangles.length;x<b;x+=3)y(x);else{var M=bl.flatten(r),w=M.vertices,E=M.holes;m=bl(w,void 0===E?[]:E,2)}var S=bp(Cl(o,(function(t){return t[0]})),[0,1]),T=bp(Cl(o,(function(t){return t[1]})),[0,1]),C=o.map((function(t){var e=Rm(t,2),n=e[0],r=e[1];return[S(n),T(r)]}));return{contour:r,triangles:{points:o,indices:m,uvs:C}}}function Im(t,e){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?function(t,e){return(t&&ih.hasOwnProperty(t.type)?ih[t.type]:oh)(t,e)}(e,t):Vp(t,e)}var qm=window.THREE?window.THREE:{BufferGeometry:zn,Float32BufferAttribute:On},Um=(new qm.BufferGeometry).setAttribute?"setAttribute":"addAttribute",Nm=function(t){function e(t,n,r,i,a,o,s){var A;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(A=Mm(this,e)).type="ConicPolygonBufferGeometry",A.parameters={polygonGeoJson:t,startHeight:n,endHeight:r,closedBottom:i,closedTop:a,includeSides:o,curvatureResolution:s},n=n||0,r=r||1,i=void 0===i||i,a=void 0===a||a,o=void 0===o||o;var l=Om(t,{resolution:s=s||5}),c=l.contour,u=l.triangles,h=ql(u.uvs),d=[],f=[],p=[],m=0,g=function(t){var e=Math.round(d.length/3),n=p.length;d=d.concat(t.vertices),f=f.concat(t.uvs),p=p.concat(e?t.indices.map((function(t){return t+e})):t.indices),A.addGroup(n,p.length-n,m++)};function v(t,e){var n=t.map((function(t){return t.map((function(t){var n=Rm(t,2),r=n[0];return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-t)*Math.PI/180,i=(90-e)*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,e)}))}));return bl.flatten(n)}function _(t){return{indices:!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?u.indices:u.indices.slice().reverse(),vertices:v([u.points],t).vertices,uvs:h}}return o&&g(function(){for(var t=v(c,n),e=t.vertices,i=t.holes,a=v(c,r).vertices,o=ql([a,e]),s=Math.round(a.length/3),A=new Set(i),l=0,u=[],h=0;h<s;h++){var d=h+1;if(d===s)d=l;else if(A.has(d)){var f=d;d=l,l=f}u.push(h,h+s,d+s),u.push(d+s,d,h)}for(var p=[],m=1;m>=0;m--)for(var g=0;g<s;g+=1)p.push(g/(s-1),m);return{indices:u,vertices:o,uvs:p}}()),i&&g(_(n,!1)),a&&g(_(r,!0)),A.setIndex(p),A[Um]("position",new qm.Float32BufferAttribute(d,3)),A[Um]("uv",new qm.Float32BufferAttribute(f,2)),A.computeVertexNormals(),A}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Cm(t,e)}(e,t),n=e,r&&Sm(n.prototype,r),i&&Sm(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(qm.BufferGeometry);var Bm=function(t){var e,n=void 0!==(t=t||{})?t:{},r={};for(e in n)n.hasOwnProperty(e)&&(r[e]=n[e]);var i,a,o,s,A=!1;i="object"==typeof window,a="function"==typeof importScripts,o="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,A=o&&!i&&!a,s=!i&&!A&&!a;var l,c,u,h,d,f="";A?(f=__dirname+"/",l=function(t,e){var n;return(n=rt(t))||(h||(h=require("fs")),d||(d=require("path")),t=d.normalize(t),n=h.readFileSync(t)),e?n:n.toString()},u=function(t){var e=l(t,!0);return e.buffer||(e=new Uint8Array(e)),_(e.buffer),e},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),n.inspect=function(){return"[Emscripten Module object]"}):s?("undefined"!=typeof read&&(l=function(t){var e=rt(t);return e?et(e):read(t)}),u=function(t){var e;return(e=rt(t))?e:"function"==typeof readbuffer?new Uint8Array(readbuffer(t)):(_("object"==typeof(e=read(t,"binary"))),e)},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(i||a)&&(a?f=self.location.href:"undefined"!=typeof document&&document.currentScript&&(f=document.currentScript.src),f=0!==f.indexOf("blob:")?f.substr(0,f.lastIndexOf("/")+1):"",l=function(t){try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText}catch(e){var n=rt(t);if(n)return et(n);throw e}},a&&(u=function(t){try{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}catch(e){var n=rt(t);if(n)return n;throw e}}),c=function(t,e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){if(200==r.status||0==r.status&&r.response)e(r.response);else{var i=rt(t);i?e(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(e in r)r.hasOwnProperty(e)&&(n[e]=r[e]);r=null,n.arguments&&n.arguments,n.thisProgram&&n.thisProgram;var g=0;var v=!1;function _(t,e){t||gt("Assertion failed: "+e)}function y(t){var e=n["_"+t];return _(e,"Cannot call unknown function "+t+", make sure it is exported"),e}function x(t,e,n,r,i){var a={string:function(t){var e=0;if(null!=t&&0!==t){var n=1+(t.length<<2);(function(t,e,n){(function(t,e,n,r){if(!(r>0))return 0;for(var i=n,a=n+r-1,o=0;o<t.length;++o){var s=t.charCodeAt(o);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&t.charCodeAt(++o);if(s<=127){if(n>=a)break;e[n++]=s}else if(s<=2047){if(n+1>=a)break;e[n++]=192|s>>6,e[n++]=128|63&s}else if(s<=65535){if(n+2>=a)break;e[n++]=224|s>>12,e[n++]=128|s>>6&63,e[n++]=128|63&s}else{if(n+3>=a)break;e[n++]=240|s>>18,e[n++]=128|s>>12&63,e[n++]=128|s>>6&63,e[n++]=128|63&s}}e[n]=0})(t,w,e,n)})(t,e=At(n),n)}return e},array:function(t){var e=At(t.length);return function(t,e){M.set(t,e)}(t,e),e}};var o=y(t),s=[],A=0;if(r)for(var l=0;l<r.length;l++){var c=a[n[l]];c?(0===A&&(A=ct()),s[l]=c(r[l])):s[l]=r[l]}var u=o.apply(null,s);return u=function(t){return"string"===e?P(t):"boolean"===e?Boolean(t):t}(u),0!==A&&lt(A),u}var b,M,w,E,S,T,C,R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function P(t,e){return t?function(t,e,n){for(var r=e+n,i=e;t[i]&&!(i>=r);)++i;if(i-e>16&&t.subarray&&R)return R.decode(t.subarray(e,i));for(var a="";e<i;){var o=t[e++];if(128&o){var s=63&t[e++];if(192!=(224&o)){var A=63&t[e++];if((o=224==(240&o)?(15&o)<<12|s<<6|A:(7&o)<<18|s<<12|A<<6|63&t[e++])<65536)a+=String.fromCharCode(o);else{var l=o-65536;a+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else a+=String.fromCharCode((31&o)<<6|s)}else a+=String.fromCharCode(o)}return a}(w,t,e):""}function L(t,e){return t%e>0&&(t+=e-t%e),t}function D(t){b=t,n.HEAP8=M=new Int8Array(t),n.HEAP16=E=new Int16Array(t),n.HEAP32=S=new Int32Array(t),n.HEAPU8=w=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=new Uint32Array(t),n.HEAPF32=T=new Float32Array(t),n.HEAPF64=C=new Float64Array(t)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var O=n.TOTAL_MEMORY||33554432;function I(t){for(;t.length>0;){var e=t.shift();if("function"!=typeof e){var r=e.func;"number"==typeof r?void 0===e.arg?n.dynCall_v(r):n.dynCall_vi(r,e.arg):r(void 0===e.arg?null:e.arg)}else e()}}O=(b=n.buffer?n.buffer:new ArrayBuffer(O)).byteLength,D(b),S[6032]=5267040;var q=[],U=[],N=[],B=[];var k=Math.abs,F=Math.ceil,z=Math.floor,G=Math.min,H=0,j=null;n.preloadedImages={},n.preloadedAudios={};var V,W,X=null,Q="data:application/octet-stream;base64,";function Y(t){return String.prototype.startsWith?t.startsWith(Q):0===t.indexOf(Q)}X="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAH6iBfbytuk/Gq6akm/58z/Xrm0Liez0P5doSdOpSwRAWs602ULg8D/dT7Rcbo/1v1N1RQHFNOM/g9Snx7HW3L8HWsP8Q3jfP6VwOLosutk/9rjk1YQcxj+gnmKMsNn6P/HDeuPFY+M/YHwDjqKhB0Ci19/fCVrbP4UxKkDWOP6/pvljWa09tL9wi7wrQXjnv/Z6yLImkM2/3yTlOzY14D+m+WNZrT20PzwKVQnrQwNA9nrIsiaQzT/g40rFrRQFwPa45NWEHMa/kbslHEZq97/xw3rjxWPjv4cLC2SMBci/otff3wla27+rKF5oIAv0P1N1RQHFNOO/iDJPGyWHBUAHWsP8Q3jfvwQf/by16gXAfqIF9vK26b8XrO0Vh0r+v9eubQuJ7PS/BxLrA0ZZ479azrTZQuDwv1MK1EuItPw/yscgV9Z6FkAwHBR2WjQMQJNRzXsQ5vY/GlUHVJYKF0DONuFv2lMNQNCGZ28QJfk/0WUwoIL36D8ggDOMQuATQNqMOeAy/wZAWFYOYM+M2z/LWC4uH3oSQDE+LyTsMgRAkJzhRGWFGEDd4soovCQQQKqk0DJMEP8/rGmNdwOLBUAW2X/9xCbjP4hu3dcqJhNAzuYItRvdB0CgzW3zJW/sPxotm/Y2TxRAQAk9XmdDDEC1Kx9MKgT3P1M+NctcghZAFVqcLlb0C0Bgzd3sB2b2P77mZDPUWhZAFROHJpUGCEDAfma5CxXtPz1DWq/zYxRAmhYY5824F0DOuQKWSbAOQNCMqrvu3fs/L6DR22K2wT9nAAxPBU8RQGiN6mW43AFAZhu25b633D8c1YgmzowSQNM25BRKWARArGS08/lNxD+LFssHwmMRQLC5aNcxBgJABL9HT0WRF0CjCmJmOGEOQHsuaVzMP/s/TWJCaGGwBUCeu1PAPLzjP9nqN9DZOBNAKE4JcydbCkCGtbd1qjPzP8dgm9U8jhVAtPeKTkVwDkCeCLss5l37P401XMPLmBdAFd29VMVQDUBg0yA55h75Pz6odcYLCRdApBM4rBrkAkDyAVWgQxbRP4XDMnK20hFAymLlF7EmzD8GUgo9XBHlP3lbK7T9COc/k+OhPthhy7+YGEpnrOvCPzBFhLs15u4/epbqB6H4uz9IuuLF5svev6lzLKY31es/CaQ0envF5z8ZY0xlUADXv7zaz7HYEuI/CfbK1sn16T8uAQfWwxLWPzKn/YuFN94/5KdbC1AFu793fyCSnlfvPzK2y4doAMY/NRg5t1/X6b/shq4QJaHDP5yNIAKPOeI/vpn7BSE30r/X4YQrO6nrv78Ziv/Thto/DqJ1Y6+y5z9l51NaxFrlv8QlA65HOLS/86dxiEc96z+Hj0+LFjneP6LzBZ8LTc2/DaJ1Y6+y579l51NaxFrlP8QlA65HOLQ/8qdxiEc967+Jj0+LFjnev6LzBZ8LTc0/1qdbC1AFuz93fyCSnlfvvzK2y4doAMa/NRg5t1/X6T/vhq4QJaHDv5yNIAKPOeK/wJn7BSE30j/W4YQrO6nrP78Ziv/Thtq/CaQ0envF578XY0xlUADXP7zaz7HYEuK/CvbK1sn16b8rAQfWwxLWvzKn/YuFN96/zWLlF7EmzL8GUgo9XBHlv3lbK7T9COe/kOOhPthhyz+cGEpnrOvCvzBFhLs15u6/c5bqB6H4u79IuuLF5sveP6lzLKY31eu/AQAAAP////8HAAAA/////zEAAAD/////VwEAAP////9hCQAA/////6dBAAD/////kcsBAP/////3kAwA/////8H2VwAAAAAAAAAAAAAAAAACAAAA/////w4AAAD/////YgAAAP////+uAgAA/////8ISAAD/////ToMAAP////8ilwMA/////+4hGQD/////gu2vAAAAAAAAAAAAAAAAAAAAAAACAAAA//////////8BAAAAAwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////AgAAAP//////////AQAAAAAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD/////////////////////AQAAAP///////////////wIAAAD///////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP///////////////////////////////wIAAAD///////////////8BAAAA/////////////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAABAAAA//////////8CAAAA//////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAAAQAAAP//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAOgehWlKfUEEz1zLi+JsiQa2og3wcMfVAWCbHorc0yEDi+Yn/Y6mbQJ11/mfsnG9At6bnG4UQQkBvMCQWKqUUQJVmwwswmOc/3hVgVBL3uj//qqOEOdGOPw/WDN4gnGE/H3ANkCUgND+AA8btKgAHPwTXBqJVSdo+XfRQAqsKrj4fc+zLYbSPQklEmCZHv2FCUP+uDso1NEKYtPhwphUHQptxnyFXYdpB7CddZAMmrkGAt1AxSTqBQUibBVdTsFNBSuX3MV+AJkFocv82SLf5QAqmgj7AY81A23VDSEnLoEDGEJVSeDFzQDYrqvBk70VA8U157pcRGUBWfEF+ZKbsP7KBdLHZTpFAqKYk69AqekDbeGY41MdjQD8AZzHK501A1vcrrjubNkD5LnquvBYhQCbiRRD71QlAqt72EbOH8z8Eu+jL1YbdP4uaox/xUcY/abedg1XfsD+BsUdzJ4KZP5wE9YFySIM/rW1kAKMpbT+rZFthVRhWPy4PKlXIs0A/qMZLlwDnMEHByqEF0I0ZQQYSFD8lUQNBPpY+dFs07UAH8BZImBPWQN9RY0I0sMBA2T7kLfc6qUByFYvfhBKTQMq+0Mis1XxA0XQbeQXMZUBJJ5aEGXpQQP7/SY0a6ThAaMD92b/UIkAs8s8yqXoMQNIegOvCk/U/aOi7NZJP4D8AAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAD/////AAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAA/////wAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAP////8AAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////BQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAEAAQAAAQEAAAAAAAEAAAABAAAAAQABAAAAAAAAAAAAAAAAAAAAAAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAAGFsZ29zLmMAaDNOZWlnaGJvclJvdGF0aW9ucwBjb29yZGlqay5jAF91cEFwN0NoZWNrZWQAX3VwQXA3ckNoZWNrZWQAZGlyZWN0ZWRFZGdlLmMAZGlyZWN0ZWRFZGdlVG9Cb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0NlbGxCb3VuZGFyeQBhZGphY2VudEZhY2VEaXJbY2VudGVySUpLLmZhY2VdW2ZhY2UyXSA9PSBLSQBfZmFjZUlqa1RvQ2VsbEJvdW5kYXJ5AGgzSW5kZXguYwBjb21wYWN0Q2VsbHMAbGF0TG5nVG9DZWxsAGNlbGxUb0NoaWxkUG9zAHZhbGlkYXRlQ2hpbGRQb3MAbGF0TG5nLmMAY2VsbEFyZWFSYWRzMgBwb2x5Z29uLT5uZXh0ID09IE5VTEwAbGlua2VkR2VvLmMAYWRkTmV3TGlua2VkUG9seWdvbgBuZXh0ICE9IE5VTEwAbG9vcCAhPSBOVUxMAGFkZE5ld0xpbmtlZExvb3AAcG9seWdvbi0+Zmlyc3QgPT0gTlVMTABhZGRMaW5rZWRMb29wAGNvb3JkICE9IE5VTEwAYWRkTGlua2VkQ29vcmQAbG9vcC0+Zmlyc3QgPT0gTlVMTABpbm5lckxvb3BzICE9IE5VTEwAbm9ybWFsaXplTXVsdGlQb2x5Z29uAGJib3hlcyAhPSBOVUxMAGNhbmRpZGF0ZXMgIT0gTlVMTABmaW5kUG9seWdvbkZvckhvbGUAY2FuZGlkYXRlQkJveGVzICE9IE5VTEwAcmV2RGlyICE9IElOVkFMSURfRElHSVQAbG9jYWxpai5jAGNlbGxUb0xvY2FsSWprAGJhc2VDZWxsICE9IG9yaWdpbkJhc2VDZWxsACEob3JpZ2luT25QZW50ICYmIGluZGV4T25QZW50KQBiYXNlQ2VsbCA9PSBvcmlnaW5CYXNlQ2VsbABiYXNlQ2VsbCAhPSBJTlZBTElEX0JBU0VfQ0VMTABsb2NhbElqa1RvQ2VsbAAhX2lzQmFzZUNlbGxQZW50YWdvbihiYXNlQ2VsbCkAYmFzZUNlbGxSb3RhdGlvbnMgPj0gMABncmlkUGF0aENlbGxzADAAdmVydGV4LmMAY2VsbFRvVmVydGV4AGdyYXBoLT5idWNrZXRzICE9IE5VTEwAdmVydGV4R3JhcGguYwBpbml0VmVydGV4R3JhcGgAbm9kZSAhPSBOVUxMAGFkZFZlcnRleE5vZGU=";function Z(t){return t}function K(t){return t.replace(/\b__Z[\w\d_]+/g,(function(t){return t===t?t:t+" ["+t+"]"}))}function J(){var t=new Error;if(!t.stack){try{throw new Error(0)}catch(e){t=e}if(!t.stack)return"(no stack trace available)"}return t.stack.toString()}function $(){return M.length}function tt(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(M),at(e),D(e),1}catch(t){}}function et(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];r>255&&(r&=255),e.push(String.fromCharCode(r))}return e.join("")}var nt="function"==typeof atob?atob:function(t){var e,n,r,i,a,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",A="",l=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=s.indexOf(t.charAt(l++))<<2|(i=s.indexOf(t.charAt(l++)))>>4,n=(15&i)<<4|(a=s.indexOf(t.charAt(l++)))>>2,r=(3&a)<<6|(o=s.indexOf(t.charAt(l++))),A+=String.fromCharCode(e),64!==a&&(A+=String.fromCharCode(n)),64!==o&&(A+=String.fromCharCode(r))}while(l<t.length);return A};function rt(t){if(Y(t))return function(t){if("boolean"==typeof A&&A){var e;try{e=Buffer.from(t,"base64")}catch(n){e=new Buffer(t,"base64")}return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}try{for(var n=nt(t),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}catch(t){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(Q.length))}var it=function(t,e,n){var r=new t.Int8Array(n),i=new t.Int32Array(n);new t.Uint8Array(n),new t.Float32Array(n);var a=new t.Float64Array(n),o=0|e.o,s=0|e.p,A=t.Math.floor,l=t.Math.abs,c=t.Math.sqrt,u=t.Math.pow,h=t.Math.cos,d=t.Math.sin,f=t.Math.tan,p=t.Math.acos,m=t.Math.asin,g=t.Math.atan,v=t.Math.atan2,_=t.Math.ceil,y=t.Math.imul,x=t.Math.min,b=t.Math.max,M=t.Math.clz32,w=e.b,E=e.c,S=e.d,T=e.e,C=e.f,R=e.g,P=e.h,L=e.i,D=24160;function O(t,e,n,r){return 0|I(t|=0,e|=0,n|=0,r|=0,0)}function I(t,e,n,r,a){var o,s=0,A=0,l=0,c=0;if(o=D,D=D+16|0,A=o,!(0|q(t|=0,e|=0,n|=0,r|=0,a|=0)))return D=o,0|(r=0);do{if((0|n)>=0){if((0|n)>13780509){if(0|(s=0|ee(15,A)))break;A=0|i[(l=A)>>2],l=0|i[l+4>>2]}else c=0|Ne(0|n,0|(s=((0|n)<0)<<31>>31),3,0),l=0|E(),s=0|De(0|n,0|s,1,0),s=0|De(0|(s=0|Ne(0|c,0|l,0|s,0|E())),0|E(),1,0),l=0|E(),i[A>>2]=s,i[A+4>>2]=l,A=s;if(Xe(0|r,0,A<<3|0),0|a){Xe(0|a,0,A<<2|0),s=0|U(t,e,n,r,a,A,l,0);break}(s=0|Le(A,4))?(c=0|U(t,e,n,r,s,A,l,0),Pe(s),s=c):s=13}else s=2}while(0);return D=o,0|(c=s)}function q(t,e,n,r,a){t|=0,e|=0,n|=0,r|=0,a|=0;var o,s,A=0,l=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0;if(s=D,D=D+16|0,m=s+8|0,i[(p=o=s)>>2]=t,i[p+4>>2]=e,(0|n)<0)return D=s,0|(m=2);if(i[(A=r)>>2]=t,i[A+4>>2]=e,(A=0!=(0|a))&&(i[a>>2]=0),0|Nt(t,e))return D=s,0|(m=9);i[m>>2]=0;t:do{if((0|n)>=1)if(A)for(d=1,h=0,f=0,p=1,A=t;;){if(!(h|f)){if(0|(A=0|N(A,e,4,m,o)))break t;if(0|Nt(A=0|i[(e=o)>>2],e=0|i[e+4>>2])){A=9;break t}}if(0|(A=0|N(A,e,0|i[22384+(f<<2)>>2],m,o)))break t;if(A=0|i[(e=o)>>2],e=0|i[e+4>>2],i[(t=r+(d<<3)|0)>>2]=A,i[t+4>>2]=e,i[a+(d<<2)>>2]=p,l=(0|(t=h+1|0))==(0|p),u=6==(0|(c=f+1|0)),0|Nt(A,e)){A=9;break t}if((0|(p=p+(u&l&1)|0))>(0|n)){A=0;break}d=d+1|0,h=l?0:t,f=l?u?0:c:f}else for(d=1,h=0,f=0,p=1,A=t;;){if(!(h|f)){if(0|(A=0|N(A,e,4,m,o)))break t;if(0|Nt(A=0|i[(e=o)>>2],e=0|i[e+4>>2])){A=9;break t}}if(0|(A=0|N(A,e,0|i[22384+(f<<2)>>2],m,o)))break t;if(A=0|i[(e=o)>>2],e=0|i[e+4>>2],i[(t=r+(d<<3)|0)>>2]=A,i[t+4>>2]=e,l=(0|(t=h+1|0))==(0|p),u=6==(0|(c=f+1|0)),0|Nt(A,e)){A=9;break t}if((0|(p=p+(u&l&1)|0))>(0|n)){A=0;break}d=d+1|0,h=l?0:t,f=l?u?0:c:f}else A=0}while(0);return D=s,0|(m=A)}function U(t,e,n,r,a,o,s,A){n|=0,r|=0,a|=0,A|=0;var l,c,u,h=0,d=0,f=0,p=0,m=0,g=0,v=0;if(u=D,D=D+16|0,l=u+8|0,c=u,h=0|ke(0|(t|=0),0|(e|=0),0|(o|=0),0|(s|=0)),f=0|E(),!(0==(0|(v=0|i[(g=p=r+(h<<3)|0)>>2]))&0==(0|(g=0|i[g+4>>2]))|(d=(0|v)==(0|t)&(0|g)==(0|e))))do{h=0|Be(0|(h=0|De(0|h,0|f,1,0)),0|E(),0|o,0|s),f=0|E(),d=(0|(g=0|i[(v=p=r+(h<<3)|0)>>2]))==(0|t)&(0|(v=0|i[v+4>>2]))==(0|e)}while(!(0==(0|g)&0==(0|v)|d));if(h=a+(h<<2)|0,d&&(0|i[h>>2])<=(0|A))return D=u,0|(v=0);if(i[(v=p)>>2]=t,i[v+4>>2]=e,i[h>>2]=A,(0|A)>=(0|n))return D=u,0|(v=0);switch(d=A+1|0,i[l>>2]=0,0|(h=0|N(t,e,2,l,c))){case 9:m=9;break;case 0:(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,d))||(m=9)}t:do{if(9==(0|m)){switch(i[l>>2]=0,0|(h=0|N(t,e,3,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,d)))break t;break;default:break t}switch(i[l>>2]=0,0|(h=0|N(t,e,1,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,d)))break t;break;default:break t}switch(i[l>>2]=0,0|(h=0|N(t,e,5,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,d)))break t;break;default:break t}switch(i[l>>2]=0,0|(h=0|N(t,e,4,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,d)))break t;break;default:break t}switch(i[l>>2]=0,0|(h=0|N(t,e,6,l,c))){case 9:break;case 0:if(0|(h=0|U(0|i[(h=c)>>2],0|i[h+4>>2],n,r,a,o,s,d)))break t;break;default:break t}return D=u,0|(v=0)}}while(0);return D=u,0|(v=h)}function N(t,e,n,r,a){t|=0,e|=0,a|=0;var o,s,A=0,l=0,c=0,u=0,h=0,d=0,f=0;if((n|=0)>>>0>6)return 0|(a=1);if(h=(0|i[(r|=0)>>2])%6|0,i[r>>2]=h,(0|h)>0){A=0;do{n=0|ft(n),A=A+1|0}while((0|A)<(0|i[r>>2]))}if(h=0|ze(0|t,0|e,45),E(),(s=127&h)>>>0>121)return 0|(a=5);o=0|Bt(t,e),A=0|ze(0|t,0|e,52),E(),A&=15;t:do{if(A){for(;;){if(c=0|ze(0|t,0|e,0|(l=3*(15-A|0)|0)),E(),7==(0|(c&=7))){e=5;break}if(f=0==(0|Ht(A)),A=A+-1|0,d=0|Ge(7,0,0|l),e&=~(0|E()),t=0|Ge(0|i[(f?432:16)+(28*c|0)+(n<<2)>>2],0,0|l)|t&~d,e|=l=0|E(),!(n=0|i[(f?640:224)+(28*c|0)+(n<<2)>>2])){n=0;break t}if(!A){u=8;break t}}return 0|e}u=8}while(0);8==(0|u)&&(t|=0|Ge(0|(f=0|i[848+(28*s|0)+(n<<2)>>2]),0,45),e=0|E()|-1040385&e,n=0|i[4272+(28*s|0)+(n<<2)>>2],127==(127&f|0)&&(f=0|Ge(0|i[848+(28*s|0)+20>>2],0,45),e=0|E()|-1040385&e,n=0|i[4272+(28*s|0)+20>>2],t=0|Ft(f|t,e),e=0|E(),i[r>>2]=1+(0|i[r>>2]))),c=0|ze(0|t,0|e,45),E(),c&=127;t:do{if(0|F(c)){e:do{if(1==(0|Bt(t,e))){if((0|s)!=(0|c)){if(0|j(c,0|i[7696+(28*s|0)>>2])){t=0|Gt(t,e),l=1,e=0|E();break}S(23313,22416,436,22424)}switch(0|o){case 3:t=0|Ft(t,e),e=0|E(),i[r>>2]=1+(0|i[r>>2]),l=0;break e;case 5:t=0|Gt(t,e),e=0|E(),i[r>>2]=5+(0|i[r>>2]),l=0;break e;case 0:return 0|(f=9);default:return 0|(f=1)}}else l=0}while(0);if((0|n)>0){A=0;do{t=0|kt(t,e),e=0|E(),A=A+1|0}while((0|A)!=(0|n))}if((0|s)!=(0|c)){if(!(0|z(c))){if(0!=(0|l)|5!=(0|Bt(t,e)))break;i[r>>2]=1+(0|i[r>>2]);break}switch(127&h){case 8:case 118:break t}3!=(0|Bt(t,e))&&(i[r>>2]=1+(0|i[r>>2]))}}else if((0|n)>0){A=0;do{t=0|Ft(t,e),e=0|E(),A=A+1|0}while((0|A)!=(0|n))}}while(0);return i[r>>2]=((0|i[r>>2])+n|0)%6|0,i[(f=a)>>2]=t,i[f+4>>2]=e,0|(f=0)}function B(t,e,n,r){n|=0,r|=0;var a,o,s,A=0,l=0;for(s=D,D=D+16|0,a=s,o=s+8|0,A=(A=0==(0|Nt(t|=0,e|=0)))?1:2;;){if(i[o>>2]=0,0==(0|N(t,e,A,o,a))&((0|i[(l=a)>>2])==(0|n)?(0|i[l+4>>2])==(0|r):0)){t=4;break}if((A=A+1|0)>>>0>=7){A=7,t=4;break}}return 4==(0|t)?(D=s,0|A):0}function k(t,e,n,r,o,s,A){e|=0,n|=0,r|=0,o|=0,s|=0,A|=0;var l,c,u,h,d,f,p,m,g,v,_=0,y=0,x=0,b=0,M=0,w=0,S=0,T=0,C=0,R=0,P=0,L=0,O=0,I=0,q=0,U=0,N=0,B=0,k=0;if(v=D,D=D+64|0,p=v+48|0,m=v+32|0,g=v+24|0,l=v+8|0,c=v,(0|(y=0|i[(t|=0)>>2]))<=0)return D=v,0|(q=0);for(u=t+4|0,h=p+8|0,d=m+8|0,f=l+8|0,_=0,O=0;;){L=(x=0|i[u>>2])+(O<<4)|0,i[p>>2]=i[L>>2],i[p+4>>2]=i[L+4>>2],i[p+8>>2]=i[L+8>>2],i[p+12>>2]=i[L+12>>2],(0|O)==(y+-1|0)?(i[m>>2]=i[x>>2],i[m+4>>2]=i[x+4>>2],i[m+8>>2]=i[x+8>>2],i[m+12>>2]=i[x+12>>2]):(L=x+(O+1<<4)|0,i[m>>2]=i[L>>2],i[m+4>>2]=i[L+4>>2],i[m+8>>2]=i[L+8>>2],i[m+12>>2]=i[L+12>>2]),y=0|Z(p,m,r,g);t:do{if(y)x=0,_=y;else if(y=0|i[(x=g)>>2],(0|(x=0|i[x+4>>2]))>0|0==(0|x)&y>>>0>0){P=0,L=0;e:for(;;){if(k=+a[p>>3],B=+((R=0|Oe(0|y,0|x,0|P,0|L))>>>0)+4294967296*+(0|E()),U=+(y>>>0)+4294967296*+(0|x),N=+(P>>>0)+4294967296*+(0|L),a[l>>3]=k*B/U+ +a[m>>3]*N/U,a[f>>3]=+a[h>>3]*B/U+ +a[d>>3]*N/U,0|(y=0|jt(l,r,c))){_=y;break}w=0|ke(0|(C=0|i[(R=c)>>2]),0|(R=0|i[R+4>>2]),0|e,0|n),b=0|E(),x=0|i[(M=y=A+(w<<3)|0)>>2],M=0|i[M+4>>2];n:do{if(0==(0|x)&0==(0|M))I=y,q=16;else for(S=0,T=0;;){if((0|S)>(0|n)|(0|S)==(0|n)&T>>>0>e>>>0){_=1;break e}if((0|x)==(0|C)&(0|M)==(0|R))break n;if(w=0|Be(0|(y=0|De(0|w,0|b,1,0)),0|E(),0|e,0|n),b=0|E(),T=0|De(0|T,0|S,1,0),S=0|E(),0==(0|(x=0|i[(M=y=A+(w<<3)|0)>>2]))&0==(0|(M=0|i[M+4>>2]))){I=y,q=16;break}}}while(0);if(16!=(0|q)||(q=0,0==(0|C)&0==(0|R))||(i[(T=I)>>2]=C,i[T+4>>2]=R,T=s+(i[o>>2]<<3)|0,i[T>>2]=C,i[T+4>>2]=R,T=0|De(0|i[(T=o)>>2],0|i[T+4>>2],1,0),C=0|E(),i[(R=o)>>2]=T,i[R+4>>2]=C),P=0|De(0|P,0|L,1,0),L=0|E(),y=0|i[(x=g)>>2],!((0|(x=0|i[x+4>>2]))>(0|L)|(0|x)==(0|L)&y>>>0>P>>>0)){x=1;break t}}x=0}else x=1}while(0);if(O=O+1|0,!x){q=21;break}if((0|O)>=(0|(y=0|i[t>>2]))){_=0,q=21;break}}return 21==(0|q)?(D=v,0|_):0}function F(t){return(t|=0)>>>0>121?0|(t=0):0|(t=0|i[7696+(28*t|0)+16>>2])}function z(t){return 4==(0|(t|=0))|117==(0|t)|0}function G(t){return 0|i[11120+(216*(0|i[(t|=0)>>2])|0)+(72*(0|i[t+4>>2])|0)+(24*(0|i[t+8>>2])|0)+(i[t+12>>2]<<3)>>2]}function H(t){return 0|i[11120+(216*(0|i[(t|=0)>>2])|0)+(72*(0|i[t+4>>2])|0)+(24*(0|i[t+8>>2])|0)+(i[t+12>>2]<<3)+4>>2]}function j(t,e){return e|=0,(0|i[7696+(28*(t|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|i[7696+(28*t|0)+24>>2])==(0|e))}function V(t,e){return 0|i[848+(28*(t|=0)|0)+((e|=0)<<2)>>2]}function W(t,e){return e|=0,(0|i[848+(28*(t|=0)|0)>>2])==(0|e)?0|(e=0):(0|i[848+(28*t|0)+4>>2])==(0|e)?0|(e=1):(0|i[848+(28*t|0)+8>>2])==(0|e)?0|(e=2):(0|i[848+(28*t|0)+12>>2])==(0|e)?0|(e=3):(0|i[848+(28*t|0)+16>>2])==(0|e)?0|(e=4):(0|i[848+(28*t|0)+20>>2])==(0|e)?0|(e=5):0|((0|i[848+(28*t|0)+24>>2])==(0|e)?6:7)}function X(t){return+a[(t|=0)+16>>3]<+a[t+24>>3]|0}function Q(t,e){t|=0;var n,r,i=0;return(i=+a[(e|=0)>>3])>=+a[t+8>>3]&&i<=+a[t>>3]?(n=+a[t+16>>3],i=+a[t+24>>3],e=(r=+a[e+8>>3])>=i,t=r<=n&1,n<i?e&&(t=1):e||(t=0),0|(e=0!=(0|t))):0|(e=0)}function Y(t,e,n){t|=0,e|=0,n|=0;var r,s,c,u,h,d,f,p=0,m=0,g=0,v=0,y=0,b=0,M=0;d=D,D=D+288|0,h=d+264|0,v=d+96|0,m=(p=g=d)+96|0;do{i[p>>2]=0,p=p+4|0}while((0|p)<(0|m));return 0|(e=0|Yt(e,g))?(D=d,0|(b=e)):(Xt(g=0|i[(m=g)>>2],m=0|i[m+4>>2],h),Qt(g,m,v),u=+te(h,v+8|0),a[h>>3]=+a[t>>3],a[(m=h+8|0)>>3]=+a[t+16>>3],a[v>>3]=+a[t+8>>3],a[(g=v+8|0)>>3]=+a[t+24>>3],s=+te(h,v),M=+a[m>>3]-+a[g>>3],c=+l(+M),f=+a[h>>3]-+a[v>>3],r=+l(+f),0==M|0==f||(M=+He(+c,+r),M=+_(+s*s/+je(+M/+je(+c,+r),3)/(u*(2.59807621135*u)*.8)),a[o>>3]=M,y=~~M>>>0,b=+l(M)>=1?M>0?~~+x(+A(M/4294967296),4294967295)>>>0:~~+_((M-+(~~M>>>0))/4294967296)>>>0:0,2146435072==(2146435072&i[o+4>>2]|0))?e=1:(v=0==(0|y)&0==(0|b),i[(e=n)>>2]=v?1:y,i[e+4>>2]=v?0:b,e=0),D=d,0|(b=e))}function Z(t,e,n,r){t|=0,e|=0,n|=0,r|=0;var s,c,u,h,d=0,f=0,p=0;h=D,D=D+288|0,c=h+264|0,u=h+96|0,s=(d=f=h)+96|0;do{i[d>>2]=0,d=d+4|0}while((0|d)<(0|s));return 0|(n=0|Yt(n,f))?(D=h,0|(r=n)):(Xt(d=0|i[(n=f)>>2],n=0|i[n+4>>2],c),Qt(d,n,u),p=+te(c,u+8|0),p=+_(+ +te(t,e)/(2*p)),a[o>>3]=p,n=~~p>>>0,d=+l(p)>=1?p>0?~~+x(+A(p/4294967296),4294967295)>>>0:~~+_((p-+(~~p>>>0))/4294967296)>>>0:0,2146435072==(2146435072&i[o+4>>2]|0)?(D=h,0|(r=1)):(f=0==(0|n)&0==(0|d),i[r>>2]=f?1:n,i[r+4>>2]=f?0:d,D=h,0|(r=0)))}function K(t,e,n,r){e|=0,n|=0,r|=0,i[(t|=0)>>2]=e,i[t+4>>2]=n,i[t+8>>2]=r}function J(t,e){t|=0;var n,r,o,s,A=0,c=0,u=0,h=0,d=0,f=0,p=0;i[(s=(e|=0)+8|0)>>2]=0,r=+a[t>>3],h=+l(+r),o=+a[t+8>>3],h+=.5*(d=+l(+o)/.8660254037844386),h-=+(0|(A=~~h)),d-=+(0|(t=~~d));do{if(h<.5){if(h<.3333333333333333){if(i[e>>2]=A,d<.5*(h+1)){i[e+4>>2]=t;break}t=t+1|0,i[e+4>>2]=t;break}if(t=(1&!(d<(p=1-h)))+t|0,i[e+4>>2]=t,p<=d&d<2*h){A=A+1|0,i[e>>2]=A;break}i[e>>2]=A;break}if(!(h<.6666666666666666)){if(A=A+1|0,i[e>>2]=A,d<.5*h){i[e+4>>2]=t;break}t=t+1|0,i[e+4>>2]=t;break}if(d<1-h){if(i[e+4>>2]=t,2*h-1<d){i[e>>2]=A;break}}else t=t+1|0,i[e+4>>2]=t;A=A+1|0,i[e>>2]=A}while(0);do{if(r<0){if(1&t){A=~~(+(0|A)-(2*(+((f=0|Oe(0|A,((0|A)<0)<<31>>31|0,0|(f=(t+1|0)/2|0),((0|f)<0)<<31>>31|0))>>>0)+4294967296*+(0|E()))+1)),i[e>>2]=A;break}A=~~(+(0|A)-2*(+((f=0|Oe(0|A,((0|A)<0)<<31>>31|0,0|(f=(0|t)/2|0),((0|f)<0)<<31>>31|0))>>>0)+4294967296*+(0|E()))),i[e>>2]=A;break}}while(0);f=e+4|0,o<0&&(A=A-((1|t<<1)/2|0)|0,i[e>>2]=A,t=0-t|0,i[f>>2]=t),c=t-A|0,(0|A)<0?(u=0-A|0,i[f>>2]=c,i[s>>2]=u,i[e>>2]=0,t=c,A=0):u=0,(0|t)<0&&(A=A-t|0,i[e>>2]=A,u=u-t|0,i[s>>2]=u,i[f>>2]=0,t=0),n=A-u|0,c=t-u|0,(0|u)<0&&(i[e>>2]=n,i[f>>2]=c,i[s>>2]=0,t=c,A=n,u=0),(0|(c=(0|u)<(0|(c=(0|t)<(0|A)?t:A))?u:c))<=0||(i[e>>2]=A-c,i[f>>2]=t-c,i[s>>2]=u-c)}function $(t){var e,n=0,r=0,a=0,o=0,s=0;n=0|i[(t|=0)>>2],r=0|i[(e=t+4|0)>>2],(0|n)<0&&(r=r-n|0,i[e>>2]=r,i[(s=t+8|0)>>2]=(0|i[s>>2])-n,i[t>>2]=0,n=0),(0|r)<0?(n=n-r|0,i[t>>2]=n,o=(0|i[(s=t+8|0)>>2])-r|0,i[s>>2]=o,i[e>>2]=0,r=0):(s=o=t+8|0,o=0|i[o>>2]),(0|o)<0&&(n=n-o|0,i[t>>2]=n,r=r-o|0,i[e>>2]=r,i[s>>2]=0,o=0),(0|(a=(0|o)<(0|(a=(0|r)<(0|n)?r:n))?o:a))<=0||(i[t>>2]=n-a,i[e>>2]=r-a,i[s>>2]=o-a)}function tt(t,e){e|=0;var n,r;r=0|i[(t|=0)+8>>2],n=+((0|i[t+4>>2])-r|0),a[e>>3]=+((0|i[t>>2])-r|0)-.5*n,a[e+8>>3]=.8660254037844386*n}function et(t,e,n){t|=0,e|=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 nt(t,e,n){t|=0,e|=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 rt(t,e){e|=0;var n,r=0;r=0|y(0|i[(t|=0)>>2],e),i[t>>2]=r,n=0|y(0|i[(r=t+4|0)>>2],e),i[r>>2]=n,e=0|y(0|i[(t=t+8|0)>>2],e),i[t>>2]=e}function it(t){var e,n,r=0,a=0,o=0,s=0,A=0;A=(0|(n=0|i[(t|=0)>>2]))<0,t=(t=(a=(0|(s=((e=(0|(o=(0|i[t+4>>2])-(A?n:0)|0))<0)?0-o|0:0)+((0|i[t+8>>2])-(A?n:0))|0))<0)?0:s)-((o=(0|(a=(0|t)<(0|(a=(0|(r=(e?0:o)-(a?s:0)|0))<(0|(s=(A?0:n)-(e?o:0)-(a?s:0)|0))?r:s))?t:a))>0)?a:0)|0,r=r-(o?a:0)|0;t:do{switch(s-(o?a:0)|0){case 0:switch(0|r){case 0:return 0|(A=0==(0|t)?0:1==(0|t)?1:7);case 1:return 0|(A=0==(0|t)?2:1==(0|t)?3:7);default:break t}case 1:switch(0|r){case 0:return 0|(A=0==(0|t)?4:1==(0|t)?5:7);case 1:if(t)break t;return 0|(t=6);default:break t}}}while(0);return 0|(A=7)}function at(t){var e,n=0,r=0,a=0,o=0,s=0,A=0;o=0|i[(e=(t|=0)+8|0)>>2],s=(0|i[t>>2])-o|0,o=(0|i[(A=t+4|0)>>2])-o|0;do{if(s>>>0>715827881|o>>>0>715827881){if(r=(0|s)>0){if((2147483647-s|0)<(0|s))return 0|(A=1);if((2147483647-(s<<1)|0)<(0|s))return 0|(A=1)}else{if((-2147483648-s|0)>(0|s))return 0|(A=1);if((-2147483648-(s<<1)|0)>(0|s))return 0|(A=1)}if(n=3*s|0,(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(A=1)}else if((-2147483648-o|0)>(0|o))return 0|(A=1);if(a=o<<1,(0|s)>-1){if((-2147483648|n|0)>=(0|o))return 0|(A=1)}else if((-2147483648^n|0)<(0|o))return 0|(A=1);if(r){if(!((2147483647-s|0)<(0|a))){r=a;break}return 0|(n=1)}if(!((-2147483648-s|0)>(0|a))){r=a;break}return 0|(n=1)}r=o<<1,n=3*s|0}while(0);a=0|Ce(+(n-o|0)/7),i[t>>2]=a,o=0|Ce(+(r+s|0)/7),i[A>>2]=o,i[e>>2]=0,n=(r=(0|o)<(0|a))?a:o,r=r?o:a;do{if((0|r)<0){if((0|n)>0){if((-2147483648|n|0)<(0|r)&-2147483648!=(0|r)&(2147483647-n|0)>=(0|r))break;S(23313,22444,355,22455)}if(-2147483648==(0|r)|(-2147483648-n|0)>(0|r)&&S(23313,22444,355,22455),(0|n)>-1){if((-2147483648|n|0)<(0|r))break;S(23313,22444,355,22455)}else{if((-2147483648^n|0)>=(0|r))break;S(23313,22444,355,22455)}}}while(0);return n=o-a|0,(0|a)<0?(r=0-a|0,i[A>>2]=n,i[e>>2]=r,i[t>>2]=0,a=0):(n=o,r=0),(0|n)<0&&(a=a-n|0,i[t>>2]=a,r=r-n|0,i[e>>2]=r,i[A>>2]=0,n=0),s=a-r|0,o=n-r|0,(0|r)<0?(i[t>>2]=s,i[A>>2]=o,i[e>>2]=0,n=o,o=s,r=0):o=a,(0|(a=(0|r)<(0|(a=(0|n)<(0|o)?n:o))?r:a))<=0||(i[t>>2]=o-a,i[A>>2]=n-a,i[e>>2]=r-a),0|(A=0)}function ot(t){var e,n=0,r=0,a=0,o=0,s=0,A=0;o=0|i[(e=(t|=0)+8|0)>>2],s=(0|i[t>>2])-o|0,o=(0|i[(A=t+4|0)>>2])-o|0;do{if(s>>>0>715827881|o>>>0>715827881){if(r=(0|s)>0){if((2147483647-s|0)<(0|s))return 0|(A=1)}else if((-2147483648-s|0)>(0|s))return 0|(A=1);if(n=s<<1,(0|o)>0){if((2147483647-o|0)<(0|o))return 0|(A=1);if((2147483647-(o<<1)|0)<(0|o))return 0|(A=1)}else{if((-2147483648-o|0)>(0|o))return 0|(A=1);if((-2147483648-(o<<1)|0)>(0|o))return 0|(A=1)}if(a=3*o|0,r){if((2147483647-n|0)<(0|o))return 0|(A=1)}else if((-2147483648-n|0)>(0|o))return 0|(A=1);if((0|o)>-1){if((-2147483648|a|0)<(0|s)){r=a;break}return 0|(n=1)}if(!((-2147483648^a|0)<(0|s))){r=a;break}return 0|(n=1)}r=3*o|0,n=s<<1}while(0);a=0|Ce(+(n+o|0)/7),i[t>>2]=a,o=0|Ce(+(r-s|0)/7),i[A>>2]=o,i[e>>2]=0,n=(r=(0|o)<(0|a))?a:o,r=r?o:a;do{if((0|r)<0){if((0|n)>0){if((-2147483648|n|0)<(0|r)&-2147483648!=(0|r)&(2147483647-n|0)>=(0|r))break;S(23313,22444,404,22469)}if(-2147483648==(0|r)|(-2147483648-n|0)>(0|r)&&S(23313,22444,404,22469),(0|n)>-1){if((-2147483648|n|0)<(0|r))break;S(23313,22444,404,22469)}else{if((-2147483648^n|0)>=(0|r))break;S(23313,22444,404,22469)}}}while(0);return n=o-a|0,(0|a)<0?(r=0-a|0,i[A>>2]=n,i[e>>2]=r,i[t>>2]=0,a=0):(n=o,r=0),(0|n)<0&&(a=a-n|0,i[t>>2]=a,r=r-n|0,i[e>>2]=r,i[A>>2]=0,n=0),s=a-r|0,o=n-r|0,(0|r)<0?(i[t>>2]=s,i[A>>2]=o,i[e>>2]=0,n=o,o=s,r=0):o=a,(0|(a=(0|r)<(0|(a=(0|n)<(0|o)?n:o))?r:a))<=0||(i[t>>2]=o-a,i[A>>2]=n-a,i[e>>2]=r-a),0|(A=0)}function st(t){var e,n,r=0,a=0,o=0,s=0,A=0;a=0|i[(e=(t|=0)+8|0)>>2],o=0|Ce(+((3*(r=(0|i[t>>2])-a|0)|0)-(a=(0|i[(n=t+4|0)>>2])-a|0)|0)/7),i[t>>2]=o,r=0|Ce(+((a<<1)+r|0)/7),i[n>>2]=r,i[e>>2]=0,a=r-o|0,(0|o)<0?(A=0-o|0,i[n>>2]=a,i[e>>2]=A,i[t>>2]=0,r=a,o=0,a=A):a=0,(0|r)<0&&(o=o-r|0,i[t>>2]=o,a=a-r|0,i[e>>2]=a,i[n>>2]=0,r=0),A=o-a|0,s=r-a|0,(0|a)<0?(i[t>>2]=A,i[n>>2]=s,i[e>>2]=0,r=s,s=A,a=0):s=o,(0|(o=(0|a)<(0|(o=(0|r)<(0|s)?r:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=r-o,i[e>>2]=a-o)}function At(t){var e,n,r=0,a=0,o=0,s=0,A=0;a=0|i[(e=(t|=0)+8|0)>>2],o=0|Ce(+(((r=(0|i[t>>2])-a|0)<<1)+(a=(0|i[(n=t+4|0)>>2])-a|0)|0)/7),i[t>>2]=o,r=0|Ce(+((3*a|0)-r|0)/7),i[n>>2]=r,i[e>>2]=0,a=r-o|0,(0|o)<0?(A=0-o|0,i[n>>2]=a,i[e>>2]=A,i[t>>2]=0,r=a,o=0,a=A):a=0,(0|r)<0&&(o=o-r|0,i[t>>2]=o,a=a-r|0,i[e>>2]=a,i[n>>2]=0,r=0),A=o-a|0,s=r-a|0,(0|a)<0?(i[t>>2]=A,i[n>>2]=s,i[e>>2]=0,r=s,s=A,a=0):s=o,(0|(o=(0|a)<(0|(o=(0|r)<(0|s)?r:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=r-o,i[e>>2]=a-o)}function lt(t){var e,n,r,a=0,o=0,s=0,A=0;a=0|i[(t|=0)>>2],o=0|i[(n=t+4|0)>>2],s=0|i[(r=t+8|0)>>2],A=o+(3*a|0)|0,i[t>>2]=A,o=s+(3*o|0)|0,i[n>>2]=o,a=(3*s|0)+a|0,i[r>>2]=a,s=o-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=s,i[r>>2]=a,i[t>>2]=0,o=s,s=0):s=A,(0|o)<0&&(s=s-o|0,i[t>>2]=s,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=s-a|0,A=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=A,i[r>>2]=0,s=e,a=0):A=o,(0|(o=(0|a)<(0|(o=(0|A)<(0|s)?A:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=A-o,i[r>>2]=a-o)}function ct(t){var e,n,r,a=0,o=0,s=0,A=0;A=0|i[(t|=0)>>2],s=(3*(a=0|i[(n=t+4|0)>>2])|0)+A|0,A=(o=0|i[(r=t+8|0)>>2])+(3*A|0)|0,i[t>>2]=A,i[n>>2]=s,a=(3*o|0)+a|0,i[r>>2]=a,o=s-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=o,i[r>>2]=a,i[t>>2]=0,A=0):o=s,(0|o)<0&&(A=A-o|0,i[t>>2]=A,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=A-a|0,s=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=s,i[r>>2]=0,A=e,a=0):s=o,(0|(o=(0|a)<(0|(o=(0|s)<(0|A)?s:A))?a:o))<=0||(i[t>>2]=A-o,i[n>>2]=s-o,i[r>>2]=a-o)}function ut(t,e){t|=0;var n,r,a,o=0,s=0,A=0;((e|=0)+-1|0)>>>0>=6||(A=(0|i[15440+(12*e|0)>>2])+(0|i[t>>2])|0,i[t>>2]=A,a=t+4|0,s=(0|i[15440+(12*e|0)+4>>2])+(0|i[a>>2])|0,i[a>>2]=s,r=t+8|0,e=(0|i[15440+(12*e|0)+8>>2])+(0|i[r>>2])|0,i[r>>2]=e,o=s-A|0,(0|A)<0?(e=e-A|0,i[a>>2]=o,i[r>>2]=e,i[t>>2]=0,s=0):(o=s,s=A),(0|o)<0&&(s=s-o|0,i[t>>2]=s,e=e-o|0,i[r>>2]=e,i[a>>2]=0,o=0),n=s-e|0,A=o-e|0,(0|e)<0?(i[t>>2]=n,i[a>>2]=A,i[r>>2]=0,s=n,e=0):A=o,(0|(o=(0|e)<(0|(o=(0|A)<(0|s)?A:s))?e:o))<=0||(i[t>>2]=s-o,i[a>>2]=A-o,i[r>>2]=e-o))}function ht(t){var e,n,r,a=0,o=0,s=0,A=0;A=0|i[(t|=0)>>2],s=(a=0|i[(n=t+4|0)>>2])+A|0,A=(o=0|i[(r=t+8|0)>>2])+A|0,i[t>>2]=A,i[n>>2]=s,a=o+a|0,i[r>>2]=a,o=s-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=o,i[r>>2]=a,i[t>>2]=0,s=0):(o=s,s=A),(0|o)<0&&(s=s-o|0,i[t>>2]=s,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=s-a|0,A=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=A,i[r>>2]=0,s=e,a=0):A=o,(0|(o=(0|a)<(0|(o=(0|A)<(0|s)?A:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=A-o,i[r>>2]=a-o)}function dt(t){var e,n,r,a=0,o=0,s=0,A=0;a=0|i[(t|=0)>>2],s=0|i[(n=t+4|0)>>2],o=0|i[(r=t+8|0)>>2],A=s+a|0,i[t>>2]=A,s=o+s|0,i[n>>2]=s,a=o+a|0,i[r>>2]=a,o=s-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=o,i[r>>2]=a,i[t>>2]=0,s=0):(o=s,s=A),(0|o)<0&&(s=s-o|0,i[t>>2]=s,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=s-a|0,A=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=A,i[r>>2]=0,s=e,a=0):A=o,(0|(o=(0|a)<(0|(o=(0|A)<(0|s)?A:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=A-o,i[r>>2]=a-o)}function ft(t){switch(0|(t|=0)){case 1:t=5;break;case 5:t=4;break;case 4:t=6;break;case 6:t=2;break;case 2:t=3;break;case 3:t=1}return 0|t}function pt(t){switch(0|(t|=0)){case 1:t=3;break;case 3:t=2;break;case 2:t=6;break;case 6:t=4;break;case 4:t=5;break;case 5:t=1}return 0|t}function mt(t){var e,n,r,a=0,o=0,s=0,A=0;a=0|i[(t|=0)>>2],o=0|i[(n=t+4|0)>>2],s=0|i[(r=t+8|0)>>2],A=o+(a<<1)|0,i[t>>2]=A,o=s+(o<<1)|0,i[n>>2]=o,a=(s<<1)+a|0,i[r>>2]=a,s=o-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=s,i[r>>2]=a,i[t>>2]=0,o=s,s=0):s=A,(0|o)<0&&(s=s-o|0,i[t>>2]=s,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=s-a|0,A=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=A,i[r>>2]=0,s=e,a=0):A=o,(0|(o=(0|a)<(0|(o=(0|A)<(0|s)?A:s))?a:o))<=0||(i[t>>2]=s-o,i[n>>2]=A-o,i[r>>2]=a-o)}function gt(t){var e,n,r,a=0,o=0,s=0,A=0;A=0|i[(t|=0)>>2],s=((a=0|i[(n=t+4|0)>>2])<<1)+A|0,A=(o=0|i[(r=t+8|0)>>2])+(A<<1)|0,i[t>>2]=A,i[n>>2]=s,a=(o<<1)+a|0,i[r>>2]=a,o=s-A|0,(0|A)<0?(a=a-A|0,i[n>>2]=o,i[r>>2]=a,i[t>>2]=0,A=0):o=s,(0|o)<0&&(A=A-o|0,i[t>>2]=A,a=a-o|0,i[r>>2]=a,i[n>>2]=0,o=0),e=A-a|0,s=o-a|0,(0|a)<0?(i[t>>2]=e,i[n>>2]=s,i[r>>2]=0,A=e,a=0):s=o,(0|(o=(0|a)<(0|(o=(0|s)<(0|A)?s:A))?a:o))<=0||(i[t>>2]=A-o,i[n>>2]=s-o,i[r>>2]=a-o)}function vt(t,e){e|=0;var n,r,a,o=0,s=0,A=0;return a=(0|(r=(0|i[(t|=0)>>2])-(0|i[e>>2])|0))<0,n=(0|(s=(0|i[t+4>>2])-(0|i[e+4>>2])-(a?r:0)|0))<0,e=(e=(t=(0|(A=(a?0-r|0:0)+(0|i[t+8>>2])-(0|i[e+8>>2])+(n?0-s|0:0)|0))<0)?0:A)-((s=(0|(t=(0|e)<(0|(t=(0|(o=(n?0:s)-(t?A:0)|0))<(0|(A=(a?0:r)-(n?s:0)-(t?A:0)|0))?o:A))?e:t))>0)?t:0)|0,o=o-(s?t:0)|0,0|((0|(t=(0|(t=A-(s?t:0)|0))>-1?t:0-t|0))>(0|(e=(0|(o=(0|o)>-1?o:0-o|0))>(0|(e=(0|e)>-1?e:0-e|0))?o:e))?t:e)}function _t(t,e){e|=0;var n;n=0|i[(t|=0)+8>>2],i[e>>2]=(0|i[t>>2])-n,i[e+4>>2]=(0|i[t+4>>2])-n}function yt(t,e){e|=0;var n,r,a,o=0,s=0,A=0;s=0|i[(t|=0)>>2],i[e>>2]=s,A=0|i[t+4>>2],i[(r=e+4|0)>>2]=A,i[(a=e+8|0)>>2]=0,t=(o=(0|A)<(0|s))?s:A,o=o?A:s;do{if((0|o)<0){if((0|t)>0){if((-2147483648|t|0)<(0|o)&-2147483648!=(0|o)&(2147483647-t|0)>=(0|o))break;return 0|(t=1)}if(-2147483648==(0|o)|(-2147483648-t|0)>(0|o))return 0|(e=1);if((0|t)>-1){if((-2147483648|t|0)<(0|o))break;return 0|(t=1)}if(!((-2147483648^t|0)<(0|o)))break;return 0|(t=1)}}while(0);return t=A-s|0,(0|s)<0?(o=0-s|0,i[r>>2]=t,i[a>>2]=o,i[e>>2]=0,s=0):(t=A,o=0),(0|t)<0&&(s=s-t|0,i[e>>2]=s,o=o-t|0,i[a>>2]=o,i[r>>2]=0,t=0),n=s-o|0,A=t-o|0,(0|o)<0?(i[e>>2]=n,i[r>>2]=A,i[a>>2]=0,t=A,A=n,o=0):A=s,(0|(s=(0|o)<(0|(s=(0|t)<(0|A)?t:A))?o:s))<=0||(i[e>>2]=A-s,i[r>>2]=t-s,i[a>>2]=o-s),0|(e=0)}function xt(t){var e,n,r,a;n=(a=0|i[(e=(t|=0)+8|0)>>2])-(0|i[t>>2])|0,i[t>>2]=n,t=(0|i[(r=t+4|0)>>2])-a|0,i[r>>2]=t,i[e>>2]=0-(t+n)}function bt(t){var e,n,r=0,a=0,o=0,s=0,A=0;r=0-(a=0|i[(t|=0)>>2])|0,i[t>>2]=r,i[(e=t+8|0)>>2]=0,s=(o=0|i[(n=t+4|0)>>2])+a|0,(0|a)>0?(i[n>>2]=s,i[e>>2]=a,i[t>>2]=0,r=0,o=s):a=0,(0|o)<0?(A=r-o|0,i[t>>2]=A,a=a-o|0,i[e>>2]=a,i[n>>2]=0,s=A-a|0,r=0-a|0,(0|a)<0?(i[t>>2]=s,i[n>>2]=r,i[e>>2]=0,o=r,a=0):(o=0,s=A)):s=r,(0|(r=(0|a)<(0|(r=(0|o)<(0|s)?o:s))?a:r))<=0||(i[t>>2]=s-r,i[n>>2]=o-r,i[e>>2]=a-r)}function Mt(t,e,n){n|=0;var r,a,o=0,s=0;return a=D,D=D+16|0,r=a,s=-2130706433&(e|=0)|134217728,!0&268435456==(2013265920&e|0)?(o=0|ze(0|(t|=0),0|e,56),E(),o=0|function(t,e,n){t|=0,e|=0,n|=0;var r=0,a=0,o=0;if(o=D,D=D+16|0,a=o,r=0|Nt(t,e),(n+-1|0)>>>0>5)return D=o,0|(a=-1);if(r=0!=(0|r),1==(0|n)&r)return D=o,0|(a=-1);do{if(!(0|_e(t,e,a))){if(r){r=(5+(0|i[21936+(n<<2)>>2])-(0|i[a>>2])|0)%5|0;break}r=(6+(0|i[21968+(n<<2)>>2])-(0|i[a>>2])|0)%6|0;break}r=-1}while(0);return a=r,D=o,0|a}(t,s,7&o),-1==(0|o)?(i[n>>2]=0,D=a,0|(s=6)):(0|Wt(t,s,r)&&S(23313,22484,282,22499),e=0|ze(0|t,0|e,52),E(),e&=15,0|Nt(t,s)?Tt(r,e,o,2,n):Lt(r,e,o,2,n),D=a,0|(s=0))):(D=a,0|(s=6))}function wt(t,e,n,r){e|=0,r|=0;var o,s=0,A=0,l=0,c=0;if(o=D,D=D+16|0,function(t,e,n){t|=0,e|=0,n|=0;var r=0,o=0,s=0;s=D,D=D+32|0,o=s,function(t,e){t|=0,e|=0;var n=0,r=0,i=0;n=+a[t>>3],r=+h(+n),n=+d(+n),a[e+16>>3]=n,n=+a[t+8>>3],i=r*+h(+n),a[e>>3]=i,n=r*+d(+n),a[e+8>>3]=n}(t,o),i[e>>2]=0,a[n>>3]=5,r=+ve(16400,o),r<+a[n>>3]&&(i[e>>2]=0,a[n>>3]=r);r=+ve(16424,o),r<+a[n>>3]&&(i[e>>2]=1,a[n>>3]=r);r=+ve(16448,o),r<+a[n>>3]&&(i[e>>2]=2,a[n>>3]=r);r=+ve(16472,o),r<+a[n>>3]&&(i[e>>2]=3,a[n>>3]=r);r=+ve(16496,o),r<+a[n>>3]&&(i[e>>2]=4,a[n>>3]=r);r=+ve(16520,o),r<+a[n>>3]&&(i[e>>2]=5,a[n>>3]=r);r=+ve(16544,o),r<+a[n>>3]&&(i[e>>2]=6,a[n>>3]=r);r=+ve(16568,o),r<+a[n>>3]&&(i[e>>2]=7,a[n>>3]=r);r=+ve(16592,o),r<+a[n>>3]&&(i[e>>2]=8,a[n>>3]=r);r=+ve(16616,o),r<+a[n>>3]&&(i[e>>2]=9,a[n>>3]=r);r=+ve(16640,o),r<+a[n>>3]&&(i[e>>2]=10,a[n>>3]=r);r=+ve(16664,o),r<+a[n>>3]&&(i[e>>2]=11,a[n>>3]=r);r=+ve(16688,o),r<+a[n>>3]&&(i[e>>2]=12,a[n>>3]=r);r=+ve(16712,o),r<+a[n>>3]&&(i[e>>2]=13,a[n>>3]=r);r=+ve(16736,o),r<+a[n>>3]&&(i[e>>2]=14,a[n>>3]=r);r=+ve(16760,o),r<+a[n>>3]&&(i[e>>2]=15,a[n>>3]=r);r=+ve(16784,o),r<+a[n>>3]&&(i[e>>2]=16,a[n>>3]=r);r=+ve(16808,o),r<+a[n>>3]&&(i[e>>2]=17,a[n>>3]=r);r=+ve(16832,o),r<+a[n>>3]&&(i[e>>2]=18,a[n>>3]=r);if(r=+ve(16856,o),!(r<+a[n>>3]))return void(D=s);i[e>>2]=19,a[n>>3]=r,D=s}(t|=0,n|=0,c=o),(A=+p(+(1-.5*+a[c>>3])))<1e-16)return i[r>>2]=0,i[r+4>>2]=0,i[r+8>>2]=0,i[r+12>>2]=0,void(D=o);if(c=0|i[n>>2],s=+Jt((s=+a[15920+(24*c|0)>>3])-+Jt(+function(t,e){t|=0,e|=0;var n=0,r=0,i=0,o=0,s=0;return o=+a[e>>3],r=+h(+o),i=+a[e+8>>3]-+a[t+8>>3],s=r*+d(+i),n=+a[t>>3],+ +v(+s,+(+d(+o)*+h(+n)-+h(+i)*(r*+d(+n))))}(15600+(c<<4)|0,t))),l=0|Ht(e)?+Jt(s+-.3334731722518321):s,s=+f(+A)/.381966011250105,(0|e)>0){t=0;do{s*=2.6457513110645907,t=t+1|0}while((0|t)!=(0|e))}A=+h(+l)*s,a[r>>3]=A,l=+d(+l)*s,a[r+8>>3]=l,D=o}function Et(t,e,n,r,o){e|=0,n|=0,r|=0,o|=0;var s=0,A=0;if(s=+function(t){t|=0;var e=0,n=0;return n=+a[t>>3],e=+a[t+8>>3],+ +c(+(n*n+e*e))}(t|=0),s<1e-16)return e=15600+(e<<4)|0,i[o>>2]=i[e>>2],i[o+4>>2]=i[e+4>>2],i[o+8>>2]=i[e+8>>2],void(i[o+12>>2]=i[e+12>>2]);if(A=+v(+ +a[t+8>>3],+ +a[t>>3]),(0|n)>0){t=0;do{s/=2.6457513110645907,t=t+1|0}while((0|t)!=(0|n))}r?(s/=3,n=0==(0|Ht(n)),s=+g(.381966011250105*(n?s:s/2.6457513110645907))):(s=+g(.381966011250105*s),0|Ht(n)&&(A=+Jt(A+.3334731722518321))),function(t,e,n,r){t|=0,e=+e,n=+n,r|=0;var o=0,s=0,A=0,c=0;if(n<1e-16)return i[r>>2]=i[t>>2],i[r+4>>2]=i[t+4>>2],i[r+8>>2]=i[t+8>>2],void(i[r+12>>2]=i[t+12>>2]);s=e<0?e+6.283185307179586:e,s=e>=6.283185307179586?s+-6.283185307179586:s;do{if(!(s<1e-16)){if(o=+l(+(s+-3.141592653589793))<1e-16,e=+a[t>>3],o){e-=n,a[r>>3]=e,o=r;break}if(A=+h(+n),n=+d(+n),e=A*+d(+e)+ +h(+s)*(n*+h(+e)),e=+m(+((e=e>1?1:e)<-1?-1:e)),a[r>>3]=e,+l(+(e+-1.5707963267948966))<1e-16)return a[r>>3]=1.5707963267948966,void(a[r+8>>3]=0);if(+l(+(e+1.5707963267948966))<1e-16)return a[r>>3]=-1.5707963267948966,void(a[r+8>>3]=0);if(c=+h(+e),s=n*+d(+s)/c,n=+a[t>>3],e=(A-+d(+e)*+d(+n))/+h(+n)/c,A=s>1?1:s,e=e>1?1:e,(e=+a[t+8>>3]+ +v(+(A<-1?-1:A),+(e<-1?-1:e)))>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);return void(a[r+8>>3]=e)}e=+a[t>>3]+n,a[r>>3]=e,o=r}while(0);if(+l(+(e+-1.5707963267948966))<1e-16)return a[o>>3]=1.5707963267948966,void(a[r+8>>3]=0);if(+l(+(e+1.5707963267948966))<1e-16)return a[o>>3]=-1.5707963267948966,void(a[r+8>>3]=0);if(e=+a[t+8>>3],e>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);a[r+8>>3]=e}(15600+(e<<4)|0,+Jt(+a[15920+(24*e|0)>>3]-A),s,o)}function St(t,e,n){e|=0,n|=0;var r,a;r=D,D=D+16|0,tt((t|=0)+4|0,a=r),Et(a,0|i[t>>2],e,0,n),D=r}function Tt(t,e,n,r,o){t|=0,e|=0,n|=0,r|=0,o|=0;var s,A,l,c,u,h,d,f,p,m,g,v,_,y,x,b,M,w,E,T,C,R,P=0,L=0,O=0,I=0,q=0,U=0;if(R=D,D=D+272|0,I=R+240|0,E=R,T=R+224|0,C=R+208|0,g=R+176|0,v=R+160|0,_=R+192|0,y=R+144|0,x=R+128|0,b=R+112|0,M=R+96|0,w=R+80|0,i[(P=R+256|0)>>2]=e,i[I>>2]=i[t>>2],i[I+4>>2]=i[t+4>>2],i[I+8>>2]=i[t+8>>2],i[I+12>>2]=i[t+12>>2],Ct(I,P,E),i[o>>2]=0,(0|(I=r+n+(5==(0|r)&1)|0))<=(0|n))D=R;else{A=T+4|0,l=g+4|0,c=n+5|0,u=16880+((s=0|i[P>>2])<<2)|0,h=16960+(s<<2)|0,d=x+8|0,f=b+8|0,p=M+8|0,m=C+4|0,O=n;t:for(;;){L=E+(((0|O)%5|0)<<4)|0,i[C>>2]=i[L>>2],i[C+4>>2]=i[L+4>>2],i[C+8>>2]=i[L+8>>2],i[C+12>>2]=i[L+12>>2];do{}while(2==(0|Rt(C,s,0,1)));if((0|O)>(0|n)&0!=(0|Ht(e))){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],tt(A,v),r=0|i[g>>2],P=0|i[17040+(80*r|0)+(i[T>>2]<<2)>>2],i[g>>2]=i[18640+(80*r|0)+(20*P|0)>>2],(0|(L=0|i[18640+(80*r|0)+(20*P|0)+16>>2]))>0){t=0;do{ht(l),t=t+1|0}while((0|t)<(0|L))}switch(L=18640+(80*r|0)+(20*P|0)+4|0,i[_>>2]=i[L>>2],i[_+4>>2]=i[L+4>>2],i[_+8>>2]=i[L+8>>2],rt(_,3*(0|i[u>>2])|0),et(l,_,l),$(l),tt(l,y),q=+(0|i[h>>2]),a[x>>3]=3*q,a[d>>3]=0,U=-1.5*q,a[b>>3]=U,a[f>>3]=2.598076211353316*q,a[M>>3]=U,a[p>>3]=-2.598076211353316*q,0|i[17040+(80*(0|i[g>>2])|0)+(i[C>>2]<<2)>>2]){case 1:t=b,r=x;break;case 3:t=M,r=b;break;case 2:t=x,r=M;break;default:t=12;break t}me(v,y,r,t,w),Et(w,0|i[g>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2])}if((0|O)<(0|c)&&(tt(m,g),Et(g,0|i[C>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>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|(O=O+1|0))>=(0|I)){t=3;break}}3!=(0|t)?12==(0|t)&&S(22522,22569,571,22579):D=R}}function Ct(t,e,n){t|=0,e|=0,n|=0;var r,a=0,o=0,s=0,A=0,l=0;r=D,D=D+128|0,o=r,A=20240,l=(s=a=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=20304,l=(s=o)+60|0;do{i[s>>2]=i[A>>2],s=s+4|0,A=A+4|0}while((0|s)<(0|l));a=(l=0==(0|Ht(0|i[e>>2])))?a:o,mt(o=t+4|0),gt(o),0|Ht(0|i[e>>2])&&(ct(o),i[e>>2]=1+(0|i[e>>2])),i[n>>2]=i[t>>2],et(o,a,e=n+4|0),$(e),i[n+16>>2]=i[t>>2],et(o,a+12|0,e=n+20|0),$(e),i[n+32>>2]=i[t>>2],et(o,a+24|0,e=n+36|0),$(e),i[n+48>>2]=i[t>>2],et(o,a+36|0,e=n+52|0),$(e),i[n+64>>2]=i[t>>2],et(o,a+48|0,n=n+68|0),$(n),D=r}function Rt(t,e,n,r){n|=0,r|=0;var a,o,s,A,l,c,u=0,h=0,d=0,f=0,p=0;if(c=D,D=D+32|0,l=c+12|0,o=c,p=(t|=0)+4|0,f=0|i[16960+((e|=0)<<2)>>2],f=(A=0!=(0|r))?3*f|0:f,u=0|i[p>>2],a=0|i[(s=t+8|0)>>2],A){if((0|(u=a+u+(r=0|i[(h=t+12|0)>>2])|0))==(0|f))return D=c,0|(p=1);d=h}else u=a+u+(r=0|i[(d=t+12|0)>>2])|0;if((0|u)<=(0|f))return D=c,0|(p=0);do{if((0|r)>0){if(r=0|i[t>>2],(0|a)>0){h=18640+(80*r|0)+60|0,r=t;break}r=18640+(80*r|0)+40|0,n?(K(l,f,0,0),nt(p,l,o),dt(o),et(o,l,p),h=r,r=t):(h=r,r=t)}else h=18640+(80*(0|i[t>>2])|0)+20|0,r=t}while(0);if(i[r>>2]=i[h>>2],(0|i[(u=h+16|0)>>2])>0){r=0;do{ht(p),r=r+1|0}while((0|r)<(0|i[u>>2]))}return t=h+4|0,i[l>>2]=i[t>>2],i[l+4>>2]=i[t+4>>2],i[l+8>>2]=i[t+8>>2],e=0|i[16880+(e<<2)>>2],rt(l,A?3*e|0:e),et(p,l,p),$(p),r=A&&((0|i[s>>2])+(0|i[p>>2])+(0|i[d>>2])|0)==(0|f)?1:2,D=c,0|(p=r)}function Pt(t,e){t|=0,e|=0;var n=0;do{n=0|Rt(t,e,0,1)}while(2==(0|n));return 0|n}function Lt(t,e,n,r,o){t|=0,e|=0,n|=0,r|=0,o|=0;var s,A,l,c,u,h,d,f,p,m,g,v,_,y,x,b,M,w,E=0,T=0,C=0,R=0,P=0;if(w=D,D=D+240|0,y=w+208|0,x=w,b=w+192|0,M=w+176|0,p=w+160|0,m=w+144|0,g=w+128|0,v=w+112|0,_=w+96|0,i[(E=w+224|0)>>2]=e,i[y>>2]=i[t>>2],i[y+4>>2]=i[t+4>>2],i[y+8>>2]=i[t+8>>2],i[y+12>>2]=i[t+12>>2],Dt(y,E,x),i[o>>2]=0,(0|(f=r+n+(6==(0|r)&1)|0))<=(0|n))D=w;else{A=n+6|0,l=16960+((s=0|i[E>>2])<<2)|0,c=m+8|0,u=g+8|0,h=v+8|0,d=b+4|0,T=0,C=n,r=-1;t:for(;;){if(t=x+((E=(0|C)%6|0)<<4)|0,i[b>>2]=i[t>>2],i[b+4>>2]=i[t+4>>2],i[b+8>>2]=i[t+8>>2],i[b+12>>2]=i[t+12>>2],t=T,T=0|Rt(b,s,0,1),(0|C)>(0|n)&0!=(0|Ht(e))&&(1!=(0|t)&&(0|i[b>>2])!=(0|r))){switch(tt(x+(((E+5|0)%6|0)<<4)+4|0,M),tt(x+(E<<4)+4|0,p),R=+(0|i[l>>2]),a[m>>3]=3*R,a[c>>3]=0,P=-1.5*R,a[g>>3]=P,a[u>>3]=2.598076211353316*R,a[v>>3]=P,a[h>>3]=-2.598076211353316*R,E=0|i[y>>2],0|i[17040+(80*E|0)+(((0|r)==(0|E)?0|i[b>>2]:r)<<2)>>2]){case 1:t=g,r=m;break;case 3:t=v,r=g;break;case 2:t=m,r=v;break;default:t=8;break t}me(M,p,r,t,_),0|ge(M,_)||0|ge(p,_)||(Et(_,0|i[y>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2]))}if((0|C)<(0|A)&&(tt(d,M),Et(M,0|i[b>>2],s,1,o+8+(i[o>>2]<<4)|0),i[o>>2]=1+(0|i[o>>2])),(0|(C=C+1|0))>=(0|f)){t=3;break}r=0|i[b>>2]}3!=(0|t)?8==(0|t)&&S(22606,22569,736,22651):D=w}}function Dt(t,e,n){t|=0,e|=0,n|=0;var r,a=0,o=0,s=0,A=0,l=0;r=D,D=D+160|0,o=r,A=20368,l=(s=a=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=20448,l=(s=o)+72|0;do{i[s>>2]=i[A>>2],s=s+4|0,A=A+4|0}while((0|s)<(0|l));a=(l=0==(0|Ht(0|i[e>>2])))?a:o,mt(o=t+4|0),gt(o),0|Ht(0|i[e>>2])&&(ct(o),i[e>>2]=1+(0|i[e>>2])),i[n>>2]=i[t>>2],et(o,a,e=n+4|0),$(e),i[n+16>>2]=i[t>>2],et(o,a+12|0,e=n+20|0),$(e),i[n+32>>2]=i[t>>2],et(o,a+24|0,e=n+36|0),$(e),i[n+48>>2]=i[t>>2],et(o,a+36|0,e=n+52|0),$(e),i[n+64>>2]=i[t>>2],et(o,a+48|0,e=n+68|0),$(e),i[n+80>>2]=i[t>>2],et(o,a+60|0,n=n+84|0),$(n),D=r}function Ot(t,e){return e=0|ze(0|(t|=0),0|(e|=0),45),E(),127&e|0}function It(t,e){var n=0,r=0,i=0,a=0,o=0,s=0;if(!(!0&134217728==(-16777216&(e|=0)|0)))return 0|(e=0);if(o=0|ze(0|(t|=0),0|e,45),E(),(o&=127)>>>0>121)return 0|(e=0);n=0|ze(0|t,0|e,52),E(),n&=15;do{if(0|n){for(i=1,r=0;;){if(a=0|ze(0|t,0|e,3*(15-i|0)|0),E(),0!=(0|(a&=7))&(1^r)){if(1==(0|a)&0!=(0|F(o))){s=0,r=13;break}r=1}if(7==(0|a)){s=0,r=13;break}if(!(i>>>0<n>>>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|ze(0|t,0|e,3*(14-n|0)|0),E(),!(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 qt(t,e,n,r){n|=0,r|=0;var a=0,o=0;if(o=0|ze(0|(t|=0),0|(e|=0),52),E(),n>>>0>15)return 0|(r=4);if((0|(o&=15))<(0|n))return 0|(r=12);if((0|o)==(0|n))return i[r>>2]=t,i[r+4>>2]=e,0|(r=0);if(a=0|Ge(0|n,0,52),a|=t,t=0|E()|-15728641&e,(0|o)>(0|n))do{e=0|Ge(7,0,3*(14-n|0)|0),n=n+1|0,a|=e,t=0|E()|t}while((0|n)<(0|o));return i[r>>2]=a,i[r+4>>2]=t,0|(r=0)}function Ut(t,e,n,r){n|=0,r|=0;var a=0,o=0,s=0;if(o=0|ze(0|(t|=0),0|(e|=0),52),E(),!((0|n)<16&(0|(o&=15))<=(0|n)))return 0|(r=4);a=n-o|0,n=0|ze(0|t,0|e,45),E();t:do{if(0|F(127&n)){e:do{if(0|o){for(n=1;0==((s=0|Ge(7,0,3*(15-n|0)|0))&t|0)&0==((0|E())&e|0);){if(!(n>>>0<o>>>0))break e;n=n+1|0}n=0|ue(7,0,a,((0|a)<0)<<31>>31),a=0|E();break t}}while(0);n=0|De(0|(n=0|Ne(0|(n=0|ue(7,0,a,((0|a)<0)<<31>>31)),0|E(),5,0)),0|E(),-5,-1),n=0|De(0|(n=0|Ue(0|n,0|E(),6,0)),0|E(),1,0),a=0|E()}else n=0|ue(7,0,a,((0|a)<0)<<31>>31),a=0|E()}while(0);return i[(s=r)>>2]=n,i[s+4>>2]=a,0|(s=0)}function Nt(t,e){var n=0,r=0,i=0;if(i=0|ze(0|(t|=0),0|(e|=0),45),E(),!(0|F(127&i)))return 0|(i=0);i=0|ze(0|t,0|e,52),E(),i&=15;t:do{if(i)for(r=1;;){if(n=0|ze(0|t,0|e,3*(15-r|0)|0),E(),0|(n&=7))break t;if(!(r>>>0<i>>>0)){n=0;break}r=r+1|0}else n=0}while(0);return 0|(i=0==(0|n)&1)}function Bt(t,e){var n=0,r=0,i=0;if(i=0|ze(0|(t|=0),0|(e|=0),52),E(),!(i&=15))return 0|(i=0);for(r=1;;){if(n=0|ze(0|t,0|e,3*(15-r|0)|0),E(),0|(n&=7)){r=5;break}if(!(r>>>0<i>>>0)){n=0,r=5;break}r=r+1|0}return 5==(0|r)?0|n:0}function kt(t,e){var n=0,r=0,i=0,a=0,o=0,s=0,A=0;if(A=0|ze(0|(t|=0),0|(e|=0),52),E(),!(A&=15))return A=t,w(0|(s=e)),0|A;for(s=1,n=0;;){r=0|Ge(7,0,0|(a=3*(15-s|0)|0)),i=0|E(),o=0|ze(0|t,0|e,0|a),E(),t=(a=0|Ge(0|ft(7&o),0,0|a))|t&~r,e=(o=0|E())|e&~i;t:do{if(!n)if(0==(a&r|0)&0==(o&i|0))n=0;else if(r=0|ze(0|t,0|e,52),E(),r&=15){n=1;e:for(;;){switch(o=0|ze(0|t,0|e,3*(15-n|0)|0),E(),7&o){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(i=0|ze(0|t,0|e,0|(o=3*(15-n|0)|0)),E(),a=0|Ge(7,0,0|o),e&=~(0|E()),t=t&~a|(o=0|Ge(0|ft(7&i),0,0|o)),e=0|e|E(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0<A>>>0))break;s=s+1|0}return w(0|e),0|t}function Ft(t,e){var n=0,r=0,i=0,a=0,o=0;if(r=0|ze(0|(t|=0),0|(e|=0),52),E(),!(r&=15))return r=t,w(0|(n=e)),0|r;for(n=1;o=0|ze(0|t,0|e,0|(a=3*(15-n|0)|0)),E(),i=0|Ge(7,0,0|a),e&=~(0|E()),t=(a=0|Ge(0|ft(7&o),0,0|a))|t&~i,e=0|E()|e,n>>>0<r>>>0;)n=n+1|0;return w(0|e),0|t}function zt(t,e){var n=0,r=0,i=0,a=0,o=0,s=0,A=0;if(A=0|ze(0|(t|=0),0|(e|=0),52),E(),!(A&=15))return A=t,w(0|(s=e)),0|A;for(s=1,n=0;;){r=0|Ge(7,0,0|(a=3*(15-s|0)|0)),i=0|E(),o=0|ze(0|t,0|e,0|a),E(),t=(a=0|Ge(0|pt(7&o),0,0|a))|t&~r,e=(o=0|E())|e&~i;t:do{if(!n)if(0==(a&r|0)&0==(o&i|0))n=0;else if(r=0|ze(0|t,0|e,52),E(),r&=15){n=1;e:for(;;){switch(o=0|ze(0|t,0|e,3*(15-n|0)|0),E(),7&o){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(a=0|Ge(7,0,0|(i=3*(15-n|0)|0)),o=e&~(0|E()),e=0|ze(0|t,0|e,0|i),E(),t=t&~a|(e=0|Ge(0|pt(7&e),0,0|i)),e=0|o|E(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0<A>>>0))break;s=s+1|0}return w(0|e),0|t}function Gt(t,e){var n=0,r=0,i=0,a=0,o=0;if(r=0|ze(0|(t|=0),0|(e|=0),52),E(),!(r&=15))return r=t,w(0|(n=e)),0|r;for(n=1;a=0|Ge(7,0,0|(o=3*(15-n|0)|0)),i=e&~(0|E()),e=0|ze(0|t,0|e,0|o),E(),t=(e=0|Ge(0|pt(7&e),0,0|o))|t&~a,e=0|E()|i,n>>>0<r>>>0;)n=n+1|0;return w(0|e),0|t}function Ht(t){return 0|(0|(t|=0))%2}function jt(t,e,n){n|=0;var r,a=0;return r=D,D=D+16|0,a=r,(e|=0)>>>0>15?(D=r,0|(a=4)):2146435072==(2146435072&i[(t|=0)+4>>2]|0)||2146435072==(2146435072&i[t+8+4>>2]|0)?(D=r,0|(a=3)):(function(t,e,n){var r,i;r=D,D=D+16|0,wt(t|=0,e|=0,n|=0,i=r),J(i,n+4|0),D=r}(t,e,a),e=0|function(t,e){t|=0;var n,r=0,a=0,o=0,s=0,A=0,l=0,c=0,u=0;if(n=D,D=D+64|0,l=n+40|0,a=n+24|0,o=n+12|0,s=n,Ge(0|(e|=0),0,52),r=134225919|E(),!e)return(0|i[t+4>>2])>2||(0|i[t+8>>2])>2||(0|i[t+12>>2])>2?(l=0,w(0|(A=0)),D=n,0|l):(Ge(0|G(t),0,45),A=0|E()|r,l=-1,w(0|A),D=n,0|l);if(i[l>>2]=i[t>>2],i[l+4>>2]=i[t+4>>2],i[l+8>>2]=i[t+8>>2],i[l+12>>2]=i[t+12>>2],A=l+4|0,(0|e)>0)for(t=-1;i[a>>2]=i[A>>2],i[a+4>>2]=i[A+4>>2],i[a+8>>2]=i[A+8>>2],1&e?(st(A),i[o>>2]=i[A>>2],i[o+4>>2]=i[A+4>>2],i[o+8>>2]=i[A+8>>2],lt(o)):(At(A),i[o>>2]=i[A>>2],i[o+4>>2]=i[A+4>>2],i[o+8>>2]=i[A+8>>2],ct(o)),nt(a,o,s),$(s),c=0|Ge(7,0,0|(u=3*(15-e|0)|0)),r&=~(0|E()),t=(u=0|Ge(0|it(s),0,0|u))|t&~c,r=0|E()|r,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|i[A>>2])<=2&&(0|i[l+8>>2])<=2&&(0|i[l+12>>2])<=2){if(e=0|Ge(0|(a=0|G(l)),0,45),e|=t,t=0|E()|-1040385&r,s=0|H(l),!(0|F(a))){if((0|s)<=0)break;for(o=0;;){if(a=0|ze(0|e,0|t,52),E(),a&=15)for(r=1;l=0|ze(0|e,0|t,0|(u=3*(15-r|0)|0)),E(),c=0|Ge(7,0,0|u),t&=~(0|E()),e=e&~c|(u=0|Ge(0|ft(7&l),0,0|u)),t=0|t|E(),r>>>0<a>>>0;)r=r+1|0;if((0|(o=o+1|0))==(0|s))break t}}o=0|ze(0|e,0|t,52),E(),o&=15;e:do{if(o){r=1;n:for(;;){switch(u=0|ze(0|e,0|t,3*(15-r|0)|0),E(),7&u){case 1:break n;case 0:break;default:break e}if(!(r>>>0<o>>>0))break e;r=r+1|0}if(0|j(a,0|i[l>>2]))for(r=1;c=0|Ge(7,0,0|(l=3*(15-r|0)|0)),u=t&~(0|E()),t=0|ze(0|e,0|t,0|l),E(),e=e&~c|(t=0|Ge(0|pt(7&t),0,0|l)),t=0|u|E(),r>>>0<o>>>0;)r=r+1|0;else for(r=1;l=0|ze(0|e,0|t,0|(u=3*(15-r|0)|0)),E(),c=0|Ge(7,0,0|u),t&=~(0|E()),e=e&~c|(u=0|Ge(0|ft(7&l),0,0|u)),t=0|t|E(),r>>>0<o>>>0;)r=r+1|0}}while(0);if((0|s)>0){r=0;do{e=0|kt(e,t),t=0|E(),r=r+1|0}while((0|r)!=(0|s))}}else e=0,t=0}while(0);return u=e,w(0|(c=t)),D=n,0|u}(a,e),a=0|E(),i[n>>2]=e,i[n+4>>2]=a,0==(0|e)&0==(0|a)&&S(23313,22674,786,22697),D=r,0|(a=0))}function Vt(t,e,n){var r,a=0,o=0,s=0;if(r=(n|=0)+4|0,o=0|ze(0|(t|=0),0|(e|=0),52),E(),o&=15,s=0|ze(0|t,0|e,45),E(),a=0==(0|o),0|F(127&s)){if(a)return 0|(s=1);a=1}else{if(a)return 0|(s=0);a=0==(0|i[r>>2])&&0==(0|i[n+8>>2])?0!=(0|i[n+12>>2])&1:1}for(n=1;1&n?lt(r):ct(r),s=0|ze(0|t,0|e,3*(15-n|0)|0),E(),ut(r,7&s),n>>>0<o>>>0;)n=n+1|0;return 0|a}function Wt(t,e,n){n|=0;var r,a,o=0,s=0,A=0,l=0,c=0,u=0;if(a=D,D=D+16|0,r=a,u=0|ze(0|(t|=0),0|(e|=0),45),E(),(u&=127)>>>0>121)return i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,i[n+12>>2]=0,D=a,0|(u=5);t:do{if(0!=(0|F(u))&&(A=0|ze(0|t,0|e,52),E(),0!=(0|(A&=15)))){o=1;e:for(;;){switch(c=0|ze(0|t,0|e,3*(15-o|0)|0),E(),7&c){case 5:break e;case 0:break;default:o=e;break t}if(!(o>>>0<A>>>0)){o=e;break t}o=o+1|0}for(s=1,o=e;l=0|Ge(7,0,0|(e=3*(15-s|0)|0)),c=o&~(0|E()),o=0|ze(0|t,0|o,0|e),E(),t=t&~l|(o=0|Ge(0|pt(7&o),0,0|e)),o=0|c|E(),s>>>0<A>>>0;)s=s+1|0}else o=e}while(0);if(c=7696+(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|Vt(t,o,n)))return D=a,0|(u=0);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|ze(0|t,0|o,52),E(),c=15&A,1&A?(ct(l),A=c+1|0):A=c,0|F(u)){t:do{if(c)for(e=1;;){if(s=0|ze(0|t,0|o,3*(15-e|0)|0),E(),0|(s&=7)){o=s;break t}if(!(e>>>0<c>>>0)){o=0;break}e=e+1|0}else o=0}while(0);o=4==(0|o)&1}else o=0;if(0|Rt(n,A,o,0)){if(0|F(u))do{}while(0!=(0|Rt(n,A,0,0)));(0|A)!=(0|c)&&At(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]);return D=a,0|(u=0)}function Xt(t,e,n){n|=0;var r,i,a=0;return i=D,D=D+16|0,0|(a=0|Wt(t|=0,e|=0,r=i))?(D=i,0|a):(a=0|ze(0|t,0|e,52),E(),St(r,15&a,n),D=i,0|(a=0))}function Qt(t,e,n){n|=0;var r,i=0,a=0,o=0;if(r=D,D=D+16|0,0|(i=0|Wt(t|=0,e|=0,o=r)))return D=r,0|(o=i);i=0|ze(0|t,0|e,45),E(),i=0==(0|F(127&i)),a=0|ze(0|t,0|e,52),E(),a&=15;t:do{if(!i){if(0|a)for(i=1;;){if(!(0==((0|Ge(7,0,3*(15-i|0)|0))&t|0)&0==((0|E())&e|0)))break t;if(!(i>>>0<a>>>0))break;i=i+1|0}return Tt(o,a,0,5,n),D=r,0|0}}while(0);return Lt(o,a,0,6,n),D=r,0|0}function Yt(t,e){e|=0;var n=0,r=0,a=0,o=0,s=0,A=0,l=0;if((t|=0)>>>0>15)return 0|(A=4);if(Ge(0|t,0,52),A=134225919|E(),!t){n=0,r=0;do{0|F(r)&&(Ge(0|r,0,45),s=0|A|E(),i[(t=e+(n<<3)|0)>>2]=-1,i[t+4>>2]=s,n=n+1|0),r=r+1|0}while(122!=(0|r));return 0|(n=0)}n=0,s=0;do{if(0|F(s)){for(Ge(0|s,0,45),r=1,a=-1,o=0|A|E();a&=~(l=0|Ge(7,0,3*(15-r|0)|0)),o&=~(0|E()),(0|r)!=(0|t);)r=r+1|0;i[(l=e+(n<<3)|0)>>2]=a,i[l+4>>2]=o,n=n+1|0}s=s+1|0}while(122!=(0|s));return 0|(n=0)}function Zt(t,e,n,r){t|=0,r|=0;var a=0,o=0;a=0|ze(0|(e|=0),0|(n|=0),52),E(),0==(0|e)&0==(0|n)|(0|r)>15|(0|(a&=15))>(0|r)?(r=-1,a=-1,e=0,n=0):(o=0|function(t,e,n,r){return t|=0,e|=0,(0|(r|=0))<(0|(n|=0))?(r=t,w(0|(n=e)),0|r):(n=0|Ge(-1,-1,3+(3*(r-n|0)|0)|0),r=0|Ge(0|~n,0|~(0|E()),3*(15-r|0)|0),n=~(0|E())&e,r=~r&t,w(0|n),0|r)}(e,n,a+1|0,r),n=-15728641&(0|E()),e=0|Ge(0|r,0,52),r=(o=0==(0|Nt(e|=o,n=0|n|E())))?-1:r),i[(o=t)>>2]=e,i[o+4>>2]=n,i[t+8>>2]=a,i[t+12>>2]=r}function Kt(t){var e,n=0,r=0,a=0,o=0,s=0,A=0,l=0,c=0;if(!(0==(0|(n=0|i[(r=t|=0)>>2]))&0==(0|(r=0|i[r+4>>2]))||(a=0|ze(0|n,0|r,52),E(),n=0|De(0|(l=0|Ge(1,0,3*(15^(a&=15))|0)),0|E(),0|n,0|r),r=0|E(),i[(l=t)>>2]=n,i[l+4>>2]=r,(0|a)<(0|(A=0|i[(l=t+8|0)>>2]))))){for(e=t+12|0,s=a;;){if((0|s)==(0|A)){a=5;break}if(c=(0|s)==(0|i[e>>2]),a=0|ze(0|n,0|r,0|(o=3*(15-s|0)|0)),E(),c&1==(0|(a&=7))&!0){a=7;break}if(!(7==(0|a)&!0)){a=10;break}if(n=0|De(0|n,0|r,0|(c=0|Ge(1,0,0|o)),0|E()),r=0|E(),i[(c=t)>>2]=n,i[c+4>>2]=r,!((0|s)>(0|A))){a=10;break}s=s+-1|0}if(5==(0|a))return i[(c=t)>>2]=0,i[c+4>>2]=0,i[l>>2]=-1,void(i[e>>2]=-1);if(7==(0|a))return A=0|De(0|n,0|r,0|(A=0|Ge(1,0,0|o)),0|E()),l=0|E(),i[(c=t)>>2]=A,i[c+4>>2]=l,void(i[e>>2]=s+-1)}}function Jt(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function $t(t,e){return e|=0,+l(+(+a[(t|=0)>>3]-+a[e>>3]))<17453292519943298e-27?0|(e=+l(+(+a[t+8>>3]-+a[e+8>>3]))<17453292519943298e-27):0|(e=0)}function te(t,e){t|=0;var n,r,i,o=0;return r=+a[(e|=0)>>3],n=+a[t>>3],o=(i=+d(.5*(r-n)))*i+(o=+d(.5*(+a[e+8>>3]-+a[t+8>>3])))*(+h(+r)*+h(+n)*o),2*+v(+ +c(+o),+ +c(+(1-o)))*6371.007180918475}function ee(t,e){e|=0;var n=0;return(t|=0)>>>0>15?0|(e=4):(n=0|Ne(0|(n=0|ue(7,0,t,((0|t)<0)<<31>>31)),0|E(),120,0),t=0|E(),i[e>>2]=2|n,i[e+4>>2]=t,0|(e=0))}function ne(t,e,n){t|=0,n|=0;var r,i,o,s,A=0,l=0,u=0,p=0,m=0,_=0;return _=+a[(e|=0)>>3],o=+a[t>>3],m=+d(.5*(_-o)),u=+a[e+8>>3],i=+a[t+8>>3],p=+d(.5*(u-i)),r=+h(+o),s=+h(+_),p=2*+v(+ +c(+(p=m*m+p*(s*r*p))),+ +c(+(1-p))),m=+a[n>>3],_=+d(.5*(m-_)),A=+a[n+8>>3],u=+d(.5*(A-u)),l=+h(+m),u=2*+v(+ +c(+(u=_*_+u*(s*l*u))),+ +c(+(1-u))),m=+d(.5*(o-m)),A=+d(.5*(i-A)),A=2*+v(+ +c(+(A=m*m+A*(r*l*A))),+ +c(+(1-A))),4*+g(+ +c(+ +f(.5*(l=.5*(p+u+A)))*+f(.5*(l-p))*+f(.5*(l-u))*+f(.5*(l-A))))}function re(t,e,n){n|=0;var r,o,s,A=0,l=0;if(s=D,D=D+192|0,o=s,0|(l=0|Xt(t|=0,e|=0,r=s+168|0)))return D=s,0|(n=l);if(0|Qt(t,e,o)&&S(23313,22742,386,22751),(0|(e=0|i[o>>2]))>0){if(A=+ne(o+8|0,o+8+((1!=(0|e)&1)<<4)|0,r)+0,1!=(0|e)){t=1;do{A+=+ne(o+8+((l=t)<<4)|0,o+8+(((0|(t=t+1|0))%(0|e)|0)<<4)|0,r)}while((0|t)<(0|e))}}else A=0;return a[n>>3]=A,D=s,0|(n=0)}function ie(t){t|=0;var e,n,r=0;return(e=0|Le(1,12))||S(22832,22787,49,22845),0|(r=0|i[(n=t+4|0)>>2])?(i[(r=r+8|0)>>2]=e,i[n>>2]=e,0|e):(0|i[t>>2]&&S(22862,22787,61,22885),i[(r=t)>>2]=e,i[n>>2]=e,0|e)}function ae(t,e){t|=0,e|=0;var n,r;return(r=0|Re(24))||S(22899,22787,78,22913),i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],i[r+12>>2]=i[e+12>>2],i[r+16>>2]=0,0|(n=0|i[(e=t+4|0)>>2])?(i[n+16>>2]=r,i[e>>2]=r,0|r):(0|i[t>>2]&&S(22928,22787,82,22913),i[t>>2]=r,i[e>>2]=r,0|r)}function oe(t){var e=0,n=0,r=0,a=0;if(t|=0)for(r=1;;){if(0|(e=0|i[t>>2]))do{if(0|(n=0|i[e>>2]))do{a=n,n=0|i[n+16>>2],Pe(a)}while(0!=(0|n));a=e,e=0|i[e+8>>2],Pe(a)}while(0!=(0|e));if(e=t,t=0|i[t+8>>2],r||Pe(e),!t)break;r=0}}function se(t){var e,n,r=0,o=0,s=0,A=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,E=0,T=0,C=0,R=0,P=0,L=0,D=0,O=0,I=0,q=0,U=0;if(0|i[(A=(t|=0)+8|0)>>2])return 0|(U=1);if(!(s=0|i[t>>2]))return 0|(U=0);r=s,o=0;do{o=o+1|0,r=0|i[r+8>>2]}while(0!=(0|r));if(o>>>0<2)return 0|(U=0);(n=0|Re(o<<2))||S(22948,22787,317,22967),(e=0|Re(o<<5))||S(22989,22787,321,22967),i[t>>2]=0,i[(C=t+4|0)>>2]=0,i[A>>2]=0,o=0,I=0,T=0,m=0;t:for(;;){if(p=0|i[s>>2]){c=0,u=p;do{if(d=+a[u+8>>3],r=u,u=0|i[u+16>>2],h=+a[(A=(f=0==(0|u))?p:u)+8>>3],+l(+(d-h))>3.141592653589793){U=14;break}c+=(h-d)*(+a[r>>3]+ +a[A>>3])}while(!f);if(14==(0|U)){U=0,c=0,r=p;do{E=+a[r+8>>3],D=0|i[(O=r+16|0)>>2],w=+a[(D=0==(0|D)?p:D)+8>>3],c+=(+a[r>>3]+ +a[D>>3])*((w<0?w+6.283185307179586:w)-(E<0?E+6.283185307179586:E)),r=0|i[(0==(0|r)?s:O)>>2]}while(0!=(0|r))}c>0?(i[n+(I<<2)>>2]=s,I=I+1|0,A=T,r=m):U=19}else U=19;if(19==(0|U)){U=0;do{if(!o){if(m){A=C,u=m+8|0,r=s,o=t;break}if(0|i[t>>2]){U=27;break t}A=C,u=t,r=s,o=t;break}if(0|i[(r=o+8|0)>>2]){U=21;break t}if(!(o=0|Le(1,12))){U=23;break t}i[r>>2]=o,A=o+4|0,u=o,r=m}while(0);if(i[u>>2]=s,i[A>>2]=s,u=e+(T<<5)|0,f=0|i[s>>2]){for(a[(p=e+(T<<5)+8|0)>>3]=17976931348623157e292,a[(m=e+(T<<5)+24|0)>>3]=17976931348623157e292,a[u>>3]=-17976931348623157e292,a[(g=e+(T<<5)+16|0)>>3]=-17976931348623157e292,b=17976931348623157e292,M=-17976931348623157e292,A=0,v=f,d=17976931348623157e292,y=17976931348623157e292,x=-17976931348623157e292,h=-17976931348623157e292;c=+a[v>>3],E=+a[v+8>>3],v=0|i[v+16>>2],w=+a[((_=0==(0|v))?f:v)+8>>3],c<d&&(a[p>>3]=c,d=c),E<y&&(a[m>>3]=E,y=E),c>x?a[u>>3]=c:c=x,E>h&&(a[g>>3]=E,h=E),b=E>0&E<b?E:b,M=E<0&E>M?E:M,A|=+l(+(E-w))>3.141592653589793,!_;)x=c;A&&(a[g>>3]=M,a[m>>3]=b)}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;A=T+1|0}if(s=0|i[(O=s+8|0)>>2],i[O>>2]=0,!s){U=45;break}T=A,m=r}if(21==(0|U))S(22765,22787,35,22799);else if(23==(0|U))S(22819,22787,37,22799);else if(27==(0|U))S(22862,22787,61,22885);else if(45==(0|U)){t:do{if((0|I)>0){for(O=0==(0|A),L=A<<2,D=0==(0|t),P=0,r=0;;){if(R=0|i[n+(P<<2)>>2],O)U=73;else{if(!(T=0|Re(L))){U=50;break}if(!(C=0|Re(L))){U=52;break}e:do{if(D)o=0;else{for(A=0,o=0,u=t;s=e+(A<<5)|0,0|Ae(0|i[u>>2],s,0|i[R>>2])?(i[T+(o<<2)>>2]=u,i[C+(o<<2)>>2]=s,_=o+1|0):_=o,u=0|i[u+8>>2];)A=A+1|0,o=_;if((0|_)>0)if(s=0|i[T>>2],1==(0|_))o=s;else for(g=0,v=-1,o=s,m=s;;){for(f=0|i[m>>2],s=0,u=0;p=(0|(A=0|i[i[T+(u<<2)>>2]>>2]))==(0|f)?s:s+(1&(0|Ae(A,0|i[C+(u<<2)>>2],0|i[f>>2])))|0,(0|(u=u+1|0))!=(0|_);)s=p;if(o=(A=(0|p)>(0|v))?m:o,(0|(s=g+1|0))==(0|_))break e;g=s,v=A?p:v,m=0|i[T+(s<<2)>>2]}else o=0}}while(0);if(Pe(T),Pe(C),o){if(s=0|i[(A=o+4|0)>>2])o=s+8|0;else if(0|i[o>>2]){U=70;break}i[o>>2]=R,i[A>>2]=R}else U=73}if(73==(0|U)){if(U=0,0|(r=0|i[R>>2]))do{C=r,r=0|i[r+16>>2],Pe(C)}while(0!=(0|r));Pe(R),r=1}if((0|(P=P+1|0))>=(0|I)){q=r;break t}}50==(0|U)?S(23004,22787,249,23023):52==(0|U)?S(23042,22787,252,23023):70==(0|U)&&S(22862,22787,61,22885)}else q=0}while(0);return Pe(n),Pe(e),0|(U=q)}return 0}function Ae(t,e,n){t|=0;var r=0,o=0,s=0,A=0,l=0,c=0,u=0,h=0;if(!(0|Q(e|=0,n|=0)))return 0|(t=0);if(e=0|X(e),r=+a[n>>3],o=e&(o=+a[n+8>>3])<0?o+6.283185307179586:o,!(t=0|i[t>>2]))return 0|(t=0);if(e){e=0,u=o,n=t;t:for(;;){for(;A=+a[n>>3],o=+a[n+8>>3],h=0|i[(n=n+16|0)>>2],s=+a[(h=0==(0|h)?t:h)>>3],l=+a[h+8>>3],A>s?(c=A,A=l):(c=s,s=A,A=o,o=l),(r=r==s|r==c?r+2220446049250313e-31:r)<s|r>c;)if(!(n=0|i[n>>2])){n=22;break t}if(((c=(l=A<0?A+6.283185307179586:A)+(r-s)/(c-s)*((A=o<0?o+6.283185307179586:o)-l))<0?c+6.283185307179586:c)>(u=l==u|A==u?u+-2220446049250313e-31:u)&&(e^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|e}else{e=0,u=o,n=t;t:for(;;){for(;A=+a[n>>3],o=+a[n+8>>3],h=0|i[(n=n+16|0)>>2],s=+a[(h=0==(0|h)?t:h)>>3],l=+a[h+8>>3],A>s?(c=A,A=l):(c=s,s=A,A=o,o=l),(r=r==s|r==c?r+2220446049250313e-31:r)<s|r>c;)if(!(n=0|i[n>>2])){n=22;break t}if(A+(r-s)/(c-s)*(o-A)>(u=A==u|o==u?u+-2220446049250313e-31:u)&&(e^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|e}return 0}function le(t,e,n,a,o){n|=0,a|=0,o|=0;var s,A,l,c,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,_=0,y=0;if(c=D,D=D+32|0,y=c+16|0,l=c,u=0|ze(0|(t|=0),0|(e|=0),52),E(),u&=15,g=0|ze(0|n,0|a,52),E(),(0|u)!=(15&g|0))return D=c,0|(y=12);if(p=0|ze(0|t,0|e,45),E(),p&=127,m=0|ze(0|n,0|a,45),E(),p>>>0>121|(m&=127)>>>0>121)return D=c,0|(y=5);if(g=(0|p)!=(0|m)){if(7==(0|(d=0|W(p,m))))return D=c,0|(y=1);7==(0|(f=0|W(m,p)))?S(23066,23090,161,23100):(v=d,h=f)}else v=0,h=0;s=0|F(p),A=0|F(m),i[y>>2]=0,i[y+4>>2]=0,i[y+8>>2]=0,i[y+12>>2]=0;do{if(v){if(d=(0|(m=0|i[4272+(28*p|0)+(v<<2)>>2]))>0,A)if(d){p=0,f=n,d=a;do{f=0|zt(f,d),d=0|E(),1==(0|(h=0|pt(h)))&&(h=0|pt(1)),p=p+1|0}while((0|p)!=(0|m));m=h,p=f,f=d}else m=h,p=n,f=a;else if(d){p=0,f=n,d=a;do{f=0|Gt(f,d),d=0|E(),h=0|pt(h),p=p+1|0}while((0|p)!=(0|m));m=h,p=f,f=d}else m=h,p=n,f=a;if(Vt(p,f,y),g||S(23115,23090,191,23100),(d=0!=(0|s))&(h=0!=(0|A))&&S(23142,23090,192,23100),d){if(7==(0|(h=0|Bt(t,e)))){u=5;break}if(0|r[21872+(7*h|0)+v>>0]){u=1;break}p=f=0|i[21040+(28*h|0)+(v<<2)>>2]}else if(h){if(7==(0|(h=0|Bt(p,f)))){u=5;break}if(0|r[21872+(7*h|0)+m>>0]){u=1;break}p=0,f=0|i[21040+(28*m|0)+(h<<2)>>2]}else p=0,f=0;if((p|f|0)<0)u=5;else{if((0|f)>0){d=y+4|0,h=0;do{dt(d),h=h+1|0}while((0|h)!=(0|f))}if(i[l>>2]=0,i[l+4>>2]=0,i[l+8>>2]=0,ut(l,v),0|u)for(;0|Ht(u)?lt(l):ct(l),(0|u)>1;)u=u+-1|0;if((0|p)>0){u=0;do{dt(l),u=u+1|0}while((0|u)!=(0|p))}et(_=y+4|0,l,_),$(_),_=51}}else if(Vt(n,a,y),0!=(0|s)&0!=(0|A))if((0|m)!=(0|p)&&S(23173,23090,261,23100),7==(0|(h=0|Bt(t,e)))|7==(0|(u=0|Bt(n,a))))u=5;else if(0|r[21872+(7*h|0)+u>>0])u=1;else if((0|(h=0|i[21040+(28*h|0)+(u<<2)>>2]))>0){d=y+4|0,u=0;do{dt(d),u=u+1|0}while((0|u)!=(0|h));_=51}else _=51;else _=51}while(0);return 51==(0|_)&&(u=y+4|0,i[o>>2]=i[u>>2],i[o+4>>2]=i[u+4>>2],i[o+8>>2]=i[u+8>>2],u=0),D=c,0|(y=u)}function ce(t,e,n,r){n|=0,r|=0;var a,o,s,A=0,l=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,_=0,y=0;if(s=D,D=D+48|0,a=s+36|0,c=s+24|0,u=s+12|0,h=s,A=0|ze(0|(t|=0),0|(e|=0),52),E(),A&=15,f=0|ze(0|t,0|e,45),E(),(f&=127)>>>0>121)return D=s,0|(r=5);if(o=0|F(f),Ge(0|A,0,52),g=134225919|E(),i[(l=r)>>2]=-1,i[l+4>>2]=g,!A)return 7==(0|(A=0|it(n)))||127==(0|(A=0|V(f,A)))?(D=s,0|(g=1)):(p=0|Ge(0|A,0,45),m=0|E(),m=-1040385&i[(f=r)+4>>2]|m,i[(g=r)>>2]=i[f>>2]|p,i[g+4>>2]=m,D=s,0|(g=0));for(i[a>>2]=i[n>>2],i[a+4>>2]=i[n+4>>2],i[a+8>>2]=i[n+8>>2],n=A;;){if(l=n,n=n+-1|0,i[c>>2]=i[a>>2],i[c+4>>2]=i[a+4>>2],i[c+8>>2]=i[a+8>>2],0|Ht(l)){if(0|(A=0|at(a))){n=13;break}i[u>>2]=i[a>>2],i[u+4>>2]=i[a+4>>2],i[u+8>>2]=i[a+8>>2],lt(u)}else{if(0|(A=0|ot(a))){n=13;break}i[u>>2]=i[a>>2],i[u+4>>2]=i[a+4>>2],i[u+8>>2]=i[a+8>>2],ct(u)}if(nt(c,u,h),$(h),_=0|i[(A=r)>>2],A=0|i[A+4>>2],v=0|Ge(7,0,0|(y=3*(15-l|0)|0)),A&=~(0|E()),y=0|Ge(0|it(h),0,0|y),A=0|E()|A,i[(g=r)>>2]=y|_&~v,i[g+4>>2]=A,(0|l)<=1){n=14;break}}t:do{if(13!=(0|n)&&14==(0|n))if((0|i[a>>2])<=1&&(0|i[a+4>>2])<=1&&(0|i[a+8>>2])<=1){h=127==(0|(A=0|V(f,n=0|it(a))))?0:0|F(A);e:do{if(n){if(o){if(7==(0|(A=0|Bt(t,e)))){A=5;break t}if((0|(l=0|i[21248+(28*A|0)+(n<<2)>>2]))>0){A=n,n=0;do{A=0|ft(A),n=n+1|0}while((0|n)!=(0|l))}else A=n;if(1==(0|A)){A=9;break t}127==(0|(n=0|V(f,A)))&&S(23200,23090,411,23230),0|F(n)?S(23245,23090,412,23230):(m=n,p=l,d=A)}else m=A,p=0,d=n;if((0|(u=0|i[4272+(28*f|0)+(d<<2)>>2]))<=-1&&S(23276,23090,419,23230),!h){if((0|p)<0){A=5;break t}if(0|p){A=0,n=0|i[(l=r)>>2],l=0|i[l+4>>2];do{n=0|Ft(n,l),l=0|E(),i[(y=r)>>2]=n,i[y+4>>2]=l,A=A+1|0}while((0|A)<(0|p))}if((0|u)<=0){A=m,n=58;break}for(A=0,n=0|i[(l=r)>>2],l=0|i[l+4>>2];;)if(n=0|Ft(n,l),l=0|E(),i[(y=r)>>2]=n,i[y+4>>2]=l,(0|(A=A+1|0))==(0|u)){A=m,n=58;break e}}if(7==(0|(c=0|W(m,f)))&&S(23066,23090,428,23230),n=0|i[(A=r)>>2],A=0|i[A+4>>2],(0|u)>0){l=0;do{n=0|Ft(n,A),A=0|E(),i[(y=r)>>2]=n,i[y+4>>2]=A,l=l+1|0}while((0|l)!=(0|u))}if(7==(0|(A=0|Bt(n,A)))&&S(23313,23090,440,23230),n=0|z(m),(0|(n=0|i[(n?21664:21456)+(28*c|0)+(A<<2)>>2]))<0&&S(23313,23090,454,23230),n){A=0,l=0|i[(c=r)>>2],c=0|i[c+4>>2];do{l=0|kt(l,c),c=0|E(),i[(y=r)>>2]=l,i[y+4>>2]=c,A=A+1|0}while((0|A)<(0|n));A=m,n=58}else A=m,n=58}else if(0!=(0|o)&0!=(0|h)){if(7==(0|(n=0|Bt(t,e)))|7==(0|(l=0|Bt(0|i[(l=r)>>2],0|i[l+4>>2])))){A=5;break t}if((0|(l=0|i[21248+(28*n|0)+(l<<2)>>2]))<0){A=5;break t}if(l){n=0,c=0|i[(u=r)>>2],u=0|i[u+4>>2];do{c=0|Ft(c,u),u=0|E(),i[(y=r)>>2]=c,i[y+4>>2]=u,n=n+1|0}while((0|n)<(0|l));n=58}else n=59}else n=58}while(0);if(58==(0|n)&&h&&(n=59),59==(0|n)&&1==(0|Bt(0|i[(y=r)>>2],0|i[y+4>>2]))){A=9;break}v=0|i[(y=r)>>2],y=-1040385&i[y+4>>2],_=0|Ge(0|A,0,45),y=0|y|E(),i[(A=r)>>2]=v|_,i[A+4>>2]=y,A=0}else A=1}while(0);return D=s,0|(y=A)}function ue(t,e,n,r){t|=0,e|=0;var i=0,a=0,o=0;if(0==(0|(n|=0))&0==(0|(r|=0)))return a=1,w(0|(i=0)),0|a;a=t,i=e,t=1,e=0;do{t=0|Ne(0|((o=0==(1&n|0)&!0)?1:a),0|(o?0:i),0|t,0|e),e=0|E(),n=0|Fe(0|n,0|r,1),r=0|E(),a=0|Ne(0|a,0|i,0|a,0|i),i=0|E()}while(!(0==(0|n)&0==(0|r)));return w(0|e),0|t}function he(t,e,n){t|=0;var r,o=0,s=0,A=0,l=0,c=0,u=0,h=0,d=0,f=0;if(!(0|Q(e|=0,n|=0)))return 0|(f=0);if(e=0|X(e),o=+a[n>>3],s=e&(s=+a[n+8>>3])<0?s+6.283185307179586:s,(0|(f=0|i[t>>2]))<=0)return 0|(f=0);if(r=0|i[t+4>>2],e){e=0,d=s,n=-1,t=0;t:for(;;){for(h=t;l=+a[r+(h<<4)>>3],s=+a[r+(h<<4)+8>>3],A=+a[r+((t=(n+2|0)%(0|f)|0)<<4)>>3],c=+a[r+(t<<4)+8>>3],l>A?(u=l,l=c):(u=A,A=l,l=s,s=c),(o=o==A|o==u?o+2220446049250313e-31:o)<A|o>u;){if((0|(n=h+1|0))>=(0|f)){n=22;break t}t=h,h=n,n=t}if(((u=(c=l<0?l+6.283185307179586:l)+(o-A)/(u-A)*((l=s<0?s+6.283185307179586:s)-c))<0?u+6.283185307179586:u)>(d=c==d|l==d?d+-2220446049250313e-31:d)&&(e^=1),(0|(t=h+1|0))>=(0|f)){n=22;break}n=h}if(22==(0|n))return 0|e}else{e=0,d=s,n=-1,t=0;t:for(;;){for(h=t;l=+a[r+(h<<4)>>3],s=+a[r+(h<<4)+8>>3],A=+a[r+((t=(n+2|0)%(0|f)|0)<<4)>>3],c=+a[r+(t<<4)+8>>3],l>A?(u=l,l=c):(u=A,A=l,l=s,s=c),(o=o==A|o==u?o+2220446049250313e-31:o)<A|o>u;){if((0|(n=h+1|0))>=(0|f)){n=22;break t}t=h,h=n,n=t}if(l+(o-A)/(u-A)*(s-l)>(d=l==d|s==d?d+-2220446049250313e-31:d)&&(e^=1),(0|(t=h+1|0))>=(0|f)){n=22;break}n=h}if(22==(0|n))return 0|e}return 0}function de(t,e){e|=0;var n,r,o,s,A,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0;if(!(r=0|i[(t|=0)>>2]))return i[e>>2]=0,i[e+4>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+24>>2]=0,void(i[e+28>>2]=0);if(a[(o=e+8|0)>>3]=17976931348623157e292,a[(s=e+24|0)>>3]=17976931348623157e292,a[e>>3]=-17976931348623157e292,a[(A=e+16|0)>>3]=-17976931348623157e292,!((0|r)<=0)){for(n=0|i[t+4>>2],g=17976931348623157e292,v=-17976931348623157e292,_=0,t=-1,d=17976931348623157e292,f=17976931348623157e292,m=-17976931348623157e292,u=-17976931348623157e292,y=0;c=+a[n+(y<<4)>>3],p=+a[n+(y<<4)+8>>3],h=+a[n+(((0|(t=t+2|0))==(0|r)?0:t)<<4)+8>>3],c<d&&(a[o>>3]=c,d=c),p<f&&(a[s>>3]=p,f=p),c>m?a[e>>3]=c:c=m,p>u&&(a[A>>3]=p,u=p),g=p>0&p<g?p:g,v=p<0&p>v?p:v,_|=+l(+(p-h))>3.141592653589793,(0|(t=y+1|0))!=(0|r);)x=y,m=c,y=t,t=x;_&&(a[A>>3]=v,a[s>>3]=g)}}function fe(t,e){e|=0;var n,r=0,o=0,s=0,A=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,E=0,S=0;if(v=0|i[(t|=0)>>2]){if(a[(_=e+8|0)>>3]=17976931348623157e292,a[(y=e+24|0)>>3]=17976931348623157e292,a[e>>3]=-17976931348623157e292,a[(x=e+16|0)>>3]=-17976931348623157e292,(0|v)>0){for(s=0|i[t+4>>2],m=17976931348623157e292,g=-17976931348623157e292,o=0,r=-1,h=17976931348623157e292,d=17976931348623157e292,p=-17976931348623157e292,c=-17976931348623157e292,b=0;A=+a[s+(b<<4)>>3],f=+a[s+(b<<4)+8>>3],u=+a[s+(((0|(E=r+2|0))==(0|v)?0:E)<<4)+8>>3],A<h&&(a[_>>3]=A,h=A),f<d&&(a[y>>3]=f,d=f),A>p?a[e>>3]=A:A=p,f>c&&(a[x>>3]=f,c=f),m=f>0&f<m?f:m,g=f<0&f>g?f:g,o|=+l(+(f-u))>3.141592653589793,(0|(r=b+1|0))!=(0|v);)E=b,p=A,b=r,r=E;o&&(a[x>>3]=g,a[y>>3]=m)}}else i[e>>2]=0,i[e+4>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+24>>2]=0,i[e+28>>2]=0;if(!((0|(r=0|i[(E=t+8|0)>>2]))<=0)){n=t+12|0,w=0;do{if(s=0|i[n>>2],o=w,y=e+((w=w+1|0)<<5)|0,x=0|i[s+(o<<3)>>2]){if(a[(b=e+(w<<5)+8|0)>>3]=17976931348623157e292,a[(t=e+(w<<5)+24|0)>>3]=17976931348623157e292,a[y>>3]=-17976931348623157e292,a[(M=e+(w<<5)+16|0)>>3]=-17976931348623157e292,(0|x)>0){for(v=0|i[s+(o<<3)+4>>2],m=17976931348623157e292,g=-17976931348623157e292,s=0,o=-1,_=0,h=17976931348623157e292,d=17976931348623157e292,f=-17976931348623157e292,c=-17976931348623157e292;A=+a[v+(_<<4)>>3],p=+a[v+(_<<4)+8>>3],u=+a[v+(((0|(o=o+2|0))==(0|x)?0:o)<<4)+8>>3],A<h&&(a[b>>3]=A,h=A),p<d&&(a[t>>3]=p,d=p),A>f?a[y>>3]=A:A=f,p>c&&(a[M>>3]=p,c=p),m=p>0&p<m?p:m,g=p<0&p>g?p:g,s|=+l(+(p-u))>3.141592653589793,(0|(o=_+1|0))!=(0|x);)S=_,_=o,f=A,o=S;s&&(a[M>>3]=g,a[t>>3]=m)}}else i[y>>2]=0,i[y+4>>2]=0,i[y+8>>2]=0,i[y+12>>2]=0,i[y+16>>2]=0,i[y+20>>2]=0,i[y+24>>2]=0,i[y+28>>2]=0,r=0|i[E>>2]}while((0|w)<(0|r))}}function pe(t,e,n){var r=0,a=0,o=0;if(!(0|he(t|=0,e|=0,n|=0)))return 0|(a=0);if((0|i[(a=t+8|0)>>2])<=0)return 0|(a=1);for(r=t+12|0,t=0;;){if(o=t,t=t+1|0,0|he((0|i[r>>2])+(o<<3)|0,e+(t<<5)|0,n)){t=0,r=6;break}if((0|t)>=(0|i[a>>2])){t=1,r=6;break}}return 6==(0|r)?0|t:0}function me(t,e,n,r,i){e|=0,n|=0,r|=0,i|=0;var o,s,A,l,c,u,h,d=0;l=+a[(t|=0)>>3],A=+a[e>>3]-l,s=+a[t+8>>3],o=+a[e+8>>3]-s,u=+a[n>>3],d=((d=+a[r>>3]-u)*(s-(h=+a[n+8>>3]))-(l-u)*(c=+a[r+8>>3]-h))/(A*c-o*d),a[i>>3]=l+A*d,a[i+8>>3]=s+o*d}function ge(t,e){return e|=0,+l(+(+a[(t|=0)>>3]-+a[e>>3]))<1.1920928955078125e-7?0|(e=+l(+(+a[t+8>>3]-+a[e+8>>3]))<1.1920928955078125e-7):0|(e=0)}function ve(t,e){e|=0;var n,r,i;return+((i=+a[(t|=0)>>3]-+a[e>>3])*i+(r=+a[t+8>>3]-+a[e+8>>3])*r+(n=+a[t+16>>3]-+a[e+16>>3])*n)}function _e(t,e,n){n|=0;var r,a,o,s,A=0,l=0,c=0;if(s=D,D=D+32|0,c=s,0|(A=0|Wt(t|=0,e|=0,a=s+16|0)))return D=s,0|(n=A);r=0|Ot(t,e),o=0|Bt(t,e),function(t,e){t=7696+(28*(t|=0)|0)|0,i[(e|=0)>>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]}(r,c),A=0|function(t,e){t|=0;var n=0,r=0;if((e|=0)>>>0>20)return-1;do{if((0|i[11120+(216*e|0)>>2])!=(0|t))if((0|i[11120+(216*e|0)+8>>2])!=(0|t))if((0|i[11120+(216*e|0)+16>>2])!=(0|t))if((0|i[11120+(216*e|0)+24>>2])!=(0|t))if((0|i[11120+(216*e|0)+32>>2])!=(0|t))if((0|i[11120+(216*e|0)+40>>2])!=(0|t))if((0|i[11120+(216*e|0)+48>>2])!=(0|t))if((0|i[11120+(216*e|0)+56>>2])!=(0|t))if((0|i[11120+(216*e|0)+64>>2])!=(0|t))if((0|i[11120+(216*e|0)+72>>2])!=(0|t))if((0|i[11120+(216*e|0)+80>>2])!=(0|t))if((0|i[11120+(216*e|0)+88>>2])!=(0|t))if((0|i[11120+(216*e|0)+96>>2])!=(0|t))if((0|i[11120+(216*e|0)+104>>2])!=(0|t))if((0|i[11120+(216*e|0)+112>>2])!=(0|t))if((0|i[11120+(216*e|0)+120>>2])!=(0|t))if((0|i[11120+(216*e|0)+128>>2])!=(0|t)){if((0|i[11120+(216*e|0)+136>>2])!=(0|t)){if((0|i[11120+(216*e|0)+144>>2])==(0|t)){t=0,n=2,r=0;break}if((0|i[11120+(216*e|0)+152>>2])==(0|t)){t=0,n=2,r=1;break}if((0|i[11120+(216*e|0)+160>>2])==(0|t)){t=0,n=2,r=2;break}if((0|i[11120+(216*e|0)+168>>2])==(0|t)){t=1,n=2,r=0;break}if((0|i[11120+(216*e|0)+176>>2])==(0|t)){t=1,n=2,r=1;break}if((0|i[11120+(216*e|0)+184>>2])==(0|t)){t=1,n=2,r=2;break}if((0|i[11120+(216*e|0)+192>>2])==(0|t)){t=2,n=2,r=0;break}if((0|i[11120+(216*e|0)+200>>2])==(0|t)){t=2,n=2,r=1;break}if((0|i[11120+(216*e|0)+208>>2])==(0|t)){t=2,n=2,r=2;break}return-1}t=2,n=1,r=2}else t=2,n=1,r=1;else t=2,n=1,r=0;else t=1,n=1,r=2;else t=1,n=1,r=1;else t=1,n=1,r=0;else t=0,n=1,r=2;else t=0,n=1,r=1;else t=0,n=1,r=0;else t=2,n=0,r=2;else t=2,n=0,r=1;else t=2,n=0,r=0;else t=1,n=0,r=2;else t=1,n=0,r=1;else t=1,n=0,r=0;else t=0,n=0,r=2;else t=0,n=0,r=1;else t=0,n=0,r=0}while(0);return 0|i[11120+(216*e|0)+(72*n|0)+(24*t|0)+(r<<3)+4>>2]}(r,0|i[a>>2]);t:do{if(0|F(r)){switch(0|r){case 4:t=0;break;case 14:t=1;break;case 24:t=2;break;case 38:t=3;break;case 49:t=4;break;case 58:t=5;break;case 63:t=6;break;case 72:t=7;break;case 83:t=8;break;case 97:t=9;break;case 107:t=10;break;case 117:t=11;break;default:A=1;break t}if(l=0|i[22e3+(24*t|0)+8>>2],e=0|i[22e3+(24*t|0)+16>>2],(0|(t=0|i[a>>2]))!=(0|i[c>>2])&&(c=0|z(r))|(0|(t=0|i[a>>2]))==(0|e)&&(A=(A+1|0)%6|0),3==(0|o)&(0|t)==(0|e)){A=(A+5|0)%6|0,l=22;break}5==(0|o)&(0|t)==(0|l)?(A=(A+1|0)%6|0,l=22):l=22}else l=22}while(0);return 22==(0|l)&&(i[n>>2]=A,A=0),D=s,0|(n=A)}function ye(t,e,n,r){n|=0,r|=0;var a,o,s,A,l,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,_=0,y=0;if(l=D,D=D+32|0,y=l+24|0,A=l+20|0,s=l+8|0,o=l+16|0,a=l,f=(f=0==(0|Nt(t|=0,e|=0)))?6:5,m=0|ze(0|t,0|e,52),E(),f>>>0<=n>>>0)return D=l,0|(r=2);!(g=0==(0|(m&=15)))&&0==((v=0|Ge(7,0,3*(15^m)|0))&t|0)&0==((0|E())&e|0)?c=n:u=4;t:do{if(4==(0|u)){if((0|((c=0!=(0|Nt(t,e)))?4:5))<(0|n))return D=l,0|(r=1);if(0|_e(t,e,y))return D=l,0|(r=1);if(u=(0|i[y>>2])+n|0,7==(0|(v=0|i[(c=c?22288+(((0|u)%5|0)<<2)|0:22320+(((0|u)%6|0)<<2)|0)>>2])))return D=l,0|(r=1);i[A>>2]=0,c=0|N(t,e,v,A,s);do{if(!c){if(p=0|i[(d=s)>>2],u=(h=(d=0|i[d+4>>2])>>>0<e>>>0|(0|d)==(0|e)&p>>>0<t>>>0)?p:t,h=h?d:e,!g&&0==(p&(g=0|Ge(7,0,3*(15^m)|0))|0)&0==(d&(0|E())|0))c=n;else{if(d=(n+-1+f|0)%(0|f)|0,c=0|Nt(t,e),(0|d)<0&&S(23313,23315,245,23324),(0|((f=0!=(0|c))?4:5))<(0|d)&&S(23313,23315,245,23324),0|_e(t,e,y)&&S(23313,23315,245,23324),c=(0|i[y>>2])+d|0,7==(0|(d=0|i[(c=f?22288+(((0|c)%5|0)<<2)|0:22320+(((0|c)%6|0)<<2)|0)>>2]))&&S(23313,23315,245,23324),i[o>>2]=0,0|(c=0|N(t,e,d,o,a)))break;f=0|i[(p=a)>>2],p=0|i[p+4>>2];do{if(p>>>0<h>>>0|(0|p)==(0|h)&f>>>0<u>>>0){if(u=0|Nt(f,p)?0|B(f,p,t,e):0|i[22384+((((0|i[o>>2])+(0|i[22352+(d<<2)>>2])|0)%6|0)<<2)>>2],c=0|Nt(f,p),(u+-1|0)>>>0>5){c=-1,u=f,h=p;break}if(1==(0|u)&(c=0!=(0|c))){c=-1,u=f,h=p;break}do{if(!(0|_e(f,p,y))){if(c){c=(5+(0|i[21936+(u<<2)>>2])-(0|i[y>>2])|0)%5|0;break}c=(6+(0|i[21968+(u<<2)>>2])-(0|i[y>>2])|0)%6|0;break}c=-1}while(0);u=f,h=p}else c=n}while(0);p=0|i[(d=s)>>2],d=0|i[d+4>>2]}if((0|u)==(0|p)&(0|h)==(0|d)){if(t=(f=0!=(0|Nt(p,d)))?0|B(p,d,t,e):0|i[22384+((((0|i[A>>2])+(0|i[22352+(v<<2)>>2])|0)%6|0)<<2)>>2],c=0|Nt(p,d),(t+-1|0)>>>0<=5&&!(1==(0|t)&(_=0!=(0|c))))do{if(!(0|_e(p,d,y))){if(_){c=(5+(0|i[21936+(t<<2)>>2])-(0|i[y>>2])|0)%5|0;break}c=(6+(0|i[21968+(t<<2)>>2])-(0|i[y>>2])|0)%6|0;break}c=-1}while(0);else c=-1;c=6==(0|(c=c+1|0))|f&5==(0|c)?0:c}e=h,t=u;break t}}while(0);return D=l,0|(r=c)}}while(0);return _=0|Ge(0|c,0,56),y=0|E()|-2130706433&e|536870912,i[r>>2]=_|t,i[r+4>>2]=y,D=l,0|(r=0)}function xe(t,e,n){t|=0,n|=0;var r=0;(0|(e|=0))>0?(r=0|Le(e,4),i[t>>2]=r,r||S(23337,23360,40,23374)):i[t>>2]=0,i[t+4>>2]=e,i[t+8>>2]=0,i[t+12>>2]=n}function be(t){var e,n,r,o=0,s=0,A=0,c=0;e=(t|=0)+4|0,n=t+12|0,r=t+8|0;t:for(;;){for(s=0|i[e>>2],o=0;;){if((0|o)>=(0|s))break t;if(A=0|i[t>>2],c=0|i[A+(o<<2)>>2])break;o=o+1|0}o=A+(~~(+l(+ +u(10,+ +(15-(0|i[n>>2])|0))*(+a[c>>3]+ +a[c+8>>3]))%+(0|s))>>>0<<2)|0,s=0|i[o>>2];e:do{if(0|s){if(A=c+32|0,(0|s)==(0|c))i[o>>2]=i[A>>2];else{if(!(o=0|i[(s=s+32|0)>>2]))break;for(;(0|o)!=(0|c);)if(!(o=0|i[(s=o+32|0)>>2]))break e;i[s>>2]=i[A>>2]}Pe(c),i[r>>2]=(0|i[r>>2])-1}}while(0)}Pe(0|i[t>>2])}function Me(t){var e,n=0,r=0;for(e=0|i[(t|=0)+4>>2],r=0;;){if((0|r)>=(0|e)){n=0,r=4;break}if(n=0|i[(0|i[t>>2])+(r<<2)>>2]){r=4;break}r=r+1|0}return 4==(0|r)?0|n:0}function we(t,e){e|=0;var n=0,r=0,o=0,s=0;if(n=~~(+l(+ +u(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+a[e>>3]+ +a[e+8>>3]))%+(0|i[t+4>>2]))>>>0,n=(0|i[t>>2])+(n<<2)|0,!(r=0|i[n>>2]))return 0|(s=1);s=e+32|0;do{if((0|r)!=(0|e)){if(!(n=0|i[r+32>>2]))return 0|(s=1);for(o=n;;){if((0|o)==(0|e)){o=8;break}if(!(n=0|i[o+32>>2])){n=1,o=10;break}r=o,o=n}if(8==(0|o)){i[r+32>>2]=i[s>>2];break}if(10==(0|o))return 0|n}else i[n>>2]=i[s>>2]}while(0);return Pe(e),i[(s=t+8|0)>>2]=(0|i[s>>2])-1,0|(s=0)}function Ee(t,e,n){t|=0,e|=0,n|=0;var r,o=0,s=0,A=0;(r=0|Re(40))||S(23390,23360,98,23403),i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],i[r+12>>2]=i[e+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=~~(+l(+ +u(10,+ +(15-(0|i[t+12>>2])|0))*(+a[e>>3]+ +a[e+8>>3]))%+(0|i[t+4>>2]))>>>0,s=(0|i[t>>2])+(s<<2)|0,o=0|i[s>>2];do{if(o){for(;!(0|$t(o,e)&&0|$t(o+16|0,n));)if(s=0|i[o+32>>2],!(0|i[(o=0==(0|s)?o:s)+32>>2])){A=10;break}if(10==(0|A)){i[o+32>>2]=r;break}return Pe(r),0|(A=o)}i[s>>2]=r}while(0);return i[(A=t+8|0)>>2]=1+(0|i[A>>2]),0|(A=r)}function Se(t,e,n){e|=0,n|=0;var r=0,o=0;if(o=~~(+l(+ +u(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+a[e>>3]+ +a[e+8>>3]))%+(0|i[t+4>>2]))>>>0,!(o=0|i[(0|i[t>>2])+(o<<2)>>2]))return 0|(n=0);if(!n){for(t=o;;){if(0|$t(t,e)){r=10;break}if(!(t=0|i[t+32>>2])){t=0,r=10;break}}if(10==(0|r))return 0|t}for(t=o;;){if(0|$t(t,e)&&0|$t(t+16|0,n)){r=10;break}if(!(t=0|i[t+32>>2])){t=0,r=10;break}}return 10==(0|r)?0|t:0}function Te(t,e){e|=0;var n=0;if(n=~~(+l(+ +u(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+a[e>>3]+ +a[e+8>>3]))%+(0|i[t+4>>2]))>>>0,!(t=0|i[(0|i[t>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|$t(t,e)){e=5;break}if(!(t=0|i[t+32>>2])){t=0,e=5;break}}return 5==(0|e)?0|t:0}function Ce(t){return 0|~~+function(t){return+ +Qe(+(t=+t))}(t=+t)}function Re(t){t|=0;var e,n=0,r=0,a=0,o=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,_=0,y=0,x=0,b=0;e=D,D=D+16|0,f=e;do{if(t>>>0<245){if(t=(u=t>>>0<11?16:t+11&-8)>>>3,3&(r=(d=0|i[5857])>>>t)|0)return a=0|i[(r=(t=23468+((n=(1&r^1)+t|0)<<1<<2)|0)+8|0)>>2],(0|(s=0|i[(o=a+8|0)>>2]))==(0|t)?i[5857]=d&~(1<<n):(i[s+12>>2]=t,i[r>>2]=s),b=n<<3,i[a+4>>2]=3|b,i[(b=a+b+4|0)>>2]=1|i[b>>2],D=e,0|(b=o);if(u>>>0>(h=0|i[5859])>>>0){if(0|r)return n=((n=r<<t&((n=2<<t)|0-n))&0-n)-1|0,s=0|i[(t=(n=23468+((a=((r=(n>>>=l=n>>>12&16)>>>5&8)|l|(s=(n>>>=r)>>>2&4)|(t=(n>>>=s)>>>1&2)|(a=(n>>>=t)>>>1&1))+(n>>>a)|0)<<1<<2)|0)+8|0)>>2],(0|(r=0|i[(l=s+8|0)>>2]))==(0|n)?(t=d&~(1<<a),i[5857]=t):(i[r+12>>2]=n,i[t>>2]=r,t=d),A=(b=a<<3)-u|0,i[s+4>>2]=3|u,i[(o=s+u|0)+4>>2]=1|A,i[s+b>>2]=A,0|h&&(a=0|i[5862],r=23468+((n=h>>>3)<<1<<2)|0,t&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5857]=t|n,n=r,t=r+8|0),i[t>>2]=a,i[n+12>>2]=a,i[a+8>>2]=n,i[a+12>>2]=r),i[5859]=A,i[5862]=o,D=e,0|(b=l);if(s=0|i[5858]){for(r=(s&0-s)-1|0,r=c=0|i[23732+(((a=(r>>>=o=r>>>12&16)>>>5&8)|o|(A=(r>>>=a)>>>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;(t=0|i[r+16>>2])||(t=0|i[r+20>>2]);)r=t,l=(o=(A=(-8&i[t+4>>2])-u|0)>>>0<c>>>0)?t:l,c=o?A:c;if((A=l+u|0)>>>0>l>>>0){o=0|i[l+24>>2],n=0|i[l+12>>2];do{if((0|n)==(0|l)){if(!(n=0|i[(t=l+20|0)>>2])&&!(n=0|i[(t=l+16|0)>>2])){r=0;break}for(;;)if(r=0|i[(a=n+20|0)>>2])n=r,t=a;else{if(!(r=0|i[(a=n+16|0)>>2]))break;n=r,t=a}i[t>>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|o){if(n=0|i[l+28>>2],(0|l)==(0|i[(t=23732+(n<<2)|0)>>2])){if(i[t>>2]=r,!r){i[5858]=s&~(1<<n);break}}else if(i[((0|i[(b=o+16|0)>>2])==(0|l)?b:o+20|0)>>2]=r,!r)break;i[r+24>>2]=o,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?(b=c+u|0,i[l+4>>2]=3|b,i[(b=l+b+4|0)>>2]=1|i[b>>2]):(i[l+4>>2]=3|u,i[A+4>>2]=1|c,i[A+c>>2]=c,0|h&&(a=0|i[5862],r=23468+((n=h>>>3)<<1<<2)|0,(n=1<<n)&d?n=0|i[(t=r+8|0)>>2]:(i[5857]=n|d,n=r,t=r+8|0),i[t>>2]=a,i[n+12>>2]=a,i[a+8>>2]=n,i[a+12>>2]=r),i[5859]=c,i[5862]=A),D=e,0|(b=l+8|0)}d=u}else d=u}else d=u}else if(t>>>0<=4294967231)if(u=-8&(t=t+11|0),a=0|i[5858]){o=0-u|0,c=(t>>>=8)?u>>>0>16777215?31:u>>>((c=14-((l=((g=t<<(d=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|d|(c=((g<<=l)+245760|0)>>>16&2))+(g<<c>>>15)|0)+7|0)&1|c<<1:0,r=0|i[23732+(c<<2)>>2];t:do{if(r)for(t=0,l=u<<(31==(0|c)?0:25-(c>>>1)|0),s=0;;){if((A=(-8&i[r+4>>2])-u|0)>>>0<o>>>0){if(!A){t=r,o=0,g=65;break t}t=r,o=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,t=0,g=61}while(0);if(61==(0|g)){if(0==(0|r)&0==(0|t)){if(!(t=((t=2<<c)|0-t)&a)){d=u;break}d=(t&0-t)-1|0,t=0,r=0|i[23732+(((s=(d>>>=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=t,A=o)}if(65==(0|g))for(s=r;;){if(o=(r=(d=(-8&i[s+4>>2])-u|0)>>>0<o>>>0)?d:o,t=r?s:t,(r=0|i[s+16>>2])||(r=0|i[s+20>>2]),!r){l=t,A=o;break}s=r}if(0!=(0|l)&&A>>>0<((0|i[5859])-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[(t=l+20|0)>>2])&&!(n=0|i[(t=l+16|0)>>2])){n=0;break}for(;;)if(r=0|i[(o=n+20|0)>>2])n=r,t=o;else{if(!(r=0|i[(o=n+16|0)>>2]))break;n=r,t=o}i[t>>2]=0}else b=0|i[l+8>>2],i[b+12>>2]=n,i[n+8>>2]=b}while(0);do{if(s){if(t=0|i[l+28>>2],(0|l)==(0|i[(r=23732+(t<<2)|0)>>2])){if(i[r>>2]=n,!n){a&=~(1<<t),i[5858]=a;break}}else if(i[((0|i[(b=s+16|0)>>2])==(0|l)?b:s+20|0)>>2]=n,!n)break;i[n+24>>2]=s,0|(t=0|i[l+16>>2])&&(i[n+16>>2]=t,i[t+24>>2]=n),(t=0|i[l+20>>2])&&(i[n+20>>2]=t,i[t+24>>2]=n)}}while(0);t:do{if(A>>>0<16)b=A+u|0,i[l+4>>2]=3|b,i[(b=l+b+4|0)>>2]=1|i[b>>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=23468+(n<<1<<2)|0,(t=0|i[5857])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5857]=t|n,n=r,t=r+8|0),i[t>>2]=h,i[n+12>>2]=h,i[h+8>>2]=n,i[h+12>>2]=r;break}if(n=23732+((r=(n=A>>>8)?A>>>0>16777215?31:A>>>((r=14-((y=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(r=((b<<=y)+245760|0)>>>16&2))+(b<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[h+28>>2]=r,i[(t=h+16|0)+4>>2]=0,i[t>>2]=0,!(a&(t=1<<r))){i[5858]=a|t,i[n>>2]=h,i[h+24>>2]=n,i[h+12>>2]=h,i[h+8>>2]=h;break}n=0|i[n>>2];e:do{if((-8&i[n+4>>2]|0)!=(0|A)){for(a=A<<(31==(0|r)?0:25-(r>>>1)|0);t=0|i[(r=n+16+(a>>>31<<2)|0)>>2];){if((-8&i[t+4>>2]|0)==(0|A)){n=t;break e}a<<=1,n=t}i[r>>2]=h,i[h+24>>2]=n,i[h+12>>2]=h,i[h+8>>2]=h;break t}}while(0);b=0|i[(x=n+8|0)>>2],i[b+12>>2]=h,i[x>>2]=h,i[h+8>>2]=b,i[h+12>>2]=n,i[h+24>>2]=0}}while(0);return D=e,0|(b=l+8|0)}d=u}else d=u;else d=-1}while(0);if((r=0|i[5859])>>>0>=d>>>0)return n=r-d|0,t=0|i[5862],n>>>0>15?(b=t+d|0,i[5862]=b,i[5859]=n,i[b+4>>2]=1|n,i[t+r>>2]=n,i[t+4>>2]=3|d):(i[5859]=0,i[5862]=0,i[t+4>>2]=3|r,i[(b=t+r+4|0)>>2]=1|i[b>>2]),D=e,0|(b=t+8|0);if((A=0|i[5860])>>>0>d>>>0)return y=A-d|0,i[5860]=y,x=(b=0|i[5863])+d|0,i[5863]=x,i[x+4>>2]=1|y,i[b+4>>2]=3|d,D=e,0|(b=b+8|0);if(0|i[5975]?t=0|i[5977]:(i[5977]=4096,i[5976]=4096,i[5978]=-1,i[5979]=-1,i[5980]=0,i[5968]=0,i[5975]=-16&f^1431655768,t=4096),l=d+48|0,(u=(s=t+(c=d+47|0)|0)&(o=0-t|0))>>>0<=d>>>0)return D=e,0|(b=0);if(0|(t=0|i[5967])&&(f=(h=0|i[5965])+u|0)>>>0<=h>>>0|f>>>0>t>>>0)return D=e,0|(b=0);t:do{if(4&i[5968])n=0,g=143;else{r=0|i[5863];e:do{if(r){for(a=23876;!((f=0|i[a>>2])>>>0<=r>>>0&&(f+(0|i[a+4>>2])|0)>>>0>r>>>0);){if(!(t=0|i[a+8>>2])){g=128;break e}a=t}if((n=s-A&o)>>>0<2147483647)if((0|(t=0|Ye(0|n)))==((0|i[a>>2])+(0|i[a+4>>2])|0)){if(-1!=(0|t)){A=n,s=t,g=145;break t}}else a=t,g=136;else n=0}else g=128}while(0);do{if(128==(0|g))if(-1!=(0|(r=0|Ye(0)))&&(n=r,m=(n=(0==((m=(p=0|i[5976])+-1|0)&n|0)?0:(m+n&0-p)-n|0)+u|0)+(p=0|i[5965])|0,n>>>0>d>>>0&n>>>0<2147483647)){if(0|(f=0|i[5967])&&m>>>0<=p>>>0|m>>>0>f>>>0){n=0;break}if((0|(t=0|Ye(0|n)))==(0|r)){A=n,s=r,g=145;break t}a=t,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|a))){if(-1==(0|a)){n=0;break}A=n,s=a,g=145;break t}if((t=c-n+(t=0|i[5977])&0-t)>>>0>=2147483647){A=n,s=a,g=145;break t}if(-1==(0|Ye(0|t))){Ye(0|r),n=0;break}A=t+n|0,s=a,g=145;break t}}while(0);i[5968]=4|i[5968],g=143}}while(0);if(143==(0|g)&&u>>>0<2147483647&&!(-1==(0|(y=0|Ye(0|u)))|1^(_=(v=(m=0|Ye(0))-y|0)>>>0>(d+40|0)>>>0)|y>>>0<m>>>0&-1!=(0|y)&-1!=(0|m)^1)&&(A=_?v:n,s=y,g=145),145==(0|g)){n=(0|i[5965])+A|0,i[5965]=n,n>>>0>(0|i[5966])>>>0&&(i[5966]=n),c=0|i[5863];t:do{if(c){for(n=23876;;){if((0|s)==((t=0|i[n>>2])+(r=0|i[n+4>>2])|0)){g=154;break}if(!(a=0|i[n+8>>2]))break;n=a}if(154==(0|g)&&(x=n+4|0,0==(8&i[n+12>>2]|0))&&s>>>0>c>>>0&t>>>0<=c>>>0){i[x>>2]=r+A,x=c+(y=0==(7&(y=c+8|0)|0)?0:0-y&7)|0,y=(b=(0|i[5860])+A|0)-y|0,i[5863]=x,i[5860]=y,i[x+4>>2]=1|y,i[c+b+4>>2]=40,i[5864]=i[5979];break}for(s>>>0<(0|i[5861])>>>0&&(i[5861]=s),r=s+A|0,n=23876;;){if((0|i[n>>2])==(0|r)){g=162;break}if(!(t=0|i[n+8>>2]))break;n=t}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;e:do{if((0|c)==(0|n))b=(0|i[5860])+l|0,i[5860]=b,i[5863]=u,i[u+4>>2]=1|b;else{if((0|i[5862])==(0|n)){b=(0|i[5859])+l|0,i[5859]=b,i[5862]=u,i[u+4>>2]=1|b,i[u+b>>2]=b;break}if(1==(3&(t=0|i[n+4>>2])|0)){A=-8&t,a=t>>>3;n:do{if(t>>>0<256){if(t=0|i[n+8>>2],(0|(r=0|i[n+12>>2]))==(0|t)){i[5857]=i[5857]&~(1<<a);break}i[t+12>>2]=r,i[r+8>>2]=t;break}s=0|i[n+24>>2],t=0|i[n+12>>2];do{if((0|t)==(0|n)){if(t=0|i[(a=(r=n+16|0)+4|0)>>2])r=a;else if(!(t=0|i[r>>2])){t=0;break}for(;;)if(a=0|i[(o=t+20|0)>>2])t=a,r=o;else{if(!(a=0|i[(o=t+16|0)>>2]))break;t=a,r=o}i[r>>2]=0}else b=0|i[n+8>>2],i[b+12>>2]=t,i[t+8>>2]=b}while(0);if(!s)break;a=23732+((r=0|i[n+28>>2])<<2)|0;do{if((0|i[a>>2])==(0|n)){if(i[a>>2]=t,0|t)break;i[5858]=i[5858]&~(1<<r);break n}if(i[((0|i[(b=s+16|0)>>2])==(0|n)?b:s+20|0)>>2]=t,!t)break n}while(0);if(i[t+24>>2]=s,0|(a=0|i[(r=n+16|0)>>2])&&(i[t+16>>2]=a,i[a+24>>2]=t),!(r=0|i[r+4>>2]))break;i[t+20>>2]=r,i[r+24>>2]=t}while(0);n=n+A|0,o=A+l|0}else o=l;if(i[(n=n+4|0)>>2]=-2&i[n>>2],i[u+4>>2]=1|o,i[u+o>>2]=o,n=o>>>3,o>>>0<256){r=23468+(n<<1<<2)|0,(t=0|i[5857])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5857]=t|n,n=r,t=r+8|0),i[t>>2]=u,i[n+12>>2]=u,i[u+8>>2]=n,i[u+12>>2]=r;break}n=o>>>8;do{if(n){if(o>>>0>16777215){a=31;break}a=o>>>((a=14-((y=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(a=((b<<=y)+245760|0)>>>16&2))+(b<<a>>>15)|0)+7|0)&1|a<<1}else a=0}while(0);if(n=23732+(a<<2)|0,i[u+28>>2]=a,i[(t=u+16|0)+4>>2]=0,i[t>>2]=0,!((t=0|i[5858])&(r=1<<a))){i[5858]=t|r,i[n>>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|o)){for(a=o<<(31==(0|a)?0:25-(a>>>1)|0);t=0|i[(r=n+16+(a>>>31<<2)|0)>>2];){if((-8&i[t+4>>2]|0)==(0|o)){n=t;break n}a<<=1,n=t}i[r>>2]=u,i[u+24>>2]=n,i[u+12>>2]=u,i[u+8>>2]=u;break e}}while(0);b=0|i[(x=n+8|0)>>2],i[b+12>>2]=u,i[x>>2]=u,i[u+8>>2]=b,i[u+12>>2]=n,i[u+24>>2]=0}}while(0);return D=e,0|(b=h+8|0)}for(n=23876;!((t=0|i[n>>2])>>>0<=c>>>0&&(b=t+(0|i[n+4>>2])|0)>>>0>c>>>0);)n=0|i[n+8>>2];n=(t=(t=(o=b+-47|0)+(0==(7&(t=o+8|0)|0)?0:0-t&7)|0)>>>0<(o=c+16|0)>>>0?c:t)+8|0,x=s+(y=0==(7&(y=s+8|0)|0)?0:0-y&7)|0,y=(r=A+-40|0)-y|0,i[5863]=x,i[5860]=y,i[x+4>>2]=1|y,i[s+r+4>>2]=40,i[5864]=i[5979],i[(r=t+4|0)>>2]=27,i[n>>2]=i[5969],i[n+4>>2]=i[5970],i[n+8>>2]=i[5971],i[n+12>>2]=i[5972],i[5969]=s,i[5970]=A,i[5972]=0,i[5971]=n,n=t+24|0;do{x=n,i[(n=n+4|0)>>2]=7}while((x+8|0)>>>0<b>>>0);if((0|t)!=(0|c)){if(s=t-c|0,i[r>>2]=-2&i[r>>2],i[c+4>>2]=1|s,i[t>>2]=s,n=s>>>3,s>>>0<256){r=23468+(n<<1<<2)|0,(t=0|i[5857])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5857]=t|n,n=r,t=r+8|0),i[t>>2]=c,i[n+12>>2]=c,i[c+8>>2]=n,i[c+12>>2]=r;break}if(r=23732+((a=(n=s>>>8)?s>>>0>16777215?31:s>>>((a=14-((y=((b=n<<(x=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|x|(a=((b<<=y)+245760|0)>>>16&2))+(b<<a>>>15)|0)+7|0)&1|a<<1:0)<<2)|0,i[c+28>>2]=a,i[c+20>>2]=0,i[o>>2]=0,!((n=0|i[5858])&(t=1<<a))){i[5858]=n|t,i[r>>2]=c,i[c+24>>2]=r,i[c+12>>2]=c,i[c+8>>2]=c;break}n=0|i[r>>2];e:do{if((-8&i[n+4>>2]|0)!=(0|s)){for(a=s<<(31==(0|a)?0:25-(a>>>1)|0);t=0|i[(r=n+16+(a>>>31<<2)|0)>>2];){if((-8&i[t+4>>2]|0)==(0|s)){n=t;break e}a<<=1,n=t}i[r>>2]=c,i[c+24>>2]=n,i[c+12>>2]=c,i[c+8>>2]=c;break t}}while(0);b=0|i[(x=n+8|0)>>2],i[b+12>>2]=c,i[x>>2]=c,i[c+8>>2]=b,i[c+12>>2]=n,i[c+24>>2]=0}}else 0==(0|(b=0|i[5861]))|s>>>0<b>>>0&&(i[5861]=s),i[5969]=s,i[5970]=A,i[5972]=0,i[5866]=i[5975],i[5865]=-1,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,i[5906]=23612,i[5905]=23612,i[5908]=23620,i[5907]=23620,i[5910]=23628,i[5909]=23628,i[5912]=23636,i[5911]=23636,i[5914]=23644,i[5913]=23644,i[5916]=23652,i[5915]=23652,i[5918]=23660,i[5917]=23660,i[5920]=23668,i[5919]=23668,i[5922]=23676,i[5921]=23676,i[5924]=23684,i[5923]=23684,i[5926]=23692,i[5925]=23692,i[5928]=23700,i[5927]=23700,i[5930]=23708,i[5929]=23708,i[5932]=23716,i[5931]=23716,x=s+(y=0==(7&(y=s+8|0)|0)?0:0-y&7)|0,y=(b=A+-40|0)-y|0,i[5863]=x,i[5860]=y,i[x+4>>2]=1|y,i[s+b+4>>2]=40,i[5864]=i[5979]}while(0);if((n=0|i[5860])>>>0>d>>>0)return y=n-d|0,i[5860]=y,x=(b=0|i[5863])+d|0,i[5863]=x,i[x+4>>2]=1|y,i[b+4>>2]=3|d,D=e,0|(b=b+8|0)}return i[(b=23424)>>2]=12,D=e,0|(b=0)}function Pe(t){var e=0,n=0,r=0,a=0,o=0,s=0,A=0,l=0;if(t|=0){n=t+-8|0,a=0|i[5861],l=n+(e=-8&(t=0|i[t+-4>>2]))|0;do{if(1&t)A=n,s=n;else{if(r=0|i[n>>2],!(3&t))return;if(o=r+e|0,(s=n+(0-r)|0)>>>0<a>>>0)return;if((0|i[5862])==(0|s)){if(3!=(3&(e=0|i[(t=l+4|0)>>2])|0)){A=s,e=o;break}return i[5859]=o,i[t>>2]=-2&e,i[s+4>>2]=1|o,void(i[s+o>>2]=o)}if(n=r>>>3,r>>>0<256){if(t=0|i[s+8>>2],(0|(e=0|i[s+12>>2]))==(0|t)){i[5857]=i[5857]&~(1<<n),A=s,e=o;break}i[t+12>>2]=e,i[e+8>>2]=t,A=s,e=o;break}a=0|i[s+24>>2],t=0|i[s+12>>2];do{if((0|t)==(0|s)){if(t=0|i[(n=(e=s+16|0)+4|0)>>2])e=n;else if(!(t=0|i[e>>2])){t=0;break}for(;;)if(n=0|i[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|i[(r=t+16|0)>>2]))break;t=n,e=r}i[e>>2]=0}else A=0|i[s+8>>2],i[A+12>>2]=t,i[t+8>>2]=A}while(0);if(a){if(e=0|i[s+28>>2],(0|i[(n=23732+(e<<2)|0)>>2])==(0|s)){if(i[n>>2]=t,!t){i[5858]=i[5858]&~(1<<e),A=s,e=o;break}}else if(i[((0|i[(A=a+16|0)>>2])==(0|s)?A:a+20|0)>>2]=t,!t){A=s,e=o;break}i[t+24>>2]=a,0|(n=0|i[(e=s+16|0)>>2])&&(i[t+16>>2]=n,i[n+24>>2]=t),(e=0|i[e+4>>2])?(i[t+20>>2]=e,i[e+24>>2]=t,A=s,e=o):(A=s,e=o)}else A=s,e=o}}while(0);if(!(s>>>0>=l>>>0)&&1&(r=0|i[(t=l+4|0)>>2])){if(2&r)i[t>>2]=-2&r,i[A+4>>2]=1|e,i[s+e>>2]=e,a=e;else{if((0|i[5863])==(0|l)){if(l=(0|i[5860])+e|0,i[5860]=l,i[5863]=A,i[A+4>>2]=1|l,(0|A)!=(0|i[5862]))return;return i[5862]=0,void(i[5859]=0)}if((0|i[5862])==(0|l))return l=(0|i[5859])+e|0,i[5859]=l,i[5862]=s,i[A+4>>2]=1|l,void(i[s+l>>2]=l);a=(-8&r)+e|0,n=r>>>3;do{if(r>>>0<256){if(e=0|i[l+8>>2],(0|(t=0|i[l+12>>2]))==(0|e)){i[5857]=i[5857]&~(1<<n);break}i[e+12>>2]=t,i[t+8>>2]=e;break}o=0|i[l+24>>2],t=0|i[l+12>>2];do{if((0|t)==(0|l)){if(t=0|i[(n=(e=l+16|0)+4|0)>>2])e=n;else if(!(t=0|i[e>>2])){n=0;break}for(;;)if(n=0|i[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|i[(r=t+16|0)>>2]))break;t=n,e=r}i[e>>2]=0,n=t}else n=0|i[l+8>>2],i[n+12>>2]=t,i[t+8>>2]=n,n=t}while(0);if(0|o){if(t=0|i[l+28>>2],(0|i[(e=23732+(t<<2)|0)>>2])==(0|l)){if(i[e>>2]=n,!n){i[5858]=i[5858]&~(1<<t);break}}else if(i[((0|i[(r=o+16|0)>>2])==(0|l)?r:o+20|0)>>2]=n,!n)break;i[n+24>>2]=o,0|(e=0|i[(t=l+16|0)>>2])&&(i[n+16>>2]=e,i[e+24>>2]=n),0|(t=0|i[t+4>>2])&&(i[n+20>>2]=t,i[t+24>>2]=n)}}while(0);if(i[A+4>>2]=1|a,i[s+a>>2]=a,(0|A)==(0|i[5862]))return void(i[5859]=a)}if(t=a>>>3,a>>>0<256)return n=23468+(t<<1<<2)|0,(e=0|i[5857])&(t=1<<t)?t=0|i[(e=n+8|0)>>2]:(i[5857]=e|t,t=n,e=n+8|0),i[e>>2]=A,i[t+12>>2]=A,i[A+8>>2]=t,void(i[A+12>>2]=n);t=23732+((r=(t=a>>>8)?a>>>0>16777215?31:a>>>((r=14-((o=((l=t<<(s=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|s|(r=((l<<=o)+245760|0)>>>16&2))+(l<<r>>>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,e=0|i[5858],n=1<<r;t:do{if(e&n){t=0|i[t>>2];e:do{if((-8&i[t+4>>2]|0)!=(0|a)){for(r=a<<(31==(0|r)?0:25-(r>>>1)|0);e=0|i[(n=t+16+(r>>>31<<2)|0)>>2];){if((-8&i[e+4>>2]|0)==(0|a)){t=e;break e}r<<=1,t=e}i[n>>2]=A,i[A+24>>2]=t,i[A+12>>2]=A,i[A+8>>2]=A;break t}}while(0);l=0|i[(s=t+8|0)>>2],i[l+12>>2]=A,i[s>>2]=A,i[A+8>>2]=l,i[A+12>>2]=t,i[A+24>>2]=0}else i[5858]=e|n,i[t>>2]=A,i[A+24>>2]=t,i[A+12>>2]=A,i[A+8>>2]=A}while(0);if(l=(0|i[5865])-1|0,i[5865]=l,!(0|l)){for(t=23884;t=0|i[t>>2];)t=t+8|0;i[5865]=-1}}}}function Le(t,e){e|=0;var n=0;return(t|=0)?(n=0|y(e,t),(e|t)>>>0>65535&&(n=(0|(n>>>0)/(t>>>0))==(0|e)?n:-1)):n=0,(t=0|Re(n))&&3&i[t+-4>>2]?(Xe(0|t,0,0|n),0|t):0|t}function De(t,e,n,r){return 0|(w((e|=0)+(r|=0)+((n=(t|=0)+(n|=0)>>>0)>>>0<t>>>0|0)>>>0|0),0|n)}function Oe(t,e,n,r){return 0|(w(0|(r=(e|=0)-(r|=0)-((n|=0)>>>0>(t|=0)>>>0|0)>>>0)),t-n>>>0|0)}function Ie(t){return 0|((t|=0)?31-(0|M(t^t-1))|0:32)}function qe(t,e,n,r,a){a|=0;var o=0,s=0,A=0,l=0,c=0,u=0,h=0,d=0,f=0,p=0;if(u=t|=0,s=n|=0,A=d=r|=0,!(c=l=e|=0))return o=0!=(0|a),A?o?(i[a>>2]=0|t,i[a+4>>2]=0&e,a=0,0|(w(0|(d=0)),a)):(a=0,0|(w(0|(d=0)),a)):(o&&(i[a>>2]=(u>>>0)%(s>>>0),i[a+4>>2]=0),a=(u>>>0)/(s>>>0)>>>0,0|(w(0|(d=0)),a));o=0==(0|A);do{if(s){if(!o){if((o=(0|M(0|A))-(0|M(0|c))|0)>>>0<=31){s=h=o+1|0,t=u>>>(h>>>0)&(e=o-31>>31)|c<<(A=31-o|0),e&=c>>>(h>>>0),o=0,A=u<<A;break}return a?(i[a>>2]=0|t,i[a+4>>2]=l|0&e,a=0,0|(w(0|(d=0)),a)):(a=0,0|(w(0|(d=0)),a))}if((o=s-1|0)&s|0){s=A=33+(0|M(0|s))-(0|M(0|c))|0,t=(h=32-A|0)-1>>31&c>>>((f=A-32|0)>>>0)|(c<<h|u>>>(A>>>0))&(e=f>>31),e&=c>>>(A>>>0),o=u<<(p=64-A|0)&(l=h>>31),A=(c<<p|u>>>(f>>>0))&l|u<<h&A-33>>31;break}return 0|a&&(i[a>>2]=o&u,i[a+4>>2]=0),1==(0|s)?(p=0|t,0|(w(0|(f=l|0&e)),p)):(f=c>>>((p=0|Ie(0|s))>>>0)|0,p=c<<32-p|u>>>(p>>>0)|0,0|(w(0|f),p))}if(o)return 0|a&&(i[a>>2]=(c>>>0)%(s>>>0),i[a+4>>2]=0),p=(c>>>0)/(s>>>0)>>>0,0|(w(0|(f=0)),p);if(!u)return 0|a&&(i[a>>2]=0,i[a+4>>2]=(c>>>0)%(A>>>0)),p=(c>>>0)/(A>>>0)>>>0,0|(w(0|(f=0)),p);if(!((o=A-1|0)&A))return 0|a&&(i[a>>2]=0|t,i[a+4>>2]=o&c|0&e),f=0,p=c>>>((0|Ie(0|A))>>>0),0|(w(0|f),p);if((o=(0|M(0|A))-(0|M(0|c))|0)>>>0<=30){s=e=o+1|0,t=c<<(A=31-o|0)|u>>>(e>>>0),e=c>>>(e>>>0),o=0,A=u<<A;break}return a?(i[a>>2]=0|t,i[a+4>>2]=l|0&e,p=0,0|(w(0|(f=0)),p)):(p=0,0|(w(0|(f=0)),p))}while(0);if(s){c=0|De(0|(h=0|n),0|(u=d|0&r),-1,-1),n=0|E(),l=A,A=0;do{r=l,l=o>>>31|l<<1,o=A|o<<1,Oe(0|c,0|n,0|(r=t<<1|r>>>31|0),0|(d=t>>>31|e<<1|0)),A=1&(f=(p=0|E())>>31|((0|p)<0?-1:0)<<1),t=0|Oe(0|r,0|d,f&h|0,(((0|p)<0?-1:0)>>31|((0|p)<0?-1:0)<<1)&u|0),e=0|E(),s=s-1|0}while(0!=(0|s));c=l,l=0}else c=A,l=0,A=0;return s=0,0|a&&(i[a>>2]=t,i[a+4>>2]=e),p=-2&(o<<1|0)|A,0|(w(0|(f=(0|o)>>>31|(c|s)<<1|0&(s<<1|o>>>31)|l)),p)}function Ue(t,e,n,r){n|=0;var i,a,o,s,A;return a=(r|=0)>>31|((0|r)<0?-1:0)<<1,i=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,o=0|Oe((A=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0)|0,(s=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e|0,0|A,0|s),t=a^A,e=i^s,0|Oe((0|qe(o,0|E(),0|Oe(a^n|0,i^r|0,0|a,0|i),0|E(),0))^t|0,(0|E())^e|0,0|t,0|e)}function Ne(t,e,n,r){e|=0,r|=0;var i,a;return n=0|function(t,e){var n,r,i,a=0;return t=((n=0|y(a=65535&(e|=0),i=65535&(t|=0)))>>>16)+(0|y(a,r=t>>>16))|0,e=0|y(a=e>>>16,i),0|(w((t>>>16)+(0|y(a,r))+(((65535&t)+e|0)>>>16)|0),t+e<<16|65535&n|0)}(i=t|=0,a=n|=0),t=0|E(),0|(w((0|y(e,a))+(0|y(r,i))+t|0&t|0),0|n)}function Be(t,e,n,r){n|=0;var a,o,s,A,l,c;return a=D,D=D+16|0,A=0|a,c=(r|=0)>>31|((0|r)<0?-1:0)<<1,l=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,qe(t=0|Oe((s=(e|=0)>>31|((0|e)<0?-1:0)<<1)^(t|=0)|0,(o=((0|e)<0?-1:0)>>31|((0|e)<0?-1:0)<<1)^e|0,0|s,0|o),e=0|E(),0|Oe(c^n|0,l^r|0,0|c,0|l),0|E(),A),r=0|Oe(i[A>>2]^s|0,i[A+4>>2]^o|0,0|s,0|o),n=0|E(),D=a,0|(w(0|n),r)}function ke(t,e,n,r){var a,o;return o=D,D=D+16|0,qe(t|=0,e|=0,n|=0,r|=0,a=0|o),D=o,0|(w(0|i[a+4>>2]),0|i[a>>2])}function Fe(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(w(e>>n|0),t>>>n|(e&(1<<n)-1)<<32-n):(w(0|((0|e)<0?-1:0)),e>>n-32|0)}function ze(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(w(e>>>n|0),t>>>n|(e&(1<<n)-1)<<32-n):(w(0),e>>>n-32|0)}function Ge(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(w(e<<n|(t&(1<<n)-1<<32-n)>>>32-n|0),t<<n):(w(t<<n-32|0),0)}function He(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+b(+t,+e)}function je(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+x(+t,+e)}function Ve(t){return(t=+t)>=0?+A(t+.5):+_(t-.5)}function We(t,e,n){t|=0,e|=0;var a,o,s=0;if((0|(n|=0))>=8192)return R(0|t,0|e,0|n),0|t;if(o=0|t,a=t+n|0,(3&t)==(3&e)){for(;3&t;){if(!n)return 0|o;r[t>>0]=0|r[e>>0],t=t+1|0,e=e+1|0,n=n-1|0}for(s=(n=-4&a|0)-64|0;(0|t)<=(0|s);)i[t>>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],i[t+16>>2]=i[e+16>>2],i[t+20>>2]=i[e+20>>2],i[t+24>>2]=i[e+24>>2],i[t+28>>2]=i[e+28>>2],i[t+32>>2]=i[e+32>>2],i[t+36>>2]=i[e+36>>2],i[t+40>>2]=i[e+40>>2],i[t+44>>2]=i[e+44>>2],i[t+48>>2]=i[e+48>>2],i[t+52>>2]=i[e+52>>2],i[t+56>>2]=i[e+56>>2],i[t+60>>2]=i[e+60>>2],t=t+64|0,e=e+64|0;for(;(0|t)<(0|n);)i[t>>2]=i[e>>2],t=t+4|0,e=e+4|0}else for(n=a-4|0;(0|t)<(0|n);)r[t>>0]=0|r[e>>0],r[t+1>>0]=0|r[e+1>>0],r[t+2>>0]=0|r[e+2>>0],r[t+3>>0]=0|r[e+3>>0],t=t+4|0,e=e+4|0;for(;(0|t)<(0|a);)r[t>>0]=0|r[e>>0],t=t+1|0,e=e+1|0;return 0|o}function Xe(t,e,n){e|=0;var a,o=0,s=0,A=0;if(a=(t|=0)+(n|=0)|0,e&=255,(0|n)>=67){for(;3&t;)r[t>>0]=e,t=t+1|0;for(A=e|e<<8|e<<16|e<<24,s=(o=-4&a|0)-64|0;(0|t)<=(0|s);)i[t>>2]=A,i[t+4>>2]=A,i[t+8>>2]=A,i[t+12>>2]=A,i[t+16>>2]=A,i[t+20>>2]=A,i[t+24>>2]=A,i[t+28>>2]=A,i[t+32>>2]=A,i[t+36>>2]=A,i[t+40>>2]=A,i[t+44>>2]=A,i[t+48>>2]=A,i[t+52>>2]=A,i[t+56>>2]=A,i[t+60>>2]=A,t=t+64|0;for(;(0|t)<(0|o);)i[t>>2]=A,t=t+4|0}for(;(0|t)<(0|a);)r[t>>0]=e,t=t+1|0;return a-n|0}function Qe(t){return(t=+t)>=0?+A(t+.5):+_(t-.5)}function Ye(t){t|=0;var e,n,r;return r=0|C(),(0|t)>0&(0|(e=(n=0|i[s>>2])+t|0))<(0|n)|(0|e)<0?(L(0|e),T(12),-1):(0|e)>(0|r)&&!(0|P(0|e))?(T(12),-1):(i[s>>2]=e,0|n)}return{___divdi3:Ue,___muldi3:Ne,___remdi3:Be,___uremdi3:ke,_areNeighborCells:function(t,e,n,r,a){a|=0;var o,s,A,l=0,c=0,u=0,h=0;if(A=D,D=D+64|0,s=A,o=A+56|0,!(!0&134217728==(2013265920&(e|=0)|0)&!0&134217728==(2013265920&(r|=0)|0)))return D=A,0|(a=5);if((0|(t|=0))==(0|(n|=0))&(0|e)==(0|r))return i[a>>2]=0,D=A,0|(a=0);if(c=0|ze(0|t,0|e,52),E(),c&=15,h=0|ze(0|n,0|r,52),E(),(0|c)!=(15&h|0))return D=A,0|(a=12);if(l=c+-1|0,c>>>0>1){qt(t,e,l,s),qt(n,r,l,o),u=0|i[(h=s)>>2],h=0|i[h+4>>2];t:do{if((0|u)==(0|i[o>>2])&&(0|h)==(0|i[o+4>>2])){l=0|ze(0|t,0|e,0|(c=3*(15^c)|0)),E(),l&=7,c=0|ze(0|n,0|r,0|c),E(),c&=7;do{if(0==(0|l)|0==(0|c))i[a>>2]=1,l=0;else if(7==(0|l))l=5;else{if(1==(0|l)|1==(0|c)&&0|Nt(u,h)){l=5;break}if((0|i[15536+(l<<2)>>2])!=(0|c)&&(0|i[15568+(l<<2)>>2])!=(0|c))break t;i[a>>2]=1,l=0}}while(0);return D=A,0|(a=l)}}while(0)}c=(l=s)+56|0;do{i[l>>2]=0,l=l+4|0}while((0|l)<(0|c));return O(t,e,1,s),l=(0|i[(e=s)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+8|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+16|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+24|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+32|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)||(0|i[(e=s+40|0)>>2])==(0|n)&&(0|i[e+4>>2])==(0|r)?1:1&((0|i[(l=s+48|0)>>2])==(0|n)?(0|i[l+4>>2])==(0|r):0),i[a>>2]=l,D=A,0|(a=0)},_bitshift64Ashr:Fe,_bitshift64Lshr:ze,_bitshift64Shl:Ge,_calloc:Le,_cellAreaKm2:function(t,e,n){return 0|(t=0|re(t|=0,e|=0,n|=0))||(a[n>>3]=6371.007180918475*+a[n>>3]*6371.007180918475),0|t},_cellAreaM2:function(t,e,n){return 0|(t=0|re(t|=0,e|=0,n|=0))||(a[n>>3]=6371.007180918475*+a[n>>3]*6371.007180918475*1e3*1e3),0|t},_cellAreaRads2:re,_cellToBoundary:Qt,_cellToCenterChild:function(t,e,n,r){n|=0,r|=0;var a=0;return a=0|ze(0|(t|=0),0|(e|=0),52),E(),(0|n)<16&(0|(a&=15))<=(0|n)?((0|a)<(0|n)&&(a=0|Ge(-1,-1,3+(3*(n+-1-a|0)|0)|0),a=0|Ge(0|~a,0|~(0|E()),3*(15-n|0)|0),e=~(0|E())&e,t&=~a),a=0|Ge(0|n,0,52),n=-15728641&e|0|E(),i[r>>2]=t|a,i[r+4>>2]=n,0|(r=0)):0|(r=4)},_cellToChildPos:function(t,e,n,r){n|=0,r|=0;var a,o=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,_=0;if(a=D,D=D+16|0,v=a,_=0|ze(0|(t|=0),0|(e|=0),52),E(),_&=15,n>>>0>15)return D=a,0|(_=4);if((0|_)<(0|n))return D=a,0|(_=12);if((0|_)!=(0|n))if(s=0|Ge(0|n,0,52),s|=t,l=0|E()|-15728641&e,(0|_)>(0|n)){c=n;do{g=0|Ge(7,0,3*(14-c|0)|0),c=c+1|0,s|=g,l=0|E()|l}while((0|c)<(0|_));g=s}else g=s;else g=t,l=e;m=0|ze(0|g,0|l,45),E();t:do{if(0|F(127&m)){if(c=0|ze(0|g,0|l,52),E(),0|(c&=15))for(s=1;;){if(!(0==((m=0|Ge(7,0,3*(15-s|0)|0))&g|0)&0==((0|E())&l|0))){u=33;break t}if(!(s>>>0<c>>>0))break;s=s+1|0}if(i[(m=r)>>2]=0,i[m+4>>2]=0,(0|_)>(0|n)){for(m=-15728641&e,p=_;;){if(f=p,(p=p+-1|0)>>>0>15|(0|_)<(0|p)){u=19;break}if((0|_)!=(0|p))if(s=0|Ge(0|p,0,52),s|=t,c=0|E()|m,(0|_)<(0|f))d=s;else{u=p;do{d=0|Ge(7,0,3*(14-u|0)|0),u=u+1|0,s|=d,c=0|E()|c}while((0|u)<(0|_));d=s}else d=t,c=e;if(h=0|ze(0|d,0|c,45),E(),0|F(127&h)){h=0|ze(0|d,0|c,52),E(),h&=15;e:do{if(h)for(u=1;;){if(s=0|ze(0|d,0|c,3*(15-u|0)|0),E(),0|(s&=7))break e;if(!(u>>>0<h>>>0)){s=0;break}u=u+1|0}else s=0}while(0);s=0==(0|s)&1}else s=0;if(c=0|ze(0|t,0|e,3*(15-f|0)|0),E(),7==(0|(c&=7))){o=5,u=42;break}if(1==(0|c)&(s=0!=(0|s))){o=5,u=42;break}if(0|(d=c+((0!=(0|c)&s)<<31>>31)|0)&&(u=0|ue(7,0,u=_-f|0,((0|u)<0)<<31>>31),h=0|E(),s?(s=0|De(0|(s=0|Ne(0|u,0|h,5,0)),0|E(),-5,-1),s=0|De(0|(s=0|Ue(0|s,0|E(),6,0)),0|E(),1,0),c=0|E()):(s=u,c=h),f=0|De(0|s,0|c,0|(f=0|Ne(0|u,0|h,0|(f=d+-1|0),((0|f)<0)<<31>>31|0)),0|E()),h=0|De(0|f,0|(d=0|E()),0|i[(h=r)>>2],0|i[h+4>>2]),d=0|E(),i[(f=r)>>2]=h,i[f+4>>2]=d),(0|p)<=(0|n)){u=37;break}}if(19==(0|u))S(23313,22674,1099,22710);else{if(37==(0|u)){o=0|i[(A=r)+4>>2],A=0|i[A>>2];break}if(42==(0|u))return D=a,0|o}}else o=0,A=0}else u=33}while(0);t:do{if(33==(0|u)){if(i[(m=r)>>2]=0,i[m+4>>2]=0,(0|_)>(0|n)){for(s=_;;){if(o=0|ze(0|t,0|e,3*(15-s|0)|0),E(),7==(0|(o&=7))){o=5;break}if(o=0|Ne(0|(A=0|ue(7,0,A=_-s|0,((0|A)<0)<<31>>31)),0|E(),0|o,0),A=0|E(),A=0|De(0|i[(m=r)>>2],0|i[m+4>>2],0|o,0|A),o=0|E(),i[(m=r)>>2]=A,i[m+4>>2]=o,(0|(s=s+-1|0))<=(0|n))break t}return D=a,0|o}o=0,A=0}}while(0);return 0|Ut(g,l,_,v)&&S(23313,22674,1063,22725),((0|o)>-1|-1==(0|o)&A>>>0>4294967295)&((0|(v=0|i[(_=v)+4>>2]))>(0|o)|((0|v)==(0|o)?(0|i[_>>2])>>>0>A>>>0:0))?(D=a,0|(_=0)):(S(23313,22674,1139,22710),0)},_cellToChildren:function(t,e,n,r){r|=0;var a,o,s=0,A=0;if(o=D,D=D+16|0,Zt(a=o,t|=0,e|=0,n|=0),0==(0|(t=0|i[(e=a)>>2]))&0==(0|(e=0|i[e+4>>2])))return D=o,0;s=0,n=0;do{i[(A=r+(s<<3)|0)>>2]=t,i[A+4>>2]=e,s=0|De(0|s,0|n,1,0),n=0|E(),Kt(a),t=0|i[(A=a)>>2],e=0|i[A+4>>2]}while(!(0==(0|t)&0==(0|e)));return D=o,0},_cellToChildrenSize:Ut,_cellToLatLng:Xt,_cellToLocalIj:function(t,e,n,r,i,a){var o,s;return t|=0,e|=0,n|=0,r|=0,a|=0,s=D,D=D+16|0,o=s,(i|=0)?t=15:(t=0|le(t,e,n,r,o))||(_t(o,a),t=0),D=s,0|t},_cellToParent:qt,_cellToVertex:ye,_cellToVertexes:function(t,e,n){n|=0;var r,a=0,o=0;return o=0==(0|Nt(t|=0,e|=0)),r=0==(0|(a=0|ye(t,e,0,n))),o?r?0|(a=0|ye(t,e,1,n+8|0))||0|(a=0|ye(t,e,2,n+16|0))||0|(a=0|ye(t,e,3,n+24|0))||(a=0|ye(t,e,4,n+32|0))?0|(o=a):0|ye(t,e,5,n+40|0):0|(o=a):r?0|(a=0|ye(t,e,1,n+8|0))||0|(a=0|ye(t,e,2,n+16|0))||0|(a=0|ye(t,e,3,n+24|0))||0|(a=0|ye(t,e,4,n+32|0))?0|(o=a):(i[(o=n+40|0)>>2]=0,i[o+4>>2]=0,0|(o=0)):0|(o=a)},_cellsToDirectedEdge:function(t,e,n,r,a){return a|=0,7==(0|(n=0|B(t|=0,e|=0,n|=0,r|=0)))?0|(a=11):(r=0|Ge(0|n,0,56),e=-2130706433&e|0|E()|268435456,i[a>>2]=t|r,i[a+4>>2]=e,0|(a=0))},_cellsToLinkedMultiPolygon:function(t,e,n){n|=0;var r,a,o,s=0;if(o=D,D=D+32|0,r=o,t=0|function(t,e,n){t|=0,n|=0;var r,a,o=0,s=0,A=0,l=0,c=0,u=0;if(a=D,D=D+176|0,r=a,(0|(e|=0))<1)return xe(n,0,0),D=a,0;for(c=0|ze(0|i[(c=t)>>2],0|i[c+4>>2],52),E(),xe(n,(0|e)>6?e:6,15&c),c=0;!(0|(o=0|Qt(0|i[(o=t+(c<<3)|0)>>2],0|i[o+4>>2],r)));){if((0|(o=0|i[r>>2]))>0){l=0;do{A=r+8+(l<<4)|0,(s=0|Se(n,o=r+8+(((0|(l=l+1|0))%(0|o)|0)<<4)|0,A))?we(n,s):Ee(n,A,o),o=0|i[r>>2]}while((0|l)<(0|o))}if((0|(c=c+1|0))>=(0|e)){o=0,u=13;break}}return 13==(0|u)?(D=a,0|o):(be(n),D=a,0|(u=o))}(t|=0,e|=0,a=o+16|0),0|t)return D=o,0|(n=t);if(i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,0|(t=0|Me(a)))do{e=0|ie(n);do{ae(e,t),s=t+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],we(a,t),t=0|Te(a,r)}while(0!=(0|t));t=0|Me(a)}while(0!=(0|t));return be(a),(t=0|se(n))?(oe(n),D=o,0|(s=t)):(D=o,0|(s=0))},_childPosToCell:function(t,e,n,r,a,o){t|=0,e|=0,o|=0;var s,A=0,l=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0;if(s=D,D=D+16|0,A=s,(a|=0)>>>0>15)return D=s,0|(o=4);if(l=0|ze(0|(n|=0),0|(r|=0),52),E(),(0|(l&=15))>(0|a))return D=s,0|(o=12);if(0|Ut(n,r,a,A)&&S(23313,22674,1063,22725),!(((0|e)>-1|-1==(0|e)&t>>>0>4294967295)&((0|(u=0|i[(h=A)+4>>2]))>(0|e)|((0|u)==(0|e)?(0|i[h>>2])>>>0>t>>>0:0))))return D=s,0|(o=2);h=a-l|0,a=0|Ge(0|a,0,52),c=0|E()|-15728641&r,i[(u=o)>>2]=a|n,i[u+4>>2]=c,u=0|ze(0|n,0|r,45),E();t:do{if(0|F(127&u)){if(0|l)for(A=1;;){if(!(0==((u=0|Ge(7,0,3*(15-A|0)|0))&n|0)&0==((0|E())&r|0)))break t;if(!(A>>>0<l>>>0))break;A=A+1|0}if((0|h)<1)return D=s,0|(o=0);for(u=15^l,r=-1,c=1,A=1;;){l=0|ue(7,0,l=h-c|0,((0|l)<0)<<31>>31),n=0|E();do{if(A){if(A=0|Ue(0|(A=0|De(0|(A=0|Ne(0|l,0|n,5,0)),0|E(),-5,-1)),0|E(),6,0),(0|e)>(0|(a=0|E()))|(0|e)==(0|a)&t>>>0>A>>>0){e=0|Oe(0|(e=0|De(0|t,0|e,-1,-1)),0|E(),0|A,0|a),A=0|E(),p=0|i[(d=o)>>2],d=0|i[d+4>>2],f=0|Ge(7,0,0|(m=3*(u+r|0)|0)),d&=~(0|E()),m=0|Ge(0|(a=0|De(0|(r=0|Ue(0|e,0|A,0|l,0|n)),0|(t=0|E()),2,0)),0|E(),0|m),d=0|E()|d,i[(a=o)>>2]=m|p&~f,i[a+4>>2]=d,t=0|Oe(0|e,0|A,0|(t=0|Ne(0|r,0|t,0|l,0|n)),0|E()),A=0,e=0|E();break}f=0|i[(m=o)>>2],m=0|i[m+4>>2],p=0|Ge(7,0,3*(u+r|0)|0),m&=~(0|E()),i[(A=o)>>2]=f&~p,i[A+4>>2]=m,A=1;break}a=0|i[(f=o)>>2],f=0|i[f+4>>2],d=0|Ge(7,0,0|(r=3*(u+r|0)|0)),f&=~(0|E()),r=0|Ge(0|(m=0|Ue(0|t,0|e,0|l,0|n)),0|(A=0|E()),0|r),f=0|E()|f,i[(p=o)>>2]=r|a&~d,i[p+4>>2]=f,t=0|Oe(0|t,0|e,0|(A=0|Ne(0|m,0|A,0|l,0|n)),0|E()),A=0,e=0|E()}while(0);if(!((0|h)>(0|c))){e=0;break}r=~c,c=c+1|0}return D=s,0|e}}while(0);if((0|h)<1)return D=s,0|(m=0);for(a=15^l,A=1;;){if(p=0|ue(7,0,p=h-A|0,((0|p)<0)<<31>>31),m=0|E(),n=0|i[(c=o)>>2],c=0|i[c+4>>2],r=0|Ge(7,0,0|(l=3*(a-A|0)|0)),c&=~(0|E()),l=0|Ge(0|(d=0|Ue(0|t,0|e,0|p,0|m)),0|(f=0|E()),0|l),c=0|E()|c,i[(u=o)>>2]=l|n&~r,i[u+4>>2]=c,t=0|Oe(0|t,0|e,0|(m=0|Ne(0|d,0|f,0|p,0|m)),0|E()),e=0|E(),(0|h)<=(0|A)){e=0;break}A=A+1|0}return D=s,0|e},_compactCells:function(t,e,n,r){e|=0;var a,o=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,_=0,y=0,x=0,b=0,M=0,w=0,T=0;if(0==(0|(n|=0))&0==(0|(r|=0)))return 0|(w=0);if(s=0|i[(o=t|=0)>>2],!0&0==(15728640&(o=0|i[o+4>>2])|0)){if(!((0|r)>0|0==(0|r)&n>>>0>0))return 0|(w=0);if(i[(w=e)>>2]=s,i[w+4>>2]=o,1==(0|n)&0==(0|r))return 0|(w=0);o=1;do{M=0|i[(b=t+(o<<3)|0)+4>>2],i[(w=e+(o<<3)|0)>>2]=i[b>>2],i[w+4>>2]=M,o=o+1|0}while(0<(0|r)|0==(0|r)&o>>>0<n>>>0);return 0|(o=0)}if(!(M=0|Re(a=n<<3)))return 0|(w=13);if(We(0|M,0|t,0|a),!(b=0|Le(n,8)))return Pe(M),0|(w=13);t:do{if(0|n){e:for(;;){y=0|ze(0|(_=0|i[(o=M)>>2]),0|(o=0|i[o+4>>2]),52),E(),x=(y&=15)+-1|0,v=(0|n)>0;n:do{if(0!=(0|y)&v){if(p=((0|n)<0)<<31>>31,m=0|Ge(0|x,0,52),g=0|E(),x>>>0>15){if(!(0==(0|_)&0==(0|o))){w=17;break e}for(s=0;;){if((0|(s=s+1|0))>=(0|n))break n;if(!(0==(0|(g=0|i[(r=M+(s<<3)|0)>>2]))&0==(0|(r=0|i[r+4>>2])))){o=r,w=17;break e}}}for(s=0,t=_,r=o;;){if(!(0==(0|t)&0==(0|r))){if(!(!0&0==(117440512&r|0))){w=22;break e}if(l=0|ze(0|t,0|r,52),E(),(0|(l&=15))<(0|x)){o=12,w=28;break e}if((0|l)!=(0|x)&&(t|=m,r=-15728641&r|g,l>>>0>=y>>>0)){A=x;do{f=0|Ge(7,0,3*(14-A|0)|0),A=A+1|0,t|=f,r=0|E()|r}while(A>>>0<l>>>0)}if(A=0|ke(0|t,0|r,0|n,0|p),E(),0==(0|(c=0|i[(l=u=b+(A<<3)|0)>>2]))&0==(0|(l=0|i[l+4>>2])))A=u;else for(f=0;;){if((0|f)>(0|n)){w=32;break e}if((0|c)==(0|t)&(-117440513&l|0)==(0|r)){h=0|ze(0|c,0|l,56),E(),d=(h&=7)+1|0,T=0|ze(0|c,0|l,45),E();r:do{if(0|F(127&T)){if(c=0|ze(0|c,0|l,52),E(),!(c&=15)){l=6;break}for(l=1;;){if(!(0==((T=0|Ge(7,0,3*(15-l|0)|0))&t|0)&0==((0|E())&r|0))){l=7;break r}if(!(l>>>0<c>>>0)){l=6;break}l=l+1|0}}else l=7}while(0);if((h+2|0)>>>0>l>>>0){w=42;break e}T=0|Ge(0|d,0,56),r=0|E()|-117440513&r,i[(d=u)>>2]=0,i[d+4>>2]=0,t|=T}else A=(A+1|0)%(0|n)|0;if(0==(0|(c=0|i[(l=u=b+(A<<3)|0)>>2]))&0==(0|(l=0|i[l+4>>2]))){A=u;break}f=f+1|0}i[(T=A)>>2]=t,i[T+4>>2]=r}if((0|(s=s+1|0))>=(0|n))break n;t=0|i[(r=M+(s<<3)|0)>>2],r=0|i[r+4>>2]}}}while(0);if((n+5|0)>>>0<11){w=85;break}if(!(g=0|Le((0|n)/6|0,8))){w=49;break}n:do{if(v){f=0,d=0;do{if(!(0==(0|(s=0|i[(r=l=b+(f<<3)|0)>>2]))&0==(0|(r=0|i[r+4>>2])))){c=0|ze(0|s,0|r,56),E(),t=(c&=7)+1|0,u=-117440513&r,T=0|ze(0|s,0|r,45),E();r:do{if(0|F(127&T)){if(h=0|ze(0|s,0|r,52),E(),0|(h&=15))for(A=1;;){if(!(0==(s&(T=0|Ge(7,0,3*(15-A|0)|0))|0)&0==(u&(0|E())|0)))break r;if(!(A>>>0<h>>>0))break;A=A+1|0}s|=r=0|Ge(0|t,0,56),r=0|E()|u,i[(t=l)>>2]=s,i[t+4>>2]=r,t=c+2|0}}while(0);7==(0|t)&&(i[(T=g+(d<<3)|0)>>2]=s,i[T+4>>2]=-117440513&r,d=d+1|0)}f=f+1|0}while((0|f)!=(0|n));if(v){if(f=((0|n)<0)<<31>>31,p=0|Ge(0|x,0,52),m=0|E(),x>>>0>15){if(!(0==(0|_)&0==(0|o))){o=4,w=84;break e}for(o=0;;){if((0|(o=o+1|0))>=(0|n)){s=0,o=d;break n}if(!(0==(0|i[(T=M+(o<<3)|0)>>2])&0==(0|i[T+4>>2]))){o=4,w=84;break e}}}for(h=0,s=0,u=_;;){do{if(!(0==(0|u)&0==(0|o))){if(l=0|ze(0|u,0|o,52),E(),(0|(l&=15))<(0|x)){o=12,w=84;break e}do{if((0|l)==(0|x))r=u,l=o;else{if(r=u|p,t=-15728641&o|m,l>>>0<y>>>0){l=t;break}A=x;do{T=0|Ge(7,0,3*(14-A|0)|0),A=A+1|0,r|=T,t=0|E()|t}while(A>>>0<l>>>0);l=t}}while(0);for(A=0|ke(0|r,0|l,0|n,0|f),E(),t=0;;){if((0|t)>(0|n)){w=77;break e}if((-117440513&(c=0|i[(T=b+(A<<3)|0)+4>>2])|0)==(0|l)&&(0|i[T>>2])==(0|r)){w=79;break}if((0|i[(T=b+((A=(A+1|0)%(0|n)|0)<<3)|0)>>2])==(0|r)&&(0|i[T+4>>2])==(0|l))break;t=t+1|0}if(79==(0|w)&&(w=0,!0&100663296==(117440512&c|0)))break;i[(T=e+(s<<3)|0)>>2]=u,i[T+4>>2]=o,s=s+1|0}}while(0);if((0|(o=h+1|0))>=(0|n)){o=d;break n}h=o,u=0|i[(T=M+(o<<3)|0)>>2],o=0|i[T+4>>2]}}else s=0,o=d}else s=0,o=0}while(0);if(Xe(0|b,0,0|a),We(0|M,0|g,o<<3|0),Pe(g),!o)break t;e=e+(s<<3)|0,n=o}if(17==(0|w))!0&0==(117440512&o|0)?(o=4,w=28):w=22;else if(32==(0|w))S(23313,22674,362,22684);else{if(42==(0|w))return Pe(M),Pe(b),0|(T=10);if(49==(0|w))return Pe(M),Pe(b),0|(T=13);if(77==(0|w))S(23313,22674,462,22684);else{if(84==(0|w))return Pe(g),Pe(M),Pe(b),0|(T=o);if(85==(0|w)){We(0|e,0|M,n<<3|0);break}}}if(22==(0|w))return Pe(M),Pe(b),0|(T=5);if(28==(0|w))return Pe(M),Pe(b),0|(T=o)}}while(0);return Pe(M),Pe(b),0|(T=0)},_destroyLinkedMultiPolygon:oe,_directedEdgeToBoundary:Mt,_directedEdgeToCells:function(t,e,n){t|=0;var r,a,o,s=0;return r=D,D=D+16|0,s=r,!0&268435456==(2013265920&(e|=0)|0)?(a=-2130706433&e|134217728,i[(o=n|=0)>>2]=t,i[o+4>>2]=a,i[s>>2]=0,e=0|ze(0|t,0|e,56),E(),s=0|N(t,a,7&e,s,n+8|0),D=r,0|s):(D=r,0|(s=6))},_edgeLengthKm:function(t,e,n){n|=0;var r,o=0,s=0,A=0,l=0,u=0,f=0,p=0;if(r=D,D=D+176|0,0|(t=0|Mt(t|=0,e|=0,l=r)))return l=t,A=+a[n>>3],A*=6371.007180918475,a[n>>3]=A,D=r,0|l;if(a[n>>3]=0,(0|(t=0|i[l>>2]))<=1)return l=0,A=0,A*=6371.007180918475,a[n>>3]=A,D=r,0|l;e=t+-1|0,t=0,o=+a[l+8>>3],s=+a[l+16>>3],A=0;do{f=o,o=+a[l+8+((t=t+1|0)<<4)>>3],p=+d(.5*(o-f)),u=s,s=+a[l+8+(t<<4)+8>>3],u=p*p+(u=+d(.5*(s-u)))*(+h(+f)*+h(+o)*u),A+=2*+v(+ +c(+u),+ +c(+(1-u)))}while((0|t)!=(0|e));return a[n>>3]=A,l=0,p=A,p*=6371.007180918475,a[n>>3]=p,D=r,0|l},_edgeLengthM:function(t,e,n){n|=0;var r,o=0,s=0,A=0,l=0,u=0,f=0,p=0;if(r=D,D=D+176|0,0|(t=0|Mt(t|=0,e|=0,l=r)))return l=t,A=+a[n>>3],A*=6371.007180918475,A*=1e3,a[n>>3]=A,D=r,0|l;if(a[n>>3]=0,(0|(t=0|i[l>>2]))<=1)return l=0,A=0,A*=6371.007180918475,A*=1e3,a[n>>3]=A,D=r,0|l;e=t+-1|0,t=0,o=+a[l+8>>3],s=+a[l+16>>3],A=0;do{f=o,o=+a[l+8+((t=t+1|0)<<4)>>3],p=+d(.5*(o-f)),u=s,s=+a[l+8+(t<<4)+8>>3],u=p*p+(u=+d(.5*(s-u)))*(+h(+f)*+h(+o)*u),A+=2*+v(+ +c(+u),+ +c(+(1-u)))}while((0|t)!=(0|e));return a[n>>3]=A,l=0,p=A,p*=6371.007180918475,p*=1e3,a[n>>3]=p,D=r,0|l},_edgeLengthRads:function(t,e,n){n|=0;var r,o=0,s=0,A=0,l=0,u=0,f=0,p=0;if(r=D,D=D+176|0,0|(t=0|Mt(t|=0,e|=0,l=r)))return D=r,0|(l=t);if(a[n>>3]=0,(0|(t=0|i[l>>2]))<=1)return D=r,0|(l=0);e=t+-1|0,t=0,o=+a[l+8>>3],s=+a[l+16>>3],A=0;do{f=o,o=+a[l+8+((t=t+1|0)<<4)>>3],p=+d(.5*(o-f)),u=s,s=+a[l+8+(t<<4)+8>>3],u=p*p+(u=+d(.5*(s-u)))*(+h(+o)*+h(+f)*u),A+=2*+v(+ +c(+u),+ +c(+(1-u)))}while((0|t)<(0|e));return a[n>>3]=A,D=r,0|(l=0)},_emscripten_replace_memory:function(t){return r=new Int8Array(t),i=new Int32Array(t),a=new Float64Array(t),n=t,!0},_free:Pe,_getBaseCellNumber:Ot,_getDirectedEdgeDestination:function(t,e,n){t|=0,e|=0,n|=0;var r,a,o=0;return r=D,D=D+16|0,i[(o=r)>>2]=0,!0&268435456==(2013265920&e|0)?(a=0|ze(0|t,0|e,56),E(),o=0|N(t,-2130706433&e|134217728,7&a,o,n),D=r,0|o):(D=r,0|(o=6))},_getDirectedEdgeOrigin:function(t,e,n){return t|=0,n|=0,!0&268435456==(2013265920&(e|=0)|0)?(i[n>>2]=t,i[n+4>>2]=-2130706433&e|134217728,0|(n=0)):0|(n=6)},_getHexagonAreaAvgKm2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20528+(t<<3)>>3],0|(e=0))},_getHexagonAreaAvgM2:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20656+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgKm:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20784+(t<<3)>>3],0|(e=0))},_getHexagonEdgeLengthAvgM:function(t,e){return e|=0,(t|=0)>>>0>15?0|(e=4):(a[e>>3]=+a[20912+(t<<3)>>3],0|(e=0))},_getIcosahedronFaces:function t(e,n,r){r|=0;var a,o=0,s=0,A=0,l=0,c=0,u=0,h=0,d=0;a=D,D=D+128|0,h=a+112|0,A=a+96|0,d=a,s=0|ze(0|(e|=0),0|(n|=0),52),E(),c=15&s,i[h>>2]=c,l=0|ze(0|e,0|n,45),E(),l&=127;t:do{if(0|F(l)){if(0|c)for(o=1;;){if(!(0==((u=0|Ge(7,0,3*(15-o|0)|0))&e|0)&0==((0|E())&n|0))){s=0;break t}if(!(o>>>0<c>>>0))break;o=o+1|0}if(!(1&s))return u=0|Ge(c+1|0,0,52),d=0|E()|-15728641&n,d=0|t((u|e)&~(h=0|Ge(7,0,3*(14-c|0)|0)),d&~(0|E()),r),D=a,0|d;s=1}else s=0}while(0);if(!(o=0|Wt(e,n,A))){s?(Ct(A,h,d),u=5):(Dt(A,h,d),u=6);t:do{if(0|F(l))if(c)for(o=1;;){if(!(0==((l=0|Ge(7,0,3*(15-o|0)|0))&e|0)&0==((0|E())&n|0))){e=2;break t}if(!(o>>>0<c>>>0)){e=5;break}o=o+1|0}else e=5;else e=2}while(0);Xe(0|r,-1,e<<2|0);t:do{if(s)for(A=0;;){if(Pt(l=d+(A<<4)|0,0|i[h>>2]),l=0|i[l>>2],-1==(0|(c=0|i[r>>2]))|(0|c)==(0|l))o=r;else{s=0;do{if((s=s+1|0)>>>0>=e>>>0){o=1;break t}c=0|i[(o=r+(s<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|l)))}if(i[o>>2]=l,(A=A+1|0)>>>0>=u>>>0){o=0;break}}else for(A=0;;){if(Rt(l=d+(A<<4)|0,0|i[h>>2],0,1),l=0|i[l>>2],-1==(0|(c=0|i[r>>2]))|(0|c)==(0|l))o=r;else{s=0;do{if((s=s+1|0)>>>0>=e>>>0){o=1;break t}c=0|i[(o=r+(s<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|l)))}if(i[o>>2]=l,(A=A+1|0)>>>0>=u>>>0){o=0;break}}}while(0)}return D=a,0|(d=o)},_getNumCells:ee,_getPentagons:Yt,_getRes0Cells:function(t){t|=0;var e=0,n=0,r=0;e=0;do{Ge(0|e,0,45),r=134225919|E(),i[(n=t+(e<<3)|0)>>2]=-1,i[n+4>>2]=r,e=e+1|0}while(122!=(0|e));return 0},_getResolution:function(t,e){return e=0|ze(0|(t|=0),0|(e|=0),52),E(),15&e|0},_greatCircleDistanceKm:te,_greatCircleDistanceM:function(t,e){t|=0;var n,r,i,o=0;return r=+a[(e|=0)>>3],n=+a[t>>3],o=(i=+d(.5*(r-n)))*i+(o=+d(.5*(+a[e+8>>3]-+a[t+8>>3])))*(+h(+r)*+h(+n)*o),2*+v(+ +c(+o),+ +c(+(1-o)))*6371.007180918475*1e3},_greatCircleDistanceRads:function(t,e){t|=0;var n,r,i,o=0;return r=+a[(e|=0)>>3],n=+a[t>>3],o=(i=+d(.5*(r-n)))*i+(o=+d(.5*(+a[e+8>>3]-+a[t+8>>3])))*(+h(+r)*+h(+n)*o),2*+v(+ +c(+o),+ +c(+(1-o)))},_gridDisk:O,_gridDiskDistances:I,_gridDistance:function(t,e,n,r,a){n|=0,r|=0,a|=0;var o,s,A=0,l=0;return s=D,D=D+32|0,l=s,0|(o=0|le(t|=0,e|=0,t,e,A=s+12|0))?(D=s,0|(l=o)):0|(t=0|le(t,e,n,r,l))?(D=s,0|(l=t)):(A=0|vt(A,l),i[(l=a)>>2]=A,i[l+4>>2]=((0|A)<0)<<31>>31,D=s,0|(l=0))},_gridPathCells:function(t,e,n,r,a){n|=0,r|=0,a|=0;var o,s=0,A=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,T=0,C=0;if(o=D,D=D+48|0,c=o+12|0,T=o,!(s=0|le(t|=0,e|=0,t,e,A=o+24|0))&&!(s=0|le(t,e,n,r,c))){w=((0|(M=0|vt(A,c)))<0)<<31>>31,i[A>>2]=0,i[A+4>>2]=0,i[A+8>>2]=0,i[c>>2]=0,i[c+4>>2]=0,i[c+8>>2]=0,0|le(t,e,t,e,A)&&S(23313,23090,691,23299),0|le(t,e,n,r,c)&&S(23313,23090,696,23299),xt(A),xt(c),M?(g=+(0|M),b=A,r=f=0|i[A>>2],s=p=0|i[(y=A+4|0)>>2],n=m=0|i[(x=A+8|0)>>2],v=+((0|i[c>>2])-f|0)/g,_=+((0|i[c+4>>2])-p|0)/g,g=+((0|i[c+8>>2])-m|0)/g):(y=s=A+4|0,x=n=A+8|0,b=A,r=0|i[A>>2],s=0|i[s>>2],n=0|i[n>>2],v=0,_=0,g=0),i[T>>2]=r,i[(m=T+4|0)>>2]=s,i[(p=T+8|0)>>2]=n;t:do{if((0|M)<0)s=0;else for(d=0,f=0,s=r;;){C=v*(h=+(f>>>0)+4294967296*+(0|d))+ +(0|s),u=_*h+ +(0|i[y>>2]),h=g*h+ +(0|i[x>>2]),n=~~+Ve(+C),A=~~+Ve(+u),s=~~+Ve(+h),C=+l(+(+(0|n)-C)),u=+l(+(+(0|A)-u)),h=+l(+(+(0|s)-h));do{if(!(C>u&C>h)){if(c=0-n|0,u>h){r=c-s|0;break}r=A,s=c-A|0;break}n=0-(A+s)|0,r=A}while(0);if(i[T>>2]=n,i[m>>2]=r,i[p>>2]=s,bt(T),0|(s=0|ce(t,e,T,a+(f<<3)|0)))break t;if(!((0|d)<(0|w)|(0|d)==(0|w)&f>>>0<M>>>0)){s=0;break t}s=0|De(0|f,0|d,1,0),d=c=0|E(),f=s,s=0|i[b>>2]}}while(0);return D=o,0|(T=s)}return D=o,0|(T=s)},_gridPathCellsSize:function(t,e,n,r,a){n|=0,r|=0,a|=0;var o,s=0,A=0,l=0;return o=D,D=D+32|0,l=o,(s=0|le(t|=0,e|=0,t,e,A=o+12|0))||(s=0|le(t,e,n,r,l))?(D=o,0|(l=s)):(r=0|De(0|(r=0|vt(A,l)),((0|r)<0)<<31>>31|0,1,0),A=0|E(),i[(l=a)>>2]=r,i[l+4>>2]=A,D=o,0|(l=0))},_gridRingUnsafe:function(t,e,n,r){t|=0,e|=0,n|=0,r|=0;var a,o,s=0,A=0,l=0,c=0,u=0,h=0,d=0,f=0,p=0;if(o=D,D=D+16|0,p=o+8|0,i[(f=a=o)>>2]=t,i[f+4>>2]=e,!n)return i[(p=r)>>2]=t,i[p+4>>2]=e,D=o,0|(p=0);i[p>>2]=0;t:do{if(0|Nt(t,e))t=9;else{if(A=(0|n)>0){s=0,f=t;do{if(0|(t=0|N(f,e,4,p,a)))break t;if(s=s+1|0,0|Nt(f=0|i[(e=a)>>2],e=0|i[e+4>>2])){t=9;break t}}while((0|s)<(0|n));if(i[(d=r)>>2]=f,i[d+4>>2]=e,d=n+-1|0,A){h=0,t=1;do{if(s=22384+(h<<2)|0,5==(0|h))for(l=0|i[s>>2],A=0,s=t;;){if(0|(t=0|N(0|i[(t=a)>>2],0|i[t+4>>2],l,p,a)))break t;if((0|A)!=(0|d)){if(c=0|i[(u=a)>>2],u=0|i[u+4>>2],i[(t=r+(s<<3)|0)>>2]=c,i[t+4>>2]=u,0|Nt(c,u)){t=9;break t}t=s+1|0}else t=s;if((0|(A=A+1|0))>=(0|n))break;s=t}else for(l=a,u=0|i[s>>2],c=0,s=t,A=0|i[l>>2],l=0|i[l+4>>2];;){if(0|(t=0|N(A,l,u,p,a)))break t;if(A=0|i[(l=a)>>2],l=0|i[l+4>>2],i[(t=r+(s<<3)|0)>>2]=A,i[t+4>>2]=l,t=s+1|0,0|Nt(A,l)){t=9;break t}if((0|(c=c+1|0))>=(0|n))break;s=t}h=h+1|0}while(h>>>0<6);l=f,s=0|i[(t=a)>>2],A=e,t=0|i[t+4>>2]}else l=f,s=f,A=e,t=e}else i[(l=r)>>2]=t,i[l+4>>2]=e,l=t,s=t,A=e,t=e;t=(0|l)==(0|s)&(0|A)==(0|t)?0:9}}while(0);return D=o,0|(p=t)},_i64Add:De,_i64Subtract:Oe,_isPentagon:Nt,_isResClassIII:function(t,e){return e=0|ze(0|(t|=0),0|(e|=0),52),E(),1&e|0},_isValidCell:It,_isValidDirectedEdge:function(t,e){var n=0;switch(n=0|ze(0|(t|=0),0|(e|=0),56),E(),7&n){case 0:case 7:return 0|(n=0)}return n=-2130706433&e|134217728,!0&268435456==(2013265920&e|0)?!0&16777216==(117440512&e|0)&0!=(0|Nt(t,n))?0|(n=0):0|(n=0|It(t,n)):0|(n=0)},_isValidVertex:function(t,e){t|=0;var n,r,a=0,o=0;return r=D,D=D+16|0,n=r,!0&536870912==(2013265920&(e|=0)|0)&&0|It(t,a=-2130706433&e|134217728)?(o=0|ze(0|t,0|e,56),E(),a=(o=0==(0|ye(t,a,7&o,n)))&((0|i[(a=n)>>2])==(0|t)?(0|i[a+4>>2])==(0|e):0)&1,D=r,0|a):(D=r,0|(a=0))},_latLngToCell:jt,_llvm_maxnum_f64:He,_llvm_minnum_f64:je,_llvm_round_f64:Ve,_localIjToCell:function(t,e,n,r,i){var a,o;return t|=0,e|=0,n|=0,i|=0,o=D,D=D+16|0,a=o,(r|=0)?n=15:(n=0|yt(n,a))||(n=0|ce(t,e,a,i)),D=o,0|n},_malloc:Re,_maxFaceCount:function(t,e,n){n|=0;var r=0,a=0;if(a=0|ze(0|(t|=0),0|(e|=0),45),E(),!(0|F(127&a)))return a=2,i[n>>2]=a,0;if(a=0|ze(0|t,0|e,52),E(),!(a&=15))return a=5,i[n>>2]=a,0;for(r=1;;){if(!(0==((0|Ge(7,0,3*(15-r|0)|0))&t|0)&0==((0|E())&e|0))){r=2,t=6;break}if(!(r>>>0<a>>>0)){r=5,t=6;break}r=r+1|0}return 6==(0|t)?(i[n>>2]=r,0):0},_maxGridDiskSize:function(t,e){e|=0;var n=0,r=0,a=0;return(0|(t|=0))<0?0|(e=2):(0|t)>13780509?0|(e=0|ee(15,e)):(a=0|Ne(0|t,0|(n=((0|t)<0)<<31>>31),3,0),r=0|E(),n=0|De(0|t,0|n,1,0),n=0|De(0|(n=0|Ne(0|a,0|r,0|n,0|E())),0|E(),1,0),t=0|E(),i[e>>2]=n,i[e+4>>2]=t,0|(e=0))},_maxPolygonToCellsSize:function(t,e,n,r){e|=0,r|=0;var a,o=0,s=0,A=0,l=0,c=0;if(a=D,D=D+48|0,o=a+16|0,s=a+8|0,A=a,0|(n|=0))return D=a,0|(A=15);if(l=0|i[(c=t|=0)+4>>2],i[(n=s)>>2]=i[c>>2],i[n+4>>2]=l,de(s,o),!(e=0|Y(o,e,A))){if(n=0|i[s>>2],(0|(s=0|i[t+8>>2]))>0){o=0|i[t+12>>2],e=0;do{n=(0|i[o+(e<<3)>>2])+n|0,e=e+1|0}while((0|e)<(0|s))}o=0|i[(e=A)>>2],(0|(e=0|i[e+4>>2]))<(0|(s=((0|n)<0)<<31>>31))|(0|e)==(0|s)&o>>>0<n>>>0?(i[(e=A)>>2]=n,i[e+4>>2]=s,e=s):n=o,l=0|De(0|n,0|e,12,0),c=0|E(),i[(e=A)>>2]=l,i[e+4>>2]=c,i[(e=r)>>2]=l,i[e+4>>2]=c,e=0}return D=a,0|(c=e)},_memcpy:We,_memset:Xe,_originToDirectedEdges:function(t,e,n){n|=0;var r,a=0;return r=0==(0|Nt(t|=0,e|=0)),e&=-2130706433,i[(a=n)>>2]=r?t:0,i[a+4>>2]=r?285212672|e:0,i[(a=n+8|0)>>2]=t,i[a+4>>2]=301989888|e,i[(a=n+16|0)>>2]=t,i[a+4>>2]=318767104|e,i[(a=n+24|0)>>2]=t,i[a+4>>2]=335544320|e,i[(a=n+32|0)>>2]=t,i[a+4>>2]=352321536|e,i[(n=n+40|0)>>2]=t,i[n+4>>2]=369098752|e,0},_pentagonCount:function(){return 12},_polygonToCells:function(t,e,n,r){e|=0,r|=0;var a,o,s,A,l=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0,g=0,v=0,_=0,y=0,x=0,b=0,M=0,w=0,S=0,T=0,C=0,R=0,P=0,L=0,O=0,I=0,N=0,B=0,F=0;if(A=D,D=D+112|0,a=A+80|0,d=A+72|0,o=A,s=A+56|0,0|(n|=0))return D=A,0|(F=15);if(!(F=0|Re(32+(i[(f=(t|=0)+8|0)>>2]<<5)|0)))return D=A,0|(F=13);if(fe(t,F),B=0|i[(N=t)+4>>2],i[(n=d)>>2]=i[N>>2],i[n+4>>2]=B,de(d,a),n=0|Y(a,e,o))N=0,B=0;else{if(n=0|i[d>>2],(0|(c=0|i[f>>2]))>0){u=0|i[t+12>>2],l=0;do{n=(0|i[u+(l<<3)>>2])+n|0,l=l+1|0}while((0|l)!=(0|c));l=n}else l=n;c=0|i[(n=o)>>2],(0|(n=0|i[n+4>>2]))<(0|(u=((0|l)<0)<<31>>31))|(0|n)==(0|u)&c>>>0<l>>>0?(i[(n=o)>>2]=l,i[n+4>>2]=u,n=u):l=c,N=0|De(0|l,0|n,12,0),B=0|E(),i[(n=o)>>2]=N,i[n+4>>2]=B,n=0}if(0|n)return Pe(F),D=A,0|(F=n);if(!(l=0|Le(N,8)))return Pe(F),D=A,0|(F=13);if(!(h=0|Le(N,8)))return Pe(F),Pe(l),D=A,0|(F=13);i[(O=a)>>2]=0,i[O+4>>2]=0,I=0|i[(O=t)+4>>2],i[(n=d)>>2]=i[O>>2],i[n+4>>2]=I,n=0|k(d,N,B,e,a,l,h);t:do{if(n)Pe(l),Pe(h),Pe(F);else{e:do{if((0|i[f>>2])>0){for(u=t+12|0,c=0;n=0|k((0|i[u>>2])+(c<<3)|0,N,B,e,a,l,h),c=c+1|0,!(0|n);)if((0|c)>=(0|i[f>>2]))break e;Pe(l),Pe(h),Pe(F);break t}}while(0);(0|B)>0|0==(0|B)&N>>>0>0&&Xe(0|h,0,N<<3|0),O=0|i[(I=a)+4>>2];e:do{if((0|O)>0|0==(0|O)&(0|i[I>>2])>>>0>0){R=l,P=h,L=l,O=h,I=l,n=l,S=l,T=h,C=h,l=h;n:for(;;){for(x=0,b=0,M=0,w=0,c=0,u=0;;){d=(h=o)+56|0;do{i[h>>2]=0,h=h+4|0}while((0|h)<(0|d));if(0|q(f=0|i[(e=R+(x<<3)|0)>>2],e=0|i[e+4>>2],1,o,0)){d=(h=o)+56|0;do{i[h>>2]=0,h=h+4|0}while((0|h)<(0|d));0|(h=0|Le(7,4))&&(U(f,e,1,o,h,7,0,0),Pe(h))}for(y=0;;){v=0|i[(_=o+(y<<3)|0)>>2],_=0|i[_+4>>2];r:do{if(0==(0|v)&0==(0|_))h=c,d=u;else{if(p=0|ke(0|v,0|_,0|N,0|B),f=0|E(),!(0==(0|(d=0|i[(e=h=r+(p<<3)|0)>>2]))&0==(0|(e=0|i[e+4>>2])))){m=0,g=0;do{if((0|m)>(0|B)|(0|m)==(0|B)&g>>>0>N>>>0)break n;if((0|d)==(0|v)&(0|e)==(0|_)){h=c,d=u;break r}p=0|Be(0|(h=0|De(0|p,0|f,1,0)),0|E(),0|N,0|B),f=0|E(),g=0|De(0|g,0|m,1,0),m=0|E(),d=0|i[(e=h=r+(p<<3)|0)>>2],e=0|i[e+4>>2]}while(!(0==(0|d)&0==(0|e)))}0==(0|v)&0==(0|_)?(h=c,d=u):(Xt(v,_,s),0|pe(t,F,s)&&(g=0|De(0|c,0|u,1,0),u=0|E(),i[(m=h)>>2]=v,i[m+4>>2]=_,i[(c=P+(c<<3)|0)>>2]=v,i[c+4>>2]=_,c=g),h=c,d=u)}}while(0);if((y=y+1|0)>>>0>=7)break;c=h,u=d}if(x=0|De(0|x,0|b,1,0),b=0|E(),M=0|De(0|M,0|w,1,0),w=0|E(),c=0|i[(u=a)>>2],!((0|w)<(0|(u=0|i[u+4>>2]))|(0|w)==(0|u)&M>>>0<c>>>0))break;c=h,u=d}if((0|u)>0|0==(0|u)&c>>>0>0){c=0,u=0;do{i[(w=R+(c<<3)|0)>>2]=0,i[w+4>>2]=0,c=0|De(0|c,0|u,1,0),u=0|E(),M=0|i[(w=a)+4>>2]}while((0|u)<(0|M)|((0|u)==(0|M)?c>>>0<(0|i[w>>2])>>>0:0))}if(i[(w=a)>>2]=h,i[w+4>>2]=d,!((0|d)>0|0==(0|d)&h>>>0>0))break e;y=l,x=C,b=I,M=T,w=P,l=S,C=n,T=L,S=y,n=x,I=O,O=b,L=M,P=R,R=w}Pe(L),Pe(O),Pe(F),n=1;break t}n=h}while(0);Pe(F),Pe(l),Pe(n),n=0}}while(0);return D=A,0|(F=n)},_readInt64AsDoubleFromPointer:function(t){return+(+((0|i[(t|=0)>>2])>>>0)+4294967296*+(0|i[t+4>>2]))},_res0CellCount:function(){return 122},_round:Qe,_sbrk:Ye,_sizeOfCellBoundary:function(){return 168},_sizeOfCoordIJ:function(){return 8},_sizeOfGeoLoop:function(){return 8},_sizeOfGeoPolygon:function(){return 16},_sizeOfH3Index:function(){return 8},_sizeOfLatLng:function(){return 16},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompactCells:function(t,e,n,r,a,o,s){t|=0,r|=0,a|=0,o|=0;var A,l=0,c=0,u=0,h=0,d=0,f=0,p=0,m=0;if(A=D,D=D+16|0,m=A,!((0|(n|=0))>0|0==(0|n)&(e|=0)>>>0>0))return D=A,0|(m=0);if((0|(s|=0))>=16)return D=A,0|(m=12);f=0,p=0,d=0,l=0;t:for(;;){if(h=0|ze(0|(c=0|i[(u=t+(f<<3)|0)>>2]),0|(u=0|i[u+4>>2]),52),E(),(15&h|0)>(0|s)){l=12,c=11;break}if(Zt(m,c,u,s),0==(0|(u=0|i[(h=m)>>2]))&0==(0|(h=0|i[h+4>>2])))c=d;else{c=d;do{if(!((0|l)<(0|o)|(0|l)==(0|o)&c>>>0<a>>>0)){c=10;break t}i[(d=r+(c<<3)|0)>>2]=u,i[d+4>>2]=h,c=0|De(0|c,0|l,1,0),l=0|E(),Kt(m),u=0|i[(d=m)>>2],h=0|i[d+4>>2]}while(!(0==(0|u)&0==(0|h)))}if(f=0|De(0|f,0|p,1,0),!((0|(p=0|E()))<(0|n)|(0|p)==(0|n)&f>>>0<e>>>0)){l=0,c=11;break}d=c}return 10==(0|c)?(D=A,0|(m=14)):11==(0|c)?(D=A,0|l):0},_uncompactCellsSize:function(t,e,n,r,a){t|=0,e|=0,n|=0,r|=0,a|=0;var o,s,A=0,l=0,c=0,u=0,h=0,d=0;s=D,D=D+16|0,o=s;t:do{if((0|n)>0|0==(0|n)&e>>>0>0){for(h=0,l=0,A=0,d=0;;){if(!(0==(0|(c=0|i[(u=t+(h<<3)|0)>>2]))&0==(0|(u=0|i[u+4>>2]))||(u=0==(0|Ut(c,u,r,o)),l=0|De(0|i[(c=o)>>2],0|i[c+4>>2],0|l,0|A),A=0|E(),u))){A=12;break}if(h=0|De(0|h,0|d,1,0),!((0|(d=0|E()))<(0|n)|(0|d)==(0|n)&h>>>0<e>>>0))break t}return D=s,0|A}l=0,A=0}while(0);return i[a>>2]=l,i[a+4>>2]=A,D=s,0|(a=0)},_vertexToLatLng:function(t,e,n){n|=0;var r,a,o,s,A=0,l=0;return s=D,D=D+192|0,a=s,o=s+168|0,A=0|ze(0|(t|=0),0|(e|=0),56),E(),A&=7,0|(r=0|Wt(t,l=-2130706433&e|134217728,o))?(D=s,0|(l=r)):(e=0|ze(0|t,0|e,52),E(),e&=15,0|Nt(t,l)?Tt(o,e,A,1,a):Lt(o,e,A,1,a),l=a+8|0,i[n>>2]=i[l>>2],i[n+4>>2]=i[l+4>>2],i[n+8>>2]=i[l+8>>2],i[n+12>>2]=i[l+12>>2],D=s,0|(l=0))},establishStackSpace:function(t,e){D=t|=0},stackAlloc:function(t){var e;return e=D,D=(D=D+(t|=0)|0)+15&-16,0|e},stackRestore:function(t){D=t|=0},stackSave:function(){return 0|D}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{a:gt,b:function(t){g=t},c:function(){return g},d:function(t,e,n,r){gt("Assertion failed: "+P(t)+", at: "+[e?P(e):"unknown filename",n,r?P(r):"unknown function"])},e:function(t){return n.___errno_location&&(S[n.___errno_location()>>2]=t),t},f:$,g:function(t,e,n){w.set(w.subarray(e,e+n),t)},h:function(t){var e=$(),n=16777216,r=2130706432;if(t>r)return!1;for(var i=Math.max(e,16777216);i<t;)i=i<=536870912?L(2*i,n):Math.min(L((3*i+2147483648)/4,n),r);return!!tt(i)},i:function(t){gt("OOM")},j:Z,k:K,l:tt,m:J,n:function(){var t=J();return n.extraStackTrace&&(t+="\n"+n.extraStackTrace()),K(t)},o:24144,p:24128},b);n.___divdi3=it.___divdi3,n.___muldi3=it.___muldi3,n.___remdi3=it.___remdi3,n.___uremdi3=it.___uremdi3,n._areNeighborCells=it._areNeighborCells,n._bitshift64Ashr=it._bitshift64Ashr,n._bitshift64Lshr=it._bitshift64Lshr,n._bitshift64Shl=it._bitshift64Shl,n._calloc=it._calloc,n._cellAreaKm2=it._cellAreaKm2,n._cellAreaM2=it._cellAreaM2,n._cellAreaRads2=it._cellAreaRads2,n._cellToBoundary=it._cellToBoundary,n._cellToCenterChild=it._cellToCenterChild,n._cellToChildPos=it._cellToChildPos,n._cellToChildren=it._cellToChildren,n._cellToChildrenSize=it._cellToChildrenSize,n._cellToLatLng=it._cellToLatLng,n._cellToLocalIj=it._cellToLocalIj,n._cellToParent=it._cellToParent,n._cellToVertex=it._cellToVertex,n._cellToVertexes=it._cellToVertexes,n._cellsToDirectedEdge=it._cellsToDirectedEdge,n._cellsToLinkedMultiPolygon=it._cellsToLinkedMultiPolygon,n._childPosToCell=it._childPosToCell,n._compactCells=it._compactCells,n._destroyLinkedMultiPolygon=it._destroyLinkedMultiPolygon,n._directedEdgeToBoundary=it._directedEdgeToBoundary,n._directedEdgeToCells=it._directedEdgeToCells,n._edgeLengthKm=it._edgeLengthKm,n._edgeLengthM=it._edgeLengthM,n._edgeLengthRads=it._edgeLengthRads;var at=n._emscripten_replace_memory=it._emscripten_replace_memory;n._free=it._free,n._getBaseCellNumber=it._getBaseCellNumber,n._getDirectedEdgeDestination=it._getDirectedEdgeDestination,n._getDirectedEdgeOrigin=it._getDirectedEdgeOrigin,n._getHexagonAreaAvgKm2=it._getHexagonAreaAvgKm2,n._getHexagonAreaAvgM2=it._getHexagonAreaAvgM2,n._getHexagonEdgeLengthAvgKm=it._getHexagonEdgeLengthAvgKm,n._getHexagonEdgeLengthAvgM=it._getHexagonEdgeLengthAvgM,n._getIcosahedronFaces=it._getIcosahedronFaces,n._getNumCells=it._getNumCells,n._getPentagons=it._getPentagons,n._getRes0Cells=it._getRes0Cells,n._getResolution=it._getResolution,n._greatCircleDistanceKm=it._greatCircleDistanceKm,n._greatCircleDistanceM=it._greatCircleDistanceM,n._greatCircleDistanceRads=it._greatCircleDistanceRads,n._gridDisk=it._gridDisk,n._gridDiskDistances=it._gridDiskDistances,n._gridDistance=it._gridDistance,n._gridPathCells=it._gridPathCells,n._gridPathCellsSize=it._gridPathCellsSize,n._gridRingUnsafe=it._gridRingUnsafe,n._i64Add=it._i64Add,n._i64Subtract=it._i64Subtract,n._isPentagon=it._isPentagon,n._isResClassIII=it._isResClassIII,n._isValidCell=it._isValidCell,n._isValidDirectedEdge=it._isValidDirectedEdge,n._isValidVertex=it._isValidVertex,n._latLngToCell=it._latLngToCell,n._llvm_maxnum_f64=it._llvm_maxnum_f64,n._llvm_minnum_f64=it._llvm_minnum_f64,n._llvm_round_f64=it._llvm_round_f64,n._localIjToCell=it._localIjToCell,n._malloc=it._malloc,n._maxFaceCount=it._maxFaceCount,n._maxGridDiskSize=it._maxGridDiskSize,n._maxPolygonToCellsSize=it._maxPolygonToCellsSize,n._memcpy=it._memcpy,n._memset=it._memset,n._originToDirectedEdges=it._originToDirectedEdges,n._pentagonCount=it._pentagonCount,n._polygonToCells=it._polygonToCells,n._readInt64AsDoubleFromPointer=it._readInt64AsDoubleFromPointer,n._res0CellCount=it._res0CellCount,n._round=it._round,n._sbrk=it._sbrk,n._sizeOfCellBoundary=it._sizeOfCellBoundary,n._sizeOfCoordIJ=it._sizeOfCoordIJ,n._sizeOfGeoLoop=it._sizeOfGeoLoop,n._sizeOfGeoPolygon=it._sizeOfGeoPolygon,n._sizeOfH3Index=it._sizeOfH3Index,n._sizeOfLatLng=it._sizeOfLatLng,n._sizeOfLinkedGeoPolygon=it._sizeOfLinkedGeoPolygon,n._uncompactCells=it._uncompactCells,n._uncompactCellsSize=it._uncompactCellsSize,n._vertexToLatLng=it._vertexToLatLng,n.establishStackSpace=it.establishStackSpace;var ot,st,At=n.stackAlloc=it.stackAlloc,lt=n.stackRestore=it.stackRestore,ct=n.stackSave=it.stackSave;if(n.asm=it,n.cwrap=function(t,e,n,r){var i=(n=n||[]).every((function(t){return"number"===t}));return"string"!==e&&i&&!r?y(t):function(){return x(t,e,n,arguments)}},n.setValue=function(t,e,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":M[t>>0]=e;break;case"i16":E[t>>1]=e;break;case"i32":S[t>>2]=e;break;case"i64":W=[e>>>0,(V=e,+k(V)>=1?V>0?(0|G(+z(V/4294967296),4294967295))>>>0:~~+F((V-+(~~V>>>0))/4294967296)>>>0:0)],S[t>>2]=W[0],S[t+4>>2]=W[1];break;case"float":T[t>>2]=e;break;case"double":C[t>>3]=e;break;default:gt("invalid type for setValue: "+n)}},n.getValue=function(t,e,n){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return M[t>>0];case"i16":return E[t>>1];case"i32":case"i64":return S[t>>2];case"float":return T[t>>2];case"double":return C[t>>3];default:gt("invalid type for getValue: "+e)}return null},X)if(Y(X)||(ot=X,X=n.locateFile?n.locateFile(ot,f):f+ot),A||s){var ut=u(X);w.set(ut,8)}else{H++,n.monitorRunDependencies&&n.monitorRunDependencies(H);var ht=function(t){t.byteLength&&(t=new Uint8Array(t)),w.set(t,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(t){if(H--,n.monitorRunDependencies&&n.monitorRunDependencies(H),0==H&&j){var e=j;j=null,e()}}()},dt=function(){c(X,ht,(function(){throw"could not load memory initializer "+X}))},ft=rt(X);if(ft)ht(ft.buffer);else if(n.memoryInitializerRequest){var pt=function(){var t=n.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var r=rt(n.memoryInitializerRequestURL);if(!r)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+X),void dt();e=r.buffer}ht(e)};n.memoryInitializerRequest.response?setTimeout(pt,0):n.memoryInitializerRequest.addEventListener("load",pt)}else dt()}function mt(t){function e(){st||(st=!0,v||(I(U),I(N),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),B.unshift(t);var t;I(B)}()))}H>0||(!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),q.unshift(t);var t;I(q)}(),H>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e()))}function gt(t){throw n.onAbort&&n.onAbort(t),p(t+=""),m(t),v=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(j=function t(){st||mt(),st||(j=t)},n.run=mt,n.abort=gt,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return mt(),t}("object"==typeof Bm?Bm:{}),km="number",Fm=[["sizeOfH3Index",km],["sizeOfLatLng",km],["sizeOfCellBoundary",km],["sizeOfGeoLoop",km],["sizeOfGeoPolygon",km],["sizeOfLinkedGeoPolygon",km],["sizeOfCoordIJ",km],["readInt64AsDoubleFromPointer",km],["isValidCell",km,[km,km]],["latLngToCell",km,[km,km,km,km]],["cellToLatLng",km,[km,km,km]],["cellToBoundary",km,[km,km,km]],["maxGridDiskSize",km,[km,km]],["gridDisk",km,[km,km,km,km]],["gridDiskDistances",km,[km,km,km,km,km]],["gridRingUnsafe",km,[km,km,km,km]],["maxPolygonToCellsSize",km,[km,km,km,km]],["polygonToCells",km,[km,km,km,km]],["cellsToLinkedMultiPolygon",km,[km,km,km]],["destroyLinkedMultiPolygon",null,[km]],["compactCells",km,[km,km,km,km]],["uncompactCells",km,[km,km,km,km,km,km]],["uncompactCellsSize",km,[km,km,km,km,km]],["isPentagon",km,[km,km]],["isResClassIII",km,[km,km]],["getBaseCellNumber",km,[km,km]],["getResolution",km,[km,km]],["maxFaceCount",km,[km,km,km]],["getIcosahedronFaces",km,[km,km,km]],["cellToParent",km,[km,km,km,km]],["cellToChildren",km,[km,km,km,km]],["cellToCenterChild",km,[km,km,km,km]],["cellToChildrenSize",km,[km,km,km,km]],["cellToChildPos",km,[km,km,km,km]],["childPosToCell",km,[km,km,km,km,km,km]],["areNeighborCells",km,[km,km,km,km,km]],["cellsToDirectedEdge",km,[km,km,km,km,km]],["getDirectedEdgeOrigin",km,[km,km,km]],["getDirectedEdgeDestination",km,[km,km,km]],["isValidDirectedEdge",km,[km,km]],["directedEdgeToCells",km,[km,km,km]],["originToDirectedEdges",km,[km,km,km]],["directedEdgeToBoundary",km,[km,km,km]],["gridDistance",km,[km,km,km,km,km]],["gridPathCells",km,[km,km,km,km,km]],["gridPathCellsSize",km,[km,km,km,km,km]],["cellToLocalIj",km,[km,km,km,km,km,km]],["localIjToCell",km,[km,km,km,km,km]],["getHexagonAreaAvgM2",km,[km,km]],["getHexagonAreaAvgKm2",km,[km,km]],["getHexagonEdgeLengthAvgM",km,[km,km]],["getHexagonEdgeLengthAvgKm",km,[km,km]],["greatCircleDistanceM",km,[km,km]],["greatCircleDistanceKm",km,[km,km]],["greatCircleDistanceRads",km,[km,km]],["cellAreaM2",km,[km,km,km]],["cellAreaKm2",km,[km,km,km]],["cellAreaRads2",km,[km,km,km]],["edgeLengthM",km,[km,km,km]],["edgeLengthKm",km,[km,km,km]],["edgeLengthRads",km,[km,km,km]],["getNumCells",km,[km,km]],["getRes0Cells",km,[km]],["res0CellCount",km],["getPentagons",km,[km,km]],["pentagonCount",km],["cellToVertex",km,[km,km,km,km]],["cellToVertexes",km,[km,km,km]],["vertexToLatLng",km,[km,km,km]],["isValidVertex",km,[km,km]]],zm=4,Gm={0:"Success",1:"The operation failed but a more specific error is not available",2:"Argument was outside of acceptable range",3:"Latitude or longitude arguments were outside of acceptable range"};
/*
* Copyright 2018-2019, 2022 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.
*/Gm[zm]="Resolution argument was outside of acceptable range",Gm[5]="Cell argument was not valid",Gm[6]="Directed edge argument was not valid",Gm[7]="Undirected edge argument was not valid",Gm[8]="Vertex argument was not valid",Gm[9]="Pentagon distortion was encountered",Gm[10]="Duplicate input",Gm[11]="Cell arguments were not neighbors",Gm[12]="Cell arguments had incompatible resolutions",Gm[13]="Memory allocation failed",Gm[14]="Bounds of provided memory were insufficient",Gm[15]="Mode or flags argument was not valid";var Hm=1001,jm=1002,Vm={1e3:"Unknown unit"};Vm[Hm]="Array length out of bounds",Vm[jm]="Got unexpected null value for H3 index";var Wm="Unknown error";function Xm(t,e,n){var r=n&&"value"in n,i=new Error((t[e]||Wm)+" (code: "+e+(r?", value: "+n.value:"")+")");return i.code=e,i}function Qm(t,e){return Xm(Gm,t,2===arguments.length?{value:e}:{})}function Ym(t,e){return Xm(Vm,t,2===arguments.length?{value:e}:{})}function Zm(t){if(0!==t)throw Qm(t)}
/*
* Copyright 2018-2019, 2022 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.
*/var Km={};Fm.forEach((function(t){Km[t[0]]=Bm.cwrap.apply(Bm,t)}));var Jm=16,$m=4,tg=8,eg=Km.sizeOfH3Index(),ng=Km.sizeOfLatLng(),rg=Km.sizeOfCellBoundary(),ig=Km.sizeOfGeoPolygon(),ag=Km.sizeOfGeoLoop();Km.sizeOfLinkedGeoPolygon(),Km.sizeOfCoordIJ();var og=Math.pow(2,32)-1;var sg=/[^0-9a-fA-F]/;function Ag(t){if(Array.isArray(t)&&2===t.length&&Number.isInteger(t[0])&&Number.isInteger(t[1]))return t;if("string"!=typeof t||sg.test(t))return[0,0];var e=parseInt(t.substring(0,t.length-8),Jm);return[parseInt(t.substring(t.length-8),Jm),e]}function lg(t){if(t>=0)return t.toString(Jm);var e=cg(8,(t&=2147483647).toString(Jm));return e=(parseInt(e[0],Jm)+8).toString(Jm)+e.substring(1)}function cg(t,e){for(var n=t-e.length,r="",i=0;i<n;i++)r+="0";return r+=e}function ug(t,e,n){for(var r=t.length,i=Bm._calloc(r,ng),a=n?1:0,o=n?0:1,s=0;s<2*r;s+=2)Bm.HEAPF64.set([t[s/2][a],t[s/2][o]].map(yg),i/tg+s);return Bm.HEAPU32.set([r,i],e/$m),e}function hg(t,e){void 0===e&&(e=0);var n=Bm.getValue(t+eg*e,"i32"),r=Bm.getValue(t+eg*e+$m,"i32");return r?function(t,e){return lg(e)+cg(8,lg(t))}(n,r):null}function dg(t){return 180*Bm.getValue(t,"double")/Math.PI}function fg(t){return[dg(t),dg(t+tg)]}function pg(t){return[dg(t+tg),dg(t)]}function mg(t,e,n){var r=Bm._malloc(ng);Bm.HEAPF64.set([t,e].map(yg),r/tg);var i=Bm._malloc(eg);try{return Zm(Km.latLngToCell(r,n,i)),function(t){if(!t)throw Ym(jm);return t}(hg(i))}finally{Bm._free(i),Bm._free(r)}}function gg(t){var e=Bm._malloc(ng),n=Ag(t),r=n[0],i=n[1];try{return Zm(Km.cellToLatLng(r,i,e)),fg(e)}finally{Bm._free(e)}}function vg(t,e){var n=Bm._malloc(rg),r=Ag(t),i=r[0],a=r[1];try{return Zm(Km.cellToBoundary(i,a,n)),function(t,e,n){for(var r=Bm.getValue(t,"i32"),i=t+tg,a=[],o=e?pg:fg,s=0;s<2*r;s+=2)a.push(o(i+tg*s));return n&&a.push(a[0]),a}(n,e,e)}finally{Bm._free(n)}}function _g(t,e,n){if(function(t){if("number"!=typeof t||t<0||t>15||Math.floor(t)!==t)throw Qm(zm,t)}(e),n=Boolean(n),0===t.length||0===t[0].length)return[];var r,i=function(t,e){var n,r=t.length-1,i=Bm._calloc(ig),a=0+ag,o=a+$m;if(ug(t[0],i+0,e),r>0){n=Bm._calloc(r,ag);for(var s=0;s<r;s++)ug(t[s+1],n+ag*s,e)}return Bm.setValue(i+a,r,"i32"),Bm.setValue(i+o,n,"i32"),i}("number"==typeof t[0][0]?[t]:t,n),a=Bm._malloc(8);try{Zm(Km.maxPolygonToCellsSize(i,e,0,a));var o=function(t){if(t>og)throw Ym(Hm,t);return t}((r=a,Km.readInt64AsDoubleFromPointer(r))),s=Bm._calloc(o,eg);try{return Zm(Km.polygonToCells(i,e,0,s)),function(t,e){for(var n=[],r=0;r<e;r++){var i=hg(t,r);null!==i&&n.push(i)}return n}(s,o)}finally{Bm._free(s)}}finally{Bm._free(a),function(t){var e=0+ag,n=e+$m,r=$m;Bm._free(Bm.getValue(t+0+r,"i8*"));var i=Bm.getValue(t+e,"i32");if(i>0){for(var a=Bm.getValue(t+n,"i32"),o=0;o<i;o++)Bm._free(Bm.getValue(a+ag*o+r,"i8*"));Bm._free(a)}Bm._free(t)}(i)}}function yg(t){return t*Math.PI/180}var xg=bg;function bg(t,e,n,r){this.x="number"==typeof t?t:0,this.y="number"==typeof e?e:0,this.z="number"==typeof n?n:0,this.half="number"==typeof r?r:0}bg.prototype.contains=function(t,e,n){var r=this.half;return this.x-r<=t&&t<this.x+r&&this.y-r<=e&&e<this.y+r&&this.z-r<=n&&n<this.z+r};var Mg=xg,wg=Eg;function Eg(t){this.bounds=t,this.q0=null,this.q1=null,this.q2=null,this.q3=null,this.q4=null,this.q5=null,this.q6=null,this.q7=null,this.items=null}Eg.prototype.subdivide=function(){var t=this.bounds,e=t.half/2;this.q0=new Eg(new Mg(t.x-e,t.y-e,t.z-e,e)),this.q1=new Eg(new Mg(t.x+e,t.y-e,t.z-e,e)),this.q2=new Eg(new Mg(t.x-e,t.y+e,t.z-e,e)),this.q3=new Eg(new Mg(t.x+e,t.y+e,t.z-e,e)),this.q4=new Eg(new Mg(t.x-e,t.y-e,t.z+e,e)),this.q5=new Eg(new Mg(t.x+e,t.y-e,t.z+e,e)),this.q6=new Eg(new Mg(t.x-e,t.y+e,t.z+e,e)),this.q7=new Eg(new Mg(t.x+e,t.y+e,t.z+e,e))},Eg.prototype.insert=function(t,e,n){if(null===this.q0){if(null===this.items?this.items=[t]:this.items.push(t),this.items.length>=4&&n<16){this.subdivide();for(var r=0;r<this.items.length;++r)this.insert(this.items[r],e,n+1);this.items=null}}else{var i=e[t],a=e[t+1],o=e[t+2],s=this.bounds,A=0;i>s.x&&(A+=1),a>s.y&&(A+=2),o>s.z&&(A+=4);var l=function(t,e){if(0===e)return t.q0;if(1===e)return t.q1;if(2===e)return t.q2;if(3===e)return t.q3;if(4===e)return t.q4;if(5===e)return t.q5;if(6===e)return t.q6;if(7===e)return t.q7}(this,A);l.insert(t,e,n+1)}},Eg.prototype.query=function(t,e,n,r){if(n(this.bounds)){var i=this.items,a="function"==typeof r;if(i)for(var o=0;o<i.length;++o){var s=i[o];a?r(e[s],e[s+1],e[s+2])&&t.push(s):t.push(s)}this.q0&&(this.q0.query(t,e,n,r),this.q1.query(t,e,n,r),this.q2.query(t,e,n,r),this.q3.query(t,e,n,r),this.q4.query(t,e,n,r),this.q5.query(t,e,n,r),this.q6.query(t,e,n,r),this.q7.query(t,e,n,r))}};var Sg=function(t,e,n,r){var i=0,a=0,o=(r=r||{}).step||1,s=r.maxTimeMS||8,A=r.probeElements||5e3;setTimeout((function r(){var l=Math.min(t.length,i+A),c=i,u=new Date;for(c=i;c<l;c+=o)e(t[c],c,t);c<t.length?(a+=new Date-u,i=c,A=Math.round(i*s/a),setTimeout(r,0)):n(t)}),0)};var Tg=xg,Cg=wg,Rg=new Tg,Pg=Sg,Lg=function(t){var e,n,r=[],i={initAsync:function(t,r){o(t);var a=s(t);function A(e,n){a.insert(n,t,0)}function l(){n=t,e=a,"function"==typeof r&&r(i)}Pg(t,A,l,{step:3})},init:function(t){o(t),n=t,e=s(t);for(var r=0;r<t.length;r+=3)e.insert(r,n,0)},bounds:function(){return e?e.bounds:Rg},intersectRay:function(t,i,a,o){if(!e)return r;void 0===a&&(a=0);void 0===o&&(o=Number.POSITIVE_INFINITY);a*=a,o*=o;var s=[];return e.query(s,n,A,l),s.sort(c);function A(e){var n,r=e.half,a=(e.x-r-t.x)/i.x,s=(e.x+r-t.x)/i.x,A=(e.y+r-t.y)/i.y,l=(e.y-r-t.y)/i.y,c=(e.z-r-t.z)/i.z,u=(e.z+r-t.z)/i.z,h=Math.min(Math.min(Math.max(a,s),Math.max(A,l)),Math.max(c,u));return!(h<0)&&((n=Math.max(Math.max(Math.min(a,s),Math.min(A,l)),Math.min(c,u)))<=h&&n<=o)}function l(e,n,r){var i=(e-t.x)*(e-t.x)+(n-t.y)*(n-t.y)+(r-t.z)*(r-t.z);return a<=i&&i<=o}function c(e,n){var r=t[e],i=t[e+1],a=t[e+2],o=(r-t.x)*(r-t.x)+(i-t.y)*(i-t.y)+(a-t.z)*(a-t.z),s=t[n],A=t[n+1],l=t[n+2];return o-((s-t.x)*(s-t.x)+(A-t.y)*(A-t.y)+(l-t.z)*(l-t.z))}},intersectSphere:function(t,i,o,s){if(!e)return r;var A=[],l=s*s;return e.query(A,n,c,u),A;function c(e){var n=l,r=e.half;return t<e.x-r?n-=a(t-(e.x-r)):t>e.x+r&&(n-=a(t-(e.x+r))),i<e.y-r?n-=a(i-(e.y-r)):i>e.y+r&&(n-=a(i-(e.y+r))),o<e.z-r?n-=a(o-(e.z-r)):o>e.z+r&&(n-=a(o-(e.z+r))),n>0}function u(e,n,r){return a(e-t)+a(n-i)+a(r-o)<l}},getRoot:function(){return e}};return i;function a(t){return t*t}function o(t){if(!t)throw new Error("Points array is required for quadtree to work");if("number"!=typeof t.length)throw new Error("Points should be array-like object");if(t.length%3!=0)throw new Error("Points array should consist of series of x,y,z coordinates and be multiple of 3")}function s(t){if(0===t.length){var e=new Tg;return new Cg(e)}for(var n=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY,A=0;A<t.length;A+=3){var l=t[A],c=t[A+1],u=t[A+2];l<n&&(n=l),l>a&&(a=l),c<r&&(r=c),c>o&&(o=c),u<i&&(i=u),u>s&&(s=u)}var h=Math.max(Math.max(a-n,o-r),s-i),d=(h+=2)/2,f=new Tg((n-=1)+d,(r-=1)+d,(i-=1)+d,d);return new Cg(f)}};var Dg=QA(Lg);const Og=window.THREE?window.THREE:{Box3:Ae,BufferGeometry:zn,Float32BufferAttribute:On,InstancedBufferGeometry:class extends zn{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){const t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}},InstancedInterleavedBuffer:Vs,InterleavedBufferAttribute:go,Sphere:Se,Vector3:ae,WireframeGeometry:class extends zn{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},null!==t){const e=[],n=new Set,r=new ae,i=new ae;if(null!==t.index){const a=t.attributes.position,o=t.index;let s=t.groups;0===s.length&&(s=[{start:0,count:o.count,materialIndex:0}]);for(let t=0,A=s.length;t<A;++t){const A=s[t],l=A.start;for(let t=l,s=l+A.count;t<s;t+=3)for(let s=0;s<3;s++){const A=o.getX(t+s),l=o.getX(t+(s+1)%3);r.fromBufferAttribute(a,A),i.fromBufferAttribute(a,l),!0===Rs(r,i,n)&&(e.push(r.x,r.y,r.z),e.push(i.x,i.y,i.z))}}}else{const a=t.attributes.position;for(let t=0,o=a.count/3;t<o;t++)for(let o=0;o<3;o++){const s=3*t+o,A=3*t+(o+1)%3;r.fromBufferAttribute(a,s),i.fromBufferAttribute(a,A),!0===Rs(r,i,n)&&(e.push(r.x,r.y,r.z),e.push(i.x,i.y,i.z))}}this.setAttribute("position",new On(e,3))}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}}};var Ig=(new Og.BufferGeometry).setAttribute?"setAttribute":"addAttribute";const qg=new Og.Box3,Ug=new Og.Vector3;class Ng extends Og.InstancedBufferGeometry{constructor(){super(),this.type="LineSegmentsGeometry";this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this[Ig]("position",new Og.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this[Ig]("uv",new Og.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(t){const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),n.applyMatrix4(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new Og.InstancedInterleavedBuffer(e,6,1);return this[Ig]("instanceStart",new Og.InterleavedBufferAttribute(n,3,0)),this[Ig]("instanceEnd",new Og.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));const n=new Og.InstancedInterleavedBuffer(e,6,1);return this[Ig]("instanceColorStart",new Og.InterleavedBufferAttribute(n,3,0)),this[Ig]("instanceColorEnd",new Og.InterleavedBufferAttribute(n,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new Og.WireframeGeometry(t.geometry)),this}fromLineSegments(t){const e=t.geometry;if(!e.isGeometry)return e.isBufferGeometry&&this.setPositions(e.attributes.position.array),this;console.error("LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.")}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new Og.Box3);const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;void 0!==t&&void 0!==e&&(this.boundingBox.setFromBufferAttribute(t),qg.setFromBufferAttribute(e),this.boundingBox.union(qg))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Og.Sphere),null===this.boundingBox&&this.computeBoundingBox();const t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let r=0;for(let i=0,a=t.count;i<a;i++)Ug.fromBufferAttribute(t,i),r=Math.max(r,n.distanceToSquared(Ug)),Ug.fromBufferAttribute(e,i),r=Math.max(r,n.distanceToSquared(Ug));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}}Ng.prototype.isLineSegmentsGeometry=!0;const Bg=window.THREE?window.THREE:{ShaderLib:Ir,ShaderMaterial:hr,UniformsLib:Or,UniformsUtils:ur,Vector2:Lt};Bg.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Bg.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},dashOffset:{value:0},gapSize:{value:1}},Bg.ShaderLib.line={uniforms:Bg.UniformsUtils.merge([Bg.UniformsLib.common,Bg.UniformsLib.fog,Bg.UniformsLib.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\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 <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\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 <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\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 <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"};class kg extends Bg.ShaderMaterial{constructor(t){super({type:"LineMaterial",uniforms:Bg.UniformsUtils.clone(Bg.ShaderLib.line.uniforms),vertexShader:Bg.ShaderLib.line.vertexShader,fragmentShader:Bg.ShaderLib.line.fragmentShader,clipping:!0}),Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(t){!0===t?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashed:{enumerable:!0,get:function(){return Boolean("USE_DASH"in this.defines)},set(t){Boolean(t)!==Boolean("USE_DASH"in this.defines)&&(this.needsUpdate=!0),!0===t?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},alphaToCoverage:{enumerable:!0,get:function(){return Boolean("ALPHA_TO_COVERAGE"in this.defines)},set:function(t){Boolean(t)!==Boolean("ALPHA_TO_COVERAGE"in this.defines)&&(this.needsUpdate=!0),!0===t?(this.defines.ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(t)}}kg.prototype.isLineMaterial=!0;const Fg=window.THREE?window.THREE:{Box3:Ae,BufferGeometry:zn,InstancedInterleavedBuffer:Vs,InterleavedBufferAttribute:go,Line3:class{constructor(t=new ae,e=new ae){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){Ys.subVectors(t,this.start),Zs.subVectors(this.end,this.start);const n=Zs.dot(Zs);let r=Zs.dot(Ys)/n;return e&&(r=Mt(r,0,1)),r}closestPointToPoint(t,e,n){const r=this.closestPointToPointParameter(t,e);return this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}},MathUtils:Pt,Matrix4:qe,Mesh:ar,Sphere:Se,Vector3:ae,Vector4:$t};var zg=(new Fg.BufferGeometry).setAttribute?"setAttribute":"addAttribute";const Gg=new Fg.Vector3,Hg=new Fg.Vector3,jg=new Fg.Vector4,Vg=new Fg.Vector4,Wg=new Fg.Vector4,Xg=new Fg.Vector3,Qg=new Fg.Matrix4,Yg=new Fg.Line3,Zg=new Fg.Vector3,Kg=new Fg.Box3,Jg=new Fg.Sphere,$g=new Fg.Vector4;class tv extends Fg.Mesh{constructor(t=new Ng,e=new kg({color:16777215*Math.random()})){super(t,e),this.type="LineSegments2"}computeLineDistances(){const t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,r=new Float32Array(2*e.count);for(let t=0,i=0,a=e.count;t<a;t++,i+=2)Gg.fromBufferAttribute(e,t),Hg.fromBufferAttribute(n,t),r[i]=0===i?0:r[i-1],r[i+1]=r[i]+Gg.distanceTo(Hg);const i=new Fg.InstancedInterleavedBuffer(r,2,1);return t[zg]("instanceDistanceStart",new Fg.InterleavedBufferAttribute(i,1,0)),t[zg]("instanceDistanceEnd",new Fg.InterleavedBufferAttribute(i,1,1)),this}raycast(t,e){null===t.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');const n=void 0!==t.params.Line2&&t.params.Line2.threshold||0,r=t.ray,i=t.camera,a=i.projectionMatrix,o=this.matrixWorld,s=this.geometry,A=this.material,l=A.resolution,c=A.linewidth+n,u=s.attributes.instanceStart,h=s.attributes.instanceEnd,d=-i.near,f=2*Math.max(c/l.width,c/l.height);null===s.boundingSphere&&s.computeBoundingSphere(),Jg.copy(s.boundingSphere).applyMatrix4(o);const p=Math.max(i.near,Jg.distanceToPoint(r.origin));$g.set(0,0,-p,1).applyMatrix4(i.projectionMatrix),$g.multiplyScalar(1/$g.w),$g.applyMatrix4(i.projectionMatrixInverse);const m=.5*Math.abs(f/$g.w);if(Jg.radius+=m,!1===t.ray.intersectsSphere(Jg))return;null===s.boundingBox&&s.computeBoundingBox(),Kg.copy(s.boundingBox).applyMatrix4(o);const g=Math.max(i.near,Kg.distanceToPoint(r.origin));$g.set(0,0,-g,1).applyMatrix4(i.projectionMatrix),$g.multiplyScalar(1/$g.w),$g.applyMatrix4(i.projectionMatrixInverse);const v=.5*Math.abs(f/$g.w);if(Kg.max.x+=v,Kg.max.y+=v,Kg.max.z+=v,Kg.min.x-=v,Kg.min.y-=v,Kg.min.z-=v,!1!==t.ray.intersectsBox(Kg)){r.at(1,Wg),Wg.w=1,Wg.applyMatrix4(i.matrixWorldInverse),Wg.applyMatrix4(a),Wg.multiplyScalar(1/Wg.w),Wg.x*=l.x/2,Wg.y*=l.y/2,Wg.z=0,Xg.copy(Wg),Qg.multiplyMatrices(i.matrixWorldInverse,o);for(let t=0,n=u.count;t<n;t++){if(jg.fromBufferAttribute(u,t),Vg.fromBufferAttribute(h,t),jg.w=1,Vg.w=1,jg.applyMatrix4(Qg),Vg.applyMatrix4(Qg),jg.z>d&&Vg.z>d)continue;if(jg.z>d){const t=jg.z-Vg.z,e=(jg.z-d)/t;jg.lerp(Vg,e)}else if(Vg.z>d){const t=Vg.z-jg.z,e=(Vg.z-d)/t;Vg.lerp(jg,e)}jg.applyMatrix4(a),Vg.applyMatrix4(a),jg.multiplyScalar(1/jg.w),Vg.multiplyScalar(1/Vg.w),jg.x*=l.x/2,jg.y*=l.y/2,Vg.x*=l.x/2,Vg.y*=l.y/2,Yg.start.copy(jg),Yg.start.z=0,Yg.end.copy(Vg),Yg.end.z=0;const n=Yg.closestPointToPointParameter(Xg,!0);Yg.at(n,Zg);const i=Fg.MathUtils.lerp(jg.z,Vg.z,n),s=i>=-1&&i<=1,A=Xg.distanceTo(Zg)<.5*c;if(s&&A){Yg.start.fromBufferAttribute(u,t),Yg.end.fromBufferAttribute(h,t),Yg.start.applyMatrix4(o),Yg.end.applyMatrix4(o);const n=new Fg.Vector3,i=new Fg.Vector3;r.distanceSqToSegment(Yg.start,Yg.end,i,n),e.push({point:i,pointOnLine:n,distance:r.origin.distanceTo(i),object:this,face:null,faceIndex:t,uv:null,uv2:null})}}}}}tv.prototype.LineSegments2=!0;class ev extends Ng{constructor(){super(),this.type="LineGeometry"}setPositions(t){for(var e=t.length-3,n=new Float32Array(2*e),r=0;r<e;r+=3)n[2*r]=t[r],n[2*r+1]=t[r+1],n[2*r+2]=t[r+2],n[2*r+3]=t[r+3],n[2*r+4]=t[r+4],n[2*r+5]=t[r+5];return super.setPositions(n),this}setColors(t){for(var e=t.length-3,n=new Float32Array(2*e),r=0;r<e;r+=3)n[2*r]=t[r],n[2*r+1]=t[r+1],n[2*r+2]=t[r+2],n[2*r+3]=t[r+3],n[2*r+4]=t[r+4],n[2*r+5]=t[r+5];return super.setColors(n),this}fromLine(t){var e=t.geometry;if(!e.isGeometry)return e.isBufferGeometry&&this.setPositions(e.attributes.position.array),this;console.error("THREE.LineGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.")}}ev.prototype.isLineGeometry=!0;class nv extends tv{constructor(t=new ev,e=new kg({color:16777215*Math.random()})){super(t,e),this.type="Line2"}}nv.prototype.isLine2=!0;class rv extends Es{constructor(t,e={}){const n=e.font;if(void 0===n)super();else{const r=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),super(r,e)}this.type="TextGeometry"}}function iv(t,e,n,r,i){const a=i.glyphs[t]||i.glyphs["?"];if(!a)return void console.error('THREE.Font: character "'+t+'" does not exists in font family '+i.familyName+".");const o=new Ks;let s,A,l,c,u,h,d,f;if(a.o){const t=a._cachedOutline||(a._cachedOutline=a.o.split(" "));for(let i=0,a=t.length;i<a;){switch(t[i++]){case"m":s=t[i++]*e+n,A=t[i++]*e+r,o.moveTo(s,A);break;case"l":s=t[i++]*e+n,A=t[i++]*e+r,o.lineTo(s,A);break;case"q":l=t[i++]*e+n,c=t[i++]*e+r,u=t[i++]*e+n,h=t[i++]*e+r,o.quadraticCurveTo(u,h,l,c);break;case"b":l=t[i++]*e+n,c=t[i++]*e+r,u=t[i++]*e+n,h=t[i++]*e+r,d=t[i++]*e+n,f=t[i++]*e+r,o.bezierCurveTo(u,h,d,f,l,c)}}}return{offsetX:a.ha*e,path:o}}function av(t,e,n){return e=pv(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return vv(t)}(t,ov()?Reflect.construct(e,n||[],pv(t).constructor):e.apply(t,n))}function ov(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ov=function(){return!!t})()}function sv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Av(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?sv(Object(n),!0).forEach((function(e){dv(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sv(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function lv(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function cv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function uv(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,lv(r.key),r)}}function hv(t,e,n){return e&&uv(t.prototype,e),n&&uv(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function dv(t,e,n){return(e=lv(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fv(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mv(t,e)}function pv(t){return pv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pv(t)}function mv(t,e){return mv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mv(t,e)}function gv(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)n=a[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function vv(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||xv(t,e)||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 yv(t){return function(t){if(Array.isArray(t))return bv(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||xv(t)||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 xv(t,e){if(t){if("string"==typeof t)return bv(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bv(t,e):void 0}}function bv(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Mv(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Ev(t,e,"get"))}function wv(t,e,n){return function(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}(t,Ev(t,e,"set"),n),n}function Ev(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function Sv(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Tv(t,e,n){Sv(t,e),e.set(t,n)}var Cv=function t(e){e instanceof Array?e.forEach(t):(e.map&&e.map.dispose(),e.dispose())},Rv=function t(e){e.geometry&&e.geometry.dispose(),e.material&&Cv(e.material),e.texture&&e.texture.dispose(),e.children&&e.children.forEach(t)},Pv=function(t){if(t&&t.children)for(;t.children.length;){var e=t.children[0];t.remove(e),Rv(e)}};function Lv(t,e){var n=new e;return{linkProp:function(e){return{default:n[e](),onChange:function(n,r){r[t][e](n)},triggerUpdate:!1}},linkMethod:function(e){return function(n){for(var r=n[t],i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];var s=r[e].apply(r,a);return s===r?this:s}}}}var Dv=100;function Ov(){return Dv}function Iv(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-t)*Math.PI/180,i=(90-e)*Math.PI/180,a=Dv*(1+n);return{x:a*Math.sin(r)*Math.cos(i),y:a*Math.cos(r),z:a*Math.sin(r)*Math.sin(i)}}function qv(t){var e=t.x,n=t.y,r=t.z,i=Math.sqrt(e*e+n*n+r*r),a=Math.acos(n/i),o=Math.atan2(r,e);return{lat:90-180*a/Math.PI,lng:90-180*o/Math.PI-(o<-Math.PI/2?360:0),altitude:i/Dv-1}}function Uv(t){return t*Math.PI/180}var Nv=window.THREE?window.THREE:{BackSide:g,BufferAttribute:Pn,Color:Mn,Mesh:ar,ShaderMaterial:hr},Bv="\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}",kv="\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",Fv={backside:!0,coefficient:.5,color:"gold",size:2,power:1};function zv(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fv,n=e.backside,r=e.coefficient,i=e.color,a=e.size,o=e.power,s=function(t,e){for(var n=t.clone(),r=new Float32Array(3*t.attributes.position.count),i=0,a=r.length;i<a;i++){var o=t.attributes.normal.array[i],s=t.attributes.position.array[i];r[i]=s+o*e}return n.setAttribute("position",new Nv.BufferAttribute(r,3)),n}(t,a),A=function(t,e,n){return new Nv.ShaderMaterial({depthWrite:!1,fragmentShader:Bv,transparent:!0,uniforms:{coefficient:{value:t},color:{value:new Nv.Color(e)},power:{value:n}},vertexShader:kv})}(r,i,o);return n&&(A.side=Nv.BackSide),new Nv.Mesh(s,A)}var Gv=window.THREE?window.THREE:{Color:Mn,LineBasicMaterial:_o,LineSegments:Co,Mesh:ar,MeshPhongMaterial:class extends Sn{constructor(t){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Mn(16777215),this.specular=new Mn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Mn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Lt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=_,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}},SphereGeometry:Ts,SRGBColorSpace:rt,TextureLoader:Us},Hv=NA({props:{globeImageUrl:{},bumpImageUrl:{},showGlobe:{default:!0,onChange:function(t,e){e.globeObj.visible=!!t},triggerUpdate:!1},showGraticules:{default:!1,onChange:function(t,e){e.graticulesObj.visible=!!t},triggerUpdate:!1},showAtmosphere:{default:!0,onChange:function(t,e){e.atmosphereObj&&(e.atmosphereObj.visible=!!t)},triggerUpdate:!1},atmosphereColor:{default:"lightskyblue"},atmosphereAltitude:{default:.15},onReady:{default:function(){},triggerUpdate:!1}},methods:{globeMaterial:function(t,e){return void 0!==e?(t.globeObj.material=e||t.defaultGlobeMaterial,this):t.globeObj.material},_destructor:function(t){Pv(t.globeObj),Pv(t.graticulesObj)}},stateInit:function(){var t=new Gv.SphereGeometry(Dv,75,75),e=new Gv.MeshPhongMaterial({color:0}),n=new Gv.Mesh(t,e);return n.rotation.y=-Math.PI/2,n.__globeObjType="globe",{globeObj:n,graticulesObj:new Gv.LineSegments(new Wh(fh(),Dv,2),new Gv.LineBasicMaterial({color:"lightgrey",transparent:!0,opacity:.1})),defaultGlobeMaterial:e}},init:function(t,e){Pv(t),e.scene=t,e.scene.add(e.globeObj),e.scene.add(e.graticulesObj),e.ready=!1},update:function(t,e){var n=t.globeObj.material;if(e.hasOwnProperty("globeImageUrl")&&(t.globeImageUrl?(new Gv.TextureLoader).load(t.globeImageUrl,(function(e){e.colorSpace=Gv.SRGBColorSpace,n.map=e,n.color=null,n.needsUpdate=!0,!t.ready&&(t.ready=!0)&&setTimeout(t.onReady)})):!n.color&&(n.color=new Gv.Color(0))),e.hasOwnProperty("bumpImageUrl")&&(t.bumpImageUrl?t.bumpImageUrl&&(new Gv.TextureLoader).load(t.bumpImageUrl,(function(t){n.bumpMap=t,n.needsUpdate=!0})):(n.bumpMap=null,n.needsUpdate=!0)),(e.hasOwnProperty("atmosphereColor")||e.hasOwnProperty("atmosphereAltitude"))&&(t.atmosphereObj&&(t.scene.remove(t.atmosphereObj),Pv(t.atmosphereObj)),t.atmosphereColor&&t.atmosphereAltitude)){var r=t.atmosphereObj=zv(t.globeObj.geometry,{backside:!0,color:t.atmosphereColor,size:Dv*t.atmosphereAltitude,power:3.5,coefficient:.1});r.visible=!!t.showAtmosphere,r.__globeObjType="atmosphere",t.scene.add(r)}t.ready||t.globeImageUrl||(t.ready=!0,t.onReady())}}),jv=function(t){return isNaN(t)?parseInt(Nd(t).toHex(),16):t},Vv=function(t){return t&&isNaN(t)?vd(t).opacity:1},Wv=function(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=1,a=/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.eE+-]+)\s*\)$/.exec(t.trim().toLowerCase());if(a){var o=_v(a.slice(1),4),s=o[0],A=o[1],l=o[2],c=o[3];e=new Mn("rgb(".concat(+s,",").concat(+A,",").concat(+l,")")),i=Math.min(+c,1)}else e=new Mn(t);r&&e.convertLinearToSRGB();var u=e.toArray();return n?[].concat(yv(u),[i]):u};var Xv=window.THREE?window.THREE:{Float32BufferAttribute:On};function Qv(t,e){var n=new(arguments.length>2&&void 0!==arguments[2]?arguments[2]:Xv.Float32BufferAttribute)(t.length*e,e);return 1===e?t.forEach((function(t,e){return n.setX(e,t)})):t.forEach((function(t,r){return n.set(t,r*e)})),n}function Yv(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).removeDelay,i=void 0===r?0:r;return Df(t,e.children,(function(t){return e.add(t)}),(function(t){var n=function(){e.remove(t),Pv(t),t&&t.hasOwnProperty("__data")&&delete t.__data.__currentTargetD};i?setTimeout(n,i):n()}),Av({objBindAttr:"__threeObj"},n))}var Zv=window.THREE?window.THREE:{BufferGeometry:zn,Color:Mn,CylinderGeometry:Yo,Matrix4:qe,Mesh:ar,MeshLambertMaterial:Ps,Object3D:sn,Vector3:ae},Kv=Object.assign({},Jh),Jv=Kv.BufferGeometryUtils||Kv,$v=NA({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(t,e){Pv(t),e.scene=t},update:function(t){var e=$h(t.pointLat),n=$h(t.pointLng),r=$h(t.pointAltitude),i=$h(t.pointRadius),a=$h(t.pointColor),o=new Zv.CylinderGeometry(1,1,1,t.pointResolution);o.applyMatrix4((new Zv.Matrix4).makeRotationX(Math.PI/2)),o.applyMatrix4((new Zv.Matrix4).makeTranslation(0,0,-.5));var s=2*Math.PI*Dv/360,A={},l=t.pointsMerge?new Zv.Object3D:t.scene;if(Yv(t.pointsData,l,{createObj:function(){var t=new Zv.Mesh(o);return t.__globeObjType="point",t},updateObj:function(o,l){var c=function(e){var n=o.__currentTargetD=e,r=n.r,i=n.alt,a=n.lat,A=n.lng;Object.assign(o.position,Iv(a,A));var l=t.pointsMerge?new Zv.Vector3(0,0,0):t.scene.localToWorld(new Zv.Vector3(0,0,0));o.lookAt(l),o.scale.x=o.scale.y=Math.min(30,r)*s,o.scale.z=Math.max(i*Dv,.1)},u={alt:+r(l),r:+i(l),lat:+e(l),lng:+n(l)},h=o.__currentTargetD||Object.assign({},u,{alt:-.001});Object.keys(u).some((function(t){return h[t]!==u[t]}))&&(t.pointsMerge||!t.pointsTransitionDuration||t.pointsTransitionDuration<0?c(u):new VA(h).to(u,t.pointsTransitionDuration).easing(kA.Quadratic.InOut).onUpdate(c).start());if(!t.pointsMerge){var d=a(l),f=d?Vv(d):0,p=!!f;o.visible=p,p&&(A.hasOwnProperty(d)||(A[d]=new Zv.MeshLambertMaterial({color:jv(d),transparent:f<1,opacity:f})),o.material=A[d])}}}),t.pointsMerge){var c=t.pointsData.length?(Jv.mergeGeometries||Jv.mergeBufferGeometries)(t.pointsData.map((function(t){var e=t.__threeObj;t.__threeObj=void 0;var n=e.geometry.clone();e.updateMatrix(),n.applyMatrix4(e.matrix);var r=Wv(a(t));return n.setAttribute("color",Qv(yv(new Array(n.getAttribute("position").count)).map((function(){return r})),4)),n}))):new Zv.BufferGeometry,u=new Zv.Mesh(c,new Zv.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0}));u.__globeObjType="points",u.__data=t.pointsData,Pv(t.scene),t.scene.add(u)}}}),t_=["stroke"],e_=window.THREE?window.THREE:{BufferGeometry:zn,CubicBezierCurve3:Fo,Curve:Ro,Group:oo,Line:Eo,Mesh:ar,NormalBlending:1,QuadraticBezierCurve3:Ho,ShaderMaterial:hr,TubeGeometry:Cs,Vector3:ae},n_=If.default||If,r_={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 "},i_=NA({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}},methods:{pauseAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.pause()},resumeAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.resume()},_destructor:function(t){var e;null===(e=t.ticker)||void 0===e||e.dispose()}},init:function(t,e){Pv(t),e.scene=t,e.ticker=new n_,e.ticker.onTick.add((function(t,n){e.arcsData.filter((function(t){return t.__threeObj&&t.__threeObj.children.length&&t.__threeObj.children[0].material&&t.__threeObj.children[0].__dashAnimateStep})).forEach((function(t){var e=t.__threeObj.children[0],r=e.__dashAnimateStep*n,i=e.material.uniforms.dashTranslate.value%1e9;e.material.uniforms.dashTranslate.value=i+r}))}))},update:function(t){var e=$h(t.arcStartLat),n=$h(t.arcStartLng),r=$h(t.arcEndLat),i=$h(t.arcEndLng),a=$h(t.arcAltitude),o=$h(t.arcAltitudeAutoScale),s=$h(t.arcStroke),A=$h(t.arcColor),l=$h(t.arcDashLength),c=$h(t.arcDashGap),u=$h(t.arcDashInitialGap),h=$h(t.arcDashAnimateTime),d=new e_.ShaderMaterial(Av(Av({},r_),{},{transparent:!0,blending:e_.NormalBlending}));Yv(t.arcsData,t.scene,{createObj:function(){var t=new e_.Group;return t.__globeObjType="arc",t},updateObj:function(f,p){var m=s(p),g=null!=m;if(!f.children.length||g!==("Mesh"===f.children[0].type)){Pv(f);var v=g?new e_.Mesh:new e_.Line(new e_.BufferGeometry);v.material=d.clone(),f.add(v)}var _=f.children[0];Object.assign(_.material.uniforms,{dashSize:{value:l(p)},gapSize:{value:c(p)},dashOffset:{value:u(p)}});var y=h(p);_.__dashAnimateStep=y>0?1e3/y:0;var x=function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=e+1;if(t instanceof Array||t instanceof Function){var a=t instanceof Array?bp().domain(t.map((function(e,n){return n/(t.length-1)}))).range(t):t;n=function(t){return Wv(a(t),!0,!0)}}else{var o=Wv(t,!0,!0);n=function(){return o}}for(var s=[],A=0,l=i;A<l;A++)for(var c=n(A/(l-1)),u=0;u<r;u++)s.push(c);return Qv(s,4)}(A(p),t.arcCurveResolution,g?t.arcCircularResolution+1:1),b=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=0,a=t+1;i<a;i++)for(var o=i/(a-1),s=0;s<e;s++)r.push(o);return n&&r.reverse(),Qv(r,1)}(t.arcCurveResolution,g?t.arcCircularResolution+1:1,!0);_.geometry.setAttribute("vertexColor",x),_.geometry.setAttribute("vertexRelDistance",b);var M=function(e){var n=p.__currentTargetD=e,r=n.stroke,i=function(t){var e=t.alt,n=t.altAutoScale,r=t.startLat,i=t.startLng,a=t.endLat,o=t.endLng,s=function(t){var e=_v(t,3),n=e[0],r=Iv(e[1],n,e[2]),i=r.x,a=r.y,o=r.z;return new e_.Vector3(i,a,o)},A=[i,r],l=[o,a],c=e;if(null==c&&(c=rh(A,l)/2*n),c){var u=ph(A,l),h=_v([.25,.75].map((function(t){return[].concat(yv(u(t)),[1.5*c])})),2),d=h[0],f=h[1],p=function(t,e,n){if(ov())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&mv(i,n.prototype),i}(e_.CubicBezierCurve3,yv([A,d,f,l].map(s)));return p}var m=.001;return g.apply(void 0,yv([[].concat(A,[m]),[].concat(l,[m])].map(s)));function g(t,e){var n=t.angleTo(e),r=0===n?function(){return t.clone()}:function(r){return(new e_.Vector3).addVectors(t.clone().multiplyScalar(Math.sin((1-r)*n)),e.clone().multiplyScalar(Math.sin(r*n))).divideScalar(Math.sin(n))},i=new e_.Curve;return i.getPoint=r,i}}(gv(n,t_));g?(_.geometry&&_.geometry.dispose(),_.geometry=new e_.TubeGeometry(i,t.arcCurveResolution,r/2,t.arcCircularResolution),_.geometry.setAttribute("vertexColor",x),_.geometry.setAttribute("vertexRelDistance",b)):_.geometry.setFromPoints(i.getPoints(t.arcCurveResolution))},w={stroke:m,alt:a(p),altAutoScale:+o(p),startLat:+e(p),startLng:+n(p),endLat:+r(p),endLng:+i(p)},E=p.__currentTargetD||Object.assign({},w,{altAutoScale:-.001});Object.keys(w).some((function(t){return E[t]!==w[t]}))&&(!t.arcsTransitionDuration||t.arcsTransitionDuration<0?M(w):new VA(E).to(w,t.arcsTransitionDuration).easing(kA.Quadratic.InOut).onUpdate(M).start())}})}}),a_=window.THREE?window.THREE:{BufferGeometry:zn,Color:Mn,DoubleSide:2,Mesh:ar,MeshLambertMaterial:Ps,Object3D:sn},o_=Object.assign({},Jh),s_=o_.BufferGeometryUtils||o_,A_=NA({props:{hexBinPointsData:{default:[]},hexBinPointLat:{default:"lat"},hexBinPointLng:{default:"lng"},hexBinPointWeight:{default:1},hexBinResolution:{default:4},hexMargin:{default:.2},hexTopCurvatureResolution:{default:5},hexTopColor:{default:function(){return"#ffffaa"}},hexSideColor:{default:function(){return"#ffffaa"}},hexAltitude:{default:function(t){return.01*t.sumWeight}},hexBinMerge:{default:!1},hexTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e){Pv(t),e.scene=t},update:function(t){var e=$h(t.hexBinPointLat),n=$h(t.hexBinPointLng),r=$h(t.hexBinPointWeight),i=$h(t.hexAltitude),a=$h(t.hexTopColor),o=$h(t.hexSideColor),s=$h(t.hexMargin),A=bf(t.hexBinPointsData.map((function(r){return Av(Av({},r),{},{h3Idx:mg(e(r),n(r),t.hexBinResolution)})})),"h3Idx"),l=Object.entries(A).map((function(t){var e=_v(t,2),n=e[0],i=e[1];return{h3Idx:n,points:i,sumWeight:i.reduce((function(t,e){return t+ +r(e)}),0)}})),c={};if(Yv(l,t.hexBinMerge?new a_.Object3D:t.scene,{createObj:function(t){var e=new a_.Mesh;e.__hexCenter=gg(t.h3Idx),e.__hexGeoJson=vg(t.h3Idx,!0).reverse();var n=e.__hexCenter[1];return e.__hexGeoJson.forEach((function(t){var e=t[0];Math.abs(n-e)>170&&(t[0]+=n>e?360:-360)})),e.__globeObjType="hexbin",e},updateObj:function(e,n){var r=Math.max(0,Math.min(1,+s(n))),A=_v(e.__hexCenter,2),l=A[0],u=A[1],h=0===r?e.__hexGeoJson:e.__hexGeoJson.map((function(t){var e=_v(t,2),n=e[0],i=e[1];return[[n,u],[i,l]].map((function(t){var e=_v(t,2);return function(t,e,n){return t-(t-e)*n}(e[0],e[1],r)}))})),d=t.hexTopCurvatureResolution;e.geometry&&e.geometry.dispose(),e.geometry=new Nm([h],0,Dv,!1,!0,!0,d);var f={alt:+i(n)},p=function(t){var n=(e.__currentTargetD=t).alt;e.scale.x=e.scale.y=e.scale.z=1+n},m=e.__currentTargetD||Object.assign({},f,{alt:-.001});Object.keys(f).some((function(t){return m[t]!==f[t]}))&&(t.hexBinMerge||!t.hexTransitionDuration||t.hexTransitionDuration<0?p(f):new VA(m).to(f,t.hexTransitionDuration).easing(kA.Quadratic.InOut).onUpdate(p).start());if(!t.hexBinMerge){var g=o(n),v=a(n);[g,v].forEach((function(t){if(!c.hasOwnProperty(t)){var e=Vv(t);c[t]=new a_.MeshLambertMaterial({color:jv(t),transparent:e<1,opacity:e,side:a_.DoubleSide})}})),e.material=[g,v].map((function(t){return c[t]}))}},idAccessor:function(t){return t.h3Idx}}),t.hexBinMerge){var u=l.length?(s_.mergeGeometries||s_.mergeBufferGeometries)(l.map((function(t){var e=t.__threeObj;t.__threeObj=void 0;var n=e.geometry.toNonIndexed();e.updateMatrix(),n.applyMatrix4(e.matrix);var r=Wv(a(t)),i=Wv(o(t)),s=n.getAttribute("position").count,A=n.groups[0].count;return n.setAttribute("color",Qv(yv(new Array(s)).map((function(t,e){return e>=A?r:i})),4)),n}))):new a_.BufferGeometry,h=new a_.Mesh(u,new a_.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0,side:a_.DoubleSide}));h.__globeObjType="hexBinPoints",h.__data=l,Pv(t.scene),t.scene.add(h)}}}),l_=function(t){return t*t};var c_=Math.sqrt(2*Math.PI);var u_=function(t){var e=_v(t,2),n=e[0],r=e[1],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=a.lngAccessor,s=void 0===o?function(t){return t[0]}:o,A=a.latAccessor,l=void 0===A?function(t){return t[1]}:A,c=a.weightAccessor,u=void 0===c?function(){return 1}:c,h=a.bandwidth,d=[n,r],f=h*Math.PI/180;return function(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}(i.map((function(t){var e=u(t);if(!e)return 0;var n,r,i=function(t,e){var n=Math.sqrt,r=Math.cos,i=function(t){return t*Math.PI/180},a=function(t){return l_(Math.sin(t/2))},o=i(t[1]),s=i(e[1]),A=i(t[0]),l=i(e[0]);return 2*Math.asin(n(a(s-o)+r(o)*r(s)*a(l-A)))}(d,[s(t),l(t)]);return n=i,r=f,Math.exp(-l_(n/r)/2)/(r*c_)*e})))},h_=window.THREE?window.THREE:{Mesh:ar,MeshLambertMaterial:Ps,SphereGeometry:Ts},d_=new WeakSet,f_=new WeakMap,p_=new WeakMap,m_=new WeakMap,g_=function(){function t(e,n){var r,i;cv(this,t),Sv(r=this,i=d_),i.add(r),Tv(this,f_,{writable:!0,value:void 0}),Tv(this,p_,{writable:!0,value:void 0}),Tv(this,m_,{writable:!0,value:void 0}),wv(this,f_,e),wv(this,p_,Dg()),Mv(this,p_).init(e.map((function(t){return[t.x,t.y,t.z]})).flat()),wv(this,m_,function(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}(this,d_,v_).call(this,Iv(0,0),Iv(0,Math.min(180,n))))}return hv(t,[{key:"getNearPoints",value:function(t,e,n){var r=this;return Mv(this,p_).intersectSphere(t,e,n,Mv(this,m_)).map((function(t){return Mv(r,f_)[t/3]}))}}]),t}();function v_(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)+Math.pow(t.z-e.z,2))}var __=function(t){var e=vd(function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"}(t));return e.opacity=Math.cbrt(t),e.formatRgb()},y_=NA({props:{heatmapsData:{default:[]},heatmapPoints:{default:function(t){return t}},heatmapPointLat:{default:function(t){return t[0]}},heatmapPointLng:{default:function(t){return t[1]}},heatmapPointWeight:{default:1},heatmapBandwidth:{default:4},heatmapColorFn:{default:function(){return __}},heatmapColorSaturation:{default:1.5},heatmapBaseAltitude:{default:.01},heatmapTopAltitude:{},heatmapsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(t,e){Pv(t),e.scene=t},update:function(t){var e=$h(t.heatmapPoints),n=$h(t.heatmapPointLat),r=$h(t.heatmapPointLng),i=$h(t.heatmapPointWeight),a=$h(t.heatmapBandwidth),o=$h(t.heatmapColorFn),s=$h(t.heatmapColorSaturation),A=$h(t.heatmapBaseAltitude),l=$h(t.heatmapTopAltitude);Yv(t.heatmapsData,t.scene,{createObj:function(t){var e=new h_.Mesh(new h_.SphereGeometry(Dv),new h_.MeshLambertMaterial({vertexColors:!0,transparent:!0}));return e.__globeObjType="heatmap",e},updateObj:function(c,u){var h=a(u),d=o(u),f=s(u),p=A(u),m=l(u),g=e(u).map((function(t){var e=n(t),a=r(t),o=Iv(e,a);return{x:o.x,y:o.y,z:o.z,lat:e,lng:a,weight:i(t)}})),v=Math.max(.1,h/3.5),_=Math.ceil(360/(v||-1));c.geometry.parameters.widthSegments!==_&&(c.geometry.dispose(),c.geometry=new h_.SphereGeometry(Dv,_,_/2));var y=function(t){for(var e=t.itemSize,n=[],r=0;r<t.count;r++)n.push(t.array.slice(r*e,(r+1)*e));return n}(c.geometry.getAttribute("position")),x=y.map((function(t){var e=_v(t,3),n=qv({x:e[0],y:e[1],z:e[2]});return[n.lng,n.lat]})),b=new g_(g,3.5*h),M=x.map((function(t,e){var n=_v(y[e],3),r=n[0],i=n[1],a=n[2];return u_(t,b.getNearPoints(r,i,a),{latAccessor:function(t){return t.lat},lngAccessor:function(t){return t.lng},weightAccessor:function(t){return t.weight},bandwidth:h})})),w=function(t){var e=c.__currentTargetD=t,n=e.kdeVals,r=e.topAlt,i=e.saturation,a=function(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}(n.map(Math.abs))||1e-15;c.geometry.setAttribute("color",Qv(n.map((function(t){return Wv(d(t/a*i))})),4));var o=bp([0,a],[p,r||p]);c.geometry.setAttribute("position",Qv(n.map((function(t,e){var n=_v(x[e],2),r=n[0],i=Iv(n[1],r,o(Math.abs(t)));return[i.x,i.y,i.z]})),3))},E={kdeVals:M,topAlt:m,saturation:f},S=c.__currentTargetD||Object.assign({},E,{kdeVals:M.map((function(){return 0})),topAlt:m?p:m,saturation:.5});S.kdeVals.length!==M.length&&(S.kdeVals=M.slice()),Object.keys(E).some((function(t){return S[t]!==E[t]}))&&(!t.heatmapsTransitionDuration||t.heatmapsTransitionDuration<0?w(E):new VA(S).to(E,t.heatmapsTransitionDuration).easing(kA.Quadratic.InOut).onUpdate(w).start())}})}}),x_=window.THREE?window.THREE:{DoubleSide:2,Group:oo,LineBasicMaterial:_o,LineSegments:Co,Mesh:ar,MeshBasicMaterial:Tn},b_=NA({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(t,e){Pv(t),e.scene=t},update:function(t){var e=$h(t.polygonGeoJsonGeometry),n=$h(t.polygonAltitude),r=$h(t.polygonCapCurvatureResolution),i=$h(t.polygonCapColor),a=$h(t.polygonCapMaterial),o=$h(t.polygonSideColor),s=$h(t.polygonSideMaterial),A=$h(t.polygonStrokeColor),l=[];t.polygonsData.forEach((function(t){var c={data:t,capColor:i(t),capMaterial:a(t),sideColor:o(t),sideMaterial:s(t),strokeColor:A(t),altitude:+n(t),capCurvatureResolution:+r(t)},u=e(t),h=t.__id||"".concat(Math.round(1e9*Math.random()));t.__id=h,"Polygon"===u.type?l.push(Av({id:"".concat(h,"_0"),coords:u.coordinates},c)):"MultiPolygon"===u.type?l.push.apply(l,yv(u.coordinates.map((function(t,e){return Av({id:"".concat(h,"_").concat(e),coords:t},c)})))):console.warn("Unsupported GeoJson geometry type: ".concat(u.type,". Skipping geometry..."))})),Yv(l,t.scene,{idAccessor:function(t){return t.id},createObj:function(){var t=new x_.Group;return t.__defaultSideMaterial=new x_.MeshBasicMaterial({side:x_.DoubleSide,depthWrite:!0}),t.__defaultCapMaterial=new x_.MeshBasicMaterial({side:x_.DoubleSide,depthWrite:!0}),t.add(new x_.Mesh(void 0,[t.__defaultSideMaterial,t.__defaultCapMaterial])),t.add(new x_.LineSegments(void 0,new x_.LineBasicMaterial)),t.__globeObjType="polygon",t},updateObj:function(e,n){var r=n.coords,i=n.capColor,a=n.capMaterial,o=n.sideColor,s=n.sideMaterial,A=n.strokeColor,l=n.altitude,c=n.capCurvatureResolution,u=_v(e.children,2),h=u[0],d=u[1],f=!!A;if(d.visible=f,function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return function(t,e){return t===e}};return Object.entries(e).every((function(e){var r=_v(e,2),i=r[0],a=r[1];return t.hasOwnProperty(i)&&n(i)(t[i],a)}))}(h.geometry.parameters||{},{polygonGeoJson:r,curvatureResolution:c})||(h.geometry&&h.geometry.dispose(),h.geometry=new Nm(r,0,Dv,!1,!0,!0,c)),!f||d.geometry.parameters&&d.geometry.parameters.geoJson.coordinates===r&&d.geometry.parameters.resolution===c||(d.geometry&&d.geometry.dispose(),d.geometry=new Wh({type:"Polygon",coordinates:r},Dv,c)),h.material[0]=s||e.__defaultSideMaterial,h.material[1]=a||e.__defaultCapMaterial,[!s&&o,!a&&i].forEach((function(t,e){if(t){var n=h.material[e],r=Vv(t);n.color.set(jv(t)),n.transparent=r<1,n.opacity=r}})),f){var p=d.material,m=Vv(A);p.color.set(jv(A)),p.transparent=m<1,p.opacity=m}var g={alt:l},v=function(t){var n=(e.__currentTargetD=t).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)},_=e.__currentTargetD||Object.assign({},g,{alt:-.001});Object.keys(g).some((function(t){return _[t]!==g[t]}))&&(!t.polygonsTransitionDuration||t.polygonsTransitionDuration<0||_.alt===g.alt?v(g):new VA(_).to(g,t.polygonsTransitionDuration).easing(kA.Quadratic.InOut).onUpdate(v).start())}})}});var M_=window.THREE?window.THREE:{BufferGeometry:zn,CircleGeometry:Qo,DoubleSide:2,Mesh:ar,MeshLambertMaterial:Ps,Vector3:ae},w_=Object.assign({},Jh),E_=w_.BufferGeometryUtils||w_,S_=NA({props:{hexPolygonsData:{default:[]},hexPolygonGeoJsonGeometry:{default:"geometry"},hexPolygonColor:{default:function(){return"#ffffaa"}},hexPolygonAltitude:{default:.001},hexPolygonResolution:{default:3},hexPolygonMargin:{default:.2},hexPolygonUseDots:{default:!1},hexPolygonCurvatureResolution:{default:5},hexPolygonDotResolution:{default:12},hexPolygonsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(t,e){Pv(t),e.scene=t},update:function(t){var e=$h(t.hexPolygonGeoJsonGeometry),n=$h(t.hexPolygonColor),r=$h(t.hexPolygonAltitude),i=$h(t.hexPolygonResolution),a=$h(t.hexPolygonMargin),o=$h(t.hexPolygonUseDots),s=$h(t.hexPolygonCurvatureResolution),A=$h(t.hexPolygonDotResolution);Yv(t.hexPolygonsData,t.scene,{createObj:function(t){var e=new M_.Mesh(void 0,new M_.MeshLambertMaterial({side:M_.DoubleSide}));return e.__globeObjType="hexPolygon",e},updateObj:function(l,c){var u=e(c),h=i(c),d=r(c),f=Math.max(0,Math.min(1,+a(c))),p=o(c),m=s(c),g=A(c),v=n(c),_=Vv(v);l.material.color.set(jv(v)),l.material.transparent=_<1,l.material.opacity=_;var y={alt:d,margin:f,curvatureResolution:m},x={geoJson:u,h3Res:h},b=l.__currentTargetD||Object.assign({},y,{alt:-.001}),M=l.__currentMemD||x;if(Object.keys(y).some((function(t){return b[t]!==y[t]}))||Object.keys(x).some((function(t){return M[t]!==x[t]}))){l.__currentMemD=x;var w=[];"Polygon"===u.type?_g(u.coordinates,h,!0).forEach((function(t){return w.push(t)})):"MultiPolygon"===u.type?u.coordinates.forEach((function(t){return _g(t,h,!0).forEach((function(t){return w.push(t)}))})):console.warn("Unsupported GeoJson geometry type: ".concat(u.type,". Skipping geometry..."));var E=w.map((function(t){var e=gg(t),n=vg(t,!0).reverse(),r=e[1];return n.forEach((function(t){var e=t[0];Math.abs(r-e)>170&&(t[0]+=r>e?360:-360)})),{h3Idx:t,hexCenter:e,hexGeoJson:n}})),S=function(t){var e=l.__currentTargetD=t,n=e.alt,r=e.margin,i=e.curvatureResolution;l.geometry&&l.geometry.dispose(),l.geometry=E.length?(E_.mergeGeometries||E_.mergeBufferGeometries)(E.map((function(t){var e=_v(t.hexCenter,2),a=e[0],o=e[1];if(p){var s=Iv(a,o,n),A=Iv(t.hexGeoJson[0][1],t.hexGeoJson[0][0],n),l=.85*(1-r)*new M_.Vector3(s.x,s.y,s.z).distanceTo(new M_.Vector3(A.x,A.y,A.z)),c=new Qo(l,g);return c.rotateX(Uv(-a)),c.rotateY(Uv(o)),c.translate(s.x,s.y,s.z),c}var u=0===r?t.hexGeoJson:t.hexGeoJson.map((function(t){var e=_v(t,2),n=e[0],i=e[1];return[[n,o],[i,a]].map((function(t){var e=_v(t,2);return function(t,e,n){return t-(t-e)*n}(e[0],e[1],r)}))}));return new Nm([u],Dv,Dv*(1+n),!1,!0,!1,i)}))):new M_.BufferGeometry};!t.hexPolygonsTransitionDuration||t.hexPolygonsTransitionDuration<0?S(y):new VA(b).to(y,t.hexPolygonsTransitionDuration).easing(kA.Quadratic.InOut).onUpdate(S).start()}}})}}),T_=window.THREE?window.THREE:{Vector3:ae};function C_(t,e){var n=Math.max(t.length,e.length),r=Gf.apply(void 0,yv([t,e].map((function(t){return t.map((function(t){return[t.x,t.y,t.z]}))})).map((function(t){return function(t,e){var n=t[t.length-1];return[].concat(yv(t),yv(yv(new Array(e-t.length)).map((function(){return n}))))}(t,n)}))));return function(n){return 0===n?t:1===n?e:r(n).map((function(t){var e=_v(t,3),n=e[0],r=e[1],i=e[2];return new T_.Vector3(n,r,i)}))}}var R_=window.THREE?window.THREE:{BufferGeometry:zn,Color:Mn,Group:oo,Line:Eo,NormalBlending:1,ShaderMaterial:hr,Vector3:ae},P_=If.default||If,L_={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 "},D_=NA({props:{pathsData:{default:[]},pathPoints:{default:function(t){return t}},pathPointLat:{default:function(t){return t[0]}},pathPointLng:{default:function(t){return t[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:{}},methods:{pauseAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.pause()},resumeAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.resume()},_destructor:function(t){var e;null===(e=t.ticker)||void 0===e||e.dispose()}},init:function(t,e){Pv(t),e.scene=t,e.ticker=new P_,e.ticker.onTick.add((function(t,n){e.pathsData.filter((function(t){return t.__threeObj&&t.__threeObj.children.length&&t.__threeObj.children[0].material&&t.__threeObj.children[0].__dashAnimateStep})).forEach((function(t){var e=t.__threeObj.children[0],r=e.__dashAnimateStep*n;if("Line"===e.type){var i=e.material.uniforms.dashTranslate.value%1e9;e.material.uniforms.dashTranslate.value=i+r}else if("Line2"===e.type){for(var a=e.material.dashOffset-r,o=e.material.dashSize+e.material.gapSize;a<=-o;)a+=o;e.material.dashOffset=a}}))}))},update:function(t){var e=$h(t.pathPoints),n=$h(t.pathPointLat),r=$h(t.pathPointLng),i=$h(t.pathPointAlt),a=$h(t.pathStroke),o=$h(t.pathColor),s=$h(t.pathDashLength),A=$h(t.pathDashGap),l=$h(t.pathDashInitialGap),c=$h(t.pathDashAnimateTime),u=new R_.ShaderMaterial(Av(Av({},L_),{},{transparent:!0,blending:R_.NormalBlending}));function h(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=e+1;if(t instanceof Array||t instanceof Function){var o=t instanceof Array?bp().domain(t.map((function(e,n){return n/(t.length-1)}))).range(t):t;n=function(t){return Wv(o(t),i,!0)}}else{var s=Wv(t,i,!0);n=function(){return s}}for(var A=[],l=0,c=a;l<c;l++)for(var u=n(l/(c-1)),h=0;h<r;h++)A.push(u);return Qv(A,i?4:3)}Yv(t.pathsData,t.scene,{createObj:function(){var t=new R_.Group;return t.__globeObjType="path",t},updateObj:function(d,f){var p=a(f),m=null!=p;if(!d.children.length||m===("Line"===d.children[0].type)){Pv(d);var g=m?new nv(new ev,new kg):new R_.Line(new R_.BufferGeometry,u.clone());d.add(g)}var v,_,y=d.children[0],x=function(t,e,n,r,i){var a=function(t,e,n){for(var r=[],i=1;i<=n;i++)r.push(t+(e-t)*i/(n+1));return r},o=function(){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=[],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]<r[1]?1:-1);var i=Math.sqrt(Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2));if(i>t)for(var o=Math.floor(i/t),s=a(n[0],r[0],o),A=a(n[1],r[1],o),l=a(n[2],r[2],o),c=0,u=s.length;c<u;c++)e.push([s[c],A[c],l[c]])}e.push(n=r)})),e},s=function(t){var e=_v(t,3),n=Iv(e[0],e[1],e[2]),r=n.x,i=n.y,a=n.z;return new R_.Vector3(r,i,a)};return o(t.map((function(t){return[e(t),n(t),r(t)]})),i).map(s)}(e(f),n,r,i,t.pathResolution),b=c(f);if(y.__dashAnimateStep=b>0?1e3/b:0,m){y.material.resolution=t.rendererSize;var M=s(f),w=A(f),E=l(f);y.material.dashed=w>0,y.material.dashed?y.material.defines.USE_DASH="":delete y.material.defines.USE_DASH,y.material.dashed&&(y.material.dashScale=1/(_=0,x.forEach((function(t){v&&(_+=v.distanceTo(t)),v=t})),_),y.material.dashSize=M,y.material.gapSize=w,y.material.dashOffset=-E);var S=o(f);if(S instanceof Array){var T=h(o(f),x.length-1,1,!1);y.geometry.setColors(T.array),y.material.vertexColors=!0}else{var C=S,R=Vv(C);y.material.color=new R_.Color(jv(C)),y.material.transparent=R<1,y.material.opacity=R,y.material.vertexColors=!1}y.material.needsUpdate=!0}else{Object.assign(y.material.uniforms,{dashSize:{value:s(f)},gapSize:{value:A(f)},dashOffset:{value:l(f)}});var P=h(o(f),x.length),L=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=0,a=t+1;i<a;i++)for(var o=i/(a-1),s=0;s<e;s++)r.push(o);return n&&r.reverse(),Qv(r,1)}(x.length,1,!0);y.geometry.setAttribute("vertexColor",P),y.geometry.setAttribute("vertexRelDistance",L)}var D=C_(f.__currentTargetD&&f.__currentTargetD.points||[x[0]],x),O=function(t){var e,n=f.__currentTargetD=t,r=n.stroke,i=n.interpolK,a=f.__currentTargetD.points=D(i);m?(y.geometry.setPositions((e=[]).concat.apply(e,yv(a.map((function(t){return[t.x,t.y,t.z]}))))),y.material.linewidth=r,y.material.dashed&&y.computeLineDistances()):(y.geometry.setFromPoints(a),y.geometry.computeBoundingSphere())},I={stroke:p,interpolK:1},q=Object.assign({},f.__currentTargetD||I,{interpolK:0});Object.keys(I).some((function(t){return q[t]!==I[t]}))&&(!t.pathTransitionDuration||t.pathTransitionDuration<0?O(I):new VA(q).to(I,t.pathTransitionDuration).easing(kA.Quadratic.InOut).onUpdate(O).start())}})}}),O_=window.THREE?window.THREE:{Euler:Ve,Mesh:ar,MeshLambertMaterial:Ps,SphereGeometry:Ts},I_=NA({props:{tilesData:{default:[]},tileLat:{default:"lat"},tileLng:{default:"lng"},tileAltitude:{default:.01},tileWidth:{default:1},tileHeight:{default:1},tileUseGlobeProjection:{default:!0},tileMaterial:{default:function(){return new O_.MeshLambertMaterial({color:"#ffbb88",opacity:.4,transparent:!0})}},tileCurvatureResolution:{default:5},tilesTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(t,e){Pv(t),e.scene=t},update:function(t){var e=$h(t.tileLat),n=$h(t.tileLng),r=$h(t.tileAltitude),i=$h(t.tileWidth),a=$h(t.tileHeight),o=$h(t.tileUseGlobeProjection),s=$h(t.tileMaterial),A=$h(t.tileCurvatureResolution);Yv(t.tilesData,t.scene,{createObj:function(){var t=new O_.Mesh;return t.__globeObjType="tile",t},updateObj:function(l,c){l.material=s(c);var u=o(c),h=A(c),d=function(t){var e=l.__currentTargetD=t,n=e.lat,r=e.lng,i=e.alt,a=e.width,o=e.height,s=q_(r),A=q_(-n);l.geometry&&l.geometry.dispose(),l.geometry=new O_.SphereGeometry(Dv*(1+i),Math.ceil(a/(h||-1)),Math.ceil(o/(h||-1)),q_(90-a/2)+(u?s:0),q_(a),q_(90-o/2)+(u?A:0),q_(o)),u||l.setRotationFromEuler(new O_.Euler(A,s,0,"YXZ"))},f={lat:+e(c),lng:+n(c),alt:+r(c),width:+i(c),height:+a(c)},p=l.__currentTargetD||Object.assign({},f,{width:0,height:0});Object.keys(f).some((function(t){return p[t]!==f[t]}))&&(!t.tilesTransitionDuration||t.tilesTransitionDuration<0?d(f):new VA(p).to(f,t.tilesTransitionDuration).easing(kA.Quadratic.InOut).onUpdate(d).start())}})}}),q_=function(t){return t*Math.PI/180},U_={glyphs:{0:{x_min:73,x_max:715,ha:792,o:"m 394 -29 q 153 129 242 -29 q 73 479 73 272 q 152 829 73 687 q 394 989 241 989 q 634 829 545 989 q 715 479 715 684 q 635 129 715 270 q 394 -29 546 -29 m 394 89 q 546 211 489 89 q 598 479 598 322 q 548 748 598 640 q 394 871 491 871 q 241 748 298 871 q 190 479 190 637 q 239 211 190 319 q 394 89 296 89 "},1:{x_min:215.671875,x_max:574,ha:792,o:"m 574 0 l 442 0 l 442 697 l 215 697 l 215 796 q 386 833 330 796 q 475 986 447 875 l 574 986 l 574 0 "},2:{x_min:59,x_max:731,ha:792,o:"m 731 0 l 59 0 q 197 314 59 188 q 457 487 199 315 q 598 691 598 580 q 543 819 598 772 q 411 867 488 867 q 272 811 328 867 q 209 630 209 747 l 81 630 q 182 901 81 805 q 408 986 271 986 q 629 909 536 986 q 731 694 731 826 q 613 449 731 541 q 378 316 495 383 q 201 122 235 234 l 731 122 l 731 0 "},3:{x_min:54,x_max:737,ha:792,o:"m 737 284 q 635 55 737 141 q 399 -25 541 -25 q 156 52 248 -25 q 54 308 54 140 l 185 308 q 245 147 185 202 q 395 96 302 96 q 539 140 484 96 q 602 280 602 190 q 510 429 602 390 q 324 454 451 454 l 324 565 q 487 584 441 565 q 565 719 565 617 q 515 835 565 791 q 395 879 466 879 q 255 824 307 879 q 203 661 203 769 l 78 661 q 166 909 78 822 q 387 992 250 992 q 603 921 513 992 q 701 723 701 844 q 669 607 701 656 q 578 524 637 558 q 696 434 655 499 q 737 284 737 369 "},4:{x_min:48,x_max:742.453125,ha:792,o:"m 742 243 l 602 243 l 602 0 l 476 0 l 476 243 l 48 243 l 48 368 l 476 958 l 602 958 l 602 354 l 742 354 l 742 243 m 476 354 l 476 792 l 162 354 l 476 354 "},5:{x_min:54.171875,x_max:738,ha:792,o:"m 738 314 q 626 60 738 153 q 382 -23 526 -23 q 155 47 248 -23 q 54 256 54 125 l 183 256 q 259 132 204 174 q 382 91 314 91 q 533 149 471 91 q 602 314 602 213 q 538 469 602 411 q 386 528 475 528 q 284 506 332 528 q 197 439 237 484 l 81 439 l 159 958 l 684 958 l 684 840 l 254 840 l 214 579 q 306 627 258 612 q 407 643 354 643 q 636 552 540 643 q 738 314 738 457 "},6:{x_min:53,x_max:739,ha:792,o:"m 739 312 q 633 62 739 162 q 400 -31 534 -31 q 162 78 257 -31 q 53 439 53 206 q 178 859 53 712 q 441 986 284 986 q 643 912 559 986 q 732 713 732 833 l 601 713 q 544 830 594 786 q 426 875 494 875 q 268 793 331 875 q 193 517 193 697 q 301 597 240 570 q 427 624 362 624 q 643 540 552 624 q 739 312 739 451 m 603 298 q 540 461 603 400 q 404 516 484 516 q 268 461 323 516 q 207 300 207 401 q 269 137 207 198 q 405 83 325 83 q 541 137 486 83 q 603 298 603 197 "},7:{x_min:58.71875,x_max:730.953125,ha:792,o:"m 730 839 q 469 448 560 641 q 335 0 378 255 l 192 0 q 328 441 235 252 q 593 830 421 630 l 58 830 l 58 958 l 730 958 l 730 839 "},8:{x_min:55,x_max:736,ha:792,o:"m 571 527 q 694 424 652 491 q 736 280 736 358 q 648 71 736 158 q 395 -26 551 -26 q 142 69 238 -26 q 55 279 55 157 q 96 425 55 359 q 220 527 138 491 q 120 615 153 562 q 88 726 88 668 q 171 904 88 827 q 395 986 261 986 q 618 905 529 986 q 702 727 702 830 q 670 616 702 667 q 571 527 638 565 m 394 565 q 519 610 475 565 q 563 717 563 655 q 521 823 563 781 q 392 872 474 872 q 265 824 312 872 q 224 720 224 783 q 265 613 224 656 q 394 565 312 565 m 395 91 q 545 150 488 91 q 597 280 597 204 q 546 408 597 355 q 395 465 492 465 q 244 408 299 465 q 194 280 194 356 q 244 150 194 203 q 395 91 299 91 "},9:{x_min:53,x_max:739,ha:792,o:"m 739 524 q 619 94 739 241 q 362 -32 516 -32 q 150 47 242 -32 q 59 244 59 126 l 191 244 q 246 129 191 176 q 373 82 301 82 q 526 161 466 82 q 597 440 597 255 q 363 334 501 334 q 130 432 216 334 q 53 650 53 521 q 134 880 53 786 q 383 986 226 986 q 659 841 566 986 q 739 524 739 719 m 388 449 q 535 514 480 449 q 585 658 585 573 q 535 805 585 744 q 388 873 480 873 q 242 809 294 873 q 191 658 191 745 q 239 514 191 572 q 388 449 292 449 "},"ο":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 96 88 192 -25 q 0 368 0 201 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 "},S:{x_min:0,x_max:788,ha:890,o:"m 788 291 q 662 54 788 144 q 397 -26 550 -26 q 116 68 226 -26 q 0 337 0 168 l 131 337 q 200 152 131 220 q 384 85 269 85 q 557 129 479 85 q 650 270 650 183 q 490 429 650 379 q 194 513 341 470 q 33 739 33 584 q 142 964 33 881 q 388 1041 242 1041 q 644 957 543 1041 q 756 716 756 867 l 625 716 q 561 874 625 816 q 395 933 497 933 q 243 891 309 933 q 164 759 164 841 q 325 609 164 656 q 625 526 475 568 q 788 291 788 454 "},"¦":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"/":{x_min:183.25,x_max:608.328125,ha:792,o:"m 608 1041 l 266 -129 l 183 -129 l 520 1041 l 608 1041 "},"Τ":{x_min:-.4375,x_max:777.453125,ha:839,o:"m 777 893 l 458 893 l 458 0 l 319 0 l 319 892 l 0 892 l 0 1013 l 777 1013 l 777 893 "},y:{x_min:0,x_max:684.78125,ha:771,o:"m 684 738 l 388 -83 q 311 -216 356 -167 q 173 -279 252 -279 q 97 -266 133 -279 l 97 -149 q 132 -155 109 -151 q 168 -160 155 -160 q 240 -114 213 -160 q 274 -26 248 -98 l 0 738 l 137 737 l 341 139 l 548 737 l 684 738 "},"Π":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 803 1012 l 803 0 "},"ΐ":{x_min:-111,x_max:339,ha:361,o:"m 339 800 l 229 800 l 229 925 l 339 925 l 339 800 m -1 800 l -111 800 l -111 925 l -1 925 l -1 800 m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 m 302 1040 l 113 819 l 30 819 l 165 1040 l 302 1040 "},g:{x_min:0,x_max:686,ha:838,o:"m 686 34 q 586 -213 686 -121 q 331 -306 487 -306 q 131 -252 216 -306 q 31 -84 31 -190 l 155 -84 q 228 -174 166 -138 q 345 -207 284 -207 q 514 -109 454 -207 q 564 89 564 -27 q 461 6 521 36 q 335 -23 401 -23 q 88 100 184 -23 q 0 370 0 215 q 87 634 0 522 q 330 758 183 758 q 457 728 398 758 q 564 644 515 699 l 564 737 l 686 737 l 686 34 m 582 367 q 529 560 582 481 q 358 652 468 652 q 189 561 250 652 q 135 369 135 482 q 189 176 135 255 q 361 85 251 85 q 529 176 468 85 q 582 367 582 255 "},"²":{x_min:0,x_max:442,ha:539,o:"m 442 383 l 0 383 q 91 566 0 492 q 260 668 176 617 q 354 798 354 727 q 315 875 354 845 q 227 905 277 905 q 136 869 173 905 q 99 761 99 833 l 14 761 q 82 922 14 864 q 232 974 141 974 q 379 926 316 974 q 442 797 442 878 q 351 635 442 704 q 183 539 321 611 q 92 455 92 491 l 442 455 l 442 383 "},"":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},"Κ":{x_min:0,x_max:819.5625,ha:893,o:"m 819 0 l 650 0 l 294 509 l 139 356 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},"ƒ":{x_min:-46.265625,x_max:392,ha:513,o:"m 392 651 l 259 651 l 79 -279 l -46 -278 l 134 651 l 14 651 l 14 751 l 135 751 q 151 948 135 900 q 304 1041 185 1041 q 334 1040 319 1041 q 392 1034 348 1039 l 392 922 q 337 931 360 931 q 271 883 287 931 q 260 793 260 853 l 260 751 l 392 751 l 392 651 "},e:{x_min:0,x_max:714,ha:813,o:"m 714 326 l 140 326 q 200 157 140 227 q 359 87 260 87 q 488 130 431 87 q 561 245 545 174 l 697 245 q 577 48 670 123 q 358 -26 484 -26 q 97 85 195 -26 q 0 363 0 197 q 94 642 0 529 q 358 765 195 765 q 626 627 529 765 q 714 326 714 503 m 576 429 q 507 583 564 522 q 355 650 445 650 q 206 583 266 650 q 140 429 152 522 l 576 429 "},"ό":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 94 91 194 -25 q 0 368 0 202 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 m 576 1040 l 387 819 l 303 819 l 438 1040 l 576 1040 "},J:{x_min:0,x_max:588,ha:699,o:"m 588 279 q 287 -26 588 -26 q 58 73 126 -26 q 0 327 0 158 l 133 327 q 160 172 133 227 q 288 96 198 96 q 426 171 391 96 q 449 336 449 219 l 449 1013 l 588 1013 l 588 279 "},"»":{x_min:-1,x_max:503,ha:601,o:"m 503 302 l 280 136 l 281 256 l 429 373 l 281 486 l 280 608 l 503 440 l 503 302 m 221 302 l 0 136 l 0 255 l 145 372 l 0 486 l -1 608 l 221 440 l 221 302 "},"©":{x_min:-3,x_max:1008,ha:1106,o:"m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 741 394 q 661 246 731 302 q 496 190 591 190 q 294 285 369 190 q 228 497 228 370 q 295 714 228 625 q 499 813 370 813 q 656 762 588 813 q 733 625 724 711 l 634 625 q 589 704 629 673 q 498 735 550 735 q 377 666 421 735 q 334 504 334 597 q 374 340 334 408 q 490 272 415 272 q 589 304 549 272 q 638 394 628 337 l 741 394 "},"ώ":{x_min:0,x_max:922,ha:1030,o:"m 687 1040 l 498 819 l 415 819 l 549 1040 l 687 1040 m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 338 0 202 q 45 551 0 444 q 161 737 84 643 l 302 737 q 175 552 219 647 q 124 336 124 446 q 155 179 124 248 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 341 797 257 q 745 555 797 450 q 619 737 705 637 l 760 737 q 874 551 835 640 q 922 339 922 444 "},"^":{x_min:193.0625,x_max:598.609375,ha:792,o:"m 598 772 l 515 772 l 395 931 l 277 772 l 193 772 l 326 1013 l 462 1013 l 598 772 "},"«":{x_min:0,x_max:507.203125,ha:604,o:"m 506 136 l 284 302 l 284 440 l 506 608 l 507 485 l 360 371 l 506 255 l 506 136 m 222 136 l 0 302 l 0 440 l 222 608 l 221 486 l 73 373 l 222 256 l 222 136 "},D:{x_min:0,x_max:828,ha:935,o:"m 389 1013 q 714 867 593 1013 q 828 521 828 729 q 712 161 828 309 q 382 0 587 0 l 0 0 l 0 1013 l 389 1013 m 376 124 q 607 247 523 124 q 681 510 681 355 q 607 771 681 662 q 376 896 522 896 l 139 896 l 139 124 l 376 124 "},"∙":{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:0,x_max:47,ha:125,o:"m 47 3 q 37 -7 47 -7 q 28 0 30 -7 q 39 -4 32 -4 q 45 3 45 -1 l 37 0 q 28 9 28 0 q 39 19 28 19 l 47 16 l 47 19 l 47 3 m 37 1 q 44 8 44 1 q 37 16 44 16 q 30 8 30 16 q 37 1 30 1 m 26 1 l 23 22 l 14 0 l 3 22 l 3 3 l 0 25 l 13 1 l 22 25 l 26 1 "},w:{x_min:0,x_max:1009.71875,ha:1100,o:"m 1009 738 l 783 0 l 658 0 l 501 567 l 345 0 l 222 0 l 0 738 l 130 738 l 284 174 l 432 737 l 576 738 l 721 173 l 881 737 l 1009 738 "},$:{x_min:0,x_max:700,ha:793,o:"m 664 717 l 542 717 q 490 825 531 785 q 381 872 450 865 l 381 551 q 620 446 540 522 q 700 241 700 370 q 618 45 700 116 q 381 -25 536 -25 l 381 -152 l 307 -152 l 307 -25 q 81 62 162 -25 q 0 297 0 149 l 124 297 q 169 146 124 204 q 307 81 215 89 l 307 441 q 80 536 148 469 q 13 725 13 603 q 96 910 13 839 q 307 982 180 982 l 307 1077 l 381 1077 l 381 982 q 574 917 494 982 q 664 717 664 845 m 307 565 l 307 872 q 187 831 233 872 q 142 724 142 791 q 180 618 142 656 q 307 565 218 580 m 381 76 q 562 237 562 96 q 517 361 562 313 q 381 423 472 409 l 381 76 "},"\\":{x_min:-.015625,x_max:425.0625,ha:522,o:"m 425 -129 l 337 -129 l 0 1041 l 83 1041 l 425 -129 "},"µ":{x_min:0,x_max:697.21875,ha:747,o:"m 697 -4 q 629 -14 658 -14 q 498 97 513 -14 q 422 9 470 41 q 313 -23 374 -23 q 207 4 258 -23 q 119 81 156 32 l 119 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 173 124 246 q 308 83 216 83 q 452 178 402 83 q 493 359 493 255 l 493 738 l 617 738 l 617 214 q 623 136 617 160 q 673 92 637 92 q 697 96 684 92 l 697 -4 "},"Ι":{x_min:42,x_max:181,ha:297,o:"m 181 0 l 42 0 l 42 1013 l 181 1013 l 181 0 "},"Ύ":{x_min:0,x_max:1144.5,ha:1214,o:"m 1144 1012 l 807 416 l 807 0 l 667 0 l 667 416 l 325 1012 l 465 1012 l 736 533 l 1004 1012 l 1144 1012 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"Ν":{x_min:0,x_max:801,ha:915,o:"m 801 0 l 651 0 l 131 822 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 191 l 670 1013 l 801 1013 l 801 0 "},"-":{x_min:8.71875,x_max:350.390625,ha:478,o:"m 350 317 l 8 317 l 8 428 l 350 428 l 350 317 "},Q:{x_min:0,x_max:968,ha:1072,o:"m 954 5 l 887 -79 l 744 35 q 622 -11 687 2 q 483 -26 556 -26 q 127 130 262 -26 q 0 504 0 279 q 127 880 0 728 q 484 1041 262 1041 q 841 884 708 1041 q 968 507 968 735 q 933 293 968 398 q 832 104 899 188 l 954 5 m 723 191 q 802 330 777 248 q 828 499 828 412 q 744 790 828 673 q 483 922 650 922 q 228 791 322 922 q 142 505 142 673 q 227 221 142 337 q 487 91 323 91 q 632 123 566 91 l 520 215 l 587 301 l 723 191 "},"ς":{x_min:1,x_max:676.28125,ha:740,o:"m 676 460 l 551 460 q 498 595 542 546 q 365 651 448 651 q 199 578 263 651 q 136 401 136 505 q 266 178 136 241 q 508 106 387 142 q 640 -50 640 62 q 625 -158 640 -105 q 583 -278 611 -211 l 465 -278 q 498 -182 490 -211 q 515 -80 515 -126 q 381 12 515 -15 q 134 91 197 51 q 1 388 1 179 q 100 651 1 542 q 354 761 199 761 q 587 680 498 761 q 676 460 676 599 "},M:{x_min:0,x_max:954,ha:1067,o:"m 954 0 l 819 0 l 819 869 l 537 0 l 405 0 l 128 866 l 128 0 l 0 0 l 0 1013 l 200 1013 l 472 160 l 757 1013 l 954 1013 l 954 0 "},"Ψ":{x_min:0,x_max:1006,ha:1094,o:"m 1006 678 q 914 319 1006 429 q 571 200 814 200 l 571 0 l 433 0 l 433 200 q 92 319 194 200 q 0 678 0 429 l 0 1013 l 139 1013 l 139 679 q 191 417 139 492 q 433 326 255 326 l 433 1013 l 571 1013 l 571 326 l 580 326 q 813 423 747 326 q 868 679 868 502 l 868 1013 l 1006 1013 l 1006 678 "},C:{x_min:0,x_max:886,ha:944,o:"m 886 379 q 760 87 886 201 q 455 -26 634 -26 q 112 136 236 -26 q 0 509 0 283 q 118 882 0 737 q 469 1041 245 1041 q 748 955 630 1041 q 879 708 879 859 l 745 708 q 649 862 724 805 q 473 920 573 920 q 219 791 312 920 q 136 509 136 675 q 217 229 136 344 q 470 99 311 99 q 672 179 591 99 q 753 379 753 259 l 886 379 "},"!":{x_min:0,x_max:138,ha:236,o:"m 138 684 q 116 409 138 629 q 105 244 105 299 l 33 244 q 16 465 33 313 q 0 684 0 616 l 0 1013 l 138 1013 l 138 684 m 138 0 l 0 0 l 0 151 l 138 151 l 138 0 "},"{":{x_min:0,x_max:480.5625,ha:578,o:"m 480 -286 q 237 -213 303 -286 q 187 -45 187 -159 q 194 48 187 -15 q 201 141 201 112 q 164 264 201 225 q 0 314 118 314 l 0 417 q 164 471 119 417 q 201 605 201 514 q 199 665 201 644 q 193 772 193 769 q 241 941 193 887 q 480 1015 308 1015 l 480 915 q 336 866 375 915 q 306 742 306 828 q 310 662 306 717 q 314 577 314 606 q 288 452 314 500 q 176 365 256 391 q 289 275 257 337 q 314 143 314 226 q 313 84 314 107 q 310 -11 310 -5 q 339 -131 310 -94 q 480 -182 377 -182 l 480 -286 "},X:{x_min:-.015625,x_max:854.15625,ha:940,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 428 637 l 675 1013 l 836 1013 l 504 520 l 854 0 "},"#":{x_min:0,x_max:963.890625,ha:1061,o:"m 963 690 l 927 590 l 719 590 l 655 410 l 876 410 l 840 310 l 618 310 l 508 -3 l 393 -2 l 506 309 l 329 310 l 215 -2 l 102 -3 l 212 310 l 0 310 l 36 410 l 248 409 l 312 590 l 86 590 l 120 690 l 347 690 l 459 1006 l 573 1006 l 462 690 l 640 690 l 751 1006 l 865 1006 l 754 690 l 963 690 m 606 590 l 425 590 l 362 410 l 543 410 l 606 590 "},"ι":{x_min:42,x_max:284,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 738 l 167 738 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 "},"Ά":{x_min:0,x_max:906.953125,ha:982,o:"m 283 1040 l 88 799 l 5 799 l 145 1040 l 283 1040 m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1012 l 529 1012 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},")":{x_min:0,x_max:318,ha:415,o:"m 318 365 q 257 25 318 191 q 87 -290 197 -141 l 0 -290 q 140 21 93 -128 q 193 360 193 189 q 141 704 193 537 q 0 1024 97 850 l 87 1024 q 257 706 197 871 q 318 365 318 542 "},"ε":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 314 0 265 q 128 390 67 353 q 56 460 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 "},"Δ":{x_min:0,x_max:952.78125,ha:1028,o:"m 952 0 l 0 0 l 400 1013 l 551 1013 l 952 0 m 762 124 l 476 867 l 187 124 l 762 124 "},"}":{x_min:0,x_max:481,ha:578,o:"m 481 314 q 318 262 364 314 q 282 136 282 222 q 284 65 282 97 q 293 -58 293 -48 q 241 -217 293 -166 q 0 -286 174 -286 l 0 -182 q 143 -130 105 -182 q 171 -2 171 -93 q 168 81 171 22 q 165 144 165 140 q 188 275 165 229 q 306 365 220 339 q 191 455 224 391 q 165 588 165 505 q 168 681 165 624 q 171 742 171 737 q 141 865 171 827 q 0 915 102 915 l 0 1015 q 243 942 176 1015 q 293 773 293 888 q 287 675 293 741 q 282 590 282 608 q 318 466 282 505 q 481 417 364 417 l 481 314 "},"‰":{x_min:-3,x_max:1672,ha:1821,o:"m 846 0 q 664 76 732 0 q 603 244 603 145 q 662 412 603 344 q 846 489 729 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 846 0 962 0 m 845 103 q 945 143 910 103 q 981 243 981 184 q 947 340 981 301 q 845 385 910 385 q 745 342 782 385 q 709 243 709 300 q 742 147 709 186 q 845 103 781 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 m 1428 0 q 1246 76 1314 0 q 1185 244 1185 145 q 1244 412 1185 344 q 1428 489 1311 489 q 1610 412 1542 489 q 1672 244 1672 343 q 1612 76 1672 144 q 1428 0 1545 0 m 1427 103 q 1528 143 1492 103 q 1564 243 1564 184 q 1530 340 1564 301 q 1427 385 1492 385 q 1327 342 1364 385 q 1291 243 1291 300 q 1324 147 1291 186 q 1427 103 1363 103 "},a:{x_min:0,x_max:698.609375,ha:794,o:"m 698 0 q 661 -12 679 -7 q 615 -17 643 -17 q 536 12 564 -17 q 500 96 508 41 q 384 6 456 37 q 236 -25 312 -25 q 65 31 130 -25 q 0 194 0 88 q 118 390 0 334 q 328 435 180 420 q 488 483 476 451 q 495 523 495 504 q 442 619 495 584 q 325 654 389 654 q 209 617 257 654 q 152 513 161 580 l 33 513 q 123 705 33 633 q 332 772 207 772 q 528 712 448 772 q 617 531 617 645 l 617 163 q 624 108 617 126 q 664 90 632 90 l 698 94 l 698 0 m 491 262 l 491 372 q 272 329 350 347 q 128 201 128 294 q 166 113 128 144 q 264 83 205 83 q 414 130 346 83 q 491 262 491 183 "},"—":{x_min:0,x_max:941.671875,ha:1039,o:"m 941 334 l 0 334 l 0 410 l 941 410 l 941 334 "},"=":{x_min:8.71875,x_max:780.953125,ha:792,o:"m 780 510 l 8 510 l 8 606 l 780 606 l 780 510 m 780 235 l 8 235 l 8 332 l 780 332 l 780 235 "},N:{x_min:0,x_max:801,ha:914,o:"m 801 0 l 651 0 l 131 823 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 193 l 670 1013 l 801 1013 l 801 0 "},"ρ":{x_min:0,x_max:712,ha:797,o:"m 712 369 q 620 94 712 207 q 362 -26 521 -26 q 230 2 292 -26 q 119 83 167 30 l 119 -278 l 0 -278 l 0 362 q 91 643 0 531 q 355 764 190 764 q 617 647 517 764 q 712 369 712 536 m 583 366 q 530 559 583 480 q 359 651 469 651 q 190 562 252 651 q 135 370 135 483 q 189 176 135 257 q 359 85 250 85 q 528 175 466 85 q 583 366 583 254 "},"¯":{x_min:0,x_max:941.671875,ha:938,o:"m 941 1033 l 0 1033 l 0 1109 l 941 1109 l 941 1033 "},Z:{x_min:0,x_max:779,ha:849,o:"m 779 0 l 0 0 l 0 113 l 621 896 l 40 896 l 40 1013 l 779 1013 l 778 887 l 171 124 l 779 124 l 779 0 "},u:{x_min:0,x_max:617,ha:729,o:"m 617 0 l 499 0 l 499 110 q 391 10 460 45 q 246 -25 322 -25 q 61 58 127 -25 q 0 258 0 136 l 0 738 l 125 738 l 125 284 q 156 148 125 202 q 273 82 197 82 q 433 165 369 82 q 493 340 493 243 l 493 738 l 617 738 l 617 0 "},k:{x_min:0,x_max:612.484375,ha:697,o:"m 612 738 l 338 465 l 608 0 l 469 0 l 251 382 l 121 251 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 402 l 456 738 l 612 738 "},"Η":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"Α":{x_min:0,x_max:906.953125,ha:985,o:"m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},s:{x_min:0,x_max:604,ha:697,o:"m 604 217 q 501 36 604 104 q 292 -23 411 -23 q 86 43 166 -23 q 0 238 0 114 l 121 237 q 175 122 121 164 q 300 85 223 85 q 415 112 363 85 q 479 207 479 147 q 361 309 479 276 q 140 372 141 370 q 21 544 21 426 q 111 708 21 647 q 298 761 190 761 q 492 705 413 761 q 583 531 583 643 l 462 531 q 412 625 462 594 q 298 657 363 657 q 199 636 242 657 q 143 558 143 608 q 262 454 143 486 q 484 394 479 397 q 604 217 604 341 "},B:{x_min:0,x_max:778,ha:876,o:"m 580 546 q 724 469 670 535 q 778 311 778 403 q 673 83 778 171 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 892 q 691 633 732 693 q 580 546 650 572 m 393 899 l 139 899 l 139 588 l 379 588 q 521 624 462 588 q 592 744 592 667 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 303 635 219 q 559 436 635 389 q 402 477 494 477 l 139 477 l 139 124 l 419 124 "},"…":{x_min:0,x_max:614,ha:708,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 m 378 0 l 236 0 l 236 151 l 378 151 l 378 0 m 614 0 l 472 0 l 472 151 l 614 151 l 614 0 "},"?":{x_min:0,x_max:607,ha:704,o:"m 607 777 q 543 599 607 674 q 422 474 482 537 q 357 272 357 391 l 236 272 q 297 487 236 395 q 411 619 298 490 q 474 762 474 691 q 422 885 474 838 q 301 933 371 933 q 179 880 228 933 q 124 706 124 819 l 0 706 q 94 963 0 872 q 302 1044 177 1044 q 511 973 423 1044 q 607 777 607 895 m 370 0 l 230 0 l 230 151 l 370 151 l 370 0 "},H:{x_min:0,x_max:803,ha:915,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"ν":{x_min:0,x_max:675,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 738 l 340 147 l 541 738 l 675 738 "},c:{x_min:1,x_max:701.390625,ha:775,o:"m 701 264 q 584 53 681 133 q 353 -26 487 -26 q 91 91 188 -26 q 1 370 1 201 q 92 645 1 537 q 353 761 190 761 q 572 688 479 761 q 690 493 666 615 l 556 493 q 487 606 545 562 q 356 650 428 650 q 186 563 246 650 q 134 372 134 487 q 188 179 134 258 q 359 88 250 88 q 492 136 437 88 q 566 264 548 185 l 701 264 "},"¶":{x_min:0,x_max:566.671875,ha:678,o:"m 21 892 l 52 892 l 98 761 l 145 892 l 176 892 l 178 741 l 157 741 l 157 867 l 108 741 l 88 741 l 40 871 l 40 741 l 21 741 l 21 892 m 308 854 l 308 731 q 252 691 308 691 q 227 691 240 691 q 207 696 213 695 l 207 712 l 253 706 q 288 733 288 706 l 288 763 q 244 741 279 741 q 193 797 193 741 q 261 860 193 860 q 287 860 273 860 q 308 854 302 855 m 288 842 l 263 843 q 213 796 213 843 q 248 756 213 756 q 288 796 288 756 l 288 842 m 566 988 l 502 988 l 502 -1 l 439 -1 l 439 988 l 317 988 l 317 -1 l 252 -1 l 252 602 q 81 653 155 602 q 0 805 0 711 q 101 989 0 918 q 309 1053 194 1053 l 566 1053 l 566 988 "},"β":{x_min:0,x_max:660,ha:745,o:"m 471 550 q 610 450 561 522 q 660 280 660 378 q 578 64 660 151 q 367 -22 497 -22 q 239 5 299 -22 q 126 82 178 32 l 126 -278 l 0 -278 l 0 593 q 54 903 0 801 q 318 1042 127 1042 q 519 964 436 1042 q 603 771 603 887 q 567 644 603 701 q 471 550 532 586 m 337 79 q 476 138 418 79 q 535 279 535 198 q 427 437 535 386 q 226 477 344 477 l 226 583 q 398 620 329 583 q 486 762 486 668 q 435 884 486 833 q 312 935 384 935 q 169 861 219 935 q 126 698 126 797 l 126 362 q 170 169 126 242 q 337 79 224 79 "},"Μ":{x_min:0,x_max:954,ha:1068,o:"m 954 0 l 819 0 l 819 868 l 537 0 l 405 0 l 128 865 l 128 0 l 0 0 l 0 1013 l 199 1013 l 472 158 l 758 1013 l 954 1013 l 954 0 "},"Ό":{x_min:.109375,x_max:1120,ha:1217,o:"m 1120 505 q 994 132 1120 282 q 642 -29 861 -29 q 290 130 422 -29 q 167 505 167 280 q 294 883 167 730 q 650 1046 430 1046 q 999 882 868 1046 q 1120 505 1120 730 m 977 504 q 896 784 977 669 q 644 915 804 915 q 391 785 484 915 q 307 504 307 669 q 391 224 307 339 q 644 95 486 95 q 894 224 803 95 q 977 504 977 339 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Ή":{x_min:0,x_max:1158,ha:1275,o:"m 1158 0 l 1022 0 l 1022 475 l 496 475 l 496 0 l 356 0 l 356 1012 l 496 1012 l 496 599 l 1022 599 l 1022 1012 l 1158 1012 l 1158 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"•":{x_min:0,x_max:663.890625,ha:775,o:"m 663 529 q 566 293 663 391 q 331 196 469 196 q 97 294 194 196 q 0 529 0 393 q 96 763 0 665 q 331 861 193 861 q 566 763 469 861 q 663 529 663 665 "},"¥":{x_min:.1875,x_max:819.546875,ha:886,o:"m 563 561 l 697 561 l 696 487 l 520 487 l 482 416 l 482 380 l 697 380 l 695 308 l 482 308 l 482 0 l 342 0 l 342 308 l 125 308 l 125 380 l 342 380 l 342 417 l 303 487 l 125 487 l 125 561 l 258 561 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 l 563 561 "},"(":{x_min:0,x_max:318.0625,ha:415,o:"m 318 -290 l 230 -290 q 61 23 122 -142 q 0 365 0 190 q 62 712 0 540 q 230 1024 119 869 l 318 1024 q 175 705 219 853 q 125 360 125 542 q 176 22 125 187 q 318 -290 223 -127 "},U:{x_min:0,x_max:796,ha:904,o:"m 796 393 q 681 93 796 212 q 386 -25 566 -25 q 101 95 208 -25 q 0 393 0 211 l 0 1013 l 138 1013 l 138 391 q 204 191 138 270 q 394 107 276 107 q 586 191 512 107 q 656 391 656 270 l 656 1013 l 796 1013 l 796 393 "},"γ":{x_min:.5,x_max:744.953125,ha:822,o:"m 744 737 l 463 54 l 463 -278 l 338 -278 l 338 54 l 154 495 q 104 597 124 569 q 13 651 67 651 l 0 651 l 0 751 l 39 753 q 168 711 121 753 q 242 594 207 676 l 403 208 l 617 737 l 744 737 "},"α":{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 728 407 760 q 563 637 524 696 l 563 739 l 685 739 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 96 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 "},F:{x_min:0,x_max:683.328125,ha:717,o:"m 683 888 l 140 888 l 140 583 l 613 583 l 613 458 l 140 458 l 140 0 l 0 0 l 0 1013 l 683 1013 l 683 888 "},"­":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},":":{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 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"Χ":{x_min:0,x_max:854.171875,ha:935,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 427 637 l 675 1013 l 836 1013 l 504 521 l 854 0 "},"*":{x_min:116,x_max:674,ha:792,o:"m 674 768 l 475 713 l 610 544 l 517 477 l 394 652 l 272 478 l 178 544 l 314 713 l 116 766 l 153 876 l 341 812 l 342 1013 l 446 1013 l 446 811 l 635 874 l 674 768 "},"†":{x_min:0,x_max:777,ha:835,o:"m 458 804 l 777 804 l 777 683 l 458 683 l 458 0 l 319 0 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 "},"°":{x_min:0,x_max:347,ha:444,o:"m 173 802 q 43 856 91 802 q 0 977 0 905 q 45 1101 0 1049 q 173 1153 90 1153 q 303 1098 255 1153 q 347 977 347 1049 q 303 856 347 905 q 173 802 256 802 m 173 884 q 238 910 214 884 q 262 973 262 937 q 239 1038 262 1012 q 173 1064 217 1064 q 108 1037 132 1064 q 85 973 85 1010 q 108 910 85 937 q 173 884 132 884 "},V:{x_min:0,x_max:862.71875,ha:940,o:"m 862 1013 l 505 0 l 361 0 l 0 1013 l 143 1013 l 434 165 l 718 1012 l 862 1013 "},"Ξ":{x_min:0,x_max:734.71875,ha:763,o:"m 723 889 l 9 889 l 9 1013 l 723 1013 l 723 889 m 673 463 l 61 463 l 61 589 l 673 589 l 673 463 m 734 0 l 0 0 l 0 124 l 734 124 l 734 0 "}," ":{x_min:0,x_max:0,ha:853},"Ϋ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 588 1046 l 460 1046 l 460 1189 l 588 1189 l 588 1046 m 360 1046 l 232 1046 l 232 1189 l 360 1189 l 360 1046 m 819 1012 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1012 l 140 1012 l 411 533 l 679 1012 l 819 1012 "},"”":{x_min:0,x_max:347,ha:454,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 m 347 851 q 310 737 347 784 q 208 669 273 690 l 208 734 q 267 787 250 741 q 280 873 280 821 l 208 873 l 208 1013 l 347 1013 l 347 851 "},"@":{x_min:0,x_max:1260,ha:1357,o:"m 1098 -45 q 877 -160 1001 -117 q 633 -203 752 -203 q 155 -29 327 -203 q 0 360 0 127 q 176 802 0 616 q 687 1008 372 1008 q 1123 854 969 1008 q 1260 517 1260 718 q 1155 216 1260 341 q 868 82 1044 82 q 772 106 801 82 q 737 202 737 135 q 647 113 700 144 q 527 82 594 82 q 367 147 420 82 q 314 312 314 212 q 401 565 314 452 q 639 690 498 690 q 810 588 760 690 l 849 668 l 938 668 q 877 441 900 532 q 833 226 833 268 q 853 182 833 198 q 902 167 873 167 q 1088 272 1012 167 q 1159 512 1159 372 q 1051 793 1159 681 q 687 925 925 925 q 248 747 415 925 q 97 361 97 586 q 226 26 97 159 q 627 -122 370 -122 q 856 -87 737 -122 q 1061 8 976 -53 l 1098 -45 m 786 488 q 738 580 777 545 q 643 615 700 615 q 483 517 548 615 q 425 322 425 430 q 457 203 425 250 q 552 156 490 156 q 722 273 665 156 q 786 488 738 309 "},"Ί":{x_min:0,x_max:499,ha:613,o:"m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 m 499 0 l 360 0 l 360 1012 l 499 1012 l 499 0 "},i:{x_min:14,x_max:136,ha:275,o:"m 136 873 l 14 873 l 14 1013 l 136 1013 l 136 873 m 136 0 l 14 0 l 14 737 l 136 737 l 136 0 "},"Β":{x_min:0,x_max:778,ha:877,o:"m 580 545 q 724 468 671 534 q 778 310 778 402 q 673 83 778 170 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 891 q 691 632 732 692 q 580 545 650 571 m 393 899 l 139 899 l 139 587 l 379 587 q 521 623 462 587 q 592 744 592 666 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 302 635 219 q 559 435 635 388 q 402 476 494 476 l 139 476 l 139 124 l 419 124 "},"υ":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 94 617 199 q 308 -24 455 -24 q 76 94 161 -24 q 0 352 0 199 l 0 739 l 126 739 l 126 355 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 355 492 257 l 492 739 l 617 739 l 617 352 "},"]":{x_min:0,x_max:275,ha:372,o:"m 275 -281 l 0 -281 l 0 -187 l 151 -187 l 151 920 l 0 920 l 0 1013 l 275 1013 l 275 -281 "},m:{x_min:0,x_max:1019,ha:1128,o:"m 1019 0 l 897 0 l 897 454 q 860 591 897 536 q 739 660 816 660 q 613 586 659 660 q 573 436 573 522 l 573 0 l 447 0 l 447 455 q 412 591 447 535 q 294 657 372 657 q 165 586 213 657 q 122 437 122 521 l 122 0 l 0 0 l 0 738 l 117 738 l 117 640 q 202 730 150 697 q 316 763 254 763 q 437 730 381 763 q 525 642 494 697 q 621 731 559 700 q 753 763 682 763 q 943 694 867 763 q 1019 512 1019 625 l 1019 0 "},"χ":{x_min:8.328125,x_max:780.5625,ha:815,o:"m 780 -278 q 715 -294 747 -294 q 616 -257 663 -294 q 548 -175 576 -227 l 379 133 l 143 -277 l 9 -277 l 313 254 l 163 522 q 127 586 131 580 q 36 640 91 640 q 8 637 27 640 l 8 752 l 52 757 q 162 719 113 757 q 236 627 200 690 l 383 372 l 594 737 l 726 737 l 448 250 l 625 -69 q 670 -153 647 -110 q 743 -188 695 -188 q 780 -184 759 -188 l 780 -278 "},"ί":{x_min:42,x_max:326.71875,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 102 239 101 q 284 112 257 104 l 284 3 m 326 1040 l 137 819 l 54 819 l 189 1040 l 326 1040 "},"Ζ":{x_min:0,x_max:779.171875,ha:850,o:"m 779 0 l 0 0 l 0 113 l 620 896 l 40 896 l 40 1013 l 779 1013 l 779 887 l 170 124 l 779 124 l 779 0 "},R:{x_min:0,x_max:781.953125,ha:907,o:"m 781 0 l 623 0 q 587 242 590 52 q 407 433 585 433 l 138 433 l 138 0 l 0 0 l 0 1013 l 396 1013 q 636 946 539 1013 q 749 731 749 868 q 711 597 749 659 q 608 502 674 534 q 718 370 696 474 q 729 207 722 352 q 781 26 736 62 l 781 0 m 373 551 q 533 594 465 551 q 614 731 614 645 q 532 859 614 815 q 373 896 465 896 l 138 896 l 138 551 l 373 551 "},o:{x_min:0,x_max:713,ha:821,o:"m 357 -25 q 94 91 194 -25 q 0 368 0 202 q 93 642 0 533 q 357 761 193 761 q 618 644 518 761 q 713 368 713 533 q 619 91 713 201 q 357 -25 521 -25 m 357 85 q 528 175 465 85 q 584 369 584 255 q 529 562 584 484 q 357 651 467 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 357 85 250 85 "},K:{x_min:0,x_max:819.46875,ha:906,o:"m 819 0 l 649 0 l 294 509 l 139 355 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},",":{x_min:0,x_max:142,ha:239,o:"m 142 -12 q 105 -132 142 -82 q 0 -205 68 -182 l 0 -138 q 57 -82 40 -124 q 70 0 70 -51 l 0 0 l 0 151 l 142 151 l 142 -12 "},d:{x_min:0,x_max:683,ha:796,o:"m 683 0 l 564 0 l 564 93 q 456 6 516 38 q 327 -25 395 -25 q 87 100 181 -25 q 0 365 0 215 q 90 639 0 525 q 343 763 187 763 q 564 647 486 763 l 564 1013 l 683 1013 l 683 0 m 582 373 q 529 562 582 484 q 361 653 468 653 q 190 561 253 653 q 135 365 135 479 q 189 175 135 254 q 358 85 251 85 q 529 178 468 85 q 582 373 582 258 "},"¨":{x_min:-109,x_max:247,ha:232,o:"m 247 1046 l 119 1046 l 119 1189 l 247 1189 l 247 1046 m 19 1046 l -109 1046 l -109 1189 l 19 1189 l 19 1046 "},E:{x_min:0,x_max:736.109375,ha:789,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},Y:{x_min:0,x_max:820,ha:886,o:"m 820 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 534 l 679 1012 l 820 1013 "},'"':{x_min:0,x_max:299,ha:396,o:"m 299 606 l 203 606 l 203 988 l 299 988 l 299 606 m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"„":{x_min:0,x_max:364,ha:467,o:"m 141 -12 q 104 -132 141 -82 q 0 -205 67 -182 l 0 -138 q 56 -82 40 -124 q 69 0 69 -51 l 0 0 l 0 151 l 141 151 l 141 -12 m 364 -12 q 327 -132 364 -82 q 222 -205 290 -182 l 222 -138 q 279 -82 262 -124 q 292 0 292 -51 l 222 0 l 222 151 l 364 151 l 364 -12 "},"δ":{x_min:1,x_max:710,ha:810,o:"m 710 360 q 616 87 710 196 q 356 -28 518 -28 q 99 82 197 -28 q 1 356 1 192 q 100 606 1 509 q 355 703 199 703 q 180 829 288 754 q 70 903 124 866 l 70 1012 l 643 1012 l 643 901 l 258 901 q 462 763 422 794 q 636 592 577 677 q 710 360 710 485 m 584 365 q 552 501 584 447 q 451 602 521 555 q 372 611 411 611 q 197 541 258 611 q 136 355 136 472 q 190 171 136 245 q 358 85 252 85 q 528 173 465 85 q 584 365 584 252 "},"έ":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 313 0 265 q 128 390 67 352 q 56 459 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 m 520 1040 l 331 819 l 248 819 l 383 1040 l 520 1040 "},"ω":{x_min:0,x_max:922,ha:1031,o:"m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 339 0 203 q 45 551 0 444 q 161 738 84 643 l 302 738 q 175 553 219 647 q 124 336 124 446 q 155 179 124 249 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 342 797 257 q 745 556 797 450 q 619 738 705 638 l 760 738 q 874 551 835 640 q 922 339 922 444 "},"´":{x_min:0,x_max:96,ha:251,o:"m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"±":{x_min:11,x_max:781,ha:792,o:"m 781 490 l 446 490 l 446 255 l 349 255 l 349 490 l 11 490 l 11 586 l 349 586 l 349 819 l 446 819 l 446 586 l 781 586 l 781 490 m 781 21 l 11 21 l 11 115 l 781 115 l 781 21 "},"|":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"ϋ":{x_min:0,x_max:617,ha:725,o:"m 482 800 l 372 800 l 372 925 l 482 925 l 482 800 m 239 800 l 129 800 l 129 925 l 239 925 l 239 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 "},"§":{x_min:0,x_max:593,ha:690,o:"m 593 425 q 554 312 593 369 q 467 233 516 254 q 537 83 537 172 q 459 -74 537 -12 q 288 -133 387 -133 q 115 -69 184 -133 q 47 96 47 -6 l 166 96 q 199 7 166 40 q 288 -26 232 -26 q 371 -5 332 -26 q 420 60 420 21 q 311 201 420 139 q 108 309 210 255 q 0 490 0 383 q 33 602 0 551 q 124 687 66 654 q 75 743 93 712 q 58 812 58 773 q 133 984 58 920 q 300 1043 201 1043 q 458 987 394 1043 q 529 814 529 925 l 411 814 q 370 908 404 877 q 289 939 336 939 q 213 911 246 939 q 180 841 180 883 q 286 720 180 779 q 484 612 480 615 q 593 425 593 534 m 467 409 q 355 544 467 473 q 196 630 228 612 q 146 587 162 609 q 124 525 124 558 q 239 387 124 462 q 398 298 369 315 q 448 345 429 316 q 467 409 467 375 "},b:{x_min:0,x_max:685,ha:783,o:"m 685 372 q 597 99 685 213 q 347 -25 501 -25 q 219 5 277 -25 q 121 93 161 36 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 634 q 214 723 157 692 q 341 754 272 754 q 591 637 493 754 q 685 372 685 526 m 554 356 q 499 550 554 470 q 328 644 437 644 q 162 556 223 644 q 108 369 108 478 q 160 176 108 256 q 330 83 221 83 q 498 169 435 83 q 554 356 554 245 "},q:{x_min:0,x_max:683,ha:876,o:"m 683 -278 l 564 -278 l 564 97 q 474 8 533 39 q 345 -23 415 -23 q 91 93 188 -23 q 0 364 0 203 q 87 635 0 522 q 337 760 184 760 q 466 727 408 760 q 564 637 523 695 l 564 737 l 683 737 l 683 -278 m 582 375 q 527 564 582 488 q 358 652 466 652 q 190 565 253 652 q 135 377 135 488 q 189 179 135 261 q 361 84 251 84 q 530 179 469 84 q 582 375 582 260 "},"Ω":{x_min:-.171875,x_max:969.5625,ha:1068,o:"m 969 0 l 555 0 l 555 123 q 744 308 675 194 q 814 558 814 423 q 726 812 814 709 q 484 922 633 922 q 244 820 334 922 q 154 567 154 719 q 223 316 154 433 q 412 123 292 199 l 412 0 l 0 0 l 0 124 l 217 124 q 68 327 122 210 q 15 572 15 444 q 144 911 15 781 q 484 1041 274 1041 q 822 909 691 1041 q 953 569 953 777 q 899 326 953 443 q 750 124 846 210 l 969 124 l 969 0 "},"ύ":{x_min:0,x_max:617,ha:725,o:"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 535 1040 l 346 819 l 262 819 l 397 1040 l 535 1040 "},z:{x_min:-.015625,x_max:613.890625,ha:697,o:"m 613 0 l 0 0 l 0 100 l 433 630 l 20 630 l 20 738 l 594 738 l 593 636 l 163 110 l 613 110 l 613 0 "},"™":{x_min:0,x_max:894,ha:1e3,o:"m 389 951 l 229 951 l 229 503 l 160 503 l 160 951 l 0 951 l 0 1011 l 389 1011 l 389 951 m 894 503 l 827 503 l 827 939 l 685 503 l 620 503 l 481 937 l 481 503 l 417 503 l 417 1011 l 517 1011 l 653 580 l 796 1010 l 894 1011 l 894 503 "},"ή":{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 721 124 755 q 200 630 193 687 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 m 479 1040 l 290 819 l 207 819 l 341 1040 l 479 1040 "},"Θ":{x_min:0,x_max:960,ha:1056,o:"m 960 507 q 833 129 960 280 q 476 -32 698 -32 q 123 129 255 -32 q 0 507 0 280 q 123 883 0 732 q 476 1045 255 1045 q 832 883 696 1045 q 960 507 960 732 m 817 500 q 733 789 817 669 q 476 924 639 924 q 223 792 317 924 q 142 507 142 675 q 222 222 142 339 q 476 89 315 89 q 730 218 636 89 q 817 500 817 334 m 716 449 l 243 449 l 243 571 l 716 571 l 716 449 "},"®":{x_min:-3,x_max:1008,ha:1106,o:"m 503 532 q 614 562 566 532 q 672 658 672 598 q 614 747 672 716 q 503 772 569 772 l 338 772 l 338 532 l 503 532 m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 788 146 l 678 146 q 653 316 655 183 q 527 449 652 449 l 338 449 l 338 146 l 241 146 l 241 854 l 518 854 q 688 808 621 854 q 766 658 766 755 q 739 563 766 607 q 668 497 713 519 q 751 331 747 472 q 788 164 756 190 l 788 146 "},"~":{x_min:0,x_max:833,ha:931,o:"m 833 958 q 778 753 833 831 q 594 665 716 665 q 402 761 502 665 q 240 857 302 857 q 131 795 166 857 q 104 665 104 745 l 0 665 q 54 867 0 789 q 237 958 116 958 q 429 861 331 958 q 594 765 527 765 q 704 827 670 765 q 729 958 729 874 l 833 958 "},"Ε":{x_min:0,x_max:736.21875,ha:778,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},"³":{x_min:0,x_max:450,ha:547,o:"m 450 552 q 379 413 450 464 q 220 366 313 366 q 69 414 130 366 q 0 567 0 470 l 85 567 q 126 470 85 504 q 225 437 168 437 q 320 467 280 437 q 360 552 360 498 q 318 632 360 608 q 213 657 276 657 q 195 657 203 657 q 176 657 181 657 l 176 722 q 279 733 249 722 q 334 815 334 752 q 300 881 334 856 q 220 907 267 907 q 133 875 169 907 q 97 781 97 844 l 15 781 q 78 926 15 875 q 220 972 135 972 q 364 930 303 972 q 426 817 426 888 q 344 697 426 733 q 421 642 392 681 q 450 552 450 603 "},"[":{x_min:0,x_max:273.609375,ha:371,o:"m 273 -281 l 0 -281 l 0 1013 l 273 1013 l 273 920 l 124 920 l 124 -187 l 273 -187 l 273 -281 "},L:{x_min:0,x_max:645.828125,ha:696,o:"m 645 0 l 0 0 l 0 1013 l 140 1013 l 140 126 l 645 126 l 645 0 "},"σ":{x_min:0,x_max:803.390625,ha:894,o:"m 803 628 l 633 628 q 713 368 713 512 q 618 93 713 204 q 357 -25 518 -25 q 94 91 194 -25 q 0 368 0 201 q 94 644 0 533 q 356 761 194 761 q 481 750 398 761 q 608 739 564 739 l 803 739 l 803 628 m 360 85 q 529 180 467 85 q 584 374 584 262 q 527 566 584 490 q 352 651 463 651 q 187 559 247 651 q 135 368 135 478 q 189 175 135 254 q 360 85 251 85 "},"ζ":{x_min:0,x_max:573,ha:642,o:"m 573 -40 q 553 -162 573 -97 q 510 -278 543 -193 l 400 -278 q 441 -187 428 -219 q 462 -90 462 -132 q 378 -14 462 -14 q 108 45 197 -14 q 0 290 0 117 q 108 631 0 462 q 353 901 194 767 l 55 901 l 55 1012 l 561 1012 l 561 924 q 261 669 382 831 q 128 301 128 489 q 243 117 128 149 q 458 98 350 108 q 573 -40 573 80 "},"θ":{x_min:0,x_max:674,ha:778,o:"m 674 496 q 601 160 674 304 q 336 -26 508 -26 q 73 153 165 -26 q 0 485 0 296 q 72 840 0 683 q 343 1045 166 1045 q 605 844 516 1045 q 674 496 674 692 m 546 579 q 498 798 546 691 q 336 935 437 935 q 178 798 237 935 q 126 579 137 701 l 546 579 m 546 475 l 126 475 q 170 233 126 348 q 338 80 230 80 q 504 233 447 80 q 546 475 546 346 "},"Ο":{x_min:0,x_max:958,ha:1054,o:"m 485 1042 q 834 883 703 1042 q 958 511 958 735 q 834 136 958 287 q 481 -26 701 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 729 q 485 1042 263 1042 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 670 q 480 913 640 913 q 226 785 321 913 q 142 504 142 671 q 226 224 142 339 q 480 98 319 98 "},"Γ":{x_min:0,x_max:705.28125,ha:749,o:"m 705 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 705 1012 l 705 886 "}," ":{x_min:0,x_max:0,ha:375},"%":{x_min:-3,x_max:1089,ha:1186,o:"m 845 0 q 663 76 731 0 q 602 244 602 145 q 661 412 602 344 q 845 489 728 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 845 0 962 0 m 844 103 q 945 143 909 103 q 981 243 981 184 q 947 340 981 301 q 844 385 909 385 q 744 342 781 385 q 708 243 708 300 q 741 147 708 186 q 844 103 780 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 "},P:{x_min:0,x_max:726,ha:806,o:"m 424 1013 q 640 931 555 1013 q 726 719 726 850 q 637 506 726 587 q 413 426 548 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 379 889 l 140 889 l 140 548 l 372 548 q 522 589 459 548 q 593 720 593 637 q 528 845 593 801 q 379 889 463 889 "},"Έ":{x_min:0,x_max:1078.21875,ha:1118,o:"m 1078 0 l 342 0 l 342 1013 l 1067 1013 l 1067 889 l 481 889 l 481 585 l 1019 585 l 1019 467 l 481 467 l 481 125 l 1078 125 l 1078 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Ώ":{x_min:.125,x_max:1136.546875,ha:1235,o:"m 1136 0 l 722 0 l 722 123 q 911 309 842 194 q 981 558 981 423 q 893 813 981 710 q 651 923 800 923 q 411 821 501 923 q 321 568 321 720 q 390 316 321 433 q 579 123 459 200 l 579 0 l 166 0 l 166 124 l 384 124 q 235 327 289 210 q 182 572 182 444 q 311 912 182 782 q 651 1042 441 1042 q 989 910 858 1042 q 1120 569 1120 778 q 1066 326 1120 443 q 917 124 1013 210 l 1136 124 l 1136 0 m 277 1040 l 83 800 l 0 800 l 140 1041 l 277 1040 "},_:{x_min:0,x_max:705.5625,ha:803,o:"m 705 -334 l 0 -334 l 0 -234 l 705 -234 l 705 -334 "},"Ϊ":{x_min:-110,x_max:246,ha:275,o:"m 246 1046 l 118 1046 l 118 1189 l 246 1189 l 246 1046 m 18 1046 l -110 1046 l -110 1189 l 18 1189 l 18 1046 m 136 0 l 0 0 l 0 1012 l 136 1012 l 136 0 "},"+":{x_min:23,x_max:768,ha:792,o:"m 768 372 l 444 372 l 444 0 l 347 0 l 347 372 l 23 372 l 23 468 l 347 468 l 347 840 l 444 840 l 444 468 l 768 468 l 768 372 "},"½":{x_min:0,x_max:1050,ha:1149,o:"m 1050 0 l 625 0 q 712 178 625 108 q 878 277 722 187 q 967 385 967 328 q 932 456 967 429 q 850 484 897 484 q 759 450 798 484 q 721 352 721 416 l 640 352 q 706 502 640 448 q 851 551 766 551 q 987 509 931 551 q 1050 385 1050 462 q 976 251 1050 301 q 829 179 902 215 q 717 68 740 133 l 1050 68 l 1050 0 m 834 985 l 215 -28 l 130 -28 l 750 984 l 834 985 m 224 422 l 142 422 l 142 811 l 0 811 l 0 867 q 104 889 62 867 q 164 973 157 916 l 224 973 l 224 422 "},"Ρ":{x_min:0,x_max:720,ha:783,o:"m 424 1013 q 637 933 554 1013 q 720 723 720 853 q 633 508 720 591 q 413 426 546 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 378 889 l 140 889 l 140 548 l 371 548 q 521 589 458 548 q 592 720 592 637 q 527 845 592 801 q 378 889 463 889 "},"'":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"ª":{x_min:0,x_max:350,ha:397,o:"m 350 625 q 307 616 328 616 q 266 631 281 616 q 247 673 251 645 q 190 628 225 644 q 116 613 156 613 q 32 641 64 613 q 0 722 0 669 q 72 826 0 800 q 247 866 159 846 l 247 887 q 220 934 247 916 q 162 953 194 953 q 104 934 129 953 q 76 882 80 915 l 16 882 q 60 976 16 941 q 166 1011 104 1011 q 266 979 224 1011 q 308 891 308 948 l 308 706 q 311 679 308 688 q 331 670 315 670 l 350 672 l 350 625 m 247 757 l 247 811 q 136 790 175 798 q 64 726 64 773 q 83 682 64 697 q 132 667 103 667 q 207 690 174 667 q 247 757 247 718 "},"΅":{x_min:0,x_max:450,ha:553,o:"m 450 800 l 340 800 l 340 925 l 450 925 l 450 800 m 406 1040 l 212 800 l 129 800 l 269 1040 l 406 1040 m 110 800 l 0 800 l 0 925 l 110 925 l 110 800 "},T:{x_min:0,x_max:777,ha:835,o:"m 777 894 l 458 894 l 458 0 l 319 0 l 319 894 l 0 894 l 0 1013 l 777 1013 l 777 894 "},"Φ":{x_min:0,x_max:915,ha:997,o:"m 527 0 l 389 0 l 389 122 q 110 231 220 122 q 0 509 0 340 q 110 785 0 677 q 389 893 220 893 l 389 1013 l 527 1013 l 527 893 q 804 786 693 893 q 915 509 915 679 q 805 231 915 341 q 527 122 696 122 l 527 0 m 527 226 q 712 310 641 226 q 779 507 779 389 q 712 705 779 627 q 527 787 641 787 l 527 226 m 389 226 l 389 787 q 205 698 275 775 q 136 505 136 620 q 206 308 136 391 q 389 226 276 226 "},"⁋":{x_min:0,x_max:0,ha:694},j:{x_min:-77.78125,x_max:167,ha:349,o:"m 167 871 l 42 871 l 42 1013 l 167 1013 l 167 871 m 167 -80 q 121 -231 167 -184 q -26 -278 76 -278 l -77 -278 l -77 -164 l -41 -164 q 26 -143 11 -164 q 42 -65 42 -122 l 42 737 l 167 737 l 167 -80 "},"Σ":{x_min:0,x_max:756.953125,ha:819,o:"m 756 0 l 0 0 l 0 107 l 395 523 l 22 904 l 22 1013 l 745 1013 l 745 889 l 209 889 l 566 523 l 187 125 l 756 125 l 756 0 "},"":{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 "},"<":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"£":{x_min:0,x_max:704.484375,ha:801,o:"m 704 41 q 623 -10 664 5 q 543 -26 583 -26 q 359 15 501 -26 q 243 36 288 36 q 158 23 197 36 q 73 -21 119 10 l 6 76 q 125 195 90 150 q 175 331 175 262 q 147 443 175 383 l 0 443 l 0 512 l 108 512 q 43 734 43 623 q 120 929 43 854 q 358 1010 204 1010 q 579 936 487 1010 q 678 729 678 857 l 678 684 l 552 684 q 504 838 552 780 q 362 896 457 896 q 216 852 263 896 q 176 747 176 815 q 199 627 176 697 q 248 512 217 574 l 468 512 l 468 443 l 279 443 q 297 356 297 398 q 230 194 297 279 q 153 107 211 170 q 227 133 190 125 q 293 142 264 142 q 410 119 339 142 q 516 96 482 96 q 579 105 550 96 q 648 142 608 115 l 704 41 "},t:{x_min:0,x_max:367,ha:458,o:"m 367 0 q 312 -5 339 -2 q 262 -8 284 -8 q 145 28 183 -8 q 108 143 108 64 l 108 638 l 0 638 l 0 738 l 108 738 l 108 944 l 232 944 l 232 738 l 367 738 l 367 638 l 232 638 l 232 185 q 248 121 232 140 q 307 102 264 102 q 345 104 330 102 q 367 107 360 107 l 367 0 "},"¬":{x_min:0,x_max:706,ha:803,o:"m 706 411 l 706 158 l 630 158 l 630 335 l 0 335 l 0 411 l 706 411 "},"λ":{x_min:0,x_max:750,ha:803,o:"m 750 -7 q 679 -15 716 -15 q 538 59 591 -15 q 466 214 512 97 l 336 551 l 126 0 l 0 0 l 270 705 q 223 837 247 770 q 116 899 190 899 q 90 898 100 899 l 90 1004 q 152 1011 125 1011 q 298 938 244 1011 q 373 783 326 901 l 605 192 q 649 115 629 136 q 716 95 669 95 l 736 95 q 750 97 745 97 l 750 -7 "},W:{x_min:0,x_max:1263.890625,ha:1351,o:"m 1263 1013 l 995 0 l 859 0 l 627 837 l 405 0 l 265 0 l 0 1013 l 136 1013 l 342 202 l 556 1013 l 701 1013 l 921 207 l 1133 1012 l 1263 1013 "},">":{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},N_=Av(Av({},window.THREE?window.THREE:{CircleGeometry:Qo,DoubleSide:2,Group:oo,Mesh:ar,MeshLambertMaterial:Ps,TextGeometry:rv,Vector3:ae}),{},{Font:class{constructor(t){this.isFont=!0,this.type="Font",this.data=t}generateShapes(t,e=100){const n=[],r=function(t,e,n){const r=Array.from(t),i=e/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,o=[];let s=0,A=0;for(let t=0;t<r.length;t++){const e=r[t];if("\n"===e)s=0,A-=a;else{const t=iv(e,i,s,A,n);s+=t.offsetX,o.push(t.path)}}return o}(t,e,this.data);for(let t=0,e=r.length;t<e;t++)n.push(...r[t].toShapes());return n}},TextGeometry:rv}),B_=NA({props:{labelsData:{default:[]},labelLat:{default:"lat"},labelLng:{default:"lng"},labelAltitude:{default:0},labelText:{default:"text"},labelSize:{default:.5},labelTypeFace:{default:U_,onChange:function(t,e){e.font=new N_.Font(t)}},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(t,e){Pv(t),e.scene=t},update:function(t){var e=$h(t.labelLat),n=$h(t.labelLng),r=$h(t.labelAltitude),i=$h(t.labelText),a=$h(t.labelSize),o=$h(t.labelRotation),s=$h(t.labelColor),A=$h(t.labelIncludeDot),l=$h(t.labelDotRadius),c=$h(t.labelDotOrientation),u=new Set(["right","top","bottom"]),h=2*Math.PI*Dv/360,d=new N_.CircleGeometry(1,16);Yv(t.labelsData,t.scene,{createObj:function(){var t=new N_.MeshLambertMaterial;t.side=2;var e=new N_.Group;return e.add(new N_.Mesh(d,t)),e.add(new N_.Mesh(void 0,t)),e.__globeObjType="label",e},updateObj:function(d,f){var p=_v(d.children,2),m=p[0],g=p[1],v=s(f),_=Vv(v);g.material.color.set(jv(v)),g.material.transparent=_<1,g.material.opacity=_;var y=A(f),x=c(f);!y||!u.has(x)&&(x="bottom");var b=y?+l(f)*h:1e-12;m.scale.x=m.scale.y=b;var M=+a(f)*h;if(g.geometry&&g.geometry.dispose(),g.geometry=new N_.TextGeometry(i(f),{font:t.font,size:M,height:0,curveSegments:t.labelResolution}),"right"!==x&&g.geometry.center(),y){var w=b+M/2;"right"===x&&(g.position.x=w),g.position.y={right:-M/2,top:w+M/2,bottom:-w-M/2}[x]}var E=function(e){var n=d.__currentTargetD=e,r=n.lat,i=n.lng,a=n.alt,o=n.rot,s=n.scale;Object.assign(d.position,Iv(r,i,a)),d.lookAt(t.scene.localToWorld(new N_.Vector3(0,0,0))),d.rotateY(Math.PI),d.rotateZ(-o*Math.PI/180),d.scale.x=d.scale.y=d.scale.z=s},S={lat:+e(f),lng:+n(f),alt:+r(f),rot:+o(f),scale:1},T=d.__currentTargetD||Object.assign({},S,{scale:1e-12});Object.keys(S).some((function(t){return T[t]!==S[t]}))&&(!t.labelsTransitionDuration||t.labelsTransitionDuration<0?E(S):new VA(T).to(S,t.labelsTransitionDuration).easing(kA.Quadratic.InOut).onUpdate(E).start())}})}}),k_=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32;cv(this,e),(t=av(this,e)).type="CircleLineGeometry",t.parameters={radius:n,segmentCount:r};for(var i=[],a=0;a<=r;a++){var o=(a/r-.25)*Math.PI*2;i.push({x:Math.cos(o)*n,y:Math.sin(o)*n,z:0})}return t.setFromPoints(i),t}return fv(e,t),hv(e)}((window.THREE?window.THREE:{BufferGeometry:zn}).BufferGeometry),F_=window.THREE?window.THREE:{Color:Mn,Group:oo,Line:Eo,LineBasicMaterial:_o,Vector3:ae},z_=If.default||If,G_=NA({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}},methods:{pauseAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.pause()},resumeAnimation:function(t){var e;null===(e=t.ticker)||void 0===e||e.resume()},_destructor:function(t){var e;null===(e=t.ticker)||void 0===e||e.dispose()}},init:function(t,e){Pv(t),e.scene=t,e.ticker=new z_,e.ticker.onTick.add((function(t){if(e.ringsData.length){var n=$h(e.ringColor),r=$h(e.ringAltitude),i=$h(e.ringMaxRadius),a=$h(e.ringPropagationSpeed),o=$h(e.ringRepeatPeriod);e.ringsData.filter((function(t){return t.__threeObj})).forEach((function(s){var A,l,c,u=s.__threeObj;if((u.__nextRingTime||0)<=t){var h=o(s)/1e3;u.__nextRingTime=t+(h<=0?1/0:h);var d,f=new F_.Line(new k_(1,e.ringResolution),new F_.LineBasicMaterial),p=n(s),m=p instanceof Array||p instanceof Function;m?p instanceof Array?(d=bp().domain(p.map((function(t,e){return e/(p.length-1)}))).range(p),f.material.transparent=p.some((function(t){return Vv(t)<1}))):(d=p,f.material.transparent=!0):(f.material.color=new F_.Color(jv(p)),A=f.material,l=Vv(p),A.opacity=l,A.transparent=l<1,A.depthWrite=void 0===c?l>=1:c);var g=Dv*(1+r(s)),v=i(s),_=v*Math.PI/180,y=a(s),x=y<=0,b=function(t){var e=t.t,n=(x?1-e:e)*_;if(f.scale.x=f.scale.y=g*Math.sin(n),f.position.z=g*(1-Math.cos(n)),m){var r=d(e);f.material.color=new F_.Color(jv(r)),f.material.transparent&&(f.material.opacity=Vv(r))}};if(0===y)b({t:0}),u.add(f);else{var M=1e3*Math.abs(v/y);new VA({t:0}).to({t:1},M).onUpdate(b).onStart((function(){return u.add(f)})).onComplete((function(){u.remove(f),Rv(f)})).start()}}}))}}))},update:function(t){var e=$h(t.ringLat),n=$h(t.ringLng),r=$h(t.ringAltitude),i=t.scene.localToWorld(new F_.Vector3(0,0,0));Yv(t.ringsData,t.scene,{createObj:function(){var t=new F_.Group;return t.__globeObjType="ring",t},updateObj:function(t,a){var o=e(a),s=n(a),A=r(a);Object.assign(t.position,Iv(o,s,A)),t.lookAt(i)}},{removeDelay:3e4})}}),H_=Av(Av({},window.THREE?window.THREE:{}),{},{CSS2DObject:class extends sn{constructor(t=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=t,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Lt(.5,.5),this.addEventListener("removed",(function(){this.traverse((function(t){t.element instanceof Element&&null!==t.element.parentNode&&t.element.parentNode.removeChild(t.element)}))}))}copy(t,e){return super.copy(t,e),this.element=t.element.cloneNode(!0),this.center=t.center,this}}}),j_=NA({props:{htmlElementsData:{default:[]},htmlLat:{default:"lat"},htmlLng:{default:"lng"},htmlAltitude:{default:0},htmlElement:{},htmlTransitionDuration:{default:1e3,triggerUpdate:!1},isBehindGlobe:{onChange:function(){this.updateObjVisibility()},triggerUpdate:!1}},methods:{updateObjVisibility:function(t,e){(e?[e]:t.htmlElementsData.map((function(t){return t.__threeObj})).filter((function(t){return t}))).forEach((function(e){return e.visible=!t.isBehindGlobe||!t.isBehindGlobe(e.position)}))}},init:function(t,e){Pv(t),e.scene=t},update:function(t,e){var n=this,r=$h(t.htmlLat),i=$h(t.htmlLng),a=$h(t.htmlAltitude),o=$h(t.htmlElement);Yv(t.htmlElementsData,t.scene,{purge:e.hasOwnProperty("htmlElement"),createObj:function(t){var e=o(t),n=new H_.CSS2DObject(e);return n.__globeObjType="html",n},updateObj:function(e,o){var s=function(t){var r=e.__currentTargetD=t,i=r.alt,a=r.lat,o=r.lng;Object.assign(e.position,Iv(a,o,i)),n.updateObjVisibility(e)},A={lat:+r(o),lng:+i(o),alt:+a(o)};!t.htmlTransitionDuration||t.htmlTransitionDuration<0||!e.__currentTargetD?s(A):new VA(e.__currentTargetD).to(A,t.pointsTransitionDuration).easing(kA.Quadratic.InOut).onUpdate(s).start()}})}}),V_=window.THREE?window.THREE:{Euler:Ve,Group:oo,Mesh:ar,MeshLambertMaterial:Ps,SphereGeometry:Ts},W_=NA({props:{objectsData:{default:[]},objectLat:{default:"lat"},objectLng:{default:"lng"},objectAltitude:{default:.01},objectFacesSurface:{default:!0},objectRotation:{},objectThreeObject:{default:new V_.Mesh(new V_.SphereGeometry(1,16,8),new V_.MeshLambertMaterial({color:"#ffffaa",transparent:!0,opacity:.7}))}},init:function(t,e){Pv(t),e.scene=t},update:function(t,e){var n=$h(t.objectLat),r=$h(t.objectLng),i=$h(t.objectAltitude),a=$h(t.objectFacesSurface),o=$h(t.objectRotation),s=$h(t.objectThreeObject);Yv(t.objectsData,t.scene,{purge:e.hasOwnProperty("objectThreeObject"),createObj:function(e){var n=s(e);t.objectThreeObject===n&&(n=n.clone());var r=new V_.Group;return r.add(n),r.__globeObjType="object",r},updateObj:function(t,e){var s=+n(e),A=+r(e),l=+i(e);Object.assign(t.position,Iv(s,A,l)),a(e)?t.setRotationFromEuler(new Ve(Uv(-s),Uv(A),0,"YXZ")):t.rotation.set(0,0,0);var c=t.children[0],u=o(e);u&&c.setRotationFromEuler(new Ve(Uv(u.x||0),Uv(u.y||0),Uv(u.z||0)))}})}}),X_=NA({props:{customLayerData:{default:[]},customThreeObject:{},customThreeObjectUpdate:{triggerUpdate:!1}},init:function(t,e){Pv(t),e.scene=t},update:function(t,e){t.customThreeObjectUpdate||Pv(t.scene);var n=$h(t.customThreeObject),r=$h(t.customThreeObjectUpdate);Yv(t.customLayerData,t.scene,{purge:e.hasOwnProperty("customThreeObject"),createObj:function(e){var r=n(e,Dv);return r&&(t.customThreeObject===r&&(r=r.clone()),r.__globeObjType="custom"),r},updateObj:function(t,e){return r(t,e,Dv)}})}}),Q_=window.THREE?window.THREE:{Group:oo,Vector2:Lt,Vector3:ae},Y_=["globeLayer","pointsLayer","arcsLayer","hexBinLayer","heatmapsLayer","polygonsLayer","hexedPolygonsLayer","pathsLayer","tilesLayer","labelsLayer","ringsLayer","htmlElementsLayer","objectsLayer","customLayer"],Z_=Lv("globeLayer",Hv),K_=Object.assign.apply(Object,yv(["globeImageUrl","bumpImageUrl","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude"].map((function(t){return dv({},t,Z_.linkProp(t))})))),J_=Object.assign.apply(Object,yv(["globeMaterial"].map((function(t){return dv({},t,Z_.linkMethod(t))})))),$_=Lv("pointsLayer",$v),ty=Object.assign.apply(Object,yv(["pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration"].map((function(t){return dv({},t,$_.linkProp(t))})))),ey=Lv("arcsLayer",i_),ny=Object.assign.apply(Object,yv(["arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration"].map((function(t){return dv({},t,ey.linkProp(t))})))),ry=Lv("hexBinLayer",A_),iy=Object.assign.apply(Object,yv(["hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration"].map((function(t){return dv({},t,ry.linkProp(t))})))),ay=Lv("heatmapsLayer",y_),oy=Object.assign.apply(Object,yv(["heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration"].map((function(t){return dv({},t,ay.linkProp(t))})))),sy=Lv("hexedPolygonsLayer",S_),Ay=Object.assign.apply(Object,yv(["hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration"].map((function(t){return dv({},t,sy.linkProp(t))})))),ly=Lv("polygonsLayer",b_),cy=Object.assign.apply(Object,yv(["polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration"].map((function(t){return dv({},t,ly.linkProp(t))})))),uy=Lv("pathsLayer",D_),hy=Object.assign.apply(Object,yv(["pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration"].map((function(t){return dv({},t,uy.linkProp(t))})))),dy=Lv("tilesLayer",I_),fy=Object.assign.apply(Object,yv(["tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration"].map((function(t){return dv({},t,dy.linkProp(t))})))),py=Lv("labelsLayer",B_),my=Object.assign.apply(Object,yv(["labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration"].map((function(t){return dv({},t,py.linkProp(t))})))),gy=Lv("ringsLayer",G_),vy=Object.assign.apply(Object,yv(["ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod"].map((function(t){return dv({},t,gy.linkProp(t))})))),_y=Lv("htmlElementsLayer",j_),yy=Object.assign.apply(Object,yv(["htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlTransitionDuration"].map((function(t){return dv({},t,_y.linkProp(t))})))),xy=Lv("objectsLayer",W_),by=Object.assign.apply(Object,yv(["objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject"].map((function(t){return dv({},t,xy.linkProp(t))})))),My=Lv("customLayer",X_),wy=Object.assign.apply(Object,yv(["customLayerData","customThreeObject","customThreeObjectUpdate"].map((function(t){return dv({},t,My.linkProp(t))})))),Ey=NA({props:Av(Av(Av(Av(Av(Av(Av(Av(Av(Av(Av(Av(Av(Av({onGlobeReady:{triggerUpdate:!1},rendererSize:{default:new Q_.Vector2(window.innerWidth,window.innerHeight),onChange:function(t,e){e.pathsLayer.rendererSize(t)},triggerUpdate:!1}},K_),ty),ny),iy),oy),cy),Ay),hy),fy),my),vy),yy),by),wy),methods:Av({getGlobeRadius:Ov,getCoords:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Iv.apply(void 0,n)},toGeoCoords:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return qv.apply(void 0,n)},setPointOfView:function(t,e,n){var r=void 0;if(e){var i,a,o,s=Ov(),A=n?e.clone().sub(n):e;r=function(t){void 0===i&&(i=A.length()),void 0===a&&(a=Math.sqrt(Math.pow(i,2)-Math.pow(s,2))),void 0===o&&(o=Math.acos(a/i));var e=A.distanceTo(t);if(e<a)return!1;var n=t.length();return Math.acos((Math.pow(i,2)+Math.pow(e,2)-Math.pow(n,2))/(2*i*e))<o}}t.layersThatNeedBehindGlobeChecker.forEach((function(t){return t.isBehindGlobe(r)}))},pauseAnimation:function(t){return null!==t.animationFrameRequestId&&(cancelAnimationFrame(t.animationFrameRequestId),t.animationFrameRequestId=null),t.pausableLayers.forEach((function(t){var e;return null===(e=t.pauseAnimation)||void 0===e?void 0:e.call(t)})),this},resumeAnimation:function(t){return null===t.animationFrameRequestId&&this._animationCycle(),t.pausableLayers.forEach((function(t){var e;return null===(e=t.resumeAnimation)||void 0===e?void 0:e.call(t)})),this},_animationCycle:function(t){t.animationFrameRequestId=requestAnimationFrame(this._animationCycle),XA()},_destructor:function(t){this.pauseAnimation(),t.destructableLayers.forEach((function(t){return t._destructor()}))}},J_),stateInit:function(){var t={globeLayer:Hv(),pointsLayer:$v(),arcsLayer:i_(),hexBinLayer:A_(),heatmapsLayer:y_(),polygonsLayer:b_(),hexedPolygonsLayer:S_(),pathsLayer:D_(),tilesLayer:I_(),labelsLayer:B_(),ringsLayer:G_(),htmlElementsLayer:j_(),objectsLayer:W_(),customLayer:X_()};return Av(Av({},t),{},{layersThatNeedBehindGlobeChecker:Object.values(t).filter((function(t){return t.hasOwnProperty("isBehindGlobe")})),destructableLayers:Object.values(t).filter((function(t){return t.hasOwnProperty("_destructor")})),pausableLayers:Object.values(t).filter((function(t){return t.hasOwnProperty("pauseAnimation")}))})},init:function(t,e,n){var r=n.animateIn,i=void 0===r||r,a=n.waitForGlobeReady,o=void 0===a||a;Pv(t),t.add(e.scene=new Q_.Group),e.scene.visible=!1,Y_.forEach((function(t){var n=new Q_.Group;e.scene.add(n),e[t](n)}));var s=function(){if(i){e.scene.scale.set(1e-6,1e-6,1e-6),new VA({k:1e-6}).to({k:1},600).easing(kA.Quadratic.Out).onUpdate((function(t){var n=t.k;return e.scene.scale.set(n,n,n)})).start();var t=new Q_.Vector3(0,1,0);new VA({rot:2*Math.PI}).to({rot:0},1200).easing(kA.Quintic.Out).onUpdate((function(n){var r=n.rot;return e.scene.setRotationFromAxisAngle(t,r)})).start()}e.scene.visible=!0,e.onGlobeReady&&e.onGlobeReady()};o?e.globeLayer.onReady(s):s(),this._animationCycle()},update:function(t){}});var Sy=function(t){var e=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=function(n){function r(){var n;cv(this,r);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return(n=av(this,r,[].concat(a))).__kapsuleInstance=t.apply(void 0,a).apply(void 0,[].concat(yv(e?[vv(n)]:[]),a)),n}return fv(r,n),hv(r)}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object);return Object.keys(t()).forEach((function(t){return n.prototype[t]=function(){var e,n=(e=this.__kapsuleInstance)[t].apply(e,arguments);return n===this.__kapsuleInstance?this:n}})),n}(Ey,(window.THREE?window.THREE:{Group:oo}).Group,!0);const Ty={type:"change"},Cy={type:"start"},Ry={type:"end"};class Py extends gt{constructor(t,e){super();const n=this,r=-1,i=0,a=1,o=2,s=3,l=4;this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.keys=["KeyA","KeyS","KeyD"],this.mouseButtons={LEFT:A.ROTATE,MIDDLE:A.DOLLY,RIGHT:A.PAN},this.target=new ae;const c=1e-6,u=new ae;let h=1,d=r,f=r,p=0,m=0,g=0;const v=new ae,_=new Lt,y=new Lt,x=new ae,b=new Lt,M=new Lt,w=new Lt,E=new Lt,S=[],T={};this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.zoom0=this.object.zoom,this.handleResize=function(){const t=n.domElement.getBoundingClientRect(),e=n.domElement.ownerDocument.documentElement;n.screen.left=t.left+window.pageXOffset-e.clientLeft,n.screen.top=t.top+window.pageYOffset-e.clientTop,n.screen.width=t.width,n.screen.height=t.height};const C=function(){const t=new Lt;return function(e,r){return t.set((e-n.screen.left)/n.screen.width,(r-n.screen.top)/n.screen.height),t}}(),R=function(){const t=new Lt;return function(e,r){return t.set((e-.5*n.screen.width-n.screen.left)/(.5*n.screen.width),(n.screen.height+2*(n.screen.top-r))/n.screen.width),t}}();function P(t){!1!==n.enabled&&(0===S.length&&(n.domElement.setPointerCapture(t.pointerId),n.domElement.addEventListener("pointermove",L),n.domElement.addEventListener("pointerup",D)),function(t){S.push(t)}(t),"touch"===t.pointerType?function(t){if(1===(k(t),S.length))d=s,y.copy(R(S[0].pageX,S[0].pageY)),_.copy(y);else{d=l;const t=S[0].pageX-S[1].pageX,e=S[0].pageY-S[1].pageY;m=p=Math.sqrt(t*t+e*e);const n=(S[0].pageX+S[1].pageX)/2,r=(S[0].pageY+S[1].pageY)/2;w.copy(C(n,r)),E.copy(w)}n.dispatchEvent(Cy)}(t):function(t){if(d===r)switch(t.button){case n.mouseButtons.LEFT:d=i;break;case n.mouseButtons.MIDDLE:d=a;break;case n.mouseButtons.RIGHT:d=o}const e=f!==r?f:d;e!==i||n.noRotate?e!==a||n.noZoom?e!==o||n.noPan||(w.copy(C(t.pageX,t.pageY)),E.copy(w)):(b.copy(C(t.pageX,t.pageY)),M.copy(b)):(y.copy(R(t.pageX,t.pageY)),_.copy(y));n.dispatchEvent(Cy)}(t))}function L(t){!1!==n.enabled&&("touch"===t.pointerType?function(t){if(1===(k(t),S.length))_.copy(y),y.copy(R(t.pageX,t.pageY));else{const e=function(t){const e=t.pointerId===S[0].pointerId?S[1]:S[0];return T[e.pointerId]}(t),n=t.pageX-e.x,r=t.pageY-e.y;m=Math.sqrt(n*n+r*r);const i=(t.pageX+e.x)/2,a=(t.pageY+e.y)/2;E.copy(C(i,a))}}(t):function(t){const e=f!==r?f:d;e!==i||n.noRotate?e!==a||n.noZoom?e!==o||n.noPan||E.copy(C(t.pageX,t.pageY)):M.copy(C(t.pageX,t.pageY)):(_.copy(y),y.copy(R(t.pageX,t.pageY)))}(t))}function D(t){!1!==n.enabled&&("touch"===t.pointerType?function(t){switch(S.length){case 0:d=r;break;case 1:d=s,y.copy(R(t.pageX,t.pageY)),_.copy(y);break;case 2:d=l;for(let e=0;e<S.length;e++)if(S[e].pointerId!==t.pointerId){const t=T[S[e].pointerId];y.copy(R(t.x,t.y)),_.copy(y);break}}n.dispatchEvent(Ry)}(t):(d=r,n.dispatchEvent(Ry)),B(t),0===S.length&&(n.domElement.releasePointerCapture(t.pointerId),n.domElement.removeEventListener("pointermove",L),n.domElement.removeEventListener("pointerup",D)))}function O(t){B(t)}function I(t){!1!==n.enabled&&(window.removeEventListener("keydown",I),f===r&&(t.code!==n.keys[i]||n.noRotate?t.code!==n.keys[a]||n.noZoom?t.code!==n.keys[o]||n.noPan||(f=o):f=a:f=i))}function q(){!1!==n.enabled&&(f=r,window.addEventListener("keydown",I))}function U(t){if(!1!==n.enabled&&!0!==n.noZoom){switch(t.preventDefault(),t.deltaMode){case 2:b.y-=.025*t.deltaY;break;case 1:b.y-=.01*t.deltaY;break;default:b.y-=25e-5*t.deltaY}n.dispatchEvent(Cy),n.dispatchEvent(Ry)}}function N(t){!1!==n.enabled&&t.preventDefault()}function B(t){delete T[t.pointerId];for(let e=0;e<S.length;e++)if(S[e].pointerId==t.pointerId)return void S.splice(e,1)}function k(t){let e=T[t.pointerId];void 0===e&&(e=new Lt,T[t.pointerId]=e),e.set(t.pageX,t.pageY)}this.rotateCamera=function(){const t=new ae,e=new ie,r=new ae,i=new ae,a=new ae,o=new ae;return function(){o.set(y.x-_.x,y.y-_.y,0);let s=o.length();s?(v.copy(n.object.position).sub(n.target),r.copy(v).normalize(),i.copy(n.object.up).normalize(),a.crossVectors(i,r).normalize(),i.setLength(y.y-_.y),a.setLength(y.x-_.x),o.copy(i.add(a)),t.crossVectors(o,v).normalize(),s*=n.rotateSpeed,e.setFromAxisAngle(t,s),v.applyQuaternion(e),n.object.up.applyQuaternion(e),x.copy(t),g=s):!n.staticMoving&&g&&(g*=Math.sqrt(1-n.dynamicDampingFactor),v.copy(n.object.position).sub(n.target),e.setFromAxisAngle(x,g),v.applyQuaternion(e),n.object.up.applyQuaternion(e)),_.copy(y)}}(),this.zoomCamera=function(){let t;d===l?(t=p/m,p=m,n.object.isPerspectiveCamera?v.multiplyScalar(t):n.object.isOrthographicCamera?(n.object.zoom=Pt.clamp(n.object.zoom/t,n.minZoom,n.maxZoom),h!==n.object.zoom&&n.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")):(t=1+(M.y-b.y)*n.zoomSpeed,1!==t&&t>0&&(n.object.isPerspectiveCamera?v.multiplyScalar(t):n.object.isOrthographicCamera?(n.object.zoom=Pt.clamp(n.object.zoom/t,n.minZoom,n.maxZoom),h!==n.object.zoom&&n.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")),n.staticMoving?b.copy(M):b.y+=(M.y-b.y)*this.dynamicDampingFactor)},this.panCamera=function(){const t=new Lt,e=new ae,r=new ae;return function(){if(t.copy(E).sub(w),t.lengthSq()){if(n.object.isOrthographicCamera){const e=(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;t.x*=e,t.y*=r}t.multiplyScalar(v.length()*n.panSpeed),r.copy(v).cross(n.object.up).setLength(t.x),r.add(e.copy(n.object.up).setLength(t.y)),n.object.position.add(r),n.target.add(r),n.staticMoving?w.copy(E):w.add(t.subVectors(E,w).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)),b.copy(M)),v.lengthSq()<n.minDistance*n.minDistance&&(n.object.position.addVectors(n.target,v.setLength(n.minDistance)),b.copy(M)))},this.update=function(){v.subVectors(n.object.position,n.target),n.noRotate||n.rotateCamera(),n.noZoom||n.zoomCamera(),n.noPan||n.panCamera(),n.object.position.addVectors(n.target,v),n.object.isPerspectiveCamera?(n.checkDistances(),n.object.lookAt(n.target),u.distanceToSquared(n.object.position)>c&&(n.dispatchEvent(Ty),u.copy(n.object.position))):n.object.isOrthographicCamera?(n.object.lookAt(n.target),(u.distanceToSquared(n.object.position)>c||h!==n.object.zoom)&&(n.dispatchEvent(Ty),u.copy(n.object.position),h=n.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type")},this.reset=function(){d=r,f=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(Ty),u.copy(n.object.position),h=n.object.zoom},this.dispose=function(){n.domElement.removeEventListener("contextmenu",N),n.domElement.removeEventListener("pointerdown",P),n.domElement.removeEventListener("pointercancel",O),n.domElement.removeEventListener("wheel",U),n.domElement.removeEventListener("pointermove",L),n.domElement.removeEventListener("pointerup",D),window.removeEventListener("keydown",I),window.removeEventListener("keyup",q)},this.domElement.addEventListener("contextmenu",N),this.domElement.addEventListener("pointerdown",P),this.domElement.addEventListener("pointercancel",O),this.domElement.addEventListener("wheel",U,{passive:!1}),window.addEventListener("keydown",I),window.addEventListener("keyup",q),this.handleResize(),this.update()}}const Ly={type:"change"},Dy={type:"start"},Oy={type:"end"},Iy=new Ie,qy=new Er,Uy=Math.cos(70*Pt.DEG2RAD);class Ny extends gt{constructor(t,e){super(),this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new ae,this.cursor=new ae,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=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.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:A.ROTATE,MIDDLE:A.DOLLY,RIGHT:A.PAN},this.touches={ONE:l,TWO:u},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return o.phi},this.getAzimuthalAngle=function(){return o.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(t){t.addEventListener("keydown",$),this._domElementKeyEvents=t},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",$),this._domElementKeyEvents=null},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(Ly),n.update(),i=r.NONE},this.update=function(){const e=new ae,A=(new ie).setFromUnitVectors(t.up,new ae(0,1,0)),l=A.clone().invert(),c=new ae,u=new ie,h=new ae,p=2*Math.PI;return function(m=null){const g=n.object.position;e.copy(g).sub(n.target),e.applyQuaternion(A),o.setFromVector3(e),n.autoRotate&&i===r.NONE&&L(function(t){return null!==t?2*Math.PI/60*n.autoRotateSpeed*t:2*Math.PI/60/60*n.autoRotateSpeed}(m)),n.enableDamping?(o.theta+=s.theta*n.dampingFactor,o.phi+=s.phi*n.dampingFactor):(o.theta+=s.theta,o.phi+=s.phi);let v=n.minAzimuthAngle,_=n.maxAzimuthAngle;isFinite(v)&&isFinite(_)&&(v<-Math.PI?v+=p:v>Math.PI&&(v-=p),_<-Math.PI?_+=p:_>Math.PI&&(_-=p),o.theta=v<=_?Math.max(v,Math.min(_,o.theta)):o.theta>(v+_)/2?Math.max(v,o.theta):Math.min(_,o.theta)),o.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,o.phi)),o.makeSafe(),!0===n.enableDamping?n.target.addScaledVector(f,n.dampingFactor):n.target.add(f),n.target.sub(n.cursor),n.target.clampLength(n.minTargetRadius,n.maxTargetRadius),n.target.add(n.cursor),n.zoomToCursor&&S||n.object.isOrthographicCamera?o.radius=k(o.radius):o.radius=k(o.radius*d),e.setFromSpherical(o),e.applyQuaternion(l),g.copy(n.target).add(e),n.object.lookAt(n.target),!0===n.enableDamping?(s.theta*=1-n.dampingFactor,s.phi*=1-n.dampingFactor,f.multiplyScalar(1-n.dampingFactor)):(s.set(0,0,0),f.set(0,0,0));let y=!1;if(n.zoomToCursor&&S){let r=null;if(n.object.isPerspectiveCamera){const t=e.length();r=k(t*d);const i=t-r;n.object.position.addScaledVector(w,i),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){const t=new ae(E.x,E.y,0);t.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/d)),n.object.updateProjectionMatrix(),y=!0;const i=new ae(E.x,E.y,0);i.unproject(n.object),n.object.position.sub(i).add(t),n.object.updateMatrixWorld(),r=e.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;null!==r&&(this.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(r).add(n.object.position):(Iy.origin.copy(n.object.position),Iy.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(Iy.direction))<Uy?t.lookAt(n.target):(qy.setFromNormalAndCoplanarPoint(n.object.up,n.target),Iy.intersectPlane(qy,n.target))))}else n.object.isOrthographicCamera&&(y=1!==d,y&&(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/d)),n.object.updateProjectionMatrix()));return d=1,S=!1,!!(y||c.distanceToSquared(n.object.position)>a||8*(1-u.dot(n.object.quaternion))>a||h.distanceToSquared(n.target)>0)&&(n.dispatchEvent(Ly),c.copy(n.object.position),u.copy(n.object.quaternion),h.copy(n.target),!0)}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",et),n.domElement.removeEventListener("pointerdown",Q),n.domElement.removeEventListener("pointercancel",Z),n.domElement.removeEventListener("wheel",K),n.domElement.removeEventListener("pointermove",Y),n.domElement.removeEventListener("pointerup",Z),null!==n._domElementKeyEvents&&(n._domElementKeyEvents.removeEventListener("keydown",$),n._domElementKeyEvents=null)};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 a=1e-6,o=new Qs,s=new Qs;let d=1;const f=new ae,p=new Lt,m=new Lt,g=new Lt,v=new Lt,_=new Lt,y=new Lt,x=new Lt,b=new Lt,M=new Lt,w=new ae,E=new Lt;let S=!1;const T=[],C={};let R=!1;function P(t){const e=Math.abs(.01*t);return Math.pow(.95,n.zoomSpeed*e)}function L(t){s.theta-=t}function D(t){s.phi-=t}const O=function(){const t=new ae;return function(e,n){t.setFromMatrixColumn(n,0),t.multiplyScalar(-e),f.add(t)}}(),I=function(){const t=new ae;return function(e,r){!0===n.screenSpacePanning?t.setFromMatrixColumn(r,1):(t.setFromMatrixColumn(r,0),t.crossVectors(n.object.up,t)),t.multiplyScalar(e),f.add(t)}}(),q=function(){const t=new ae;return function(e,r){const i=n.domElement;if(n.object.isPerspectiveCamera){const a=n.object.position;t.copy(a).sub(n.target);let o=t.length();o*=Math.tan(n.object.fov/2*Math.PI/180),O(2*e*o/i.clientHeight,n.object.matrix),I(2*r*o/i.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(O(e*(n.object.right-n.object.left)/n.object.zoom/i.clientWidth,n.object.matrix),I(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 U(t){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?d/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function N(t){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?d*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function B(t,e){if(!n.zoomToCursor)return;S=!0;const r=n.domElement.getBoundingClientRect(),i=t-r.left,a=e-r.top,o=r.width,s=r.height;E.x=i/o*2-1,E.y=-a/s*2+1,w.set(E.x,E.y,1).unproject(n.object).sub(n.object.position).normalize()}function k(t){return Math.max(n.minDistance,Math.min(n.maxDistance,t))}function F(t){p.set(t.clientX,t.clientY)}function z(t){v.set(t.clientX,t.clientY)}function G(t){if(1===T.length)p.set(t.pageX,t.pageY);else{const e=rt(t),n=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);p.set(n,r)}}function H(t){if(1===T.length)v.set(t.pageX,t.pageY);else{const e=rt(t),n=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);v.set(n,r)}}function j(t){const e=rt(t),n=t.pageX-e.x,r=t.pageY-e.y,i=Math.sqrt(n*n+r*r);x.set(0,i)}function V(t){if(1==T.length)m.set(t.pageX,t.pageY);else{const e=rt(t),n=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);m.set(n,r)}g.subVectors(m,p).multiplyScalar(n.rotateSpeed);const e=n.domElement;L(2*Math.PI*g.x/e.clientHeight),D(2*Math.PI*g.y/e.clientHeight),p.copy(m)}function W(t){if(1===T.length)_.set(t.pageX,t.pageY);else{const e=rt(t),n=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);_.set(n,r)}y.subVectors(_,v).multiplyScalar(n.panSpeed),q(y.x,y.y),v.copy(_)}function X(t){const e=rt(t),r=t.pageX-e.x,i=t.pageY-e.y,a=Math.sqrt(r*r+i*i);b.set(0,a),M.set(0,Math.pow(b.y/x.y,n.zoomSpeed)),U(M.y),x.copy(b);B(.5*(t.pageX+e.x),.5*(t.pageY+e.y))}function Q(t){!1!==n.enabled&&(0===T.length&&(n.domElement.setPointerCapture(t.pointerId),n.domElement.addEventListener("pointermove",Y),n.domElement.addEventListener("pointerup",Z)),function(t){T.push(t.pointerId)}(t),"touch"===t.pointerType?tt(t):function(t){let e;switch(t.button){case 0:e=n.mouseButtons.LEFT;break;case 1:e=n.mouseButtons.MIDDLE;break;case 2:e=n.mouseButtons.RIGHT;break;default:e=-1}switch(e){case A.DOLLY:if(!1===n.enableZoom)return;!function(t){B(t.clientX,t.clientX),x.set(t.clientX,t.clientY)}(t),i=r.DOLLY;break;case A.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===n.enablePan)return;z(t),i=r.PAN}else{if(!1===n.enableRotate)return;F(t),i=r.ROTATE}break;case A.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===n.enableRotate)return;F(t),i=r.ROTATE}else{if(!1===n.enablePan)return;z(t),i=r.PAN}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent(Dy)}(t))}function Y(t){!1!==n.enabled&&("touch"===t.pointerType?function(t){switch(nt(t),i){case r.TOUCH_ROTATE:if(!1===n.enableRotate)return;V(t),n.update();break;case r.TOUCH_PAN:if(!1===n.enablePan)return;W(t),n.update();break;case r.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(t){n.enableZoom&&X(t),n.enablePan&&W(t)}(t),n.update();break;case r.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(t){n.enableZoom&&X(t),n.enableRotate&&V(t)}(t),n.update();break;default:i=r.NONE}}(t):function(t){switch(i){case r.ROTATE:if(!1===n.enableRotate)return;!function(t){m.set(t.clientX,t.clientY),g.subVectors(m,p).multiplyScalar(n.rotateSpeed);const e=n.domElement;L(2*Math.PI*g.x/e.clientHeight),D(2*Math.PI*g.y/e.clientHeight),p.copy(m),n.update()}(t);break;case r.DOLLY:if(!1===n.enableZoom)return;!function(t){b.set(t.clientX,t.clientY),M.subVectors(b,x),M.y>0?U(P(M.y)):M.y<0&&N(P(M.y)),x.copy(b),n.update()}(t);break;case r.PAN:if(!1===n.enablePan)return;!function(t){_.set(t.clientX,t.clientY),y.subVectors(_,v).multiplyScalar(n.panSpeed),q(y.x,y.y),v.copy(_),n.update()}(t)}}(t))}function Z(t){switch(function(t){delete C[t.pointerId];for(let e=0;e<T.length;e++)if(T[e]==t.pointerId)return void T.splice(e,1)}(t),T.length){case 0:n.domElement.releasePointerCapture(t.pointerId),n.domElement.removeEventListener("pointermove",Y),n.domElement.removeEventListener("pointerup",Z),n.dispatchEvent(Oy),i=r.NONE;break;case 1:const e=T[0],a=C[e];tt({pointerId:e,pageX:a.x,pageY:a.y})}}function K(t){!1!==n.enabled&&!1!==n.enableZoom&&i===r.NONE&&(t.preventDefault(),n.dispatchEvent(Dy),function(t){B(t.clientX,t.clientY),t.deltaY<0?N(P(t.deltaY)):t.deltaY>0&&U(P(t.deltaY)),n.update()}(function(t){const e=t.deltaMode,n={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(e){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100}t.ctrlKey&&!R&&(n.deltaY*=10);return n}(t)),n.dispatchEvent(Oy))}function J(t){if("Control"===t.key){R=!1;n.domElement.getRootNode().removeEventListener("keyup",J,{passive:!0,capture:!0})}}function $(t){!1!==n.enabled&&!1!==n.enablePan&&function(t){let e=!1;switch(t.code){case n.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?D(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):q(0,n.keyPanSpeed),e=!0;break;case n.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?D(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):q(0,-n.keyPanSpeed),e=!0;break;case n.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?L(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):q(n.keyPanSpeed,0),e=!0;break;case n.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?L(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):q(-n.keyPanSpeed,0),e=!0}e&&(t.preventDefault(),n.update())}(t)}function tt(t){switch(nt(t),T.length){case 1:switch(n.touches.ONE){case l:if(!1===n.enableRotate)return;G(t),i=r.TOUCH_ROTATE;break;case c:if(!1===n.enablePan)return;H(t),i=r.TOUCH_PAN;break;default:i=r.NONE}break;case 2:switch(n.touches.TWO){case u:if(!1===n.enableZoom&&!1===n.enablePan)return;!function(t){n.enableZoom&&j(t),n.enablePan&&H(t)}(t),i=r.TOUCH_DOLLY_PAN;break;case h:if(!1===n.enableZoom&&!1===n.enableRotate)return;!function(t){n.enableZoom&&j(t),n.enableRotate&&G(t)}(t),i=r.TOUCH_DOLLY_ROTATE;break;default:i=r.NONE}break;default:i=r.NONE}i!==r.NONE&&n.dispatchEvent(Dy)}function et(t){!1!==n.enabled&&t.preventDefault()}function nt(t){let e=C[t.pointerId];void 0===e&&(e=new Lt,C[t.pointerId]=e),e.set(t.pageX,t.pageY)}function rt(t){const e=t.pointerId===T[0]?T[1]:T[0];return C[e]}n.domElement.addEventListener("contextmenu",et),n.domElement.addEventListener("pointerdown",Q),n.domElement.addEventListener("pointercancel",Z),n.domElement.addEventListener("wheel",K,{passive:!1});n.domElement.getRootNode().addEventListener("keydown",(function(t){if("Control"===t.key){R=!0;n.domElement.getRootNode().addEventListener("keyup",J,{passive:!0,capture:!0})}}),{passive:!0,capture:!0}),this.update()}}const By={type:"change"};class ky extends gt{constructor(t,e){super(),this.object=t,this.domElement=e,this.enabled=!0,this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1;const n=this,r=1e-6,i=new ie,a=new ae;this.tmpQuaternion=new ie,this.status=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new ae(0,0,0),this.rotationVector=new ae(0,0,0),this.keydown=function(t){if(!t.altKey&&!1!==this.enabled){switch(t.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=.1;break;case"KeyW":this.moveState.forward=1;break;case"KeyS":this.moveState.back=1;break;case"KeyA":this.moveState.left=1;break;case"KeyD":this.moveState.right=1;break;case"KeyR":this.moveState.up=1;break;case"KeyF":this.moveState.down=1;break;case"ArrowUp":this.moveState.pitchUp=1;break;case"ArrowDown":this.moveState.pitchDown=1;break;case"ArrowLeft":this.moveState.yawLeft=1;break;case"ArrowRight":this.moveState.yawRight=1;break;case"KeyQ":this.moveState.rollLeft=1;break;case"KeyE":this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}},this.keyup=function(t){if(!1!==this.enabled){switch(t.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=1;break;case"KeyW":this.moveState.forward=0;break;case"KeyS":this.moveState.back=0;break;case"KeyA":this.moveState.left=0;break;case"KeyD":this.moveState.right=0;break;case"KeyR":this.moveState.up=0;break;case"KeyF":this.moveState.down=0;break;case"ArrowUp":this.moveState.pitchUp=0;break;case"ArrowDown":this.moveState.pitchDown=0;break;case"ArrowLeft":this.moveState.yawLeft=0;break;case"ArrowRight":this.moveState.yawRight=0;break;case"KeyQ":this.moveState.rollLeft=0;break;case"KeyE":this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()}},this.pointerdown=function(t){if(!1!==this.enabled)if(this.dragToLook)this.status++;else{switch(t.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}},this.pointermove=function(t){if(!1!==this.enabled&&(!this.dragToLook||this.status>0)){const e=this.getContainerDimensions(),n=e.size[0]/2,r=e.size[1]/2;this.moveState.yawLeft=-(t.pageX-e.offset[0]-n)/n,this.moveState.pitchDown=(t.pageY-e.offset[1]-r)/r,this.updateRotationVector()}},this.pointerup=function(t){if(!1!==this.enabled){if(this.dragToLook)this.status--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(t.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()}},this.pointercancel=function(){!1!==this.enabled&&(this.dragToLook?(this.status=0,this.moveState.yawLeft=this.moveState.pitchDown=0):(this.moveState.forward=0,this.moveState.back=0,this.updateMovementVector()),this.updateRotationVector())},this.contextMenu=function(t){!1!==this.enabled&&t.preventDefault()},this.update=function(t){if(!1===this.enabled)return;const e=t*n.movementSpeed,o=t*n.rollSpeed;n.object.translateX(n.moveVector.x*e),n.object.translateY(n.moveVector.y*e),n.object.translateZ(n.moveVector.z*e),n.tmpQuaternion.set(n.rotationVector.x*o,n.rotationVector.y*o,n.rotationVector.z*o,1).normalize(),n.object.quaternion.multiply(n.tmpQuaternion),(a.distanceToSquared(n.object.position)>r||8*(1-i.dot(n.object.quaternion))>r)&&(n.dispatchEvent(By),i.copy(n.object.quaternion),a.copy(n.object.position))},this.updateMovementVector=function(){const t=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=-t+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",o),this.domElement.removeEventListener("pointerdown",A),this.domElement.removeEventListener("pointermove",s),this.domElement.removeEventListener("pointerup",l),this.domElement.removeEventListener("pointercancel",c),window.removeEventListener("keydown",u),window.removeEventListener("keyup",h)};const o=this.contextMenu.bind(this),s=this.pointermove.bind(this),A=this.pointerdown.bind(this),l=this.pointerup.bind(this),c=this.pointercancel.bind(this),u=this.keydown.bind(this),h=this.keyup.bind(this);this.domElement.addEventListener("contextmenu",o),this.domElement.addEventListener("pointerdown",A),this.domElement.addEventListener("pointermove",s),this.domElement.addEventListener("pointerup",l),this.domElement.addEventListener("pointercancel",c),window.addEventListener("keydown",u),window.addEventListener("keyup",h),this.updateMovementVector(),this.updateRotationVector()}}const Fy={name:"CopyShader",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\n\t\t}"};class zy{constructor(){this.isPass=!0,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.")}dispose(){}}const Gy=new Gr(-1,1,1,-1,0,1);const Hy=new class extends zn{constructor(){super(),this.setAttribute("position",new On([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new On([0,2,0,0,2,0],2))}};class jy{constructor(t){this._mesh=new ar(Hy,t)}dispose(){this._mesh.geometry.dispose()}render(t){t.render(this._mesh,Gy)}get material(){return this._mesh.material}set material(t){this._mesh.material=t}}class Vy extends zy{constructor(t,e){super(),this.textureID=void 0!==e?e:"tDiffuse",t instanceof hr?(this.uniforms=t.uniforms,this.material=t):t&&(this.uniforms=ur.clone(t.uniforms),this.material=new hr({name:void 0!==t.name?t.name:"unspecified",defines:Object.assign({},t.defines),uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),this.fsQuad=new jy(this.material)}render(t,e,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(e),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),this.fsQuad.render(t))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}class Wy extends zy{constructor(t,e){super(),this.scene=t,this.camera=e,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(t,e,n){const r=t.getContext(),i=t.state;let a,o;i.buffers.color.setMask(!1),i.buffers.depth.setMask(!1),i.buffers.color.setLocked(!0),i.buffers.depth.setLocked(!0),this.inverse?(a=0,o=1):(a=1,o=0),i.buffers.stencil.setTest(!0),i.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),i.buffers.stencil.setFunc(r.ALWAYS,a,4294967295),i.buffers.stencil.setClear(o),i.buffers.stencil.setLocked(!0),t.setRenderTarget(n),this.clear&&t.clear(),t.render(this.scene,this.camera),t.setRenderTarget(e),this.clear&&t.clear(),t.render(this.scene,this.camera),i.buffers.color.setLocked(!1),i.buffers.depth.setLocked(!1),i.buffers.color.setMask(!0),i.buffers.depth.setMask(!0),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 Xy extends zy{constructor(){super(),this.needsSwap=!1}render(t){t.state.buffers.stencil.setLocked(!1),t.state.buffers.stencil.setTest(!1)}}class Qy{constructor(t,e){if(this.renderer=t,this._pixelRatio=t.getPixelRatio(),void 0===e){const n=t.getSize(new Lt);this._width=n.width,this._height=n.height,(e=new ee(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:V})).texture.name="EffectComposer.rt1"}else this._width=e.width,this._height=e.height;this.renderTarget1=e,this.renderTarget2=e.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new Vy(Fy),this.copyPass.material.blending=0,this.clock=new Hs}swapBuffers(){const t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t}addPass(t){this.passes.push(t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(t,e){this.passes.splice(e,0,t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(t){const e=this.passes.indexOf(t);-1!==e&&this.passes.splice(e,1)}isLastEnabledPass(t){for(let e=t+1;e<this.passes.length;e++)if(this.passes[e].enabled)return!1;return!0}render(t){void 0===t&&(t=this.clock.getDelta());const e=this.renderer.getRenderTarget();let n=!1;for(let e=0,r=this.passes.length;e<r;e++){const r=this.passes[e];if(!1!==r.enabled){if(r.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(e),r.render(this.renderer,this.writeBuffer,this.readBuffer,t,n),r.needsSwap){if(n){const e=this.renderer.getContext(),n=this.renderer.state.buffers.stencil;n.setFunc(e.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,t),n.setFunc(e.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==Wy&&(r instanceof Wy?n=!0:r instanceof Xy&&(n=!1))}}this.renderer.setRenderTarget(e)}reset(t){if(void 0===t){const e=this.renderer.getSize(new Lt);this._pixelRatio=this.renderer.getPixelRatio(),this._width=e.width,this._height=e.height,(t=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(t,e){this._width=t,this._height=e;const n=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget1.setSize(n,r),this.renderTarget2.setSize(n,r);for(let t=0;t<this.passes.length;t++)this.passes[t].setSize(n,r)}setPixelRatio(t){this._pixelRatio=t,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}class Yy extends zy{constructor(t,e,n=null,r=null,i=null){super(),this.scene=t,this.camera=e,this.overrideMaterial=n,this.clearColor=r,this.clearAlpha=i,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new Mn}render(t,e,n){const r=t.autoClear;let i,a;t.autoClear=!1,null!==this.overrideMaterial&&(a=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),null!==this.clearColor&&(t.getClearColor(this._oldClearColor),t.setClearColor(this.clearColor)),null!==this.clearAlpha&&(i=t.getClearAlpha(),t.setClearAlpha(this.clearAlpha)),1==this.clearDepth&&t.clearDepth(),t.setRenderTarget(this.renderToScreen?null:n),!0===this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),t.render(this.scene,this.camera),null!==this.clearColor&&t.setClearColor(this._oldClearColor),null!==this.clearAlpha&&t.setClearAlpha(i),null!==this.overrideMaterial&&(this.scene.overrideMaterial=a),t.autoClear=r}}function Zy(){return Zy=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Zy.apply(this,arguments)}function Ky(t,e){return Ky=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ky(t,e)}function Jy(t){return Jy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Jy(t)}function $y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return($y=function(){return!!t})()}function tx(t){var e="function"==typeof Map?new Map:void 0;return tx=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if($y())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&Ky(i,n.prototype),i}(t,arguments,Jy(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Ky(n,t)},tx(t)}var ex={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function nx(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r,i=e[0],a=[];for(r=1;r<e.length;r+=1)a.push(e[r]);return a.forEach((function(t){i=i.replace(/%[a-z]/,t)})),i}var rx=function(t){var e,n;function r(e){var n;if("production"===process.env.NODE_ENV)n=t.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+e+" for more information.")||this;else{for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];n=t.call(this,nx.apply(void 0,[ex[e]].concat(i)))||this}return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n)}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,Ky(e,n),r}(tx(Error));function ix(t){return Math.round(255*t)}function ax(t,e,n){return ix(t)+","+ix(e)+","+ix(n)}function ox(t,e,n,r){if(void 0===r&&(r=ax),0===e)return r(n,n,n);var i=(t%360+360)%360/60,a=(1-Math.abs(2*n-1))*e,o=a*(1-Math.abs(i%2-1)),s=0,A=0,l=0;i>=0&&i<1?(s=a,A=o):i>=1&&i<2?(s=o,A=a):i>=2&&i<3?(A=a,l=o):i>=3&&i<4?(A=o,l=a):i>=4&&i<5?(s=o,l=a):i>=5&&i<6&&(s=a,l=o);var c=n-a/2;return r(s+c,A+c,l+c)}var sx={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 Ax=/^#[a-fA-F0-9]{6}$/,lx=/^#[a-fA-F0-9]{8}$/,cx=/^#[a-fA-F0-9]{3}$/,ux=/^#[a-fA-F0-9]{4}$/,hx=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,dx=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,fx=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,px=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function mx(t){if("string"!=typeof t)throw new rx(3);var e=function(t){if("string"!=typeof t)return t;var e=t.toLowerCase();return sx[e]?"#"+sx[e]:t}(t);if(e.match(Ax))return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16)};if(e.match(lx)){var n=parseFloat((parseInt(""+e[7]+e[8],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16),alpha:n}}if(e.match(cx))return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16)};if(e.match(ux)){var r=parseFloat((parseInt(""+e[4]+e[4],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16),alpha:r}}var i=hx.exec(e);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var a=dx.exec(e.substring(0,50));if(a)return{red:parseInt(""+a[1],10),green:parseInt(""+a[2],10),blue:parseInt(""+a[3],10),alpha:parseFloat(""+a[4])>1?parseFloat(""+a[4])/100:parseFloat(""+a[4])};var o=fx.exec(e);if(o){var s="rgb("+ox(parseInt(""+o[1],10),parseInt(""+o[2],10)/100,parseInt(""+o[3],10)/100)+")",A=hx.exec(s);if(!A)throw new rx(4,e,s);return{red:parseInt(""+A[1],10),green:parseInt(""+A[2],10),blue:parseInt(""+A[3],10)}}var l=px.exec(e.substring(0,50));if(l){var c="rgb("+ox(parseInt(""+l[1],10),parseInt(""+l[2],10)/100,parseInt(""+l[3],10)/100)+")",u=hx.exec(c);if(!u)throw new rx(4,e,c);return{red:parseInt(""+u[1],10),green:parseInt(""+u[2],10),blue:parseInt(""+u[3],10),alpha:parseFloat(""+l[4])>1?parseFloat(""+l[4])/100:parseFloat(""+l[4])}}throw new rx(5)}function gx(t){return function(t){var e,n=t.red/255,r=t.green/255,i=t.blue/255,a=Math.max(n,r,i),o=Math.min(n,r,i),s=(a+o)/2;if(a===o)return void 0!==t.alpha?{hue:0,saturation:0,lightness:s,alpha:t.alpha}:{hue:0,saturation:0,lightness:s};var A=a-o,l=s>.5?A/(2-a-o):A/(a+o);switch(a){case n:e=(r-i)/A+(r<i?6:0);break;case r:e=(i-n)/A+2;break;default:e=(n-r)/A+4}return e*=60,void 0!==t.alpha?{hue:e,saturation:l,lightness:s,alpha:t.alpha}:{hue:e,saturation:l,lightness:s}}(mx(t))}var vx=function(t){return 7===t.length&&t[1]===t[2]&&t[3]===t[4]&&t[5]===t[6]?"#"+t[1]+t[3]+t[5]:t};function _x(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function yx(t){return _x(Math.round(255*t))}function xx(t,e,n){return vx("#"+yx(t)+yx(e)+yx(n))}function bx(t,e,n){return ox(t,e,n,xx)}function Mx(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return vx("#"+_x(t)+_x(e)+_x(n));if("object"==typeof t&&void 0===e&&void 0===n)return vx("#"+_x(t.red)+_x(t.green)+_x(t.blue));throw new rx(6)}function wx(t,e,n,r){if("string"==typeof t&&"number"==typeof e){var i=mx(t);return"rgba("+i.red+","+i.green+","+i.blue+","+e+")"}if("number"==typeof t&&"number"==typeof e&&"number"==typeof n&&"number"==typeof r)return r>=1?Mx(t,e,n):"rgba("+t+","+e+","+n+","+r+")";if("object"==typeof t&&void 0===e&&void 0===n&&void 0===r)return t.alpha>=1?Mx(t.red,t.green,t.blue):"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")";throw new rx(7)}var Ex=function(t){return"number"==typeof t.red&&"number"==typeof t.green&&"number"==typeof t.blue&&("number"!=typeof t.alpha||void 0===t.alpha)},Sx=function(t){return"number"==typeof t.red&&"number"==typeof t.green&&"number"==typeof t.blue&&"number"==typeof t.alpha},Tx=function(t){return"number"==typeof t.hue&&"number"==typeof t.saturation&&"number"==typeof t.lightness&&("number"!=typeof t.alpha||void 0===t.alpha)},Cx=function(t){return"number"==typeof t.hue&&"number"==typeof t.saturation&&"number"==typeof t.lightness&&"number"==typeof t.alpha};function Rx(t){if("object"!=typeof t)throw new rx(8);if(Sx(t))return wx(t);if(Ex(t))return Mx(t);if(Cx(t))return function(t,e,n,r){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n&&"number"==typeof r)return r>=1?bx(t,e,n):"rgba("+ox(t,e,n)+","+r+")";if("object"==typeof t&&void 0===e&&void 0===n&&void 0===r)return t.alpha>=1?bx(t.hue,t.saturation,t.lightness):"rgba("+ox(t.hue,t.saturation,t.lightness)+","+t.alpha+")";throw new rx(2)}(t);if(Tx(t))return function(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return bx(t,e,n);if("object"==typeof t&&void 0===e&&void 0===n)return bx(t.hue,t.saturation,t.lightness);throw new rx(1)}(t);throw new rx(8)}function Px(t,e,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=e?t.apply(this,r):Px(t,e,r)}}function Lx(t){return Px(t,t.length,[])}function Dx(t,e,n){return Math.max(t,Math.min(e,n))}Lx((function(t,e){if("transparent"===e)return e;var n=gx(e);return Rx(Zy({},n,{hue:n.hue+parseFloat(t)}))})),Lx((function(t,e){if("transparent"===e)return e;var n=gx(e);return Rx(Zy({},n,{lightness:Dx(0,1,n.lightness-parseFloat(t))}))})),Lx((function(t,e){if("transparent"===e)return e;var n=gx(e);return Rx(Zy({},n,{saturation:Dx(0,1,n.saturation-parseFloat(t))}))})),Lx((function(t,e){if("transparent"===e)return e;var n=gx(e);return Rx(Zy({},n,{lightness:Dx(0,1,n.lightness+parseFloat(t))}))}));var Ox=Lx((function(t,e,n){if("transparent"===e)return n;if("transparent"===n)return e;if(0===t)return n;var r=mx(e),i=Zy({},r,{alpha:"number"==typeof r.alpha?r.alpha:1}),a=mx(n),o=Zy({},a,{alpha:"number"==typeof a.alpha?a.alpha:1}),s=i.alpha-o.alpha,A=2*parseFloat(t)-1,l=((A*s==-1?A:A+s)/(1+A*s)+1)/2,c=1-l;return wx({red:Math.floor(i.red*l+o.red*c),green:Math.floor(i.green*l+o.green*c),blue:Math.floor(i.blue*l+o.blue*c),alpha:i.alpha*parseFloat(t)+o.alpha*(1-parseFloat(t))})})),Ix=Ox;var qx=Lx((function(t,e){if("transparent"===e)return e;var n=mx(e);return wx(Zy({},n,{alpha:Dx(0,1,(100*("number"==typeof n.alpha?n.alpha:1)+100*parseFloat(t))/100)}))})),Ux=qx;Lx((function(t,e){if("transparent"===e)return e;var n=gx(e);return Rx(Zy({},n,{saturation:Dx(0,1,n.saturation+parseFloat(t))}))})),Lx((function(t,e){return"transparent"===e?e:Rx(Zy({},gx(e),{hue:parseFloat(t)}))})),Lx((function(t,e){return"transparent"===e?e:Rx(Zy({},gx(e),{lightness:parseFloat(t)}))})),Lx((function(t,e){return"transparent"===e?e:Rx(Zy({},gx(e),{saturation:parseFloat(t)}))})),Lx((function(t,e){return"transparent"===e?e:Ix(parseFloat(t),"rgb(0, 0, 0)",e)})),Lx((function(t,e){return"transparent"===e?e:Ix(parseFloat(t),"rgb(255, 255, 255)",e)})),Lx((function(t,e){if("transparent"===e)return e;var n=mx(e);return wx(Zy({},n,{alpha:Dx(0,1,+(100*("number"==typeof n.alpha?n.alpha:1)-100*parseFloat(t)).toFixed(2)/100)}))}));function Nx(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function Bx(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],A=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;A=!1}else for(;!(A=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);A=!0);}catch(t){l=!0,i=t}finally{try{if(!A&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Fx(t,e)||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 kx(t){return function(t){if(Array.isArray(t))return zx(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Fx(t)||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 Fx(t,e){if(t){if("string"==typeof t)return zx(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zx(t,e):void 0}}function zx(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t))}}(".scene-nav-info {\n bottom: 5px;\n width: 100%;\n text-align: center;\n color: slategrey;\n opacity: 0.7;\n font-size: 10px;\n}\n\n.scene-tooltip {\n top: 0;\n color: lavender;\n font-size: 15px;\n}\n\n.scene-nav-info, .scene-tooltip {\n position: absolute;\n font-family: sans-serif;\n pointer-events: none;\n user-select: none;\n}\n\n.scene-container canvas:focus {\n outline: none;\n}");var Gx=window.THREE?window.THREE:{WebGLRenderer:fo,Scene:class extends sn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.fog&&(e.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(e.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(e.object.backgroundIntensity=this.backgroundIntensity),e}},PerspectiveCamera:gr,Raycaster:class{constructor(t,e,n=0,r=1/0){this.ray=new Ie(t,e),this.near=n,this.far=r,this.camera=null,this.layers=new We,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type: "+e.type)}intersectObject(t,e=!0,n=[]){return Xs(t,this,n,e),n.sort(Ws),n}intersectObjects(t,e=!0,n=[]){for(let r=0,i=t.length;r<i;r++)Xs(t[r],this,n,e);return n.sort(Ws),n}},SRGBColorSpace:rt,TextureLoader:Us,Vector2:Lt,Vector3:ae,Box3:Ae,Color:Mn,Mesh:ar,SphereGeometry:Ts,MeshBasicMaterial:Tn,BackSide:g,EventDispatcher:gt,MOUSE:A,Quaternion:ie,Spherical:Qs,Clock:Hs},Hx=NA({props:{width:{default:window.innerWidth,onChange:function(t,e,n){isNaN(t)&&(e.width=n)}},height:{default:window.innerHeight,onChange:function(t,e,n){isNaN(t)&&(e.height=n)}},backgroundColor:{default:"#000011"},backgroundImageUrl:{},onBackgroundImageLoaded:{},showNavInfo:{default:!0},skyRadius:{default:5e4},objects:{default:[]},lights:{default:[]},enablePointerInteraction:{default:!0,onChange:function(t,e){e.hoverObj=null,e.toolTipElem&&(e.toolTipElem.innerHTML="")},triggerUpdate:!1},lineHoverPrecision:{default:1,triggerUpdate:!1},hoverOrderComparator:{default:function(){return-1},triggerUpdate:!1},hoverFilter:{default:function(){return!0},triggerUpdate:!1},tooltipContent:{triggerUpdate:!1},hoverDuringDrag:{default:!1,triggerUpdate:!1},clickAfterDrag:{default:!1,triggerUpdate:!1},onHover:{default:function(){},triggerUpdate:!1},onClick:{default:function(){},triggerUpdate:!1},onRightClick:{triggerUpdate:!1}},methods:{tick:function(t){if(t.initialised){if(t.controls.update&&t.controls.update(t.clock.getDelta()),t.postProcessingComposer?t.postProcessingComposer.render():t.renderer.render(t.scene,t.camera),t.extraRenderers.forEach((function(e){return e.render(t.scene,t.camera)})),t.enablePointerInteraction){var e=null;if(t.hoverDuringDrag||!t.isPointerDragging){var n=this.intersectingObjects(t.pointerPos.x,t.pointerPos.y).filter((function(e){return t.hoverFilter(e.object)})).sort((function(e,n){return t.hoverOrderComparator(e.object,n.object)})),r=n.length?n[0]:null;e=r?r.object:null,t.intersectionPoint=r?r.point:null}e!==t.hoverObj&&(t.onHover(e,t.hoverObj),t.toolTipElem.innerHTML=e&&$h(t.tooltipContent)(e)||"",t.hoverObj=e)}XA()}return this},getPointerPos:function(t){var e=t.pointerPos;return{x:e.x,y:e.y}},cameraPosition:function(t,e,n,r){var i=t.camera;if(e&&t.initialised){var a=e,o=n||{x:0,y:0,z:0};if(r){var s=Object.assign({},i.position),A=u();new VA(s).to(a,r).easing(kA.Quadratic.Out).onUpdate(l).start(),new VA(A).to(o,r/3).easing(kA.Quadratic.Out).onUpdate(c).start()}else l(a),c(o);return this}return Object.assign({},i.position,{lookAt:u()});function l(t){var e=t.x,n=t.y,r=t.z;void 0!==e&&(i.position.x=e),void 0!==n&&(i.position.y=n),void 0!==r&&(i.position.z=r)}function c(e){var n=new Gx.Vector3(e.x,e.y,e.z);t.controls.target?t.controls.target=n:i.lookAt(n)}function u(){return Object.assign(new Gx.Vector3(0,0,-1e3).applyQuaternion(i.quaternion).add(i.position))}},zoomToFit:function(t){for(var e=arguments.length>1&&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),a=3;a<r;a++)i[a-3]=arguments[a];return this.fitToBbox(this.getBbox.apply(this,i),e,n)},fitToBbox:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=t.camera;if(e){var a=new Gx.Vector3(0,0,0),o=2*Math.max.apply(Math,kx(Object.entries(e).map((function(t){var e=Bx(t,2),n=e[0],r=e[1];return Math.max.apply(Math,kx(r.map((function(t){return Math.abs(a[n]-t)}))))})))),s=(1-2*r/t.height)*i.fov,A=o/Math.atan(s*Math.PI/180),l=A/i.aspect,c=Math.max(A,l);if(c>0){var u=a.clone().sub(i.position).normalize().multiplyScalar(-c);this.cameraPosition(u,a,n)}}return this},getBbox:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=new Gx.Box3(new Gx.Vector3(0,0,0),new Gx.Vector3(0,0,0)),r=t.objects.filter(e);return r.length?(r.forEach((function(t){return n.expandByObject(t)})),Object.assign.apply(Object,kx(["x","y","z"].map((function(t){return e={},r=t,i=[n.min[t],n.max[t]],(r=Nx(r))in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i,e;var e,r,i}))))):null},getScreenCoords:function(t,e,n,r){var i=new Gx.Vector3(e,n,r);return i.project(this.camera()),{x:(i.x+1)*t.width/2,y:-(i.y-1)*t.height/2}},getSceneCoords:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=new Gx.Vector2(e/t.width*2-1,-n/t.height*2+1),a=new Gx.Raycaster;return a.setFromCamera(i,t.camera),Object.assign({},a.ray.at(r,new Gx.Vector3))},intersectingObjects:function(t,e,n){var r=new Gx.Vector2(e/t.width*2-1,-n/t.height*2+1),i=new Gx.Raycaster;return i.params.Line.threshold=t.lineHoverPrecision,i.setFromCamera(r,t.camera),i.intersectObjects(t.objects,!0)},renderer:function(t){return t.renderer},scene:function(t){return t.scene},camera:function(t){return t.camera},postProcessingComposer:function(t){return t.postProcessingComposer},controls:function(t){return t.controls},tbControls:function(t){return t.controls}},stateInit:function(){return{scene:new Gx.Scene,camera:new Gx.PerspectiveCamera,clock:new Gx.Clock}},init:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.controlType,i=void 0===r?"trackball":r,a=n.rendererConfig,o=void 0===a?{}:a,s=n.extraRenderers,A=void 0===s?[]:s,l=n.waitForLoadComplete,c=void 0===l||l;t.innerHTML="",t.appendChild(e.container=document.createElement("div")),e.container.className="scene-container",e.container.style.position="relative",e.container.appendChild(e.navInfo=document.createElement("div")),e.navInfo.className="scene-nav-info",e.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]||"",e.navInfo.style.display=e.showNavInfo?null:"none",e.toolTipElem=document.createElement("div"),e.toolTipElem.classList.add("scene-tooltip"),e.container.appendChild(e.toolTipElem),e.pointerPos=new Gx.Vector2,e.pointerPos.x=-2,e.pointerPos.y=-2,["pointermove","pointerdown"].forEach((function(t){return e.container.addEventListener(t,(function(n){if("pointerdown"===t&&(e.isPointerPressed=!0),!e.isPointerDragging&&"pointermove"===n.type&&(n.pressure>0||e.isPointerPressed)&&("touch"!==n.pointerType||void 0===n.movementX||[n.movementX,n.movementY].some((function(t){return Math.abs(t)>1})))&&(e.isPointerDragging=!0),e.enablePointerInteraction){var r=(i=e.container,a=i.getBoundingClientRect(),o=window.pageXOffset||document.documentElement.scrollLeft,s=window.pageYOffset||document.documentElement.scrollTop,{top:a.top+s,left:a.left+o});e.pointerPos.x=n.pageX-r.left,e.pointerPos.y=n.pageY-r.top,e.toolTipElem.style.top="".concat(e.pointerPos.y,"px"),e.toolTipElem.style.left="".concat(e.pointerPos.x,"px"),e.toolTipElem.style.transform="translate(-".concat(e.pointerPos.x/e.width*100,"%, ").concat(e.height-e.pointerPos.y<100?"calc(-100% - 8px)":"21px",")")}var i,a,o,s}),{passive:!0})})),e.container.addEventListener("pointerup",(function(t){e.isPointerPressed=!1,e.isPointerDragging&&(e.isPointerDragging=!1,!e.clickAfterDrag)||requestAnimationFrame((function(){0===t.button&&e.onClick(e.hoverObj||null,t,e.intersectionPoint),2===t.button&&e.onRightClick&&e.onRightClick(e.hoverObj||null,t,e.intersectionPoint)}))}),{passive:!0,capture:!0}),e.container.addEventListener("contextmenu",(function(t){e.onRightClick&&t.preventDefault()})),e.renderer=new Gx.WebGLRenderer(Object.assign({antialias:!0,alpha:!0},o)),e.renderer.setPixelRatio(Math.min(2,window.devicePixelRatio)),e.container.appendChild(e.renderer.domElement),e.extraRenderers=A,e.extraRenderers.forEach((function(t){t.domElement.style.position="absolute",t.domElement.style.top="0px",t.domElement.style.pointerEvents="none",e.container.appendChild(t.domElement)})),e.postProcessingComposer=new Qy(e.renderer),e.postProcessingComposer.addPass(new Yy(e.scene,e.camera)),e.controls=new{trackball:Py,orbit:Ny,fly:ky}[i](e.camera,e.renderer.domElement),"fly"===i&&(e.controls.movementSpeed=300,e.controls.rollSpeed=Math.PI/6,e.controls.dragToLook=!0),"trackball"!==i&&"orbit"!==i||(e.controls.minDistance=.1,e.controls.maxDistance=e.skyRadius,e.controls.addEventListener("start",(function(){e.controlsEngaged=!0})),e.controls.addEventListener("change",(function(){e.controlsEngaged&&(e.controlsDragging=!0)})),e.controls.addEventListener("end",(function(){e.controlsEngaged=!1,e.controlsDragging=!1}))),[e.renderer,e.postProcessingComposer].concat(kx(e.extraRenderers)).forEach((function(t){return t.setSize(e.width,e.height)})),e.camera.aspect=e.width/e.height,e.camera.updateProjectionMatrix(),e.camera.position.z=1e3,e.scene.add(e.skysphere=new Gx.Mesh),e.skysphere.visible=!1,e.loadComplete=e.scene.visible=!c,window.scene=e.scene},update:function(t,e){if(t.width&&t.height&&(e.hasOwnProperty("width")||e.hasOwnProperty("height"))&&(t.container.style.width="".concat(t.width,"px"),t.container.style.height="".concat(t.height,"px"),[t.renderer,t.postProcessingComposer].concat(kx(t.extraRenderers)).forEach((function(e){return e.setSize(t.width,t.height)})),t.camera.aspect=t.width/t.height,t.camera.updateProjectionMatrix()),e.hasOwnProperty("skyRadius")&&t.skyRadius&&(t.controls.hasOwnProperty("maxDistance")&&e.skyRadius&&(t.controls.maxDistance=Math.min(t.controls.maxDistance,t.skyRadius)),t.camera.far=2.5*t.skyRadius,t.camera.updateProjectionMatrix(),t.skysphere.geometry=new Gx.SphereGeometry(t.skyRadius)),e.hasOwnProperty("backgroundColor")){var n=mx(t.backgroundColor).alpha;void 0===n&&(n=1),t.renderer.setClearColor(new Gx.Color(Ux(1,t.backgroundColor)),n)}function r(){t.loadComplete=t.scene.visible=!0}e.hasOwnProperty("backgroundImageUrl")&&(t.backgroundImageUrl?(new Gx.TextureLoader).load(t.backgroundImageUrl,(function(e){e.colorSpace=Gx.SRGBColorSpace,t.skysphere.material=new Gx.MeshBasicMaterial({map:e,side:Gx.BackSide}),t.skysphere.visible=!0,t.onBackgroundImageLoaded&&setTimeout(t.onBackgroundImageLoaded),!t.loadComplete&&r()})):(t.skysphere.visible=!1,t.skysphere.material.map=null,!t.loadComplete&&r())),e.hasOwnProperty("showNavInfo")&&(t.navInfo.style.display=t.showNavInfo?null:"none"),e.hasOwnProperty("lights")&&((e.lights||[]).forEach((function(e){return t.scene.remove(e)})),t.lights.forEach((function(e){return t.scene.add(e)}))),e.hasOwnProperty("objects")&&((e.objects||[]).forEach((function(e){return t.scene.remove(e)})),t.objects.forEach((function(e){return t.scene.add(e)})))}});function jx(t,e){var n=new e;return n._destructor&&n._destructor(),{linkProp:function(e){return{default:n[e](),onChange:function(n,r){r[t][e](n)},triggerUpdate:!1}},linkMethod:function(e){return function(n){for(var r=n[t],i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];var s=r[e].apply(r,a);return s===r?this:s}}}}var Vx=["rendererConfig","waitForGlobeReady"],Wx=e(e({},window.THREE?window.THREE:{AmbientLight:class extends Ns{constructor(t,e){super(t,e),this.isAmbientLight=!0,this.type="AmbientLight"}},DirectionalLight:class extends Ns{constructor(t,e){super(t,e),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(sn.DEFAULT_UP),this.updateMatrix(),this.target=new sn,this.shadow=new Gs}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}},Vector2:Lt}),{},{CSS2DRenderer:class{constructor(t={}){const e=this;let n,r,i,a;const o={objects:new WeakMap},s=void 0!==t.element?t.element:document.createElement("div");function A(t,n,r){if(t.isCSS2DObject){Js.setFromMatrixPosition(t.matrixWorld),Js.applyMatrix4(tA);const A=!0===t.visible&&Js.z>=-1&&Js.z<=1&&!0===t.layers.test(r.layers);if(t.element.style.display=!0===A?"":"none",!0===A){t.onBeforeRender(e,n,r);const o=t.element;o.style.transform="translate("+-100*t.center.x+"%,"+-100*t.center.y+"%)translate("+(Js.x*i+i)+"px,"+(-Js.y*a+a)+"px)",o.parentNode!==s&&s.appendChild(o),t.onAfterRender(e,n,r)}const c={distanceToCameraSquared:l(r,t)};o.objects.set(t,c)}for(let e=0,i=t.children.length;e<i;e++)A(t.children[e],n,r)}function l(t,e){return eA.setFromMatrixPosition(t.matrixWorld),nA.setFromMatrixPosition(e.matrixWorld),eA.distanceToSquared(nA)}s.style.overflow="hidden",this.domElement=s,this.getSize=function(){return{width:n,height:r}},this.render=function(t,e){!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),null===e.parent&&!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),$s.copy(e.matrixWorldInverse),tA.multiplyMatrices(e.projectionMatrix,$s),A(t,t,e),function(t){const e=function(t){const e=[];return t.traverse((function(t){t.isCSS2DObject&&e.push(t)})),e}(t).sort((function(t,e){if(t.renderOrder!==e.renderOrder)return e.renderOrder-t.renderOrder;return o.objects.get(t).distanceToCameraSquared-o.objects.get(e).distanceToCameraSquared})),n=e.length;for(let t=0,r=e.length;t<r;t++)e[t].element.style.zIndex=n-t}(t)},this.setSize=function(t,e){n=t,r=e,i=n/2,a=r/2,s.style.width=t+"px",s.style.height=e+"px"}}}}),Xx=jx("globe",Sy),Qx=Object.assign.apply(Object,a(["globeImageUrl","bumpImageUrl","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude","onGlobeReady","pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration","arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration","polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration","pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration","heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration","hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration","hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration","tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration","ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod","labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration","htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlTransitionDuration","objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject","customLayerData","customThreeObject","customThreeObjectUpdate"].map((function(t){return r({},t,Xx.linkProp(t))})))),Yx=Object.assign.apply(Object,a(["globeMaterial","getGlobeRadius","getCoords","toGeoCoords"].map((function(t){return r({},t,Xx.linkMethod(t))})))),Zx=jx("renderObjs",Hx),Kx=Object.assign.apply(Object,a(["width","height","backgroundColor","backgroundImageUrl","enablePointerInteraction"].map((function(t){return r({},t,Zx.linkProp(t))})))),Jx=Object.assign.apply(Object,a(["lights","postProcessingComposer"].map((function(t){return r({},t,Zx.linkMethod(t))})))),$x=NA({props:e(e({onZoom:{triggerUpdate:!1},onGlobeClick:{triggerUpdate:!1},onGlobeRightClick:{triggerUpdate:!1},pointLabel:{default:"name",triggerUpdate:!1},onPointClick:{triggerUpdate:!1},onPointRightClick:{triggerUpdate:!1},onPointHover:{triggerUpdate:!1},arcLabel:{default:"name",triggerUpdate:!1},onArcClick:{triggerUpdate:!1},onArcRightClick:{triggerUpdate:!1},onArcHover:{triggerUpdate:!1},polygonLabel:{default:"name",triggerUpdate:!1},onPolygonClick:{triggerUpdate:!1},onPolygonRightClick:{triggerUpdate:!1},onPolygonHover:{triggerUpdate:!1},pathLabel:{default:"name",triggerUpdate:!1},onPathClick:{triggerUpdate:!1},onPathRightClick:{triggerUpdate:!1},onPathHover:{triggerUpdate:!1},onHeatmapClick:{triggerUpdate:!1},onHeatmapRightClick:{triggerUpdate:!1},onHeatmapHover:{triggerUpdate:!1},hexLabel:{triggerUpdate:!1},onHexClick:{triggerUpdate:!1},onHexRightClick:{triggerUpdate:!1},onHexHover:{triggerUpdate:!1},hexPolygonLabel:{triggerUpdate:!1},onHexPolygonClick:{triggerUpdate:!1},onHexPolygonRightClick:{triggerUpdate:!1},onHexPolygonHover:{triggerUpdate:!1},tileLabel:{default:"name",triggerUpdate:!1},onTileClick:{triggerUpdate:!1},onTileRightClick:{triggerUpdate:!1},onTileHover:{triggerUpdate:!1},labelLabel:{triggerUpdate:!1},onLabelClick:{triggerUpdate:!1},onLabelRightClick:{triggerUpdate:!1},onLabelHover:{triggerUpdate:!1},objectLabel:{default:"name",triggerUpdate:!1},onObjectClick:{triggerUpdate:!1},onObjectRightClick:{triggerUpdate:!1},onObjectHover:{triggerUpdate:!1},customLayerLabel:{default:"name",triggerUpdate:!1},onCustomLayerClick:{triggerUpdate:!1},onCustomLayerRightClick:{triggerUpdate:!1},onCustomLayerHover:{triggerUpdate:!1},pointerEventsFilter:{default:function(){return!0},triggerUpdate:!1,onChange:function(t,e){return e.renderObjs.hoverFilter((function(e){return t(e,e.__data)}))}},lineHoverPrecision:{default:.2,triggerUpdate:!1,onChange:function(t,e){return e.renderObjs.lineHoverPrecision(t)}}},Qx),Kx),methods:e(e({pauseAnimation:function(t){var e;return null!==t.animationFrameRequestId&&(cancelAnimationFrame(t.animationFrameRequestId),t.animationFrameRequestId=null),null===(e=t.globe)||void 0===e||e.pauseAnimation(),this},resumeAnimation:function(t){var e;return null===t.animationFrameRequestId&&this._animationCycle(),null===(e=t.globe)||void 0===e||e.resumeAnimation(),this},_animationCycle:function(t){t.renderObjs.tick(),t.animationFrameRequestId=requestAnimationFrame(this._animationCycle)},pointOfView:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.globe.toGeoCoords(t.renderObjs.cameraPosition());if(void 0===e.lat&&void 0===e.lng&&void 0===e.altitude)return r;var i=Object.assign({},r,e);if(["lat","lng","altitude"].forEach((function(t){return i[t]=+i[t]})),n){for(;r.lng-i.lng>180;)r.lng-=360;for(;r.lng-i.lng<-180;)r.lng+=360;new VA(r).to(i,n).easing(kA.Cubic.InOut).onUpdate(a).start()}else a(i);return this;function a(e){var n=e.lat,r=e.lng,i=e.altitude;t.renderObjs.cameraPosition(t.globe.getCoords(n,r,i))}},getScreenCoords:function(t){for(var e,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=(e=t.globe).getCoords.apply(e,r);return t.renderObjs.getScreenCoords(a.x,a.y,a.z)},toGlobeCoords:function(t,e,n){var r=t.renderObjs.intersectingObjects(e,n).find((function(t){return"globe"===t.object.__globeObjType}));if(!r)return null;var i=t.globe.toGeoCoords(r.point);return{lat:i.lat,lng:i.lng}},scene:function(t){return t.renderObjs.scene()},camera:function(t){return t.renderObjs.camera()},renderer:function(t){return t.renderObjs.renderer()},controls:function(t){return t.renderObjs.controls()},_destructor:function(t){t.globe._destructor(),this.pauseAnimation(),this.pointsData([]),this.arcsData([]),this.polygonsData([]),this.pathsData([]),this.heatmapsData([]),this.hexBinPointsData([]),this.hexPolygonsData([]),this.tilesData([]),this.labelsData([]),this.htmlElementsData([]),this.objectsData([]),this.customLayerData([])}},Yx),Jx),stateInit:function(t){var n=t.rendererConfig,r=t.waitForGlobeReady,a=void 0===r||r,o=i(t,Vx),s=new Sy(e({waitForGlobeReady:a},o));return{globe:s,renderObjs:Hx({controlType:"orbit",rendererConfig:n,waitForLoadComplete:a,extraRenderers:[new Wx.CSS2DRenderer]}).skyRadius(500*s.getGlobeRadius()).showNavInfo(!1).objects([s]).lights([new Wx.AmbientLight(13421772,Math.PI),new Wx.DirectionalLight(16777215,.6*Math.PI)])}},init:function(t,e){var n=this;t.innerHTML="",t.appendChild(e.container=document.createElement("div")),e.container.style.position="relative";var r=document.createElement("div");e.container.appendChild(r),e.renderObjs(r),e.globe.rendererSize(e.renderObjs.renderer().getSize(new Wx.Vector2)),this.pointOfView({altitude:2.5});var i=e.globe.getGlobeRadius(),a=e.renderObjs.controls();a.minDistance=1.01*i,a.maxDistance=100*i,a.enablePan=!1,a.enableDamping=!0,a.dampingFactor=.1,a.rotateSpeed=.3,a.zoomSpeed=.3,a.addEventListener("change",(function(){var t=n.pointOfView();a.rotateSpeed=.2*t.altitude,a.zoomSpeed=.1*(t.altitude+1),e.globe.setPointOfView(e.renderObjs.camera().position),e.onZoom&&e.onZoom(t)}));var o=function(t){for(var e=t;e&&!e.hasOwnProperty("__globeObjType");)e=e.parent;return e},s={point:function(t){return t},arc:function(t){return t},polygon:function(t){return t.data},path:function(t){return t},heatmap:function(t){return t},hexbin:function(t){return t},hexPolygon:function(t){return t},tile:function(t){return t},label:function(t){return t},object:function(t){return t},custom:function(t){return t}};e.renderObjs.renderer().useLegacyLights=!1,e.renderObjs.hoverOrderComparator((function(t,e){var n=o(t),r=o(e),i=function(t){return!t};return i(n)-i(r)})).tooltipContent((function(t){var n={point:e.pointLabel,arc:e.arcLabel,polygon:e.polygonLabel,path:e.pathLabel,hexbin:e.hexLabel,hexPolygon:e.hexPolygonLabel,tile:e.tileLabel,label:e.labelLabel,object:e.objectLabel,custom:e.customLayerLabel},r=o(t),i=r&&r.__globeObjType;return r&&i&&n.hasOwnProperty(i)&&s.hasOwnProperty(i)&&$h(n[i])(s[i](r.__data))||""})).onHover((function(t){var n={point:e.onPointHover,arc:e.onArcHover,polygon:e.onPolygonHover,path:e.onPathHover,heatmap:e.onHeatmapHover,hexbin:e.onHexHover,hexPolygon:e.onHexPolygonHover,tile:e.onTileHover,label:e.onLabelHover,object:e.onObjectHover,custom:e.onCustomLayerHover},r={globe:e.onGlobeClick,point:e.onPointClick,arc:e.onArcClick,polygon:e.onPolygonClick,path:e.onPathClick,heatmap:e.onHeatmapClick,hexbin:e.onHexClick,hexPolygon:e.onHexPolygonClick,tile:e.onTileClick,label:e.onLabelClick,object:e.onObjectClick,custom:e.onCustomLayerClick},i=o(t);if(i&&!n.hasOwnProperty(i.__globeObjType)&&(i=null),i!==e.hoverObj){var a=e.hoverObj?e.hoverObj.__globeObjType:null,A=e.hoverObj?s[a](e.hoverObj.__data):null,l=i?i.__globeObjType:null,c=i?s[l](i.__data):null;a&&a!==l&&n[a]&&n[a](null,A),l&&n[l]&&n[l](c,a===l?A:null),e.renderObjs.renderer().domElement.classList[l&&r[l]?"add":"remove"]("clickable"),e.hoverObj=i}})).onClick((function(t,r,i){if(t){var a={globe:e.onGlobeClick,point:e.onPointClick,arc:e.onArcClick,polygon:e.onPolygonClick,path:e.onPathClick,heatmap:e.onHeatmapClick,hexbin:e.onHexClick,hexPolygon:e.onHexPolygonClick,tile:e.onTileClick,label:e.onLabelClick,object:e.onObjectClick,custom:e.onCustomLayerClick},A=o(t),l=A.__globeObjType;if(A&&a.hasOwnProperty(l)&&a[l]){var c=[r];if("globe"===l){var u=n.toGeoCoords(i),h=u.lat,d=u.lng;c.unshift({lat:h,lng:d})}else c.push(n.toGeoCoords(i));s.hasOwnProperty(l)&&c.unshift(s[l](A.__data)),a[l].apply(a,c)}}})).onRightClick((function(t,r,i){if(t){var a={globe:e.onGlobeRightClick,point:e.onPointRightClick,arc:e.onArcRightClick,polygon:e.onPolygonRightClick,path:e.onPathRightClick,heatmap:e.onHeatmapRightClick,hexbin:e.onHexRightClick,hexPolygon:e.onHexPolygonRightClick,tile:e.onTileRightClick,label:e.onLabelRightClick,object:e.onObjectRightClick,custom:e.onCustomLayerRightClick},A=o(t),l=A.__globeObjType;if(A&&a.hasOwnProperty(l)&&a[l]){var c=[r];if("globe"===l){var u=n.toGeoCoords(i),h=u.lat,d=u.lng;c.unshift({lat:h,lng:d})}else c.push(n.toGeoCoords(i));s.hasOwnProperty(l)&&c.unshift(s[l](A.__data)),a[l].apply(a,c)}}})),this._animationCycle()}});return $x}));