@soonspacejs/plugin-transform-controls 2.3.15 → 2.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +47 -1
- package/dist/index.js +48 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1 +1,47 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2010-2022 Three.js Authors
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
class e{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;const n=this._listeners[e];if(void 0!==n){const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;const t=this._listeners[e.type];if(void 0!==t){e.target=this;const n=t.slice(0);for(let t=0,r=n.length;t<r;t++)n[t].call(this,e);e.target=null}}}const t=[];for(let e=0;e<256;e++)t[e]=(e<16?"0":"")+e.toString(16);let n=1234567;const r=Math.PI/180,i=180/Math.PI;function s(){const e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(t[255&e]+t[e>>8&255]+t[e>>16&255]+t[e>>24&255]+"-"+t[255&n]+t[n>>8&255]+"-"+t[n>>16&15|64]+t[n>>24&255]+"-"+t[63&r|128]+t[r>>8&255]+"-"+t[r>>16&255]+t[r>>24&255]+t[255&i]+t[i>>8&255]+t[i>>16&255]+t[i>>24&255]).toLowerCase()}function o(e,t,n){return Math.max(t,Math.min(n,e))}function a(e,t){return(e%t+t)%t}function l(e,t,n){return(1-n)*e+n*t}function c(e){return 0==(e&e-1)&&0!==e}function h(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function u(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}var d=Object.freeze({__proto__:null,DEG2RAD:r,RAD2DEG:i,generateUUID:s,clamp:o,euclideanModulo:a,mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:l,damp:function(e,t,n,r){return l(e,t,1-Math.exp(-n*r))},pingpong:function(e,t=1){return t-Math.abs(a(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(n=e);let t=n+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*r},radToDeg:function(e){return e*i},isPowerOfTwo:c,ceilPowerOfTwo:h,floorPowerOfTwo:u,setQuaternionFromProperEuler:function(e,t,n,r,i){const s=Math.cos,o=Math.sin,a=s(n/2),l=o(n/2),c=s((t+r)/2),h=o((t+r)/2),u=s((t-r)/2),d=o((t-r)/2),p=s((r-t)/2),f=o((r-t)/2);switch(i){case"XYX":e.set(a*h,l*u,l*d,a*c);break;case"YZY":e.set(l*d,a*h,l*u,a*c);break;case"ZXZ":e.set(l*u,l*d,a*h,a*c);break;case"XZX":e.set(a*h,l*f,l*p,a*c);break;case"YXY":e.set(l*p,a*h,l*f,a*c);break;case"ZYZ":e.set(l*f,l*p,a*h,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}},normalize:function(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}},denormalize:function(e,t){switch(t.constructor){case Float32Array:return e;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}});class p{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,s=this.y-e.y;return this.x=i*n-s*r+e.x,this.y=i*r+s*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}p.prototype.isVector2=!0;class f{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,r,i,s,o,a,l){const c=this.elements;return c[0]=e,c[1]=r,c[2]=o,c[3]=t,c[4]=i,c[5]=a,c[6]=n,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,s=n[0],o=n[3],a=n[6],l=n[1],c=n[4],h=n[7],u=n[2],d=n[5],p=n[8],f=r[0],m=r[3],g=r[6],v=r[1],y=r[4],x=r[7],w=r[2],b=r[5],_=r[8];return i[0]=s*f+o*v+a*w,i[3]=s*m+o*y+a*b,i[6]=s*g+o*x+a*_,i[1]=l*f+c*v+h*w,i[4]=l*m+c*y+h*b,i[7]=l*g+c*x+h*_,i[2]=u*f+d*v+p*w,i[5]=u*m+d*y+p*b,i[8]=u*g+d*x+p*_,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8];return t*s*c-t*o*l-n*i*c+n*o*a+r*i*l-r*s*a}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],h=c*s-o*l,u=o*a-c*i,d=l*i-s*a,p=t*h+n*u+r*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return e[0]=h*f,e[1]=(r*l-c*n)*f,e[2]=(o*n-r*s)*f,e[3]=u*f,e[4]=(c*t-r*a)*f,e[5]=(r*i-o*t)*f,e[6]=d*f,e[7]=(n*a-l*t)*f,e[8]=(s*t-n*i)*f,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,s,o){const a=Math.cos(i),l=Math.sin(i);return this.set(n*a,n*l,-n*(a*s+l*o)+s+e,-r*l,r*a,-r*(-l*s+a*o)+o+t,0,0,1),this}scale(e,t){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],s=r[3],o=r[6],a=r[1],l=r[4],c=r[7];return r[0]=t*i+n*a,r[3]=t*s+n*l,r[6]=t*o+n*c,r[1]=-n*i+t*a,r[4]=-n*s+t*l,r[7]=-n*o+t*c,this}translate(e,t){const n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}function m(e){for(let t=e.length-1;t>=0;--t)if(e[t]>65535)return!0;return!1}f.prototype.isMatrix3=!0;const g={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function v(e,t){return new g[e](t)}function y(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function x(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function w(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}const b={srgb:{"srgb-linear":x},"srgb-linear":{srgb:w}},_={legacyMode:!0,get workingColorSpace(){return"srgb-linear"},set workingColorSpace(e){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(e,t,n){if(this.legacyMode||t===n||!t||!n)return e;if(b[t]&&void 0!==b[t][n]){const r=b[t][n];return e.r=r(e.r),e.g=r(e.g),e.b=r(e.b),e}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},toWorkingColorSpace:function(e,t){return this.convert(e,t,this.workingColorSpace)}},M={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},S={r:0,g:0,b:0},T={h:0,s:0,l:0},E={h:0,s:0,l:0};function A(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function C(e,t){return t.r=e.r,t.g=e.g,t.b=e.b,t}class P{constructor(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t="srgb"){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,_.toWorkingColorSpace(this,t),this}setRGB(e,t,n,r="srgb-linear"){return this.r=e,this.g=t,this.b=n,_.toWorkingColorSpace(this,r),this}setHSL(e,t,n,r="srgb-linear"){if(e=a(e,1),t=o(t,0,1),n=o(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=A(i,r,e+1/3),this.g=A(i,r,e),this.b=A(i,r,e-1/3)}return _.toWorkingColorSpace(this,r),this}setStyle(e,t="srgb"){function n(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let e;const i=r[1],s=r[2];switch(i){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,_.toWorkingColorSpace(this,t),n(e[4]),this;if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,_.toWorkingColorSpace(this,t),n(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s)){const r=parseFloat(e[1])/360,i=parseInt(e[2],10)/100,s=parseInt(e[3],10)/100;return n(e[4]),this.setHSL(r,i,s,t)}}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const e=r[1],n=e.length;if(3===n)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2),16)/255,_.toWorkingColorSpace(this,t),this;if(6===n)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,_.toWorkingColorSpace(this,t),this}return e&&e.length>0?this.setColorName(e,t):this}setColorName(e,t="srgb"){const n=M[e.toLowerCase()];return void 0!==n?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=x(e.r),this.g=x(e.g),this.b=x(e.b),this}copyLinearToSRGB(e){return this.r=w(e.r),this.g=w(e.g),this.b=w(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e="srgb"){return _.fromWorkingColorSpace(C(this,S),e),o(255*S.r,0,255)<<16^o(255*S.g,0,255)<<8^o(255*S.b,0,255)<<0}getHexString(e="srgb"){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t="srgb-linear"){_.fromWorkingColorSpace(C(this,S),t);const n=S.r,r=S.g,i=S.b,s=Math.max(n,r,i),o=Math.min(n,r,i);let a,l;const c=(o+s)/2;if(o===s)a=0,l=0;else{const e=s-o;switch(l=c<=.5?e/(s+o):e/(2-s-o),s){case n:a=(r-i)/e+(r<i?6:0);break;case r:a=(i-n)/e+2;break;case i:a=(n-r)/e+4}a/=6}return e.h=a,e.s=l,e.l=c,e}getRGB(e,t="srgb-linear"){return _.fromWorkingColorSpace(C(this,S),t),e.r=S.r,e.g=S.g,e.b=S.b,e}getStyle(e="srgb"){return _.fromWorkingColorSpace(C(this,S),e),"srgb"!==e?`color(${e} ${S.r} ${S.g} ${S.b})`:`rgb(${255*S.r|0},${255*S.g|0},${255*S.b|0})`}offsetHSL(e,t,n){return this.getHSL(T),T.h+=e,T.s+=t,T.l+=n,this.setHSL(T.h,T.s,T.l),this}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(T),e.getHSL(E);const n=l(T.h,E.h,t),r=l(T.s,E.s,t),i=l(T.l,E.l,t);return this.setHSL(n,r,i),this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}}let R;P.NAMES=M,P.prototype.isColor=!0,P.prototype.r=1,P.prototype.g=1,P.prototype.b=1;class L{static getDataURL(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===R&&(R=y("canvas")),R.width=e.width,R.height=e.height;const n=R.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=R}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=y("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=255*x(i[e]/255);return n.putImageData(r,0,0),t}if(e.data){const t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*x(t[e]/255)):t[e]=x(t[e]);return{data:t,width:e.width,height:e.height}}return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}class I{constructor(e=null){this.uuid=s(),this.data=e,this.version=0}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(null!==r){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(D(r[t].image)):e.push(D(r[t]))}else e=D(r);n.url=e}return t||(e.images[this.uuid]=n),n}}function D(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?L.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}I.prototype.isSource=!0;let O=0;class B extends e{constructor(e=B.DEFAULT_IMAGE,t=B.DEFAULT_MAPPING,n=1001,r=1001,i=1006,o=1008,a=1023,l=1009,c=1,h=3e3){super(),Object.defineProperty(this,"id",{value:O++}),this.uuid=s(),this.name="",this.source=new I(e),this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=o,this.anisotropy=c,this.format=a,this.internalFormat=null,this.type=l,this.offset=new p(0,0),this.repeat=new p(1,1),this.center=new p(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new f,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(e){this.source.data=e}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(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}}B.DEFAULT_IMAGE=null,B.DEFAULT_MAPPING=300,B.prototype.isTexture=!0;class N{constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=this.w,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r+s[12]*i,this.y=s[1]*t+s[5]*n+s[9]*r+s[13]*i,this.z=s[2]*t+s[6]*n+s[10]*r+s[14]*i,this.w=s[3]*t+s[7]*n+s[11]*r+s[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i;const s=.01,o=.1,a=e.elements,l=a[0],c=a[4],h=a[8],u=a[1],d=a[5],p=a[9],f=a[2],m=a[6],g=a[10];if(Math.abs(c-u)<s&&Math.abs(h-f)<s&&Math.abs(p-m)<s){if(Math.abs(c+u)<o&&Math.abs(h+f)<o&&Math.abs(p+m)<o&&Math.abs(l+d+g-3)<o)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,a=(d+1)/2,v=(g+1)/2,y=(c+u)/4,x=(h+f)/4,w=(p+m)/4;return e>a&&e>v?e<s?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=y/n,i=x/n):a>v?a<s?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(a),n=y/r,i=w/r):v<s?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(v),n=x/i,r=w/i),this.set(n,r,i,t),this}let v=Math.sqrt((m-p)*(m-p)+(h-f)*(h-f)+(u-c)*(u-c));return Math.abs(v)<.001&&(v=1),this.x=(m-p)/v,this.y=(h-f)/v,this.z=(u-c)/v,this.w=Math.acos((l+d+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}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}}N.prototype.isVector4=!0;class z extends e{constructor(e,t,n={}){super(),this.width=e,this.height=t,this.depth=1,this.scissor=new N(0,0,e,t),this.scissorTest=!1,this.viewport=new N(0,0,e,t);const r={width:e,height:t,depth:1};this.texture=new B(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.internalFormat=void 0!==n.internalFormat?n.internalFormat:null,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:1006,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null,this.samples=void 0!==n.samples?n.samples:0}setSize(e,t,n=1){this.width===e&&this.height===t&&this.depth===n||(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0,this.texture.image=Object.assign({},e.texture.image),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}z.prototype.isWebGLRenderTarget=!0;class U extends B{constructor(e=null,t=1,n=1,r=1){super(null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}U.prototype.isDataArrayTexture=!0;class k extends z{constructor(e,t,n){super(e,t),this.depth=n,this.texture=new U(null,e,t,n),this.texture.isRenderTargetTexture=!0}}k.prototype.isWebGLArrayRenderTarget=!0;class F extends B{constructor(e=null,t=1,n=1,r=1){super(null),this.image={data:e,width:t,height:n,depth:r},this.magFilter=1003,this.minFilter=1003,this.wrapR=1001,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}F.prototype.isData3DTexture=!0;class H extends z{constructor(e,t,n){super(e,t),this.depth=n,this.texture=new F(null,e,t,n),this.texture.isRenderTargetTexture=!0}}H.prototype.isWebGL3DRenderTarget=!0;class G extends z{constructor(e,t,n,r={}){super(e,t,r);const i=this.texture;this.texture=[];for(let e=0;e<n;e++)this.texture[e]=i.clone(),this.texture[e].isRenderTargetTexture=!0}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,i=this.texture.length;r<i;r++)this.texture[r].image.width=e,this.texture[r].image.height=t,this.texture[r].image.depth=n;this.dispose()}return this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t),this}copy(e){this.dispose(),this.width=e.width,this.height=e.height,this.depth=e.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this.texture.length=0;for(let t=0,n=e.texture.length;t<n;t++)this.texture[t]=e.texture[t].clone();return this}}G.prototype.isWebGLMultipleRenderTargets=!0;class j{constructor(e=0,t=0,n=0,r=1){this._x=e,this._y=t,this._z=n,this._w=r}static slerp(e,t,n,r){return console.warn("THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead."),n.slerpQuaternions(e,t,r)}static slerpFlat(e,t,n,r,i,s,o){let a=n[r+0],l=n[r+1],c=n[r+2],h=n[r+3];const u=i[s+0],d=i[s+1],p=i[s+2],f=i[s+3];if(0===o)return e[t+0]=a,e[t+1]=l,e[t+2]=c,void(e[t+3]=h);if(1===o)return e[t+0]=u,e[t+1]=d,e[t+2]=p,void(e[t+3]=f);if(h!==f||a!==u||l!==d||c!==p){let e=1-o;const t=a*u+l*d+c*p+h*f,n=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){const i=Math.sqrt(r),s=Math.atan2(i,t*n);e=Math.sin(e*s)/i,o=Math.sin(o*s)/i}const i=o*n;if(a=a*e+u*i,l=l*e+d*i,c=c*e+p*i,h=h*e+f*i,e===1-o){const e=1/Math.sqrt(a*a+l*l+c*c+h*h);a*=e,l*=e,c*=e,h*=e}}e[t]=a,e[t+1]=l,e[t+2]=c,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,r,i,s){const o=n[r],a=n[r+1],l=n[r+2],c=n[r+3],h=i[s],u=i[s+1],d=i[s+2],p=i[s+3];return e[t]=o*p+c*h+a*d-l*u,e[t+1]=a*p+c*u+l*h-o*d,e[t+2]=l*p+c*d+o*u-a*h,e[t+3]=c*p-o*h-a*u-l*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=e._x,r=e._y,i=e._z,s=e._order,o=Math.cos,a=Math.sin,l=o(n/2),c=o(r/2),h=o(i/2),u=a(n/2),d=a(r/2),p=a(i/2);switch(s){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],i=t[8],s=t[1],o=t[5],a=t[9],l=t[2],c=t[6],h=t[10],u=n+o+h;if(u>0){const e=.5/Math.sqrt(u+1);this._w=.25/e,this._x=(c-a)*e,this._y=(i-l)*e,this._z=(s-r)*e}else if(n>o&&n>h){const e=2*Math.sqrt(1+n-o-h);this._w=(c-a)/e,this._x=.25*e,this._y=(r+s)/e,this._z=(i+l)/e}else if(o>h){const e=2*Math.sqrt(1+o-n-h);this._w=(i-l)/e,this._x=(r+s)/e,this._y=.25*e,this._z=(a+c)/e}else{const e=2*Math.sqrt(1+h-n-o);this._w=(s-r)/e,this._x=(i+l)/e,this._y=(a+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(o(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,i=e._z,s=e._w,o=t._x,a=t._y,l=t._z,c=t._w;return this._x=n*c+s*o+r*l-i*a,this._y=r*c+s*a+i*o-n*l,this._z=i*c+s*l+n*a-r*o,this._w=s*c-n*o-r*a-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,r=this._y,i=this._z,s=this._w;let o=s*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=s,this._x=n,this._y=r,this._z=i,this;const a=1-o*o;if(a<=Number.EPSILON){const e=1-t;return this._w=e*s+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),c=Math.atan2(l,o),h=Math.sin((1-t)*c)/l,u=Math.sin(t*c)/l;return this._w=s*h+this._w*u,this._x=n*h+this._x*u,this._y=r*h+this._y*u,this._z=i*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),r=2*Math.PI*Math.random(),i=2*Math.PI*Math.random();return this.set(t*Math.cos(r),n*Math.sin(i),n*Math.cos(i),t*Math.sin(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}j.prototype.isQuaternion=!0;class V{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(X.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(X.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=e.elements,s=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*s,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*s,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*s,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,i=e.x,s=e.y,o=e.z,a=e.w,l=a*t+s*r-o*n,c=a*n+o*t-i*r,h=a*r+i*n-s*t,u=-i*t-s*n-o*r;return this.x=l*a+u*-i+c*-o-h*-s,this.y=c*a+u*-s+h*-i-l*-o,this.z=h*a+u*-o+l*-s-c*-i,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,i=e.z,s=t.x,o=t.y,a=t.z;return this.x=r*a-i*o,this.y=i*s-n*a,this.z=n*o-r*s,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return W.copy(this).projectOnVector(e),this.sub(W)}reflect(e){return this.sub(W.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(o(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=2*(Math.random()-.5),t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}V.prototype.isVector3=!0;const W=new V,X=new j;class q{constructor(e=new V(1/0,1/0,1/0),t=new V(-1/0,-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,r=1/0,i=-1/0,s=-1/0,o=-1/0;for(let a=0,l=e.length;a<l;a+=3){const l=e[a],c=e[a+1],h=e[a+2];l<t&&(t=l),c<n&&(n=c),h<r&&(r=h),l>i&&(i=l),c>s&&(s=c),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,s,o),this}setFromBufferAttribute(e){let t=1/0,n=1/0,r=1/0,i=-1/0,s=-1/0,o=-1/0;for(let a=0,l=e.count;a<l;a++){const l=e.getX(a),c=e.getY(a),h=e.getZ(a);l<t&&(t=l),c<n&&(n=c),h<r&&(r=h),l>i&&(i=l),c>s&&(s=c),h>o&&(o=h)}return this.min.set(t,n,r),this.max.set(i,s,o),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Z.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.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(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(void 0!==n)if(t&&null!=n.attributes&&void 0!==n.attributes.position){const t=n.attributes.position;for(let n=0,r=t.count;n<r;n++)Z.fromBufferAttribute(t,n).applyMatrix4(e.matrixWorld),this.expandByPoint(Z)}else null===n.boundingBox&&n.computeBoundingBox(),J.copy(n.boundingBox),J.applyMatrix4(e.matrixWorld),this.union(J);const r=e.children;for(let e=0,n=r.length;e<n;e++)this.expandByObject(r[e],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Z),Z.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(re),ie.subVectors(this.max,re),Q.subVectors(e.a,re),K.subVectors(e.b,re),$.subVectors(e.c,re),ee.subVectors(K,Q),te.subVectors($,K),ne.subVectors(Q,$);let t=[0,-ee.z,ee.y,0,-te.z,te.y,0,-ne.z,ne.y,ee.z,0,-ee.x,te.z,0,-te.x,ne.z,0,-ne.x,-ee.y,ee.x,0,-te.y,te.x,0,-ne.y,ne.x,0];return!!ae(t,Q,K,$,ie)&&(t=[1,0,0,0,1,0,0,0,1],!!ae(t,Q,K,$,ie)&&(se.crossVectors(ee,te),t=[se.x,se.y,se.z],ae(t,Q,K,$,ie)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Z.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return this.getCenter(e.center),e.radius=.5*this.getSize(Z).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(Y[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Y[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Y[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Y[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Y[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Y[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Y[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Y[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Y)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}q.prototype.isBox3=!0;const Y=[new V,new V,new V,new V,new V,new V,new V,new V],Z=new V,J=new q,Q=new V,K=new V,$=new V,ee=new V,te=new V,ne=new V,re=new V,ie=new V,se=new V,oe=new V;function ae(e,t,n,r,i){for(let s=0,o=e.length-3;s<=o;s+=3){oe.fromArray(e,s);const o=i.x*Math.abs(oe.x)+i.y*Math.abs(oe.y)+i.z*Math.abs(oe.z),a=t.dot(oe),l=n.dot(oe),c=r.dot(oe);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>o)return!1}return!0}const le=new q,ce=new V,he=new V,ue=new V;class de{constructor(e=new V,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):le.setFromPoints(e).getCenter(n);let r=0;for(let t=0,i=e.length;t<i;t++)r=Math.max(r,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){ue.subVectors(e,this.center);const t=ue.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.add(ue.multiplyScalar(n/e)),this.radius+=n}return this}union(e){return!0===this.center.equals(e.center)?he.set(0,0,1).multiplyScalar(e.radius):he.subVectors(e.center,this.center).normalize().multiplyScalar(e.radius),this.expandByPoint(ce.copy(e.center).add(he)),this.expandByPoint(ce.copy(e.center).sub(he)),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const pe=new V,fe=new V,me=new V,ge=new V,ve=new V,ye=new V,xe=new V;class we{constructor(e=new V,t=new V(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,pe)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=pe.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(pe.copy(this.direction).multiplyScalar(t).add(this.origin),pe.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){fe.copy(e).add(t).multiplyScalar(.5),me.copy(t).sub(e).normalize(),ge.copy(this.origin).sub(fe);const i=.5*e.distanceTo(t),s=-this.direction.dot(me),o=ge.dot(this.direction),a=-ge.dot(me),l=ge.lengthSq(),c=Math.abs(1-s*s);let h,u,d,p;if(c>0)if(h=s*a-o,u=s*o-a,p=i*c,h>=0)if(u>=-p)if(u<=p){const e=1/c;h*=e,u*=e,d=h*(h+s*u+2*o)+u*(s*h+u+2*a)+l}else u=i,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u=-i,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;else u<=-p?(h=Math.max(0,-(-s*i+o)),u=h>0?-i:Math.min(Math.max(-i,-a),i),d=-h*h+u*(u+2*a)+l):u<=p?(h=0,u=Math.min(Math.max(-i,-a),i),d=u*(u+2*a)+l):(h=Math.max(0,-(s*i+o)),u=h>0?i:Math.min(Math.max(-i,-a),i),d=-h*h+u*(u+2*a)+l);else u=s>0?-i:i,h=Math.max(0,-(s*u+o)),d=-h*h+u*(u+2*a)+l;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),r&&r.copy(me).multiplyScalar(u).add(fe),d}intersectSphere(e,t){pe.subVectors(e.center,this.origin);const n=pe.dot(this.direction),r=pe.dot(pe)-n*n,i=e.radius*e.radius;if(r>i)return null;const s=Math.sqrt(i-r),o=n-s,a=n+s;return o<0&&a<0?null:o<0?this.at(a,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,s,o,a;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(n=(e.min.x-u.x)*l,r=(e.max.x-u.x)*l):(n=(e.max.x-u.x)*l,r=(e.min.x-u.x)*l),c>=0?(i=(e.min.y-u.y)*c,s=(e.max.y-u.y)*c):(i=(e.max.y-u.y)*c,s=(e.min.y-u.y)*c),n>s||i>r?null:((i>n||n!=n)&&(n=i),(s<r||r!=r)&&(r=s),h>=0?(o=(e.min.z-u.z)*h,a=(e.max.z-u.z)*h):(o=(e.max.z-u.z)*h,a=(e.min.z-u.z)*h),n>a||o>r?null:((o>n||n!=n)&&(n=o),(a<r||r!=r)&&(r=a),r<0?null:this.at(n>=0?n:r,t)))}intersectsBox(e){return null!==this.intersectBox(e,pe)}intersectTriangle(e,t,n,r,i){ve.subVectors(t,e),ye.subVectors(n,e),xe.crossVectors(ve,ye);let s,o=this.direction.dot(xe);if(o>0){if(r)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}ge.subVectors(this.origin,e);const a=s*this.direction.dot(ye.crossVectors(ge,ye));if(a<0)return null;const l=s*this.direction.dot(ve.cross(ge));if(l<0)return null;if(a+l>o)return null;const c=-s*ge.dot(xe);return c<0?null:this.at(c/o,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class be{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,r,i,s,o,a,l,c,h,u,d,p,f,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=s,g[9]=o,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,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 be).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/_e.setFromMatrixColumn(e,0).length(),i=1/_e.setFromMatrixColumn(e,1).length(),s=1/_e.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*s,t[9]=n[9]*s,t[10]=n[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,n=e.x,r=e.y,i=e.z,s=Math.cos(n),o=Math.sin(n),a=Math.cos(r),l=Math.sin(r),c=Math.cos(i),h=Math.sin(i);if("XYZ"===e.order){const e=s*c,n=s*h,r=o*c,i=o*h;t[0]=a*c,t[4]=-a*h,t[8]=l,t[1]=n+r*l,t[5]=e-i*l,t[9]=-o*a,t[2]=i-e*l,t[6]=r+n*l,t[10]=s*a}else if("YXZ"===e.order){const e=a*c,n=a*h,r=l*c,i=l*h;t[0]=e+i*o,t[4]=r*o-n,t[8]=s*l,t[1]=s*h,t[5]=s*c,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=s*a}else if("ZXY"===e.order){const e=a*c,n=a*h,r=l*c,i=l*h;t[0]=e-i*o,t[4]=-s*h,t[8]=r+n*o,t[1]=n+r*o,t[5]=s*c,t[9]=i-e*o,t[2]=-s*l,t[6]=o,t[10]=s*a}else if("ZYX"===e.order){const e=s*c,n=s*h,r=o*c,i=o*h;t[0]=a*c,t[4]=r*l-n,t[8]=e*l+i,t[1]=a*h,t[5]=i*l+e,t[9]=n*l-r,t[2]=-l,t[6]=o*a,t[10]=s*a}else if("YZX"===e.order){const e=s*a,n=s*l,r=o*a,i=o*l;t[0]=a*c,t[4]=i-e*h,t[8]=r*h+n,t[1]=h,t[5]=s*c,t[9]=-o*c,t[2]=-l*c,t[6]=n*h+r,t[10]=e-i*h}else if("XZY"===e.order){const e=s*a,n=s*l,r=o*a,i=o*l;t[0]=a*c,t[4]=-h,t[8]=l*c,t[1]=e*h+i,t[5]=s*c,t[9]=n*h-r,t[2]=r*h-n,t[6]=o*c,t[10]=i*h+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Se,e,Te)}lookAt(e,t,n){const r=this.elements;return Ce.subVectors(e,t),0===Ce.lengthSq()&&(Ce.z=1),Ce.normalize(),Ee.crossVectors(n,Ce),0===Ee.lengthSq()&&(1===Math.abs(n.z)?Ce.x+=1e-4:Ce.z+=1e-4,Ce.normalize(),Ee.crossVectors(n,Ce)),Ee.normalize(),Ae.crossVectors(Ce,Ee),r[0]=Ee.x,r[4]=Ae.x,r[8]=Ce.x,r[1]=Ee.y,r[5]=Ae.y,r[9]=Ce.y,r[2]=Ee.z,r[6]=Ae.z,r[10]=Ce.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,s=n[0],o=n[4],a=n[8],l=n[12],c=n[1],h=n[5],u=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],w=n[15],b=r[0],_=r[4],M=r[8],S=r[12],T=r[1],E=r[5],A=r[9],C=r[13],P=r[2],R=r[6],L=r[10],I=r[14],D=r[3],O=r[7],B=r[11],N=r[15];return i[0]=s*b+o*T+a*P+l*D,i[4]=s*_+o*E+a*R+l*O,i[8]=s*M+o*A+a*L+l*B,i[12]=s*S+o*C+a*I+l*N,i[1]=c*b+h*T+u*P+d*D,i[5]=c*_+h*E+u*R+d*O,i[9]=c*M+h*A+u*L+d*B,i[13]=c*S+h*C+u*I+d*N,i[2]=p*b+f*T+m*P+g*D,i[6]=p*_+f*E+m*R+g*O,i[10]=p*M+f*A+m*L+g*B,i[14]=p*S+f*C+m*I+g*N,i[3]=v*b+y*T+x*P+w*D,i[7]=v*_+y*E+x*R+w*O,i[11]=v*M+y*A+x*L+w*B,i[15]=v*S+y*C+x*I+w*N,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],s=e[1],o=e[5],a=e[9],l=e[13],c=e[2],h=e[6],u=e[10],d=e[14];return e[3]*(+i*a*h-r*l*h-i*o*u+n*l*u+r*o*d-n*a*d)+e[7]*(+t*a*d-t*l*u+i*s*u-r*s*d+r*l*c-i*a*c)+e[11]*(+t*l*h-t*o*d-i*s*h+n*s*d+i*o*c-n*l*c)+e[15]*(-r*o*c-t*a*h+t*o*u+r*s*h-n*s*u+n*a*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],o=e[5],a=e[6],l=e[7],c=e[8],h=e[9],u=e[10],d=e[11],p=e[12],f=e[13],m=e[14],g=e[15],v=h*m*l-f*u*l+f*a*d-o*m*d-h*a*g+o*u*g,y=p*u*l-c*m*l-p*a*d+s*m*d+c*a*g-s*u*g,x=c*f*l-p*h*l+p*o*d-s*f*d-c*o*g+s*h*g,w=p*h*a-c*f*a-p*o*u+s*f*u+c*o*m-s*h*m,b=t*v+n*y+r*x+i*w;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const _=1/b;return e[0]=v*_,e[1]=(f*u*i-h*m*i-f*r*d+n*m*d+h*r*g-n*u*g)*_,e[2]=(o*m*i-f*a*i+f*r*l-n*m*l-o*r*g+n*a*g)*_,e[3]=(h*a*i-o*u*i-h*r*l+n*u*l+o*r*d-n*a*d)*_,e[4]=y*_,e[5]=(c*m*i-p*u*i+p*r*d-t*m*d-c*r*g+t*u*g)*_,e[6]=(p*a*i-s*m*i-p*r*l+t*m*l+s*r*g-t*a*g)*_,e[7]=(s*u*i-c*a*i+c*r*l-t*u*l-s*r*d+t*a*d)*_,e[8]=x*_,e[9]=(p*h*i-c*f*i-p*n*d+t*f*d+c*n*g-t*h*g)*_,e[10]=(s*f*i-p*o*i+p*n*l-t*f*l-s*n*g+t*o*g)*_,e[11]=(c*o*i-s*h*i-c*n*l+t*h*l+s*n*d-t*o*d)*_,e[12]=w*_,e[13]=(c*f*r-p*h*r+p*n*u-t*f*u-c*n*m+t*h*m)*_,e[14]=(p*o*r-s*f*r-p*n*a+t*f*a+s*n*m-t*o*m)*_,e[15]=(s*h*r-c*o*r+c*n*a-t*h*a-s*n*u+t*o*u)*_,this}scale(e){const t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),i=1-n,s=e.x,o=e.y,a=e.z,l=i*s,c=i*o;return this.set(l*s+n,l*o-r*a,l*a+r*o,0,l*o+r*a,c*o+n,c*a-r*s,0,l*a-r*o,c*a+r*s,i*a*a+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,s){return this.set(1,n,i,0,e,1,s,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,i=t._x,s=t._y,o=t._z,a=t._w,l=i+i,c=s+s,h=o+o,u=i*l,d=i*c,p=i*h,f=s*c,m=s*h,g=o*h,v=a*l,y=a*c,x=a*h,w=n.x,b=n.y,_=n.z;return r[0]=(1-(f+g))*w,r[1]=(d+x)*w,r[2]=(p-y)*w,r[3]=0,r[4]=(d-x)*b,r[5]=(1-(u+g))*b,r[6]=(m+v)*b,r[7]=0,r[8]=(p+y)*_,r[9]=(m-v)*_,r[10]=(1-(u+f))*_,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let i=_e.set(r[0],r[1],r[2]).length();const s=_e.set(r[4],r[5],r[6]).length(),o=_e.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Me.copy(this);const a=1/i,l=1/s,c=1/o;return Me.elements[0]*=a,Me.elements[1]*=a,Me.elements[2]*=a,Me.elements[4]*=l,Me.elements[5]*=l,Me.elements[6]*=l,Me.elements[8]*=c,Me.elements[9]*=c,Me.elements[10]*=c,t.setFromRotationMatrix(Me),n.x=i,n.y=s,n.z=o,this}makePerspective(e,t,n,r,i,s){void 0===s&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const o=this.elements,a=2*i/(t-e),l=2*i/(n-r),c=(t+e)/(t-e),h=(n+r)/(n-r),u=-(s+i)/(s-i),d=-2*s*i/(s-i);return o[0]=a,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=l,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(e,t,n,r,i,s){const o=this.elements,a=1/(t-e),l=1/(n-r),c=1/(s-i),h=(t+e)*a,u=(n+r)*l,d=(s+i)*c;return o[0]=2*a,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}be.prototype.isMatrix4=!0;const _e=new V,Me=new be,Se=new V(0,0,0),Te=new V(1,1,1),Ee=new V,Ae=new V,Ce=new V,Pe=new be,Re=new j;class Le{constructor(e=0,t=0,n=0,r=Le.DefaultOrder){this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,i=r[0],s=r[4],a=r[8],l=r[1],c=r[5],h=r[9],u=r[2],d=r[6],p=r[10];switch(t){case"XYZ":this._y=Math.asin(o(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-s,i)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-o(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,i),this._z=0);break;case"ZXY":this._x=Math.asin(o(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(l,i));break;case"ZYX":this._y=Math.asin(-o(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,i)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(o(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,i)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-o(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,i)):(this._x=Math.atan2(-h,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Pe.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Pe,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Re.setFromEuler(this),this.setFromQuaternion(Re,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}Le.prototype.isEuler=!0,Le.DefaultOrder="XYZ",Le.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class Ie{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return 0!=(this.mask&e.mask)}isEnabled(e){return 0!=(this.mask&(1<<e|0))}}let De=0;const Oe=new V,Be=new j,Ne=new be,ze=new V,Ue=new V,ke=new V,Fe=new j,He=new V(1,0,0),Ge=new V(0,1,0),je=new V(0,0,1),Ve={type:"added"},We={type:"removed"};class Xe extends e{constructor(){super(),Object.defineProperty(this,"id",{value:De++}),this.uuid=s(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Xe.DefaultUp.clone();const e=new V,t=new Le,n=new j,r=new V(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new be},normalMatrix:{value:new f}}),this.matrix=new be,this.matrixWorld=new be,this.matrixAutoUpdate=Xe.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Ie,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Be.setFromAxisAngle(e,t),this.quaternion.multiply(Be),this}rotateOnWorldAxis(e,t){return Be.setFromAxisAngle(e,t),this.quaternion.premultiply(Be),this}rotateX(e){return this.rotateOnAxis(He,e)}rotateY(e){return this.rotateOnAxis(Ge,e)}rotateZ(e){return this.rotateOnAxis(je,e)}translateOnAxis(e,t){return Oe.copy(e).applyQuaternion(this.quaternion),this.position.add(Oe.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(He,e)}translateY(e){return this.translateOnAxis(Ge,e)}translateZ(e){return this.translateOnAxis(je,e)}localToWorld(e){return e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return e.applyMatrix4(Ne.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?ze.copy(e):ze.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),Ue.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Ne.lookAt(Ue,ze,this.up):Ne.lookAt(ze,Ue,this.up),this.quaternion.setFromRotationMatrix(Ne),r&&(Ne.extractRotation(r.matrixWorld),Be.setFromRotationMatrix(Ne),this.quaternion.premultiply(Be.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(Ve)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(We)),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){for(let e=0;e<this.children.length;e++){const t=this.children[e];t.parent=null,t.dispatchEvent(We)}return this.children.length=0,this}attach(e){return this.updateWorldMatrix(!0,!1),Ne.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),Ne.multiply(e.parent.matrixWorld)),e.applyMatrix4(Ne),this.add(e),e.updateWorldMatrix(!1,!0),this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const r=this.children[n].getObjectByProperty(e,t);if(void 0!==r)return r}}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ue,e,ke),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ue,Fe,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(!0===e&&null!==n&&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===t){const e=this.children;for(let t=0,n=e.length;t<n;t++)e[t].updateWorldMatrix(!1,!0)}}toJSON(e){const t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),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),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.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.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){const r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){const n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){const t=s(e.geometries),r=s(e.materials),i=s(e.textures),o=s(e.images),a=s(e.shapes),l=s(e.skeletons),c=s(e.animations),h=s(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),a.length>0&&(n.shapes=a),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c),h.length>0&&(n.nodes=h)}return n.object=r,n;function s(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){const n=e.children[t];this.add(n.clone())}return this}}Xe.DefaultUp=new V(0,1,0),Xe.DefaultMatrixAutoUpdate=!0,Xe.prototype.isObject3D=!0;const qe=new V,Ye=new V,Ze=new V,Je=new V,Qe=new V,Ke=new V,$e=new V,et=new V,tt=new V,nt=new V;class rt{constructor(e=new V,t=new V,n=new V){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),qe.subVectors(e,t),r.cross(qe);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){qe.subVectors(r,t),Ye.subVectors(n,t),Ze.subVectors(e,t);const s=qe.dot(qe),o=qe.dot(Ye),a=qe.dot(Ze),l=Ye.dot(Ye),c=Ye.dot(Ze),h=s*l-o*o;if(0===h)return i.set(-2,-1,-1);const u=1/h,d=(l*a-o*c)*u,p=(s*c-o*a)*u;return i.set(1-d-p,p,d)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Je),Je.x>=0&&Je.y>=0&&Je.x+Je.y<=1}static getUV(e,t,n,r,i,s,o,a){return this.getBarycoord(e,t,n,r,Je),a.set(0,0),a.addScaledVector(i,Je.x),a.addScaledVector(s,Je.y),a.addScaledVector(o,Je.z),a}static isFrontFacing(e,t,n,r){return qe.subVectors(n,t),Ye.subVectors(e,t),qe.cross(Ye).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return qe.subVectors(this.c,this.b),Ye.subVectors(this.a,this.b),.5*qe.cross(Ye).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return rt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return rt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,i){return rt.getUV(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return rt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return rt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,i=this.c;let s,o;Qe.subVectors(r,n),Ke.subVectors(i,n),et.subVectors(e,n);const a=Qe.dot(et),l=Ke.dot(et);if(a<=0&&l<=0)return t.copy(n);tt.subVectors(e,r);const c=Qe.dot(tt),h=Ke.dot(tt);if(c>=0&&h<=c)return t.copy(r);const u=a*h-c*l;if(u<=0&&a>=0&&c<=0)return s=a/(a-c),t.copy(n).addScaledVector(Qe,s);nt.subVectors(e,i);const d=Qe.dot(nt),p=Ke.dot(nt);if(p>=0&&d<=p)return t.copy(i);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return o=l/(l-p),t.copy(n).addScaledVector(Ke,o);const m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return $e.subVectors(i,r),o=(h-c)/(h-c+(d-p)),t.copy(r).addScaledVector($e,o);const g=1/(m+f+u);return s=f*g,o=u*g,t.copy(n).addScaledVector(Qe,s).addScaledVector(Ke,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let it=0;class st extends e{constructor(){super(),Object.defineProperty(this,"id",{value:it++}),this.uuid=s(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=7680,this.stencilZFail=7680,this.stencilZPass=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const n=e[t];if(void 0===n){console.warn("THREE.Material: '"+t+"' parameter is undefined.");continue}if("shading"===t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;continue}const r=this[t];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function r(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,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.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){const t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}st.prototype.isMaterial=!0,st.fromType=function(){return null};class ot extends st{constructor(e){super(),this.type="MeshBasicMaterial",this.color=new P(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}ot.prototype.isMeshBasicMaterial=!0;const at=new V,lt=new p;class ct{constructor(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}copyColorsArray(e){const t=this.array;let n=0;for(let r=0,i=e.length;r<i;r++){let i=e[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),i=new P),t[n++]=i.r,t[n++]=i.g,t[n++]=i.b}return this}copyVector2sArray(e){const t=this.array;let n=0;for(let r=0,i=e.length;r<i;r++){let i=e[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),i=new p),t[n++]=i.x,t[n++]=i.y}return this}copyVector3sArray(e){const t=this.array;let n=0;for(let r=0,i=e.length;r<i;r++){let i=e[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),i=new V),t[n++]=i.x,t[n++]=i.y,t[n++]=i.z}return this}copyVector4sArray(e){const t=this.array;let n=0;for(let r=0,i=e.length;r<i;r++){let i=e[r];void 0===i&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),i=new N),t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n++]=i.w}return this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)lt.fromBufferAttribute(this,t),lt.applyMatrix3(e),this.setXY(t,lt.x,lt.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)at.fromBufferAttribute(this,t),at.applyMatrix3(e),this.setXYZ(t,at.x,at.y,at.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)at.fromBufferAttribute(this,t),at.applyMatrix4(e),this.setXYZ(t,at.x,at.y,at.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)at.fromBufferAttribute(this,t),at.applyNormalMatrix(e),this.setXYZ(t,at.x,at.y,at.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)at.fromBufferAttribute(this,t),at.transformDirection(e),this.setXYZ(t,at.x,at.y,at.z);return this}set(e,t=0){return this.array.set(e,t),this}getX(e){return this.array[e*this.itemSize]}setX(e,t){return this.array[e*this.itemSize]=t,this}getY(e){return this.array[e*this.itemSize+1]}setY(e,t){return this.array[e*this.itemSize+1]=t,this}getZ(e){return this.array[e*this.itemSize+2]}setZ(e,t){return this.array[e*this.itemSize+2]=t,this}getW(e){return this.array[e*this.itemSize+3]}setW(e,t){return this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),35044!==this.usage&&(e.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(e.updateRange=this.updateRange),e}}ct.prototype.isBufferAttribute=!0;class ht extends ct{constructor(e,t,n){super(new Int8Array(e),t,n)}}class ut extends ct{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class dt extends ct{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class pt extends ct{constructor(e,t,n){super(new Int16Array(e),t,n)}}class ft extends ct{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class mt extends ct{constructor(e,t,n){super(new Int32Array(e),t,n)}}class gt extends ct{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class vt extends ct{constructor(e,t,n){super(new Uint16Array(e),t,n)}}vt.prototype.isFloat16BufferAttribute=!0;class yt extends ct{constructor(e,t,n){super(new Float32Array(e),t,n)}}class xt extends ct{constructor(e,t,n){super(new Float64Array(e),t,n)}}let wt=0;const bt=new be,_t=new Xe,Mt=new V,St=new q,Tt=new q,Et=new V;class At extends e{constructor(){super(),Object.defineProperty(this,"id",{value:wt++}),this.uuid=s(),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(e){return Array.isArray(e)?this.index=new(m(e)?gt:ft)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new f).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return bt.makeRotationFromQuaternion(e),this.applyMatrix4(bt),this}rotateX(e){return bt.makeRotationX(e),this.applyMatrix4(bt),this}rotateY(e){return bt.makeRotationY(e),this.applyMatrix4(bt),this}rotateZ(e){return bt.makeRotationZ(e),this.applyMatrix4(bt),this}translate(e,t,n){return bt.makeTranslation(e,t,n),this.applyMatrix4(bt),this}scale(e,t,n){return bt.makeScale(e,t,n),this.applyMatrix4(bt),this}lookAt(e){return _t.lookAt(e),_t.updateMatrix(),this.applyMatrix4(_t.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Mt).negate(),this.translate(Mt.x,Mt.y,Mt.z),this}setFromPoints(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new yt(t,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new q);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.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 V(-1/0,-1/0,-1/0),new V(1/0,1/0,1/0));if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];St.setFromBufferAttribute(n),this.morphTargetsRelative?(Et.addVectors(this.boundingBox.min,St.min),this.boundingBox.expandByPoint(Et),Et.addVectors(this.boundingBox.max,St.max),this.boundingBox.expandByPoint(Et)):(this.boundingBox.expandByPoint(St.min),this.boundingBox.expandByPoint(St.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 de);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.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 V,1/0);if(e){const n=this.boundingSphere.center;if(St.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];Tt.setFromBufferAttribute(n),this.morphTargetsRelative?(Et.addVectors(St.min,Tt.min),St.expandByPoint(Et),Et.addVectors(St.max,Tt.max),St.expandByPoint(Et)):(St.expandByPoint(Tt.min),St.expandByPoint(Tt.max))}St.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)Et.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(Et));if(t)for(let i=0,s=t.length;i<s;i++){const s=t[i],o=this.morphTargetsRelative;for(let t=0,i=s.count;t<i;t++)Et.fromBufferAttribute(s,t),o&&(Mt.fromBufferAttribute(e,t),Et.add(Mt)),r=Math.max(r,n.distanceToSquared(Et))}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 e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return void console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");const n=e.array,r=t.position.array,i=t.normal.array,s=t.uv.array,o=r.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new ct(new Float32Array(4*o),4));const a=this.getAttribute("tangent").array,l=[],c=[];for(let e=0;e<o;e++)l[e]=new V,c[e]=new V;const h=new V,u=new V,d=new V,f=new p,m=new p,g=new p,v=new V,y=new V;function x(e,t,n){h.fromArray(r,3*e),u.fromArray(r,3*t),d.fromArray(r,3*n),f.fromArray(s,2*e),m.fromArray(s,2*t),g.fromArray(s,2*n),u.sub(h),d.sub(h),m.sub(f),g.sub(f);const i=1/(m.x*g.y-g.x*m.y);isFinite(i)&&(v.copy(u).multiplyScalar(g.y).addScaledVector(d,-m.y).multiplyScalar(i),y.copy(d).multiplyScalar(m.x).addScaledVector(u,-g.x).multiplyScalar(i),l[e].add(v),l[t].add(v),l[n].add(v),c[e].add(y),c[t].add(y),c[n].add(y))}let w=this.groups;0===w.length&&(w=[{start:0,count:n.length}]);for(let e=0,t=w.length;e<t;++e){const t=w[e],r=t.start;for(let e=r,i=r+t.count;e<i;e+=3)x(n[e+0],n[e+1],n[e+2])}const b=new V,_=new V,M=new V,S=new V;function T(e){M.fromArray(i,3*e),S.copy(M);const t=l[e];b.copy(t),b.sub(M.multiplyScalar(M.dot(t))).normalize(),_.crossVectors(S,t);const n=_.dot(c[e])<0?-1:1;a[4*e]=b.x,a[4*e+1]=b.y,a[4*e+2]=b.z,a[4*e+3]=n}for(let e=0,t=w.length;e<t;++e){const t=w[e],r=t.start;for(let e=r,i=r+t.count;e<i;e+=3)T(n[e+0]),T(n[e+1]),T(n[e+2])}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n)n=new ct(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);const r=new V,i=new V,s=new V,o=new V,a=new V,l=new V,c=new V,h=new V;if(e)for(let u=0,d=e.count;u<d;u+=3){const d=e.getX(u+0),p=e.getX(u+1),f=e.getX(u+2);r.fromBufferAttribute(t,d),i.fromBufferAttribute(t,p),s.fromBufferAttribute(t,f),c.subVectors(s,i),h.subVectors(r,i),c.cross(h),o.fromBufferAttribute(n,d),a.fromBufferAttribute(n,p),l.fromBufferAttribute(n,f),o.add(c),a.add(c),l.add(c),n.setXYZ(d,o.x,o.y,o.z),n.setXYZ(p,a.x,a.y,a.z),n.setXYZ(f,l.x,l.y,l.z)}else for(let e=0,o=t.count;e<o;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),s.fromBufferAttribute(t,e+2),c.subVectors(s,i),h.subVectors(r,i),c.cross(h),n.setXYZ(e+0,c.x,c.y,c.z),n.setXYZ(e+1,c.x,c.y,c.z),n.setXYZ(e+2,c.x,c.y,c.z);this.normalizeNormals(),n.needsUpdate=!0}}merge(e,t){if(!e||!e.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const n=this.attributes;for(const r in n){if(void 0===e.attributes[r])continue;const i=n[r].array,s=e.attributes[r],o=s.array,a=s.itemSize*t,l=Math.min(o.length,i.length-a);for(let e=0,t=a;e<l;e++,t++)i[t]=o[e]}return this}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Et.fromBufferAttribute(e,t),Et.normalize(),e.setXYZ(t,Et.x,Et.y,Et.z)}toNonIndexed(){function e(e,t){const n=e.array,r=e.itemSize,i=e.normalized,s=new n.constructor(t.length*r);let o=0,a=0;for(let i=0,l=t.length;i<l;i++){o=e.isInterleavedBufferAttribute?t[i]*e.data.stride+e.offset:t[i]*r;for(let e=0;e<r;e++)s[a++]=n[o++]}return new ct(s,r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new At,n=this.index.array,r=this.attributes;for(const i in r){const s=e(r[i],n);t.setAttribute(i,s)}const i=this.morphAttributes;for(const r in i){const s=[],o=i[r];for(let t=0,r=o.length;t<r;t++){const r=e(o[t],n);s.push(r)}t.morphAttributes[r]=s}t.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let e=0,n=s.length;e<n;e++){const n=s[e];t.addGroup(n.start,n.count,n.materialIndex)}return t}toJSON(){const e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const t in n){const r=n[t];e.data.attributes[t]=r.toJSON(e.data)}const r={};let i=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],s=[];for(let t=0,r=n.length;t<r;t++){const r=n[t];s.push(r.toJSON(e.data))}s.length>0&&(r[t]=s,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const r=e.attributes;for(const e in r){const n=r[e];this.setAttribute(e,n.clone(t))}const i=e.morphAttributes;for(const e in i){const n=[],r=i[e];for(let e=0,i=r.length;e<i;e++)n.push(r[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;const s=e.groups;for(let e=0,t=s.length;e<t;e++){const t=s[e];this.addGroup(t.start,t.count,t.materialIndex)}const o=e.boundingBox;null!==o&&(this.boundingBox=o.clone());const a=e.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,void 0!==e.parameters&&(this.parameters=Object.assign({},e.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}At.prototype.isBufferGeometry=!0;const Ct=new be,Pt=new we,Rt=new de,Lt=new V,It=new V,Dt=new V,Ot=new V,Bt=new V,Nt=new V,zt=new V,Ut=new V,kt=new V,Ft=new p,Ht=new p,Gt=new p,jt=new V,Vt=new V;class Wt extends Xe{constructor(e=new At,t=new ot){super(),this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t<n;t++){const n=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}raycast(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0===r)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),Rt.copy(n.boundingSphere),Rt.applyMatrix4(i),!1===e.ray.intersectsSphere(Rt))return;if(Ct.copy(i).invert(),Pt.copy(e.ray).applyMatrix4(Ct),null!==n.boundingBox&&!1===Pt.intersectsBox(n.boundingBox))return;let s;if(n.isBufferGeometry){const i=n.index,o=n.attributes.position,a=n.morphAttributes.position,l=n.morphTargetsRelative,c=n.attributes.uv,h=n.attributes.uv2,u=n.groups,d=n.drawRange;if(null!==i)if(Array.isArray(r))for(let n=0,p=u.length;n<p;n++){const p=u[n],f=r[p.materialIndex];for(let n=Math.max(p.start,d.start),r=Math.min(i.count,Math.min(p.start+p.count,d.start+d.count));n<r;n+=3){const r=i.getX(n),u=i.getX(n+1),d=i.getX(n+2);s=Xt(this,f,e,Pt,o,a,l,c,h,r,u,d),s&&(s.faceIndex=Math.floor(n/3),s.face.materialIndex=p.materialIndex,t.push(s))}}else for(let n=Math.max(0,d.start),u=Math.min(i.count,d.start+d.count);n<u;n+=3){const u=i.getX(n),d=i.getX(n+1),p=i.getX(n+2);s=Xt(this,r,e,Pt,o,a,l,c,h,u,d,p),s&&(s.faceIndex=Math.floor(n/3),t.push(s))}else if(void 0!==o)if(Array.isArray(r))for(let n=0,i=u.length;n<i;n++){const i=u[n],p=r[i.materialIndex];for(let n=Math.max(i.start,d.start),r=Math.min(o.count,Math.min(i.start+i.count,d.start+d.count));n<r;n+=3)s=Xt(this,p,e,Pt,o,a,l,c,h,n,n+1,n+2),s&&(s.faceIndex=Math.floor(n/3),s.face.materialIndex=i.materialIndex,t.push(s))}else for(let n=Math.max(0,d.start),i=Math.min(o.count,d.start+d.count);n<i;n+=3)s=Xt(this,r,e,Pt,o,a,l,c,h,n,n+1,n+2),s&&(s.faceIndex=Math.floor(n/3),t.push(s))}else n.isGeometry&&console.error("THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}}function Xt(e,t,n,r,i,s,o,a,l,c,h,u){Lt.fromBufferAttribute(i,c),It.fromBufferAttribute(i,h),Dt.fromBufferAttribute(i,u);const d=e.morphTargetInfluences;if(s&&d){zt.set(0,0,0),Ut.set(0,0,0),kt.set(0,0,0);for(let e=0,t=s.length;e<t;e++){const t=d[e],n=s[e];0!==t&&(Ot.fromBufferAttribute(n,c),Bt.fromBufferAttribute(n,h),Nt.fromBufferAttribute(n,u),o?(zt.addScaledVector(Ot,t),Ut.addScaledVector(Bt,t),kt.addScaledVector(Nt,t)):(zt.addScaledVector(Ot.sub(Lt),t),Ut.addScaledVector(Bt.sub(It),t),kt.addScaledVector(Nt.sub(Dt),t)))}Lt.add(zt),It.add(Ut),Dt.add(kt)}e.isSkinnedMesh&&(e.boneTransform(c,Lt),e.boneTransform(h,It),e.boneTransform(u,Dt));const f=function(e,t,n,r,i,s,o,a){let l;if(l=1===t.side?r.intersectTriangle(o,s,i,!0,a):r.intersectTriangle(i,s,o,2!==t.side,a),null===l)return null;Vt.copy(a),Vt.applyMatrix4(e.matrixWorld);const c=n.ray.origin.distanceTo(Vt);return c<n.near||c>n.far?null:{distance:c,point:Vt.clone(),object:e}}(e,t,n,r,Lt,It,Dt,jt);if(f){a&&(Ft.fromBufferAttribute(a,c),Ht.fromBufferAttribute(a,h),Gt.fromBufferAttribute(a,u),f.uv=rt.getUV(jt,Lt,It,Dt,Ft,Ht,Gt,new p)),l&&(Ft.fromBufferAttribute(l,c),Ht.fromBufferAttribute(l,h),Gt.fromBufferAttribute(l,u),f.uv2=rt.getUV(jt,Lt,It,Dt,Ft,Ht,Gt,new p));const e={a:c,b:h,c:u,normal:new V,materialIndex:0};rt.getNormal(Lt,It,Dt,e.normal),f.face=e}return f}Wt.prototype.isMesh=!0;class qt extends At{constructor(e=1,t=1,n=1,r=1,i=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:s};const o=this;r=Math.floor(r),i=Math.floor(i),s=Math.floor(s);const a=[],l=[],c=[],h=[];let u=0,d=0;function p(e,t,n,r,i,s,p,f,m,g,v){const y=s/m,x=p/g,w=s/2,b=p/2,_=f/2,M=m+1,S=g+1;let T=0,E=0;const A=new V;for(let s=0;s<S;s++){const o=s*x-b;for(let a=0;a<M;a++){const u=a*y-w;A[e]=u*r,A[t]=o*i,A[n]=_,l.push(A.x,A.y,A.z),A[e]=0,A[t]=0,A[n]=f>0?1:-1,c.push(A.x,A.y,A.z),h.push(a/m),h.push(1-s/g),T+=1}}for(let e=0;e<g;e++)for(let t=0;t<m;t++){const n=u+t+M*e,r=u+t+M*(e+1),i=u+(t+1)+M*(e+1),s=u+(t+1)+M*e;a.push(n,r,s),a.push(r,i,s),E+=6}o.addGroup(d,E,v),d+=E,u+=T}p("z","y","x",-1,-1,n,t,e,s,i,0),p("z","y","x",1,-1,n,t,-e,s,i,1),p("x","z","y",1,1,e,n,t,r,s,2),p("x","z","y",1,-1,e,n,-t,r,s,3),p("x","y","z",1,-1,e,t,n,r,i,4),p("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(a),this.setAttribute("position",new yt(l,3)),this.setAttribute("normal",new yt(c,3)),this.setAttribute("uv",new yt(h,2))}static fromJSON(e){return new qt(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Yt(e){const t={};for(const n in e){t[n]={};for(const r in e[n]){const i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}}return t}function Zt(e){const t={};for(let n=0;n<e.length;n++){const r=Yt(e[n]);for(const e in r)t[e]=r[e]}return t}const Jt={clone:Yt,merge:Zt};class Qt extends st{constructor(e){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Yt(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const n in this.uniforms){const r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:"m4",value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}Qt.prototype.isShaderMaterial=!0;class Kt extends Xe{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new be,this.projectionMatrix=new be,this.projectionMatrixInverse=new be}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}Kt.prototype.isCamera=!0;class $t extends Kt{constructor(e=50,t=1,n=.1,r=2e3){super(),this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*i*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*r*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*i*Math.atan(Math.tan(.5*r*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,r,i,s){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*r*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i;const o=this.view;if(null!==this.view&&this.view.enabled){const e=o.fullWidth,r=o.fullHeight;s+=o.offsetX*i/e,t-=o.offsetY*n/r,i*=o.width/e,n*=o.height/r}const a=this.filmOffset;0!==a&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}$t.prototype.isPerspectiveCamera=!0;class en extends Xe{constructor(e,t,n){if(super(),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const r=new $t(90,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new V(1,0,0)),this.add(r);const i=new $t(90,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new V(-1,0,0)),this.add(i);const s=new $t(90,1,e,t);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new V(0,1,0)),this.add(s);const o=new $t(90,1,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new V(0,-1,0)),this.add(o);const a=new $t(90,1,e,t);a.layers=this.layers,a.up.set(0,-1,0),a.lookAt(new V(0,0,1)),this.add(a);const l=new $t(90,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new V(0,0,-1)),this.add(l)}update(e,t){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget,[r,i,s,o,a,l]=this.children,c=e.getRenderTarget(),h=e.outputEncoding,u=e.toneMapping,d=e.xr.enabled;e.outputEncoding=3e3,e.toneMapping=0,e.xr.enabled=!1;const p=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,s),e.setRenderTarget(n,3),e.render(t,o),e.setRenderTarget(n,4),e.render(t,a),n.texture.generateMipmaps=p,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(c),e.outputEncoding=h,e.toneMapping=u,e.xr.enabled=d,n.texture.needsPMREMUpdate=!0}}class tn extends B{constructor(e,t,n,r,i,s,o,a,l,c){super(e=void 0!==e?e:[],t=void 0!==t?t:301,n,r,i,s,o,a,l,c),this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}tn.prototype.isCubeTexture=!0;class nn extends z{constructor(e,t={}){super(e,e,t);const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new tn(r,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==t.generateMipmaps&&t.generateMipmaps,this.texture.minFilter=void 0!==t.minFilter?t.minFilter:1006}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={tEquirect:{value:null}},r="\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",i="\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",s=new qt(5,5,5),o=new Qt({name:"CubemapFromEquirect",uniforms:Yt(n),vertexShader:r,fragmentShader:i,side:1,blending:0});o.uniforms.tEquirect.value=t;const a=new Wt(s,o),l=t.minFilter;return 1008===t.minFilter&&(t.minFilter=1006),new en(1,10,this).update(e,a),t.minFilter=l,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,n,r){const i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}}nn.prototype.isWebGLCubeRenderTarget=!0;const rn=new V,sn=new V,on=new f;class an{constructor(e=new V(1,0,0),t=0){this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=rn.subVectors(n,t).cross(sn.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)}intersectLine(e,t){const n=e.delta(rn),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(n).multiplyScalar(i).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||on.getNormalMatrix(e),r=this.coplanarPoint(rn).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}an.prototype.isPlane=!0;const ln=new de,cn=new V;class hn{constructor(e=new an,t=new an,n=new an,r=new an,i=new an,s=new an){this.planes=[e,t,n,r,i,s]}set(e,t,n,r,i,s){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(s),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,r=n[0],i=n[1],s=n[2],o=n[3],a=n[4],l=n[5],c=n[6],h=n[7],u=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return t[0].setComponents(o-r,h-a,f-u,y-m).normalize(),t[1].setComponents(o+r,h+a,f+u,y+m).normalize(),t[2].setComponents(o+i,h+l,f+d,y+g).normalize(),t[3].setComponents(o-i,h-l,f-d,y-g).normalize(),t[4].setComponents(o-s,h-c,f-p,y-v).normalize(),t[5].setComponents(o+s,h+c,f+p,y+v).normalize(),this}intersectsObject(e){const t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),ln.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(ln)}intersectsSprite(e){return ln.center.set(0,0,0),ln.radius=.7071067811865476,ln.applyMatrix4(e.matrixWorld),this.intersectsSphere(ln)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(cn.x=r.normal.x>0?e.max.x:e.min.x,cn.y=r.normal.y>0?e.max.y:e.min.y,cn.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(cn)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function un(){let e=null,t=!1,n=null,r=null;function i(t,s){n(t,s),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function dn(e,t){const n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){const e=r.get(t);return void((!e||e.version<t.version)&&r.set(t,{buffer:t.buffer,type:t.type,bytesPerElement:t.elementSize,version:t.version}))}t.isInterleavedBufferAttribute&&(t=t.data);const s=r.get(t);void 0===s?r.set(t,function(t,r){const i=t.array,s=t.usage,o=e.createBuffer();let a;if(e.bindBuffer(r,o),e.bufferData(r,i,s),t.onUploadCallback(),i instanceof Float32Array)a=5126;else if(i instanceof Uint16Array)if(t.isFloat16BufferAttribute){if(!n)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");a=5131}else a=5123;else if(i instanceof Int16Array)a=5122;else if(i instanceof Uint32Array)a=5125;else if(i instanceof Int32Array)a=5124;else if(i instanceof Int8Array)a=5120;else if(i instanceof Uint8Array)a=5121;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+i);a=5121}return{buffer:o,type:a,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version}}(t,i)):s.version<t.version&&(function(t,r,i){const s=r.array,o=r.updateRange;e.bindBuffer(i,t),-1===o.count?e.bufferSubData(i,0,s):(n?e.bufferSubData(i,o.offset*s.BYTES_PER_ELEMENT,s,o.offset,o.count):e.bufferSubData(i,o.offset*s.BYTES_PER_ELEMENT,s.subarray(o.offset,o.offset+o.count)),o.count=-1)}(s.buffer,t,i),s.version=t.version)}}}class pn extends At{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const i=e/2,s=t/2,o=Math.floor(n),a=Math.floor(r),l=o+1,c=a+1,h=e/o,u=t/a,d=[],p=[],f=[],m=[];for(let e=0;e<c;e++){const t=e*u-s;for(let n=0;n<l;n++){const r=n*h-i;p.push(r,-t,0),f.push(0,0,1),m.push(n/o),m.push(1-e/a)}}for(let e=0;e<a;e++)for(let t=0;t<o;t++){const n=t+l*e,r=t+l*(e+1),i=t+1+l*(e+1),s=t+1+l*e;d.push(n,r,s),d.push(r,i,s)}this.setIndex(d),this.setAttribute("position",new yt(p,3)),this.setAttribute("normal",new yt(f,3)),this.setAttribute("uv",new yt(m,2))}static fromJSON(e){return new pn(e.width,e.height,e.widthSegments,e.heightSegments)}}const fn={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec3 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 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}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float 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\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\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}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_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\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 ) + 0.5;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\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 r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, CUBEUV_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_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec = 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#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",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 = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_pars_vertex:"#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif",normal_vertex:"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef texture2DLodEXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",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 <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",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 <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",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 <encodings_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <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 <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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 <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\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 <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <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 <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 <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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#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 <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\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 <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( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <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\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\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 <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <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 <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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 <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <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 <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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 SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <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 <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 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 + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <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 <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_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 <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <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 <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <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 <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\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 <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 <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",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 <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}"},mn={common:{diffuse:{value:new P(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new f},uv2Transform:{value:new f},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new p(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new P(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new P(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new f}},sprite:{diffuse:{value:new P(16777215)},opacity:{value:1},center:{value:new p(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new f}}},gn={basic:{uniforms:Zt([mn.common,mn.specularmap,mn.envmap,mn.aomap,mn.lightmap,mn.fog]),vertexShader:fn.meshbasic_vert,fragmentShader:fn.meshbasic_frag},lambert:{uniforms:Zt([mn.common,mn.specularmap,mn.envmap,mn.aomap,mn.lightmap,mn.emissivemap,mn.fog,mn.lights,{emissive:{value:new P(0)}}]),vertexShader:fn.meshlambert_vert,fragmentShader:fn.meshlambert_frag},phong:{uniforms:Zt([mn.common,mn.specularmap,mn.envmap,mn.aomap,mn.lightmap,mn.emissivemap,mn.bumpmap,mn.normalmap,mn.displacementmap,mn.fog,mn.lights,{emissive:{value:new P(0)},specular:{value:new P(1118481)},shininess:{value:30}}]),vertexShader:fn.meshphong_vert,fragmentShader:fn.meshphong_frag},standard:{uniforms:Zt([mn.common,mn.envmap,mn.aomap,mn.lightmap,mn.emissivemap,mn.bumpmap,mn.normalmap,mn.displacementmap,mn.roughnessmap,mn.metalnessmap,mn.fog,mn.lights,{emissive:{value:new P(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:fn.meshphysical_vert,fragmentShader:fn.meshphysical_frag},toon:{uniforms:Zt([mn.common,mn.aomap,mn.lightmap,mn.emissivemap,mn.bumpmap,mn.normalmap,mn.displacementmap,mn.gradientmap,mn.fog,mn.lights,{emissive:{value:new P(0)}}]),vertexShader:fn.meshtoon_vert,fragmentShader:fn.meshtoon_frag},matcap:{uniforms:Zt([mn.common,mn.bumpmap,mn.normalmap,mn.displacementmap,mn.fog,{matcap:{value:null}}]),vertexShader:fn.meshmatcap_vert,fragmentShader:fn.meshmatcap_frag},points:{uniforms:Zt([mn.points,mn.fog]),vertexShader:fn.points_vert,fragmentShader:fn.points_frag},dashed:{uniforms:Zt([mn.common,mn.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:fn.linedashed_vert,fragmentShader:fn.linedashed_frag},depth:{uniforms:Zt([mn.common,mn.displacementmap]),vertexShader:fn.depth_vert,fragmentShader:fn.depth_frag},normal:{uniforms:Zt([mn.common,mn.bumpmap,mn.normalmap,mn.displacementmap,{opacity:{value:1}}]),vertexShader:fn.meshnormal_vert,fragmentShader:fn.meshnormal_frag},sprite:{uniforms:Zt([mn.sprite,mn.fog]),vertexShader:fn.sprite_vert,fragmentShader:fn.sprite_frag},background:{uniforms:{uvTransform:{value:new f},t2D:{value:null}},vertexShader:fn.background_vert,fragmentShader:fn.background_frag},cube:{uniforms:Zt([mn.envmap,{opacity:{value:1}}]),vertexShader:fn.cube_vert,fragmentShader:fn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:fn.equirect_vert,fragmentShader:fn.equirect_frag},distanceRGBA:{uniforms:Zt([mn.common,mn.displacementmap,{referencePosition:{value:new V},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:fn.distanceRGBA_vert,fragmentShader:fn.distanceRGBA_frag},shadow:{uniforms:Zt([mn.lights,mn.fog,{color:{value:new P(0)},opacity:{value:1}}]),vertexShader:fn.shadow_vert,fragmentShader:fn.shadow_frag}};function vn(e,t,n,r,i,s){const o=new P(0);let a,l,c=!0===i?0:1,h=null,u=0,d=null;function p(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,s)}return{getClearColor:function(){return o},setClearColor:function(e,t=1){o.set(e),c=t,p(o,c)},getClearAlpha:function(){return c},setClearAlpha:function(e){c=e,p(o,c)},render:function(n,i){let s=!1,f=!0===i.isScene?i.background:null;f&&f.isTexture&&(f=t.get(f));const m=e.xr,g=m.getSession&&m.getSession();g&&"additive"===g.environmentBlendMode&&(f=null),null===f?p(o,c):f&&f.isColor&&(p(f,1),s=!0),(e.autoClear||s)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),f&&(f.isCubeTexture||306===f.mapping)?(void 0===l&&(l=new Wt(new qt(1,1,1),new Qt({name:"BackgroundCubeMaterial",uniforms:Yt(gn.cube.uniforms),vertexShader:gn.cube.vertexShader,fragmentShader:gn.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),l.geometry.deleteAttribute("uv"),l.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(l.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(l)),l.material.uniforms.envMap.value=f,l.material.uniforms.flipEnvMap.value=f.isCubeTexture&&!1===f.isRenderTargetTexture?-1:1,h===f&&u===f.version&&d===e.toneMapping||(l.material.needsUpdate=!0,h=f,u=f.version,d=e.toneMapping),n.unshift(l,l.geometry,l.material,0,0,null)):f&&f.isTexture&&(void 0===a&&(a=new Wt(new pn(2,2),new Qt({name:"BackgroundMaterial",uniforms:Yt(gn.background.uniforms),vertexShader:gn.background.vertexShader,fragmentShader:gn.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(a)),a.material.uniforms.t2D.value=f,!0===f.matrixAutoUpdate&&f.updateMatrix(),a.material.uniforms.uvTransform.value.copy(f.matrix),h===f&&u===f.version&&d===e.toneMapping||(a.material.needsUpdate=!0,h=f,u=f.version,d=e.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null))}}}function yn(e,t,n,r){const i=e.getParameter(34921),s=r.isWebGL2?null:t.get("OES_vertex_array_object"),o=r.isWebGL2||null!==s,a={},l=p(null);let c=l,h=!1;function u(t){return r.isWebGL2?e.bindVertexArray(t):s.bindVertexArrayOES(t)}function d(t){return r.isWebGL2?e.deleteVertexArray(t):s.deleteVertexArrayOES(t)}function p(e){const t=[],n=[],r=[];for(let e=0;e<i;e++)t[e]=0,n[e]=0,r[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:n,attributeDivisors:r,object:e,attributes:{},index:null}}function f(){const e=c.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function m(e){g(e,0)}function g(n,i){const s=c.newAttributes,o=c.enabledAttributes,a=c.attributeDivisors;s[n]=1,0===o[n]&&(e.enableVertexAttribArray(n),o[n]=1),a[n]!==i&&((r.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[r.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),a[n]=i)}function v(){const t=c.newAttributes,n=c.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function y(t,n,i,s,o,a){!0!==r.isWebGL2||5124!==i&&5125!==i?e.vertexAttribPointer(t,n,i,s,o,a):e.vertexAttribIPointer(t,n,i,o,a)}function x(){w(),h=!0,c!==l&&(c=l,u(c.object))}function w(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:function(i,l,d,x,w){let b=!1;if(o){const t=function(t,n,i){const o=!0===i.wireframe;let l=a[t.id];void 0===l&&(l={},a[t.id]=l);let c=l[n.id];void 0===c&&(c={},l[n.id]=c);let h=c[o];return void 0===h&&(h=p(r.isWebGL2?e.createVertexArray():s.createVertexArrayOES()),c[o]=h),h}(x,d,l);c!==t&&(c=t,u(c.object)),b=function(e,t){const n=c.attributes,r=e.attributes;let i=0;for(const e in r){const t=n[e],s=r[e];if(void 0===t)return!0;if(t.attribute!==s)return!0;if(t.data!==s.data)return!0;i++}return c.attributesNum!==i||c.index!==t}(x,w),b&&function(e,t){const n={},r=e.attributes;let i=0;for(const e in r){const t=r[e],s={};s.attribute=t,t.data&&(s.data=t.data),n[e]=s,i++}c.attributes=n,c.attributesNum=i,c.index=t}(x,w)}else{const e=!0===l.wireframe;c.geometry===x.id&&c.program===d.id&&c.wireframe===e||(c.geometry=x.id,c.program=d.id,c.wireframe=e,b=!0)}!0===i.isInstancedMesh&&(b=!0),null!==w&&n.update(w,34963),(b||h)&&(h=!1,function(i,s,o,a){if(!1===r.isWebGL2&&(i.isInstancedMesh||a.isInstancedBufferGeometry)&&null===t.get("ANGLE_instanced_arrays"))return;f();const l=a.attributes,c=o.getAttributes(),h=s.defaultAttributeValues;for(const t in c){const r=c[t];if(r.location>=0){let s=l[t];if(void 0===s&&("instanceMatrix"===t&&i.instanceMatrix&&(s=i.instanceMatrix),"instanceColor"===t&&i.instanceColor&&(s=i.instanceColor)),void 0!==s){const t=s.normalized,o=s.itemSize,l=n.get(s);if(void 0===l)continue;const c=l.buffer,h=l.type,u=l.bytesPerElement;if(s.isInterleavedBufferAttribute){const n=s.data,l=n.stride,d=s.offset;if(n.isInstancedInterleavedBuffer){for(let e=0;e<r.locationSize;e++)g(r.location+e,n.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=n.meshPerAttribute*n.count)}else for(let e=0;e<r.locationSize;e++)m(r.location+e);e.bindBuffer(34962,c);for(let e=0;e<r.locationSize;e++)y(r.location+e,o/r.locationSize,h,t,l*u,(d+o/r.locationSize*e)*u)}else{if(s.isInstancedBufferAttribute){for(let e=0;e<r.locationSize;e++)g(r.location+e,s.meshPerAttribute);!0!==i.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let e=0;e<r.locationSize;e++)m(r.location+e);e.bindBuffer(34962,c);for(let e=0;e<r.locationSize;e++)y(r.location+e,o/r.locationSize,h,t,o*u,o/r.locationSize*e*u)}}else if(void 0!==h){const n=h[t];if(void 0!==n)switch(n.length){case 2:e.vertexAttrib2fv(r.location,n);break;case 3:e.vertexAttrib3fv(r.location,n);break;case 4:e.vertexAttrib4fv(r.location,n);break;default:e.vertexAttrib1fv(r.location,n)}}}}v()}(i,l,d,x),null!==w&&e.bindBuffer(34963,n.get(w).buffer))},reset:x,resetDefaultState:w,dispose:function(){x();for(const e in a){const t=a[e];for(const e in t){const n=t[e];for(const e in n)d(n[e].object),delete n[e];delete t[e]}delete a[e]}},releaseStatesOfGeometry:function(e){if(void 0===a[e.id])return;const t=a[e.id];for(const e in t){const n=t[e];for(const e in n)d(n[e].object),delete n[e];delete t[e]}delete a[e.id]},releaseStatesOfProgram:function(e){for(const t in a){const n=a[t];if(void 0===n[e.id])continue;const r=n[e.id];for(const e in r)d(r[e].object),delete r[e];delete n[e.id]}},initAttributes:f,enableAttribute:m,disableUnusedAttributes:v}}function xn(e,t,n,r){const i=r.isWebGL2;let s;this.setMode=function(e){s=e},this.render=function(t,r){e.drawArrays(s,t,r),n.update(r,s,1)},this.renderInstances=function(r,o,a){if(0===a)return;let l,c;if(i)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](s,r,o,a),n.update(o,s,a)}}function wn(e,t,n){let r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext;let o=void 0!==n.precision?n.precision:"highp";const a=i(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const l=s||t.has("WEBGL_draw_buffers"),c=!0===n.logarithmicDepthBuffer,h=e.getParameter(34930),u=e.getParameter(35660),d=e.getParameter(3379),p=e.getParameter(34076),f=e.getParameter(34921),m=e.getParameter(36347),g=e.getParameter(36348),v=e.getParameter(36349),y=u>0,x=s||t.has("OES_texture_float");return{isWebGL2:s,drawBuffers:l,getMaxAnisotropy:function(){if(void 0!==r)return r;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");r=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:x,floatVertexTextures:y&&x,maxSamples:s?e.getParameter(36183):0}}function bn(e){const t=this;let n=null,r=0,i=!1,s=!1;const o=new an,a=new f,l={value:null,needsUpdate:!1};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function h(e,n,r,i){const s=null!==e?e.length:0;let c=null;if(0!==s){if(c=l.value,!0!==i||null===c){const t=r+4*s,i=n.matrixWorldInverse;a.getNormalMatrix(i),(null===c||c.length<t)&&(c=new Float32Array(t));for(let t=0,n=r;t!==s;++t,n+=4)o.copy(e[t]).applyMatrix4(i,a),o.normal.toArray(c,n),c[n+3]=o.constant}l.value=c,l.needsUpdate=!0}return t.numPlanes=s,t.numIntersection=0,c}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t,s){const o=0!==e.length||t||0!==r||i;return i=t,n=h(e,s,0),r=e.length,o},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1,c()},this.setState=function(t,o,a){const u=t.clippingPlanes,d=t.clipIntersection,p=t.clipShadows,f=e.get(t);if(!i||null===u||0===u.length||s&&!p)s?h(null):c();else{const e=s?0:r,t=4*e;let i=f.clippingState||null;l.value=i,i=h(u,o,t,a);for(let e=0;e!==t;++e)i[e]=n[e];f.clippingState=i,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=e}}}function _n(e){let t=new WeakMap;function n(e,t){return 303===t?e.mapping=301:304===t&&(e.mapping=302),e}function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture&&!1===i.isRenderTargetTexture){const s=i.mapping;if(303===s||304===s){if(t.has(i))return n(t.get(i).texture,i.mapping);{const s=i.image;if(s&&s.height>0){const o=new nn(s.height/2);return o.fromEquirectangularTexture(e,i),t.set(i,o),i.addEventListener("dispose",r),n(o.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}gn.physical={uniforms:Zt([gn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new p(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new P(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new p},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new P(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new P(1,1,1)},specularColorMap:{value:null}}]),vertexShader:fn.meshphysical_vert,fragmentShader:fn.meshphysical_frag};class Mn extends Kt{constructor(e=-1,t=1,n=1,r=-1,i=.1,s=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=s,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=n-e,s=n+e,o=r+t,a=r-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,s=i+e*this.view.width,o-=t*this.view.offsetY,a=o-t*this.view.height}this.projectionMatrix.makeOrthographic(i,s,o,a,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}Mn.prototype.isOrthographicCamera=!0;const Sn=[.125,.215,.35,.446,.526,.582],Tn=new Mn,En=new P;let An=null;const Cn=(1+Math.sqrt(5))/2,Pn=1/Cn,Rn=[new V(1,1,1),new V(-1,1,1),new V(1,1,-1),new V(-1,1,-1),new V(0,Cn,Pn),new V(0,Cn,-Pn),new V(Pn,0,Cn),new V(-Pn,0,Cn),new V(Cn,Pn,0),new V(-Cn,Pn,0)];class Ln{constructor(e){this._renderer=e,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(e,t=0,n=.1,r=100){An=this._renderer.getRenderTarget(),this._setSize(256);const i=this._allocateTargets();return i.depthBuffer=!0,this._sceneToCubeUV(e,n,r,i),t>0&&this._blur(i,0,0,t),this._applyPMREM(i),this._cleanup(i),i}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=Bn(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=On(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(An),e.scissorTest=!1,Dn(e,0,0,e.width,e.height)}_fromTexture(e,t){301===e.mapping||302===e.mapping?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),An=this._renderer.getRenderTarget();const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize-32,n={magFilter:1006,minFilter:1006,generateMipmaps:!1,type:1016,format:1023,encoding:3e3,depthBuffer:!1},r=In(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=In(e,t,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(e){const t=[],n=[],r=[];let i=e;const s=e-4+1+Sn.length;for(let o=0;o<s;o++){const s=Math.pow(2,i);n.push(s);let a=1/s;o>e-4?a=Sn[o-e+4-1]:0===o&&(a=0),r.push(a);const l=1/(s-1),c=-l/2,h=1+l/2,u=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,f=3,m=2,g=1,v=new Float32Array(f*p*d),y=new Float32Array(m*p*d),x=new Float32Array(g*p*d);for(let e=0;e<d;e++){const t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];v.set(r,f*p*e),y.set(u,m*p*e);const i=[e,e,e,e,e,e];x.set(i,g*p*e)}const w=new At;w.setAttribute("position",new ct(v,f)),w.setAttribute("uv",new ct(y,m)),w.setAttribute("faceIndex",new ct(x,g)),t.push(w),i>4&&i--}return{lodPlanes:t,sizeLods:n,sigmas:r}}(r)),this._blurMaterial=function(e,t,n){const r=new Float32Array(20),i=new V(0,1,0);return new Qt({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:"\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",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})}(r,e,t)}return r}_compileMaterial(e){const t=new Wt(this._lodPlanes[0],e);this._renderer.compile(t,Tn)}_sceneToCubeUV(e,t,n,r){const i=new $t(90,1,t,n),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],a=this._renderer,l=a.autoClear,c=a.toneMapping;a.getClearColor(En),a.toneMapping=0,a.autoClear=!1;const h=new ot({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),u=new Wt(new qt,h);let d=!1;const p=e.background;p?p.isColor&&(h.color.copy(p),e.background=null,d=!0):(h.color.copy(En),d=!0);for(let t=0;t<6;t++){const n=t%3;0===n?(i.up.set(0,s[t],0),i.lookAt(o[t],0,0)):1===n?(i.up.set(0,0,s[t]),i.lookAt(0,o[t],0)):(i.up.set(0,s[t],0),i.lookAt(0,0,o[t]));const l=this._cubeSize;Dn(r,n*l,t>2?l:0,l,l),a.setRenderTarget(r),d&&a.render(u,i),a.render(e,i)}u.geometry.dispose(),u.material.dispose(),a.toneMapping=c,a.autoClear=l,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,r=301===e.mapping||302===e.mapping;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=Bn()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=On());const i=r?this._cubemapMaterial:this._equirectMaterial,s=new Wt(this._lodPlanes[0],i);i.uniforms.envMap.value=e;const o=this._cubeSize;Dn(t,0,0,3*o,2*o),n.setRenderTarget(t),n.render(s,Tn)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let t=1;t<this._lodPlanes.length;t++){const n=Math.sqrt(this._sigmas[t]*this._sigmas[t]-this._sigmas[t-1]*this._sigmas[t-1]),r=Rn[(t-1)%Rn.length];this._blur(e,t-1,t,n,r)}t.autoClear=n}_blur(e,t,n,r,i){const s=this._pingPongRenderTarget;this._halfBlur(e,s,t,n,r,"latitudinal",i),this._halfBlur(s,e,n,n,r,"longitudinal",i)}_halfBlur(e,t,n,r,i,s,o){const a=this._renderer,l=this._blurMaterial;"latitudinal"!==s&&"longitudinal"!==s&&console.error("blur direction must be either latitudinal or longitudinal!");const c=new Wt(this._lodPlanes[r],l),h=l.uniforms,u=this._sizeLods[n]-1,d=isFinite(i)?Math.PI/(2*u):2*Math.PI/39,p=i/d,f=isFinite(i)?1+Math.floor(3*p):20;f>20&&console.warn(`sigmaRadians, ${i}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let e=0;e<20;++e){const t=e/p,n=Math.exp(-t*t/2);m.push(n),0===e?g+=n:e<f&&(g+=2*n)}for(let e=0;e<m.length;e++)m[e]=m[e]/g;h.envMap.value=e.texture,h.samples.value=f,h.weights.value=m,h.latitudinal.value="latitudinal"===s,o&&(h.poleAxis.value=o);const{_lodMax:v}=this;h.dTheta.value=d,h.mipInt.value=v-n;const y=this._sizeLods[r];Dn(t,3*y*(r>v-4?r-v+4:0),4*(this._cubeSize-y),3*y,2*y),a.setRenderTarget(t),a.render(c,Tn)}}function In(e,t,n){const r=new z(e,t,n);return r.texture.mapping=306,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Dn(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function On(){return new Qt({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:"\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",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 Bn(){return new Qt({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:"\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",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 Nn(e){let t=new WeakMap,n=null;function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const s=i.mapping,o=303===s||304===s,a=301===s||302===s;if(o||a){if(i.isRenderTargetTexture&&!0===i.needsPMREMUpdate){i.needsPMREMUpdate=!1;let r=t.get(i);return null===n&&(n=new Ln(e)),r=o?n.fromEquirectangular(i,r):n.fromCubemap(i,r),t.set(i,r),r.texture}if(t.has(i))return t.get(i).texture;{const s=i.image;if(o&&s&&s.height>0||a&&s&&function(e){let t=0;for(let n=0;n<6;n++)void 0!==e[n]&&t++;return 6===t}(s)){null===n&&(n=new Ln(e));const s=o?n.fromEquirectangular(i):n.fromCubemap(i);return t.set(i,s),i.addEventListener("dispose",r),s.texture}return null}}}return i},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function zn(e){const t={};function n(n){if(void 0!==t[n])return t[n];let r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(e){e.isWebGL2?n("EXT_color_buffer_float"):(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(e){const t=n(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function Un(e,t,n,r){const i={},s=new WeakMap;function o(e){const a=e.target;null!==a.index&&t.remove(a.index);for(const e in a.attributes)t.remove(a.attributes[e]);a.removeEventListener("dispose",o),delete i[a.id];const l=s.get(a);l&&(t.remove(l),s.delete(a)),r.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,n.memory.geometries--}function a(e){const n=[],r=e.index,i=e.attributes.position;let o=0;if(null!==r){const e=r.array;o=r.version;for(let t=0,r=e.length;t<r;t+=3){const r=e[t+0],i=e[t+1],s=e[t+2];n.push(r,i,i,s,s,r)}}else{const e=i.array;o=i.version;for(let t=0,r=e.length/3-1;t<r;t+=3){const e=t+0,r=t+1,i=t+2;n.push(e,r,r,i,i,e)}}const a=new(m(n)?gt:ft)(n,1);a.version=o;const l=s.get(e);l&&t.remove(l),s.set(e,a)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",o),i[t.id]=!0,n.memory.geometries++),t},update:function(e){const n=e.attributes;for(const e in n)t.update(n[e],34962);const r=e.morphAttributes;for(const e in r){const n=r[e];for(let e=0,r=n.length;e<r;e++)t.update(n[e],34962)}},getWireframeAttribute:function(e){const t=s.get(e);if(t){const n=e.index;null!==n&&t.version<n.version&&a(e)}else a(e);return s.get(e)}}}function kn(e,t,n,r){const i=r.isWebGL2;let s,o,a;this.setMode=function(e){s=e},this.setIndex=function(e){o=e.type,a=e.bytesPerElement},this.render=function(t,r){e.drawElements(s,r,o,t*a),n.update(r,s,1)},this.renderInstances=function(r,l,c){if(0===c)return;let h,u;if(i)h=e,u="drawElementsInstanced";else if(h=t.get("ANGLE_instanced_arrays"),u="drawElementsInstancedANGLE",null===h)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[u](s,l,o,r*a,c),n.update(l,s,c)}}function Fn(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,n,r){switch(t.calls++,n){case 4:t.triangles+=r*(e/3);break;case 1:t.lines+=r*(e/2);break;case 3:t.lines+=r*(e-1);break;case 2:t.lines+=r*e;break;case 0:t.points+=r*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function Hn(e,t){return e[0]-t[0]}function Gn(e,t){return Math.abs(t[1])-Math.abs(e[1])}function jn(e,t){let n=1;const r=t.isInterleavedBufferAttribute?t.data.array:t.array;r instanceof Int8Array?n=127:r instanceof Int16Array?n=32767:r instanceof Int32Array?n=2147483647:console.error("THREE.WebGLMorphtargets: Unsupported morph attribute data type: ",r),e.divideScalar(n)}function Vn(e,t,n){const r={},i=new Float32Array(8),s=new WeakMap,o=new N,a=[];for(let e=0;e<8;e++)a[e]=[e,0];return{update:function(l,c,h,u){const d=l.morphTargetInfluences;if(!0===t.isWebGL2){const r=c.morphAttributes.position||c.morphAttributes.normal||c.morphAttributes.color,i=void 0!==r?r.length:0;let a=s.get(c);if(void 0===a||a.count!==i){void 0!==a&&a.texture.dispose();const e=void 0!==c.morphAttributes.position,n=void 0!==c.morphAttributes.normal,r=void 0!==c.morphAttributes.color,l=c.morphAttributes.position||[],h=c.morphAttributes.normal||[],u=c.morphAttributes.color||[];let d=0;!0===e&&(d=1),!0===n&&(d=2),!0===r&&(d=3);let f=c.attributes.position.count*d,m=1;f>t.maxTextureSize&&(m=Math.ceil(f/t.maxTextureSize),f=t.maxTextureSize);const g=new Float32Array(f*m*4*i),v=new U(g,f,m,i);v.type=1015,v.needsUpdate=!0;const y=4*d;for(let t=0;t<i;t++){const i=l[t],s=h[t],a=u[t],c=f*m*4*t;for(let t=0;t<i.count;t++){const l=t*y;!0===e&&(o.fromBufferAttribute(i,t),!0===i.normalized&&jn(o,i),g[c+l+0]=o.x,g[c+l+1]=o.y,g[c+l+2]=o.z,g[c+l+3]=0),!0===n&&(o.fromBufferAttribute(s,t),!0===s.normalized&&jn(o,s),g[c+l+4]=o.x,g[c+l+5]=o.y,g[c+l+6]=o.z,g[c+l+7]=0),!0===r&&(o.fromBufferAttribute(a,t),!0===a.normalized&&jn(o,a),g[c+l+8]=o.x,g[c+l+9]=o.y,g[c+l+10]=o.z,g[c+l+11]=4===a.itemSize?o.w:1)}}a={count:i,texture:v,size:new p(f,m)},s.set(c,a),c.addEventListener("dispose",(function e(){v.dispose(),s.delete(c),c.removeEventListener("dispose",e)}))}let l=0;for(let e=0;e<d.length;e++)l+=d[e];const h=c.morphTargetsRelative?1:1-l;u.getUniforms().setValue(e,"morphTargetBaseInfluence",h),u.getUniforms().setValue(e,"morphTargetInfluences",d),u.getUniforms().setValue(e,"morphTargetsTexture",a.texture,n),u.getUniforms().setValue(e,"morphTargetsTextureSize",a.size)}else{const t=void 0===d?0:d.length;let n=r[c.id];if(void 0===n||n.length!==t){n=[];for(let e=0;e<t;e++)n[e]=[e,0];r[c.id]=n}for(let e=0;e<t;e++){const t=n[e];t[0]=e,t[1]=d[e]}n.sort(Gn);for(let e=0;e<8;e++)e<t&&n[e][1]?(a[e][0]=n[e][0],a[e][1]=n[e][1]):(a[e][0]=Number.MAX_SAFE_INTEGER,a[e][1]=0);a.sort(Hn);const s=c.morphAttributes.position,o=c.morphAttributes.normal;let l=0;for(let e=0;e<8;e++){const t=a[e],n=t[0],r=t[1];n!==Number.MAX_SAFE_INTEGER&&r?(s&&c.getAttribute("morphTarget"+e)!==s[n]&&c.setAttribute("morphTarget"+e,s[n]),o&&c.getAttribute("morphNormal"+e)!==o[n]&&c.setAttribute("morphNormal"+e,o[n]),i[e]=r,l+=r):(s&&!0===c.hasAttribute("morphTarget"+e)&&c.deleteAttribute("morphTarget"+e),o&&!0===c.hasAttribute("morphNormal"+e)&&c.deleteAttribute("morphNormal"+e),i[e]=0)}const h=c.morphTargetsRelative?1:1-l;u.getUniforms().setValue(e,"morphTargetBaseInfluence",h),u.getUniforms().setValue(e,"morphTargetInfluences",i)}}}}function Wn(e,t,n,r){let i=new WeakMap;function s(e){const t=e.target;t.removeEventListener("dispose",s),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(e){const o=r.render.frame,a=e.geometry,l=t.get(e,a);return i.get(l)!==o&&(t.update(l),i.set(l,o)),e.isInstancedMesh&&(!1===e.hasEventListener("dispose",s)&&e.addEventListener("dispose",s),n.update(e.instanceMatrix,34962),null!==e.instanceColor&&n.update(e.instanceColor,34962)),l},dispose:function(){i=new WeakMap}}}const Xn=new B,qn=new U,Yn=new F,Zn=new tn,Jn=[],Qn=[],Kn=new Float32Array(16),$n=new Float32Array(9),er=new Float32Array(4);function tr(e,t,n){const r=e[0];if(r<=0||r>0)return e;const i=t*n;let s=Jn[i];if(void 0===s&&(s=new Float32Array(i),Jn[i]=s),0!==t){r.toArray(s,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(s,i)}return s}function nr(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function rr(e,t){for(let n=0,r=t.length;n<r;n++)e[n]=t[n]}function ir(e,t){let n=Qn[t];void 0===n&&(n=new Int32Array(t),Qn[t]=n);for(let r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function sr(e,t){const n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function or(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(nr(n,t))return;e.uniform2fv(this.addr,t),rr(n,t)}}function ar(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(nr(n,t))return;e.uniform3fv(this.addr,t),rr(n,t)}}function lr(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(nr(n,t))return;e.uniform4fv(this.addr,t),rr(n,t)}}function cr(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(nr(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),rr(n,t)}else{if(nr(n,r))return;er.set(r),e.uniformMatrix2fv(this.addr,!1,er),rr(n,r)}}function hr(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(nr(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),rr(n,t)}else{if(nr(n,r))return;$n.set(r),e.uniformMatrix3fv(this.addr,!1,$n),rr(n,r)}}function ur(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(nr(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),rr(n,t)}else{if(nr(n,r))return;Kn.set(r),e.uniformMatrix4fv(this.addr,!1,Kn),rr(n,r)}}function dr(e,t){const n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function pr(e,t){const n=this.cache;nr(n,t)||(e.uniform2iv(this.addr,t),rr(n,t))}function fr(e,t){const n=this.cache;nr(n,t)||(e.uniform3iv(this.addr,t),rr(n,t))}function mr(e,t){const n=this.cache;nr(n,t)||(e.uniform4iv(this.addr,t),rr(n,t))}function gr(e,t){const n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function vr(e,t){const n=this.cache;nr(n,t)||(e.uniform2uiv(this.addr,t),rr(n,t))}function yr(e,t){const n=this.cache;nr(n,t)||(e.uniform3uiv(this.addr,t),rr(n,t))}function xr(e,t){const n=this.cache;nr(n,t)||(e.uniform4uiv(this.addr,t),rr(n,t))}function wr(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2D(t||Xn,i)}function br(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||Yn,i)}function _r(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(t||Zn,i)}function Mr(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||qn,i)}function Sr(e,t){e.uniform1fv(this.addr,t)}function Tr(e,t){const n=tr(t,this.size,2);e.uniform2fv(this.addr,n)}function Er(e,t){const n=tr(t,this.size,3);e.uniform3fv(this.addr,n)}function Ar(e,t){const n=tr(t,this.size,4);e.uniform4fv(this.addr,n)}function Cr(e,t){const n=tr(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function Pr(e,t){const n=tr(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function Rr(e,t){const n=tr(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function Lr(e,t){e.uniform1iv(this.addr,t)}function Ir(e,t){e.uniform2iv(this.addr,t)}function Dr(e,t){e.uniform3iv(this.addr,t)}function Or(e,t){e.uniform4iv(this.addr,t)}function Br(e,t){e.uniform1uiv(this.addr,t)}function Nr(e,t){e.uniform2uiv(this.addr,t)}function zr(e,t){e.uniform3uiv(this.addr,t)}function Ur(e,t){e.uniform4uiv(this.addr,t)}function kr(e,t,n){const r=t.length,i=ir(n,r);e.uniform1iv(this.addr,i);for(let e=0;e!==r;++e)n.setTexture2D(t[e]||Xn,i[e])}function Fr(e,t,n){const r=t.length,i=ir(n,r);e.uniform1iv(this.addr,i);for(let e=0;e!==r;++e)n.setTexture3D(t[e]||Yn,i[e])}function Hr(e,t,n){const r=t.length,i=ir(n,r);e.uniform1iv(this.addr,i);for(let e=0;e!==r;++e)n.setTextureCube(t[e]||Zn,i[e])}function Gr(e,t,n){const r=t.length,i=ir(n,r);e.uniform1iv(this.addr,i);for(let e=0;e!==r;++e)n.setTexture2DArray(t[e]||qn,i[e])}function jr(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(e){switch(e){case 5126:return sr;case 35664:return or;case 35665:return ar;case 35666:return lr;case 35674:return cr;case 35675:return hr;case 35676:return ur;case 5124:case 35670:return dr;case 35667:case 35671:return pr;case 35668:case 35672:return fr;case 35669:case 35673:return mr;case 5125:return gr;case 36294:return vr;case 36295:return yr;case 36296:return xr;case 35678:case 36198:case 36298:case 36306:case 35682:return wr;case 35679:case 36299:case 36307:return br;case 35680:case 36300:case 36308:case 36293:return _r;case 36289:case 36303:case 36311:case 36292:return Mr}}(t.type)}function Vr(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return Sr;case 35664:return Tr;case 35665:return Er;case 35666:return Ar;case 35674:return Cr;case 35675:return Pr;case 35676:return Rr;case 5124:case 35670:return Lr;case 35667:case 35671:return Ir;case 35668:case 35672:return Dr;case 35669:case 35673:return Or;case 5125:return Br;case 36294:return Nr;case 36295:return zr;case 36296:return Ur;case 35678:case 36198:case 36298:case 36306:case 35682:return kr;case 35679:case 36299:case 36307:return Fr;case 35680:case 36300:case 36308:case 36293:return Hr;case 36289:case 36303:case 36311:case 36292:return Gr}}(t.type)}function Wr(e){this.id=e,this.seq=[],this.map={}}Vr.prototype.updateCache=function(e){const t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),rr(t,e)},Wr.prototype.setValue=function(e,t,n){const r=this.seq;for(let i=0,s=r.length;i!==s;++i){const s=r[i];s.setValue(e,t[s.id],n)}};const Xr=/(\w+)(\])?(\[|\.)?/g;function qr(e,t){e.seq.push(t),e.map[t.id]=t}function Yr(e,t,n){const r=e.name,i=r.length;for(Xr.lastIndex=0;;){const s=Xr.exec(r),o=Xr.lastIndex;let a=s[1];const l="]"===s[2],c=s[3];if(l&&(a|=0),void 0===c||"["===c&&o+2===i){qr(n,void 0===c?new jr(a,e,t):new Vr(a,e,t));break}{let e=n.map[a];void 0===e&&(e=new Wr(a),qr(n,e)),n=e}}}function Zr(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,35718);for(let r=0;r<n;++r){const n=e.getActiveUniform(t,r);Yr(n,e.getUniformLocation(t,n.name),this)}}function Jr(e,t,n){const r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}Zr.prototype.setValue=function(e,t,n,r){const i=this.map[t];void 0!==i&&i.setValue(e,n,r)},Zr.prototype.setOptional=function(e,t,n){const r=t[n];void 0!==r&&this.setValue(e,n,r)},Zr.upload=function(e,t,n,r){for(let i=0,s=t.length;i!==s;++i){const s=t[i],o=n[s.id];!1!==o.needsUpdate&&s.setValue(e,o.value,r)}},Zr.seqWithValue=function(e,t){const n=[];for(let r=0,i=e.length;r!==i;++r){const i=e[r];i.id in t&&n.push(i)}return n};let Qr=0;function Kr(e,t,n){const r=e.getShaderParameter(t,35713),i=e.getShaderInfoLog(t).trim();if(r&&""===i)return"";const s=parseInt(/ERROR: 0:(\d+)/.exec(i)[1]);return n.toUpperCase()+"\n\n"+i+"\n\n"+function(e,t){const n=e.split("\n"),r=[],i=Math.max(t-6,0),s=Math.min(t+6,n.length);for(let e=i;e<s;e++)r.push(e+1+": "+n[e]);return r.join("\n")}(e.getShaderSource(t),s)}function $r(e,t){const n=function(e){switch(e){case 3e3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function ei(e,t){let n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="OptimizedCineon";break;case 4:n="ACESFilmic";break;case 5:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function ti(e){return""!==e}function ni(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function ri(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const ii=/^[ \t]*#include +<([\w\d./]+)>/gm;function si(e){return e.replace(ii,oi)}function oi(e,t){const n=fn[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return si(n)}const ai=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,li=/#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 ci(e){return e.replace(li,ui).replace(ai,hi)}function hi(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),ui(e,t,n,r)}function ui(e,t,n,r){let i="";for(let e=parseInt(t);e<parseInt(n);e++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return i}function di(e){let t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function pi(e,t,n,r){const i=e.getContext(),s=n.defines;let o=n.vertexShader,a=n.fragmentShader;const l=function(e){let t="SHADOWMAP_TYPE_BASIC";return 1===e.shadowMapType?t="SHADOWMAP_TYPE_PCF":2===e.shadowMapType?t="SHADOWMAP_TYPE_PCF_SOFT":3===e.shadowMapType&&(t="SHADOWMAP_TYPE_VSM"),t}(n),c=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case 301:case 302:t="ENVMAP_TYPE_CUBE";break;case 306:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),h=function(e){let t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case 302:t="ENVMAP_MODE_REFRACTION"}return t}(n),u=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case 0:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD"}return t}(n),d=function(e){const t=e.envMapCubeUVHeight;if(null===t)return null;const n=Math.log2(t/32+1)+3,r=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:r,maxMip:n}}(n),p=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUVHeight||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap||e.transmission)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(ti).join("\n")}(n),f=function(e){const t=[];for(const n in e){const r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(s),m=i.createProgram();let g,v,y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=[f].filter(ti).join("\n"),g.length>0&&(g+="\n"),v=[p,f].filter(ti).join("\n"),v.length>0&&(v+="\n")):(g=[di(n),"#define SHADER_NAME "+n.shaderName,f,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.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 "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(ti).join("\n"),v=[p,di(n),"#define SHADER_NAME "+n.shaderName,f,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+h:"",n.envMap?"#define "+u:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",n.specularColorMap?"#define USE_SPECULARCOLORMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEENCOLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?fn.tonemapping_pars_fragment:"",0!==n.toneMapping?ei("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",fn.encodings_pars_fragment,$r("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(ti).join("\n")),o=si(o),o=ni(o,n),o=ri(o,n),a=si(a),a=ni(a,n),a=ri(a,n),o=ci(o),a=ci(a),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",g=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#define varying in","300 es"===n.glslVersion?"":"layout(location = 0) out highp vec4 pc_fragColor;","300 es"===n.glslVersion?"":"#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"+v);const x=y+v+a,w=Jr(i,35633,y+g+o),b=Jr(i,35632,x);if(i.attachShader(m,w),i.attachShader(m,b),void 0!==n.index0AttributeName?i.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),e.debug.checkShaderErrors){const e=i.getProgramInfoLog(m).trim(),t=i.getShaderInfoLog(w).trim(),n=i.getShaderInfoLog(b).trim();let r=!0,s=!0;if(!1===i.getProgramParameter(m,35714)){r=!1;const t=Kr(i,w,"vertex"),n=Kr(i,b,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(m,35715)+"\n\nProgram Info Log: "+e+"\n"+t+"\n"+n)}else""!==e?console.warn("THREE.WebGLProgram: Program Info Log:",e):""!==t&&""!==n||(s=!1);s&&(this.diagnostics={runnable:r,programLog:e,vertexShader:{log:t,prefix:g},fragmentShader:{log:n,prefix:v}})}let _,M;return i.deleteShader(w),i.deleteShader(b),this.getUniforms=function(){return void 0===_&&(_=new Zr(i,m)),_},this.getAttributes=function(){return void 0===M&&(M=function(e,t){const n={},r=e.getProgramParameter(t,35721);for(let i=0;i<r;i++){const r=e.getActiveAttrib(t,i),s=r.name;let o=1;35674===r.type&&(o=2),35675===r.type&&(o=3),35676===r.type&&(o=4),n[s]={type:r.type,location:e.getAttribLocation(t,s),locationSize:o}}return n}(i,m)),M},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(m),this.program=void 0},this.name=n.shaderName,this.id=Qr++,this.cacheKey=t,this.usedTimes=1,this.program=m,this.vertexShader=w,this.fragmentShader=b,this}let fi=0;class mi{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),s=this._getShaderCacheForMaterial(e);return!1===s.has(r)&&(s.add(r),r.usedTimes++),!1===s.has(i)&&(s.add(i),i.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const e of t)e.usedTimes--,0===e.usedTimes&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;return!1===t.has(e)&&t.set(e,new Set),t.get(e)}_getShaderStage(e){const t=this.shaderCache;if(!1===t.has(e)){const n=new gi(e);t.set(e,n)}return t.get(e)}}class gi{constructor(e){this.id=fi++,this.code=e,this.usedTimes=0}}function vi(e,t,n,r,i,s,o){const a=new Ie,l=new mi,c=[],h=i.isWebGL2,u=i.logarithmicDepthBuffer,d=i.floatVertexTextures,p=i.maxVertexUniforms,f=i.vertexTextures;let m=i.precision;const g={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"};return{getParameters:function(s,a,c,v,y){const x=v.fog,w=y.geometry,b=s.isMeshStandardMaterial?v.environment:null,_=(s.isMeshStandardMaterial?n:t).get(s.envMap||b),M=_&&306===_.mapping?_.image.height:null,S=g[s.type],T=y.isSkinnedMesh?function(e){const t=e.skeleton.bones;if(d)return 1024;{const e=p,n=Math.floor((e-20)/4),r=Math.min(n,t.length);return r<t.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+r+"."),0):r}}(y):0;null!==s.precision&&(m=i.getMaxPrecision(s.precision),m!==s.precision&&console.warn("THREE.WebGLProgram.getParameters:",s.precision,"not supported, using",m,"instead."));const E=w.morphAttributes.position||w.morphAttributes.normal||w.morphAttributes.color,A=void 0!==E?E.length:0;let C,P,R,L,I=0;if(void 0!==w.morphAttributes.position&&(I=1),void 0!==w.morphAttributes.normal&&(I=2),void 0!==w.morphAttributes.color&&(I=3),S){const e=gn[S];C=e.vertexShader,P=e.fragmentShader}else C=s.vertexShader,P=s.fragmentShader,l.update(s),R=l.getVertexShaderID(s),L=l.getFragmentShaderID(s);const D=e.getRenderTarget(),O=s.alphaTest>0,B=s.clearcoat>0;return{isWebGL2:h,shaderID:S,shaderName:s.type,vertexShader:C,fragmentShader:P,defines:s.defines,customVertexShaderID:R,customFragmentShaderID:L,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:m,instancing:!0===y.isInstancedMesh,instancingColor:!0===y.isInstancedMesh&&null!==y.instanceColor,supportsVertexTextures:f,outputEncoding:null===D?e.outputEncoding:!0===D.isXRRenderTarget?D.texture.encoding:3e3,map:!!s.map,matcap:!!s.matcap,envMap:!!_,envMapMode:_&&_.mapping,envMapCubeUVHeight:M,lightMap:!!s.lightMap,aoMap:!!s.aoMap,emissiveMap:!!s.emissiveMap,bumpMap:!!s.bumpMap,normalMap:!!s.normalMap,objectSpaceNormalMap:1===s.normalMapType,tangentSpaceNormalMap:0===s.normalMapType,decodeVideoTexture:!!s.map&&!0===s.map.isVideoTexture&&3001===s.map.encoding,clearcoat:B,clearcoatMap:B&&!!s.clearcoatMap,clearcoatRoughnessMap:B&&!!s.clearcoatRoughnessMap,clearcoatNormalMap:B&&!!s.clearcoatNormalMap,displacementMap:!!s.displacementMap,roughnessMap:!!s.roughnessMap,metalnessMap:!!s.metalnessMap,specularMap:!!s.specularMap,specularIntensityMap:!!s.specularIntensityMap,specularColorMap:!!s.specularColorMap,opaque:!1===s.transparent&&1===s.blending,alphaMap:!!s.alphaMap,alphaTest:O,gradientMap:!!s.gradientMap,sheen:s.sheen>0,sheenColorMap:!!s.sheenColorMap,sheenRoughnessMap:!!s.sheenRoughnessMap,transmission:s.transmission>0,transmissionMap:!!s.transmissionMap,thicknessMap:!!s.thicknessMap,combine:s.combine,vertexTangents:!!s.normalMap&&!!w.attributes.tangent,vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!w.attributes.color&&4===w.attributes.color.itemSize,vertexUvs:!!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatMap||s.clearcoatRoughnessMap||s.clearcoatNormalMap||s.displacementMap||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheenColorMap||s.sheenRoughnessMap),uvsVertexOnly:!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatNormalMap||s.transmission>0||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheen>0||s.sheenColorMap||s.sheenRoughnessMap||!s.displacementMap),fog:!!x,useFog:s.fog,fogExp2:x&&x.isFogExp2,flatShading:!!s.flatShading,sizeAttenuation:s.sizeAttenuation,logarithmicDepthBuffer:u,skinning:!0===y.isSkinnedMesh&&T>0,maxBones:T,useVertexTexture:d,morphTargets:void 0!==w.morphAttributes.position,morphNormals:void 0!==w.morphAttributes.normal,morphColors:void 0!==w.morphAttributes.color,morphTargetsCount:A,morphTextureStride:I,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:s.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.length>0,shadowMapType:e.shadowMap.type,toneMapping:s.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:2===s.side,flipSided:1===s.side,depthPacking:void 0!==s.depthPacking&&s.depthPacking,index0AttributeName:s.index0AttributeName,extensionDerivatives:s.extensions&&s.extensions.derivatives,extensionFragDepth:s.extensions&&s.extensions.fragDepth,extensionDrawBuffers:s.extensions&&s.extensions.drawBuffers,extensionShaderTextureLOD:s.extensions&&s.extensions.shaderTextureLOD,rendererExtensionFragDepth:h||r.has("EXT_frag_depth"),rendererExtensionDrawBuffers:h||r.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:h||r.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(function(e,t){e.push(t.precision),e.push(t.outputEncoding),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.combine),e.push(t.vertexUvs),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.maxBones),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection)}(n,t),function(e,t){a.disableAll(),t.isWebGL2&&a.enable(0),t.supportsVertexTextures&&a.enable(1),t.instancing&&a.enable(2),t.instancingColor&&a.enable(3),t.map&&a.enable(4),t.matcap&&a.enable(5),t.envMap&&a.enable(6),t.lightMap&&a.enable(7),t.aoMap&&a.enable(8),t.emissiveMap&&a.enable(9),t.bumpMap&&a.enable(10),t.normalMap&&a.enable(11),t.objectSpaceNormalMap&&a.enable(12),t.tangentSpaceNormalMap&&a.enable(13),t.clearcoat&&a.enable(14),t.clearcoatMap&&a.enable(15),t.clearcoatRoughnessMap&&a.enable(16),t.clearcoatNormalMap&&a.enable(17),t.displacementMap&&a.enable(18),t.specularMap&&a.enable(19),t.roughnessMap&&a.enable(20),t.metalnessMap&&a.enable(21),t.gradientMap&&a.enable(22),t.alphaMap&&a.enable(23),t.alphaTest&&a.enable(24),t.vertexColors&&a.enable(25),t.vertexAlphas&&a.enable(26),t.vertexUvs&&a.enable(27),t.vertexTangents&&a.enable(28),t.uvsVertexOnly&&a.enable(29),t.fog&&a.enable(30),e.push(a.mask),a.disableAll(),t.useFog&&a.enable(0),t.flatShading&&a.enable(1),t.logarithmicDepthBuffer&&a.enable(2),t.skinning&&a.enable(3),t.useVertexTexture&&a.enable(4),t.morphTargets&&a.enable(5),t.morphNormals&&a.enable(6),t.morphColors&&a.enable(7),t.premultipliedAlpha&&a.enable(8),t.shadowMapEnabled&&a.enable(9),t.physicallyCorrectLights&&a.enable(10),t.doubleSided&&a.enable(11),t.flipSided&&a.enable(12),t.depthPacking&&a.enable(13),t.dithering&&a.enable(14),t.specularIntensityMap&&a.enable(15),t.specularColorMap&&a.enable(16),t.transmission&&a.enable(17),t.transmissionMap&&a.enable(18),t.thicknessMap&&a.enable(19),t.sheen&&a.enable(20),t.sheenColorMap&&a.enable(21),t.sheenRoughnessMap&&a.enable(22),t.decodeVideoTexture&&a.enable(23),t.opaque&&a.enable(24),e.push(a.mask)}(n,t),n.push(e.outputEncoding)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=g[e.type];let n;if(t){const e=gn[t];n=Jt.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let r;for(let e=0,t=c.length;e<t;e++){const t=c[e];if(t.cacheKey===n){r=t,++r.usedTimes;break}}return void 0===r&&(r=new pi(e,n,t,s),c.push(r)),r},releaseProgram:function(e){if(0==--e.usedTimes){const t=c.indexOf(e);c[t]=c[c.length-1],c.pop(),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:c,dispose:function(){l.dispose()}}}function yi(){let e=new WeakMap;return{get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new WeakMap}}}function xi(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function wi(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function bi(){const e=[];let t=0;const n=[],r=[],i=[];function s(n,r,i,s,o,a){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:r,material:i,groupOrder:s,renderOrder:n.renderOrder,z:o,group:a},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=i,l.groupOrder=s,l.renderOrder=n.renderOrder,l.z=o,l.group=a),t++,l}return{opaque:n,transmissive:r,transparent:i,init:function(){t=0,n.length=0,r.length=0,i.length=0},push:function(e,t,o,a,l,c){const h=s(e,t,o,a,l,c);o.transmission>0?r.push(h):!0===o.transparent?i.push(h):n.push(h)},unshift:function(e,t,o,a,l,c){const h=s(e,t,o,a,l,c);o.transmission>0?r.unshift(h):!0===o.transparent?i.unshift(h):n.unshift(h)},finish:function(){for(let n=t,r=e.length;n<r;n++){const t=e[n];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){n.length>1&&n.sort(e||xi),r.length>1&&r.sort(t||wi),i.length>1&&i.sort(t||wi)}}}function _i(){let e=new WeakMap;return{get:function(t,n){let r;return!1===e.has(t)?(r=new bi,e.set(t,[r])):n>=e.get(t).length?(r=new bi,e.get(t).push(r)):r=e.get(t)[n],r},dispose:function(){e=new WeakMap}}}function Mi(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new V,color:new P};break;case"SpotLight":n={position:new V,direction:new V,color:new P,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new V,color:new P,distance:0,decay:0};break;case"HemisphereLight":n={direction:new V,skyColor:new P,groundColor:new P};break;case"RectAreaLight":n={color:new P,position:new V,halfWidth:new V,halfHeight:new V}}return e[t.id]=n,n}}}let Si=0;function Ti(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Ei(e,t){const n=new Mi,r=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new p};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new p,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let e=0;e<9;e++)i.probe.push(new V);const s=new V,o=new be,a=new be;return{setup:function(s,o){let a=0,l=0,c=0;for(let e=0;e<9;e++)i.probe[e].set(0,0,0);let h=0,u=0,d=0,p=0,f=0,m=0,g=0,v=0;s.sort(Ti);const y=!0!==o?Math.PI:1;for(let e=0,t=s.length;e<t;e++){const t=s[e],o=t.color,x=t.intensity,w=t.distance,b=t.shadow&&t.shadow.map?t.shadow.map.texture:null;if(t.isAmbientLight)a+=o.r*x*y,l+=o.g*x*y,c+=o.b*x*y;else if(t.isLightProbe)for(let e=0;e<9;e++)i.probe[e].addScaledVector(t.sh.coefficients[e],x);else if(t.isDirectionalLight){const e=n.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*y),t.castShadow){const e=t.shadow,n=r.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,i.directionalShadow[h]=n,i.directionalShadowMap[h]=b,i.directionalShadowMatrix[h]=t.shadow.matrix,m++}i.directional[h]=e,h++}else if(t.isSpotLight){const e=n.get(t);if(e.position.setFromMatrixPosition(t.matrixWorld),e.color.copy(o).multiplyScalar(x*y),e.distance=w,e.coneCos=Math.cos(t.angle),e.penumbraCos=Math.cos(t.angle*(1-t.penumbra)),e.decay=t.decay,t.castShadow){const e=t.shadow,n=r.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,i.spotShadow[d]=n,i.spotShadowMap[d]=b,i.spotShadowMatrix[d]=t.shadow.matrix,v++}i.spot[d]=e,d++}else if(t.isRectAreaLight){const e=n.get(t);e.color.copy(o).multiplyScalar(x),e.halfWidth.set(.5*t.width,0,0),e.halfHeight.set(0,.5*t.height,0),i.rectArea[p]=e,p++}else if(t.isPointLight){const e=n.get(t);if(e.color.copy(t.color).multiplyScalar(t.intensity*y),e.distance=t.distance,e.decay=t.decay,t.castShadow){const e=t.shadow,n=r.get(t);n.shadowBias=e.bias,n.shadowNormalBias=e.normalBias,n.shadowRadius=e.radius,n.shadowMapSize=e.mapSize,n.shadowCameraNear=e.camera.near,n.shadowCameraFar=e.camera.far,i.pointShadow[u]=n,i.pointShadowMap[u]=b,i.pointShadowMatrix[u]=t.shadow.matrix,g++}i.point[u]=e,u++}else if(t.isHemisphereLight){const e=n.get(t);e.skyColor.copy(t.color).multiplyScalar(x*y),e.groundColor.copy(t.groundColor).multiplyScalar(x*y),i.hemi[f]=e,f++}}p>0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=mn.LTC_FLOAT_1,i.rectAreaLTC2=mn.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=mn.LTC_HALF_1,i.rectAreaLTC2=mn.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=a,i.ambient[1]=l,i.ambient[2]=c;const x=i.hash;x.directionalLength===h&&x.pointLength===u&&x.spotLength===d&&x.rectAreaLength===p&&x.hemiLength===f&&x.numDirectionalShadows===m&&x.numPointShadows===g&&x.numSpotShadows===v||(i.directional.length=h,i.spot.length=d,i.rectArea.length=p,i.point.length=u,i.hemi.length=f,i.directionalShadow.length=m,i.directionalShadowMap.length=m,i.pointShadow.length=g,i.pointShadowMap.length=g,i.spotShadow.length=v,i.spotShadowMap.length=v,i.directionalShadowMatrix.length=m,i.pointShadowMatrix.length=g,i.spotShadowMatrix.length=v,x.directionalLength=h,x.pointLength=u,x.spotLength=d,x.rectAreaLength=p,x.hemiLength=f,x.numDirectionalShadows=m,x.numPointShadows=g,x.numSpotShadows=v,i.version=Si++)},setupView:function(e,t){let n=0,r=0,l=0,c=0,h=0;const u=t.matrixWorldInverse;for(let t=0,d=e.length;t<d;t++){const d=e[t];if(d.isDirectionalLight){const e=i.directional[n];e.direction.setFromMatrixPosition(d.matrixWorld),s.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(s),e.direction.transformDirection(u),n++}else if(d.isSpotLight){const e=i.spot[l];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(u),e.direction.setFromMatrixPosition(d.matrixWorld),s.setFromMatrixPosition(d.target.matrixWorld),e.direction.sub(s),e.direction.transformDirection(u),l++}else if(d.isRectAreaLight){const e=i.rectArea[c];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(u),a.identity(),o.copy(d.matrixWorld),o.premultiply(u),a.extractRotation(o),e.halfWidth.set(.5*d.width,0,0),e.halfHeight.set(0,.5*d.height,0),e.halfWidth.applyMatrix4(a),e.halfHeight.applyMatrix4(a),c++}else if(d.isPointLight){const e=i.point[r];e.position.setFromMatrixPosition(d.matrixWorld),e.position.applyMatrix4(u),r++}else if(d.isHemisphereLight){const e=i.hemi[h];e.direction.setFromMatrixPosition(d.matrixWorld),e.direction.transformDirection(u),e.direction.normalize(),h++}}},state:i}}function Ai(e,t){const n=new Ei(e,t),r=[],i=[];return{init:function(){r.length=0,i.length=0},state:{lightsArray:r,shadowsArray:i,lights:n},setupLights:function(e){n.setup(r,e)},setupLightsView:function(e){n.setupView(r,e)},pushLight:function(e){r.push(e)},pushShadow:function(e){i.push(e)}}}function Ci(e,t){let n=new WeakMap;return{get:function(r,i=0){let s;return!1===n.has(r)?(s=new Ai(e,t),n.set(r,[s])):i>=n.get(r).length?(s=new Ai(e,t),n.get(r).push(s)):s=n.get(r)[i],s},dispose:function(){n=new WeakMap}}}class Pi extends st{constructor(e){super(),this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}Pi.prototype.isMeshDepthMaterial=!0;class Ri extends st{constructor(e){super(),this.type="MeshDistanceMaterial",this.referencePosition=new V,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}copy(e){return super.copy(e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Li(e,t,n){let r=new hn;const i=new p,s=new p,o=new N,a=new Pi({depthPacking:3201}),l=new Ri,c={},h=n.maxTextureSize,u={0:1,1:0,2:2},d=new Qt({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new p},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=d.clone();f.defines.HORIZONTAL_PASS=1;const m=new At;m.setAttribute("position",new ct(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new Wt(m,d),v=this;function y(n,r){const i=t.update(g);d.defines.VSM_SAMPLES!==n.blurSamples&&(d.defines.VSM_SAMPLES=n.blurSamples,f.defines.VSM_SAMPLES=n.blurSamples,d.needsUpdate=!0,f.needsUpdate=!0),d.uniforms.shadow_pass.value=n.map.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,d,g,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,f,g,null)}function x(t,n,r,i,s,o){let h=null;const d=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(h=void 0!==d?d:!0===r.isPointLight?l:a,e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0){const e=h.uuid,t=n.uuid;let r=c[e];void 0===r&&(r={},c[e]=r);let i=r[t];void 0===i&&(i=h.clone(),r[t]=i),h=i}return h.visible=n.visible,h.wireframe=n.wireframe,h.side=3===o?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:u[n.side],h.alphaMap=n.alphaMap,h.alphaTest=n.alphaTest,h.clipShadows=n.clipShadows,h.clippingPlanes=n.clippingPlanes,h.clipIntersection=n.clipIntersection,h.displacementMap=n.displacementMap,h.displacementScale=n.displacementScale,h.displacementBias=n.displacementBias,h.wireframeLinewidth=n.wireframeLinewidth,h.linewidth=n.linewidth,!0===r.isPointLight&&!0===h.isMeshDistanceMaterial&&(h.referencePosition.setFromMatrixPosition(r.matrixWorld),h.nearDistance=i,h.farDistance=s),h}function w(n,i,s,o,a){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===a)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const r=t.update(n),i=n.material;if(Array.isArray(i)){const t=r.groups;for(let l=0,c=t.length;l<c;l++){const c=t[l],h=i[c.materialIndex];if(h&&h.visible){const t=x(n,h,o,s.near,s.far,a);e.renderBufferDirect(s,null,r,t,n,c)}}}else if(i.visible){const t=x(n,i,o,s.near,s.far,a);e.renderBufferDirect(s,null,r,t,n,null)}}const l=n.children;for(let e=0,t=l.length;e<t;e++)w(l[e],i,s,o,a)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(t,n,a){if(!1===v.enabled)return;if(!1===v.autoUpdate&&!1===v.needsUpdate)return;if(0===t.length)return;const l=e.getRenderTarget(),c=e.getActiveCubeFace(),u=e.getActiveMipmapLevel(),d=e.state;d.setBlending(0),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(let l=0,c=t.length;l<c;l++){const c=t[l],u=c.shadow;if(void 0===u){console.warn("THREE.WebGLShadowMap:",c,"has no shadow.");continue}if(!1===u.autoUpdate&&!1===u.needsUpdate)continue;i.copy(u.mapSize);const p=u.getFrameExtents();if(i.multiply(p),s.copy(u.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(s.x=Math.floor(h/p.x),i.x=s.x*p.x,u.mapSize.x=s.x),i.y>h&&(s.y=Math.floor(h/p.y),i.y=s.y*p.y,u.mapSize.y=s.y)),null!==u.map||u.isPointLightShadow||3!==this.type||(u.map=new z(i.x,i.y),u.map.texture.name=c.name+".shadowMap",u.mapPass=new z(i.x,i.y),u.camera.updateProjectionMatrix()),null===u.map){const e={minFilter:1003,magFilter:1003,format:1023};u.map=new z(i.x,i.y,e),u.map.texture.name=c.name+".shadowMap",u.camera.updateProjectionMatrix()}e.setRenderTarget(u.map),e.clear();const f=u.getViewportCount();for(let e=0;e<f;e++){const t=u.getViewport(e);o.set(s.x*t.x,s.y*t.y,s.x*t.z,s.y*t.w),d.viewport(o),u.updateMatrices(c,e),r=u.getFrustum(),w(n,a,u.camera,c,this.type)}u.isPointLightShadow||3!==this.type||y(u,a),u.needsUpdate=!1}v.needsUpdate=!1,e.setRenderTarget(l,c,u)}}function Ii(e,t,n){const r=n.isWebGL2,i=new function(){let t=!1;const n=new N;let r=null;const i=new N(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,s,o,a){!0===a&&(t*=o,r*=o,s*=o),n.set(t,r,s,o),!1===i.equals(n)&&(e.clearColor(t,r,s,o),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},s=new function(){let t=!1,n=null,r=null,i=null;return{setTest:function(e){e?k(2929):F(2929)},setMask:function(r){n===r||t||(e.depthMask(r),n=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case 0:e.depthFunc(512);break;case 1:e.depthFunc(519);break;case 2:e.depthFunc(513);break;case 3:e.depthFunc(515);break;case 4:e.depthFunc(514);break;case 5:e.depthFunc(518);break;case 6:e.depthFunc(516);break;case 7:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);r=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,n=null,r=null,i=null}}},o=new function(){let t=!1,n=null,r=null,i=null,s=null,o=null,a=null,l=null,c=null;return{setTest:function(e){t||(e?k(2960):F(2960))},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,o){r===t&&i===n&&s===o||(e.stencilFunc(t,n,o),r=t,i=n,s=o)},setOp:function(t,n,r){o===t&&a===n&&l===r||(e.stencilOp(t,n,r),o=t,a=n,l=r)},setLocked:function(e){t=e},setClear:function(t){c!==t&&(e.clearStencil(t),c=t)},reset:function(){t=!1,n=null,r=null,i=null,s=null,o=null,a=null,l=null,c=null}}};let a={},l={},c=new WeakMap,h=[],u=null,d=!1,p=null,f=null,m=null,g=null,v=null,y=null,x=null,w=!1,b=null,_=null,M=null,S=null,T=null;const E=e.getParameter(35661);let A=!1,C=0;const P=e.getParameter(7938);-1!==P.indexOf("WebGL")?(C=parseFloat(/^WebGL (\d)/.exec(P)[1]),A=C>=1):-1!==P.indexOf("OpenGL ES")&&(C=parseFloat(/^OpenGL ES (\d)/.exec(P)[1]),A=C>=2);let R=null,L={};const I=e.getParameter(3088),D=e.getParameter(2978),O=(new N).fromArray(I),B=(new N).fromArray(D);function z(t,n,r){const i=new Uint8Array(4),s=e.createTexture();e.bindTexture(t,s),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let t=0;t<r;t++)e.texImage2D(n+t,0,6408,1,1,0,6408,5121,i);return s}const U={};function k(t){!0!==a[t]&&(e.enable(t),a[t]=!0)}function F(t){!1!==a[t]&&(e.disable(t),a[t]=!1)}U[3553]=z(3553,3553,1),U[34067]=z(34067,34069,6),i.setClear(0,0,0,1),s.setClear(1),o.setClear(0),k(2929),s.setFunc(3),V(!1),W(1),k(2884),j(0);const H={100:32774,101:32778,102:32779};if(r)H[103]=32775,H[104]=32776;else{const e=t.get("EXT_blend_minmax");null!==e&&(H[103]=e.MIN_EXT,H[104]=e.MAX_EXT)}const G={200:0,201:1,202:768,204:770,210:776,208:774,206:772,203:769,205:771,209:775,207:773};function j(t,n,r,i,s,o,a,l){if(0!==t){if(!1===d&&(k(3042),d=!0),5===t)s=s||n,o=o||r,a=a||i,n===f&&s===v||(e.blendEquationSeparate(H[n],H[s]),f=n,v=s),r===m&&i===g&&o===y&&a===x||(e.blendFuncSeparate(G[r],G[i],G[o],G[a]),m=r,g=i,y=o,x=a),p=t,w=null;else if(t!==p||l!==w){if(100===f&&100===v||(e.blendEquation(32774),f=100,v=100),l)switch(t){case 1:e.blendFuncSeparate(1,771,1,771);break;case 2:e.blendFunc(1,1);break;case 3:e.blendFuncSeparate(0,769,0,1);break;case 4:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case 1:e.blendFuncSeparate(770,771,1,771);break;case 2:e.blendFunc(770,1);break;case 3:e.blendFuncSeparate(0,769,0,1);break;case 4:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}m=null,g=null,y=null,x=null,p=t,w=l}}else!0===d&&(F(3042),d=!1)}function V(t){b!==t&&(t?e.frontFace(2304):e.frontFace(2305),b=t)}function W(t){0!==t?(k(2884),t!==_&&(1===t?e.cullFace(1029):2===t?e.cullFace(1028):e.cullFace(1032))):F(2884),_=t}function X(t,n,r){t?(k(32823),S===n&&T===r||(e.polygonOffset(n,r),S=n,T=r)):F(32823)}function q(t){void 0===t&&(t=33984+E-1),R!==t&&(e.activeTexture(t),R=t)}return{buffers:{color:i,depth:s,stencil:o},enable:k,disable:F,bindFramebuffer:function(t,n){return l[t]!==n&&(e.bindFramebuffer(t,n),l[t]=n,r&&(36009===t&&(l[36160]=n),36160===t&&(l[36009]=n)),!0)},drawBuffers:function(r,i){let s=h,o=!1;if(r)if(s=c.get(i),void 0===s&&(s=[],c.set(i,s)),r.isWebGLMultipleRenderTargets){const e=r.texture;if(s.length!==e.length||36064!==s[0]){for(let t=0,n=e.length;t<n;t++)s[t]=36064+t;s.length=e.length,o=!0}}else 36064!==s[0]&&(s[0]=36064,o=!0);else 1029!==s[0]&&(s[0]=1029,o=!0);o&&(n.isWebGL2?e.drawBuffers(s):t.get("WEBGL_draw_buffers").drawBuffersWEBGL(s))},useProgram:function(t){return u!==t&&(e.useProgram(t),u=t,!0)},setBlending:j,setMaterial:function(e,t){2===e.side?F(2884):k(2884);let n=1===e.side;t&&(n=!n),V(n),1===e.blending&&!1===e.transparent?j(0):j(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),s.setFunc(e.depthFunc),s.setTest(e.depthTest),s.setMask(e.depthWrite),i.setMask(e.colorWrite);const r=e.stencilWrite;o.setTest(r),r&&(o.setMask(e.stencilWriteMask),o.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),o.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),X(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage?k(32926):F(32926)},setFlipSided:V,setCullFace:W,setLineWidth:function(t){t!==M&&(A&&e.lineWidth(t),M=t)},setPolygonOffset:X,setScissorTest:function(e){e?k(3089):F(3089)},activeTexture:q,bindTexture:function(t,n){null===R&&q();let r=L[R];void 0===r&&(r={type:void 0,texture:void 0},L[R]=r),r.type===t&&r.texture===n||(e.bindTexture(t,n||U[t]),r.type=t,r.texture=n)},unbindTexture:function(){const t=L[R];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texStorage2D:function(){try{e.texStorage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texStorage3D:function(){try{e.texStorage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage2D:function(){try{e.texSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texSubImage3D:function(){try{e.texSubImage3D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D.apply(e,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(t){!1===O.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),O.copy(t))},viewport:function(t){!1===B.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),B.copy(t))},reset:function(){e.disable(3042),e.disable(2884),e.disable(2929),e.disable(32823),e.disable(3089),e.disable(2960),e.disable(32926),e.blendEquation(32774),e.blendFunc(1,0),e.blendFuncSeparate(1,0,1,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(513),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(519,0,4294967295),e.stencilOp(7680,7680,7680),e.clearStencil(0),e.cullFace(1029),e.frontFace(2305),e.polygonOffset(0,0),e.activeTexture(33984),e.bindFramebuffer(36160,null),!0===r&&(e.bindFramebuffer(36009,null),e.bindFramebuffer(36008,null)),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),a={},R=null,L={},l={},c=new WeakMap,h=[],u=null,d=!1,p=null,f=null,m=null,g=null,v=null,y=null,x=null,w=!1,b=null,_=null,M=null,S=null,T=null,O.set(0,0,e.canvas.width,e.canvas.height),B.set(0,0,e.canvas.width,e.canvas.height),i.reset(),s.reset(),o.reset()}}}function Di(e,t,n,r,i,s,o){const a=i.isWebGL2,l=i.maxTextures,h=i.maxCubemapSize,d=i.maxTextureSize,p=i.maxSamples,f=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,m=/OculusBrowser/g.test(navigator.userAgent),g=new WeakMap;let v;const x=new WeakMap;let w=!1;try{w="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function b(e,t){return w?new OffscreenCanvas(e,t):y("canvas")}function _(e,t,n,r){let i=1;if((e.width>r||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const r=t?u:Math.floor,s=r(i*e.width),o=r(i*e.height);void 0===v&&(v=b(s,o));const a=n?b(s,o):v;return a.width=s,a.height=o,a.getContext("2d").drawImage(e,0,0,s,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+s+"x"+o+")."),a}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function M(e){return c(e.width)&&c(e.height)}function S(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function T(t){e.generateMipmap(t)}function E(n,r,i,s,o=!1){if(!1===a)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let l=r;return 6403===r&&(5126===i&&(l=33326),5131===i&&(l=33325),5121===i&&(l=33321)),33319===r&&(5126===i&&(l=33328),5131===i&&(l=33327),5121===i&&(l=33323)),6408===r&&(5126===i&&(l=34836),5131===i&&(l=34842),5121===i&&(l=3001===s&&!1===o?35907:32856),32819===i&&(l=32854),32820===i&&(l=32855)),33325!==l&&33326!==l&&33327!==l&&33328!==l&&34842!==l&&34836!==l||t.get("EXT_color_buffer_float"),l}function A(e,t,n){return!0===S(e,n)||e.isFramebufferTexture&&1003!==e.minFilter&&1006!==e.minFilter?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function C(e){return 1003===e||1004===e||1005===e?9728:9729}function P(e){const t=e.target;t.removeEventListener("dispose",P),function(e){const t=r.get(e);if(void 0===t.__webglInit)return;const n=e.source,i=x.get(n);if(i){const r=i[t.__cacheKey];r.usedTimes--,0===r.usedTimes&&I(e),0===Object.keys(i).length&&x.delete(n)}r.remove(e)}(t),t.isVideoTexture&&g.delete(t)}function R(t){const n=t.target;n.removeEventListener("dispose",R),function(t){const n=t.texture,i=r.get(t),s=r.get(n);if(void 0!==s.__webglTexture&&(e.deleteTexture(s.__webglTexture),o.memory.textures--),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(i.__webglFramebuffer[t]),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[t]);else e.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&e.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer&&e.deleteRenderbuffer(i.__webglColorRenderbuffer),i.__webglDepthRenderbuffer&&e.deleteRenderbuffer(i.__webglDepthRenderbuffer);if(t.isWebGLMultipleRenderTargets)for(let t=0,i=n.length;t<i;t++){const i=r.get(n[t]);i.__webglTexture&&(e.deleteTexture(i.__webglTexture),o.memory.textures--),r.remove(n[t])}r.remove(n),r.remove(t)}(n)}function I(t){const n=r.get(t);e.deleteTexture(n.__webglTexture);const i=t.source;delete x.get(i)[n.__cacheKey],o.memory.textures--}let D=0;function O(e,t){const i=r.get(e);if(e.isVideoTexture&&function(e){const t=o.render.frame;g.get(e)!==t&&(g.set(e,t),e.update())}(e),!1===e.isRenderTargetTexture&&e.version>0&&i.__version!==e.version){const n=e.image;if(null===n)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else{if(!1!==n.complete)return void k(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,i.__webglTexture)}const B={1e3:10497,1001:33071,1002:33648},N={1003:9728,1004:9984,1005:9986,1006:9729,1007:9985,1008:9987};function z(n,s,o){if(o?(e.texParameteri(n,10242,B[s.wrapS]),e.texParameteri(n,10243,B[s.wrapT]),32879!==n&&35866!==n||e.texParameteri(n,32882,B[s.wrapR]),e.texParameteri(n,10240,N[s.magFilter]),e.texParameteri(n,10241,N[s.minFilter])):(e.texParameteri(n,10242,33071),e.texParameteri(n,10243,33071),32879!==n&&35866!==n||e.texParameteri(n,32882,33071),1001===s.wrapS&&1001===s.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,10240,C(s.magFilter)),e.texParameteri(n,10241,C(s.minFilter)),1003!==s.minFilter&&1006!==s.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!0===t.has("EXT_texture_filter_anisotropic")){const o=t.get("EXT_texture_filter_anisotropic");if(1015===s.type&&!1===t.has("OES_texture_float_linear"))return;if(!1===a&&1016===s.type&&!1===t.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||r.get(s).__currentAnisotropy)&&(e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,i.getMaxAnisotropy())),r.get(s).__currentAnisotropy=s.anisotropy)}}function U(t,n){let r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",P));const i=n.source;let s=x.get(i);void 0===s&&(s={},x.set(i,s));const a=function(e){const t=[];return t.push(e.wrapS),t.push(e.wrapT),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.encoding),t.join()}(n);if(a!==t.__cacheKey){void 0===s[a]&&(s[a]={texture:e.createTexture(),usedTimes:0},o.memory.textures++,r=!0),s[a].usedTimes++;const i=s[t.__cacheKey];void 0!==i&&(s[t.__cacheKey].usedTimes--,0===i.usedTimes&&I(n)),t.__cacheKey=a,t.__webglTexture=s[a].texture}return r}function k(t,r,i){let o=3553;r.isDataArrayTexture&&(o=35866),r.isData3DTexture&&(o=32879);const l=U(t,r),c=r.source;if(n.activeTexture(33984+i),n.bindTexture(o,t.__webglTexture),c.version!==c.__currentVersion||!0===l){e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment),e.pixelStorei(37443,0);const i=function(e){return!a&&(1001!==e.wrapS||1001!==e.wrapT||1003!==e.minFilter&&1006!==e.minFilter)}(r)&&!1===M(r.image);let l=_(r.image,i,!1,d);l=W(r,l);const h=M(l)||a,u=s.convert(r.format,r.encoding);let p,f=s.convert(r.type),m=E(r.internalFormat,u,f,r.encoding,r.isVideoTexture);z(o,r,h);const g=r.mipmaps,v=a&&!0!==r.isVideoTexture,y=void 0===t.__version,x=A(r,l,h);if(r.isDepthTexture)m=6402,a?m=1015===r.type?36012:1014===r.type?33190:1020===r.type?35056:33189:1015===r.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===r.format&&6402===m&&1012!==r.type&&1014!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=1012,f=s.convert(r.type)),1027===r.format&&6402===m&&(m=34041,1020!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=1020,f=s.convert(r.type))),v&&y?n.texStorage2D(3553,1,m,l.width,l.height):n.texImage2D(3553,0,m,l.width,l.height,0,u,f,null);else if(r.isDataTexture)if(g.length>0&&h){v&&y&&n.texStorage2D(3553,x,m,g[0].width,g[0].height);for(let e=0,t=g.length;e<t;e++)p=g[e],v?n.texSubImage2D(3553,e,0,0,p.width,p.height,u,f,p.data):n.texImage2D(3553,e,m,p.width,p.height,0,u,f,p.data);r.generateMipmaps=!1}else v?(y&&n.texStorage2D(3553,x,m,l.width,l.height),n.texSubImage2D(3553,0,0,0,l.width,l.height,u,f,l.data)):n.texImage2D(3553,0,m,l.width,l.height,0,u,f,l.data);else if(r.isCompressedTexture){v&&y&&n.texStorage2D(3553,x,m,g[0].width,g[0].height);for(let e=0,t=g.length;e<t;e++)p=g[e],1023!==r.format?null!==u?v?n.compressedTexSubImage2D(3553,e,0,0,p.width,p.height,u,p.data):n.compressedTexImage2D(3553,e,m,p.width,p.height,0,p.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):v?n.texSubImage2D(3553,e,0,0,p.width,p.height,u,f,p.data):n.texImage2D(3553,e,m,p.width,p.height,0,u,f,p.data)}else if(r.isDataArrayTexture)v?(y&&n.texStorage3D(35866,x,m,l.width,l.height,l.depth),n.texSubImage3D(35866,0,0,0,0,l.width,l.height,l.depth,u,f,l.data)):n.texImage3D(35866,0,m,l.width,l.height,l.depth,0,u,f,l.data);else if(r.isData3DTexture)v?(y&&n.texStorage3D(32879,x,m,l.width,l.height,l.depth),n.texSubImage3D(32879,0,0,0,0,l.width,l.height,l.depth,u,f,l.data)):n.texImage3D(32879,0,m,l.width,l.height,l.depth,0,u,f,l.data);else if(r.isFramebufferTexture)v&&y?n.texStorage2D(3553,x,m,l.width,l.height):n.texImage2D(3553,0,m,l.width,l.height,0,u,f,null);else if(g.length>0&&h){v&&y&&n.texStorage2D(3553,x,m,g[0].width,g[0].height);for(let e=0,t=g.length;e<t;e++)p=g[e],v?n.texSubImage2D(3553,e,0,0,u,f,p):n.texImage2D(3553,e,m,u,f,p);r.generateMipmaps=!1}else v?(y&&n.texStorage2D(3553,x,m,l.width,l.height),n.texSubImage2D(3553,0,0,0,u,f,l)):n.texImage2D(3553,0,m,u,f,l);S(r,h)&&T(o),c.__currentVersion=c.version,r.onUpdate&&r.onUpdate(r)}t.__version=r.version}function F(t,i,o,a,l){const c=s.convert(o.format,o.encoding),h=s.convert(o.type),u=E(o.internalFormat,c,h,o.encoding);r.get(i).__hasExternalTextures||(32879===l||35866===l?n.texImage3D(l,0,u,i.width,i.height,i.depth,0,c,h,null):n.texImage2D(l,0,u,i.width,i.height,0,c,h,null)),n.bindFramebuffer(36160,t),V(i)?f.framebufferTexture2DMultisampleEXT(36160,a,l,r.get(o).__webglTexture,0,j(i)):e.framebufferTexture2D(36160,a,l,r.get(o).__webglTexture,0),n.bindFramebuffer(36160,null)}function H(t,n,r){if(e.bindRenderbuffer(36161,t),n.depthBuffer&&!n.stencilBuffer){let i=33189;if(r||V(n)){const t=n.depthTexture;t&&t.isDepthTexture&&(1015===t.type?i=36012:1014===t.type&&(i=33190));const r=j(n);V(n)?f.renderbufferStorageMultisampleEXT(36161,r,i,n.width,n.height):e.renderbufferStorageMultisample(36161,r,i,n.width,n.height)}else e.renderbufferStorage(36161,i,n.width,n.height);e.framebufferRenderbuffer(36160,36096,36161,t)}else if(n.depthBuffer&&n.stencilBuffer){const i=j(n);r&&!1===V(n)?e.renderbufferStorageMultisample(36161,i,35056,n.width,n.height):V(n)?f.renderbufferStorageMultisampleEXT(36161,i,35056,n.width,n.height):e.renderbufferStorage(36161,34041,n.width,n.height),e.framebufferRenderbuffer(36160,33306,36161,t)}else{const t=!0===n.isWebGLMultipleRenderTargets?n.texture[0]:n.texture,i=s.convert(t.format,t.encoding),o=s.convert(t.type),a=E(t.internalFormat,i,o,t.encoding),l=j(n);r&&!1===V(n)?e.renderbufferStorageMultisample(36161,l,a,n.width,n.height):V(n)?f.renderbufferStorageMultisampleEXT(36161,l,a,n.width,n.height):e.renderbufferStorage(36161,a,n.width,n.height)}e.bindRenderbuffer(36161,null)}function G(t){const i=r.get(t),s=!0===t.isWebGLCubeRenderTarget;if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(s)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(36160,t),!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),O(i.depthTexture,0);const s=r.get(i.depthTexture).__webglTexture,o=j(i);if(1026===i.depthTexture.format)V(i)?f.framebufferTexture2DMultisampleEXT(36160,36096,3553,s,0,o):e.framebufferTexture2D(36160,36096,3553,s,0);else{if(1027!==i.depthTexture.format)throw new Error("Unknown depthTexture format");V(i)?f.framebufferTexture2DMultisampleEXT(36160,33306,3553,s,0,o):e.framebufferTexture2D(36160,33306,3553,s,0)}}(i.__webglFramebuffer,t)}else if(s){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)n.bindFramebuffer(36160,i.__webglFramebuffer[r]),i.__webglDepthbuffer[r]=e.createRenderbuffer(),H(i.__webglDepthbuffer[r],t,!1)}else n.bindFramebuffer(36160,i.__webglFramebuffer),i.__webglDepthbuffer=e.createRenderbuffer(),H(i.__webglDepthbuffer,t,!1);n.bindFramebuffer(36160,null)}function j(e){return Math.min(p,e.samples)}function V(e){const n=r.get(e);return a&&e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function W(e,n){const r=e.encoding,i=e.format,s=e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||1035===e.format||3e3!==r&&(3001===r?!1===a?!0===t.has("EXT_sRGB")&&1023===i?(e.format=1035,e.minFilter=1006,e.generateMipmaps=!1):n=L.sRGBToLinear(n):1023===i&&1009===s||console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",r)),n}this.allocateTextureUnit=function(){const e=D;return e>=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),D+=1,e},this.resetTextureUnits=function(){D=0},this.setTexture2D=O,this.setTexture2DArray=function(e,t){const i=r.get(e);e.version>0&&i.__version!==e.version?k(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){const i=r.get(e);e.version>0&&i.__version!==e.version?k(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=function(t,i){const o=r.get(t);t.version>0&&o.__version!==t.version?function(t,r,i){if(6!==r.image.length)return;const o=U(t,r),l=r.source;if(n.activeTexture(33984+i),n.bindTexture(34067,t.__webglTexture),l.version!==l.__currentVersion||!0===o){e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment),e.pixelStorei(37443,0);const i=r.isCompressedTexture||r.image[0].isCompressedTexture,o=r.image[0]&&r.image[0].isDataTexture,c=[];for(let e=0;e<6;e++)c[e]=i||o?o?r.image[e].image:r.image[e]:_(r.image[e],!1,!0,h),c[e]=W(r,c[e]);const u=c[0],d=M(u)||a,p=s.convert(r.format,r.encoding),f=s.convert(r.type),m=E(r.internalFormat,p,f,r.encoding),g=a&&!0!==r.isVideoTexture,v=void 0===t.__version;let y,x=A(r,u,d);if(z(34067,r,d),i){g&&v&&n.texStorage2D(34067,x,m,u.width,u.height);for(let e=0;e<6;e++){y=c[e].mipmaps;for(let t=0;t<y.length;t++){const i=y[t];1023!==r.format?null!==p?g?n.compressedTexSubImage2D(34069+e,t,0,0,i.width,i.height,p,i.data):n.compressedTexImage2D(34069+e,t,m,i.width,i.height,0,i.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):g?n.texSubImage2D(34069+e,t,0,0,i.width,i.height,p,f,i.data):n.texImage2D(34069+e,t,m,i.width,i.height,0,p,f,i.data)}}}else{y=r.mipmaps,g&&v&&(y.length>0&&x++,n.texStorage2D(34067,x,m,c[0].width,c[0].height));for(let e=0;e<6;e++)if(o){g?n.texSubImage2D(34069+e,0,0,0,c[e].width,c[e].height,p,f,c[e].data):n.texImage2D(34069+e,0,m,c[e].width,c[e].height,0,p,f,c[e].data);for(let t=0;t<y.length;t++){const r=y[t].image[e].image;g?n.texSubImage2D(34069+e,t+1,0,0,r.width,r.height,p,f,r.data):n.texImage2D(34069+e,t+1,m,r.width,r.height,0,p,f,r.data)}}else{g?n.texSubImage2D(34069+e,0,0,0,p,f,c[e]):n.texImage2D(34069+e,0,m,p,f,c[e]);for(let t=0;t<y.length;t++){const r=y[t];g?n.texSubImage2D(34069+e,t+1,0,0,p,f,r.image[e]):n.texImage2D(34069+e,t+1,m,p,f,r.image[e])}}}S(r,d)&&T(34067),l.__currentVersion=l.version,r.onUpdate&&r.onUpdate(r)}t.__version=r.version}(o,t,i):(n.activeTexture(33984+i),n.bindTexture(34067,o.__webglTexture))},this.rebindTextures=function(e,t,n){const i=r.get(e);void 0!==t&&F(i.__webglFramebuffer,e,e.texture,36064,3553),void 0!==n&&G(e)},this.setupRenderTarget=function(t){const l=t.texture,c=r.get(t),h=r.get(l);t.addEventListener("dispose",R),!0!==t.isWebGLMultipleRenderTargets&&(void 0===h.__webglTexture&&(h.__webglTexture=e.createTexture()),h.__version=l.version,o.memory.textures++);const u=!0===t.isWebGLCubeRenderTarget,d=!0===t.isWebGLMultipleRenderTargets,p=M(t)||a;if(u){c.__webglFramebuffer=[];for(let t=0;t<6;t++)c.__webglFramebuffer[t]=e.createFramebuffer()}else if(c.__webglFramebuffer=e.createFramebuffer(),d)if(i.drawBuffers){const n=t.texture;for(let t=0,i=n.length;t<i;t++){const i=r.get(n[t]);void 0===i.__webglTexture&&(i.__webglTexture=e.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");else if(a&&t.samples>0&&!1===V(t)){c.__webglMultisampledFramebuffer=e.createFramebuffer(),c.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,c.__webglColorRenderbuffer);const r=s.convert(l.format,l.encoding),i=s.convert(l.type),o=E(l.internalFormat,r,i,l.encoding),a=j(t);e.renderbufferStorageMultisample(36161,a,o,t.width,t.height),n.bindFramebuffer(36160,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,c.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(c.__webglDepthRenderbuffer=e.createRenderbuffer(),H(c.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(36160,null)}if(u){n.bindTexture(34067,h.__webglTexture),z(34067,l,p);for(let e=0;e<6;e++)F(c.__webglFramebuffer[e],t,l,36064,34069+e);S(l,p)&&T(34067),n.unbindTexture()}else if(d){const e=t.texture;for(let i=0,s=e.length;i<s;i++){const s=e[i],o=r.get(s);n.bindTexture(3553,o.__webglTexture),z(3553,s,p),F(c.__webglFramebuffer,t,s,36064+i,3553),S(s,p)&&T(3553)}n.unbindTexture()}else{let e=3553;(t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(a?e=t.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),n.bindTexture(e,h.__webglTexture),z(e,l,p),F(c.__webglFramebuffer,t,l,36064,e),S(l,p)&&T(e),n.unbindTexture()}t.depthBuffer&&G(t)},this.updateRenderTargetMipmap=function(e){const t=M(e)||a,i=!0===e.isWebGLMultipleRenderTargets?e.texture:[e.texture];for(let s=0,o=i.length;s<o;s++){const o=i[s];if(S(o,t)){const t=e.isWebGLCubeRenderTarget?34067:3553,i=r.get(o).__webglTexture;n.bindTexture(t,i),T(t),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(a&&t.samples>0&&!1===V(t)){const i=t.width,s=t.height;let o=16384;const a=[36064],l=t.stencilBuffer?33306:36096;t.depthBuffer&&a.push(l);const c=r.get(t),h=void 0!==c.__ignoreDepthValues&&c.__ignoreDepthValues;!1===h&&(t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024)),n.bindFramebuffer(36008,c.__webglMultisampledFramebuffer),n.bindFramebuffer(36009,c.__webglFramebuffer),!0===h&&(e.invalidateFramebuffer(36008,[l]),e.invalidateFramebuffer(36009,[l])),e.blitFramebuffer(0,0,i,s,0,0,i,s,o,9728),m&&e.invalidateFramebuffer(36008,a),n.bindFramebuffer(36008,null),n.bindFramebuffer(36009,c.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=G,this.setupFrameBufferTexture=F,this.useMultisampledRTT=V}function Oi(e,t,n){const r=n.isWebGL2;return{convert:function(e,n=null){let i;if(1009===e)return 5121;if(1017===e)return 32819;if(1018===e)return 32820;if(1010===e)return 5120;if(1011===e)return 5122;if(1012===e)return 5123;if(1013===e)return 5124;if(1014===e)return 5125;if(1015===e)return 5126;if(1016===e)return r?5131:(i=t.get("OES_texture_half_float"),null!==i?i.HALF_FLOAT_OES:null);if(1021===e)return 6406;if(1023===e)return 6408;if(1024===e)return 6409;if(1025===e)return 6410;if(1026===e)return 6402;if(1027===e)return 34041;if(1028===e)return 6403;if(1022===e)return console.warn("THREE.WebGLRenderer: THREE.RGBFormat has been removed. Use THREE.RGBAFormat instead. https://github.com/mrdoob/three.js/pull/23228"),6408;if(1035===e)return i=t.get("EXT_sRGB"),null!==i?i.SRGB_ALPHA_EXT:null;if(1029===e)return 36244;if(1030===e)return 33319;if(1031===e)return 33320;if(1033===e)return 36249;if(33776===e||33777===e||33778===e||33779===e)if(3001===n){if(i=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===i)return null;if(33776===e)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(33777===e)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(33778===e)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(33779===e)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(i=t.get("WEBGL_compressed_texture_s3tc"),null===i)return null;if(33776===e)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===e)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===e)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===e)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===e||35841===e||35842===e||35843===e){if(i=t.get("WEBGL_compressed_texture_pvrtc"),null===i)return null;if(35840===e)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===e)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===e)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===e)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===e)return i=t.get("WEBGL_compressed_texture_etc1"),null!==i?i.COMPRESSED_RGB_ETC1_WEBGL:null;if(37492===e||37496===e){if(i=t.get("WEBGL_compressed_texture_etc"),null===i)return null;if(37492===e)return 3001===n?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(37496===e)return 3001===n?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC}if(37808===e||37809===e||37810===e||37811===e||37812===e||37813===e||37814===e||37815===e||37816===e||37817===e||37818===e||37819===e||37820===e||37821===e){if(i=t.get("WEBGL_compressed_texture_astc"),null===i)return null;if(37808===e)return 3001===n?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(37809===e)return 3001===n?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(37810===e)return 3001===n?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(37811===e)return 3001===n?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(37812===e)return 3001===n?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(37813===e)return 3001===n?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(37814===e)return 3001===n?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(37815===e)return 3001===n?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(37816===e)return 3001===n?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(37817===e)return 3001===n?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(37818===e)return 3001===n?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(37819===e)return 3001===n?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(37820===e)return 3001===n?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(37821===e)return 3001===n?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}if(36492===e){if(i=t.get("EXT_texture_compression_bptc"),null===i)return null;if(36492===e)return 3001===n?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT}return 1020===e?r?34042:(i=t.get("WEBGL_depth_texture"),null!==i?i.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}Ri.prototype.isMeshDistanceMaterial=!0;class Bi extends $t{constructor(e=[]){super(),this.cameras=e}}Bi.prototype.isArrayCamera=!0;class Ni extends Xe{constructor(){super(),this.type="Group"}}Ni.prototype.isGroup=!0;const zi={type:"move"};class Ui{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new Ni,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 Ni,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new V,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new V),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new Ni,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new V,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new V),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,s=null;const o=this._targetRay,a=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(null!==o&&(r=t.getPose(e.targetRaySpace,n),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),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(zi))),l&&e.hand){s=!0;for(const r of e.hand.values()){const e=t.getJointPose(r,n);if(void 0===l.joints[r.jointName]){const e=new Ni;e.matrixAutoUpdate=!1,e.visible=!1,l.joints[r.jointName]=e,l.add(e)}const i=l.joints[r.jointName];null!==e&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.jointRadius=e.radius),i.visible=null!==e}const r=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],o=r.position.distanceTo(i.position),a=.02,c=.005;l.inputState.pinching&&o>a+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&o<=a-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==a&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1));return null!==o&&(o.visible=null!==r),null!==a&&(a.visible=null!==i),null!==l&&(l.visible=null!==s),this}}class ki extends B{constructor(e,t,n,r,i,s,o,a,l,c){if(1026!==(c=void 0!==c?c:1026)&&1027!==c)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===c&&(n=1012),void 0===n&&1027===c&&(n=1020),super(null,r,i,s,o,a,c,n,l),this.image={width:e,height:t},this.magFilter=void 0!==o?o:1003,this.minFilter=void 0!==a?a:1003,this.flipY=!1,this.generateMipmaps=!1}}ki.prototype.isDepthTexture=!0;class Fi extends e{constructor(e,t){super();const n=this;let r=null,i=1,s=null,o="local-floor",a=null,l=null,c=null,h=null,u=null;const d=t.getContextAttributes();let p=null,f=null;const m=[],g=new Map,v=new $t;v.layers.enable(1),v.viewport=new N;const y=new $t;y.layers.enable(2),y.viewport=new N;const x=[v,y],w=new Bi;w.layers.enable(1),w.layers.enable(2);let b=null,_=null;function M(e){const t=g.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function S(){g.forEach((function(e,t){e.disconnect(t)})),g.clear(),b=null,_=null,e.setRenderTarget(p),h=null,c=null,l=null,r=null,f=null,R.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function T(e){const t=r.inputSources;for(let e=0;e<m.length;e++)g.set(t[e],m[e]);for(let t=0;t<e.removed.length;t++){const n=e.removed[t],r=g.get(n);r&&(r.dispatchEvent({type:"disconnected",data:n}),g.delete(n))}for(let t=0;t<e.added.length;t++){const n=e.added[t],r=g.get(n);r&&r.dispatchEvent({type:"connected",data:n})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=m[e];return void 0===t&&(t=new Ui,m[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=m[e];return void 0===t&&(t=new Ui,m[e]=t),t.getGripSpace()},this.getHand=function(e){let t=m[e];return void 0===t&&(t=new Ui,m[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){o=e,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return s},this.getBaseLayer=function(){return null!==c?c:h},this.getBinding=function(){return l},this.getFrame=function(){return u},this.getSession=function(){return r},this.setSession=async function(a){if(r=a,null!==r){if(p=e.getRenderTarget(),r.addEventListener("select",M),r.addEventListener("selectstart",M),r.addEventListener("selectend",M),r.addEventListener("squeeze",M),r.addEventListener("squeezestart",M),r.addEventListener("squeezeend",M),r.addEventListener("end",S),r.addEventListener("inputsourceschange",T),!0!==d.xrCompatible&&await t.makeXRCompatible(),void 0===r.renderState.layers||!1===e.capabilities.isWebGL2){const n={antialias:void 0!==r.renderState.layers||d.antialias,alpha:d.alpha,depth:d.depth,stencil:d.stencil,framebufferScaleFactor:i};h=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:h}),f=new z(h.framebufferWidth,h.framebufferHeight,{format:1023,type:1009,encoding:e.outputEncoding})}else{let n=null,s=null,o=null;d.depth&&(o=d.stencil?35056:33190,n=d.stencil?1027:1026,s=d.stencil?1020:1012);const a={colorFormat:3001===e.outputEncoding?35907:32856,depthFormat:o,scaleFactor:i};l=new XRWebGLBinding(r,t),c=l.createProjectionLayer(a),r.updateRenderState({layers:[c]}),f=new z(c.textureWidth,c.textureHeight,{format:1023,type:1009,depthTexture:new ki(c.textureWidth,c.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:d.stencil,encoding:e.outputEncoding,samples:d.antialias?4:0}),e.properties.get(f).__ignoreDepthValues=c.ignoreDepthValues}f.isXRRenderTarget=!0,this.setFoveation(1),s=await r.requestReferenceSpace(o),R.setContext(r),R.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}};const E=new V,A=new V;function C(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===r)return;w.near=y.near=v.near=e.near,w.far=y.far=v.far=e.far,b===w.near&&_===w.far||(r.updateRenderState({depthNear:w.near,depthFar:w.far}),b=w.near,_=w.far);const t=e.parent,n=w.cameras;C(w,t);for(let e=0;e<n.length;e++)C(n[e],t);w.matrixWorld.decompose(w.position,w.quaternion,w.scale),e.position.copy(w.position),e.quaternion.copy(w.quaternion),e.scale.copy(w.scale),e.matrix.copy(w.matrix),e.matrixWorld.copy(w.matrixWorld);const i=e.children;for(let e=0,t=i.length;e<t;e++)i[e].updateMatrixWorld(!0);2===n.length?function(e,t,n){E.setFromMatrixPosition(t.matrixWorld),A.setFromMatrixPosition(n.matrixWorld);const r=E.distanceTo(A),i=t.projectionMatrix.elements,s=n.projectionMatrix.elements,o=i[14]/(i[10]-1),a=i[14]/(i[10]+1),l=(i[9]+1)/i[5],c=(i[9]-1)/i[5],h=(i[8]-1)/i[0],u=(s[8]+1)/s[0],d=o*h,p=o*u,f=r/(-h+u),m=f*-h;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(m),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert();const g=o+f,v=a+f,y=d-m,x=p+(r-m),w=l*a/v*g,b=c*a/v*g;e.projectionMatrix.makePerspective(y,x,w,b,g,v)}(w,v,y):w.projectionMatrix.copy(v.projectionMatrix)},this.getCamera=function(){return w},this.getFoveation=function(){return null!==c?c.fixedFoveation:null!==h?h.fixedFoveation:void 0},this.setFoveation=function(e){null!==c&&(c.fixedFoveation=e),null!==h&&void 0!==h.fixedFoveation&&(h.fixedFoveation=e)};let P=null;const R=new un;R.setAnimationLoop((function(t,n){if(a=n.getViewerPose(s),u=n,null!==a){const t=a.views;null!==h&&(e.setRenderTargetFramebuffer(f,h.framebuffer),e.setRenderTarget(f));let n=!1;t.length!==w.cameras.length&&(w.cameras.length=0,n=!0);for(let r=0;r<t.length;r++){const i=t[r];let s=null;if(null!==h)s=h.getViewport(i);else{const t=l.getViewSubImage(c,i);s=t.viewport,0===r&&(e.setRenderTargetTextures(f,t.colorTexture,c.ignoreDepthValues?void 0:t.depthStencilTexture),e.setRenderTarget(f))}const o=x[r];o.matrix.fromArray(i.transform.matrix),o.projectionMatrix.fromArray(i.projectionMatrix),o.viewport.set(s.x,s.y,s.width,s.height),0===r&&w.matrix.copy(o.matrix),!0===n&&w.cameras.push(o)}}const i=r.inputSources;for(let e=0;e<m.length;e++){const t=m[e],r=i[e];t.update(r,n,s)}P&&P(t,n),u=null})),this.setAnimationLoop=function(e){P=e},this.dispose=function(){}}}function Hi(e,t){function n(n,r){n.opacity.value=r.opacity,r.color&&n.diffuse.value.copy(r.color),r.emissive&&n.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(n.map.value=r.map),r.alphaMap&&(n.alphaMap.value=r.alphaMap),r.bumpMap&&(n.bumpMap.value=r.bumpMap,n.bumpScale.value=r.bumpScale,1===r.side&&(n.bumpScale.value*=-1)),r.displacementMap&&(n.displacementMap.value=r.displacementMap,n.displacementScale.value=r.displacementScale,n.displacementBias.value=r.displacementBias),r.emissiveMap&&(n.emissiveMap.value=r.emissiveMap),r.normalMap&&(n.normalMap.value=r.normalMap,n.normalScale.value.copy(r.normalScale),1===r.side&&n.normalScale.value.negate()),r.specularMap&&(n.specularMap.value=r.specularMap),r.alphaTest>0&&(n.alphaTest.value=r.alphaTest);const i=t.get(r).envMap;if(i&&(n.envMap.value=i,n.flipEnvMap.value=i.isCubeTexture&&!1===i.isRenderTargetTexture?-1:1,n.reflectivity.value=r.reflectivity,n.ior.value=r.ior,n.refractionRatio.value=r.refractionRatio),r.lightMap){n.lightMap.value=r.lightMap;const t=!0!==e.physicallyCorrectLights?Math.PI:1;n.lightMapIntensity.value=r.lightMapIntensity*t}let s,o;r.aoMap&&(n.aoMap.value=r.aoMap,n.aoMapIntensity.value=r.aoMapIntensity),r.map?s=r.map:r.specularMap?s=r.specularMap:r.displacementMap?s=r.displacementMap:r.normalMap?s=r.normalMap:r.bumpMap?s=r.bumpMap:r.roughnessMap?s=r.roughnessMap:r.metalnessMap?s=r.metalnessMap:r.alphaMap?s=r.alphaMap:r.emissiveMap?s=r.emissiveMap:r.clearcoatMap?s=r.clearcoatMap:r.clearcoatNormalMap?s=r.clearcoatNormalMap:r.clearcoatRoughnessMap?s=r.clearcoatRoughnessMap:r.specularIntensityMap?s=r.specularIntensityMap:r.specularColorMap?s=r.specularColorMap:r.transmissionMap?s=r.transmissionMap:r.thicknessMap?s=r.thicknessMap:r.sheenColorMap?s=r.sheenColorMap:r.sheenRoughnessMap&&(s=r.sheenRoughnessMap),void 0!==s&&(s.isWebGLRenderTarget&&(s=s.texture),!0===s.matrixAutoUpdate&&s.updateMatrix(),n.uvTransform.value.copy(s.matrix)),r.aoMap?o=r.aoMap:r.lightMap&&(o=r.lightMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),n.uv2Transform.value.copy(o.matrix))}return{refreshFogUniforms:function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)},refreshMaterialUniforms:function(e,r,i,s,o){r.isMeshBasicMaterial||r.isMeshLambertMaterial?n(e,r):r.isMeshToonMaterial?(n(e,r),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,r)):r.isMeshPhongMaterial?(n(e,r),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,r)):r.isMeshStandardMaterial?(n(e,r),function(e,n){e.roughness.value=n.roughness,e.metalness.value=n.metalness,n.roughnessMap&&(e.roughnessMap.value=n.roughnessMap),n.metalnessMap&&(e.metalnessMap.value=n.metalnessMap),t.get(n).envMap&&(e.envMapIntensity.value=n.envMapIntensity)}(e,r),r.isMeshPhysicalMaterial&&function(e,t,n){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap)),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap),t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,1===t.side&&e.clearcoatNormalScale.value.negate())),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=n.texture,e.transmissionSamplerSize.value.set(n.width,n.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap)}(e,r,o)):r.isMeshMatcapMaterial?(n(e,r),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,r)):r.isMeshDepthMaterial?n(e,r):r.isMeshDistanceMaterial?(n(e,r),function(e,t){e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(e,r)):r.isMeshNormalMaterial?n(e,r):r.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(e,r),r.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,r)):r.isPointsMaterial?function(e,t,n,r){let i;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*n,e.scale.value=.5*r,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest),t.map?i=t.map:t.alphaMap&&(i=t.alphaMap),void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),e.uvTransform.value.copy(i.matrix))}(e,r,i,s):r.isSpriteMaterial?function(e,t){let n;e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest),t.map?n=t.map:t.alphaMap&&(n=t.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(e,r):r.isShadowMaterial?(e.color.value.copy(r.color),e.opacity.value=r.opacity):r.isShaderMaterial&&(r.uniformsNeedUpdate=!1)}}}function Gi(e={}){const t=void 0!==e.canvas?e.canvas:function(){const e=y("canvas");return e.style.display="block",e}(),n=void 0!==e.context?e.context:null,r=void 0===e.depth||e.depth,i=void 0===e.stencil||e.stencil,s=void 0!==e.antialias&&e.antialias,o=void 0===e.premultipliedAlpha||e.premultipliedAlpha,a=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,l=void 0!==e.powerPreference?e.powerPreference:"default",c=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat;let h;h=void 0!==e.context?n.getContextAttributes().alpha:void 0!==e.alpha&&e.alpha;let d=null,f=null;const m=[],g=[];this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1;const v=this;let x=!1,w=0,b=0,_=null,M=-1,S=null;const T=new N,E=new N;let A=null,C=t.width,P=t.height,R=1,L=null,I=null;const D=new N(0,0,C,P),O=new N(0,0,C,P);let B=!1;const U=new hn;let k=!1,F=!1,H=null;const G=new be,j=new p,W=new V,X={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function q(){return null===_?R:1}let Y,Z,J,Q,K,$,ee,te,ne,re,ie,se,oe,ae,le,ce,he,ue,de,pe,fe,me,ge,ve=n;function ye(e,n){for(let r=0;r<e.length;r++){const i=e[r],s=t.getContext(i,n);if(null!==s)return s}return null}try{const e={alpha:!0,depth:r,stencil:i,antialias:s,premultipliedAlpha:o,preserveDrawingBuffer:a,powerPreference:l,failIfMajorPerformanceCaveat:c};if("setAttribute"in t&&t.setAttribute("data-engine","three.js r139"),t.addEventListener("webglcontextlost",_e,!1),t.addEventListener("webglcontextrestored",Me,!1),null===ve){const t=["webgl2","webgl","experimental-webgl"];if(!0===v.isWebGL1Renderer&&t.shift(),ve=ye(t,e),null===ve)throw ye(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===ve.getShaderPrecisionFormat&&(ve.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error("THREE.WebGLRenderer: "+e.message),e}function xe(){Y=new zn(ve),Z=new wn(ve,Y,e),Y.init(Z),me=new Oi(ve,Y,Z),J=new Ii(ve,Y,Z),Q=new Fn(ve),K=new yi,$=new Di(ve,Y,J,K,Z,me,Q),ee=new _n(v),te=new Nn(v),ne=new dn(ve,Z),ge=new yn(ve,Y,ne,Z),re=new Un(ve,ne,Q,ge),ie=new Wn(ve,re,ne,Q),de=new Vn(ve,Z,$),ce=new bn(K),se=new vi(v,ee,te,Y,Z,ge,ce),oe=new Hi(v,K),ae=new _i,le=new Ci(Y,Z),ue=new vn(v,ee,J,ie,h,o),he=new Li(v,ie,Z),pe=new xn(ve,Y,Q,Z),fe=new kn(ve,Y,Q,Z),Q.programs=se.programs,v.capabilities=Z,v.extensions=Y,v.properties=K,v.renderLists=ae,v.shadowMap=he,v.state=J,v.info=Q}xe();const we=new Fi(v,ve);function _e(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),x=!0}function Me(){console.log("THREE.WebGLRenderer: Context Restored."),x=!1;const e=Q.autoReset,t=he.enabled,n=he.autoUpdate,r=he.needsUpdate,i=he.type;xe(),Q.autoReset=e,he.enabled=t,he.autoUpdate=n,he.needsUpdate=r,he.type=i}function Se(e){const t=e.target;t.removeEventListener("dispose",Se),function(e){(function(e){const t=K.get(e).programs;void 0!==t&&(t.forEach((function(e){se.releaseProgram(e)})),e.isShaderMaterial&&se.releaseShaderCache(e))})(e),K.remove(e)}(t)}this.xr=we,this.getContext=function(){return ve},this.getContextAttributes=function(){return ve.getContextAttributes()},this.forceContextLoss=function(){const e=Y.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=Y.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return R},this.setPixelRatio=function(e){void 0!==e&&(R=e,this.setSize(C,P,!1))},this.getSize=function(e){return e.set(C,P)},this.setSize=function(e,n,r){we.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(C=e,P=n,t.width=Math.floor(e*R),t.height=Math.floor(n*R),!1!==r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return e.set(C*R,P*R).floor()},this.setDrawingBufferSize=function(e,n,r){C=e,P=n,R=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return e.copy(T)},this.getViewport=function(e){return e.copy(D)},this.setViewport=function(e,t,n,r){e.isVector4?D.set(e.x,e.y,e.z,e.w):D.set(e,t,n,r),J.viewport(T.copy(D).multiplyScalar(R).floor())},this.getScissor=function(e){return e.copy(O)},this.setScissor=function(e,t,n,r){e.isVector4?O.set(e.x,e.y,e.z,e.w):O.set(e,t,n,r),J.scissor(E.copy(O).multiplyScalar(R).floor())},this.getScissorTest=function(){return B},this.setScissorTest=function(e){J.setScissorTest(B=e)},this.setOpaqueSort=function(e){L=e},this.setTransparentSort=function(e){I=e},this.getClearColor=function(e){return e.copy(ue.getClearColor())},this.setClearColor=function(){ue.setClearColor.apply(ue,arguments)},this.getClearAlpha=function(){return ue.getClearAlpha()},this.setClearAlpha=function(){ue.setClearAlpha.apply(ue,arguments)},this.clear=function(e=!0,t=!0,n=!0){let r=0;e&&(r|=16384),t&&(r|=256),n&&(r|=1024),ve.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(){t.removeEventListener("webglcontextlost",_e,!1),t.removeEventListener("webglcontextrestored",Me,!1),ae.dispose(),le.dispose(),K.dispose(),ee.dispose(),te.dispose(),ie.dispose(),ge.dispose(),se.dispose(),we.dispose(),we.removeEventListener("sessionstart",Ee),we.removeEventListener("sessionend",Ae),H&&(H.dispose(),H=null),Ce.stop()},this.renderBufferDirect=function(e,t,n,r,i,s){null===t&&(t=X);const o=i.isMesh&&i.matrixWorld.determinant()<0,a=function(e,t,n,r,i){!0!==t.isScene&&(t=X),$.resetTextureUnits();const s=t.fog,o=r.isMeshStandardMaterial?t.environment:null,a=null===_?v.outputEncoding:!0===_.isXRRenderTarget?_.texture.encoding:3e3,l=(r.isMeshStandardMaterial?te:ee).get(r.envMap||o),c=!0===r.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,h=!!r.normalMap&&!!n.attributes.tangent,u=!!n.morphAttributes.position,d=!!n.morphAttributes.normal,p=!!n.morphAttributes.color,m=r.toneMapped?v.toneMapping:0,g=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,y=void 0!==g?g.length:0,x=K.get(r),w=f.state.lights;if(!0===k&&(!0===F||e!==S)){const t=e===S&&r.id===M;ce.setState(r,e,t)}let b=!1;r.version===x.__version?x.needsLights&&x.lightsStateVersion!==w.state.version||x.outputEncoding!==a||i.isInstancedMesh&&!1===x.instancing?b=!0:i.isInstancedMesh||!0!==x.instancing?i.isSkinnedMesh&&!1===x.skinning?b=!0:i.isSkinnedMesh||!0!==x.skinning?x.envMap!==l||r.fog&&x.fog!==s?b=!0:void 0===x.numClippingPlanes||x.numClippingPlanes===ce.numPlanes&&x.numIntersection===ce.numIntersection?(x.vertexAlphas!==c||x.vertexTangents!==h||x.morphTargets!==u||x.morphNormals!==d||x.morphColors!==p||x.toneMapping!==m||!0===Z.isWebGL2&&x.morphTargetsCount!==y)&&(b=!0):b=!0:b=!0:b=!0:(b=!0,x.__version=r.version);let T=x.currentProgram;!0===b&&(T=De(r,t,i));let E=!1,A=!1,C=!1;const L=T.getUniforms(),I=x.uniforms;if(J.useProgram(T.program)&&(E=!0,A=!0,C=!0),r.id!==M&&(M=r.id,A=!0),E||S!==e){if(L.setValue(ve,"projectionMatrix",e.projectionMatrix),Z.logarithmicDepthBuffer&&L.setValue(ve,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),S!==e&&(S=e,A=!0,C=!0),r.isShaderMaterial||r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshStandardMaterial||r.envMap){const t=L.map.cameraPosition;void 0!==t&&t.setValue(ve,W.setFromMatrixPosition(e.matrixWorld))}(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&L.setValue(ve,"isOrthographic",!0===e.isOrthographicCamera),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial||r.isShadowMaterial||i.isSkinnedMesh)&&L.setValue(ve,"viewMatrix",e.matrixWorldInverse)}if(i.isSkinnedMesh){L.setOptional(ve,i,"bindMatrix"),L.setOptional(ve,i,"bindMatrixInverse");const e=i.skeleton;e&&(Z.floatVertexTextures?(null===e.boneTexture&&e.computeBoneTexture(),L.setValue(ve,"boneTexture",e.boneTexture,$),L.setValue(ve,"boneTextureSize",e.boneTextureSize)):L.setOptional(ve,e,"boneMatrices"))}const D=n.morphAttributes;var O,B;return(void 0!==D.position||void 0!==D.normal||void 0!==D.color&&!0===Z.isWebGL2)&&de.update(i,n,r,T),(A||x.receiveShadow!==i.receiveShadow)&&(x.receiveShadow=i.receiveShadow,L.setValue(ve,"receiveShadow",i.receiveShadow)),A&&(L.setValue(ve,"toneMappingExposure",v.toneMappingExposure),x.needsLights&&(B=C,(O=I).ambientLightColor.needsUpdate=B,O.lightProbe.needsUpdate=B,O.directionalLights.needsUpdate=B,O.directionalLightShadows.needsUpdate=B,O.pointLights.needsUpdate=B,O.pointLightShadows.needsUpdate=B,O.spotLights.needsUpdate=B,O.spotLightShadows.needsUpdate=B,O.rectAreaLights.needsUpdate=B,O.hemisphereLights.needsUpdate=B),s&&r.fog&&oe.refreshFogUniforms(I,s),oe.refreshMaterialUniforms(I,r,R,P,H),Zr.upload(ve,x.uniformsList,I,$)),r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(Zr.upload(ve,x.uniformsList,I,$),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&L.setValue(ve,"center",i.center),L.setValue(ve,"modelViewMatrix",i.modelViewMatrix),L.setValue(ve,"normalMatrix",i.normalMatrix),L.setValue(ve,"modelMatrix",i.matrixWorld),T}(e,t,n,r,i);J.setMaterial(r,o);let l=n.index;const c=n.attributes.position;if(null===l){if(void 0===c||0===c.count)return}else if(0===l.count)return;let h,u=1;!0===r.wireframe&&(l=re.getWireframeAttribute(n),u=2),ge.setup(i,r,a,n,l);let d=pe;null!==l&&(h=ne.get(l),d=fe,d.setIndex(h));const p=null!==l?l.count:c.count,m=n.drawRange.start*u,g=n.drawRange.count*u,y=null!==s?s.start*u:0,x=null!==s?s.count*u:1/0,w=Math.max(m,y),b=Math.min(p,m+g,y+x)-1,T=Math.max(0,b-w+1);if(0!==T){if(i.isMesh)!0===r.wireframe?(J.setLineWidth(r.wireframeLinewidth*q()),d.setMode(1)):d.setMode(4);else if(i.isLine){let e=r.linewidth;void 0===e&&(e=1),J.setLineWidth(e*q()),i.isLineSegments?d.setMode(1):i.isLineLoop?d.setMode(2):d.setMode(3)}else i.isPoints?d.setMode(0):i.isSprite&&d.setMode(4);if(i.isInstancedMesh)d.renderInstances(w,T,i.count);else if(n.isInstancedBufferGeometry){const e=Math.min(n.instanceCount,n._maxInstanceCount);d.renderInstances(w,T,e)}else d.render(w,T)}},this.compile=function(e,t){f=le.get(e),f.init(),g.push(f),e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(f.pushLight(e),e.castShadow&&f.pushShadow(e))})),f.setupLights(v.physicallyCorrectLights),e.traverse((function(t){const n=t.material;if(n)if(Array.isArray(n))for(let r=0;r<n.length;r++)De(n[r],e,t);else De(n,e,t)})),g.pop(),f=null};let Te=null;function Ee(){Ce.stop()}function Ae(){Ce.start()}const Ce=new un;function Pe(e,t,n,r){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)f.pushLight(e),e.castShadow&&f.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||U.intersectsSprite(e)){r&&W.setFromMatrixPosition(e.matrixWorld).applyMatrix4(G);const t=ie.update(e),i=e.material;i.visible&&d.push(e,t,i,n,W.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==Q.render.frame&&(e.skeleton.update(),e.skeleton.frame=Q.render.frame),!e.frustumCulled||U.intersectsObject(e))){r&&W.setFromMatrixPosition(e.matrixWorld).applyMatrix4(G);const t=ie.update(e),i=e.material;if(Array.isArray(i)){const r=t.groups;for(let s=0,o=r.length;s<o;s++){const o=r[s],a=i[o.materialIndex];a&&a.visible&&d.push(e,t,a,n,W.z,o)}}else i.visible&&d.push(e,t,i,n,W.z,null)}const i=e.children;for(let e=0,s=i.length;e<s;e++)Pe(i[e],t,n,r)}function Re(e,t,n,r){const i=e.opaque,o=e.transmissive,a=e.transparent;f.setupLightsView(n),o.length>0&&function(e,t,n){const r=Z.isWebGL2;null===H&&(H=new z(1,1,{generateMipmaps:!0,type:null!==me.convert(1016)?1016:1009,minFilter:1008,samples:r&&!0===s?4:0})),v.getDrawingBufferSize(j),r?H.setSize(j.x,j.y):H.setSize(u(j.x),u(j.y));const i=v.getRenderTarget();v.setRenderTarget(H),v.clear();const o=v.toneMapping;v.toneMapping=0,Le(e,t,n),v.toneMapping=o,$.updateMultisampleRenderTarget(H),$.updateRenderTargetMipmap(H),v.setRenderTarget(i)}(i,t,n),r&&J.viewport(T.copy(r)),i.length>0&&Le(i,t,n),o.length>0&&Le(o,t,n),a.length>0&&Le(a,t,n),J.buffers.depth.setTest(!0),J.buffers.depth.setMask(!0),J.buffers.color.setMask(!0),J.setPolygonOffset(!1)}function Le(e,t,n){const r=!0===t.isScene?t.overrideMaterial:null;for(let i=0,s=e.length;i<s;i++){const s=e[i],o=s.object,a=s.geometry,l=null===r?s.material:r,c=s.group;o.layers.test(n.layers)&&Ie(o,t,n,a,l,c)}}function Ie(e,t,n,r,i,s){e.onBeforeRender(v,t,n,r,i,s),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(v,t,n,r,e,s),!0===i.transparent&&2===i.side?(i.side=1,i.needsUpdate=!0,v.renderBufferDirect(n,t,r,i,e,s),i.side=0,i.needsUpdate=!0,v.renderBufferDirect(n,t,r,i,e,s),i.side=2):v.renderBufferDirect(n,t,r,i,e,s),e.onAfterRender(v,t,n,r,i,s)}function De(e,t,n){!0!==t.isScene&&(t=X);const r=K.get(e),i=f.state.lights,s=f.state.shadowsArray,o=i.state.version,a=se.getParameters(e,i.state,s,t,n),l=se.getProgramCacheKey(a);let c=r.programs;r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=(e.isMeshStandardMaterial?te:ee).get(e.envMap||r.environment),void 0===c&&(e.addEventListener("dispose",Se),c=new Map,r.programs=c);let h=c.get(l);if(void 0!==h){if(r.currentProgram===h&&r.lightsStateVersion===o)return Oe(e,a),h}else a.uniforms=se.getUniforms(e),e.onBuild(n,a,v),e.onBeforeCompile(a,v),h=se.acquireProgram(a,l),c.set(l,h),r.uniforms=a.uniforms;const u=r.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(u.clippingPlanes=ce.uniform),Oe(e,a),r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),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.spotShadowMatrix.value=i.state.spotShadowMatrix,u.pointShadowMap.value=i.state.pointShadowMap,u.pointShadowMatrix.value=i.state.pointShadowMatrix);const d=h.getUniforms(),p=Zr.seqWithValue(d.seq,u);return r.currentProgram=h,r.uniformsList=p,h}function Oe(e,t){const n=K.get(e);n.outputEncoding=t.outputEncoding,n.instancing=t.instancing,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}Ce.setAnimationLoop((function(e){Te&&Te(e)})),"undefined"!=typeof self&&Ce.setContext(self),this.setAnimationLoop=function(e){Te=e,we.setAnimationLoop(e),null===e?Ce.stop():Ce.start()},we.addEventListener("sessionstart",Ee),we.addEventListener("sessionend",Ae),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===x)return;!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),!0===we.enabled&&!0===we.isPresenting&&(!0===we.cameraAutoUpdate&&we.updateCamera(t),t=we.getCamera()),!0===e.isScene&&e.onBeforeRender(v,e,t,_),f=le.get(e,g.length),f.init(),g.push(f),G.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),U.setFromProjectionMatrix(G),F=this.localClippingEnabled,k=ce.init(this.clippingPlanes,F,t),d=ae.get(e,m.length),d.init(),m.push(d),Pe(e,t,0,v.sortObjects),d.finish(),!0===v.sortObjects&&d.sort(L,I),!0===k&&ce.beginShadows();const n=f.state.shadowsArray;if(he.render(n,e,t),!0===k&&ce.endShadows(),!0===this.info.autoReset&&this.info.reset(),ue.render(d,e),f.setupLights(v.physicallyCorrectLights),t.isArrayCamera){const n=t.cameras;for(let t=0,r=n.length;t<r;t++){const r=n[t];Re(d,e,r,r.viewport)}}else Re(d,e,t);null!==_&&($.updateMultisampleRenderTarget(_),$.updateRenderTargetMipmap(_)),!0===e.isScene&&e.onAfterRender(v,e,t),ge.resetDefaultState(),M=-1,S=null,g.pop(),f=g.length>0?g[g.length-1]:null,m.pop(),d=m.length>0?m[m.length-1]:null},this.getActiveCubeFace=function(){return w},this.getActiveMipmapLevel=function(){return b},this.getRenderTarget=function(){return _},this.setRenderTargetTextures=function(e,t,n){K.get(e.texture).__webglTexture=t,K.get(e.depthTexture).__webglTexture=n;const r=K.get(e);r.__hasExternalTextures=!0,r.__hasExternalTextures&&(r.__autoAllocateDepthBuffer=void 0===n,r.__autoAllocateDepthBuffer||!0===Y.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(e,t){const n=K.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t},this.setRenderTarget=function(e,t=0,n=0){_=e,w=t,b=n;let r=!0;if(e){const t=K.get(e);void 0!==t.__useDefaultFramebuffer?(J.bindFramebuffer(36160,null),r=!1):void 0===t.__webglFramebuffer?$.setupRenderTarget(e):t.__hasExternalTextures&&$.rebindTextures(e,K.get(e.texture).__webglTexture,K.get(e.depthTexture).__webglTexture)}let i=null,s=!1,o=!1;if(e){const n=e.texture;(n.isData3DTexture||n.isDataArrayTexture)&&(o=!0);const r=K.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=r[t],s=!0):i=Z.isWebGL2&&e.samples>0&&!1===$.useMultisampledRTT(e)?K.get(e).__webglMultisampledFramebuffer:r,T.copy(e.viewport),E.copy(e.scissor),A=e.scissorTest}else T.copy(D).multiplyScalar(R).floor(),E.copy(O).multiplyScalar(R).floor(),A=B;if(J.bindFramebuffer(36160,i)&&Z.drawBuffers&&r&&J.drawBuffers(e,i),J.viewport(T),J.scissor(E),J.setScissorTest(A),s){const r=K.get(e.texture);ve.framebufferTexture2D(36160,36064,34069+t,r.__webglTexture,n)}else if(o){const r=K.get(e.texture),i=t||0;ve.framebufferTextureLayer(36160,36064,r.__webglTexture,n||0,i)}M=-1},this.readRenderTargetPixels=function(e,t,n,r,i,s,o){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=K.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){J.bindFramebuffer(36160,a);try{const o=e.texture,a=o.format,l=o.type;if(1023!==a&&me.convert(a)!==ve.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=1016===l&&(Y.has("EXT_color_buffer_half_float")||Z.isWebGL2&&Y.has("EXT_color_buffer_float"));if(!(1009===l||me.convert(l)===ve.getParameter(35738)||1015===l&&(Z.isWebGL2||Y.has("OES_texture_float")||Y.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&ve.readPixels(t,n,r,i,me.convert(a),me.convert(l),s)}finally{const e=null!==_?K.get(_).__webglFramebuffer:null;J.bindFramebuffer(36160,e)}}},this.copyFramebufferToTexture=function(e,t,n=0){if(!0!==t.isFramebufferTexture)return void console.error("THREE.WebGLRenderer: copyFramebufferToTexture() can only be used with FramebufferTexture.");const r=Math.pow(2,-n),i=Math.floor(t.image.width*r),s=Math.floor(t.image.height*r);$.setTexture2D(t,0),ve.copyTexSubImage2D(3553,n,0,0,e.x,e.y,i,s),J.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r=0){const i=t.image.width,s=t.image.height,o=me.convert(n.format),a=me.convert(n.type);$.setTexture2D(n,0),ve.pixelStorei(37440,n.flipY),ve.pixelStorei(37441,n.premultiplyAlpha),ve.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?ve.texSubImage2D(3553,r,e.x,e.y,i,s,o,a,t.image.data):t.isCompressedTexture?ve.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):ve.texSubImage2D(3553,r,e.x,e.y,o,a,t.image),0===r&&n.generateMipmaps&&ve.generateMipmap(3553),J.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n,r,i=0){if(v.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const s=e.max.x-e.min.x+1,o=e.max.y-e.min.y+1,a=e.max.z-e.min.z+1,l=me.convert(r.format),c=me.convert(r.type);let h;if(r.isData3DTexture)$.setTexture3D(r,0),h=32879;else{if(!r.isDataArrayTexture)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");$.setTexture2DArray(r,0),h=35866}ve.pixelStorei(37440,r.flipY),ve.pixelStorei(37441,r.premultiplyAlpha),ve.pixelStorei(3317,r.unpackAlignment);const u=ve.getParameter(3314),d=ve.getParameter(32878),p=ve.getParameter(3316),f=ve.getParameter(3315),m=ve.getParameter(32877),g=n.isCompressedTexture?n.mipmaps[0]:n.image;ve.pixelStorei(3314,g.width),ve.pixelStorei(32878,g.height),ve.pixelStorei(3316,e.min.x),ve.pixelStorei(3315,e.min.y),ve.pixelStorei(32877,e.min.z),n.isDataTexture||n.isData3DTexture?ve.texSubImage3D(h,i,t.x,t.y,t.z,s,o,a,l,c,g.data):n.isCompressedTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),ve.compressedTexSubImage3D(h,i,t.x,t.y,t.z,s,o,a,l,g.data)):ve.texSubImage3D(h,i,t.x,t.y,t.z,s,o,a,l,c,g),ve.pixelStorei(3314,u),ve.pixelStorei(32878,d),ve.pixelStorei(3316,p),ve.pixelStorei(3315,f),ve.pixelStorei(32877,m),0===i&&r.generateMipmaps&&ve.generateMipmap(h),J.unbindTexture()},this.initTexture=function(e){$.setTexture2D(e,0),J.unbindTexture()},this.resetState=function(){w=0,b=0,_=null,J.reset(),ge.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Gi.prototype.isWebGLRenderer=!0;class ji extends Gi{}ji.prototype.isWebGL1Renderer=!0;class Vi{constructor(e,t=25e-5){this.name="",this.color=new P(e),this.density=t}clone(){return new Vi(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}Vi.prototype.isFogExp2=!0;class Wi{constructor(e,t=1,n=1e3){this.name="",this.color=new P(e),this.near=t,this.far=n}clone(){return new Wi(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}Wi.prototype.isFog=!0;class Xi extends Xe{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}Xi.prototype.isScene=!0;class qi{constructor(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=s()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=s()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=s()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}qi.prototype.isInterleavedBuffer=!0;const Yi=new V;class Zi{constructor(e,t,n,r=!1){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)Yi.fromBufferAttribute(this,t),Yi.applyMatrix4(e),this.setXYZ(t,Yi.x,Yi.y,Yi.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Yi.fromBufferAttribute(this,t),Yi.applyNormalMatrix(e),this.setXYZ(t,Yi.x,Yi.y,Yi.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Yi.fromBufferAttribute(this,t),Yi.transformDirection(e),this.setXYZ(t,Yi.x,Yi.y,Yi.z);return this}setX(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){return this.data.array[e*this.data.stride+this.offset]}getY(e){return this.data.array[e*this.data.stride+this.offset+1]}getZ(e){return this.data.array[e*this.data.stride+this.offset+2]}getW(e){return this.data.array[e*this.data.stride+this.offset+3]}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new ct(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Zi(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}Zi.prototype.isInterleavedBufferAttribute=!0;class Ji extends st{constructor(e){super(),this.type="SpriteMaterial",this.color=new P(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this}}let Qi;Ji.prototype.isSpriteMaterial=!0;const Ki=new V,$i=new V,es=new V,ts=new p,ns=new p,rs=new be,is=new V,ss=new V,os=new V,as=new p,ls=new p,cs=new p;class hs extends Xe{constructor(e){if(super(),this.type="Sprite",void 0===Qi){Qi=new At;const e=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),t=new qi(e,5);Qi.setIndex([0,1,2,0,2,3]),Qi.setAttribute("position",new Zi(t,3,0,!1)),Qi.setAttribute("uv",new Zi(t,2,3,!1))}this.geometry=Qi,this.material=void 0!==e?e:new Ji,this.center=new p(.5,.5)}raycast(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),$i.setFromMatrixScale(this.matrixWorld),rs.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),es.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&$i.multiplyScalar(-es.z);const n=this.material.rotation;let r,i;0!==n&&(i=Math.cos(n),r=Math.sin(n));const s=this.center;us(is.set(-.5,-.5,0),es,s,$i,r,i),us(ss.set(.5,-.5,0),es,s,$i,r,i),us(os.set(.5,.5,0),es,s,$i,r,i),as.set(0,0),ls.set(1,0),cs.set(1,1);let o=e.ray.intersectTriangle(is,ss,os,!1,Ki);if(null===o&&(us(ss.set(-.5,.5,0),es,s,$i,r,i),ls.set(0,1),o=e.ray.intersectTriangle(is,os,ss,!1,Ki),null===o))return;const a=e.ray.origin.distanceTo(Ki);a<e.near||a>e.far||t.push({distance:a,point:Ki.clone(),uv:rt.getUV(Ki,is,ss,os,as,ls,cs,new p),face:null,object:this})}copy(e){return super.copy(e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}}function us(e,t,n,r,i,s){ts.subVectors(e,n).addScalar(.5).multiply(r),void 0!==i?(ns.x=s*ts.x-i*ts.y,ns.y=i*ts.x+s*ts.y):ns.copy(ts),e.copy(t),e.x+=ns.x,e.y+=ns.y,e.applyMatrix4(rs)}hs.prototype.isSprite=!0;const ds=new V,ps=new V;class fs extends Xe{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let e=0,n=t.length;e<n;e++){const n=t[e];this.addLevel(n.object.clone(),n.distance)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0){t=Math.abs(t);const n=this.levels;let r;for(r=0;r<n.length&&!(t<n[r].distance);r++);return n.splice(r,0,{distance:t,object:e}),this.add(e),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,r;for(n=1,r=t.length;n<r&&!(e<t[n].distance);n++);return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){ds.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(ds);this.getObjectForDistance(n).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){ds.setFromMatrixPosition(e.matrixWorld),ps.setFromMatrixPosition(this.matrixWorld);const n=ds.distanceTo(ps)/e.zoom;let r,i;for(t[0].object.visible=!0,r=1,i=t.length;r<i&&n>=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;r<i;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let e=0,r=n.length;e<r;e++){const r=n[e];t.object.levels.push({object:r.object.uuid,distance:r.distance})}return t}}const ms=new V,gs=new N,vs=new N,ys=new V,xs=new be;class ws extends Wt{constructor(e,t){super(e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new be,this.bindMatrixInverse=new be}copy(e){return super.copy(e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this}bind(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new N,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);const r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}boneTransform(e,t){const n=this.skeleton,r=this.geometry;gs.fromBufferAttribute(r.attributes.skinIndex,e),vs.fromBufferAttribute(r.attributes.skinWeight,e),ms.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let e=0;e<4;e++){const r=vs.getComponent(e);if(0!==r){const i=gs.getComponent(e);xs.multiplyMatrices(n.bones[i].matrixWorld,n.boneInverses[i]),t.addScaledVector(ys.copy(ms).applyMatrix4(xs),r)}}return t.applyMatrix4(this.bindMatrixInverse)}}ws.prototype.isSkinnedMesh=!0;class bs extends Xe{constructor(){super(),this.type="Bone"}}bs.prototype.isBone=!0;class _s extends B{constructor(e=null,t=1,n=1,r,i,s,o,a,l=1003,c=1003,h,u){super(null,s,o,a,l,c,r,i,h,u),this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}_s.prototype.isDataTexture=!0;const Ms=new be,Ss=new be;class Ts{constructor(e=[],t=[]){this.uuid=s(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(16*e.length),0===t.length)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new be)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const t=new be;this.bones[e]&&t.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(t)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&t.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const t=this.bones[e];t&&(t.parent&&t.parent.isBone?(t.matrix.copy(t.parent.matrixWorld).invert(),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture;for(let r=0,i=e.length;r<i;r++){const i=e[r]?e[r].matrixWorld:Ss;Ms.multiplyMatrices(i,t[r]),Ms.toArray(n,16*r)}null!==r&&(r.needsUpdate=!0)}clone(){return new Ts(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(4*this.bones.length);e=h(e),e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new _s(t,e,e,1023,1015);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this.boneTextureSize=e,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const n=this.bones[t];if(n.name===e)return n}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;n++){const r=e.bones[n];let i=t[r];void 0===i&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),i=new bs),this.bones.push(i),this.boneInverses.push((new be).fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let r=0,i=t.length;r<i;r++){const i=t[r];e.bones.push(i.uuid);const s=n[r];e.boneInverses.push(s.toArray())}return e}}class Es extends ct{constructor(e,t,n,r=1){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),super(e,t,n),this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}Es.prototype.isInstancedBufferAttribute=!0;const As=new be,Cs=new be,Ps=[],Rs=new Wt;class Ls extends Wt{constructor(e,t,n){super(e,t),this.instanceMatrix=new Es(new Float32Array(16*n),16),this.instanceColor=null,this.count=n,this.frustumCulled=!1}copy(e){return super.copy(e),this.instanceMatrix.copy(e.instanceMatrix),null!==e.instanceColor&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,this}getColorAt(e,t){t.fromArray(this.instanceColor.array,3*e)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,16*e)}raycast(e,t){const n=this.matrixWorld,r=this.count;if(Rs.geometry=this.geometry,Rs.material=this.material,void 0!==Rs.material)for(let i=0;i<r;i++){this.getMatrixAt(i,As),Cs.multiplyMatrices(n,As),Rs.matrixWorld=Cs,Rs.raycast(e,Ps);for(let e=0,n=Ps.length;e<n;e++){const n=Ps[e];n.instanceId=i,n.object=this,t.push(n)}Ps.length=0}}setColorAt(e,t){null===this.instanceColor&&(this.instanceColor=new Es(new Float32Array(3*this.instanceMatrix.count),3)),t.toArray(this.instanceColor.array,3*e)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,16*e)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}Ls.prototype.isInstancedMesh=!0;class Is extends st{constructor(e){super(),this.type="LineBasicMaterial",this.color=new P(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this}}Is.prototype.isLineBasicMaterial=!0;const Ds=new V,Os=new V,Bs=new be,Ns=new we,zs=new de;class Us extends Xe{constructor(e=new At,t=new Is){super(),this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)Ds.fromBufferAttribute(t,e-1),Os.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=Ds.distanceTo(Os);e.setAttribute("lineDistance",new yt(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,s=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),zs.copy(n.boundingSphere),zs.applyMatrix4(r),zs.radius+=i,!1===e.ray.intersectsSphere(zs))return;Bs.copy(r).invert(),Ns.copy(e.ray).applyMatrix4(Bs);const o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,l=new V,c=new V,h=new V,u=new V,d=this.isLineSegments?2:1;if(n.isBufferGeometry){const r=n.index,i=n.attributes.position;if(null!==r)for(let n=Math.max(0,s.start),o=Math.min(r.count,s.start+s.count)-1;n<o;n+=d){const s=r.getX(n),o=r.getX(n+1);if(l.fromBufferAttribute(i,s),c.fromBufferAttribute(i,o),Ns.distanceSqToSegment(l,c,u,h)>a)continue;u.applyMatrix4(this.matrixWorld);const d=e.ray.origin.distanceTo(u);d<e.near||d>e.far||t.push({distance:d,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}else for(let n=Math.max(0,s.start),r=Math.min(i.count,s.start+s.count)-1;n<r;n+=d){if(l.fromBufferAttribute(i,n),c.fromBufferAttribute(i,n+1),Ns.distanceSqToSegment(l,c,u,h)>a)continue;u.applyMatrix4(this.matrixWorld);const r=e.ray.origin.distanceTo(u);r<e.near||r>e.far||t.push({distance:r,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t<n;t++){const n=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}Us.prototype.isLine=!0;const ks=new V,Fs=new V;class Hs extends Us{constructor(e,t){super(e,t),this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,r=t.count;e<r;e+=2)ks.fromBufferAttribute(t,e),Fs.fromBufferAttribute(t,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+ks.distanceTo(Fs);e.setAttribute("lineDistance",new yt(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else e.isGeometry&&console.error("THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");return this}}Hs.prototype.isLineSegments=!0;class Gs extends Us{constructor(e,t){super(e,t),this.type="LineLoop"}}Gs.prototype.isLineLoop=!0;class js extends st{constructor(e){super(),this.type="PointsMaterial",this.color=new P(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this}}js.prototype.isPointsMaterial=!0;const Vs=new be,Ws=new we,Xs=new de,qs=new V;class Ys extends Xe{constructor(e=new At,t=new js){super(),this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e){return super.copy(e),this.material=e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,s=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),Xs.copy(n.boundingSphere),Xs.applyMatrix4(r),Xs.radius+=i,!1===e.ray.intersectsSphere(Xs))return;Vs.copy(r).invert(),Ws.copy(e.ray).applyMatrix4(Vs);const o=i/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o;if(n.isBufferGeometry){const i=n.index,o=n.attributes.position;if(null!==i)for(let n=Math.max(0,s.start),l=Math.min(i.count,s.start+s.count);n<l;n++){const s=i.getX(n);qs.fromBufferAttribute(o,s),Zs(qs,s,a,r,e,t,this)}else for(let n=Math.max(0,s.start),i=Math.min(o.count,s.start+s.count);n<i;n++)qs.fromBufferAttribute(o,n),Zs(qs,n,a,r,e,t,this)}else console.error("THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}updateMorphTargets(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t<n;t++){const n=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}}}else{const t=e.morphTargets;void 0!==t&&t.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}function Zs(e,t,n,r,i,s,o){const a=Ws.distanceSqToPoint(e);if(a<n){const n=new V;Ws.closestPointToPoint(e,n),n.applyMatrix4(r);const l=i.ray.origin.distanceTo(n);if(l<i.near||l>i.far)return;s.push({distance:l,distanceToRay:Math.sqrt(a),point:n,index:t,face:null,object:o})}}Ys.prototype.isPoints=!0;class Js extends B{constructor(e,t,n,r,i,s,o,a,l){super(e,t,n,r,i,s,o,a,l),this.minFilter=void 0!==s?s:1006,this.magFilter=void 0!==i?i:1006,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;!1=="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}Js.prototype.isVideoTexture=!0;class Qs extends B{constructor(e,t,n){super({width:e,height:t}),this.format=n,this.magFilter=1003,this.minFilter=1003,this.generateMipmaps=!1,this.needsUpdate=!0}}Qs.prototype.isFramebufferTexture=!0;class Ks extends B{constructor(e,t,n,r,i,s,o,a,l,c,h,u){super(null,s,o,a,l,c,r,i,h,u),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}Ks.prototype.isCompressedTexture=!0;class $s extends B{constructor(e,t,n,r,i,s,o,a,l){super(e,t,n,r,i,s,o,a,l),this.needsUpdate=!0}}$s.prototype.isCanvasTexture=!0;class eo{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),i=0;t.push(0);for(let s=1;s<=e;s++)n=this.getPoint(s/e),i+=n.distanceTo(r),t.push(i),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let r=0;const i=n.length;let s;s=t||e*n[i-1];let o,a=0,l=i-1;for(;a<=l;)if(r=Math.floor(a+(l-a)/2),o=n[r]-s,o<0)a=r+1;else{if(!(o>0)){l=r;break}l=r-1}if(r=l,n[r]===s)return r/(i-1);const c=n[r];return(r+(s-c)/(n[r+1]-c))/(i-1)}getTangent(e,t){const n=1e-4;let r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);const s=this.getPoint(r),o=this.getPoint(i),a=t||(s.isVector2?new p:new V);return a.copy(o).sub(s).normalize(),a}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new V,r=[],i=[],s=[],a=new V,l=new be;for(let t=0;t<=e;t++){const n=t/e;r[t]=this.getTangentAt(n,new V)}i[0]=new V,s[0]=new V;let c=Number.MAX_VALUE;const h=Math.abs(r[0].x),u=Math.abs(r[0].y),d=Math.abs(r[0].z);h<=c&&(c=h,n.set(1,0,0)),u<=c&&(c=u,n.set(0,1,0)),d<=c&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],a),s[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),s[t]=s[t-1].clone(),a.crossVectors(r[t-1],r[t]),a.length()>Number.EPSILON){a.normalize();const e=Math.acos(o(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(l.makeRotationAxis(a,e))}s[t].crossVectors(r[t],i[t])}if(!0===t){let t=Math.acos(o(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(a.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(l.makeRotationAxis(r[n],t*n)),s[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class to extends eo{constructor(e=0,t=0,n=1,r=1,i=0,s=2*Math.PI,o=!1,a=0){super(),this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=s,this.aClockwise=o,this.aRotation=a}getPoint(e,t){const n=t||new p,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const s=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=s?0:r),!0!==this.aClockwise||s||(i===r?i=-r:i-=r);const o=this.aStartAngle+e*i;let a=this.aX+this.xRadius*Math.cos(o),l=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=a-this.aX,r=l-this.aY;a=n*e-r*t+this.aX,l=n*t+r*e+this.aY}return n.set(a,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}to.prototype.isEllipseCurve=!0;class no extends to{constructor(e,t,n,r,i,s){super(e,t,n,n,r,i,s),this.type="ArcCurve"}}function ro(){let e=0,t=0,n=0,r=0;function i(i,s,o,a){e=i,t=o,n=-3*i+3*s-2*o-a,r=2*i-2*s+o+a}return{initCatmullRom:function(e,t,n,r,s){i(t,n,s*(n-e),s*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,s,o,a){let l=(t-e)/s-(n-e)/(s+o)+(n-t)/o,c=(n-t)/o-(r-t)/(o+a)+(r-n)/a;l*=o,c*=o,i(t,n,l,c)},calc:function(i){const s=i*i;return e+t*i+n*s+r*(s*i)}}}no.prototype.isArcCurve=!0;const io=new V,so=new ro,oo=new ro,ao=new ro;class lo extends eo{constructor(e=[],t=!1,n="centripetal",r=.5){super(),this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new V){const n=t,r=this.points,i=r.length,s=(i-(this.closed?0:1))*e;let o,a,l=Math.floor(s),c=s-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/i)+1)*i:0===c&&l===i-1&&(l=i-2,c=1),this.closed||l>0?o=r[(l-1)%i]:(io.subVectors(r[0],r[1]).add(r[0]),o=io);const h=r[l%i],u=r[(l+1)%i];if(this.closed||l+2<i?a=r[(l+2)%i]:(io.subVectors(r[i-1],r[i-2]).add(r[i-1]),a=io),"centripetal"===this.curveType||"chordal"===this.curveType){const e="chordal"===this.curveType?.5:.25;let t=Math.pow(o.distanceToSquared(h),e),n=Math.pow(h.distanceToSquared(u),e),r=Math.pow(u.distanceToSquared(a),e);n<1e-4&&(n=1),t<1e-4&&(t=n),r<1e-4&&(r=n),so.initNonuniformCatmullRom(o.x,h.x,u.x,a.x,t,n,r),oo.initNonuniformCatmullRom(o.y,h.y,u.y,a.y,t,n,r),ao.initNonuniformCatmullRom(o.z,h.z,u.z,a.z,t,n,r)}else"catmullrom"===this.curveType&&(so.initCatmullRom(o.x,h.x,u.x,a.x,this.tension),oo.initCatmullRom(o.y,h.y,u.y,a.y,this.tension),ao.initCatmullRom(o.z,h.z,u.z,a.z,this.tension));return n.set(so.calc(c),oo.calc(c),ao.calc(c)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new V).fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function co(e,t,n,r,i){const s=.5*(r-t),o=.5*(i-n),a=e*e;return(2*n-2*r+s+o)*(e*a)+(-3*n+3*r-2*s-o)*a+s*e+n}function ho(e,t,n,r){return function(e,t){const n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function uo(e,t,n,r,i){return function(e,t){const n=1-e;return n*n*n*t}(e,t)+function(e,t){const n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}lo.prototype.isCatmullRomCurve3=!0;class po extends eo{constructor(e=new p,t=new p,n=new p,r=new p){super(),this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new p){const n=t,r=this.v0,i=this.v1,s=this.v2,o=this.v3;return n.set(uo(e,r.x,i.x,s.x,o.x),uo(e,r.y,i.y,s.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}po.prototype.isCubicBezierCurve=!0;class fo extends eo{constructor(e=new V,t=new V,n=new V,r=new V){super(),this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new V){const n=t,r=this.v0,i=this.v1,s=this.v2,o=this.v3;return n.set(uo(e,r.x,i.x,s.x,o.x),uo(e,r.y,i.y,s.y,o.y),uo(e,r.z,i.z,s.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}fo.prototype.isCubicBezierCurve3=!0;class mo extends eo{constructor(e=new p,t=new p){super(),this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new p){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t){const n=t||new p;return n.copy(this.v2).sub(this.v1).normalize(),n}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}mo.prototype.isLineCurve=!0;class go extends eo{constructor(e=new V,t=new V){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=e,this.v2=t}getPoint(e,t=new V){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class vo extends eo{constructor(e=new p,t=new p,n=new p){super(),this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new p){const n=t,r=this.v0,i=this.v1,s=this.v2;return n.set(ho(e,r.x,i.x,s.x),ho(e,r.y,i.y,s.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}vo.prototype.isQuadraticBezierCurve=!0;class yo extends eo{constructor(e=new V,t=new V,n=new V){super(),this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new V){const n=t,r=this.v0,i=this.v1,s=this.v2;return n.set(ho(e,r.x,i.x,s.x),ho(e,r.y,i.y,s.y),ho(e,r.z,i.z,s.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}yo.prototype.isQuadraticBezierCurve3=!0;class xo extends eo{constructor(e=[]){super(),this.type="SplineCurve",this.points=e}getPoint(e,t=new p){const n=t,r=this.points,i=(r.length-1)*e,s=Math.floor(i),o=i-s,a=r[0===s?s:s-1],l=r[s],c=r[s>r.length-2?r.length-1:s+1],h=r[s>r.length-3?r.length-1:s+2];return n.set(co(o,a.x,l.x,c.x,h.x),co(o,a.y,l.y,c.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new p).fromArray(n))}return this}}xo.prototype.isSplineCurve=!0;var wo=Object.freeze({__proto__:null,ArcCurve:no,CatmullRomCurve3:lo,CubicBezierCurve:po,CubicBezierCurve3:fo,EllipseCurve:to,LineCurve:mo,LineCurve3:go,QuadraticBezierCurve:vo,QuadraticBezierCurve3:yo,SplineCurve:xo});class bo extends eo{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new mo(t,e))}getPoint(e,t){const n=e*this.getLength(),r=this.getCurveLengths();let i=0;for(;i<r.length;){if(r[i]>=n){const e=r[i]-n,s=this.curves[i],o=s.getLength(),a=0===o?0:1-e/o;return s.getPointAt(a,t)}i++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let r=0,i=this.curves;r<i.length;r++){const s=i[r],o=s.isEllipseCurve?2*e:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?e*s.points.length:e,a=s.getPoints(o);for(let e=0;e<a.length;e++){const r=a[e];n&&n.equals(r)||(t.push(r),n=r)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push((new wo[n.type]).fromJSON(n))}return this}}class _o extends bo{constructor(e){super(),this.type="Path",this.currentPoint=new p,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new mo(this.currentPoint.clone(),new p(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){const i=new vo(this.currentPoint.clone(),new p(e,t),new p(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,i,s){const o=new po(this.currentPoint.clone(),new p(e,t),new p(n,r),new p(i,s));return this.curves.push(o),this.currentPoint.set(i,s),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new xo(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,i,s){const o=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(e+o,t+a,n,r,i,s),this}absarc(e,t,n,r,i,s){return this.absellipse(e,t,n,n,r,i,s),this}ellipse(e,t,n,r,i,s,o,a){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,n,r,i,s,o,a),this}absellipse(e,t,n,r,i,s,o,a){const l=new to(e,t,n,r,i,s,o,a);if(this.curves.length>0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Mo extends At{constructor(e=[new p(0,.5),new p(.5,0),new p(0,-.5)],t=12,n=0,r=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t),r=o(r,0,2*Math.PI);const i=[],s=[],a=[],l=[],c=[],h=1/t,u=new V,d=new p,f=new V,m=new V,g=new V;let v=0,y=0;for(let t=0;t<=e.length-1;t++)switch(t){case 0:v=e[t+1].x-e[t].x,y=e[t+1].y-e[t].y,f.x=1*y,f.y=-v,f.z=0*y,g.copy(f),f.normalize(),l.push(f.x,f.y,f.z);break;case e.length-1:l.push(g.x,g.y,g.z);break;default:v=e[t+1].x-e[t].x,y=e[t+1].y-e[t].y,f.x=1*y,f.y=-v,f.z=0*y,m.copy(f),f.x+=g.x,f.y+=g.y,f.z+=g.z,f.normalize(),l.push(f.x,f.y,f.z),g.copy(m)}for(let i=0;i<=t;i++){const o=n+i*h*r,p=Math.sin(o),f=Math.cos(o);for(let n=0;n<=e.length-1;n++){u.x=e[n].x*p,u.y=e[n].y,u.z=e[n].x*f,s.push(u.x,u.y,u.z),d.x=i/t,d.y=n/(e.length-1),a.push(d.x,d.y);const r=l[3*n+0]*p,o=l[3*n+1],h=l[3*n+0]*f;c.push(r,o,h)}}for(let n=0;n<t;n++)for(let t=0;t<e.length-1;t++){const r=t+n*e.length,s=r,o=r+e.length,a=r+e.length+1,l=r+1;i.push(s,o,l),i.push(a,l,o)}this.setIndex(i),this.setAttribute("position",new yt(s,3)),this.setAttribute("uv",new yt(a,2)),this.setAttribute("normal",new yt(c,3))}static fromJSON(e){return new Mo(e.points,e.segments,e.phiStart,e.phiLength)}}class So extends Mo{constructor(e=1,t=1,n=4,r=8){const i=new _o;i.absarc(0,-t/2,e,1.5*Math.PI,0),i.absarc(0,t/2,e,0,.5*Math.PI),super(i.getPoints(n),r),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:n,radialSegments:r}}static fromJSON(e){return new So(e.radius,e.length,e.capSegments,e.radialSegments)}}class To extends At{constructor(e=1,t=8,n=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);const i=[],s=[],o=[],a=[],l=new V,c=new p;s.push(0,0,0),o.push(0,0,1),a.push(.5,.5);for(let i=0,h=3;i<=t;i++,h+=3){const u=n+i/t*r;l.x=e*Math.cos(u),l.y=e*Math.sin(u),s.push(l.x,l.y,l.z),o.push(0,0,1),c.x=(s[h]/e+1)/2,c.y=(s[h+1]/e+1)/2,a.push(c.x,c.y)}for(let e=1;e<=t;e++)i.push(e,e+1,0);this.setIndex(i),this.setAttribute("position",new yt(s,3)),this.setAttribute("normal",new yt(o,3)),this.setAttribute("uv",new yt(a,2))}static fromJSON(e){return new To(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Eo extends At{constructor(e=1,t=1,n=1,r=8,i=1,s=!1,o=0,a=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:s,thetaStart:o,thetaLength:a};const l=this;r=Math.floor(r),i=Math.floor(i);const c=[],h=[],u=[],d=[];let f=0;const m=[],g=n/2;let v=0;function y(n){const i=f,s=new p,m=new V;let y=0;const x=!0===n?e:t,w=!0===n?1:-1;for(let e=1;e<=r;e++)h.push(0,g*w,0),u.push(0,w,0),d.push(.5,.5),f++;const b=f;for(let e=0;e<=r;e++){const t=e/r*a+o,n=Math.cos(t),i=Math.sin(t);m.x=x*i,m.y=g*w,m.z=x*n,h.push(m.x,m.y,m.z),u.push(0,w,0),s.x=.5*n+.5,s.y=.5*i*w+.5,d.push(s.x,s.y),f++}for(let e=0;e<r;e++){const t=i+e,r=b+e;!0===n?c.push(r,r+1,t):c.push(r+1,r,t),y+=3}l.addGroup(v,y,!0===n?1:2),v+=y}!function(){const s=new V,p=new V;let y=0;const x=(t-e)/n;for(let l=0;l<=i;l++){const c=[],v=l/i,y=v*(t-e)+e;for(let e=0;e<=r;e++){const t=e/r,i=t*a+o,l=Math.sin(i),m=Math.cos(i);p.x=y*l,p.y=-v*n+g,p.z=y*m,h.push(p.x,p.y,p.z),s.set(l,x,m).normalize(),u.push(s.x,s.y,s.z),d.push(t,1-v),c.push(f++)}m.push(c)}for(let e=0;e<r;e++)for(let t=0;t<i;t++){const n=m[t][e],r=m[t+1][e],i=m[t+1][e+1],s=m[t][e+1];c.push(n,r,s),c.push(r,i,s),y+=6}l.addGroup(v,y,0),v+=y}(),!1===s&&(e>0&&y(!0),t>0&&y(!1)),this.setIndex(c),this.setAttribute("position",new yt(h,3)),this.setAttribute("normal",new yt(u,3)),this.setAttribute("uv",new yt(d,2))}static fromJSON(e){return new Eo(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Ao extends Eo{constructor(e=1,t=1,n=8,r=1,i=!1,s=0,o=2*Math.PI){super(0,e,t,n,r,i,s,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:i,thetaStart:s,thetaLength:o}}static fromJSON(e){return new Ao(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Co extends At{constructor(e=[],t=[],n=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r};const i=[],s=[];function o(e,t,n,r){const i=r+1,s=[];for(let r=0;r<=i;r++){s[r]=[];const o=e.clone().lerp(n,r/i),a=t.clone().lerp(n,r/i),l=i-r;for(let e=0;e<=l;e++)s[r][e]=0===e&&r===i?o:o.clone().lerp(a,e/l)}for(let e=0;e<i;e++)for(let t=0;t<2*(i-e)-1;t++){const n=Math.floor(t/2);t%2==0?(a(s[e][n+1]),a(s[e+1][n]),a(s[e][n])):(a(s[e][n+1]),a(s[e+1][n+1]),a(s[e+1][n]))}}function a(e){i.push(e.x,e.y,e.z)}function l(t,n){const r=3*t;n.x=e[r+0],n.y=e[r+1],n.z=e[r+2]}function c(e,t,n,r){r<0&&1===e.x&&(s[t]=e.x-1),0===n.x&&0===n.z&&(s[t]=r/2/Math.PI+.5)}function h(e){return Math.atan2(e.z,-e.x)}function u(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}!function(e){const n=new V,r=new V,i=new V;for(let s=0;s<t.length;s+=3)l(t[s+0],n),l(t[s+1],r),l(t[s+2],i),o(n,r,i,e)}(r),function(e){const t=new V;for(let n=0;n<i.length;n+=3)t.x=i[n+0],t.y=i[n+1],t.z=i[n+2],t.normalize().multiplyScalar(e),i[n+0]=t.x,i[n+1]=t.y,i[n+2]=t.z}(n),function(){const e=new V;for(let t=0;t<i.length;t+=3){e.x=i[t+0],e.y=i[t+1],e.z=i[t+2];const n=h(e)/2/Math.PI+.5,r=u(e)/Math.PI+.5;s.push(n,1-r)}(function(){const e=new V,t=new V,n=new V,r=new V,o=new p,a=new p,l=new p;for(let u=0,d=0;u<i.length;u+=9,d+=6){e.set(i[u+0],i[u+1],i[u+2]),t.set(i[u+3],i[u+4],i[u+5]),n.set(i[u+6],i[u+7],i[u+8]),o.set(s[d+0],s[d+1]),a.set(s[d+2],s[d+3]),l.set(s[d+4],s[d+5]),r.copy(e).add(t).add(n).divideScalar(3);const p=h(r);c(o,d+0,e,p),c(a,d+2,t,p),c(l,d+4,n,p)}})(),function(){for(let e=0;e<s.length;e+=6){const t=s[e+0],n=s[e+2],r=s[e+4],i=Math.max(t,n,r),o=Math.min(t,n,r);i>.9&&o<.1&&(t<.2&&(s[e+0]+=1),n<.2&&(s[e+2]+=1),r<.2&&(s[e+4]+=1))}}()}(),this.setAttribute("position",new yt(i,3)),this.setAttribute("normal",new yt(i.slice(),3)),this.setAttribute("uv",new yt(s,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(e){return new Co(e.vertices,e.indices,e.radius,e.details)}}class Po extends Co{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,r=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Po(e.radius,e.detail)}}const Ro=new V,Lo=new V,Io=new V,Do=new rt;class Oo extends At{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},null!==e){const n=4,i=Math.pow(10,n),s=Math.cos(r*t),o=e.getIndex(),a=e.getAttribute("position"),l=o?o.count:a.count,c=[0,0,0],h=["a","b","c"],u=new Array(3),d={},p=[];for(let e=0;e<l;e+=3){o?(c[0]=o.getX(e),c[1]=o.getX(e+1),c[2]=o.getX(e+2)):(c[0]=e,c[1]=e+1,c[2]=e+2);const{a:t,b:n,c:r}=Do;if(t.fromBufferAttribute(a,c[0]),n.fromBufferAttribute(a,c[1]),r.fromBufferAttribute(a,c[2]),Do.getNormal(Io),u[0]=`${Math.round(t.x*i)},${Math.round(t.y*i)},${Math.round(t.z*i)}`,u[1]=`${Math.round(n.x*i)},${Math.round(n.y*i)},${Math.round(n.z*i)}`,u[2]=`${Math.round(r.x*i)},${Math.round(r.y*i)},${Math.round(r.z*i)}`,u[0]!==u[1]&&u[1]!==u[2]&&u[2]!==u[0])for(let e=0;e<3;e++){const t=(e+1)%3,n=u[e],r=u[t],i=Do[h[e]],o=Do[h[t]],a=`${n}_${r}`,l=`${r}_${n}`;l in d&&d[l]?(Io.dot(d[l].normal)<=s&&(p.push(i.x,i.y,i.z),p.push(o.x,o.y,o.z)),d[l]=null):a in d||(d[a]={index0:c[e],index1:c[t],normal:Io.clone()})}}for(const e in d)if(d[e]){const{index0:t,index1:n}=d[e];Ro.fromBufferAttribute(a,t),Lo.fromBufferAttribute(a,n),p.push(Ro.x,Ro.y,Ro.z),p.push(Lo.x,Lo.y,Lo.z)}this.setAttribute("position",new yt(p,3))}}}class Bo extends _o{constructor(e){super(e),this.uuid=s(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push((new _o).fromJSON(n))}return this}}function No(e,t,n,r,i){let s,o;if(i===function(e,t,n,r){let i=0;for(let s=t,o=n-r;s<n;s+=r)i+=(e[o]-e[s])*(e[s+1]+e[o+1]),o=s;return i}(e,t,n,r)>0)for(s=t;s<n;s+=r)o=ra(s,e[s],e[s+1],o);else for(s=n-r;s>=t;s-=r)o=ra(s,e[s],e[s+1],o);return o&&Qo(o,o.next)&&(ia(o),o=o.next),o}function zo(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!Qo(r,r.next)&&0!==Jo(r.prev,r,r.next))r=r.next;else{if(ia(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function Uo(e,t,n,r,i,s,o){if(!e)return;!o&&s&&function(e,t,n,r){let i=e;do{null===i.z&&(i.z=Xo(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n,r,i,s,o,a,l,c=1;do{for(n=e,e=null,s=null,o=0;n;){for(o++,r=n,a=0,t=0;t<c&&(a++,r=r.nextZ,r);t++);for(l=c;a>0||l>0&&r;)0!==a&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,l--),s?s.nextZ=i:e=i,i.prevZ=s,s=i;n=r}s.nextZ=null,c*=2}while(o>1)}(i)}(e,r,i,s);let a,l,c=e;for(;e.prev!==e.next;)if(a=e.prev,l=e.next,s?Fo(e,r,i,s):ko(e))t.push(a.i/n),t.push(e.i/n),t.push(l.i/n),ia(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?Uo(e=Ho(zo(e),t,n),t,n,r,i,s,2):2===o&&Go(e,t,n,r,i,s):Uo(zo(e),t,n,r,i,s,1);break}}function ko(e){const t=e.prev,n=e,r=e.next;if(Jo(t,n,r)>=0)return!1;let i=e.next.next;for(;i!==e.prev;){if(Yo(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Jo(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Fo(e,t,n,r){const i=e.prev,s=e,o=e.next;if(Jo(i,s,o)>=0)return!1;const a=i.x<s.x?i.x<o.x?i.x:o.x:s.x<o.x?s.x:o.x,l=i.y<s.y?i.y<o.y?i.y:o.y:s.y<o.y?s.y:o.y,c=i.x>s.x?i.x>o.x?i.x:o.x:s.x>o.x?s.x:o.x,h=i.y>s.y?i.y>o.y?i.y:o.y:s.y>o.y?s.y:o.y,u=Xo(a,l,t,n,r),d=Xo(c,h,t,n,r);let p=e.prevZ,f=e.nextZ;for(;p&&p.z>=u&&f&&f.z<=d;){if(p!==e.prev&&p!==e.next&&Yo(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Jo(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&Yo(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Jo(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=u;){if(p!==e.prev&&p!==e.next&&Yo(i.x,i.y,s.x,s.y,o.x,o.y,p.x,p.y)&&Jo(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==e.prev&&f!==e.next&&Yo(i.x,i.y,s.x,s.y,o.x,o.y,f.x,f.y)&&Jo(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Ho(e,t,n){let r=e;do{const i=r.prev,s=r.next.next;!Qo(i,s)&&Ko(i,r,r.next,s)&&ta(i,s)&&ta(s,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(s.i/n),ia(r),ia(r.next),r=e=s),r=r.next}while(r!==e);return zo(r)}function Go(e,t,n,r,i,s){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&Zo(o,e)){let a=na(o,e);return o=zo(o,o.next),a=zo(a,a.next),Uo(o,t,n,r,i,s),void Uo(a,t,n,r,i,s)}e=e.next}o=o.next}while(o!==e)}function jo(e,t){return e.x-t.x}function Vo(e,t){if(t=function(e,t){let n=t;const r=e.x,i=e.y;let s,o=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>o){if(o=e,e===r){if(i===n.y)return n;if(i===n.next.y)return n.next}s=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!s)return null;if(r===o)return s;const a=s,l=s.x,c=s.y;let h,u=1/0;n=s;do{r>=n.x&&n.x>=l&&r!==n.x&&Yo(i<c?r:o,i,l,c,i<c?o:r,i,n.x,n.y)&&(h=Math.abs(i-n.y)/(r-n.x),ta(n,e)&&(h<u||h===u&&(n.x>s.x||n.x===s.x&&Wo(s,n)))&&(s=n,u=h)),n=n.next}while(n!==a);return s}(e,t)){const n=na(t,e);zo(t,t.next),zo(n,n.next)}}function Wo(e,t){return Jo(e.prev,e,t.prev)<0&&Jo(t.next,e,e.next)<0}function Xo(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function qo(e){let t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Yo(e,t,n,r,i,s,o,a){return(i-o)*(t-a)-(e-o)*(s-a)>=0&&(e-o)*(r-a)-(n-o)*(t-a)>=0&&(n-o)*(s-a)-(i-o)*(r-a)>=0}function Zo(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Ko(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(ta(e,t)&&ta(t,e)&&function(e,t){let n=e,r=!1;const i=(e.x+t.x)/2,s=(e.y+t.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&i<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Jo(e.prev,e,t.prev)||Jo(e,t.prev,t))||Qo(e,t)&&Jo(e.prev,e,e.next)>0&&Jo(t.prev,t,t.next)>0)}function Jo(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Qo(e,t){return e.x===t.x&&e.y===t.y}function Ko(e,t,n,r){const i=ea(Jo(e,t,n)),s=ea(Jo(e,t,r)),o=ea(Jo(n,r,e)),a=ea(Jo(n,r,t));return i!==s&&o!==a||!(0!==i||!$o(e,n,t))||!(0!==s||!$o(e,r,t))||!(0!==o||!$o(n,e,r))||!(0!==a||!$o(n,t,r))}function $o(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function ea(e){return e>0?1:e<0?-1:0}function ta(e,t){return Jo(e.prev,e,e.next)<0?Jo(e,t,e.next)>=0&&Jo(e,e.prev,t)>=0:Jo(e,t,e.prev)<0||Jo(e,e.next,t)<0}function na(e,t){const n=new sa(e.i,e.x,e.y),r=new sa(t.i,t.x,t.y),i=e.next,s=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,s.next=r,r.prev=s,r}function ra(e,t,n,r){const i=new sa(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function ia(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function sa(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}class oa{static area(e){const t=e.length;let n=0;for(let r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n}static isClockWise(e){return oa.area(e)<0}static triangulateShape(e,t){const n=[],r=[],i=[];aa(e),la(n,e);let s=e.length;t.forEach(aa);for(let e=0;e<t.length;e++)r.push(s),s+=t[e].length,la(n,t[e]);const o=function(e,t,n=2){const r=t&&t.length,i=r?t[0]*n:e.length;let s=No(e,0,i,n,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,c,h,u,d,p;if(r&&(s=function(e,t,n,r){const i=[];let s,o,a,l,c;for(s=0,o=t.length;s<o;s++)a=t[s]*r,l=s<o-1?t[s+1]*r:e.length,c=No(e,a,l,r,!1),c===c.next&&(c.steiner=!0),i.push(qo(c));for(i.sort(jo),s=0;s<i.length;s++)Vo(i[s],n),n=zo(n,n.next);return n}(e,t,s,n)),e.length>80*n){a=c=e[0],l=h=e[1];for(let t=n;t<i;t+=n)u=e[t],d=e[t+1],u<a&&(a=u),d<l&&(l=d),u>c&&(c=u),d>h&&(h=d);p=Math.max(c-a,h-l),p=0!==p?1/p:0}return Uo(s,o,n,a,l,p),o}(n,r);for(let e=0;e<o.length;e+=3)i.push(o.slice(e,e+3));return i}}function aa(e){const t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function la(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}class ca extends At{constructor(e=new Bo([new p(.5,.5),new p(-.5,.5),new p(-.5,-.5),new p(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,r=[],i=[];for(let t=0,n=e.length;t<n;t++)s(e[t]);function s(e){const s=[],o=void 0!==t.curveSegments?t.curveSegments:12,a=void 0!==t.steps?t.steps:1;let l=void 0!==t.depth?t.depth:1,c=void 0===t.bevelEnabled||t.bevelEnabled,h=void 0!==t.bevelThickness?t.bevelThickness:.2,u=void 0!==t.bevelSize?t.bevelSize:h-.1,d=void 0!==t.bevelOffset?t.bevelOffset:0,f=void 0!==t.bevelSegments?t.bevelSegments:3;const m=t.extrudePath,g=void 0!==t.UVGenerator?t.UVGenerator:ha;void 0!==t.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),l=t.amount);let v,y,x,w,b,_=!1;m&&(v=m.getSpacedPoints(a),_=!0,c=!1,y=m.computeFrenetFrames(a,!1),x=new V,w=new V,b=new V),c||(f=0,h=0,u=0,d=0);const M=e.extractPoints(o);let S=M.shape;const T=M.holes;if(!oa.isClockWise(S)){S=S.reverse();for(let e=0,t=T.length;e<t;e++){const t=T[e];oa.isClockWise(t)&&(T[e]=t.reverse())}}const E=oa.triangulateShape(S,T),A=S;for(let e=0,t=T.length;e<t;e++){const t=T[e];S=S.concat(t)}function C(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}const P=S.length,R=E.length;function L(e,t,n){let r,i,s;const o=e.x-t.x,a=e.y-t.y,l=n.x-e.x,c=n.y-e.y,h=o*o+a*a,u=o*c-a*l;if(Math.abs(u)>Number.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),f=t.x-a/u,m=t.y+o/u,g=((n.x-c/d-f)*c-(n.y+l/d-m)*l)/(o*c-a*l);r=f+o*g-e.x,i=m+a*g-e.y;const v=r*r+i*i;if(v<=2)return new p(r,i);s=Math.sqrt(v/2)}else{let e=!1;o>Number.EPSILON?l>Number.EPSILON&&(e=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(a)===Math.sign(c)&&(e=!0),e?(r=-a,i=o,s=Math.sqrt(h)):(r=o,i=a,s=Math.sqrt(h/2))}return new p(r/s,i/s)}const I=[];for(let e=0,t=A.length,n=t-1,r=e+1;e<t;e++,n++,r++)n===t&&(n=0),r===t&&(r=0),I[e]=L(A[e],A[n],A[r]);const D=[];let O,B=I.concat();for(let e=0,t=T.length;e<t;e++){const t=T[e];O=[];for(let e=0,n=t.length,r=n-1,i=e+1;e<n;e++,r++,i++)r===n&&(r=0),i===n&&(i=0),O[e]=L(t[e],t[r],t[i]);D.push(O),B=B.concat(O)}for(let e=0;e<f;e++){const t=e/f,n=h*Math.cos(t*Math.PI/2),r=u*Math.sin(t*Math.PI/2)+d;for(let e=0,t=A.length;e<t;e++){const t=C(A[e],I[e],r);U(t.x,t.y,-n)}for(let e=0,t=T.length;e<t;e++){const t=T[e];O=D[e];for(let e=0,i=t.length;e<i;e++){const i=C(t[e],O[e],r);U(i.x,i.y,-n)}}}const N=u+d;for(let e=0;e<P;e++){const t=c?C(S[e],B[e],N):S[e];_?(w.copy(y.normals[0]).multiplyScalar(t.x),x.copy(y.binormals[0]).multiplyScalar(t.y),b.copy(v[0]).add(w).add(x),U(b.x,b.y,b.z)):U(t.x,t.y,0)}for(let e=1;e<=a;e++)for(let t=0;t<P;t++){const n=c?C(S[t],B[t],N):S[t];_?(w.copy(y.normals[e]).multiplyScalar(n.x),x.copy(y.binormals[e]).multiplyScalar(n.y),b.copy(v[e]).add(w).add(x),U(b.x,b.y,b.z)):U(n.x,n.y,l/a*e)}for(let e=f-1;e>=0;e--){const t=e/f,n=h*Math.cos(t*Math.PI/2),r=u*Math.sin(t*Math.PI/2)+d;for(let e=0,t=A.length;e<t;e++){const t=C(A[e],I[e],r);U(t.x,t.y,l+n)}for(let e=0,t=T.length;e<t;e++){const t=T[e];O=D[e];for(let e=0,i=t.length;e<i;e++){const i=C(t[e],O[e],r);_?U(i.x,i.y+v[a-1].y,v[a-1].x+n):U(i.x,i.y,l+n)}}}function z(e,t){let n=e.length;for(;--n>=0;){const r=n;let i=n-1;i<0&&(i=e.length-1);for(let e=0,n=a+2*f;e<n;e++){const n=P*e,s=P*(e+1);F(t+r+n,t+i+n,t+i+s,t+r+s)}}}function U(e,t,n){s.push(e),s.push(t),s.push(n)}function k(e,t,i){H(e),H(t),H(i);const s=r.length/3,o=g.generateTopUV(n,r,s-3,s-2,s-1);G(o[0]),G(o[1]),G(o[2])}function F(e,t,i,s){H(e),H(t),H(s),H(t),H(i),H(s);const o=r.length/3,a=g.generateSideWallUV(n,r,o-6,o-3,o-2,o-1);G(a[0]),G(a[1]),G(a[3]),G(a[1]),G(a[2]),G(a[3])}function H(e){r.push(s[3*e+0]),r.push(s[3*e+1]),r.push(s[3*e+2])}function G(e){i.push(e.x),i.push(e.y)}!function(){const e=r.length/3;if(c){let e=0,t=P*e;for(let e=0;e<R;e++){const n=E[e];k(n[2]+t,n[1]+t,n[0]+t)}e=a+2*f,t=P*e;for(let e=0;e<R;e++){const n=E[e];k(n[0]+t,n[1]+t,n[2]+t)}}else{for(let e=0;e<R;e++){const t=E[e];k(t[2],t[1],t[0])}for(let e=0;e<R;e++){const t=E[e];k(t[0]+P*a,t[1]+P*a,t[2]+P*a)}}n.addGroup(e,r.length/3-e,0)}(),function(){const e=r.length/3;let t=0;z(A,t),t+=A.length;for(let e=0,n=T.length;e<n;e++){const n=T[e];z(n,t),t+=n.length}n.addGroup(e,r.length/3-e,1)}()}this.setAttribute("position",new yt(r,3)),this.setAttribute("uv",new yt(i,2)),this.computeVertexNormals()}toJSON(){const e=super.toJSON();return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(let t=0,r=e.length;t<r;t++){const r=e[t];n.shapes.push(r.uuid)}else n.shapes.push(e.uuid);return void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){const n=[];for(let r=0,i=e.shapes.length;r<i;r++){const i=t[e.shapes[r]];n.push(i)}const r=e.options.extrudePath;return void 0!==r&&(e.options.extrudePath=(new wo[r.type]).fromJSON(r)),new ca(n,e.options)}}const ha={generateTopUV:function(e,t,n,r,i){const s=t[3*n],o=t[3*n+1],a=t[3*r],l=t[3*r+1],c=t[3*i],h=t[3*i+1];return[new p(s,o),new p(a,l),new p(c,h)]},generateSideWallUV:function(e,t,n,r,i,s){const o=t[3*n],a=t[3*n+1],l=t[3*n+2],c=t[3*r],h=t[3*r+1],u=t[3*r+2],d=t[3*i],f=t[3*i+1],m=t[3*i+2],g=t[3*s],v=t[3*s+1],y=t[3*s+2];return Math.abs(a-h)<Math.abs(o-c)?[new p(o,1-l),new p(c,1-u),new p(d,1-m),new p(g,1-y)]:[new p(a,1-l),new p(h,1-u),new p(f,1-m),new p(v,1-y)]}};class ua extends Co{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2;super([-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new ua(e.radius,e.detail)}}class da extends Co{constructor(e=1,t=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new da(e.radius,e.detail)}}class pa extends At{constructor(e=.5,t=1,n=8,r=1,i=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:s},n=Math.max(3,n);const o=[],a=[],l=[],c=[];let h=e;const u=(t-e)/(r=Math.max(1,r)),d=new V,f=new p;for(let e=0;e<=r;e++){for(let e=0;e<=n;e++){const r=i+e/n*s;d.x=h*Math.cos(r),d.y=h*Math.sin(r),a.push(d.x,d.y,d.z),l.push(0,0,1),f.x=(d.x/t+1)/2,f.y=(d.y/t+1)/2,c.push(f.x,f.y)}h+=u}for(let e=0;e<r;e++){const t=e*(n+1);for(let e=0;e<n;e++){const r=e+t,i=r,s=r+n+1,a=r+n+2,l=r+1;o.push(i,s,l),o.push(s,a,l)}}this.setIndex(o),this.setAttribute("position",new yt(a,3)),this.setAttribute("normal",new yt(l,3)),this.setAttribute("uv",new yt(c,2))}static fromJSON(e){return new pa(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class fa extends At{constructor(e=new Bo([new p(0,.5),new p(-.5,-.5),new p(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],r=[],i=[],s=[];let o=0,a=0;if(!1===Array.isArray(e))l(e);else for(let t=0;t<e.length;t++)l(e[t]),this.addGroup(o,a,t),o+=a,a=0;function l(e){const o=r.length/3,l=e.extractPoints(t);let c=l.shape;const h=l.holes;!1===oa.isClockWise(c)&&(c=c.reverse());for(let e=0,t=h.length;e<t;e++){const t=h[e];!0===oa.isClockWise(t)&&(h[e]=t.reverse())}const u=oa.triangulateShape(c,h);for(let e=0,t=h.length;e<t;e++){const t=h[e];c=c.concat(t)}for(let e=0,t=c.length;e<t;e++){const t=c[e];r.push(t.x,t.y,0),i.push(0,0,1),s.push(t.x,t.y)}for(let e=0,t=u.length;e<t;e++){const t=u[e],r=t[0]+o,i=t[1]+o,s=t[2]+o;n.push(r,i,s),a+=3}}this.setIndex(n),this.setAttribute("position",new yt(r,3)),this.setAttribute("normal",new yt(i,3)),this.setAttribute("uv",new yt(s,2))}toJSON(){const e=super.toJSON();return function(e,t){if(t.shapes=[],Array.isArray(e))for(let n=0,r=e.length;n<r;n++){const r=e[n];t.shapes.push(r.uuid)}else t.shapes.push(e.uuid);return t}(this.parameters.shapes,e)}static fromJSON(e,t){const n=[];for(let r=0,i=e.shapes.length;r<i;r++){const i=t[e.shapes[r]];n.push(i)}return new fa(n,e.curveSegments)}}class ma extends At{constructor(e=1,t=32,n=16,r=0,i=2*Math.PI,s=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:s,thetaLength:o},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const a=Math.min(s+o,Math.PI);let l=0;const c=[],h=new V,u=new V,d=[],p=[],f=[],m=[];for(let d=0;d<=n;d++){const g=[],v=d/n;let y=0;0==d&&0==s?y=.5/t:d==n&&a==Math.PI&&(y=-.5/t);for(let n=0;n<=t;n++){const a=n/t;h.x=-e*Math.cos(r+a*i)*Math.sin(s+v*o),h.y=e*Math.cos(s+v*o),h.z=e*Math.sin(r+a*i)*Math.sin(s+v*o),p.push(h.x,h.y,h.z),u.copy(h).normalize(),f.push(u.x,u.y,u.z),m.push(a+y,1-v),g.push(l++)}c.push(g)}for(let e=0;e<n;e++)for(let r=0;r<t;r++){const t=c[e][r+1],i=c[e][r],o=c[e+1][r],l=c[e+1][r+1];(0!==e||s>0)&&d.push(t,i,l),(e!==n-1||a<Math.PI)&&d.push(i,o,l)}this.setIndex(d),this.setAttribute("position",new yt(p,3)),this.setAttribute("normal",new yt(f,3)),this.setAttribute("uv",new yt(m,2))}static fromJSON(e){return new ma(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class ga extends Co{constructor(e=1,t=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new ga(e.radius,e.detail)}}class va extends At{constructor(e=1,t=.4,n=8,r=6,i=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:i},n=Math.floor(n),r=Math.floor(r);const s=[],o=[],a=[],l=[],c=new V,h=new V,u=new V;for(let s=0;s<=n;s++)for(let d=0;d<=r;d++){const p=d/r*i,f=s/n*Math.PI*2;h.x=(e+t*Math.cos(f))*Math.cos(p),h.y=(e+t*Math.cos(f))*Math.sin(p),h.z=t*Math.sin(f),o.push(h.x,h.y,h.z),c.x=e*Math.cos(p),c.y=e*Math.sin(p),u.subVectors(h,c).normalize(),a.push(u.x,u.y,u.z),l.push(d/r),l.push(s/n)}for(let e=1;e<=n;e++)for(let t=1;t<=r;t++){const n=(r+1)*e+t-1,i=(r+1)*(e-1)+t-1,o=(r+1)*(e-1)+t,a=(r+1)*e+t;s.push(n,i,a),s.push(i,o,a)}this.setIndex(s),this.setAttribute("position",new yt(o,3)),this.setAttribute("normal",new yt(a,3)),this.setAttribute("uv",new yt(l,2))}static fromJSON(e){return new va(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class ya extends At{constructor(e=1,t=.4,n=64,r=8,i=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:i,q:s},n=Math.floor(n),r=Math.floor(r);const o=[],a=[],l=[],c=[],h=new V,u=new V,d=new V,p=new V,f=new V,m=new V,g=new V;for(let o=0;o<=n;++o){const y=o/n*i*Math.PI*2;v(y,i,s,e,d),v(y+.01,i,s,e,p),m.subVectors(p,d),g.addVectors(p,d),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let e=0;e<=r;++e){const i=e/r*Math.PI*2,s=-t*Math.cos(i),p=t*Math.sin(i);h.x=d.x+(s*g.x+p*f.x),h.y=d.y+(s*g.y+p*f.y),h.z=d.z+(s*g.z+p*f.z),a.push(h.x,h.y,h.z),u.subVectors(h,d).normalize(),l.push(u.x,u.y,u.z),c.push(o/n),c.push(e/r)}}for(let e=1;e<=n;e++)for(let t=1;t<=r;t++){const n=(r+1)*(e-1)+(t-1),i=(r+1)*e+(t-1),s=(r+1)*e+t,a=(r+1)*(e-1)+t;o.push(n,i,a),o.push(i,s,a)}function v(e,t,n,r,i){const s=Math.cos(e),o=Math.sin(e),a=n/t*e,l=Math.cos(a);i.x=r*(2+l)*.5*s,i.y=r*(2+l)*o*.5,i.z=r*Math.sin(a)*.5}this.setIndex(o),this.setAttribute("position",new yt(a,3)),this.setAttribute("normal",new yt(l,3)),this.setAttribute("uv",new yt(c,2))}static fromJSON(e){return new ya(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class xa extends At{constructor(e=new yo(new V(-1,-1,0),new V(-1,1,0),new V(1,1,0)),t=64,n=1,r=8,i=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i};const s=e.computeFrenetFrames(t,i);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const o=new V,a=new V,l=new p;let c=new V;const h=[],u=[],d=[],f=[];function m(i){c=e.getPointAt(i/t,c);const l=s.normals[i],d=s.binormals[i];for(let e=0;e<=r;e++){const t=e/r*Math.PI*2,i=Math.sin(t),s=-Math.cos(t);a.x=s*l.x+i*d.x,a.y=s*l.y+i*d.y,a.z=s*l.z+i*d.z,a.normalize(),u.push(a.x,a.y,a.z),o.x=c.x+n*a.x,o.y=c.y+n*a.y,o.z=c.z+n*a.z,h.push(o.x,o.y,o.z)}}!function(){for(let e=0;e<t;e++)m(e);m(!1===i?t:0),function(){for(let e=0;e<=t;e++)for(let n=0;n<=r;n++)l.x=e/t,l.y=n/r,d.push(l.x,l.y)}(),function(){for(let e=1;e<=t;e++)for(let t=1;t<=r;t++){const n=(r+1)*(e-1)+(t-1),i=(r+1)*e+(t-1),s=(r+1)*e+t,o=(r+1)*(e-1)+t;f.push(n,i,o),f.push(i,s,o)}}()}(),this.setIndex(f),this.setAttribute("position",new yt(h,3)),this.setAttribute("normal",new yt(u,3)),this.setAttribute("uv",new yt(d,2))}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new xa((new wo[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class wa extends At{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){const t=[],n=new Set,r=new V,i=new V;if(null!==e.index){const s=e.attributes.position,o=e.index;let a=e.groups;0===a.length&&(a=[{start:0,count:o.count,materialIndex:0}]);for(let e=0,l=a.length;e<l;++e){const l=a[e],c=l.start;for(let e=c,a=c+l.count;e<a;e+=3)for(let a=0;a<3;a++){const l=o.getX(e+a),c=o.getX(e+(a+1)%3);r.fromBufferAttribute(s,l),i.fromBufferAttribute(s,c),!0===ba(r,i,n)&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}}else{const s=e.attributes.position;for(let e=0,o=s.count/3;e<o;e++)for(let o=0;o<3;o++){const a=3*e+o,l=3*e+(o+1)%3;r.fromBufferAttribute(s,a),i.fromBufferAttribute(s,l),!0===ba(r,i,n)&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}this.setAttribute("position",new yt(t,3))}}}function ba(e,t,n){const r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return!0!==n.has(r)&&!0!==n.has(i)&&(n.add(r),n.add(i),!0)}var _a=Object.freeze({__proto__:null,BoxGeometry:qt,BoxBufferGeometry:qt,CapsuleGeometry:So,CapsuleBufferGeometry:So,CircleGeometry:To,CircleBufferGeometry:To,ConeGeometry:Ao,ConeBufferGeometry:Ao,CylinderGeometry:Eo,CylinderBufferGeometry:Eo,DodecahedronGeometry:Po,DodecahedronBufferGeometry:Po,EdgesGeometry:Oo,ExtrudeGeometry:ca,ExtrudeBufferGeometry:ca,IcosahedronGeometry:ua,IcosahedronBufferGeometry:ua,LatheGeometry:Mo,LatheBufferGeometry:Mo,OctahedronGeometry:da,OctahedronBufferGeometry:da,PlaneGeometry:pn,PlaneBufferGeometry:pn,PolyhedronGeometry:Co,PolyhedronBufferGeometry:Co,RingGeometry:pa,RingBufferGeometry:pa,ShapeGeometry:fa,ShapeBufferGeometry:fa,SphereGeometry:ma,SphereBufferGeometry:ma,TetrahedronGeometry:ga,TetrahedronBufferGeometry:ga,TorusGeometry:va,TorusBufferGeometry:va,TorusKnotGeometry:ya,TorusKnotBufferGeometry:ya,TubeGeometry:xa,TubeBufferGeometry:xa,WireframeGeometry:wa});class Ma extends st{constructor(e){super(),this.type="ShadowMaterial",this.color=new P(0),this.transparent=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this}}Ma.prototype.isShadowMaterial=!0;class Sa extends Qt{constructor(e){super(e),this.type="RawShaderMaterial"}}Sa.prototype.isRawShaderMaterial=!0;class Ta extends st{constructor(e){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new P(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new P(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new p(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}Ta.prototype.isMeshStandardMaterial=!0;class Ea extends Ta{constructor(e){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new p(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return o(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.sheenColor=new P(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new P(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new P(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._transmission=0,this.setValues(e)}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}Ea.prototype.isMeshPhysicalMaterial=!0;class Aa extends st{constructor(e){super(),this.type="MeshPhongMaterial",this.color=new P(16777215),this.specular=new P(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new P(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new p(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this}}Aa.prototype.isMeshPhongMaterial=!0;class Ca extends st{constructor(e){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new P(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new P(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new p(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}Ca.prototype.isMeshToonMaterial=!0;class Pa extends st{constructor(e){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new p(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}Pa.prototype.isMeshNormalMaterial=!0;class Ra extends st{constructor(e){super(),this.type="MeshLambertMaterial",this.color=new P(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new P(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this}}Ra.prototype.isMeshLambertMaterial=!0;class La extends st{constructor(e){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new P(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new p(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this}}La.prototype.isMeshMatcapMaterial=!0;class Ia extends Is{constructor(e){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}Ia.prototype.isLineDashedMaterial=!0;const Da={ShadowMaterial:Ma,SpriteMaterial:Ji,RawShaderMaterial:Sa,ShaderMaterial:Qt,PointsMaterial:js,MeshPhysicalMaterial:Ea,MeshStandardMaterial:Ta,MeshPhongMaterial:Aa,MeshToonMaterial:Ca,MeshNormalMaterial:Pa,MeshLambertMaterial:Ra,MeshDepthMaterial:Pi,MeshDistanceMaterial:Ri,MeshBasicMaterial:ot,MeshMatcapMaterial:La,LineDashedMaterial:Ia,LineBasicMaterial:Is,Material:st};st.fromType=function(e){return new Da[e]};const Oa={arraySlice:function(e,t,n){return Oa.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){const t=e.length,n=new Array(t);for(let e=0;e!==t;++e)n[e]=e;return n.sort((function(t,n){return e[t]-e[n]})),n},sortedArray:function(e,t,n){const r=e.length,i=new e.constructor(r);for(let s=0,o=0;o!==r;++s){const r=n[s]*t;for(let n=0;n!==t;++n)i[o++]=e[r+n]}return i},flattenJSON:function(e,t,n,r){let i=1,s=e[0];for(;void 0!==s&&void 0===s[r];)s=e[i++];if(void 0===s)return;let o=s[r];if(void 0!==o)if(Array.isArray(o))do{o=s[r],void 0!==o&&(t.push(s.time),n.push.apply(n,o)),s=e[i++]}while(void 0!==s);else if(void 0!==o.toArray)do{o=s[r],void 0!==o&&(t.push(s.time),o.toArray(n,n.length)),s=e[i++]}while(void 0!==s);else do{o=s[r],void 0!==o&&(t.push(s.time),n.push(o)),s=e[i++]}while(void 0!==s)},subclip:function(e,t,n,r,i=30){const s=e.clone();s.name=t;const o=[];for(let e=0;e<s.tracks.length;++e){const t=s.tracks[e],a=t.getValueSize(),l=[],c=[];for(let e=0;e<t.times.length;++e){const s=t.times[e]*i;if(!(s<n||s>=r)){l.push(t.times[e]);for(let n=0;n<a;++n)c.push(t.values[e*a+n])}}0!==l.length&&(t.times=Oa.convertArray(l,t.times.constructor),t.values=Oa.convertArray(c,t.values.constructor),o.push(t))}s.tracks=o;let a=1/0;for(let e=0;e<s.tracks.length;++e)a>s.tracks[e].times[0]&&(a=s.tracks[e].times[0]);for(let e=0;e<s.tracks.length;++e)s.tracks[e].shift(-1*a);return s.resetDuration(),s},makeClipAdditive:function(e,t=0,n=e,r=30){r<=0&&(r=30);const i=n.tracks.length,s=t/r;for(let t=0;t<i;++t){const r=n.tracks[t],i=r.ValueTypeName;if("bool"===i||"string"===i)continue;const o=e.tracks.find((function(e){return e.name===r.name&&e.ValueTypeName===i}));if(void 0===o)continue;let a=0;const l=r.getValueSize();r.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(a=l/3);let c=0;const h=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(c=h/3);const u=r.times.length-1;let d;if(s<=r.times[0]){const e=a,t=l-a;d=Oa.arraySlice(r.values,e,t)}else if(s>=r.times[u]){const e=u*l+a,t=e+l-a;d=Oa.arraySlice(r.values,e,t)}else{const e=r.createInterpolant(),t=a,n=l-a;e.evaluate(s),d=Oa.arraySlice(e.resultBuffer,t,n)}"quaternion"===i&&(new j).fromArray(d).normalize().conjugate().toArray(d);const p=o.times.length;for(let e=0;e<p;++e){const t=e*h+c;if("quaternion"===i)j.multiplyQuaternionsFlat(o.values,t,d,0,o.values,t);else{const e=h-2*c;for(let n=0;n<e;++n)o.values[t+n]-=d[n]}}}return e.blendMode=2501,e}};class Ba{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,r=t[n],i=t[n-1];e:{t:{let s;n:{r:if(!(e<r)){for(let s=n+2;;){if(void 0===r){if(e<i)break r;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,i)}if(n===s)break;if(i=r,r=t[++n],e<r)break t}s=t.length;break n}if(e>=i)break e;{const o=t[1];e<o&&(n=2,i=o);for(let s=n-2;;){if(void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(n===s)break;if(r=i,i=t[--n-1],e>=i)break t}s=n,n=0}}for(;n<s;){const r=n+s>>>1;e<t[r]?s=r:n=r+1}if(r=t[n],i=t[n-1],void 0===i)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,i,e)}this._cachedIndex=n,this.intervalChanged_(n,i,r)}return this.interpolate_(n,i,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r;for(let e=0;e!==r;++e)t[e]=n[i+e];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}Ba.prototype.beforeStart_=Ba.prototype.copySampleValue_,Ba.prototype.afterEnd_=Ba.prototype.copySampleValue_;class Na extends Ba{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:2400,endingEnd:2400}}intervalChanged_(e,t,n){const r=this.parameterPositions;let i=e-2,s=e+1,o=r[i],a=r[s];if(void 0===o)switch(this.getSettings_().endingStart){case 2401:i=e,o=2*t-n;break;case 2402:i=r.length-2,o=t+r[i]-r[i+1];break;default:i=e,o=n}if(void 0===a)switch(this.getSettings_().endingEnd){case 2401:s=e,a=2*n-t;break;case 2402:s=1,a=n+r[1]-r[0];break;default:s=e-1,a=t}const l=.5*(n-t),c=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(a-n),this._offsetPrev=i*c,this._offsetNext=s*c}interpolate_(e,t,n,r){const i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=e*o,l=a-o,c=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,d=this._weightNext,p=(n-t)/(r-t),f=p*p,m=f*p,g=-u*m+2*u*f-u*p,v=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f;for(let e=0;e!==o;++e)i[e]=g*s[c+e]+v*s[l+e]+y*s[a+e]+x*s[h+e];return i}}class za extends Ba{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=e*o,l=a-o,c=(n-t)/(r-t),h=1-c;for(let e=0;e!==o;++e)i[e]=s[l+e]*h+s[a+e]*c;return i}}class Ua extends Ba{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class ka{constructor(e,t,n,r){if(void 0===e)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Oa.convertArray(t,this.TimeBufferType),this.values=Oa.convertArray(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Oa.convertArray(e.times,Array),values:Oa.convertArray(e.values,Array)};const t=e.getInterpolation();t!==e.DefaultInterpolation&&(n.interpolation=t)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new Ua(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new za(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new Na(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case 2300:t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){const t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}}getValueSize(){return this.values.length/this.times.length}shift(e){if(0!==e){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(1!==e){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){const n=this.times,r=n.length;let i=0,s=r-1;for(;i!==r&&n[i]<e;)++i;for(;-1!==s&&n[s]>t;)--s;if(++s,0!==i||s!==r){i>=s&&(s=Math.max(s,1),i=s-1);const e=this.getValueSize();this.times=Oa.arraySlice(n,i,s),this.values=Oa.arraySlice(this.values,i*e,s*e)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let s=null;for(let t=0;t!==i;t++){const r=n[t];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,r),e=!1;break}if(null!==s&&s>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,r,s),e=!1;break}s=r}if(void 0!==r&&Oa.isTypedArray(r))for(let t=0,n=r.length;t!==n;++t){const n=r[t];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,n),e=!1;break}}return e}optimize(){const e=Oa.arraySlice(this.times),t=Oa.arraySlice(this.values),n=this.getValueSize(),r=2302===this.getInterpolation(),i=e.length-1;let s=1;for(let o=1;o<i;++o){let i=!1;const a=e[o];if(a!==e[o+1]&&(1!==o||a!==e[0]))if(r)i=!0;else{const e=o*n,r=e-n,s=e+n;for(let o=0;o!==n;++o){const n=t[e+o];if(n!==t[r+o]||n!==t[s+o]){i=!0;break}}}if(i){if(o!==s){e[s]=e[o];const r=o*n,i=s*n;for(let e=0;e!==n;++e)t[i+e]=t[r+e]}++s}}if(i>0){e[s]=e[i];for(let e=i*n,r=s*n,o=0;o!==n;++o)t[r+o]=t[e+o];++s}return s!==e.length?(this.times=Oa.arraySlice(e,0,s),this.values=Oa.arraySlice(t,0,s*n)):(this.times=e,this.values=t),this}clone(){const e=Oa.arraySlice(this.times,0),t=Oa.arraySlice(this.values,0),n=new this.constructor(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}ka.prototype.TimeBufferType=Float32Array,ka.prototype.ValueBufferType=Float32Array,ka.prototype.DefaultInterpolation=2301;class Fa extends ka{}Fa.prototype.ValueTypeName="bool",Fa.prototype.ValueBufferType=Array,Fa.prototype.DefaultInterpolation=2300,Fa.prototype.InterpolantFactoryMethodLinear=void 0,Fa.prototype.InterpolantFactoryMethodSmooth=void 0;class Ha extends ka{}Ha.prototype.ValueTypeName="color";class Ga extends ka{}Ga.prototype.ValueTypeName="number";class ja extends Ba{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(n-t)/(r-t);let l=e*o;for(let e=l+o;l!==e;l+=4)j.slerpFlat(i,0,s,l-o,s,l,a);return i}}class Va extends ka{InterpolantFactoryMethodLinear(e){return new ja(this.times,this.values,this.getValueSize(),e)}}Va.prototype.ValueTypeName="quaternion",Va.prototype.DefaultInterpolation=2301,Va.prototype.InterpolantFactoryMethodSmooth=void 0;class Wa extends ka{}Wa.prototype.ValueTypeName="string",Wa.prototype.ValueBufferType=Array,Wa.prototype.DefaultInterpolation=2300,Wa.prototype.InterpolantFactoryMethodLinear=void 0,Wa.prototype.InterpolantFactoryMethodSmooth=void 0;class Xa extends ka{}Xa.prototype.ValueTypeName="vector";class qa{constructor(e,t=-1,n,r=2500){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=s(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push(Ya(n[e]).scale(r));const i=new this(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i}static toJSON(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,r=n.length;e!==r;++e)t.push(ka.toJSON(n[e]));return r}static CreateFromMorphTargetSequence(e,t,n,r){const i=t.length,s=[];for(let e=0;e<i;e++){let o=[],a=[];o.push((e+i-1)%i,e,(e+1)%i),a.push(0,1,0);const l=Oa.getKeyframeOrder(o);o=Oa.sortedArray(o,1,l),a=Oa.sortedArray(a,1,l),r||0!==o[0]||(o.push(i),a.push(a[0])),s.push(new Ga(".morphTargetInfluences["+t[e].name+"]",o,a).scale(1/n))}return new this(e,-1,s)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const t=e;n=t.geometry&&t.geometry.animations||t.animations}for(let e=0;e<n.length;e++)if(n[e].name===t)return n[e];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const r={},i=/^([\w-]*?)([\d]+)$/;for(let t=0,n=e.length;t<n;t++){const n=e[t],s=n.name.match(i);if(s&&s.length>1){const e=s[1];let t=r[e];t||(r[e]=t=[]),t.push(n)}}const s=[];for(const e in r)s.push(this.CreateFromMorphTargetSequence(e,r[e],t,n));return s}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,r,i){if(0!==n.length){const s=[],o=[];Oa.flattenJSON(n,s,o,r),0!==s.length&&i.push(new e(t,s,o))}},r=[],i=e.name||"default",s=e.fps||30,o=e.blendMode;let a=e.length||-1;const l=e.hierarchy||[];for(let e=0;e<l.length;e++){const i=l[e].keys;if(i&&0!==i.length)if(i[0].morphTargets){const e={};let t;for(t=0;t<i.length;t++)if(i[t].morphTargets)for(let n=0;n<i[t].morphTargets.length;n++)e[i[t].morphTargets[n]]=-1;for(const n in e){const e=[],s=[];for(let r=0;r!==i[t].morphTargets.length;++r){const r=i[t];e.push(r.time),s.push(r.morphTarget===n?1:0)}r.push(new Ga(".morphTargetInfluence["+n+"]",e,s))}a=e.length*s}else{const s=".bones["+t[e].name+"]";n(Xa,s+".position",i,"pos",r),n(Va,s+".quaternion",i,"rot",r),n(Xa,s+".scale",i,"scl",r)}}return 0===r.length?null:new this(i,a,r,o)}resetDuration(){let e=0;for(let t=0,n=this.tracks.length;t!==n;++t){const n=this.tracks[t];e=Math.max(e,n.times[n.times.length-1])}return this.duration=e,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function Ya(e){if(void 0===e.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ga;case"vector":case"vector2":case"vector3":case"vector4":return Xa;case"color":return Ha;case"quaternion":return Va;case"bool":case"boolean":return Fa;case"string":return Wa}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){const t=[],n=[];Oa.flattenJSON(e.keys,t,n,"value"),e.times=t,e.values=n}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}const Za={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};class Ja{constructor(e,t,n){const r=this;let i,s=!1,o=0,a=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){a++,!1===s&&void 0!==r.onStart&&r.onStart(e,o,a),s=!0},this.itemEnd=function(e){o++,void 0!==r.onProgress&&r.onProgress(e,o,a),o===a&&(s=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return i?i(e):e},this.setURLModifier=function(e){return i=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=l.length;t<n;t+=2){const n=l[t],r=l[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return r}return null}}}const Qa=new Ja;class Ka{constructor(e){this.manager=void 0!==e?e:Qa,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise((function(r,i){n.load(e,r,t,i)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}const $a={};class el extends Ka{constructor(e){super(e)}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=Za.get(e);if(void 0!==i)return this.manager.itemStart(e),setTimeout((()=>{t&&t(i),this.manager.itemEnd(e)}),0),i;if(void 0!==$a[e])return void $a[e].push({onLoad:t,onProgress:n,onError:r});$a[e]=[],$a[e].push({onLoad:t,onProgress:n,onError:r});const s=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,a=this.responseType;fetch(s).then((t=>{if(200===t.status||0===t.status){if(0===t.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),"undefined"==typeof ReadableStream||void 0===t.body||void 0===t.body.getReader)return t;const n=$a[e],r=t.body.getReader(),i=t.headers.get("Content-Length"),s=i?parseInt(i):0,o=0!==s;let a=0;const l=new ReadableStream({start(e){!function t(){r.read().then((({done:r,value:i})=>{if(r)e.close();else{a+=i.byteLength;const r=new ProgressEvent("progress",{lengthComputable:o,loaded:a,total:s});for(let e=0,t=n.length;e<t;e++){const t=n[e];t.onProgress&&t.onProgress(r)}e.enqueue(i),t()}}))}()}});return new Response(l)}throw Error(`fetch for "${t.url}" responded with ${t.status}: ${t.statusText}`)})).then((e=>{switch(a){case"arraybuffer":return e.arrayBuffer();case"blob":return e.blob();case"document":return e.text().then((e=>(new DOMParser).parseFromString(e,o)));case"json":return e.json();default:if(void 0===o)return e.text();{const t=/charset="?([^;"\s]*)"?/i.exec(o),n=t&&t[1]?t[1].toLowerCase():void 0,r=new TextDecoder(n);return e.arrayBuffer().then((e=>r.decode(e)))}}})).then((t=>{Za.add(e,t);const n=$a[e];delete $a[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onLoad&&r.onLoad(t)}})).catch((t=>{const n=$a[e];if(void 0===n)throw this.manager.itemError(e),t;delete $a[e];for(let e=0,r=n.length;e<r;e++){const r=n[e];r.onError&&r.onError(t)}this.manager.itemError(e)})).finally((()=>{this.manager.itemEnd(e)})),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class tl extends Ka{constructor(e){super(e)}load(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,s=Za.get(e);if(void 0!==s)return i.manager.itemStart(e),setTimeout((function(){t&&t(s),i.manager.itemEnd(e)}),0),s;const o=y("img");function a(){c(),Za.add(e,this),t&&t(this),i.manager.itemEnd(e)}function l(t){c(),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}function c(){o.removeEventListener("load",a,!1),o.removeEventListener("error",l,!1)}return o.addEventListener("load",a,!1),o.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(e),o.src=e,o}}class nl extends Ka{constructor(e){super(e)}load(e,t,n,r){const i=new tn,s=new tl(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let o=0;function a(n){s.load(e[n],(function(e){i.images[n]=e,o++,6===o&&(i.needsUpdate=!0,t&&t(i))}),void 0,r)}for(let t=0;t<e.length;++t)a(t);return i}}class rl extends Ka{constructor(e){super(e)}load(e,t,n,r){const i=this,s=new _s,o=new el(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(i.withCredentials),o.load(e,(function(e){const n=i.parse(e);n&&(void 0!==n.image?s.image=n.image:void 0!==n.data&&(s.image.width=n.width,s.image.height=n.height,s.image.data=n.data),s.wrapS=void 0!==n.wrapS?n.wrapS:1001,s.wrapT=void 0!==n.wrapT?n.wrapT:1001,s.magFilter=void 0!==n.magFilter?n.magFilter:1006,s.minFilter=void 0!==n.minFilter?n.minFilter:1006,s.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.encoding&&(s.encoding=n.encoding),void 0!==n.flipY&&(s.flipY=n.flipY),void 0!==n.format&&(s.format=n.format),void 0!==n.type&&(s.type=n.type),void 0!==n.mipmaps&&(s.mipmaps=n.mipmaps,s.minFilter=1008),1===n.mipmapCount&&(s.minFilter=1006),void 0!==n.generateMipmaps&&(s.generateMipmaps=n.generateMipmaps),s.needsUpdate=!0,t&&t(s,n))}),n,r),s}}class il extends Ka{constructor(e){super(e)}load(e,t,n,r){const i=new B,s=new tl(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,(function(e){i.image=e,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}class sl extends Xe{constructor(e,t=1){super(),this.type="Light",this.color=new P(e),this.intensity=t}dispose(){}copy(e){return super.copy(e),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}sl.prototype.isLight=!0;class ol extends sl{constructor(e,t,n){super(e,n),this.type="HemisphereLight",this.position.copy(Xe.DefaultUp),this.updateMatrix(),this.groundColor=new P(t)}copy(e){return sl.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}ol.prototype.isHemisphereLight=!0;const al=new be,ll=new V,cl=new V;class hl{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new p(512,512),this.map=null,this.mapPass=null,this.matrix=new be,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new hn,this._frameExtents=new p(1,1),this._viewportCount=1,this._viewports=[new N(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;ll.setFromMatrixPosition(e.matrixWorld),t.position.copy(ll),cl.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(cl),t.updateMatrixWorld(),al.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(al),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class ul extends hl{constructor(){super(new $t(50,1,.5,500)),this.focus=1}updateMatrices(e){const t=this.camera,n=2*i*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;n===t.fov&&r===t.aspect&&s===t.far||(t.fov=n,t.aspect=r,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}ul.prototype.isSpotLightShadow=!0;class dl extends sl{constructor(e,t,n=0,r=Math.PI/3,i=0,s=1){super(e,t),this.type="SpotLight",this.position.copy(Xe.DefaultUp),this.updateMatrix(),this.target=new Xe,this.distance=n,this.angle=r,this.penumbra=i,this.decay=s,this.shadow=new ul}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}dl.prototype.isSpotLight=!0;const pl=new be,fl=new V,ml=new V;class gl extends hl{constructor(){super(new $t(90,1,.5,500)),this._frameExtents=new p(4,2),this._viewportCount=6,this._viewports=[new N(2,1,1,1),new N(0,1,1,1),new N(3,1,1,1),new N(1,1,1,1),new N(3,0,1,1),new N(1,0,1,1)],this._cubeDirections=[new V(1,0,0),new V(-1,0,0),new V(0,0,1),new V(0,0,-1),new V(0,1,0),new V(0,-1,0)],this._cubeUps=[new V(0,1,0),new V(0,1,0),new V(0,1,0),new V(0,1,0),new V(0,0,1),new V(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,r=this.matrix,i=e.distance||n.far;i!==n.far&&(n.far=i,n.updateProjectionMatrix()),fl.setFromMatrixPosition(e.matrixWorld),n.position.copy(fl),ml.copy(n.position),ml.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(ml),n.updateMatrixWorld(),r.makeTranslation(-fl.x,-fl.y,-fl.z),pl.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(pl)}}gl.prototype.isPointLightShadow=!0;class vl extends sl{constructor(e,t,n=0,r=1){super(e,t),this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new gl}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}vl.prototype.isPointLight=!0;class yl extends hl{constructor(){super(new Mn(-5,5,5,-5,.5,500))}}yl.prototype.isDirectionalLightShadow=!0;class xl extends sl{constructor(e,t){super(e,t),this.type="DirectionalLight",this.position.copy(Xe.DefaultUp),this.updateMatrix(),this.target=new Xe,this.shadow=new yl}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}xl.prototype.isDirectionalLight=!0;class wl extends sl{constructor(e,t){super(e,t),this.type="AmbientLight"}}wl.prototype.isAmbientLight=!0;class bl extends sl{constructor(e,t,n=10,r=10){super(e,t),this.type="RectAreaLight",this.width=n,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}bl.prototype.isRectAreaLight=!0;class _l{constructor(){this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new V)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,r=e.y,i=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.282095),t.addScaledVector(s[1],.488603*r),t.addScaledVector(s[2],.488603*i),t.addScaledVector(s[3],.488603*n),t.addScaledVector(s[4],n*r*1.092548),t.addScaledVector(s[5],r*i*1.092548),t.addScaledVector(s[6],.315392*(3*i*i-1)),t.addScaledVector(s[7],n*i*1.092548),t.addScaledVector(s[8],.546274*(n*n-r*r)),t}getIrradianceAt(e,t){const n=e.x,r=e.y,i=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.886227),t.addScaledVector(s[1],1.023328*r),t.addScaledVector(s[2],1.023328*i),t.addScaledVector(s[3],1.023328*n),t.addScaledVector(s[4],.858086*n*r),t.addScaledVector(s[5],.858086*r*i),t.addScaledVector(s[6],.743125*i*i-.247708),t.addScaledVector(s[7],.858086*n*i),t.addScaledVector(s[8],.429043*(n*n-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}toArray(e=[],t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}static getBasisAt(e,t){const n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}_l.prototype.isSphericalHarmonics3=!0;class Ml extends sl{constructor(e=new _l,t=1){super(void 0,t),this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}Ml.prototype.isLightProbe=!0;class Sl extends Ka{constructor(e){super(e),this.textures={}}load(e,t,n,r){const i=this,s=new el(i.manager);s.setPath(i.path),s.setRequestHeader(i.requestHeader),s.setWithCredentials(i.withCredentials),s.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e){const t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}const r=st.fromType(e.type);if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&void 0!==r.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=e.sheen),void 0!==e.sheenColor&&(r.sheenColor=(new P).setHex(e.sheenColor)),void 0!==e.sheenRoughness&&(r.sheenRoughness=e.sheenRoughness),void 0!==e.emissive&&void 0!==r.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&void 0!==r.specular&&r.specular.setHex(e.specular),void 0!==e.specularIntensity&&(r.specularIntensity=e.specularIntensity),void 0!==e.specularColor&&void 0!==r.specularColor&&r.specularColor.setHex(e.specularColor),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.thickness&&(r.thickness=e.thickness),void 0!==e.attenuationDistance&&(r.attenuationDistance=e.attenuationDistance),void 0!==e.attenuationColor&&void 0!==r.attenuationColor&&r.attenuationColor.setHex(e.attenuationColor),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.shadowSide&&(r.shadowSide=e.shadowSide),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.alphaToCoverage&&(r.alphaToCoverage=e.alphaToCoverage),void 0!==e.premultipliedAlpha&&(r.premultipliedAlpha=e.premultipliedAlpha),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.vertexColors&&("number"==typeof e.vertexColors?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const t in e.uniforms){const i=e.uniforms[t];switch(r.uniforms[t]={},i.type){case"t":r.uniforms[t].value=n(i.value);break;case"c":r.uniforms[t].value=(new P).setHex(i.value);break;case"v2":r.uniforms[t].value=(new p).fromArray(i.value);break;case"v3":r.uniforms[t].value=(new V).fromArray(i.value);break;case"v4":r.uniforms[t].value=(new N).fromArray(i.value);break;case"m3":r.uniforms[t].value=(new f).fromArray(i.value);break;case"m4":r.uniforms[t].value=(new be).fromArray(i.value);break;default:r.uniforms[t].value=i.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(const t in e.extensions)r.extensions[t]=e.extensions[t];if(void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),r.normalScale=(new p).fromArray(t)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.specularIntensityMap&&(r.specularIntensityMap=n(e.specularIntensityMap)),void 0!==e.specularColorMap&&(r.specularColorMap=n(e.specularColorMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new p).fromArray(e.clearcoatNormalScale)),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),void 0!==e.thicknessMap&&(r.thicknessMap=n(e.thicknessMap)),void 0!==e.sheenColorMap&&(r.sheenColorMap=n(e.sheenColorMap)),void 0!==e.sheenRoughnessMap&&(r.sheenRoughnessMap=n(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}}class Tl{static decodeText(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return-1===t?"./":e.slice(0,t+1)}static resolveURL(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class El extends At{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}clone(){return(new this.constructor).copy(this)}toJSON(){const e=super.toJSON(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}El.prototype.isInstancedBufferGeometry=!0;class Al extends Ka{constructor(e){super(e)}load(e,t,n,r){const i=this,s=new el(i.manager);s.setPath(i.path),s.setRequestHeader(i.requestHeader),s.setWithCredentials(i.withCredentials),s.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e){const t={},n={};function r(e,r){if(void 0!==t[r])return t[r];const i=e.interleavedBuffers[r],s=function(e,t){if(void 0!==n[t])return n[t];const r=e.arrayBuffers[t],i=new Uint32Array(r).buffer;return n[t]=i,i}(e,i.buffer),o=v(i.type,s),a=new qi(o,i.stride);return a.uuid=i.uuid,t[r]=a,a}const i=e.isInstancedBufferGeometry?new El:new At,s=e.data.index;if(void 0!==s){const e=v(s.type,s.array);i.setIndex(new ct(e,1))}const o=e.data.attributes;for(const t in o){const n=o[t];let s;if(n.isInterleavedBufferAttribute){const t=r(e.data,n.data);s=new Zi(t,n.itemSize,n.offset,n.normalized)}else{const e=v(n.type,n.array);s=new(n.isInstancedBufferAttribute?Es:ct)(e,n.itemSize,n.normalized)}void 0!==n.name&&(s.name=n.name),void 0!==n.usage&&s.setUsage(n.usage),void 0!==n.updateRange&&(s.updateRange.offset=n.updateRange.offset,s.updateRange.count=n.updateRange.count),i.setAttribute(t,s)}const a=e.data.morphAttributes;if(a)for(const t in a){const n=a[t],s=[];for(let t=0,i=n.length;t<i;t++){const i=n[t];let o;if(i.isInterleavedBufferAttribute){const t=r(e.data,i.data);o=new Zi(t,i.itemSize,i.offset,i.normalized)}else{const e=v(i.type,i.array);o=new ct(e,i.itemSize,i.normalized)}void 0!==i.name&&(o.name=i.name),s.push(o)}i.morphAttributes[t]=s}e.data.morphTargetsRelative&&(i.morphTargetsRelative=!0);const l=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==l)for(let e=0,t=l.length;e!==t;++e){const t=l[e];i.addGroup(t.start,t.count,t.materialIndex)}const c=e.data.boundingSphere;if(void 0!==c){const e=new V;void 0!==c.center&&e.fromArray(c.center),i.boundingSphere=new de(e,c.radius)}return e.name&&(i.name=e.name),e.userData&&(i.userData=e.userData),i}}const Cl={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,CubeUVReflectionMapping:306},Pl={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},Rl={NearestFilter:1003,NearestMipmapNearestFilter:1004,NearestMipmapLinearFilter:1005,LinearFilter:1006,LinearMipmapNearestFilter:1007,LinearMipmapLinearFilter:1008};class Ll extends Ka{constructor(e){super(e),"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,s=Za.get(e);if(void 0!==s)return i.manager.itemStart(e),setTimeout((function(){t&&t(s),i.manager.itemEnd(e)}),0),s;const o={};o.credentials="anonymous"===this.crossOrigin?"same-origin":"include",o.headers=this.requestHeader,fetch(e,o).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,Object.assign(i.options,{colorSpaceConversion:"none"}))})).then((function(n){Za.add(e,n),t&&t(n),i.manager.itemEnd(e)})).catch((function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)})),i.manager.itemStart(e)}}let Il;Ll.prototype.isImageBitmapLoader=!0;const Dl={getContext:function(){return void 0===Il&&(Il=new(window.AudioContext||window.webkitAudioContext)),Il},setContext:function(e){Il=e}};class Ol extends Ka{constructor(e){super(e)}load(e,t,n,r){const i=this,s=new el(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(n){try{const e=n.slice(0);Dl.getContext().decodeAudioData(e,(function(e){t(e)}))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}}class Bl extends Ml{constructor(e,t,n=1){super(void 0,n);const r=(new P).set(e),i=(new P).set(t),s=new V(r.r,r.g,r.b),o=new V(i.r,i.g,i.b),a=Math.sqrt(Math.PI),l=a*Math.sqrt(.75);this.sh.coefficients[0].copy(s).add(o).multiplyScalar(a),this.sh.coefficients[1].copy(s).sub(o).multiplyScalar(l)}}Bl.prototype.isHemisphereLightProbe=!0;class Nl extends Ml{constructor(e,t=1){super(void 0,t);const n=(new P).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}}Nl.prototype.isAmbientLightProbe=!0;const zl=new be,Ul=new be,kl=new be;class Fl{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Hl(),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 e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Hl();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Hl(){return("undefined"==typeof performance?Date:performance).now()}const Gl=new V,jl=new j,Vl=new V,Wl=new V;class Xl extends Xe{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(e){return e||(e=[]),!0===this._connected?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}}const ql=new V,Yl=new j,Zl=new V,Jl=new V;class Ql{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class Kl{constructor(e,t,n){let r,i,s;switch(this.binding=e,this.valueSize=n,t){case"quaternion":r=this._slerp,i=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":r=this._select,i=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:r=this._lerp,i=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=i,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,r=this.valueSize,i=e*r+r;let s=this.cumulativeWeight;if(0===s){for(let e=0;e!==r;++e)n[i+e]=n[e];s=t}else{s+=t;const e=t/s;this._mixBufferRegion(n,i,0,e,r)}this.cumulativeWeight=s}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,r=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,s=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,i<1){const e=t*this._origIndex;this._mixBufferRegion(n,r,e,1-i,t)}s>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(n[e]!==n[e+t]){o.setValue(n,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let e=n,i=r;e!==i;++e)t[e]=t[r+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,r,i){if(r>=.5)for(let r=0;r!==i;++r)e[t+r]=e[n+r]}_slerp(e,t,n,r){j.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,i){const s=this._workIndex*i;j.multiplyQuaternionsFlat(e,s,e,t,e,n),j.slerpFlat(e,t,e,t,e,s,r)}_lerp(e,t,n,r,i){const s=1-r;for(let o=0;o!==i;++o){const i=t+o;e[i]=e[i]*s+e[n+o]*r}}_lerpAdditive(e,t,n,r,i){for(let s=0;s!==i;++s){const i=t+s;e[i]=e[i]+e[n+s]*r}}}const $l=new RegExp("[\\[\\]\\.:\\/]","g"),ec="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",tc=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),nc=/(WCOD+)?/.source.replace("WCOD",ec),rc=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),ic=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),sc=new RegExp("^"+tc+nc+rc+ic+"$"),oc=["material","materials","bones"];class ac{constructor(e,t,n){this.path=t,this.parsedPath=n||ac.parseTrackName(t),this.node=ac.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new ac.Composite(e,t,n):new ac(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace($l,"")}static parseTrackName(e){const t=sc.exec(e);if(null===t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const e=n.nodeName.substring(r+1);-1!==oc.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(void 0===t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let r=0;r<e.length;r++){const i=e[r];if(i.name===t||i.uuid===t)return i;const s=n(i.children);if(s)return s}return null},r=n(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,r=t.propertyName;let i=t.propertyIndex;if(e||(e=ac.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){let r=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(let t=0;t<e.length;t++)if(e[t].name===r){r=t;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==r){if(void 0===e[r])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[r]}}const s=e[r];if(void 0===s){const n=t.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+r+" but it wasn't found.",e)}let o=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?o=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(o=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[i]&&(i=e.morphTargetDictionary[i])}a=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(a=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(a=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}ac.Composite=class{constructor(e,t,n){const r=n||ac.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}},ac.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},ac.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},ac.prototype.GetterByBindingType=[ac.prototype._getValue_direct,ac.prototype._getValue_array,ac.prototype._getValue_arrayElement,ac.prototype._getValue_toArray],ac.prototype.SetterByBindingTypeAndVersioning=[[ac.prototype._setValue_direct,ac.prototype._setValue_direct_setNeedsUpdate,ac.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[ac.prototype._setValue_array,ac.prototype._setValue_array_setNeedsUpdate,ac.prototype._setValue_array_setMatrixWorldNeedsUpdate],[ac.prototype._setValue_arrayElement,ac.prototype._setValue_arrayElement_setNeedsUpdate,ac.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[ac.prototype._setValue_fromArray,ac.prototype._setValue_fromArray_setNeedsUpdate,ac.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class lc{constructor(){this.uuid=s(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,r=this._parsedPaths,i=this._bindings,s=i.length;let o,a=e.length,l=this.nCachedObjects_;for(let c=0,h=arguments.length;c!==h;++c){const h=arguments[c],u=h.uuid;let d=t[u];if(void 0===d){d=a++,t[u]=d,e.push(h);for(let e=0,t=s;e!==t;++e)i[e].push(new ac(h,n[e],r[e]))}else if(d<l){o=e[d];const a=--l,c=e[a];t[c.uuid]=d,e[d]=c,t[u]=a,e[a]=h;for(let e=0,t=s;e!==t;++e){const t=i[e],s=t[a];let o=t[d];t[d]=s,void 0===o&&(o=new ac(h,n[e],r[e])),t[a]=o}}else e[d]!==o&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=l}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_;for(let s=0,o=arguments.length;s!==o;++s){const o=arguments[s],a=o.uuid,l=t[a];if(void 0!==l&&l>=i){const s=i++,c=e[s];t[c.uuid]=l,e[l]=c,t[a]=s,e[s]=o;for(let e=0,t=r;e!==t;++e){const t=n[e],r=t[s],i=t[l];t[l]=r,t[s]=i}}}this.nCachedObjects_=i}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_,s=e.length;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o].uuid,l=t[a];if(void 0!==l)if(delete t[a],l<i){const o=--i,a=e[o],c=--s,h=e[c];t[a.uuid]=l,e[l]=a,t[h.uuid]=o,e[o]=h,e.pop();for(let e=0,t=r;e!==t;++e){const t=n[e],r=t[o],i=t[c];t[l]=r,t[o]=i,t.pop()}}else{const i=--s,o=e[i];i>0&&(t[o.uuid]=l),e[l]=o,e.pop();for(let e=0,t=r;e!==t;++e){const t=n[e];t[l]=t[i],t.pop()}}}this.nCachedObjects_=i}subscribe_(e,t){const n=this._bindingsIndicesByPath;let r=n[e];const i=this._bindings;if(void 0!==r)return i[r];const s=this._paths,o=this._parsedPaths,a=this._objects,l=a.length,c=this.nCachedObjects_,h=new Array(l);r=i.length,n[e]=r,s.push(e),o.push(t),i.push(h);for(let n=c,r=a.length;n!==r;++n){const r=a[n];h[n]=new ac(r,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){const r=this._paths,i=this._parsedPaths,s=this._bindings,o=s.length-1,a=s[o];t[e[o]]=n,s[n]=a,s.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}}lc.prototype.isAnimationObjectGroup=!0;class cc{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;const i=t.tracks,s=i.length,o=new Array(s),a={endingStart:2400,endingEnd:2400};for(let e=0;e!==s;++e){const t=i[e].createInterpolant(null);o[e]=t,t.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const n=this._clip.duration,r=e._clip.duration,i=r/n,s=n/r;e.warp(1,i,t),this.warp(s,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const r=this._mixer,i=r.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=i,a[1]=i+n,l[0]=e/s,l[1]=t/s,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled)return void this._updateWeight(e);const i=this._startTime;if(null!==i){const r=(e-i)*n;if(r<0||0===n)return;this._startTime=null,t=n*r}t*=this._updateTimeScale(e);const s=this._updateTime(t),o=this._updateWeight(e);if(o>0){const e=this._interpolants,t=this._propertyBindings;switch(this.blendMode){case 2501:for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(s),t[n].accumulateAdditive(o);break;case 2500:default:for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(s),t[n].accumulate(r,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(null!==n){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;null!==n&&(t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t))}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let r=this.time+e,i=this._loopCount;const s=2202===n;if(0===e)return-1===i?r:s&&1==(1&i)?t-r:r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),r>=t||r<0){const n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);const o=this.repetitions-i;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===o){const t=e<0;this._setEndings(t,!t,s)}else this._setEndings(!1,!1,s);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=r;if(s&&1==(1&i))return t-r}return r}_setEndings(e,t,n){const r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(e,t,n){const r=this._mixer,i=r.time;let s=this._weightInterpolant;null===s&&(s=r._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=i,a[0]=t,o[1]=i+e,a[1]=n,this}}class hc extends e{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,s=e._propertyBindings,o=e._interpolants,a=n.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let e=0;e!==i;++e){const i=r[e],l=i.name;let h=c[l];if(void 0!==h)++h.referenceCount,s[e]=h;else{if(h=s[e],void 0!==h){null===h._cacheIndex&&(++h.referenceCount,this._addInactiveBinding(h,a,l));continue}const r=t&&t._propertyBindings[e].binding.parsedPath;h=new Kl(ac.create(n,l,r),i.ValueTypeName,i.getValueSize()),++h.referenceCount,this._addInactiveBinding(h,a,l),s[e]=h}o[e].resultBuffer=h.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return null!==t&&t<this._nActiveActions}_addInactiveAction(e,t,n){const r=this._actions,i=this._actionsByClip;let s=i[t];if(void 0===s)s={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=s;else{const t=s.knownActions;e._byClipCacheIndex=t.length,t.push(e)}e._cacheIndex=r.length,r.push(e),s.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;const i=e._clip.uuid,s=this._actionsByClip,o=s[i],a=o.knownActions,l=a[a.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,a[c]=l,a.pop(),e._byClipCacheIndex=null,delete o.actionByRoot[(e._localRoot||this._root).uuid],0===a.length&&delete s[i],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.referenceCount&&this._removeInactiveBinding(n)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_addInactiveBinding(e,t,n){const r=this._bindingsByRootAndName,i=this._bindings;let s=r[t];void 0===s&&(s={},r[t]=s),s[n]=e,e._cacheIndex=i.length,i.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,s=this._bindingsByRootAndName,o=s[r],a=t[t.length-1],l=e._cacheIndex;a._cacheIndex=l,t[l]=a,t.pop(),delete o[i],0===Object.keys(o).length&&delete s[r]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return void 0===n&&(n=new za(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i}clipAction(e,t,n){const r=t||this._root,i=r.uuid;let s="string"==typeof e?qa.findByName(r,e):e;const o=null!==s?s.uuid:e,a=this._actionsByClip[o];let l=null;if(void 0===n&&(n=null!==s?s.blendMode:2500),void 0!==a){const e=a.actionByRoot[i];if(void 0!==e&&e.blendMode===n)return e;l=a.knownActions[0],null===s&&(s=l._clip)}if(null===s)return null;const c=new cc(this,s,t,n);return this._bindAction(c,l),this._addInactiveAction(c,o,i),c}existingAction(e,t){const n=t||this._root,r=n.uuid,i="string"==typeof e?qa.findByName(n,e):e,s=i?i.uuid:e,o=this._actionsByClip[s];return void 0!==o&&o.actionByRoot[r]||null}stopAllAction(){const e=this._actions;for(let t=this._nActiveActions-1;t>=0;--t)e[t].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),s=this._accuIndex^=1;for(let o=0;o!==n;++o)t[o]._update(r,e,i,s);const o=this._bindings,a=this._nActiveBindings;for(let e=0;e!==a;++e)o[e].apply(s);return this}setTime(e){this.time=0;for(let e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){const e=i.knownActions;for(let n=0,r=e.length;n!==r;++n){const r=e[n];this._deactivateAction(r);const i=r._cacheIndex,s=t[t.length-1];r._cacheIndex=null,r._byClipCacheIndex=null,s._cacheIndex=i,t[i]=s,t.pop(),this._removeInactiveBindingsForAction(r)}delete r[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const e in n){const r=n[e].actionByRoot[t];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}const r=this._bindingsByRootAndName[t];if(void 0!==r)for(const e in r){const t=r[e];t.restoreOriginalState(),this._removeInactiveBinding(t)}}uncacheAction(e,t){const n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}hc.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class uc{constructor(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}clone(){return new uc(void 0===this.value.clone?this.value:this.value.clone())}}class dc extends qi{constructor(e,t,n=1){super(e,t),this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}dc.prototype.isInstancedInterleavedBuffer=!0;class pc{constructor(e,t,n,r,i){this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=r,this.count=i,this.version=0}set needsUpdate(e){!0===e&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}pc.prototype.isGLBufferAttribute=!0;class fc{constructor(e,t,n=0,r=1/0){this.ray=new we(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new Ie,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}intersectObject(e,t=!0,n=[]){return gc(e,this,n,t),n.sort(mc),n}intersectObjects(e,t=!0,n=[]){for(let r=0,i=e.length;r<i;r++)gc(e[r],this,n,t);return n.sort(mc),n}}function mc(e,t){return e.distance-t.distance}function gc(e,t,n,r){if(e.layers.test(t.layers)&&e.raycast(t,n),!0===r){const r=e.children;for(let e=0,i=r.length;e<i;e++)gc(r[e],t,n,!0)}}const vc=new p;class yc{constructor(e=new p(1/0,1/0),t=new p(-1/0,-1/0)){this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=vc.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return vc.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}yc.prototype.isBox2=!0;const xc=new V,wc=new V;class bc{constructor(e=new V,t=new V){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){xc.subVectors(e,this.start),wc.subVectors(this.end,this.start);const n=wc.dot(wc);let r=wc.dot(xc)/n;return t&&(r=o(r,0,1)),r}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}const _c=new V;class Mc extends Xe{constructor(e,t){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;const n=new At,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let e=0,t=1,n=32;e<n;e++,t++){const i=e/n*Math.PI*2,s=t/n*Math.PI*2;r.push(Math.cos(i),Math.sin(i),1,Math.cos(s),Math.sin(s),1)}n.setAttribute("position",new yt(r,3));const i=new Is({fog:!1,toneMapped:!1});this.cone=new Hs(n,i),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),_c.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(_c),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Sc=new V,Tc=new be,Ec=new be;class Ac extends Hs{constructor(e){const t=Cc(e),n=new At,r=[],i=[],s=new P(0,0,1),o=new P(0,1,0);for(let e=0;e<t.length;e++){const n=t[e];n.parent&&n.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(s.r,s.g,s.b),i.push(o.r,o.g,o.b))}n.setAttribute("position",new yt(r,3)),n.setAttribute("color",new yt(i,3)),super(n,new Is({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,r=n.getAttribute("position");Ec.copy(this.root.matrixWorld).invert();for(let e=0,n=0;e<t.length;e++){const i=t[e];i.parent&&i.parent.isBone&&(Tc.multiplyMatrices(Ec,i.matrixWorld),Sc.setFromMatrixPosition(Tc),r.setXYZ(n,Sc.x,Sc.y,Sc.z),Tc.multiplyMatrices(Ec,i.parent.matrixWorld),Sc.setFromMatrixPosition(Tc),r.setXYZ(n+1,Sc.x,Sc.y,Sc.z),n+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}}function Cc(e){const t=[];!0===e.isBone&&t.push(e);for(let n=0;n<e.children.length;n++)t.push.apply(t,Cc(e.children[n]));return t}class Pc extends Wt{constructor(e,t,n){super(new ma(t,4,2),new ot({wireframe:!0,fog:!1,toneMapped:!1})),this.light=e,this.light.updateMatrixWorld(),this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const Rc=new V,Lc=new P,Ic=new P;class Dc extends Xe{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;const r=new da(t);r.rotateY(.5*Math.PI),this.material=new ot({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const i=r.getAttribute("position"),s=new Float32Array(3*i.count);r.setAttribute("color",new ct(s,3)),this.add(new Wt(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");Lc.copy(this.light.color),Ic.copy(this.light.groundColor);for(let e=0,n=t.count;e<n;e++){const r=e<n/2?Lc:Ic;t.setXYZ(e,r.r,r.g,r.b)}t.needsUpdate=!0}e.lookAt(Rc.setFromMatrixPosition(this.light.matrixWorld).negate())}}class Oc extends Hs{constructor(e=10,t=10,n=4473924,r=8947848){n=new P(n),r=new P(r);const i=t/2,s=e/t,o=e/2,a=[],l=[];for(let e=0,c=0,h=-o;e<=t;e++,h+=s){a.push(-o,0,h,o,0,h),a.push(h,0,-o,h,0,o);const t=e===i?n:r;t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3}const c=new At;c.setAttribute("position",new yt(a,3)),c.setAttribute("color",new yt(l,3)),super(c,new Is({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}const Bc=new V,Nc=new V,zc=new V;class Uc extends Xe{constructor(e,t,n){super(),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);let r=new At;r.setAttribute("position",new yt([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const i=new Is({fog:!1,toneMapped:!1});this.lightPlane=new Us(r,i),this.add(this.lightPlane),r=new At,r.setAttribute("position",new yt([0,0,0,0,0,1],3)),this.targetLine=new Us(r,i),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){Bc.setFromMatrixPosition(this.light.matrixWorld),Nc.setFromMatrixPosition(this.light.target.matrixWorld),zc.subVectors(Nc,Bc),this.lightPlane.lookAt(Nc),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Nc),this.targetLine.scale.z=zc.length()}}const kc=new V,Fc=new Kt;function Hc(e,t,n,r,i,s,o){kc.set(i,s,o).unproject(r);const a=t[e];if(void 0!==a){const e=n.getAttribute("position");for(let t=0,n=a.length;t<n;t++)e.setXYZ(a[t],kc.x,kc.y,kc.z)}}const Gc=new q;class jc extends Hs{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new At;i.setIndex(new ct(n,1)),i.setAttribute("position",new ct(r,3)),super(i,new Is({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Gc.setFromObject(this.object),Gc.isEmpty())return;const t=Gc.min,n=Gc.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e){return Hs.prototype.copy.call(this,e),this.object=e.object,this}}class Vc extends Hs{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new At;r.setIndex(new ct(n,1)),r.setAttribute("position",new yt([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(r,new Is({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}}const Wc=new V;let Xc,qc;class Yc extends Hs{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new At;n.setAttribute("position",new yt(t,3)),n.setAttribute("color",new yt([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),super(n,new Is({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(e,t,n){const r=new P,i=this.geometry.attributes.color.array;return r.set(e),r.toArray(i,0),r.toArray(i,3),r.set(t),r.toArray(i,6),r.toArray(i,9),r.set(n),r.toArray(i,12),r.toArray(i,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Zc{static toHalfFloat(e){Math.abs(e)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),e=o(e,-65504,65504),Qc[0]=e;const t=Kc[0],n=t>>23&511;return $c[n]+((8388607&t)>>eh[n])}static fromHalfFloat(e){const t=e>>10;return Kc[0]=th[rh[t]+(1023&e)]+nh[t],Qc[0]}}const Jc=new ArrayBuffer(4),Qc=new Float32Array(Jc),Kc=new Uint32Array(Jc),$c=new Uint32Array(512),eh=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?($c[e]=0,$c[256|e]=32768,eh[e]=24,eh[256|e]=24):t<-14?($c[e]=1024>>-t-14,$c[256|e]=1024>>-t-14|32768,eh[e]=-t-1,eh[256|e]=-t-1):t<=15?($c[e]=t+15<<10,$c[256|e]=t+15<<10|32768,eh[e]=13,eh[256|e]=13):t<128?($c[e]=31744,$c[256|e]=64512,eh[e]=24,eh[256|e]=24):($c[e]=31744,$c[256|e]=64512,eh[e]=13,eh[256|e]=13)}const th=new Uint32Array(2048),nh=new Uint32Array(64),rh=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;0==(8388608&t);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,th[e]=t|n}for(let e=1024;e<2048;++e)th[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)nh[e]=e<<23;nh[31]=1199570944,nh[32]=2147483648;for(let e=33;e<63;++e)nh[e]=2147483648+(e-32<<23);nh[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(rh[e]=1024);eo.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(eo.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},_o.prototype.fromPoints=function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)},Oc.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Ac.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Ka.prototype.extractUrlBase=function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Tl.extractUrlBase(e)},Ka.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},yc.prototype.center=function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},yc.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},yc.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},yc.prototype.size=function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)},q.prototype.center=function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},q.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},q.prototype.isIntersectionBox=function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},q.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},q.prototype.size=function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)},Le.prototype.toVector3=function(){console.error("THREE.Euler: .toVector3() has been removed. Use Vector3.setFromEuler() instead")},de.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},hn.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},bc.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},f.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},f.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},f.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},f.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},f.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},f.prototype.getInverse=function(e){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},be.prototype.extractPosition=function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},be.prototype.flattenToArrayOffset=function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},be.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new V).setFromMatrixColumn(this,3)},be.prototype.setRotationFromQuaternion=function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},be.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},be.prototype.multiplyVector3=function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},be.prototype.multiplyVector4=function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},be.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},be.prototype.rotateAxis=function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},be.prototype.crossVector=function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},be.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},be.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},be.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},be.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},be.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},be.prototype.applyToBufferAttribute=function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},be.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},be.prototype.makeFrustum=function(e,t,n,r,i,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,s)},be.prototype.getInverse=function(e){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()},an.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},j.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},j.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},we.prototype.isIntersectionBox=function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},we.prototype.isIntersectionPlane=function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},we.prototype.isIntersectionSphere=function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},rt.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},rt.prototype.barycoordFromPoint=function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},rt.prototype.midpoint=function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},rt.prototypenormal=function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},rt.prototype.plane=function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)},rt.barycoordFromPoint=function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),rt.getBarycoord(e,t,n,r,i)},rt.normal=function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),rt.getNormal(e,t,n,r)},Bo.prototype.extractAllPoints=function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},Bo.prototype.extrude=function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new ca(this,e)},Bo.prototype.makeGeometry=function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new fa(this,e)},p.prototype.fromAttribute=function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},p.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},p.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},V.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},V.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},V.prototype.getPositionFromMatrix=function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},V.prototype.getScaleFromMatrix=function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},V.prototype.getColumnFromMatrix=function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},V.prototype.applyProjection=function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},V.prototype.fromAttribute=function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},V.prototype.distanceToManhattan=function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},V.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},N.prototype.fromAttribute=function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},N.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},Xe.prototype.getChildByName=function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},Xe.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},Xe.prototype.translate=function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},Xe.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},Xe.prototype.applyMatrix=function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(Xe.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Wt.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")},Object.defineProperties(Wt.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),ws.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},$t.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(sl.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(ct.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),35048===this.usage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),ct.prototype.setDynamic=function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},ct.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},ct.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},At.prototype.addIndex=function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},At.prototype.addAttribute=function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new ct(arguments[1],arguments[2])))},At.prototype.addDrawCall=function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},At.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},At.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},At.prototype.removeAttribute=function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},At.prototype.applyMatrix=function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)},Object.defineProperties(At.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),qi.prototype.setDynamic=function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},qi.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},ca.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},ca.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},ca.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},Xi.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},uc.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(st.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new P}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}},vertexTangents:{get:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")},set:function(){console.warn("THREE."+this.type+": .vertexTangents has been removed.")}}}),Object.defineProperties(Qt.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Gi.prototype.clearTarget=function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},Gi.prototype.animate=function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},Gi.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},Gi.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},Gi.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},Gi.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},Gi.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},Gi.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},Gi.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},Gi.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},Gi.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},Gi.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},Gi.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},Gi.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},Gi.prototype.enableScissorTest=function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},Gi.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},Gi.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},Gi.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},Gi.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},Gi.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},Gi.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},Gi.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},Gi.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},Gi.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},Gi.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(Gi.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?3001:3e3}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}},gammaFactor:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaFactor has been removed."),2},set:function(){console.warn("THREE.WebGLRenderer: .gammaFactor has been removed.")}}}),Object.defineProperties(Li.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(z.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Xl.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const t=this;return(new Ol).load(e,(function(e){t.setBuffer(e)})),this},Ql.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},en.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},en.prototype.clear=function(e,t,n,r){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(e,t,n,r)},L.crossOrigin=void 0,L.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const i=new il;i.setCrossOrigin(this.crossOrigin);const s=i.load(e,n,void 0,r);return t&&(s.mapping=t),s},L.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const i=new nl;i.setCrossOrigin(this.crossOrigin);const s=i.load(e,n,void 0,r);return t&&(s.mapping=t),s},L.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},L.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};const ih={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"139"}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="139");var sh=Object.freeze({__proto__:null,ACESFilmicToneMapping:4,AddEquation:100,AddOperation:2,AdditiveAnimationBlendMode:2501,AdditiveBlending:2,AlphaFormat:1021,AlwaysDepth:1,AlwaysStencilFunc:519,AmbientLight:wl,AmbientLightProbe:Nl,AnimationClip:qa,AnimationLoader:class extends Ka{constructor(e){super(e)}load(e,t,n,r){const i=this,s=new el(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e){const t=[];for(let n=0;n<e.length;n++){const r=qa.parse(e[n]);t.push(r)}return t}},AnimationMixer:hc,AnimationObjectGroup:lc,AnimationUtils:Oa,ArcCurve:no,ArrayCamera:Bi,ArrowHelper:class extends Xe{constructor(e=new V(0,0,1),t=new V(0,0,0),n=1,r=16776960,i=.2*n,s=.2*i){super(),this.type="ArrowHelper",void 0===Xc&&(Xc=new At,Xc.setAttribute("position",new yt([0,0,0,0,1,0],3)),qc=new Eo(0,.5,1,5,1),qc.translate(0,-.5,0)),this.position.copy(t),this.line=new Us(Xc,new Is({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Wt(qc,new ot({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,s)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Wc.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Wc,t)}}setLength(e,t=.2*e,n=.2*t){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}},Audio:Xl,AudioAnalyser:Ql,AudioContext:Dl,AudioListener:class extends Xe{constructor(){super(),this.type="AudioListener",this.context=Dl.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Fl}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Gl,jl,Vl),Wl.set(0,0,-1).applyQuaternion(jl),t.positionX){const e=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Gl.x,e),t.positionY.linearRampToValueAtTime(Gl.y,e),t.positionZ.linearRampToValueAtTime(Gl.z,e),t.forwardX.linearRampToValueAtTime(Wl.x,e),t.forwardY.linearRampToValueAtTime(Wl.y,e),t.forwardZ.linearRampToValueAtTime(Wl.z,e),t.upX.linearRampToValueAtTime(n.x,e),t.upY.linearRampToValueAtTime(n.y,e),t.upZ.linearRampToValueAtTime(n.z,e)}else t.setPosition(Gl.x,Gl.y,Gl.z),t.setOrientation(Wl.x,Wl.y,Wl.z,n.x,n.y,n.z)}},AudioLoader:Ol,AxesHelper:Yc,AxisHelper:class extends Yc{constructor(e){console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),super(e)}},BackSide:1,BasicDepthPacking:3200,BasicShadowMap:0,BinaryTextureLoader:class extends rl{constructor(e){console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),super(e)}},Bone:bs,BooleanKeyframeTrack:Fa,BoundingBoxHelper:class extends jc{constructor(e,t){console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),super(e,t)}},Box2:yc,Box3:q,Box3Helper:Vc,BoxBufferGeometry:qt,BoxGeometry:qt,BoxHelper:jc,BufferAttribute:ct,BufferGeometry:At,BufferGeometryLoader:Al,ByteType:1010,Cache:Za,Camera:Kt,CameraHelper:class extends Hs{constructor(e){const t=new At,n=new Is({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],i=[],s={},o=new P(16755200),a=new P(16711680),l=new P(43775),c=new P(16777215),h=new P(3355443);function u(e,t,n){d(e,n),d(t,n)}function d(e,t){r.push(0,0,0),i.push(t.r,t.g,t.b),void 0===s[e]&&(s[e]=[]),s[e].push(r.length/3-1)}u("n1","n2",o),u("n2","n4",o),u("n4","n3",o),u("n3","n1",o),u("f1","f2",o),u("f2","f4",o),u("f4","f3",o),u("f3","f1",o),u("n1","f1",o),u("n2","f2",o),u("n3","f3",o),u("n4","f4",o),u("p","n1",a),u("p","n2",a),u("p","n3",a),u("p","n4",a),u("u1","u2",l),u("u2","u3",l),u("u3","u1",l),u("c","t",c),u("p","c",h),u("cn1","cn2",h),u("cn3","cn4",h),u("cf1","cf2",h),u("cf3","cf4",h),t.setAttribute("position",new yt(r,3)),t.setAttribute("color",new yt(i,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}update(){const e=this.geometry,t=this.pointMap;Fc.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Hc("c",t,e,Fc,0,0,-1),Hc("t",t,e,Fc,0,0,1),Hc("n1",t,e,Fc,-1,-1,-1),Hc("n2",t,e,Fc,1,-1,-1),Hc("n3",t,e,Fc,-1,1,-1),Hc("n4",t,e,Fc,1,1,-1),Hc("f1",t,e,Fc,-1,-1,1),Hc("f2",t,e,Fc,1,-1,1),Hc("f3",t,e,Fc,-1,1,1),Hc("f4",t,e,Fc,1,1,1),Hc("u1",t,e,Fc,.7,1.1,-1),Hc("u2",t,e,Fc,-.7,1.1,-1),Hc("u3",t,e,Fc,0,2,-1),Hc("cf1",t,e,Fc,-1,0,1),Hc("cf2",t,e,Fc,1,0,1),Hc("cf3",t,e,Fc,0,-1,1),Hc("cf4",t,e,Fc,0,1,1),Hc("cn1",t,e,Fc,-1,0,-1),Hc("cn2",t,e,Fc,1,0,-1),Hc("cn3",t,e,Fc,0,-1,-1),Hc("cn4",t,e,Fc,0,1,-1),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}},CanvasRenderer:function(){console.error("THREE.CanvasRenderer has been removed")},CanvasTexture:$s,CapsuleBufferGeometry:So,CapsuleGeometry:So,CatmullRomCurve3:lo,CineonToneMapping:3,CircleBufferGeometry:To,CircleGeometry:To,ClampToEdgeWrapping:1001,Clock:Fl,Color:P,ColorKeyframeTrack:Ha,ColorManagement:_,CompressedTexture:Ks,CompressedTextureLoader:class extends Ka{constructor(e){super(e)}load(e,t,n,r){const i=this,s=[],o=new Ks,a=new el(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(i.withCredentials);let l=0;function c(c){a.load(e[c],(function(e){const n=i.parse(e,!0);s[c]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},l+=1,6===l&&(1===n.mipmapCount&&(o.minFilter=1006),o.image=s,o.format=n.format,o.needsUpdate=!0,t&&t(o))}),n,r)}if(Array.isArray(e))for(let t=0,n=e.length;t<n;++t)c(t);else a.load(e,(function(e){const n=i.parse(e,!0);if(n.isCubemap){const e=n.mipmaps.length/n.mipmapCount;for(let t=0;t<e;t++){s[t]={mipmaps:[]};for(let e=0;e<n.mipmapCount;e++)s[t].mipmaps.push(n.mipmaps[t*n.mipmapCount+e]),s[t].format=n.format,s[t].width=n.width,s[t].height=n.height}o.image=s}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;1===n.mipmapCount&&(o.minFilter=1006),o.format=n.format,o.needsUpdate=!0,t&&t(o)}),n,r);return o}},ConeBufferGeometry:Ao,ConeGeometry:Ao,CubeCamera:en,CubeReflectionMapping:301,CubeRefractionMapping:302,CubeTexture:tn,CubeTextureLoader:nl,CubeUVReflectionMapping:306,CubicBezierCurve:po,CubicBezierCurve3:fo,CubicInterpolant:Na,CullFaceBack:1,CullFaceFront:2,CullFaceFrontBack:3,CullFaceNone:0,Curve:eo,CurvePath:bo,CustomBlending:5,CustomToneMapping:5,CylinderBufferGeometry:Eo,CylinderGeometry:Eo,Cylindrical:class{constructor(e=1,t=0,n=0){return this.radius=e,this.theta=t,this.y=n,this}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return(new this.constructor).copy(this)}},Data3DTexture:F,DataArrayTexture:U,DataTexture:_s,DataTexture2DArray:class extends U{constructor(e,t,n,r){console.warn("THREE.DataTexture2DArray has been renamed to DataArrayTexture."),super(e,t,n,r)}},DataTexture3D:class extends F{constructor(e,t,n,r){console.warn("THREE.DataTexture3D has been renamed to Data3DTexture."),super(e,t,n,r)}},DataTextureLoader:rl,DataUtils:Zc,DecrementStencilOp:7683,DecrementWrapStencilOp:34056,DefaultLoadingManager:Qa,DepthFormat:1026,DepthStencilFormat:1027,DepthTexture:ki,DirectionalLight:xl,DirectionalLightHelper:Uc,DiscreteInterpolant:Ua,DodecahedronBufferGeometry:Po,DodecahedronGeometry:Po,DoubleSide:2,DstAlphaFactor:206,DstColorFactor:208,DynamicBufferAttribute:class extends ct{constructor(e,t){console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),super(e,t),this.setUsage(35048)}},DynamicCopyUsage:35050,DynamicDrawUsage:35048,DynamicReadUsage:35049,EdgesGeometry:Oo,EdgesHelper:class extends Hs{constructor(e,t){console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),super(new Oo(e.geometry),new Is({color:void 0!==t?t:16777215}))}},EllipseCurve:to,EqualDepth:4,EqualStencilFunc:514,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,Euler:Le,EventDispatcher:e,ExtrudeBufferGeometry:ca,ExtrudeGeometry:ca,FaceColors:1,FileLoader:el,FlatShading:1,Float16BufferAttribute:vt,Float32Attribute:class extends yt{constructor(e,t){console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),super(e,t)}},Float32BufferAttribute:yt,Float64Attribute:class extends xt{constructor(e,t){console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),super(e,t)}},Float64BufferAttribute:xt,FloatType:1015,Fog:Wi,FogExp2:Vi,Font:function(){console.error("THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js")},FontLoader:function(){console.error("THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js")},FramebufferTexture:Qs,FrontSide:0,Frustum:hn,GLBufferAttribute:pc,GLSL1:"100",GLSL3:"300 es",GreaterDepth:6,GreaterEqualDepth:5,GreaterEqualStencilFunc:518,GreaterStencilFunc:516,GridHelper:Oc,Group:Ni,HalfFloatType:1016,HemisphereLight:ol,HemisphereLightHelper:Dc,HemisphereLightProbe:Bl,IcosahedronBufferGeometry:ua,IcosahedronGeometry:ua,ImageBitmapLoader:Ll,ImageLoader:tl,ImageUtils:L,ImmediateRenderObject:function(){console.error("THREE.ImmediateRenderObject has been removed.")},IncrementStencilOp:7682,IncrementWrapStencilOp:34055,InstancedBufferAttribute:Es,InstancedBufferGeometry:El,InstancedInterleavedBuffer:dc,InstancedMesh:Ls,Int16Attribute:class extends pt{constructor(e,t){console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),super(e,t)}},Int16BufferAttribute:pt,Int32Attribute:class extends mt{constructor(e,t){console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),super(e,t)}},Int32BufferAttribute:mt,Int8Attribute:class extends ht{constructor(e,t){console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),super(e,t)}},Int8BufferAttribute:ht,IntType:1013,InterleavedBuffer:qi,InterleavedBufferAttribute:Zi,Interpolant:Ba,InterpolateDiscrete:2300,InterpolateLinear:2301,InterpolateSmooth:2302,InvertStencilOp:5386,JSONLoader:function(){console.error("THREE.JSONLoader has been removed.")},KeepStencilOp:7680,KeyframeTrack:ka,LOD:fs,LatheBufferGeometry:Mo,LatheGeometry:Mo,Layers:Ie,LensFlare:function(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")},LessDepth:2,LessEqualDepth:3,LessEqualStencilFunc:515,LessStencilFunc:513,Light:sl,LightProbe:Ml,Line:Us,Line3:bc,LineBasicMaterial:Is,LineCurve:mo,LineCurve3:go,LineDashedMaterial:Ia,LineLoop:Gs,LinePieces:1,LineSegments:Hs,LineStrip:0,LinearEncoding:3e3,LinearFilter:1006,LinearInterpolant:za,LinearMipMapLinearFilter:1008,LinearMipMapNearestFilter:1007,LinearMipmapLinearFilter:1008,LinearMipmapNearestFilter:1007,LinearSRGBColorSpace:"srgb-linear",LinearToneMapping:1,Loader:Ka,LoaderUtils:Tl,LoadingManager:Ja,LoopOnce:2200,LoopPingPong:2202,LoopRepeat:2201,LuminanceAlphaFormat:1025,LuminanceFormat:1024,MOUSE:{LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Material:st,MaterialLoader:Sl,Math:d,MathUtils:d,Matrix3:f,Matrix4:be,MaxEquation:104,Mesh:Wt,MeshBasicMaterial:ot,MeshDepthMaterial:Pi,MeshDistanceMaterial:Ri,MeshFaceMaterial:function(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e},MeshLambertMaterial:Ra,MeshMatcapMaterial:La,MeshNormalMaterial:Pa,MeshPhongMaterial:Aa,MeshPhysicalMaterial:Ea,MeshStandardMaterial:Ta,MeshToonMaterial:Ca,MinEquation:103,MirroredRepeatWrapping:1002,MixOperation:1,MultiMaterial:function(e=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e},MultiplyBlending:4,MultiplyOperation:0,NearestFilter:1003,NearestMipMapLinearFilter:1005,NearestMipMapNearestFilter:1004,NearestMipmapLinearFilter:1005,NearestMipmapNearestFilter:1004,NeverDepth:0,NeverStencilFunc:512,NoBlending:0,NoColorSpace:"",NoColors:0,NoToneMapping:0,NormalAnimationBlendMode:2500,NormalBlending:1,NotEqualDepth:7,NotEqualStencilFunc:517,NumberKeyframeTrack:Ga,Object3D:Xe,ObjectLoader:class extends Ka{constructor(e){super(e)}load(e,t,n,r){const i=this,s=""===this.path?Tl.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;const o=new el(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){let s=null;try{s=JSON.parse(n)}catch(t){return void 0!==r&&r(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}const o=s.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?i.parse(s,t):console.error("THREE.ObjectLoader: Can't load "+e)}),n,r)}async loadAsync(e,t){const n=""===this.path?Tl.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||n;const r=new el(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials);const i=await r.loadAsync(e,t),s=JSON.parse(i),o=s.metadata;if(void 0===o||void 0===o.type||"geometry"===o.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+e);return await this.parseAsync(s)}parse(e,t){const n=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),i=this.parseGeometries(e.geometries,r),s=this.parseImages(e.images,(function(){void 0!==t&&t(l)})),o=this.parseTextures(e.textures,s),a=this.parseMaterials(e.materials,o),l=this.parseObject(e.object,i,a,o,n),c=this.parseSkeletons(e.skeletons,l);if(this.bindSkeletons(l,c),void 0!==t){let e=!1;for(const t in s)if(s[t]instanceof HTMLImageElement){e=!0;break}!1===e&&t(l)}return l}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,n),i=await this.parseImagesAsync(e.images),s=this.parseTextures(e.textures,i),o=this.parseMaterials(e.materials,s),a=this.parseObject(e.object,r,o,s,t),l=this.parseSkeletons(e.skeletons,a);return this.bindSkeletons(a,l),a}parseShapes(e){const t={};if(void 0!==e)for(let n=0,r=e.length;n<r;n++){const r=(new Bo).fromJSON(e[n]);t[r.uuid]=r}return t}parseSkeletons(e,t){const n={},r={};if(t.traverse((function(e){e.isBone&&(r[e.uuid]=e)})),void 0!==e)for(let t=0,i=e.length;t<i;t++){const i=(new Ts).fromJSON(e[t],r);n[i.uuid]=i}return n}parseGeometries(e,t){const n={};if(void 0!==e){const r=new Al;for(let i=0,s=e.length;i<s;i++){let s;const o=e[i];switch(o.type){case"BufferGeometry":case"InstancedBufferGeometry":s=r.parse(o);break;case"Geometry":console.error("THREE.ObjectLoader: The legacy Geometry type is no longer supported.");break;default:o.type in _a?s=_a[o.type].fromJSON(o,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${o.type}"`)}s.uuid=o.uuid,void 0!==o.name&&(s.name=o.name),!0===s.isBufferGeometry&&void 0!==o.userData&&(s.userData=o.userData),n[o.uuid]=s}}return n}parseMaterials(e,t){const n={},r={};if(void 0!==e){const i=new Sl;i.setTextures(t);for(let t=0,s=e.length;t<s;t++){const s=e[t];if("MultiMaterial"===s.type){const e=[];for(let t=0;t<s.materials.length;t++){const r=s.materials[t];void 0===n[r.uuid]&&(n[r.uuid]=i.parse(r)),e.push(n[r.uuid])}r[s.uuid]=e}else void 0===n[s.uuid]&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r}parseAnimations(e){const t={};if(void 0!==e)for(let n=0;n<e.length;n++){const r=e[n],i=qa.parse(r);t[i.uuid]=i}return t}parseImages(e,t){const n=this,r={};let i;function s(e){if("string"==typeof e){const t=e;return function(e){return n.manager.itemStart(e),i.load(e,(function(){n.manager.itemEnd(e)}),void 0,(function(){n.manager.itemError(e),n.manager.itemEnd(e)}))}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(t)?t:n.resourcePath+t)}return e.data?{data:v(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){const n=new Ja(t);i=new tl(n),i.setCrossOrigin(this.crossOrigin);for(let t=0,n=e.length;t<n;t++){const n=e[t],i=n.url;if(Array.isArray(i)){const e=[];for(let t=0,n=i.length;t<n;t++){const n=s(i[t]);null!==n&&(n instanceof HTMLImageElement?e.push(n):e.push(new _s(n.data,n.width,n.height)))}r[n.uuid]=new I(e)}else{const e=s(n.url);r[n.uuid]=new I(e)}}}return r}async parseImagesAsync(e){const t=this,n={};let r;async function i(e){if("string"==typeof e){const n=e,i=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(n)?n:t.resourcePath+n;return await r.loadAsync(i)}return e.data?{data:v(e.type,e.data),width:e.width,height:e.height}:null}if(void 0!==e&&e.length>0){r=new tl(this.manager),r.setCrossOrigin(this.crossOrigin);for(let t=0,r=e.length;t<r;t++){const r=e[t],s=r.url;if(Array.isArray(s)){const e=[];for(let t=0,n=s.length;t<n;t++){const n=s[t],r=await i(n);null!==r&&(r instanceof HTMLImageElement?e.push(r):e.push(new _s(r.data,r.width,r.height)))}n[r.uuid]=new I(e)}else{const e=await i(r.url);n[r.uuid]=new I(e)}}}return n}parseTextures(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}const r={};if(void 0!==e)for(let i=0,s=e.length;i<s;i++){const s=e[i];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);const o=t[s.image],a=o.data;let l;Array.isArray(a)?(l=new tn,6===a.length&&(l.needsUpdate=!0)):(l=a&&a.data?new _s:new B,a&&(l.needsUpdate=!0)),l.source=o,l.uuid=s.uuid,void 0!==s.name&&(l.name=s.name),void 0!==s.mapping&&(l.mapping=n(s.mapping,Cl)),void 0!==s.offset&&l.offset.fromArray(s.offset),void 0!==s.repeat&&l.repeat.fromArray(s.repeat),void 0!==s.center&&l.center.fromArray(s.center),void 0!==s.rotation&&(l.rotation=s.rotation),void 0!==s.wrap&&(l.wrapS=n(s.wrap[0],Pl),l.wrapT=n(s.wrap[1],Pl)),void 0!==s.format&&(l.format=s.format),void 0!==s.type&&(l.type=s.type),void 0!==s.encoding&&(l.encoding=s.encoding),void 0!==s.minFilter&&(l.minFilter=n(s.minFilter,Rl)),void 0!==s.magFilter&&(l.magFilter=n(s.magFilter,Rl)),void 0!==s.anisotropy&&(l.anisotropy=s.anisotropy),void 0!==s.flipY&&(l.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(l.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(l.unpackAlignment=s.unpackAlignment),void 0!==s.userData&&(l.userData=s.userData),r[s.uuid]=l}return r}parseObject(e,t,n,r,i){let s,o,a;function l(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function c(e){if(void 0!==e){if(Array.isArray(e)){const t=[];for(let r=0,i=e.length;r<i;r++){const i=e[r];void 0===n[i]&&console.warn("THREE.ObjectLoader: Undefined material",i),t.push(n[i])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}function h(e){return void 0===r[e]&&console.warn("THREE.ObjectLoader: Undefined texture",e),r[e]}switch(e.type){case"Scene":s=new Xi,void 0!==e.background&&(Number.isInteger(e.background)?s.background=new P(e.background):s.background=h(e.background)),void 0!==e.environment&&(s.environment=h(e.environment)),void 0!==e.fog&&("Fog"===e.fog.type?s.fog=new Wi(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(s.fog=new Vi(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":s=new $t(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(s.focus=e.focus),void 0!==e.zoom&&(s.zoom=e.zoom),void 0!==e.filmGauge&&(s.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(s.filmOffset=e.filmOffset),void 0!==e.view&&(s.view=Object.assign({},e.view));break;case"OrthographicCamera":s=new Mn(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(s.zoom=e.zoom),void 0!==e.view&&(s.view=Object.assign({},e.view));break;case"AmbientLight":s=new wl(e.color,e.intensity);break;case"DirectionalLight":s=new xl(e.color,e.intensity);break;case"PointLight":s=new vl(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":s=new bl(e.color,e.intensity,e.width,e.height);break;case"SpotLight":s=new dl(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":s=new ol(e.color,e.groundColor,e.intensity);break;case"LightProbe":s=(new Ml).fromJSON(e);break;case"SkinnedMesh":o=l(e.geometry),a=c(e.material),s=new ws(o,a),void 0!==e.bindMode&&(s.bindMode=e.bindMode),void 0!==e.bindMatrix&&s.bindMatrix.fromArray(e.bindMatrix),void 0!==e.skeleton&&(s.skeleton=e.skeleton);break;case"Mesh":o=l(e.geometry),a=c(e.material),s=new Wt(o,a);break;case"InstancedMesh":o=l(e.geometry),a=c(e.material);const t=e.count,n=e.instanceMatrix,r=e.instanceColor;s=new Ls(o,a,t),s.instanceMatrix=new Es(new Float32Array(n.array),16),void 0!==r&&(s.instanceColor=new Es(new Float32Array(r.array),r.itemSize));break;case"LOD":s=new fs;break;case"Line":s=new Us(l(e.geometry),c(e.material));break;case"LineLoop":s=new Gs(l(e.geometry),c(e.material));break;case"LineSegments":s=new Hs(l(e.geometry),c(e.material));break;case"PointCloud":case"Points":s=new Ys(l(e.geometry),c(e.material));break;case"Sprite":s=new hs(c(e.material));break;case"Group":s=new Ni;break;case"Bone":s=new bs;break;default:s=new Xe}if(s.uuid=e.uuid,void 0!==e.name&&(s.name=e.name),void 0!==e.matrix?(s.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(s.matrixAutoUpdate=e.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==e.position&&s.position.fromArray(e.position),void 0!==e.rotation&&s.rotation.fromArray(e.rotation),void 0!==e.quaternion&&s.quaternion.fromArray(e.quaternion),void 0!==e.scale&&s.scale.fromArray(e.scale)),void 0!==e.castShadow&&(s.castShadow=e.castShadow),void 0!==e.receiveShadow&&(s.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(s.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(s.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(s.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&s.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(s.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(s.visible=e.visible),void 0!==e.frustumCulled&&(s.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(s.renderOrder=e.renderOrder),void 0!==e.userData&&(s.userData=e.userData),void 0!==e.layers&&(s.layers.mask=e.layers),void 0!==e.children){const o=e.children;for(let e=0;e<o.length;e++)s.add(this.parseObject(o[e],t,n,r,i))}if(void 0!==e.animations){const t=e.animations;for(let e=0;e<t.length;e++){const n=t[e];s.animations.push(i[n])}}if("LOD"===e.type){void 0!==e.autoUpdate&&(s.autoUpdate=e.autoUpdate);const t=e.levels;for(let e=0;e<t.length;e++){const n=t[e],r=s.getObjectByProperty("uuid",n.object);void 0!==r&&s.addLevel(r,n.distance)}}return s}bindSkeletons(e,t){0!==Object.keys(t).length&&e.traverse((function(e){if(!0===e.isSkinnedMesh&&void 0!==e.skeleton){const n=t[e.skeleton];void 0===n?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",e.skeleton):e.bind(n,e.bindMatrix)}}))}setTexturePath(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}},ObjectSpaceNormalMap:1,OctahedronBufferGeometry:da,OctahedronGeometry:da,OneFactor:201,OneMinusDstAlphaFactor:207,OneMinusDstColorFactor:209,OneMinusSrcAlphaFactor:205,OneMinusSrcColorFactor:203,OrthographicCamera:Mn,PCFShadowMap:1,PCFSoftShadowMap:2,PMREMGenerator:Ln,ParametricGeometry:class extends At{constructor(){console.error("THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js"),super()}},Particle:class extends hs{constructor(e){console.warn("THREE.Particle has been renamed to THREE.Sprite."),super(e)}},ParticleBasicMaterial:class extends js{constructor(e){console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),super(e)}},ParticleSystem:class extends Ys{constructor(e,t){console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),super(e,t)}},ParticleSystemMaterial:class extends js{constructor(e){console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),super(e)}},Path:_o,PerspectiveCamera:$t,Plane:an,PlaneBufferGeometry:pn,PlaneGeometry:pn,PlaneHelper:class extends Us{constructor(e,t=1,n=16776960){const r=n,i=new At;i.setAttribute("position",new yt([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),i.computeBoundingSphere(),super(i,new Is({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const s=new At;s.setAttribute("position",new yt([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),s.computeBoundingSphere(),this.add(new Wt(s,new ot({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){let t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?1:0,this.lookAt(this.plane.normal),super.updateMatrixWorld(e)}},PointCloud:class extends Ys{constructor(e,t){console.warn("THREE.PointCloud has been renamed to THREE.Points."),super(e,t)}},PointCloudMaterial:class extends js{constructor(e){console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),super(e)}},PointLight:vl,PointLightHelper:Pc,Points:Ys,PointsMaterial:js,PolarGridHelper:class extends Hs{constructor(e=10,t=16,n=8,r=64,i=4473924,s=8947848){i=new P(i),s=new P(s);const o=[],a=[];for(let n=0;n<=t;n++){const r=n/t*(2*Math.PI),l=Math.sin(r)*e,c=Math.cos(r)*e;o.push(0,0,0),o.push(l,0,c);const h=1&n?i:s;a.push(h.r,h.g,h.b),a.push(h.r,h.g,h.b)}for(let t=0;t<=n;t++){const l=1&t?i:s,c=e-e/n*t;for(let e=0;e<r;e++){let t=e/r*(2*Math.PI),n=Math.sin(t)*c,i=Math.cos(t)*c;o.push(n,0,i),a.push(l.r,l.g,l.b),t=(e+1)/r*(2*Math.PI),n=Math.sin(t)*c,i=Math.cos(t)*c,o.push(n,0,i),a.push(l.r,l.g,l.b)}}const l=new At;l.setAttribute("position",new yt(o,3)),l.setAttribute("color",new yt(a,3)),super(l,new Is({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}},PolyhedronBufferGeometry:Co,PolyhedronGeometry:Co,PositionalAudio:class extends Xl{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(ql,Yl,Zl),Jl.set(0,0,1).applyQuaternion(Yl);const t=this.panner;if(t.positionX){const e=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(ql.x,e),t.positionY.linearRampToValueAtTime(ql.y,e),t.positionZ.linearRampToValueAtTime(ql.z,e),t.orientationX.linearRampToValueAtTime(Jl.x,e),t.orientationY.linearRampToValueAtTime(Jl.y,e),t.orientationZ.linearRampToValueAtTime(Jl.z,e)}else t.setPosition(ql.x,ql.y,ql.z),t.setOrientation(Jl.x,Jl.y,Jl.z)}},PropertyBinding:ac,PropertyMixer:Kl,QuadraticBezierCurve:vo,QuadraticBezierCurve3:yo,Quaternion:j,QuaternionKeyframeTrack:Va,QuaternionLinearInterpolant:ja,REVISION:"139",RGBADepthPacking:3201,RGBAFormat:1023,RGBAIntegerFormat:1033,RGBA_ASTC_10x10_Format:37819,RGBA_ASTC_10x5_Format:37816,RGBA_ASTC_10x6_Format:37817,RGBA_ASTC_10x8_Format:37818,RGBA_ASTC_12x10_Format:37820,RGBA_ASTC_12x12_Format:37821,RGBA_ASTC_4x4_Format:37808,RGBA_ASTC_5x4_Format:37809,RGBA_ASTC_5x5_Format:37810,RGBA_ASTC_6x5_Format:37811,RGBA_ASTC_6x6_Format:37812,RGBA_ASTC_8x5_Format:37813,RGBA_ASTC_8x6_Format:37814,RGBA_ASTC_8x8_Format:37815,RGBA_BPTC_Format:36492,RGBA_ETC2_EAC_Format:37496,RGBA_PVRTC_2BPPV1_Format:35843,RGBA_PVRTC_4BPPV1_Format:35842,RGBA_S3TC_DXT1_Format:33777,RGBA_S3TC_DXT3_Format:33778,RGBA_S3TC_DXT5_Format:33779,RGBFormat:1022,RGB_ETC1_Format:36196,RGB_ETC2_Format:37492,RGB_PVRTC_2BPPV1_Format:35841,RGB_PVRTC_4BPPV1_Format:35840,RGB_S3TC_DXT1_Format:33776,RGFormat:1030,RGIntegerFormat:1031,RawShaderMaterial:Sa,Ray:we,Raycaster:fc,RectAreaLight:bl,RedFormat:1028,RedIntegerFormat:1029,ReinhardToneMapping:2,RepeatWrapping:1e3,ReplaceStencilOp:7681,ReverseSubtractEquation:102,RingBufferGeometry:pa,RingGeometry:pa,SRGBColorSpace:"srgb",Scene:Xi,SceneUtils:ih,ShaderChunk:fn,ShaderLib:gn,ShaderMaterial:Qt,ShadowMaterial:Ma,Shape:Bo,ShapeBufferGeometry:fa,ShapeGeometry:fa,ShapePath:class{constructor(){this.type="ShapePath",this.color=new P,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new _o,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,i,s){return this.currentPath.bezierCurveTo(e,t,n,r,i,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e,t){function n(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n],i=new Bo;i.curves=r.curves,t.push(i)}return t}function r(e,t){const n=t.length;let r=!1;for(let i=n-1,s=0;s<n;i=s++){let n=t[i],o=t[s],a=o.x-n.x,l=o.y-n.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(n=t[s],a=-a,o=t[i],l=-l),e.y<n.y||e.y>o.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=l*(e.x-n.x)-a*(e.y-n.y);if(0===t)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(o.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=o.x)return!0}}return r}const i=oa.isClockWise,s=this.subPaths;if(0===s.length)return[];if(!0===t)return n(s);let o,a,l;const c=[];if(1===s.length)return a=s[0],l=new Bo,l.curves=a.curves,c.push(l),c;let h=!i(s[0].getPoints());h=e?!h:h;const u=[],d=[];let p,f,m=[],g=0;d[g]=void 0,m[g]=[];for(let t=0,n=s.length;t<n;t++)a=s[t],p=a.getPoints(),o=i(p),o=e?!o:o,o?(!h&&d[g]&&g++,d[g]={s:new Bo,p:p},d[g].s.curves=a.curves,h&&g++,m[g]=[]):m[g].push({h:a,p:p[0]});if(!d[0])return n(s);if(d.length>1){let e=!1,t=0;for(let e=0,t=d.length;e<t;e++)u[e]=[];for(let n=0,i=d.length;n<i;n++){const i=m[n];for(let s=0;s<i.length;s++){const o=i[s];let a=!0;for(let i=0;i<d.length;i++)r(o.p,d[i].p)&&(n!==i&&t++,a?(a=!1,u[i].push(o)):e=!0);a&&u[n].push(o)}}t>0&&!1===e&&(m=u)}for(let e=0,t=d.length;e<t;e++){l=d[e].s,c.push(l),f=m[e];for(let e=0,t=f.length;e<t;e++)l.holes.push(f[e].h)}return c}},ShapeUtils:oa,ShortType:1011,Skeleton:Ts,SkeletonHelper:Ac,SkinnedMesh:ws,SmoothShading:2,Source:I,Sphere:de,SphereBufferGeometry:ma,SphereGeometry:ma,Spherical:class{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){const e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(o(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}},SphericalHarmonics3:_l,SplineCurve:xo,SpotLight:dl,SpotLightHelper:Mc,Sprite:hs,SpriteMaterial:Ji,SrcAlphaFactor:204,SrcAlphaSaturateFactor:210,SrcColorFactor:202,StaticCopyUsage:35046,StaticDrawUsage:35044,StaticReadUsage:35045,StereoCamera:class{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new $t,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new $t,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,kl.copy(e.projectionMatrix);const n=t.eyeSep/2,i=n*t.near/t.focus,s=t.near*Math.tan(r*t.fov*.5)/t.zoom;let o,a;Ul.elements[12]=-n,zl.elements[12]=n,o=-s*t.aspect+i,a=s*t.aspect+i,kl.elements[0]=2*t.near/(a-o),kl.elements[8]=(a+o)/(a-o),this.cameraL.projectionMatrix.copy(kl),o=-s*t.aspect-i,a=s*t.aspect-i,kl.elements[0]=2*t.near/(a-o),kl.elements[8]=(a+o)/(a-o),this.cameraR.projectionMatrix.copy(kl)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Ul),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(zl)}},StreamCopyUsage:35042,StreamDrawUsage:35040,StreamReadUsage:35041,StringKeyframeTrack:Wa,SubtractEquation:101,SubtractiveBlending:3,TOUCH:{ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},TangentSpaceNormalMap:0,TetrahedronBufferGeometry:ga,TetrahedronGeometry:ga,TextGeometry:class extends At{constructor(){console.error("THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js"),super()}},Texture:B,TextureLoader:il,TorusBufferGeometry:va,TorusGeometry:va,TorusKnotBufferGeometry:ya,TorusKnotGeometry:ya,Triangle:rt,TriangleFanDrawMode:2,TriangleStripDrawMode:1,TrianglesDrawMode:0,TubeBufferGeometry:xa,TubeGeometry:xa,UVMapping:300,Uint16Attribute:class extends ft{constructor(e,t){console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),super(e,t)}},Uint16BufferAttribute:ft,Uint32Attribute:class extends gt{constructor(e,t){console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),super(e,t)}},Uint32BufferAttribute:gt,Uint8Attribute:class extends ut{constructor(e,t){console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),super(e,t)}},Uint8BufferAttribute:ut,Uint8ClampedAttribute:class extends dt{constructor(e,t){console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),super(e,t)}},Uint8ClampedBufferAttribute:dt,Uniform:uc,UniformsLib:mn,UniformsUtils:Jt,UnsignedByteType:1009,UnsignedInt248Type:1020,UnsignedIntType:1014,UnsignedShort4444Type:1017,UnsignedShort5551Type:1018,UnsignedShortType:1012,VSMShadowMap:3,Vector2:p,Vector3:V,Vector4:N,VectorKeyframeTrack:Xa,Vertex:class extends V{constructor(e,t,n){console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),super(e,t,n)}},VertexColors:2,VideoTexture:Js,WebGL1Renderer:ji,WebGL3DRenderTarget:H,WebGLArrayRenderTarget:k,WebGLCubeRenderTarget:nn,WebGLMultipleRenderTargets:G,WebGLMultisampleRenderTarget:class extends z{constructor(e,t,n){console.error('THREE.WebGLMultisampleRenderTarget has been removed. Use a normal render target and set the "samples" property to greater 0 to enable multisampling.'),super(e,t,n),this.samples=4}},WebGLRenderTarget:z,WebGLRenderTargetCube:class extends nn{constructor(e,t,n){console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),super(e,n)}},WebGLRenderer:Gi,WebGLUtils:Oi,WireframeGeometry:wa,WireframeHelper:class extends Hs{constructor(e,t){console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),super(new wa(e.geometry),new Is({color:void 0!==t?t:16777215}))}},WrapAroundEnding:2402,XHRLoader:class extends el{constructor(e){console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),super(e)}},ZeroCurvatureEnding:2400,ZeroFactor:200,ZeroSlopeEnding:2401,ZeroStencilOp:0,_SRGBAFormat:1035,sRGBEncoding:3001});const oh=new fc,ah=new V,lh=new V,ch=new j,hh={X:new V(1,0,0),Y:new V(0,1,0),Z:new V(0,0,1)},uh={type:"change"},dh={type:"mouseDown"},ph={type:"mouseUp",mode:null},fh={type:"objectChange"};class mh extends Xe{constructor(e,t){super(),void 0===t&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),t=document),this.visible=!1,this.domElement=t,this.domElement.style.touchAction="none";const n=new Nh;this._gizmo=n,this.add(n);const r=new zh;this._plane=r,this.add(r);const i=this;function s(e,t){let s=t;Object.defineProperty(i,e,{get:function(){return void 0!==s?s:t},set:function(t){s!==t&&(s=t,r[e]=t,n[e]=t,i.dispatchEvent({type:e+"-changed",value:t}),i.dispatchEvent(uh))}}),i[e]=t,r[e]=t,n[e]=t}s("camera",e),s("object",void 0),s("enabled",!0),s("axis",null),s("mode","translate"),s("translationSnap",null),s("rotationSnap",null),s("scaleSnap",null),s("space","world"),s("size",1),s("dragging",!1),s("showX",!0),s("showY",!0),s("showZ",!0);const o=new V,a=new V,l=new j,c=new j,h=new V,u=new j,d=new V,p=new V,f=new V,m=new V;s("worldPosition",o),s("worldPositionStart",a),s("worldQuaternion",l),s("worldQuaternionStart",c),s("cameraPosition",h),s("cameraQuaternion",u),s("pointStart",d),s("pointEnd",p),s("rotationAxis",f),s("rotationAngle",0),s("eye",m),this._offset=new V,this._startNorm=new V,this._endNorm=new V,this._cameraScale=new V,this._parentPosition=new V,this._parentQuaternion=new j,this._parentQuaternionInv=new j,this._parentScale=new V,this._worldScaleStart=new V,this._worldQuaternionInv=new j,this._worldScale=new V,this._positionStart=new V,this._quaternionStart=new j,this._scaleStart=new V,this._getPointer=gh.bind(this),this._onPointerDown=yh.bind(this),this._onPointerHover=vh.bind(this),this._onPointerMove=xh.bind(this),this._onPointerUp=wh.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){void 0!==this.object&&(this.object.updateMatrixWorld(),null===this.object.parent?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(e){if(void 0===this.object||!0===this.dragging)return;oh.setFromCamera(e,this.camera);const t=bh(this._gizmo.picker[this.mode],oh);this.axis=t?t.object.name:null}pointerDown(e){if(void 0!==this.object&&!0!==this.dragging&&0===e.button&&null!==this.axis){oh.setFromCamera(e,this.camera);const t=bh(this._plane,oh,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,dh.mode=this.mode,this.dispatchEvent(dh)}}pointerMove(e){const t=this.axis,n=this.mode,r=this.object;let i=this.space;if("scale"===n?i="local":"E"!==t&&"XYZE"!==t&&"XYZ"!==t||(i="world"),void 0===r||null===t||!1===this.dragging||-1!==e.button)return;oh.setFromCamera(e,this.camera);const s=bh(this._plane,oh,!0);if(s){if(this.pointEnd.copy(s.point).sub(this.worldPositionStart),"translate"===n)this._offset.copy(this.pointEnd).sub(this.pointStart),"local"===i&&"XYZ"!==t&&this._offset.applyQuaternion(this._worldQuaternionInv),-1===t.indexOf("X")&&(this._offset.x=0),-1===t.indexOf("Y")&&(this._offset.y=0),-1===t.indexOf("Z")&&(this._offset.z=0),"local"===i&&"XYZ"!==t?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),r.position.copy(this._offset).add(this._positionStart),this.translationSnap&&("local"===i&&(r.position.applyQuaternion(ch.copy(this._quaternionStart).invert()),-1!==t.search("X")&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),-1!==t.search("Y")&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),-1!==t.search("Z")&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this._quaternionStart)),"world"===i&&(r.parent&&r.position.add(ah.setFromMatrixPosition(r.parent.matrixWorld)),-1!==t.search("X")&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),-1!==t.search("Y")&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),-1!==t.search("Z")&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.parent&&r.position.sub(ah.setFromMatrixPosition(r.parent.matrixWorld))));else if("scale"===n){if(-1!==t.search("XYZ")){let e=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(e*=-1),lh.set(e,e,e)}else ah.copy(this.pointStart),lh.copy(this.pointEnd),ah.applyQuaternion(this._worldQuaternionInv),lh.applyQuaternion(this._worldQuaternionInv),lh.divide(ah),-1===t.search("X")&&(lh.x=1),-1===t.search("Y")&&(lh.y=1),-1===t.search("Z")&&(lh.z=1);r.scale.copy(this._scaleStart).multiply(lh),this.scaleSnap&&(-1!==t.search("X")&&(r.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==t.search("Y")&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),-1!==t.search("Z")&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if("rotate"===n){this._offset.copy(this.pointEnd).sub(this.pointStart);const e=20/this.worldPosition.distanceTo(ah.setFromMatrixPosition(this.camera.matrixWorld));"E"===t?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1):"XYZE"===t?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(ah.copy(this.rotationAxis).cross(this.eye))*e):"X"!==t&&"Y"!==t&&"Z"!==t||(this.rotationAxis.copy(hh[t]),ah.copy(hh[t]),"local"===i&&ah.applyQuaternion(this.worldQuaternion),this.rotationAngle=this._offset.dot(ah.cross(this.eye).normalize())*e),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),"local"===i&&"E"!==t&&"XYZE"!==t?(r.quaternion.copy(this._quaternionStart),r.quaternion.multiply(ch.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),r.quaternion.copy(ch.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(uh),this.dispatchEvent(fh)}}pointerUp(e){0===e.button&&(this.dragging&&null!==this.axis&&(ph.mode=this.mode,this.dispatchEvent(ph)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse((function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()}))}attach(e){return this.object=e,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(uh),this.dispatchEvent(fh),this.pointStart.copy(this.pointEnd))}getRaycaster(){return oh}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}update(){console.warn("THREE.TransformControls: update function has no more functionality and therefore has been deprecated.")}}function gh(e){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:e.button};{const t=this.domElement.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width*2-1,y:-(e.clientY-t.top)/t.height*2+1,button:e.button}}}function vh(e){if(this.enabled)switch(e.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(e))}}function yh(e){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(e)),this.pointerDown(this._getPointer(e)))}function xh(e){this.enabled&&this.pointerMove(this._getPointer(e))}function wh(e){this.enabled&&(this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(e)))}function bh(e,t,n){const r=t.intersectObject(e,!0);for(let e=0;e<r.length;e++)if(r[e].object.visible||n)return r[e];return!1}mh.prototype.isTransformControls=!0;const _h=new Le,Mh=new V(0,1,0),Sh=new V(0,0,0),Th=new be,Eh=new j,Ah=new j,Ch=new V,Ph=new be,Rh=new V(1,0,0),Lh=new V(0,1,0),Ih=new V(0,0,1),Dh=new V,Oh=new V,Bh=new V;class Nh extends Xe{constructor(){super(),this.type="TransformControlsGizmo";const e=new ot({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new Is({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),n=e.clone();n.opacity=.15;const r=t.clone();r.opacity=.5;const i=e.clone();i.color.setHex(16711680);const s=e.clone();s.color.setHex(65280);const o=e.clone();o.color.setHex(255);const a=e.clone();a.color.setHex(16711680),a.opacity=.5;const l=e.clone();l.color.setHex(65280),l.opacity=.5;const c=e.clone();c.color.setHex(255),c.opacity=.5;const h=e.clone();h.opacity=.25;const u=e.clone();u.color.setHex(16776960),u.opacity=.25,e.clone().color.setHex(16776960);const d=e.clone();d.color.setHex(7895160);const p=new Eo(0,.04,.1,12);p.translate(0,.05,0);const f=new qt(.08,.08,.08);f.translate(0,.04,0);const m=new At;m.setAttribute("position",new yt([0,0,0,1,0,0],3));const g=new Eo(.0075,.0075,.5,3);function v(e,t){const n=new va(e,.0075,3,64,t*Math.PI*2);return n.rotateY(Math.PI/2),n.rotateX(Math.PI/2),n}g.translate(0,.25,0);const y={X:[[new Wt(p,i),[.5,0,0],[0,0,-Math.PI/2]],[new Wt(p,i),[-.5,0,0],[0,0,Math.PI/2]],[new Wt(g,i),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new Wt(p,s),[0,.5,0]],[new Wt(p,s),[0,-.5,0],[Math.PI,0,0]],[new Wt(g,s)]],Z:[[new Wt(p,o),[0,0,.5],[Math.PI/2,0,0]],[new Wt(p,o),[0,0,-.5],[-Math.PI/2,0,0]],[new Wt(g,o),null,[Math.PI/2,0,0]]],XYZ:[[new Wt(new da(.1,0),h.clone()),[0,0,0]]],XY:[[new Wt(new qt(.15,.15,.01),c.clone()),[.15,.15,0]]],YZ:[[new Wt(new qt(.15,.15,.01),a.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new Wt(new qt(.15,.15,.01),l.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},x={X:[[new Wt(new Eo(.2,0,.6,4),n),[.3,0,0],[0,0,-Math.PI/2]],[new Wt(new Eo(.2,0,.6,4),n),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new Wt(new Eo(.2,0,.6,4),n),[0,.3,0]],[new Wt(new Eo(.2,0,.6,4),n),[0,-.3,0],[0,0,Math.PI]]],Z:[[new Wt(new Eo(.2,0,.6,4),n),[0,0,.3],[Math.PI/2,0,0]],[new Wt(new Eo(.2,0,.6,4),n),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new Wt(new da(.2,0),n)]],XY:[[new Wt(new qt(.2,.2,.01),n),[.15,.15,0]]],YZ:[[new Wt(new qt(.2,.2,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new Wt(new qt(.2,.2,.01),n),[.15,0,.15],[-Math.PI/2,0,0]]]},w={START:[[new Wt(new da(.01,2),r),null,null,null,"helper"]],END:[[new Wt(new da(.01,2),r),null,null,null,"helper"]],DELTA:[[new Us(function(){const e=new At;return e.setAttribute("position",new yt([0,0,0,1,1,1],3)),e}(),r),null,null,null,"helper"]],X:[[new Us(m,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new Us(m,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new Us(m,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},b={XYZE:[[new Wt(v(.5,1),d),null,[0,Math.PI/2,0]]],X:[[new Wt(v(.5,.5),i)]],Y:[[new Wt(v(.5,.5),s),null,[0,0,-Math.PI/2]]],Z:[[new Wt(v(.5,.5),o),null,[0,Math.PI/2,0]]],E:[[new Wt(v(.75,1),u),null,[0,Math.PI/2,0]]]},_={AXIS:[[new Us(m,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},M={XYZE:[[new Wt(new ma(.25,10,8),n)]],X:[[new Wt(new va(.5,.1,4,24),n),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new Wt(new va(.5,.1,4,24),n),[0,0,0],[Math.PI/2,0,0]]],Z:[[new Wt(new va(.5,.1,4,24),n),[0,0,0],[0,0,-Math.PI/2]]],E:[[new Wt(new va(.75,.1,2,24),n)]]},S={X:[[new Wt(f,i),[.5,0,0],[0,0,-Math.PI/2]],[new Wt(g,i),[0,0,0],[0,0,-Math.PI/2]],[new Wt(f,i),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new Wt(f,s),[0,.5,0]],[new Wt(g,s)],[new Wt(f,s),[0,-.5,0],[0,0,Math.PI]]],Z:[[new Wt(f,o),[0,0,.5],[Math.PI/2,0,0]],[new Wt(g,o),[0,0,0],[Math.PI/2,0,0]],[new Wt(f,o),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new Wt(new qt(.15,.15,.01),c),[.15,.15,0]]],YZ:[[new Wt(new qt(.15,.15,.01),a),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new Wt(new qt(.15,.15,.01),l),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new Wt(new qt(.1,.1,.1),h.clone())]]},T={X:[[new Wt(new Eo(.2,0,.6,4),n),[.3,0,0],[0,0,-Math.PI/2]],[new Wt(new Eo(.2,0,.6,4),n),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new Wt(new Eo(.2,0,.6,4),n),[0,.3,0]],[new Wt(new Eo(.2,0,.6,4),n),[0,-.3,0],[0,0,Math.PI]]],Z:[[new Wt(new Eo(.2,0,.6,4),n),[0,0,.3],[Math.PI/2,0,0]],[new Wt(new Eo(.2,0,.6,4),n),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new Wt(new qt(.2,.2,.01),n),[.15,.15,0]]],YZ:[[new Wt(new qt(.2,.2,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new Wt(new qt(.2,.2,.01),n),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new Wt(new qt(.2,.2,.2),n),[0,0,0]]]},E={X:[[new Us(m,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new Us(m,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new Us(m,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function A(e){const t=new Xe;for(const n in e)for(let r=e[n].length;r--;){const i=e[n][r][0].clone(),s=e[n][r][1],o=e[n][r][2],a=e[n][r][3],l=e[n][r][4];i.name=n,i.tag=l,s&&i.position.set(s[0],s[1],s[2]),o&&i.rotation.set(o[0],o[1],o[2]),a&&i.scale.set(a[0],a[1],a[2]),i.updateMatrix();const c=i.geometry.clone();c.applyMatrix4(i.matrix),i.geometry=c,i.renderOrder=1/0,i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),t.add(i)}return t}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=A(y)),this.add(this.gizmo.rotate=A(b)),this.add(this.gizmo.scale=A(S)),this.add(this.picker.translate=A(x)),this.add(this.picker.rotate=A(M)),this.add(this.picker.scale=A(T)),this.add(this.helper.translate=A(w)),this.add(this.helper.rotate=A(_)),this.add(this.helper.scale=A(E)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){const t="local"===("scale"===this.mode?"local":this.space)?this.worldQuaternion:Ah;this.gizmo.translate.visible="translate"===this.mode,this.gizmo.rotate.visible="rotate"===this.mode,this.gizmo.scale.visible="scale"===this.mode,this.helper.translate.visible="translate"===this.mode,this.helper.rotate.visible="rotate"===this.mode,this.helper.scale.visible="scale"===this.mode;let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let e=0;e<n.length;e++){const r=n[e];let i;if(r.visible=!0,r.rotation.set(0,0,0),r.position.copy(this.worldPosition),i=this.camera.isOrthographicCamera?(this.camera.top-this.camera.bottom)/this.camera.zoom:this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),r.scale.set(1,1,1).multiplyScalar(i*this.size/4),"helper"!==r.tag){if(r.quaternion.copy(t),"translate"===this.mode||"scale"===this.mode){const e=.99,n=.2;"X"===r.name&&Math.abs(Mh.copy(Rh).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"Y"===r.name&&Math.abs(Mh.copy(Lh).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"Z"===r.name&&Math.abs(Mh.copy(Ih).applyQuaternion(t).dot(this.eye))>e&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"XY"===r.name&&Math.abs(Mh.copy(Ih).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"YZ"===r.name&&Math.abs(Mh.copy(Rh).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"XZ"===r.name&&Math.abs(Mh.copy(Lh).applyQuaternion(t).dot(this.eye))<n&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1)}else"rotate"===this.mode&&(Eh.copy(t),Mh.copy(this.eye).applyQuaternion(ch.copy(t).invert()),-1!==r.name.search("E")&&r.quaternion.setFromRotationMatrix(Th.lookAt(this.eye,Sh,Lh)),"X"===r.name&&(ch.setFromAxisAngle(Rh,Math.atan2(-Mh.y,Mh.z)),ch.multiplyQuaternions(Eh,ch),r.quaternion.copy(ch)),"Y"===r.name&&(ch.setFromAxisAngle(Lh,Math.atan2(Mh.x,Mh.z)),ch.multiplyQuaternions(Eh,ch),r.quaternion.copy(ch)),"Z"===r.name&&(ch.setFromAxisAngle(Ih,Math.atan2(Mh.y,Mh.x)),ch.multiplyQuaternions(Eh,ch),r.quaternion.copy(ch)));r.visible=r.visible&&(-1===r.name.indexOf("X")||this.showX),r.visible=r.visible&&(-1===r.name.indexOf("Y")||this.showY),r.visible=r.visible&&(-1===r.name.indexOf("Z")||this.showZ),r.visible=r.visible&&(-1===r.name.indexOf("E")||this.showX&&this.showY&&this.showZ),r.material._color=r.material._color||r.material.color.clone(),r.material._opacity=r.material._opacity||r.material.opacity,r.material.color.copy(r.material._color),r.material.opacity=r.material._opacity,this.enabled&&this.axis&&(r.name===this.axis||this.axis.split("").some((function(e){return r.name===e})))&&(r.material.color.setHex(16776960),r.material.opacity=1)}else r.visible=!1,"AXIS"===r.name?(r.position.copy(this.worldPositionStart),r.visible=!!this.axis,"X"===this.axis&&(ch.setFromEuler(_h.set(0,0,0)),r.quaternion.copy(t).multiply(ch),Math.abs(Mh.copy(Rh).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),"Y"===this.axis&&(ch.setFromEuler(_h.set(0,0,Math.PI/2)),r.quaternion.copy(t).multiply(ch),Math.abs(Mh.copy(Lh).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),"Z"===this.axis&&(ch.setFromEuler(_h.set(0,Math.PI/2,0)),r.quaternion.copy(t).multiply(ch),Math.abs(Mh.copy(Ih).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),"XYZE"===this.axis&&(ch.setFromEuler(_h.set(0,Math.PI/2,0)),Mh.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(Th.lookAt(Sh,Mh,Lh)),r.quaternion.multiply(ch),r.visible=this.dragging),"E"===this.axis&&(r.visible=!1)):"START"===r.name?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):"END"===r.name?(r.position.copy(this.worldPosition),r.visible=this.dragging):"DELTA"===r.name?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),ah.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),ah.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(ah),r.visible=this.dragging):(r.quaternion.copy(t),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=-1!==this.axis.search(r.name)))}super.updateMatrixWorld(e)}}Nh.prototype.isTransformControlsGizmo=!0;class zh extends Wt{constructor(){super(new pn(1e5,1e5,2,2),new ot({visible:!1,wireframe:!0,side:2,transparent:!0,opacity:.1,toneMapped:!1})),this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),"scale"===this.mode&&(t="local"),Dh.copy(Rh).applyQuaternion("local"===t?this.worldQuaternion:Ah),Oh.copy(Lh).applyQuaternion("local"===t?this.worldQuaternion:Ah),Bh.copy(Ih).applyQuaternion("local"===t?this.worldQuaternion:Ah),Mh.copy(Oh),this.mode){case"translate":case"scale":switch(this.axis){case"X":Mh.copy(this.eye).cross(Dh),Ch.copy(Dh).cross(Mh);break;case"Y":Mh.copy(this.eye).cross(Oh),Ch.copy(Oh).cross(Mh);break;case"Z":Mh.copy(this.eye).cross(Bh),Ch.copy(Bh).cross(Mh);break;case"XY":Ch.copy(Bh);break;case"YZ":Ch.copy(Dh);break;case"XZ":Mh.copy(Bh),Ch.copy(Oh);break;case"XYZ":case"E":Ch.set(0,0,0)}break;case"rotate":default:Ch.set(0,0,0)}0===Ch.length()?this.quaternion.copy(this.cameraQuaternion):(Ph.lookAt(ah.set(0,0,0),Ch,Mh),this.quaternion.setFromRotationMatrix(Ph)),super.updateMatrixWorld(e)}}zh.prototype.isTransformControlsPlane=!0;class Uh extends Wt{constructor(){super(Uh.Geometry,new ot({opacity:0,transparent:!0})),this.type="Lensflare",this.frustumCulled=!1,this.renderOrder=1/0;const e=new V,t=new V,n=new Qs(16,16,1023),r=new Qs(16,16,1023),i=Uh.Geometry,s=new Sa({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tuniform vec3 screenPosition;\n\t\t\t\tuniform vec2 scale;\n\n\t\t\t\tattribute vec3 position;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 );\n\n\t\t\t\t}",fragmentShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0 );\n\n\t\t\t\t}",depthTest:!0,depthWrite:!1,transparent:!1}),o=new Sa({uniforms:{map:{value:n},scale:{value:null},screenPosition:{value:null}},vertexShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tuniform vec3 screenPosition;\n\t\t\t\tuniform vec2 scale;\n\n\t\t\t\tattribute vec3 position;\n\t\t\t\tattribute vec2 uv;\n\n\t\t\t\tvarying vec2 vUV;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvUV = uv;\n\n\t\t\t\t\tgl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 );\n\n\t\t\t\t}",fragmentShader:"\n\n\t\t\t\tprecision highp float;\n\n\t\t\t\tuniform sampler2D map;\n\n\t\t\t\tvarying vec2 vUV;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_FragColor = texture2D( map, vUV );\n\n\t\t\t\t}",depthTest:!1,depthWrite:!1,transparent:!1}),a=new Wt(i,s),l=[],c=kh.Shader,h=new Sa({uniforms:{map:{value:null},occlusionMap:{value:r},color:{value:new P(16777215)},scale:{value:new p},screenPosition:{value:new V}},vertexShader:c.vertexShader,fragmentShader:c.fragmentShader,blending:2,transparent:!0,depthWrite:!1}),u=new Wt(i,h);this.addElement=function(e){l.push(e)};const d=new p,f=new p,m=new yc,g=new N;this.onBeforeRender=function(c,p,v){c.getCurrentViewport(g);const y=g.w/g.z,x=g.z/2,w=g.w/2;let b=16/g.w;if(d.set(b*y,b),m.min.set(g.x,g.y),m.max.set(g.x+(g.z-16),g.y+(g.w-16)),t.setFromMatrixPosition(this.matrixWorld),t.applyMatrix4(v.matrixWorldInverse),!(t.z>0)&&(e.copy(t).applyMatrix4(v.projectionMatrix),f.x=g.x+e.x*x+x-8,f.y=g.y+e.y*w+w-8,m.containsPoint(f))){c.copyFramebufferToTexture(f,n);let t=s.uniforms;t.scale.value=d,t.screenPosition.value=e,c.renderBufferDirect(v,null,i,s,a,null),c.copyFramebufferToTexture(f,r),t=o.uniforms,t.scale.value=d,t.screenPosition.value=e,c.renderBufferDirect(v,null,i,o,a,null);const p=2*-e.x,m=2*-e.y;for(let t=0,n=l.length;t<n;t++){const n=l[t],r=h.uniforms;r.color.value.copy(n.color),r.map.value=n.texture,r.screenPosition.value.x=e.x+p*n.distance,r.screenPosition.value.y=e.y+m*n.distance,b=n.size/g.w;const s=g.w/g.z;r.scale.value.set(b*s,b),h.uniformsNeedUpdate=!0,c.renderBufferDirect(v,null,i,h,u,null)}}},this.dispose=function(){s.dispose(),o.dispose(),h.dispose(),n.dispose(),r.dispose();for(let e=0,t=l.length;e<t;e++)l[e].texture.dispose()}}}Uh.prototype.isLensflare=!0;class kh{constructor(e,t=1,n=0,r=new P(16777215)){this.texture=e,this.size=t,this.distance=n,this.color=r}}kh.Shader={uniforms:{map:{value:null},occlusionMap:{value:null},color:{value:null},scale:{value:null},screenPosition:{value:null}},vertexShader:"\n\n\t\tprecision highp float;\n\n\t\tuniform vec3 screenPosition;\n\t\tuniform vec2 scale;\n\n\t\tuniform sampler2D occlusionMap;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\n\t\tvarying vec2 vUV;\n\t\tvarying float vVisibility;\n\n\t\tvoid main() {\n\n\t\t\tvUV = uv;\n\n\t\t\tvec2 pos = position.xy;\n\n\t\t\tvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\n\t\t\tvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\n\n\t\t\tvVisibility = visibility.r / 9.0;\n\t\t\tvVisibility *= 1.0 - visibility.g / 9.0;\n\t\t\tvVisibility *= visibility.b / 9.0;\n\n\t\t\tgl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tprecision highp float;\n\n\t\tuniform sampler2D map;\n\t\tuniform vec3 color;\n\n\t\tvarying vec2 vUV;\n\t\tvarying float vVisibility;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texture = texture2D( map, vUV );\n\t\t\ttexture.a *= vVisibility;\n\t\t\tgl_FragColor = texture;\n\t\t\tgl_FragColor.rgb *= color;\n\n\t\t}"},Uh.Geometry=function(){const e=new At,t=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),n=new qi(t,5);return e.setIndex([0,1,2,0,2,3]),e.setAttribute("position",new Zi(n,3,0,!1)),e.setAttribute("uv",new Zi(n,2,3,!1)),e}();const Fh=(e,t)=>{let n="";for(const e in t)n+=`${e}: ${t[e]};`;console.log(`%c${e}`,n)};function Hh(e){return e instanceof V?e:new V(e.x,e.y,e.z)}function Gh(e){return e instanceof Le?e:new Le(e.x,e.y,e.z)}function jh(e){return new q(new V(0,0,0),new V(500,500,500)).setFromObject(e)}function Vh(e,t,n){const r=n.clone();return Math.abs(t[e]-n[e])>Math.PI&&(t[e]>n[e]?r[e]+=2*Math.PI:r[e]-=2*Math.PI),r}function Wh(e,t){const n=Vh("x",e,t),r=Vh("y",e,t),i=Vh("z",e,t);return new Le(n.x,r.y,i.z,t.order)}function Xh(e){return Math.PI/180*e}function qh(e,t=!0){return t?{position:e.getWorldPosition(new V),rotation:(new Le).setFromQuaternion(e.getWorldQuaternion(new j)),scale:e.getWorldScale(new V)}:{position:e.position.clone(),rotation:e.rotation.clone(),scale:e.scale.clone()}}function Yh(e,t,n=!0){const r=qh(t,n);e.position.copy(r.position),e.rotation.copy(r.rotation),e.scale.copy(r.scale)}class Zh{constructor(){this.min=null,this.roots=[],this.nodes=[]}shift(){const e=this.min;if(null==e||this.roots.length<1)return this.min=null,e;this.remove(e),this.roots.length>50&&this.consolidate();let t=1/0;const n=this.roots.length;for(let e=0;e<n;e++){const n=this.roots[e],r=this.getDistance(n);r<t&&(t=r,this.min=n)}return e}consolidate(){const e=[[],[],[],[],[],[],[]],t=e.length-1,n=this.roots.length;for(let r=0;r<n;r++){const n=this.roots[r],i=this.nodes[n].depth;i<t&&e[i].push(n)}for(let n=0;n<=t;n++)for(;e[n].length>1;){const r=e[n].shift(),i=e[n].shift(),s=n+1;let o=-1;this.nodes[r].distance<this.nodes[i].distance?(this.nodes[r].depth=s,this.nodes[r].children.push(i),this.nodes[i].parent=r,s<=t&&e[s].push(r),o=this.roots.indexOf(i)):(this.nodes[i].depth=s,this.nodes[i].children.push(r),this.nodes[r].parent=i,s<=t&&e[s].push(i),o=this.roots.indexOf(r)),o>-1&&this.roots.splice(o,1)}}add(e,t){this.nodes[e]={nodeIndex:e,distance:t,depth:0,parent:null,children:[]},(!this.min||t<this.nodes[this.min].distance)&&(this.min=e),this.roots.push(e)}update(e,t){this.remove(e),this.add(e,t)}remove(e){if(!this.nodes[e])return;const t=this.nodes[e].children.length;if(t>0)for(let n=0;n<t;n++){const t=this.nodes[e].children[n];this.nodes[t].parent=this.nodes[e].parent,null==this.nodes[t].parent&&this.roots.push(t)}let n=this.nodes[e].parent;if(null==n){const t=this.roots.indexOf(e);t>-1&&this.roots.splice(t,1)}else for(;n;)this.nodes[n].depth--,n=this.nodes[n].parent}getDistance(e){return this.nodes[e]?this.nodes[e].distance:1/0}}function Jh(e,t=["px.jpg","nx.jpg","py.jpg","ny.jpg","pz.jpg","nz.jpg"]){return new Promise((n=>{(new nl).setPath(e).load(t,(e=>{e.format=1023,n(e)}))}))}const Qh=e=>/\.sbmx$/i.test(e),Kh=e=>{const t=ou(e,0,8);if("SBMG----"!==t)throw new TypeError("This format file ("+t+") is not supported by the SoonSpace.js");const n=new DataView(e.slice(8));for(let e=0;e<n.byteLength;e++){const t=n.getUint8(e),r=(t>>4&15)+(t<<4&240);n.setUint8(e,r)}return n.buffer},$h=Object.prototype.hasOwnProperty,eu=e=>"string"==typeof e,tu=e=>"boolean"==typeof e,nu=e=>"number"==typeof e,ru=Array.isArray,iu=e=>null!==e&&"object"==typeof e,su=e=>"function"==typeof e,ou=(e,t,n)=>String.fromCharCode(...new Uint8Array(e,t,n));var au,lu=Object.freeze({__proto__:null,hasOwn:(e,t)=>$h.call(e,t),isString:eu,isBoolean:tu,isNumber:nu,isNull:e=>null===e,isSymbol:e=>"symbol"==typeof e,isDate:e=>e instanceof Date,isArray:ru,isObject:iu,isFunction:su,isPromise:e=>iu(e)&&su(e.then)&&su(e.catch),typeJudge:e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase(),sleep:e=>new Promise((t=>setTimeout((()=>t()),e))),getAsciiString:ou,log:Fh,IVector3ToVector3:Hh,IVector3ToEuler:Gh,getBoundingBox:jh,rotationAxisFix:Vh,rotationAFix:Wh,deg2Euler:Xh,euler2Deg:function(e){return e/(Math.PI/180)},getSpaceAttributeFromObject:qh,syncSpaceAttributeToObject:Yh,MinHeap:Zh,getCubeTexture:Jh,isSbmxSuffix:Qh,parseSbmx:Kh}),cu={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin(5*(e-.1)*Math.PI)+1},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?-.5*Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)+1}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-cu.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*cu.Bounce.In(2*e):.5*cu.Bounce.Out(2*e-1)+.5}}},hu="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},uu=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map((function(t){return e._tweens[t]}))},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},e.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},e.prototype.update=function(e,t){void 0===e&&(e=hu()),void 0===t&&(t=!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]],s=!t;i&&!1===i.update(e,s)&&!t&&delete this._tweens[n[r]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0},e}(),du={Linear:function(e,t){var n=e.length-1,r=n*t,i=Math.floor(r),s=du.Utils.Linear;return t<0?s(e[0],e[1],r):t>1?s(e[n],e[n-1],n-r):s(e[i],e[i+1>n?n:i+1],r-i)},Bezier:function(e,t){for(var n=0,r=e.length-1,i=Math.pow,s=du.Utils.Bernstein,o=0;o<=r;o++)n+=i(1-t,r-o)*i(t,o)*e[o]*s(r,o);return n},CatmullRom:function(e,t){var n=e.length-1,r=n*t,i=Math.floor(r),s=du.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(i=Math.floor(r=n*(1+t))),s(e[(i-1+n)%n],e[i],e[(i+1)%n],e[(i+2)%n],r-i)):t<0?e[0]-(s(e[0],e[0],e[1],e[1],-r)-e[0]):t>1?e[n]-(s(e[n],e[n],e[n-1],e[n-1],r-n)-e[n]):s(e[i?i-1:0],e[i],e[n<i+1?n:i+1],e[n<i+2?n:i+2],r-i)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=du.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:(au=[1],function(e){var t=1;if(au[e])return au[e];for(var n=e;n>1;n--)t*=n;return au[e]=t,t}),CatmullRom:function(e,t,n,r,i){var s=.5*(n-e),o=.5*(r-t),a=i*i;return(2*t-2*n+s+o)*(i*a)+(-3*t+3*n-2*s-o)*a+s*i+t}}},pu=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),fu=new uu,mu=function(){function e(e,t){void 0===t&&(t=fu),this._object=e,this._group=t,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=cu.Linear.None,this._interpolationFunction=du.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=pu.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.to=function(e,t){return this._valuesEnd=Object.create(e),void 0!==t&&(this._duration=t),this},e.prototype.duration=function(e){return this._duration=e,this},e.prototype.start=function(e){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var t in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(t),this._valuesStart[t]=this._valuesStartRepeat[t];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==e?"string"==typeof e?hu()+parseFloat(e):e:hu(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},e.prototype._setupProperties=function(e,t,n,r){for(var i in n){var s=e[i],o=Array.isArray(s),a=o?"array":typeof s,l=!o&&Array.isArray(n[i]);if("undefined"!==a&&"function"!==a){if(l){var c=n[i];if(0===c.length)continue;c=c.map(this._handleRelativeValue.bind(this,s)),n[i]=[s].concat(c)}if("object"!==a&&!o||!s||l)void 0===t[i]&&(t[i]=s),o||(t[i]*=1),r[i]=l?n[i].slice().reverse():t[i]||0;else{for(var h in t[i]=o?[]:{},s)t[i][h]=s[h];r[i]=o?[]:{},this._setupProperties(s,t[i],n[i],r[i])}}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(e){return void 0===e&&(e=hu()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=e,this._group&&this._group.remove(this)),this},e.prototype.resume=function(e){return void 0===e&&(e=hu()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},e.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},e.prototype.group=function(e){return this._group=e,this},e.prototype.delay=function(e){return this._delayTime=e,this},e.prototype.repeat=function(e){return this._initialRepeat=e,this._repeat=e,this},e.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},e.prototype.yoyo=function(e){return this._yoyo=e,this},e.prototype.easing=function(e){return this._easingFunction=e,this},e.prototype.interpolation=function(e){return this._interpolationFunction=e,this},e.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},e.prototype.onStart=function(e){return this._onStartCallback=e,this},e.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},e.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},e.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},e.prototype.onStop=function(e){return this._onStopCallback=e,this},e.prototype.update=function(e,t){if(void 0===e&&(e=hu()),void 0===t&&(t=!0),this._isPaused)return!0;var n,r,i=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(e>i)return!1;t&&this.start(e)}if(this._goToEnd=!1,e<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),r=(e-this._startTime)/this._duration,r=0===this._duration||r>1?1:r;var s=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,s),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),1===r){if(this._repeat>0){for(n in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[n]||(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=e+this._repeatDelayTime:this._startTime=e+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var o=0,a=this._chainedTweens.length;o<a;o++)this._chainedTweens[o].start(this._startTime+this._duration);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(e,t,n,r){for(var i in n)if(void 0!==t[i]){var s=t[i]||0,o=n[i],a=Array.isArray(e[i]),l=Array.isArray(o);!a&&l?e[i]=this._interpolationFunction(o,r):"object"==typeof o&&o?this._updateProperties(e[i],s,o,r):"number"==typeof(o=this._handleRelativeValue(s,o))&&(e[i]=s+(o-s)*r)}},e.prototype._handleRelativeValue=function(e,t){return"string"!=typeof t?t:"+"===t.charAt(0)||"-"===t.charAt(0)?e+parseFloat(t):parseFloat(t)},e.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],n=this._valuesEnd[e];this._valuesStartRepeat[e]="string"==typeof n?this._valuesStartRepeat[e]+parseFloat(n):this._valuesEnd[e],this._valuesEnd[e]=t},e}(),gu=pu.nextId,vu=fu,yu=vu.getAll.bind(vu),xu=vu.removeAll.bind(vu),wu=vu.add.bind(vu),bu=vu.remove.bind(vu),_u=vu.update.bind(vu),Mu={Easing:cu,Group:uu,Interpolation:du,now:hu,Sequence:pu,nextId:gu,Tween:mu,VERSION:"18.6.4",getAll:yu,removeAll:xu,add:wu,remove:bu,update:_u};const Su={"Linear.None":cu.Linear.None,"Quadratic.In":cu.Quadratic.In,"Quadratic.Out":cu.Quadratic.Out,"Quadratic.InOut":cu.Quadratic.InOut,"Cubic.In":cu.Cubic.In,"Cubic.Out":cu.Cubic.Out,"Cubic.InOut":cu.Cubic.InOut,"Quartic.In":cu.Quartic.In,"Quartic.Out":cu.Quartic.Out,"Quartic.InOut":cu.Quartic.InOut,"Quintic.In":cu.Quintic.In,"Quintic.Out":cu.Quintic.Out,"Quintic.InOut":cu.Quintic.InOut,"Sinusoidal.In":cu.Sinusoidal.In,"Sinusoidal.Out":cu.Sinusoidal.Out,"Sinusoidal.InOut":cu.Sinusoidal.InOut,"Exponential.In":cu.Exponential.In,"Exponential.Out":cu.Exponential.Out,"Exponential.InOut":cu.Exponential.InOut,"Circular.In":cu.Circular.In,"Circular.Out":cu.Circular.Out,"Circular.InOut":cu.Circular.InOut,"Elastic.In":cu.Elastic.In,"Elastic.Out":cu.Elastic.Out,"Elastic.InOut":cu.Elastic.InOut,"Back.In":cu.Back.In,"Back.Out":cu.Back.Out,"Back.InOut":cu.Back.InOut,"Bounce.In":cu.Bounce.In,"Bounce.Out":cu.Bounce.Out,"Bounce.InOut":cu.Bounce.InOut};function Tu(e,t,n={},r,i){return new Promise((s=>{const{duration:o=1e3,delay:a=0,repeat:l=!1,mode:c="Linear.None",yoyo:h=!1}=n,u=Su[c],d=new mu(e).to(t,o).easing(u).delay(a).onUpdate((n=>{e instanceof Le&&t instanceof Le&&n instanceof Le&&(n.order=t.order),r&&r(n,d)})).onComplete((()=>{d.stop(),s()}));nu(l)?d.repeat(l):tu(l)&&l&&d.repeat(1/0),d.yoyo(h),d.start(),d.onStart((()=>{i&&i(d)}))}))}class Eu extends Wt{constructor(e,t,n,r="BaseMesh"){super(e,t);const{id:i,name:s="",level:o={max:null,min:null},visible:a=!0,position:l={x:0,y:0,z:0},rotation:c={x:0,y:0,z:0},scale:h={x:1,y:1,z:1},userData:u={}}=n;if(void 0===i)throw new Error("In soonspacejs: 空间对象实例化失败,缺少必要字段 'id'!");this.sid=i,this.name=s,this.stype=r,this.level=o,this.visible=null==a||a,this.handleHide=!a,this.position.set(l.x,l.y,l.z),this.rotation.set(c.x,c.y,c.z),this.scale.set(h.x,h.y,h.z),this.castShadow=!0,this.receiveShadow=!0,this.userData=u,this.isEventPropagation=!1,this.autoUpdate=!1}show(){this.visible=!0,this.handleHide=!1,this.autoUpdate=!0}hide(){this.visible=!1,this.handleHide=!0,this.autoUpdate=!0}setMove(e,t,n,r){return Tu(this.position,Hh(e),t,n,r)}setRotate(e,t,n,r){const i=Gh(e),s=(new j).setFromEuler(i);return Tu({t:0},{t:1},t,(({t:e},t)=>{this.quaternion.slerp(s,e),null==n||n(this.rotation,t)}),r)}setScale(e,t,n,r){return Tu(this.scale,Hh(e),t,n,r)}getBoundingBox(){return new q(new V,new V).setFromObject(this)}eventPropagation(){this.isEventPropagation=!0}sClone(e){return new Eu(this.geometry,this.material,{id:`${this.sid}_clone`}).sCopy(this,e)}sCopy(e,t=!0){if(this.name=e.name,this.sid=e.sid,this.stype=e.stype,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.geometry=e.geometry.clone(),ru(e.material)?this.material=e.material.map((e=>e.clone())):this.material=e.material.clone(),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++)e.children[t]instanceof Au||e.children[t]instanceof Eu?this.add(e.children[t].sClone()):this.add(e.children[t].clone());return this}}class Au extends Xe{constructor(e,t="BaseObject3D"){super();const{id:n,name:r="",level:i={max:null,min:null},visible:s=!0,position:o={x:0,y:0,z:0},rotation:a={x:0,y:0,z:0},scale:l={x:1,y:1,z:1},userData:c={}}=e;if(void 0===n)throw new Error("In soonspacejs: 空间对象实例化失败,缺少必要字段 'id'!");this.sid=n,this.name=r,this.stype=t,this.level=i,this.visible=null==s||s,this.handleHide=!s,this.position.set(o.x,o.y,o.z),this.rotation.set(a.x,a.y,a.z),this.scale.set(l.x,l.y,l.z),this.castShadow=!0,this.receiveShadow=!0,this.userData=c,this.autoUpdate=!1}show(){this.visible=!0,this.handleHide=!1,this.autoUpdate=!0}hide(){this.visible=!1,this.handleHide=!0,this.autoUpdate=!0}setMove(e,t,n,r){return Tu(this.position,Hh(e),t,n,r)}setRotate(e,t,n,r){const i=Gh(e),s=(new j).setFromEuler(i);return Tu({t:0},{t:1},t,(({t:e},t)=>{this.quaternion.slerp(s,e),null==n||n(this.rotation,t)}),r)}setScale(e,t,n,r){return Tu(this.scale,Hh(e),t,n,r)}sClone(e){return new Au({id:`${this.sid}_clone`}).sCopy(this,e)}sCopy(e,t=!0){if(this.name=e.name,this.sid=e.sid,this.stype=e.stype,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){const n=e.children[t];n instanceof Au||n instanceof Eu?this.add(n.sClone()):this.add(n.clone())}return this}getSpaceAttribute(e=!0){return qh(this,e)}syncSpaceAttribute(e,t=!0){e instanceof Au?Yh(this,e,t):console.warn("In soonspacejs: BaseObject3D 对象原型方法 'syncSpaceAttribute' 第一个参数对象类型错误!",e)}}class Cu extends Au{constructor(e){super(e,"SceneManage"),this.name=e.id.toString(),this.isSceneManage=!0}}class Pu extends Au{constructor(e){super(e,"Group")}showAllChild(){this.children.forEach((e=>{e instanceof Au&&e.show()}))}hideAllChild(){this.children.forEach((e=>{e instanceof Au&&e.hide()}))}}class Ru extends Au{constructor(e){super(e,"PluginObject")}}class Lu extends Xe{constructor(e){super(),this.element=e,this.element.style.position="absolute",this.addEventListener("removed",(()=>{this.traverse((function(e){e instanceof Lu&&null!==e.element.parentNode&&e.element.parentNode.removeChild(e.element)}))}))}}let Iu,Du;const Ou=new V,Bu=new be,Nu=new be,zu={objects:new WeakMap};function Uu(){const e=new V,t=new V;return function(n,r){return e.setFromMatrixPosition(n.matrixWorld),t.setFromMatrixPosition(r.matrixWorld),e.distanceToSquared(t)}}class ku{constructor(e){e||(e=document.createElement("div")),e.style.overflow="hidden",this.domElement=e}setSize(e,t){Iu=e/2,Du=t/2,this.domElement.style.width=e+"px",this.domElement.style.height=t+"px"}renderObject(e,t,n){if(e instanceof Lu){Ou.setFromMatrixPosition(e.matrixWorld),Ou.applyMatrix4(Nu);const t=e.element,r="translate(-50%,-100%) translate("+(Ou.x*Iu+Iu)+"px,"+(-Ou.y*Du+Du)+"px)";t.style.transform=r,t.style.display=e.visible&&Ou.z>=-1&&Ou.z<=1?e.userData.elDisplay||"":"none";const i={distanceToCameraSquared:Uu()(n,e)};zu.objects.set(e,i),t.parentNode!==this.domElement&&this.domElement.appendChild(t)}for(let r=0,i=e.children.length;r<i;r++)this.renderObject(e.children[r],t,n)}render(e,t){!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),Bu.copy(t.matrixWorldInverse),Nu.multiplyMatrices(t.projectionMatrix,Bu),this.renderObject(e,e,t),function(e){const t=function(e){const t=[];return e.traverse((function(e){e instanceof Lu&&t.push(e)})),t}(e).sort((function(e,t){return zu.objects.get(e).distanceToCameraSquared-zu.objects.get(t).distanceToCameraSquared})),n=t.length;for(let e=0,r=t.length;e<r;e++)t[e].element.style.zIndex=""+(n-e)}(e)}}class Fu extends Xe{constructor(e){super(),this.element=e,this.element.style.position="absolute",this.addEventListener("removed",(()=>{this.traverse((function(e){e instanceof Fu&&null!==e.element.parentNode&&e.element.parentNode.removeChild(e.element)}))}))}}let Hu,Gu,ju,Vu;function Wu(e){return Math.abs(e)<1e-10?0:e}function Xu(e){const t=e.elements;return"matrix3d("+Wu(t[0])+","+Wu(-t[1])+","+Wu(t[2])+","+Wu(t[3])+","+Wu(t[4])+","+Wu(-t[5])+","+Wu(t[6])+","+Wu(t[7])+","+Wu(t[8])+","+Wu(-t[9])+","+Wu(t[10])+","+Wu(t[11])+","+Wu(t[12])+","+Wu(-t[13])+","+Wu(t[14])+","+Wu(t[15])+")"}class qu{constructor(e,t){this.cache={camera:{fov:0,style:""},objects:new WeakMap},e||(e=document.createElement("div")),e.style.overflow="hidden",e.style.pointerEvents="auto",this.domElement=e,t||(t=document.createElement("div")),t.style.transformStyle="preserve-3d",t.style.pointerEvents="auto",t.style.position="absolute",t.style.top="0",e.appendChild(t),this.cameraElement=t}setSize(e,t){Hu=e/2,Gu=t/2,this.domElement.style.width=e+"px",this.domElement.style.height=t+"px",this.cameraElement.style.width=e+"px",this.cameraElement.style.height=t+"px"}renderObject(e,t,n,r){if(e instanceof Fu){const t=function(e,t){const n=e.elements;return"translateX(-50%)matrix3d("+Wu(n[0])+","+Wu(n[1])+","+Wu(n[2])+","+Wu(n[3])+","+Wu(-n[4])+","+Wu(-n[5])+","+Wu(-n[6])+","+Wu(-n[7])+","+Wu(n[8])+","+Wu(n[9])+","+Wu(n[10])+","+Wu(n[11])+","+Wu(n[12])+","+Wu(n[13])+","+Wu(n[14])+","+Wu(n[15])+")"}(e.matrixWorld),n=e.element;n.style.transform=t;const r={style:t,distanceToCameraSquared:0};this.cache.objects.set(e,r),n.parentNode!==this.cameraElement&&this.cameraElement.appendChild(n)}for(let i=0,s=e.children.length;i<s;i++)this.renderObject(e.children[i],t,n,r)}render(e,t){const n=t.projectionMatrix.elements[5]*Gu;this.cache.camera.fov!==n&&(this.domElement.style.perspective=t instanceof $t?n+"px":"",this.cache.camera.fov=n),!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld();let r="";r+=t instanceof Mn?"scale("+n+")translateX("+Wu(-(t.right+t.left)/2)+"px)"+Xu(t.matrixWorldInverse):"translateZ("+n+"px)"+Xu(t.matrixWorldInverse);const i=r+"translate("+Hu+"px,"+Gu+"px)";this.cameraElement.style.transform=i,this.cache.camera.style=i,this.renderObject(e,e,t,r)}}class Yu extends Xe{constructor(e){super(),this.element=e,this.element.style.position="absolute",this.addEventListener("removed",(()=>{this.traverse((function(e){e instanceof Yu&&null!==e.element.parentNode&&e.element.parentNode.removeChild(e.element)}))}))}}function Zu(e){return Math.abs(e)<1e-10?0:e}function Ju(e){const t=e.elements;return"matrix3d("+Zu(t[0])+","+Zu(-t[1])+","+Zu(t[2])+","+Zu(t[3])+","+Zu(t[4])+","+Zu(-t[5])+","+Zu(t[6])+","+Zu(t[7])+","+Zu(t[8])+","+Zu(-t[9])+","+Zu(t[10])+","+Zu(t[11])+","+Zu(t[12])+","+Zu(-t[13])+","+Zu(t[14])+","+Zu(t[15])+")"}class Qu{constructor(e,t){this.cache={camera:{fov:0,style:""},objects:new WeakMap},e||(e=document.createElement("div")),e.style.overflow="hidden",e.style.pointerEvents="auto",this.domElement=e,t||(t=document.createElement("div")),t.style.transformStyle="preserve-3d",t.style.pointerEvents="auto",t.style.position="absolute",t.style.top="0",e.appendChild(t),this.cameraElement=t}setSize(e,t){ju=e/2,Vu=t/2,this.domElement.style.width=e+"px",this.domElement.style.height=t+"px",this.cameraElement.style.width=e+"px",this.cameraElement.style.height=t+"px"}renderObject(e,t,n,r){if(e instanceof Yu){const t=n.quaternion.clone();t.x=-n.quaternion.x,t.z=-n.quaternion.z;const r=function(e,t){const n=e.elements;return"translateX(-50%)matrix3d("+Zu(n[0])+","+Zu(-n[1])+","+Zu(n[2])+","+Zu(n[3])+","+Zu(n[4])+","+Zu(-n[5])+","+Zu(n[6])+","+Zu(n[7])+","+Zu(n[8])+","+Zu(-n[9])+","+Zu(n[10])+","+Zu(n[11])+","+Zu(n[12])+","+Zu(n[13])+","+Zu(n[14])+","+Zu(n[15])+")"}((new be).compose(e.parent.getWorldPosition(new V(0,0,0)),t,e.parent.scale)),i=e.element;i.style.transform=r;const s={style:r,distanceToCameraSquared:0};this.cache.objects.set(e,s),i.parentNode!==this.cameraElement&&this.cameraElement.appendChild(i)}for(let i=0,s=e.children.length;i<s;i++)this.renderObject(e.children[i],t,n,r)}render(e,t){const n=t.projectionMatrix.elements[5]*Vu;this.cache.camera.fov!==n&&(this.domElement.style.perspective=t instanceof $t?n+"px":"",this.cache.camera.fov=n),!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld();let r="";r+=t instanceof Mn?"scale("+n+")translateX("+Zu(-(t.right+t.left)/2)+"px)"+Ju(t.matrixWorldInverse):"translateZ("+n+"px)"+Ju(t.matrixWorldInverse);const i=r+"translate("+ju+"px,"+Vu+"px)";this.cameraElement.style.transform=i,this.cache.camera.style=i,this.renderObject(e,e,t,r)}}class Ku extends Au{constructor(e){super(e,"PoiNode");const{type:t,element:n}=e;this.elementType=t,this.element=n,this.create(t)}create(e){"2D"===e||"2d"===e?this._create2D():"2.5D"===e||"2.5d"===e?this._create2DHalf():"3D"!==e&&"3d"!==e||this._create3D()}show(){this.visible=!0,this.handleHide=!1,this._setElementDisplay(!0),this.autoUpdate=!0}hide(){this.visible=!1,this.handleHide=!0,this._setElementDisplay(!1),this.autoUpdate=!0}getBoundingBox(e=50){e=e<=0?50:e;const t=new V,n=new V,r=new V(e,e,e);return t.copy(this.position),n.copy(this.position),t.sub(r),n.add(r),new q(t,n)}_create2D(){this.add(new Lu(this.element))}_create2DHalf(){this.add(new Yu(this.element))}_create3D(){this.add(new Fu(this.element))}_setElementDisplay(e){this.children.forEach((t=>{(t instanceof Lu||t instanceof Yu||t instanceof Fu)&&("2D"===this.elementType||"2d"===this.elementType?t.visible=e:e&&"none"===t.element.style.display?t.element.style.display=t.userData.elDisplay||"block":e||"none"===t.element.style.display||(t.userData.elDisplay=t.element.style.display,t.element.style.display="none"))}))}}
|
|
7
|
+
/*! *****************************************************************************
|
|
8
|
+
Copyright (c) Microsoft Corporation.
|
|
9
|
+
|
|
10
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
+
purpose with or without fee is hereby granted.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
14
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
+
***************************************************************************** */function $u(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))}class ed extends Xi{constructor(){super();const e=new qt;e.deleteAttribute("uv");const t=new Ta({side:1}),n=new Ta,r=new vl(16777215,5,28,2);r.position.set(.418,16.199,.3),this.add(r);const i=new Wt(e,t);i.position.set(-.757,13.219,.717),i.scale.set(31.713,28.305,28.591),this.add(i);const s=new Wt(e,n);s.position.set(-10.906,2.009,1.846),s.rotation.set(0,-.195,0),s.scale.set(2.328,7.905,4.651),this.add(s);const o=new Wt(e,n);o.position.set(-5.607,-.754,-.758),o.rotation.set(0,.994,0),o.scale.set(1.97,1.534,3.955),this.add(o);const a=new Wt(e,n);a.position.set(6.167,.857,7.803),a.rotation.set(0,.561,0),a.scale.set(3.927,6.285,3.687),this.add(a);const l=new Wt(e,n);l.position.set(-2.017,.018,6.124),l.rotation.set(0,.333,0),l.scale.set(2.002,4.566,2.064),this.add(l);const c=new Wt(e,n);c.position.set(2.291,-.756,-2.621),c.rotation.set(0,-.286,0),c.scale.set(1.546,1.552,1.496),this.add(c);const h=new Wt(e,n);h.position.set(-2.193,-.369,-5.547),h.rotation.set(0,.516,0),h.scale.set(3.875,3.487,2.986),this.add(h);const u=new Wt(e,td(50));u.position.set(-16.116,14.37,8.208),u.scale.set(.1,2.428,2.739),this.add(u);const d=new Wt(e,td(50));d.position.set(-16.109,18.021,-8.207),d.scale.set(.1,2.425,2.751),this.add(d);const p=new Wt(e,td(17));p.position.set(14.904,12.198,-1.832),p.scale.set(.15,4.265,6.331),this.add(p);const f=new Wt(e,td(43));f.position.set(-.462,8.89,14.52),f.scale.set(4.38,5.441,.088),this.add(f);const m=new Wt(e,td(20));m.position.set(3.235,11.486,-12.541),m.scale.set(2.5,2,.1),this.add(m);const g=new Wt(e,td(100));g.position.set(0,20,0),g.scale.set(1,.1,1),this.add(g)}}function td(e){const t=new ot;return t.color.setScalar(e),t}var nd=function(){var e=0,t=document.createElement("div");function n(e){return t.appendChild(e.dom),e}function r(n){for(var r=0;r<t.children.length;r++)t.children[r].style.display=r===n?"block":"none";e=n}t.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",t.addEventListener("click",(function(n){n.preventDefault(),r(++e%t.children.length)}),!1);var i=(performance||Date).now(),s=i,o=0,a=n(new nd.Panel("FPS","#0ff","#002")),l=n(new nd.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=n(new nd.Panel("MB","#f08","#201"));return r(0),{REVISION:16,dom:t,addPanel:n,showPanel:r,begin:function(){i=(performance||Date).now()},end:function(){o++;var e=(performance||Date).now();if(l.update(e-i,200),e>=s+1e3&&(a.update(1e3*o/(e-s),100),s=e,o=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){i=this.end()},domElement:t,setMode:r}};nd.Panel=function(e,t,n){var r=1/0,i=0,s=Math.round,o=s(window.devicePixelRatio||1),a=80*o,l=48*o,c=3*o,h=2*o,u=3*o,d=15*o,p=74*o,f=30*o,m=document.createElement("canvas");m.width=a,m.height=l,m.style.cssText="width:80px;height:48px";var g=m.getContext("2d");return g.font="bold "+9*o+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=n,g.fillRect(0,0,a,l),g.fillStyle=t,g.fillText(e,c,h),g.fillRect(u,d,p,f),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(u,d,p,f),{dom:m,update:function(l,v){r=Math.min(r,l),i=Math.max(i,l),g.fillStyle=n,g.globalAlpha=1,g.fillRect(0,0,a,d),g.fillStyle=t,g.fillText(s(l)+" "+e+" ("+s(r)+"-"+s(i)+")",c,h),g.drawImage(m,u+o,d,p-o,f,u,d,p-o,f),g.fillRect(u+p-o,d,o,f),g.fillStyle=n,g.globalAlpha=.9,g.fillRect(u+p-o,d,o,s((1-l/v)*f))}}};class rd extends Wt{constructor(){const e=rd.SkyShader,t=new Qt({name:"SkyShader",fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:Jt.clone(e.uniforms),side:1,depthWrite:!1});super(new qt(1,1,1),t)}}rd.prototype.isSky=!0,rd.SkyShader={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new V},up:{value:new V(0,1,0)}},vertexShader:"\n\t\tuniform vec3 sunPosition;\n\t\tuniform float rayleigh;\n\t\tuniform float turbidity;\n\t\tuniform float mieCoefficient;\n\t\tuniform vec3 up;\n\n\t\tvarying vec3 vWorldPosition;\n\t\tvarying vec3 vSunDirection;\n\t\tvarying float vSunfade;\n\t\tvarying vec3 vBetaR;\n\t\tvarying vec3 vBetaM;\n\t\tvarying float vSunE;\n\n\t\t// constants for atmospheric scattering\n\t\tconst float e = 2.71828182845904523536028747135266249775724709369995957;\n\t\tconst float pi = 3.141592653589793238462643383279502884197169;\n\n\t\t// wavelength of used primaries, according to preetham\n\t\tconst vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 );\n\t\t// this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function:\n\t\t// (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn))\n\t\tconst vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 );\n\n\t\t// mie stuff\n\t\t// K coefficient for the primaries\n\t\tconst float v = 4.0;\n\t\tconst vec3 K = vec3( 0.686, 0.678, 0.666 );\n\t\t// MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K\n\t\tconst vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 );\n\n\t\t// earth shadow hack\n\t\t// cutoffAngle = pi / 1.95;\n\t\tconst float cutoffAngle = 1.6110731556870734;\n\t\tconst float steepness = 1.5;\n\t\tconst float EE = 1000.0;\n\n\t\tfloat sunIntensity( float zenithAngleCos ) {\n\t\t\tzenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 );\n\t\t\treturn EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) );\n\t\t}\n\n\t\tvec3 totalMie( float T ) {\n\t\t\tfloat c = ( 0.2 * T ) * 10E-18;\n\t\t\treturn 0.434 * c * MieConst;\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\t\t\tvWorldPosition = worldPosition.xyz;\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n\t\t\tvSunDirection = normalize( sunPosition );\n\n\t\t\tvSunE = sunIntensity( dot( vSunDirection, up ) );\n\n\t\t\tvSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 );\n\n\t\t\tfloat rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) );\n\n\t\t\t// extinction (absorbtion + out scattering)\n\t\t\t// rayleigh coefficients\n\t\t\tvBetaR = totalRayleigh * rayleighCoefficient;\n\n\t\t\t// mie coefficients\n\t\t\tvBetaM = totalMie( turbidity ) * mieCoefficient;\n\n\t\t}",fragmentShader:"\n\t\tvarying vec3 vWorldPosition;\n\t\tvarying vec3 vSunDirection;\n\t\tvarying float vSunfade;\n\t\tvarying vec3 vBetaR;\n\t\tvarying vec3 vBetaM;\n\t\tvarying float vSunE;\n\n\t\tuniform float mieDirectionalG;\n\t\tuniform vec3 up;\n\n\t\tconst vec3 cameraPos = vec3( 0.0, 0.0, 0.0 );\n\n\t\t// constants for atmospheric scattering\n\t\tconst float pi = 3.141592653589793238462643383279502884197169;\n\n\t\tconst float n = 1.0003; // refractive index of air\n\t\tconst float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius)\n\n\t\t// optical length at zenith for molecules\n\t\tconst float rayleighZenithLength = 8.4E3;\n\t\tconst float mieZenithLength = 1.25E3;\n\t\t// 66 arc seconds -> degrees, and the cosine of that\n\t\tconst float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;\n\n\t\t// 3.0 / ( 16.0 * pi )\n\t\tconst float THREE_OVER_SIXTEENPI = 0.05968310365946075;\n\t\t// 1.0 / ( 4.0 * pi )\n\t\tconst float ONE_OVER_FOURPI = 0.07957747154594767;\n\n\t\tfloat rayleighPhase( float cosTheta ) {\n\t\t\treturn THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) );\n\t\t}\n\n\t\tfloat hgPhase( float cosTheta, float g ) {\n\t\t\tfloat g2 = pow( g, 2.0 );\n\t\t\tfloat inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 );\n\t\t\treturn ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse );\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvec3 direction = normalize( vWorldPosition - cameraPos );\n\n\t\t\t// optical length\n\t\t\t// cutoff angle at 90 to avoid singularity in next formula.\n\t\t\tfloat zenithAngle = acos( max( 0.0, dot( up, direction ) ) );\n\t\t\tfloat inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) );\n\t\t\tfloat sR = rayleighZenithLength * inverse;\n\t\t\tfloat sM = mieZenithLength * inverse;\n\n\t\t\t// combined extinction factor\n\t\t\tvec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) );\n\n\t\t\t// in scattering\n\t\t\tfloat cosTheta = dot( direction, vSunDirection );\n\n\t\t\tfloat rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 );\n\t\t\tvec3 betaRTheta = vBetaR * rPhase;\n\n\t\t\tfloat mPhase = hgPhase( cosTheta, mieDirectionalG );\n\t\t\tvec3 betaMTheta = vBetaM * mPhase;\n\n\t\t\tvec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) );\n\t\t\tLin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) );\n\n\t\t\t// nightsky\n\t\t\tfloat theta = acos( direction.y ); // elevation --\x3e y-axis, [-pi/2, pi/2]\n\t\t\tfloat phi = atan( direction.z, direction.x ); // azimuth --\x3e x-axis [-pi/2, pi/2]\n\t\t\tvec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 );\n\t\t\tvec3 L0 = vec3( 0.1 ) * Fex;\n\n\t\t\t// composition + solar disc\n\t\t\tfloat sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta );\n\t\t\tL0 += ( vSunE * 19000.0 * Fex ) * sundisk;\n\n\t\t\tvec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 );\n\n\t\t\tvec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) );\n\n\t\t\tgl_FragColor = vec4( retColor, 1.0 );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\n\t\t}"};
|
|
21
|
+
/*! *****************************************************************************
|
|
22
|
+
Copyright (c) Microsoft Corporation.
|
|
23
|
+
|
|
24
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
25
|
+
purpose with or without fee is hereby granted.
|
|
26
|
+
|
|
27
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
28
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
29
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
30
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
31
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
32
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
33
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
34
|
+
***************************************************************************** */
|
|
35
|
+
var id=function(e,t){return(id=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},sd=function(){return(sd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function od(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ad(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,s=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return o}function ld(e){return this instanceof ld?(this.v=e,this):new ld(e)}var cd=Object.freeze({__proto__:null,__extends:function(e,t){function n(){this.constructor=e}id(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},get __assign(){return sd},__rest:function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},__decorate:function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o},__param:function(e,t){return function(n,r){t(n,r,e)}},__metadata:function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter:function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))},__generator:function(e,t){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},__createBinding:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},__exportStar:function(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])},__values:od,__read:ad,__spread:function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(ad(arguments[t]));return e},__spreadArrays:function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,i++)r[i]=s[o];return r},__await:ld,__asyncGenerator:function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),s=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){s.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{(n=i[e](t)).value instanceof ld?Promise.resolve(n.value.v).then(l,c):h(s[0][2],n)}catch(e){h(s[0][3],e)}var n}function l(e){a("next",e)}function c(e){a("throw",e)}function h(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}},__asyncDelegator:function(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:ld(e[r](t)),done:"return"===r}:i?i(t):t}:i}},__asyncValues:function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=od(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,i,(t=e[n](t)).done,t.value)}))}}},__makeTemplateObject:function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},__importStar:function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},__importDefault:function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet:function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},__classPrivateFieldSet:function(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}}),hd=function(){function e(t,n){if(void 0===n&&(n=null),this.nonEmpty=!1,t||n){if(!t)throw new Error("Parameter head cannot be null.");this.head=t,this.tail=n||e.NIL,this.nonEmpty=!0}else{if(e.NIL)throw new Error("Parameters head and tail are null. Use the NIL element instead.");this.nonEmpty=!1}}return Object.defineProperty(e.prototype,"length",{get:function(){if(!this.nonEmpty)return 0;if(this.tail===e.NIL)return 1;for(var t=0,n=this;n.nonEmpty;)++t,n=n.tail;return t},enumerable:!0,configurable:!0}),e.prototype.prepend=function(t){return new e(t,this)},e.prototype.append=function(t){if(!t)return this;if(!this.nonEmpty)return new e(t);if(this.tail===e.NIL)return new e(t).prepend(this.head);for(var n=new e(this.head),r=n,i=this.tail;i.nonEmpty;)r=r.tail=new e(i.head),i=i.tail;return r.tail=new e(t),n},e.prototype.insertWithPriority=function(t){if(!this.nonEmpty)return new e(t);var n=t.priority;if(n>this.head.priority)return this.prepend(t);for(var r=new e(this.head),i=r,s=this.tail;s.nonEmpty;){if(n>s.head.priority)return i.tail=s.prepend(t),r;i=i.tail=new e(s.head),s=s.tail}return i.tail=new e(t),r},e.prototype.filterNot=function(t){if(!this.nonEmpty||null==t)return this;if(t===this.head.listener)return this.tail;for(var n=new e(this.head),r=n,i=this.tail;i.nonEmpty;){if(i.head.listener===t)return r.tail=i.tail,n;r=r.tail=new e(i.head),i=i.tail}return this},e.prototype.contains=function(e){if(!this.nonEmpty)return!1;for(var t=this;t.nonEmpty;){if(t.head.listener===e)return!0;t=t.tail}return!1},e.prototype.find=function(e){if(!this.nonEmpty)return null;for(var t=this;t.nonEmpty;){if(t.head.listener===e)return t.head;t=t.tail}return null},e.prototype.toString=function(){for(var e="",t=this;t.nonEmpty;)e+=t.head+" -> ",t=t.tail;return"[List "+(e+="NIL")+"]"},e.NIL=new e(null,null),e}(),ud=Object.defineProperty({SlotList:hd},"__esModule",{value:!0}),dd=function(){function e(e,t,n,r){void 0===n&&(n=!1),void 0===r&&(r=0),this._enabled=!0,this._once=!1,this._priority=0,this._listener=e,this._once=n,this._signal=t,this._priority=r,this.verifyListener(e)}return e.prototype.execute0=function(){this._enabled&&(this._once&&this.remove(),this._params&&this._params.length?this._listener.apply(null,this._params):this._listener())},e.prototype.execute1=function(e){this._enabled&&(this._once&&this.remove(),this._params&&this._params.length?this._listener.apply(null,[e].concat(this._params)):this._listener(e))},e.prototype.execute=function(e){if(this._enabled){this._once&&this.remove(),this._params&&this._params.length&&(e=e.concat(this._params));var t=e.length;0===t?this._listener():1===t?this._listener(e[0]):2===t?this._listener(e[0],e[1]):3===t?this._listener(e[0],e[1],e[2]):this._listener.apply(null,e)}},Object.defineProperty(e.prototype,"listener",{get:function(){return this._listener},set:function(e){if(null==e)throw new Error("Given listener is null.\nDid you want to set enabled to false instead?");this.verifyListener(e),this._listener=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"once",{get:function(){return this._once},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"priority",{get:function(){return this._priority},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return"[Slot listener: "+this._listener+", once: "+this._once+", priority: "+this._priority+", enabled: "+this._enabled+"]"},Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(e){this._enabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"params",{get:function(){return this._params},set:function(e){this._params=e},enumerable:!0,configurable:!0}),e.prototype.remove=function(){this._signal.remove(this._listener)},e.prototype.verifyListener=function(e){if(null==e)throw new Error("Given listener is null.");if(null==this._signal)throw new Error("Internal signal reference has not been set yet.")},e}(),pd=Object.defineProperty({Slot:dd},"__esModule",{value:!0}),fd=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.slots=ud.SlotList.NIL,this.valueClasses=1===e.length&&e[0]instanceof Array?e[0]:e}return Object.defineProperty(e.prototype,"valueClasses",{get:function(){return this._valueClasses},set:function(e){this._valueClasses=e?e.slice():[];for(var t=this._valueClasses.length;t--;)if(!(this._valueClasses[t]instanceof Object))throw new Error("Invalid valueClasses argument: item at index "+t+" should be a Class but was:<"+this._valueClasses[t]+">."+this._valueClasses[t])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numListeners",{get:function(){return this.slots.length},enumerable:!0,configurable:!0}),e.prototype.addOnce=function(e){return this.registerListener(e,!0)},e.prototype.remove=function(e){var t=this.slots.find(e);return t?(this.slots=this.slots.filterNot(e),t):null},e.prototype.removeAll=function(){this.slots=ud.SlotList.NIL},e.prototype.dispatch=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this._valueClasses.length,r=e.length;if(r<n)throw new Error("Incorrect number of arguments. Expected at least "+n+" but received "+r+".");for(var i=0;i<n;i++)if(!(null===e[i]||e[i]instanceof this._valueClasses[i]||e[i].constructor===this._valueClasses[i]))throw new Error("Value object <"+e[i]+"> is not an instance of <"+this._valueClasses[i]+">.");var s=this.slots;if(s.nonEmpty)for(;s.nonEmpty;)s.head.execute(e),s=s.tail},e.prototype.registerListener=function(e,t){if(void 0===t&&(t=!1),this.registrationPossible(e,t)){var n=new pd.Slot(e,this,t);return this.slots=this.slots.prepend(n),n}return this.slots.find(e)},e.prototype.registrationPossible=function(e,t){if(!this.slots.nonEmpty)return!0;var n=this.slots.find(e);if(!n)return!0;if(n.once!==t)throw new Error("You cannot addOnce() then add() the same listener without removing the relationship first.");return!1},e}(),md=Object.defineProperty({OnceSignal:fd},"__esModule",{value:!0}),gd="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function vd(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.')}var yd=function(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}(cd),xd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yd.__extends(t,e),t.prototype.add=function(e){return this.registerListener(e)},t}(md.OnceSignal),wd=Object.defineProperty({Signal:xd},"__esModule",{value:!0}),bd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yd.__extends(t,e),t.prototype.addWithPriority=function(e,t){return void 0===t&&(t=0),this.registerListenerWithPriority(e,!1,t)},t.prototype.addOnceWithPriority=function(e,t){return void 0===t&&(t=0),this.registerListenerWithPriority(e,!0,t)},t.prototype.registerListener=function(e,t){return void 0===t&&(t=!1),this.registerListenerWithPriority(e,t)},t.prototype.registerListenerWithPriority=function(e,t,n){if(void 0===n&&(n=0),this.registrationPossible(e,t)){var r=new pd.Slot(e,this,t,n);return this.slots=this.slots.insertWithPriority(r),r}return this.slots.find(e)},t}(wd.Signal),_d=Object.defineProperty({PrioritySignal:bd},"__esModule",{value:!0}),Md=function(e){function t(t){void 0===t&&(t=null);for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this;return n=1===n.length&&n[0]instanceof Array?n[0]:n,(i=e.call(this,n)||this)._target=t,i}return yd.__extends(t,e),Object.defineProperty(t.prototype,"target",{get:function(){return this._target},set:function(e){e!==this._target&&(this.removeAll(),this._target=e)},enumerable:!0,configurable:!0}),t.prototype.dispatch=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this._valueClasses.length,r=e.length;if(r<n)throw new Error("Incorrect number of arguments. Expected at least "+n+" but received "+r+".");for(var i=0;i<n;i++)if(null!==e[i]&&e[i].constructor!==this._valueClasses[i])throw new Error("Value object <"+e[i]+"> is not an instance of <"+this._valueClasses[i]+">.");var s=e[0];s&&(s.target&&(s=s.clone(),e[0]=s),s.target=this.target,s.currentTarget=this.target,s.signal=this);for(var o=this.slots;o.nonEmpty;)o.head.execute(e),o=o.tail;if(s&&s.bubbles)for(var a=this.target;a&&a.hasOwnProperty("parent")&&(null===(a=a.parent).onEventBubbled||(s.currentTarget=a,a.onEventBubbled(s))););},t}(_d.PrioritySignal),Sd=Object.defineProperty({DeluxeSignal:Md},"__esModule",{value:!0}),Td=function(){function e(e){void 0===e&&(e=!1),this._bubbles=e}return Object.defineProperty(e.prototype,"signal",{get:function(){return this._signal},set:function(e){this._signal=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._target},set:function(e){this._target=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTarget",{get:function(){return this._currentTarget},set:function(e){this._currentTarget=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bubbles",{get:function(){return this._bubbles},set:function(e){this._bubbles=e},enumerable:!0,configurable:!0}),e.prototype.clone=function(){return new e(this._bubbles)},e}(),Ed=Object.defineProperty({GenericEvent:Td},"__esModule",{value:!0}),Ad=Symbol("IOnceSignal"),Cd=Object.defineProperty({IOnceSignal:Ad},"__esModule",{value:!0}),Pd=Symbol("IPrioritySignal"),Rd=Object.defineProperty({IPrioritySignal:Pd},"__esModule",{value:!0}),Ld=Symbol("ISignal"),Id=Object.defineProperty({ISignal:Ld},"__esModule",{value:!0}),Dd=Symbol("ISlot"),Od=Object.defineProperty({ISlot:Dd},"__esModule",{value:!0}),Bd=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.valueClasses=1===e.length&&e[0]instanceof Array?e[0]:e}return Object.defineProperty(e.prototype,"valueClasses",{get:function(){return this._valueClasses},set:function(e){this._valueClasses=e?e.slice():[];for(var t=this._valueClasses.length;t--;)if("function"!=typeof this._valueClasses[t])throw new Error("Invalid valueClasses argument: item at index "+t+" should be a Class but was:<"+this._valueClasses[t]+"'>."+this._valueClasses[t])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numListeners",{get:function(){return this.slot?1:0},enumerable:!0,configurable:!0}),e.prototype.add=function(e){return this.registerListener(e)},e.prototype.addOnce=function(e){return this.registerListener(e,!0)},e.prototype.remove=function(e){if(this.slot&&this.slot.listener===e){var t=this.slot;return this.slot=null,t}return null},e.prototype.removeAll=function(){this.slot&&this.slot.remove()},e.prototype.dispatch=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this._valueClasses.length,r=e.length;if(r<n)throw new Error("Incorrect number of arguments. Expected at least "+n+" but received "+r+".");for(var i=0;i<n;i++)if(!(null===e[i]||e[i]instanceof this._valueClasses[i]||e[i].constructor===this._valueClasses[i]))throw new Error("Value object <"+e[i]+"> is not an instance of <"+this._valueClasses[i]+">.");this.slot&&this.slot.execute(e)},e.prototype.registerListener=function(e,t){if(void 0===t&&(t=!1),this.slot)throw new Error("You cannot add or addOnce with a listener already added, remove the current listener first.");return this.slot=new pd.Slot(e,this,t)},e}(),Nd=Object.defineProperty({MonoSignal:Bd},"__esModule",{value:!0}),zd=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return yd.__extends(t,e),t.prototype.addOnce=function(t){var n=e.prototype.addOnce.call(this,t);return this.isDispatched&&(n.execute(this.valueObjects),n.remove()),n},t.prototype.dispatch=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(this.isDispatched)throw new Error("You cannot dispatch() a Promise more than once");this.isDispatched=!0,this.valueObjects=t,e.prototype.dispatch.apply(this,t)},t}(md.OnceSignal),Ud=Object.defineProperty({Promise:zd},"__esModule",{value:!0});Sd.DeluxeSignal,Ed.GenericEvent,Cd.IOnceSignal,Rd.IPrioritySignal,Id.ISignal,Od.ISlot,Nd.MonoSignal,md.OnceSignal,_d.PrioritySignal,Ud.Promise;var kd=wd.Signal;pd.Slot,ud.SlotList;const Fd=new Xi;Fd.name="Scene";class Hd{constructor(e){this.signals=e,this.scene=Fd.clone(),this.scene.castShadow=!0,this.scene.receiveShadow=!0,this.selectedObjects={edge:[],stroke:[],opacity:[],highlight:[],emissive:[]},this.intersectsList={meshOfModelList:[],poiIconList:[],otherObjList:[],getAll:function(){return[...this.meshOfModelList,...this.poiIconList,...this.otherObjList]}}}addObject(e,t){t?t.add(e):this.scene.add(e),this._triggerObjectAdded(e),this.signals.objectAdded.dispatch(e)}removeObject(e){var t;function n(e){var t;e instanceof Aa&&(t=e.map)&&t.isTexture&&t.dispose(),e.dispose()}e.traverse((e=>{if("Mesh"===e.type){const t=e;t.geometry.dispose(),ru(t.material)?t.material.forEach((e=>n(e))):t.material instanceof Aa&&n(t.material)}e instanceof Ku&&e.element.remove();const{meshOfModelList:t,poiIconList:r,otherObjList:i}=this.intersectsList,s=t.findIndex((t=>t.uuid===e.uuid)),o=r.findIndex((t=>t.uuid===e.uuid)),a=i.findIndex((t=>t.uuid===e.uuid));s>-1&&this.intersectsList.meshOfModelList.splice(s,1),o>-1&&this.intersectsList.poiIconList.splice(o,1),a>-1&&this.intersectsList.otherObjList.splice(a,1)})),null===(t=e.parent)||void 0===t||t.remove(e),this.signals.objectRemoved.dispatch()}openSceneFog(e={}){const{color:t=13426943,near:n=500,far:r=5e4}=e;this.scene.fog=new Wi(t,n,r),this.signals.sceneChanged.dispatch()}closeSceneFog(){this.scene.fog=null,this.signals.sceneChanged.dispatch()}edgeShow(e,t){const n=[],r=e=>{-1===this.selectedObjects.edge.findIndex((t=>t.uuid===e.uuid))&&n.push(e)};return ru(e)?e.forEach((e=>r(e))):iu(e)&&r(e),this.selectedObjects.edge=[...this.selectedObjects.edge,...n],this.signals.outlineChange.dispatch({objects:this.selectedObjects.edge,options:t}),Promise.resolve()}unEdgeShow(e){e||(e=[...this.selectedObjects.edge]);const t=e=>{const t=this.selectedObjects.edge.findIndex((t=>t.uuid===e.uuid));return-1===t||(this.selectedObjects.edge.splice(t,1),this.signals.outlineChange.dispatch({objects:this.selectedObjects.edge})),Promise.resolve()};return ru(e)?Promise.all(e.map((e=>t(e)))):iu(e)?t(e):Promise.resolve()}strokeShow(e,t={}){const{isOpacityShow:n=!0,color:r=4647927,opacity:i=.2,edgeColor:s=61183,edgeOpacity:o=1}=t,a=e=>{if(-1!==this.selectedObjects.stroke.findIndex((t=>t.uuid===e.uuid)))return Promise.resolve();if(e.userData.strokeGroup)return Promise.resolve();const t=new Pu({id:e.uuid});return e.traverse((e=>{if(e instanceof Wt&&e.geometry){const n=new Oo(e.geometry.clone(),89),r=new Hs(n,new Is({color:s,transparent:!0,opacity:o}));Yh(r,e),t.add(r)}})),e.userData.strokeGroup=t,this.addObject(t),this.selectedObjects.stroke.push(e),Promise.resolve()};return n&&this.opacityShow(e,{color:r,opacity:i}),ru(e)?Promise.all(e.map((e=>a(e)))):iu(e)?a(e):Promise.resolve()}unStrokeShow(e){e||(e=[...this.selectedObjects.stroke]);const t=e=>{if(!e.userData.strokeGroup)return Promise.resolve();this.removeObject(e.userData.strokeGroup),Reflect.deleteProperty(e.userData,"strokeGroup");const t=this.selectedObjects.stroke.findIndex((t=>t.uuid===e.uuid));return-1===t||(this.selectedObjects.stroke.splice(t,1),this.signals.geometryChanged.dispatch(),this.unOpacityShow(e)),Promise.resolve()};return ru(e)?Promise.all(e.map((e=>t(e)))):iu(e)?t(e):Promise.resolve()}opacityShow(e,t={}){const{color:n="#fff",opacity:r=.8}=t;function i(e){if(e.userData.material)return e;const t=e.clone();return(e=Reflect.construct(e.constructor,[{transparent:!0,color:n,opacity:r}])).userData.material=t,e}const s=e=>(-1!==this.selectedObjects.opacity.findIndex((t=>t.uuid===e.uuid))||(e.traverse((e=>{e instanceof Wt&&(ru(e.material)?e.material.forEach(((t,n)=>{e.material[n]=i(t)})):e.material instanceof st&&(e.material=i(e.material)))})),this.signals.materialChanged.dispatch(),this.selectedObjects.opacity.push(e)),Promise.resolve());return ru(e)?Promise.all(e.map((e=>s(e)))):iu(e)?s(e):Promise.resolve()}unOpacityShow(e){function t(e){if(!e.userData.material)return e;const t=e.userData.material.clone();return e.userData={},t}e||(e=[...this.selectedObjects.opacity]);const n=e=>new Promise((n=>{const r=this.selectedObjects.opacity.findIndex((t=>t.uuid===e.uuid));-1===r&&n(),this.selectedObjects.opacity.splice(r,1),e.traverse((e=>{e instanceof Wt&&(ru(e.material)?e.material.forEach(((n,r)=>{e.material[r]=t(n)})):e.material instanceof st&&(e.material=t(e.material)))})),this.signals.materialChanged.dispatch(),n()}));return ru(e)?Promise.all(e.map((e=>n(e)))):iu(e)?n(e):Promise.resolve()}highlightShow(e,t={}){const{color:n="red",opacity:r=1}=t;function i(e){if(e instanceof Aa||e instanceof Ta){if(e.userData.color&&e.userData.opacity)return;e.userData={color:e.color.clone(),opacity:e.opacity,transparent:e.transparent},e.color=new P(n),e.opacity=r,e.transparent=r<1}}const s=e=>(-1!==this.selectedObjects.highlight.findIndex((t=>t.uuid===e.uuid))||(e.traverse((e=>{e instanceof Wt&&(ru(e.material)?e.material.forEach((e=>i(e))):e.material instanceof st&&i(e.material))})),this.signals.materialChanged.dispatch(),this.selectedObjects.highlight.push(e)),Promise.resolve());return ru(e)?Promise.all(e.map((e=>s(e)))):iu(e)?s(e):Promise.resolve()}unHighlightShow(e){function t(e){if(e instanceof Aa||e instanceof Ta){if(!e.userData.color&&!e.userData.opacity)return;e.color=e.userData.color,e.opacity=e.userData.opacity,e.transparent=e.userData.transparent,e.userData={}}}e||(e=[...this.selectedObjects.highlight]);const n=e=>new Promise((n=>{const r=this.selectedObjects.highlight.findIndex((t=>t.uuid===e.uuid));-1===r&&n(),this.selectedObjects.highlight.splice(r,1),e.traverse((e=>{e instanceof Wt&&(ru(e.material)?e.material.forEach((e=>t(e))):e.material instanceof st&&t(e.material))})),this.signals.materialChanged.dispatch(),n()}));return ru(e)?Promise.all(e.map((e=>n(e)))):iu(e)?n(e):Promise.resolve()}emissiveShow(e,t={}){const{color:n="red",opacity:r=.3,maxOpacity:i=1,minOpacity:s=0,duration:o=1e3}=t;function a(e){if(e instanceof Aa||e instanceof Ta){if(e.userData.emissive&&e.userData.opacity)return;e.userData={emissive:e.emissive.clone(),opacity:e.emissiveIntensity,animation:null},e.emissive.set(n),e.emissiveIntensity=r,Tu({emissiveIntensity:i},{emissiveIntensity:s},{duration:o,repeat:!0},(t=>e.emissiveIntensity=t.emissiveIntensity),(t=>e.userData.animation=t))}}const l=e=>(-1!==this.selectedObjects.emissive.findIndex((t=>t.uuid===e.uuid))||(e.traverse((e=>{e instanceof Wt&&(ru(e.material)?e.material.forEach((e=>a(e))):e.material instanceof st&&a(e.material))})),this.selectedObjects.emissive.push(e),this.signals.materialChanged.dispatch()),Promise.resolve());return ru(e)?Promise.all(e.map((e=>l(e)))):iu(e)?l(e):Promise.resolve()}unEmissiveShow(e){function t(e){var t;if(e instanceof Aa||e instanceof Ta){if(!e.userData.emissive&&!e.userData.opacity)return;e.emissive=e.userData.emissive.clone(),e.emissiveIntensity=e.userData.opacity,null===(t=e.userData.animation)||void 0===t||t.stop(),e.userData={}}}e||(e=[...this.selectedObjects.emissive]);const n=e=>new Promise((n=>{const r=this.selectedObjects.emissive.findIndex((t=>t.uuid===e.uuid));-1===r&&n(),this.selectedObjects.emissive.splice(r,1),e.traverse((e=>{e instanceof Wt&&(ru(e.material)?e.material.forEach((e=>t(e))):e.material instanceof st&&t(e.material))})),this.signals.materialChanged.dispatch(),n()}));return ru(e)?Promise.all(e.map((e=>n(e)))):iu(e)?n(e):Promise.resolve()}_triggerObjectAdded(e){e instanceof Au?"Sbm"===e.stype||"Model"===e.stype?e.traverse((e=>{e instanceof Wt&&-1===this.intersectsList.meshOfModelList.findIndex((t=>t.uuid===e.uuid))&&this.intersectsList.meshOfModelList.push(e)})):"Poi"===e.stype?-1===this.intersectsList.poiIconList.findIndex((t=>t.uuid===e.icon.uuid))&&this.intersectsList.meshOfModelList.push(e.icon):"BaseMesh"===e.stype?-1===this.intersectsList.otherObjList.findIndex((t=>t.uuid===e.uuid))&&this.intersectsList.otherObjList.push(e):"Group"===e.stype&&e.children.forEach((e=>this._triggerObjectAdded(e))):e instanceof Eu?-1===this.intersectsList.otherObjList.findIndex((t=>t.uuid===e.uuid))&&this.intersectsList.otherObjList.push(e):"Object3D"===e.type&&e.traverse((e=>{e instanceof Wt&&-1===this.intersectsList.otherObjList.findIndex((t=>t.uuid===e.uuid))&&this.intersectsList.otherObjList.push(e)}))}}const Gd={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\tgl_FragColor = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor.a *= opacity;\n\n\n\t\t}"};class jd{constructor(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}const Vd=new Mn(-1,1,1,-1,0,1),Wd=new At;Wd.setAttribute("position",new yt([-1,3,0,-1,-1,0,3,-1,0],3)),Wd.setAttribute("uv",new yt([0,2,0,0,2,0],2));class Xd{constructor(e){this._mesh=new Wt(Wd,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,Vd)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}class qd extends jd{constructor(e,t){super(),this.textureID=void 0!==t?t:"tDiffuse",e instanceof Qt?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=Jt.clone(e.uniforms),this.material=new Qt({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new Xd(this.material)}render(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}}class Yd extends jd{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,n){const r=e.getContext(),i=e.state;let s,o;i.buffers.color.setMask(!1),i.buffers.depth.setMask(!1),i.buffers.color.setLocked(!0),i.buffers.depth.setLocked(!0),this.inverse?(s=0,o=1):(s=1,o=0),i.buffers.stencil.setTest(!0),i.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),i.buffers.stencil.setFunc(r.ALWAYS,s,4294967295),i.buffers.stencil.setClear(o),i.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),i.buffers.color.setLocked(!1),i.buffers.depth.setLocked(!1),i.buffers.stencil.setLocked(!1),i.buffers.stencil.setFunc(r.EQUAL,1,4294967295),i.buffers.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),i.buffers.stencil.setLocked(!0)}}class Zd extends jd{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class Jd{constructor(e,t){if(this.renderer=e,void 0===t){const n=e.getSize(new p);this._pixelRatio=e.getPixelRatio(),this._width=n.width,this._height=n.height,(t=new z(this._width*this._pixelRatio,this._height*this._pixelRatio)).texture.name="EffectComposer.rt1"}else this._pixelRatio=1,this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],void 0===Gd&&console.error("THREE.EffectComposer relies on CopyShader"),void 0===qd&&console.error("THREE.EffectComposer relies on ShaderPass"),this.copyPass=new qd(Gd),this.clock=new Fl}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);-1!==t&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){void 0===e&&(e=this.clock.getDelta());const t=this.renderer.getRenderTarget();let n=!1;for(let t=0,r=this.passes.length;t<r;t++){const r=this.passes[t];if(!1!==r.enabled){if(r.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(t),r.render(this.renderer,this.writeBuffer,this.readBuffer,e,n),r.needsSwap){if(n){const t=this.renderer.getContext(),n=this.renderer.state.buffers.stencil;n.setFunc(t.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),n.setFunc(t.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==Yd&&(r instanceof Yd?n=!0:r instanceof Zd&&(n=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(void 0===e){const t=this.renderer.getSize(new p);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,(e=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget1.setSize(n,r),this.renderTarget2.setSize(n,r);for(let e=0;e<this.passes.length;e++)this.passes[e].setSize(n,r)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}}new Mn(-1,1,1,-1,0,1);const Qd=new At;Qd.setAttribute("position",new yt([-1,3,0,-1,-1,0,3,-1,0],3)),Qd.setAttribute("uv",new yt([0,2,0,0,2,0],2));class Kd extends jd{constructor(e,t,n,r,i){super(),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=r,this.clearAlpha=void 0!==i?i:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new P}render(e,t,n){const r=e.autoClear;let i,s;e.autoClear=!1,void 0!==this.overrideMaterial&&(s=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor&&(e.getClearColor(this._oldClearColor),i=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:n),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor&&e.setClearColor(this._oldClearColor,i),void 0!==this.overrideMaterial&&(this.scene.overrideMaterial=s),e.autoClear=r}}class $d extends jd{constructor(e,t,n,r){super(),this.renderScene=t,this.renderCamera=n,this.selectedObjects=void 0!==r?r:[],this.visibleEdgeColor=new P(1,1,1),this.hiddenEdgeColor=new P(.1,.04,.02),this.edgeGlow=0,this.usePatternTexture=!1,this.edgeThickness=1,this.edgeStrength=3,this.downSampleRatio=2,this.pulsePeriod=0,this._visibilityCache=new Map,this.resolution=void 0!==e?new p(e.x,e.y):new p(256,256);const i=Math.round(this.resolution.x/this.downSampleRatio),s=Math.round(this.resolution.y/this.downSampleRatio);this.renderTargetMaskBuffer=new z(this.resolution.x,this.resolution.y),this.renderTargetMaskBuffer.texture.name="OutlinePass.mask",this.renderTargetMaskBuffer.texture.generateMipmaps=!1,this.depthMaterial=new Pi,this.depthMaterial.side=2,this.depthMaterial.depthPacking=3201,this.depthMaterial.blending=0,this.prepareMaskMaterial=this.getPrepareMaskMaterial(),this.prepareMaskMaterial.side=2,this.prepareMaskMaterial.fragmentShader=function(e,t){const n=t.isPerspectiveCamera?"perspective":"orthographic";return e.replace(/DEPTH_TO_VIEW_Z/g,n+"DepthToViewZ")}(this.prepareMaskMaterial.fragmentShader,this.renderCamera),this.renderTargetDepthBuffer=new z(this.resolution.x,this.resolution.y),this.renderTargetDepthBuffer.texture.name="OutlinePass.depth",this.renderTargetDepthBuffer.texture.generateMipmaps=!1,this.renderTargetMaskDownSampleBuffer=new z(i,s),this.renderTargetMaskDownSampleBuffer.texture.name="OutlinePass.depthDownSample",this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps=!1,this.renderTargetBlurBuffer1=new z(i,s),this.renderTargetBlurBuffer1.texture.name="OutlinePass.blur1",this.renderTargetBlurBuffer1.texture.generateMipmaps=!1,this.renderTargetBlurBuffer2=new z(Math.round(i/2),Math.round(s/2)),this.renderTargetBlurBuffer2.texture.name="OutlinePass.blur2",this.renderTargetBlurBuffer2.texture.generateMipmaps=!1,this.edgeDetectionMaterial=this.getEdgeDetectionMaterial(),this.renderTargetEdgeBuffer1=new z(i,s),this.renderTargetEdgeBuffer1.texture.name="OutlinePass.edge1",this.renderTargetEdgeBuffer1.texture.generateMipmaps=!1,this.renderTargetEdgeBuffer2=new z(Math.round(i/2),Math.round(s/2)),this.renderTargetEdgeBuffer2.texture.name="OutlinePass.edge2",this.renderTargetEdgeBuffer2.texture.generateMipmaps=!1,this.separableBlurMaterial1=this.getSeperableBlurMaterial(4),this.separableBlurMaterial1.uniforms.texSize.value.set(i,s),this.separableBlurMaterial1.uniforms.kernelRadius.value=1,this.separableBlurMaterial2=this.getSeperableBlurMaterial(4),this.separableBlurMaterial2.uniforms.texSize.value.set(Math.round(i/2),Math.round(s/2)),this.separableBlurMaterial2.uniforms.kernelRadius.value=4,this.overlayMaterial=this.getOverlayMaterial(),void 0===Gd&&console.error("THREE.OutlinePass relies on CopyShader");const o=Gd;this.copyUniforms=Jt.clone(o.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new Qt({uniforms:this.copyUniforms,vertexShader:o.vertexShader,fragmentShader:o.fragmentShader,blending:0,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new P,this.oldClearAlpha=1,this.fsQuad=new Xd(null),this.tempPulseColor1=new P,this.tempPulseColor2=new P,this.textureMatrix=new be}dispose(){this.renderTargetMaskBuffer.dispose(),this.renderTargetDepthBuffer.dispose(),this.renderTargetMaskDownSampleBuffer.dispose(),this.renderTargetBlurBuffer1.dispose(),this.renderTargetBlurBuffer2.dispose(),this.renderTargetEdgeBuffer1.dispose(),this.renderTargetEdgeBuffer2.dispose()}setSize(e,t){this.renderTargetMaskBuffer.setSize(e,t),this.renderTargetDepthBuffer.setSize(e,t);let n=Math.round(e/this.downSampleRatio),r=Math.round(t/this.downSampleRatio);this.renderTargetMaskDownSampleBuffer.setSize(n,r),this.renderTargetBlurBuffer1.setSize(n,r),this.renderTargetEdgeBuffer1.setSize(n,r),this.separableBlurMaterial1.uniforms.texSize.value.set(n,r),n=Math.round(n/2),r=Math.round(r/2),this.renderTargetBlurBuffer2.setSize(n,r),this.renderTargetEdgeBuffer2.setSize(n,r),this.separableBlurMaterial2.uniforms.texSize.value.set(n,r)}changeVisibilityOfSelectedObjects(e){const t=this._visibilityCache;function n(n){n.isMesh&&(!0===e?n.visible=t.get(n):(t.set(n,n.visible),n.visible=e))}for(let e=0;e<this.selectedObjects.length;e++)this.selectedObjects[e].traverse(n)}changeVisibilityOfNonSelectedObjects(e){const t=this._visibilityCache,n=[];function r(e){e.isMesh&&n.push(e)}for(let e=0;e<this.selectedObjects.length;e++)this.selectedObjects[e].traverse(r);this.renderScene.traverse((function(r){if(r.isMesh||r.isSprite){let i=!1;for(let e=0;e<n.length;e++)if(n[e].id===r.id){i=!0;break}if(!1===i){const n=r.visible;!1!==e&&!0!==t.get(r)||(r.visible=e),t.set(r,n)}}else(r.isPoints||r.isLine)&&(!0===e?r.visible=t.get(r):(t.set(r,r.visible),r.visible=e))}))}updateTextureMatrix(){this.textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),this.textureMatrix.multiply(this.renderCamera.projectionMatrix),this.textureMatrix.multiply(this.renderCamera.matrixWorldInverse)}render(e,t,n,r,i){if(this.selectedObjects.length>0){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const t=e.autoClear;e.autoClear=!1,i&&e.state.buffers.stencil.setTest(!1),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);const r=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.setRenderTarget(this.renderTargetDepthBuffer),e.clear(),e.render(this.renderScene,this.renderCamera),this.changeVisibilityOfSelectedObjects(!0),this._visibilityCache.clear(),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value.set(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.setRenderTarget(this.renderTargetMaskBuffer),e.clear(),e.render(this.renderScene,this.renderCamera),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this._visibilityCache.clear(),this.renderScene.background=r,this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.setRenderTarget(this.renderTargetMaskDownSampleBuffer),e.clear(),this.fsQuad.render(e),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){const e=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(e),this.tempPulseColor2.multiplyScalar(e)}this.fsQuad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value.set(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=$d.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.setRenderTarget(this.renderTargetBlurBuffer1),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=$d.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=$d.BlurDirectionX,e.setRenderTarget(this.renderTargetBlurBuffer2),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=$d.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer2),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,i&&e.state.buffers.stencil.setTest(!0),e.setRenderTarget(n),this.fsQuad.render(e),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=t}this.renderToScreen&&(this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=n.texture,e.setRenderTarget(null),this.fsQuad.render(e))}getPrepareMaskMaterial(){return new Qt({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new p(.5,.5)},textureMatrix:{value:null}},vertexShader:"#include <morphtarget_pars_vertex>\n\t\t\t\t#include <skinning_pars_vertex>\n\n\t\t\t\tvarying vec4 projTexCoord;\n\t\t\t\tvarying vec4 vPosition;\n\t\t\t\tuniform mat4 textureMatrix;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\t#include <skinbase_vertex>\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <morphtarget_vertex>\n\t\t\t\t\t#include <skinning_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t\tvPosition = mvPosition;\n\t\t\t\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t\t\t\t\tprojTexCoord = textureMatrix * worldPosition;\n\n\t\t\t\t}",fragmentShader:"#include <packing>\n\t\t\t\tvarying vec4 vPosition;\n\t\t\t\tvarying vec4 projTexCoord;\n\t\t\t\tuniform sampler2D depthTexture;\n\t\t\t\tuniform vec2 cameraNearFar;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));\n\t\t\t\t\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );\n\t\t\t\t\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;\n\t\t\t\t\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);\n\n\t\t\t\t}"})}getEdgeDetectionMaterial(){return new Qt({uniforms:{maskTexture:{value:null},texSize:{value:new p(.5,.5)},visibleEdgeColor:{value:new V(1,1,1)},hiddenEdgeColor:{value:new V(1,1,1)}},vertexShader:"varying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\n\t\t\t\tuniform sampler2D maskTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec3 visibleEdgeColor;\n\t\t\t\tuniform vec3 hiddenEdgeColor;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\n\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\n\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\n\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\n\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\n\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\n\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\n\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\n\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\n\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\n\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\n\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\n\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\n\t\t\t\t}"})}getSeperableBlurMaterial(e){return new Qt({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new p(.5,.5)},direction:{value:new p(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include <common>\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec2 direction;\n\t\t\t\tuniform float kernelRadius;\n\n\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\n\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, kernelRadius);\n\t\t\t\t\tvec4 diffuseSum = texture2D( colorTexture, vUv) * weightSum;\n\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\n\t\t\t\t\tvec2 uvOffset = delta;\n\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\n\t\t\t\t\t\tfloat w = gaussianPdf(uvOffset.x, kernelRadius);\n\t\t\t\t\t\tvec4 sample1 = texture2D( colorTexture, vUv + uvOffset);\n\t\t\t\t\t\tvec4 sample2 = texture2D( colorTexture, vUv - uvOffset);\n\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\n\t\t\t\t\t\tweightSum += (2.0 * w);\n\t\t\t\t\t\tuvOffset += delta;\n\t\t\t\t\t}\n\t\t\t\t\tgl_FragColor = diffuseSum/weightSum;\n\t\t\t\t}"})}getOverlayMaterial(){return new Qt({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\n\t\t\t\tuniform sampler2D maskTexture;\n\t\t\t\tuniform sampler2D edgeTexture1;\n\t\t\t\tuniform sampler2D edgeTexture2;\n\t\t\t\tuniform sampler2D patternTexture;\n\t\t\t\tuniform float edgeStrength;\n\t\t\t\tuniform float edgeGlow;\n\t\t\t\tuniform bool usePatternTexture;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\n\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\n\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\n\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\n\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\n\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\n\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\n\t\t\t\t\tif(usePatternTexture)\n\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\n\t\t\t\t\tgl_FragColor = finalColor;\n\t\t\t\t}",blending:2,depthTest:!1,depthWrite:!1,transparent:!0})}}$d.BlurDirectionX=new p(1,0),$d.BlurDirectionY=new p(0,1);const ep={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new P(0)},defaultOpacity:{value:0}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform vec3 defaultColor;\n\t\tuniform float defaultOpacity;\n\t\tuniform float luminosityThreshold;\n\t\tuniform float smoothWidth;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\n\t\t\tvec3 luma = vec3( 0.299, 0.587, 0.114 );\n\n\t\t\tfloat v = dot( texel.xyz, luma );\n\n\t\t\tvec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );\n\n\t\t\tfloat alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );\n\n\t\t\tgl_FragColor = mix( outputColor, texel, alpha );\n\n\t\t}"};class tp extends jd{constructor(e,t,n,r){super(),this.strength=void 0!==t?t:1,this.radius=n,this.threshold=r,this.resolution=void 0!==e?new p(e.x,e.y):new p(256,256),this.clearColor=new P(0,0,0),this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let i=Math.round(this.resolution.x/2),s=Math.round(this.resolution.y/2);this.renderTargetBright=new z(i,s),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(let e=0;e<this.nMips;e++){const t=new z(i,s);t.texture.name="UnrealBloomPass.h"+e,t.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(t);const n=new z(i,s);n.texture.name="UnrealBloomPass.v"+e,n.texture.generateMipmaps=!1,this.renderTargetsVertical.push(n),i=Math.round(i/2),s=Math.round(s/2)}void 0===ep&&console.error("THREE.UnrealBloomPass relies on LuminosityHighPassShader");const o=ep;this.highPassUniforms=Jt.clone(o.uniforms),this.highPassUniforms.luminosityThreshold.value=r,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new Qt({uniforms:this.highPassUniforms,vertexShader:o.vertexShader,fragmentShader:o.fragmentShader,defines:{}}),this.separableBlurMaterials=[];const a=[3,5,7,9,11];i=Math.round(this.resolution.x/2),s=Math.round(this.resolution.y/2);for(let e=0;e<this.nMips;e++)this.separableBlurMaterials.push(this.getSeperableBlurMaterial(a[e])),this.separableBlurMaterials[e].uniforms.texSize.value=new p(i,s),i=Math.round(i/2),s=Math.round(s/2);this.compositeMaterial=this.getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=t,this.compositeMaterial.uniforms.bloomRadius.value=.1,this.compositeMaterial.needsUpdate=!0,this.compositeMaterial.uniforms.bloomFactors.value=[1,.8,.6,.4,.2],this.bloomTintColors=[new V(1,1,1),new V(1,1,1),new V(1,1,1),new V(1,1,1),new V(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,void 0===Gd&&console.error("THREE.UnrealBloomPass relies on CopyShader");const l=Gd;this.copyUniforms=Jt.clone(l.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new Qt({uniforms:this.copyUniforms,vertexShader:l.vertexShader,fragmentShader:l.fragmentShader,blending:2,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new P,this.oldClearAlpha=1,this.basic=new ot,this.fsQuad=new Xd(null)}dispose(){for(let e=0;e<this.renderTargetsHorizontal.length;e++)this.renderTargetsHorizontal[e].dispose();for(let e=0;e<this.renderTargetsVertical.length;e++)this.renderTargetsVertical[e].dispose();this.renderTargetBright.dispose()}setSize(e,t){let n=Math.round(e/2),r=Math.round(t/2);this.renderTargetBright.setSize(n,r);for(let e=0;e<this.nMips;e++)this.renderTargetsHorizontal[e].setSize(n,r),this.renderTargetsVertical[e].setSize(n,r),this.separableBlurMaterials[e].uniforms.texSize.value=new p(n,r),n=Math.round(n/2),r=Math.round(r/2)}render(e,t,n,r,i){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const s=e.autoClear;e.autoClear=!1,e.setClearColor(this.clearColor,0),i&&e.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=n.texture,e.setRenderTarget(null),e.clear(),this.fsQuad.render(e)),this.highPassUniforms.tDiffuse.value=n.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,e.setRenderTarget(this.renderTargetBright),e.clear(),this.fsQuad.render(e);let o=this.renderTargetBright;for(let t=0;t<this.nMips;t++)this.fsQuad.material=this.separableBlurMaterials[t],this.separableBlurMaterials[t].uniforms.colorTexture.value=o.texture,this.separableBlurMaterials[t].uniforms.direction.value=tp.BlurDirectionX,e.setRenderTarget(this.renderTargetsHorizontal[t]),e.clear(),this.fsQuad.render(e),this.separableBlurMaterials[t].uniforms.colorTexture.value=this.renderTargetsHorizontal[t].texture,this.separableBlurMaterials[t].uniforms.direction.value=tp.BlurDirectionY,e.setRenderTarget(this.renderTargetsVertical[t]),e.clear(),this.fsQuad.render(e),o=this.renderTargetsVertical[t];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,e.setRenderTarget(this.renderTargetsHorizontal[0]),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,i&&e.state.buffers.stencil.setTest(!0),this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(n),this.fsQuad.render(e)),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=s}getSeperableBlurMaterial(e){return new Qt({defines:{KERNEL_RADIUS:e,SIGMA:e},uniforms:{colorTexture:{value:null},texSize:{value:new p(.5,.5)},direction:{value:new p(.5,.5)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include <common>\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec2 direction;\n\n\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\n\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n\t\t\t\t}\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tfloat fSigma = float(SIGMA);\n\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\n\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\n\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\n\t\t\t\t\t\tfloat x = float(i);\n\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\n\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\n\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\n\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\n\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\n\t\t\t\t\t\tweightSum += 2.0 * w;\n\t\t\t\t\t}\n\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})}getCompositeMaterial(e){return new Qt({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\t\t\t\tuniform sampler2D blurTexture1;\n\t\t\t\tuniform sampler2D blurTexture2;\n\t\t\t\tuniform sampler2D blurTexture3;\n\t\t\t\tuniform sampler2D blurTexture4;\n\t\t\t\tuniform sampler2D blurTexture5;\n\t\t\t\tuniform sampler2D dirtTexture;\n\t\t\t\tuniform float bloomStrength;\n\t\t\t\tuniform float bloomRadius;\n\t\t\t\tuniform float bloomFactors[NUM_MIPS];\n\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\n\n\t\t\t\tfloat lerpBloomFactor(const in float factor) {\n\t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\n\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\n\t\t\t\t}"})}}tp.BlurDirectionX=new p(1,0),tp.BlurDirectionY=new p(0,1);const np={uniforms:{tDiffuse:{value:null},resolution:{value:new p}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform vec2 resolution;\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );\n\n\t\t// kernel definition (in glsl matrices are filled in column-major order)\n\n\t\t\tconst mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 ); // x direction kernel\n\t\t\tconst mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 ); // y direction kernel\n\n\t\t// fetch the 3x3 neighbourhood of a fragment\n\n\t\t// first column\n\n\t\t\tfloat tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;\n\t\t\tfloat tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1, 0 ) ).r;\n\t\t\tfloat tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1, 1 ) ).r;\n\n\t\t// second column\n\n\t\t\tfloat tx1y0 = texture2D( tDiffuse, vUv + texel * vec2( 0, -1 ) ).r;\n\t\t\tfloat tx1y1 = texture2D( tDiffuse, vUv + texel * vec2( 0, 0 ) ).r;\n\t\t\tfloat tx1y2 = texture2D( tDiffuse, vUv + texel * vec2( 0, 1 ) ).r;\n\n\t\t// third column\n\n\t\t\tfloat tx2y0 = texture2D( tDiffuse, vUv + texel * vec2( 1, -1 ) ).r;\n\t\t\tfloat tx2y1 = texture2D( tDiffuse, vUv + texel * vec2( 1, 0 ) ).r;\n\t\t\tfloat tx2y2 = texture2D( tDiffuse, vUv + texel * vec2( 1, 1 ) ).r;\n\n\t\t// gradient value in x direction\n\n\t\t\tfloat valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 +\n\t\t\t\tGx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 +\n\t\t\t\tGx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2;\n\n\t\t// gradient value in y direction\n\n\t\t\tfloat valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 +\n\t\t\t\tGy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 +\n\t\t\t\tGy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2;\n\n\t\t// magnitute of the total gradient\n\n\t\t\tfloat G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );\n\n\t\t\tgl_FragColor = vec4( vec3( G ), 1 );\n\n\t\t}"},rp={uniforms:{tDiffuse:{value:null}},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 sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 tex = texture2D( tDiffuse, vUv );\n\n\t\t\tgl_FragColor = LinearTosRGB( tex );\n\n\t\t}"};class ip{constructor(e,t){this.scene=e,this.options=t,this.internalOptions={enableRenderCss2D:!1,enableRenderCss2DHalf:!1,enableRenderCss3D:!1},this.effectComposer=null,this.container=this._initContainer(),this.renderer=this._initRenderer(),this.rendererCSS2D=this._initRenderCSS2D(),this.rendererCSS3D=this._initRenderCSS3D(),this.rendererCSS2DHalf=this._initRenderCSS2DHalf(),this.interactiveContainer=this._initInteractiveContainer()}initEffectComposer(){return this.effectComposer=new Jd(this.renderer),this.effectComposer}initAllPass(e){const t=this._initRenderPass(e),n=this._initOutlinePass(e),r=this._initUnrealBloomPass(),i=this._initSobelPass(),s=this._initGammaCorrectionPass();return this.addPass(t),this.addPass(n),this.addPass(r),this.addPass(i),this.addPass(s),{renderPass:t,outlinePass:n,unrealBloomPass:r,sobelPass:i,gammaCorrectionPass:s}}addPass(e){var t;null===(t=this.effectComposer)||void 0===t||t.addPass(e)}isIncludesPass(e){return!!this.effectComposer&&this.effectComposer.passes.includes(e)}setInternalState(e,t){this.internalOptions[e]=t}getWidth(){return this.renderer.domElement.width}getHeight(){return this.renderer.domElement.height}getMouseRelativeConRatio(e){const t=this.container.getBoundingClientRect();return[(e.offsetX-t.left)/t.width,(e.offsetY-t.top)/t.height]}getMousePoint(e){const t=new p(0,0);return t.fromArray(this.getMouseRelativeConRatio(e)),t}_initContainer(){const e=document.createElement("div");return e.style.position="relative",e.style.width="100%",e.style.height="100%",e}_initRenderer(){const{background:e={},logarithmicDepthBuffer:t}=this.options,{color:n,alpha:r}=e,i=new Gi({antialias:!0,alpha:r,logarithmicDepthBuffer:t,preserveDrawingBuffer:!0,powerPreference:"high-performance"}),s=r?0:1;i.setClearColor(n||0,s),i.setPixelRatio(window.devicePixelRatio),i.autoClear=!1,i.localClippingEnabled=!0,i.sortObjects=!0,i.shadowMap.enabled=!0;const{offsetWidth:o,offsetHeight:a}=this.container;return i.domElement.style.width=o.toString(),i.domElement.style.height=a.toString(),this.container.appendChild(i.domElement),i}_initRenderCSS2D(){const e=new ku;return e.domElement.id="ssp_view_2DPoi",e.domElement.style.position="absolute",e.domElement.style.top="0",e.domElement.style.width="100%",e.domElement.style.height="100%",e.setSize(this.container.offsetWidth,this.container.offsetHeight),this.container.appendChild(e.domElement),e}_initRenderCSS3D(){const e=new qu;return e.domElement.id="ssp_view_3DPoi",e.domElement.style.position="absolute",e.domElement.style.top="0",e.domElement.style.width="100%",e.domElement.style.height="100%",e.setSize(this.container.offsetWidth,this.container.offsetHeight),this.container.appendChild(e.domElement),e}_initRenderCSS2DHalf(){const e=new Qu(this.rendererCSS3D.domElement,this.rendererCSS3D.cameraElement);return e.setSize(this.container.offsetWidth,this.container.offsetHeight),e}_initInteractiveContainer(){return this.rendererCSS3D.domElement}_initRenderPass(e){return new Kd(this.scene,e)}_initOutlinePass(e){const t=new $d(new p(self.innerWidth,self.innerHeight),this.scene,e);return t.enabled=!1,t}_initUnrealBloomPass(){const e=new tp(new p(self.innerWidth,self.innerHeight),1.5,.1,.5);return e.enabled=!1,e}_initSobelPass(){const e=new qd(np);return e.uniforms.resolution.value.x=self.innerWidth*self.devicePixelRatio,e.uniforms.resolution.value.y=self.innerHeight*self.devicePixelRatio,e.enabled=!1,e}_initGammaCorrectionPass(){const e=new qd(rp);return e.enabled=!1,e}}const sp=new be,op=(e,t)=>{const n=sp.clone(),r=sp.clone(),i=sp.clone();n.makeRotationY(e),r.makeRotationX(t);const s=new Le;return i.multiplyMatrices(n,r),s.setFromRotationMatrix(i),s},ap=op(-Math.PI/2,-Math.PI/4),lp=op(Math.PI/2,-Math.PI/4),cp=op(-Math.PI/4,-Math.PI/4),hp=op(Math.PI/4,-Math.PI/4),up=op(1.25*Math.PI,-Math.PI/4),dp=op(.75*Math.PI,-Math.PI/4),pp={LEFT:new Le(0,-Math.PI/2,0),RIGHT:new Le(0,Math.PI/2,0),FRONT:new Le(0,0,0),BACK:new Le(0,Math.PI,0),TOP:new Le(-Math.PI/2,0,0),BOTTOM:new Le(Math.PI/2,0,0),FRONTTOP:new Le(-Math.PI/4,0,0),BACKTOP:new Le(Math.PI/4,Math.PI,0),LEFTTOP:new Le(ap.x,ap.y,ap.z),RIGHTTOP:new Le(lp.x,lp.y,lp.z),LEFTFRONTTOP:new Le(cp.x,cp.y,cp.z),RIGHTFRONTTOP:new Le(hp.x,hp.y,hp.z),LEFTBACKTOP:new Le(up.x,up.y,up.z),RIGHTBACKTOP:new Le(dp.x,dp.y,dp.z)},fp=e=>nu(e)?e:e.includes("%")?.01*Number(e.split("%")[0]):isNaN(+e)?0:Number(e),mp=new $t(50,1,.1,5e5);mp.name="Camera",mp.position.set(500,1e3,500),mp.lookAt(new V);class gp{constructor(e){this.viewport=e,this.mainCamera=mp.clone(),this.mainCamera.name="fullFreeCamera",this.currentCamera=this.mainCamera,this.cameras={}}createCamera(e){const t=mp.clone();return t.name=e,this.cameras[e]=t,t}removeCamera(e){return"fullFreeCamera"!==e&&(delete this.cameras[e],!0)}setCurrentCamera(e){this.currentCamera=this.viewport.camera=e,this.viewport.signals.cameraObjectChange.dispatch()}getMainCamera(){return this.mainCamera}getCameraViewpoint(){return{position:this.currentCamera.position.clone(),rotation:{x:this.currentCamera.rotation.x,y:this.currentCamera.rotation.y,z:this.currentCamera.rotation.z}}}setCameraViewpoint(e){const{position:t,rotation:n}=e;this.currentCamera.position.set(t.x,t.y,t.z),this.currentCamera.rotation.set(n.x,n.y,n.z),this.viewport.signals.cameraChange.dispatch(this.currentCamera.position.clone())}rotateTo(e,t){const n=(new j).setFromEuler(e);return Tu({t:0},{t:1},t,(({t:e})=>{this.currentCamera.quaternion.slerp(n,e)}))}moveTo(e,t){return Tu(this.currentCamera.position,e,t,(e=>this.viewport.signals.cameraChange.dispatch(e)))}flyTo(e,t="frontTop",n){const r=this.viewport.controls.enableAutoRotate;this.viewport.controls.enableAutoRotate=!1;const i=new Le;if(eu(t)){const e=t.toLocaleUpperCase();"CURRENT"===e?i.copy(this.currentCamera.rotation):pp[e]&&i.copy(pp[e])}else t instanceof Le?i.copy(t):iu(t)&&i.set(t.x,t.y,t.z);return i.copy(Wh(this.currentCamera.rotation,i.clone())),Promise.all([this.moveTo(e,n),this.rotateTo(i,n)]).then((()=>(this.viewport.controls.enableAutoRotate=r,Promise.resolve())))}flyToBoundingBox(e,t="frontTop",n){if(eu(t)){if("CURRENT"===t.toLocaleUpperCase())return this.flyTo(this.getMovePosByBBox(e),t,n);{const r=pp[t.toLocaleUpperCase()],i=this.getObjectLabelPos(e,r);return this.flyTo(i,t,n)}}{const r=Gh(t),i=this.getObjectLabelPos(e,r);return this.flyTo(i,r,n)}}flyToObj(e,t="frontTop",n={}){if(e instanceof Np||e instanceof Ku){const{padding:r=50}=n,i=fp(r);return this.flyToBoundingBox(e.getBoundingBox(i),t,n)}{const{padding:r="30%"}=n,i=jh(e),s=i.getSize(new V);let o=0;if(eu(r)){const e=Math.max(s.x,s.y,s.z);o=fp(r)*e}else o=r;let a=o,l=o;if(o<0){const e=Math.min(s.x,s.z),t=s.y-1;a=Math.abs(o)>e?-e:o,l=Math.abs(a)>t?-t:a}return 0!==r&&(i.max.add(new V(a/2,l/2,a/2)),i.min.sub(new V(a/2,l/2,a/2))),this.flyToBoundingBox(i,t,n)}}surroundOnTarget(e,t={}){const{speed:n=1,angle:r=360,onStart:i}=t,s=Hh(e),o=s.clone().setY(this.currentCamera.position.y).distanceTo(this.currentCamera.position),a=Math.abs(r);return Tu({angle:0},{angle:Math.PI/180*a},{duration:a/360*5e3/n},(e=>{const t=r>0?e.angle:2*Math.PI-e.angle;this.currentCamera.position.x=Math.sin(t)*o+s.x,this.currentCamera.position.z=Math.cos(t)*o+s.z,this.currentCamera.lookAt(s)}),i)}surroundOnObject(e,t={}){const n=new q(new V,new V).setFromObject(e).getCenter(new V);return this.surroundOnTarget(n,t)}getMovePosByBBox(e){const t=this.currentCamera.position,n=e.getCenter(new V);(new V).subVectors(n,t).normalize();let r=new de;r=e.getBoundingSphere(r);const i=this.currentCamera.fov/2*Math.PI/180,s=Math.sin(i),o=r.radius/s,a=new V;this.currentCamera.getWorldDirection(a);const l=a.clone();return l.multiplyScalar(-o),n.clone().add(l)}getObjectLabelPos(e,t="frontTop",n={}){e instanceof Au&&(e=new q(new V,new V).setFromObject(e));const{extendScale:r=1.6,mode:i="scene"}=n;if("scene"===i){const n=e.getCenter(new V),i=e.max.clone().sub(e.min),s=Math.max(i.x,i.y,i.z),o=n.clone(),a=e=>{const t=(r-.5)*Math.abs(s),n=Math.max(t,this.viewport.camera.near);o.add(e.multiplyScalar(n))};let l;return l=eu(t)?pp[t.toLocaleUpperCase()]:Gh(t),a(new V(0,0,1).applyEuler(l)),o}return"screen"===i?e.getCenter(new V):new V}}const vp=navigator.userAgent.toLowerCase().includes("mac");var yp;!function(e){e[e.NONE=-1]="NONE",e[e.ROTATE=0]="ROTATE",e[e.ZOOM=1]="ZOOM",e[e.PAN=2]="PAN"}(yp||(yp={}));const xp=new V,wp=[new V,new V,new V],bp=[new V,new V,new V];let _p=new DOMRect;class Mp{constructor(e,t){this.viewport=e,this.camera=t,this.domElement=e.interactiveContainer,this.enabled=!0,this.enabledMousePointInteractive=!0,this.enableZoom=!0,this.zoomSpeed=1,this.zoomMinDistance=50,this.zoomMaxDistance=1e5,this.zoomMinStepDistance=20,this.zoomMaxStepDistance=2e4,this.enableRotate=!0,this.enableRotateX=!0,this.enableRotateY=!0,this.rotateSpeed=1,this.rotateTiltRange={max:Math.PI,min:0},this.enableAutoRotate=!1,this.autoRotateSpeed=1,this.autoRotateClockwise=!0,this.enableOutOfScene=!0,this.unOffsetOfScene=0,this.enablePan=!0,this.enablePanX=!0,this.enablePanY=!0,this.enablePanAxisX=!0,this.enablePanAxisY=!0,this.enablePanAxisZ=!0,this.panSpeed=2,this.interactivePosition=null,this.state=yp.NONE,this.init()}setOptions(e){for(const t in e)this[t]=e[t]}init(){const e=e=>{if(e.preventDefault(),!1===this.enabled)return;const{movementX:t,movementY:n}=e;this.state===yp.ROTATE?this.rotate(new V(.00375*-t,.00375*-n,0)):this.state===yp.PAN&&this.pan(new V(-t,n,0))},t=n=>{n.preventDefault(),this.domElement.removeEventListener("mousemove",e,!1),window.removeEventListener("mouseup",t,!0),this.state=yp.NONE},n=e=>{if(e.preventDefault(),!1!==this.enabled){switch(e.touches.length){case 1:{wp[0].set(e.touches[0].clientX-_p.x,e.touches[0].clientY-_p.y,0),wp[1].set(e.touches[0].clientX-_p.x,e.touches[0].clientY-_p.y,0);const t=wp[0].clone().sub(((e,t)=>{let n=t[0];for(const r in t)n.distanceTo(e)>t[r].distanceTo(e)&&(n=t[r]);return n})(wp[0],bp));t.x=-t.x;const n=t.multiplyScalar(.9);this.pan(n);break}case 2:{wp[0].set(e.touches[0].clientX-_p.x,e.touches[0].clientY-_p.y,0),wp[1].set(e.touches[1].clientX-_p.x,e.touches[1].clientY-_p.y,0);const n=bp[0].distanceTo(bp[1])-wp[0].distanceTo(wp[1]);this.zoom_touch(new V(0,0,n*this.zoomSpeed/25)),this.rotate(t(wp,bp,"x"));break}case 3:case 4:case 5:wp[0].set(e.touches[0].clientX-_p.x,e.touches[0].clientY-_p.y,0),wp[1].set(e.touches[2].clientX-_p.x,e.touches[2].clientY-_p.y,0),this.rotate(t(wp,bp,"y"))}bp[0].copy(wp[0]),bp[1].copy(wp[1])}function t(e,t,n="y"){const r=new p(e[1].x-e[0].x,e[1].y-e[0].y),i=new p(t[1].x-t[0].x,t[1].y-t[0].y),s=r.angle(),o=i.angle();r.normalize(),i.normalize();const a=t[0].y-e[0].y;return"y"===n?new V(0,.005*a,0):"x"===n?new V(s-o,0,0):new V}},r=e=>{e.preventDefault(),this.state=yp.NONE,this.domElement.removeEventListener("touchmove",n,!1),this.domElement.removeEventListener("touchend",r,!1)};this.domElement.addEventListener("mousedown",(n=>{n.preventDefault(),!1!==this.enabled&&(0===n.button?this.state=yp.ROTATE:1===n.button?this.state=yp.ZOOM:2===n.button&&(this.state=yp.PAN),_p=this.domElement.getBoundingClientRect(),this.state!==yp.ROTATE&&this.state!==yp.PAN||(this.interactivePosition=this.getInteractivePosition(n),this.domElement.addEventListener("mousemove",e,!1),window.addEventListener("mouseup",t,!0)))}),!1),this.domElement.addEventListener("wheel",(e=>{if(e.preventDefault(),!this.enabled)return;let t=0;t=vp&&e.shiftKey?120*-e.deltaX:120*-e.deltaY,this.zoom_on_point(new V(0,0,t),e)}),{passive:!1}),this.domElement.addEventListener("touchstart",(e=>{if(e.preventDefault(),!1===this.enabled)return;_p=this.domElement.getBoundingClientRect();const t=e.touches;switch(t.length){case 1:wp[0].set(t[0].clientX,t[0].clientY,0),wp[1].set(t[0].clientX,t[0].clientY,0);break;case 2:wp[0].set(t[0].clientX,t[0].clientY,0),wp[1].set(t[1].clientX,t[1].clientY,0);break;case 3:case 4:case 5:wp[0].set(t[0].clientX,t[0].clientY,0),wp[1].set(t[2].clientX,t[2].clientY,0)}const i=new V(_p.x,_p.y,0);wp[0].sub(i),wp[1].sub(i),bp[0].copy(wp[0]),bp[1].copy(wp[1]),this.interactivePosition=this.getInteractivePosition({offsetX:(wp[0].x+wp[1].x)/2,offsetY:(wp[0].y+wp[1].y)/2}),this.domElement.addEventListener("touchmove",n,{passive:!1}),this.domElement.addEventListener("touchend",r,!1)}),{passive:!1})}getInteractivePosition(e){var t;if(this.enabledMousePointInteractive){const n=this.viewport.getIntersects(e);return n.length?null===(t=n[0].point)||void 0===t?void 0:t.clone():null}return null}intersectsBox(e){const t=this.getSceneBbox(),n=new V;t.getSize(n);let r=Math.max(n.x,n.y,n.z);0!=this.unOffsetOfScene&&(r=this.unOffsetOfScene);const i=t.clone();i.min.addScalar(r/2),i.max.addScalar(-r/2);const s=(new $t).copy(this.camera);return s.position.add(e),s.updateMatrixWorld(),s.updateProjectionMatrix(),(new hn).setFromProjectionMatrix((new be).multiplyMatrices(s.projectionMatrix,s.matrixWorldInverse)).intersectsBox(t)}caculateContainPoint(e,t){const n=(new V).copy(e).applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix);return!(Math.abs(n.x)>1||Math.abs(n.y)>1||Math.abs(n.z)>1)}panLeft(e){const t=new V,n=this.camera.matrix.elements;this.enablePanAxisX&&t.setX(n[0]),this.enablePanAxisY&&t.setY(n[1]),this.enablePanAxisZ&&t.setZ(n[2]),t.multiplyScalar(e);let r=!0;this.enableOutOfScene||(r=this.intersectsBox(t)),r&&this.camera.position.add(t)}panUp(e){const t=new V,n=this.camera.matrix.elements;this.enablePanAxisX&&t.setX(n[4]),this.enablePanAxisY&&t.setY(n[5]),this.enablePanAxisZ&&t.setZ(n[6]),t.multiplyScalar(e);let r=!0;this.enableOutOfScene||(r=this.intersectsBox(t)),r&&this.camera.position.add(t)}pan(e){if(!this.enablePan)return;this.enablePanX||e.setX(0),this.enablePanY||e.setY(0);const t=this.interactivePosition||this.getSceneBbox().getCenter(new V);let n=this.camera.position.clone().sub(t).length();n*=Math.tan(this.camera.fov/2*Math.PI/180),n<50&&(n=50*this.panSpeed),this.panLeft(this.panSpeed*e.x*n/this.domElement.offsetHeight),this.panUp(this.panSpeed*e.y*n/this.domElement.offsetHeight),this.viewport.signals.cameraChange.dispatch(this.camera.position.clone())}zoom_on_point(e,t){if(!this.enableZoom)return;this.interactivePosition=this.getInteractivePosition(t);let n=e.z>0?6:-6;const r=new V(0,0,0);let i;if(this.interactivePosition){i=this.interactivePosition.distanceTo(this.camera.position);const e=this.domElement.getBoundingClientRect();r.set(t.offsetX/e.width*2-1,-t.offsetY/e.height*2+1,.1)}else i=this.camera.position.length(),r.set(0,0,.1);let s=!1;i>this.zoomMaxDistance&&n<0?(s=!0,i=this.zoomMaxDistance,n*=2):i<this.zoomMinDistance&&n>0&&(s=!0,i=this.zoomMinDistance,n*=2),r.unproject(this.camera),r.sub(this.camera.position);let o=i/n*this.zoomSpeed;if(s){if(!t.shiftKey)return;o>0?o>this.zoomMaxStepDistance?o=this.zoomMaxStepDistance:o<this.zoomMinStepDistance&&(o=this.zoomMinStepDistance):o<0&&(o<-this.zoomMaxStepDistance?o=-this.zoomMaxStepDistance:o>-this.zoomMinStepDistance&&(o=-this.zoomMinStepDistance))}const a=this.camera.position.clone().addVectors(this.camera.position,r.setLength(o));this.camera.position.copy(a),this.viewport.signals.cameraChange.dispatch(this.camera.position.clone())}zoom_touch(e){if(!this.enableZoom)return;let t=e.z;const n=new V(0,0,0);let r;if(this.interactivePosition){const e={offsetX:(bp[0].x+bp[1].x)/2,offsetY:(bp[0].y+bp[1].y)/2};r=this.interactivePosition.distanceTo(this.camera.position),n.set(e.offsetX/_p.width*2-1,-e.offsetY/_p.height*2+1,.1)}else r=this.camera.position.length(),n.set(0,0,.1);if(r>this.zoomMaxDistance&&t>0?(r=this.zoomMaxDistance,t=0):r<this.zoomMinDistance&&t<0&&(r=this.zoomMinDistance),0===t)return;n.unproject(this.camera),n.sub(this.camera.position);let i=r*-t*this.zoomSpeed*.1;i>0?i>this.zoomMaxStepDistance?i=this.zoomMaxStepDistance:i<this.zoomMinStepDistance&&(i=this.zoomMinStepDistance):i<0&&(i<-this.zoomMaxStepDistance?i=-this.zoomMaxStepDistance:i>-this.zoomMinStepDistance&&(i=-this.zoomMinStepDistance));const s=this.camera.position.clone().addVectors(this.camera.position,n.setLength(i));this.camera.position.copy(s),this.viewport.signals.cameraChange.dispatch(this.camera.position.clone())}rotate(e){if(!this.enableRotate)return;e.x*=this.rotateSpeed,e.y*=this.rotateSpeed;const t=new V(0,0,-1);t.applyQuaternion(this.camera.quaternion);const n=t.angleTo(new V(0,1,0));(n-e.y>this.rotateTiltRange.max&&e.y<0||n-e.y<this.rotateTiltRange.min&&e.y>0)&&(e.y=0);const r=this.interactivePosition||this.getSceneBbox().getCenter(new V);xp.copy(this.camera.position).sub(r);const i=new be,s=new V(1,0,0);this.enableRotateX&&i.makeRotationAxis(new V(0,1,0),e.x);const o=new be;this.enableRotateY&&(s.applyEuler(this.camera.rotation),o.makeRotationAxis(s,e.y),i.multiply(o)),xp.applyMatrix4(i),t.applyMatrix4(i),this.camera.position.copy(r).add(xp),this.camera.lookAt(t.add(this.camera.position)),this.viewport.signals.cameraChange.dispatch(this.camera.position.clone())}autoRotate(){const e=this.autoRotateClockwise?.01:-.01;this.rotate(new V(e*this.autoRotateSpeed,0,0))}update(){this.enableAutoRotate&&this.autoRotate()}getSceneBbox(){const e=this.viewport._getManagerScene("sbm"),t=this.viewport._getManagerScene("model"),n=new q;return e&&n.setFromObject(e),t&&n.union((new q).setFromObject(t)),n}}class Sp{constructor(e,t){this.scene=e,this.signals=t;const n=document.createElement("div");n.style.position="absolute",n.style.left="12px",n.style.bottom="12px",n.style.fontSize="12px",n.style.color="#fff",this.container=n,this.state={objects:0,vertices:0,triangles:0,frametime:0,lodFrametime:0}}addListeners(){const{scene:e,signals:t}=this;function n(e,t=!0){const n=document.createElement("span");return t&&(n.style.marginLeft="6px"),n.innerHTML=e,n}function r(){return document.createElement("br")}const i=n("0"),s=n("0"),o=n("0"),a=n("0"),l=n("0");this.container.appendChild(n("objects",!1)),this.container.appendChild(i),this.container.appendChild(r()),this.container.appendChild(n("triangles",!1)),this.container.appendChild(s),this.container.appendChild(r()),this.container.appendChild(n("vertices",!1)),this.container.appendChild(o),this.container.appendChild(r()),this.container.appendChild(n("frametime",!1)),this.container.appendChild(a),this.container.appendChild(r()),this.container.appendChild(n("lodFrametime",!1)),this.container.appendChild(l);const c=()=>{this.state.objects=0,this.state.vertices=0,this.state.triangles=0;for(let t=0;t<e.children.length;t++)e.children[t].traverseVisible((e=>{var t,n,r,i;if("SceneManager"!==e.stype&&this.state.objects++,e.isMesh){const s=e.geometry;s.isGeometry?(this.state.vertices+=(null===(t=s.vertices)||void 0===t?void 0:t.length)||0,this.state.triangles+=(null===(n=s.faces)||void 0===n?void 0:n.length)||0):s.isBufferGeometry&&(this.state.vertices+=(null===(r=s.attributes.position)||void 0===r?void 0:r.count)||0,null!==s.index?this.state.triangles+=s.index.count/3:this.state.triangles+=(null===(i=s.attributes.position)||void 0===i?void 0:i.count)/3||0)}}));i.innerHTML=String(this.state.objects),o.innerHTML=String(this.state.vertices),s.innerHTML=String(this.state.triangles)};t.objectAdded.add(c),t.objectRemoved.add(c),t.geometryChanged.add(c),t.sceneRendered.add((e=>{this.state.frametime=e,a.innerHTML=Number(e).toFixed(2)+" ms"})),t.loadRendered.add((e=>{this.state.lodFrametime=e,l.innerHTML=Number(e).toFixed(2)+" ms"}))}}const Tp={needRender:!1};let Ep=0,Ap=0;const Cp=new Fl;class Pp{constructor(e){this.sky=null,this.options=e,this.state={useFreq:1,animationTotal:0},this.signals={windowResize:new kd,cameraObjectChange:new kd,sceneChanged:new kd,backgroundChanged:new kd,beforeRender:new kd,afterRender:new kd,sceneRendered:new kd,loadRendered:new kd,tweenUpdate:new kd,hover:new kd,click:new kd,dblClick:new kd,rightClick:new kd,mouseDown:new kd,mouseMove:new kd,mouseUp:new kd,mouseWheel:new kd,keyDown:new kd,keyUp:new kd,modelHover:new kd,modelUnHover:new kd,modelClick:new kd,modelDblClick:new kd,modelRightClick:new kd,poiHover:new kd,poiUnHover:new kd,poiClick:new kd,poiDblClick:new kd,poiRightClick:new kd,selectPosition:new kd,sceneClick:new kd,objectAdded:new kd,objectRemoved:new kd,objectChanged:new kd,geometryChanged:new kd,materialAdded:new kd,materialChanged:new kd,materialRemoved:new kd,cameraChange:new kd,outlineChange:new kd,modelAnimation:new kd,getSceneInfo:new kd},this.scener=new Hd(this.signals),this.scene=this.scener.scene,this.rendererManager=new ip(this.scene,e),this.container=this.rendererManager.container,this.interactiveContainer=this.rendererManager.interactiveContainer,this.renderer=this.rendererManager.renderer,this.rendererCSS3D=this.rendererManager.rendererCSS3D,this.rendererCSS2D=this.rendererManager.rendererCSS2D,this.rendererCSS2DHalf=this.rendererManager.rendererCSS2DHalf,this.pmremGenerator=new Ln(this.renderer),this.pmremGenerator.compileEquirectangularShader(),this.info=new Sp(this.scene,this.signals),this.stats=new nd,this.cameraManager=new gp(this),this.camera=this.cameraManager.currentCamera,this.controls=new Mp(this,this.camera),this.effectComposer=this.rendererManager.initEffectComposer(),this.passObj=this.rendererManager.initAllPass(this.camera),this.mixer=new hc(this.scene),this.postUpdate=new Map,this.postRender=new Map,this.selectModel=null,this.selectPoi=null,this._loop=0,this.initInfo(),this.initStats(),this._signalsEventListenr(),this._containerAddEventListener(this.container),this.animate(0)}initInfo(){if(this.options.showInfo){this.info.addListeners();const{container:e}=this.info;e.style.zIndex="1",this.container.appendChild(e)}}initStats(){if(this.options.showStats){const{dom:e}=this.stats;e.style.zIndex="1",this.container.appendChild(e),this.signals.sceneRendered.add((()=>{this.stats.update()}))}}setSobel(e={}){const{enable:t=!0}=e,{sobelPass:n}=this.passObj;n.enabled=t,this.signals.sceneChanged.dispatch()}setBloom(e={}){const{enable:t=!0,strength:n=1.5,threshold:r=.5,radius:i=.1}=e,{unrealBloomPass:s}=this.passObj;s.enabled=t,s.strength=n,s.threshold=r,s.radius=i,this.signals.sceneChanged.dispatch()}setColorSpace(e){this.renderer.outputEncoding="sRGB"===e?3001:3e3,this.signals.sceneChanged.dispatch()}setSphereSkyBackground(e){(new il).load(e,(e=>{e.mapping=303,this.scene.background=e,this.signals.backgroundChanged.dispatch()}))}setSkyBackground(e,t){Jh(e,t).then((e=>{this.scene.background=e,this.signals.backgroundChanged.dispatch()}))}setBackgroundColor(e){this.renderer.setClearColor(e),this.scene.background=new P(e),this.signals.backgroundChanged.dispatch()}setBackgroundImage(e){(new il).load(e,(e=>{e.wrapS=1002,e.wrapT=1002,this.scene.background=e,this.signals.backgroundChanged.dispatch()}))}setSky(e={}){const{enable:t=!0,position:n={x:0,y:0,z:0},scalar:r=45e4,turbidity:i=10,rayleigh:s=3,elevation:o=2,azimuth:a=180,exposure:l=.5}=e;if(!t)return void this.closeSky();this.sky||(this.sky=new rd,this.scene.add(this.sky)),this.sky.name="sky",this.sky.position.set(n.x,n.y,n.z),this.sky.scale.setScalar(r);const c=this.sky.material.uniforms;c.turbidity.value=i,c.rayleigh.value=s,c.mieCoefficient.value=.005,c.mieDirectionalG.value=.7;const h=new V,u=Xh(90-o),d=Xh(a);return h.setFromSphericalCoords(1,u,d),c.sunPosition.value.copy(h),this.renderer.toneMapping=4,this.renderer.toneMappingExposure=l,this.signals.objectAdded.dispatch(),this.sky}closeSky(){return!!this.sky&&(this.sky.removeFromParent(),this.sky=null,this.renderer.toneMapping=0,this.renderer.toneMappingExposure=1,this.signals.objectRemoved.dispatch(),!0)}setEnvironment(){return this.scene.environment=this.pmremGenerator.fromScene(new ed,.04).texture,this.signals.sceneChanged.dispatch(),this.scene.environment}playModelAnimation(e,t){let n;if(t instanceof qa?n=t:nu(t)?n=e.animations[t]:su(t)&&(n=e.animations.find(t)),!n)return;const r=this.mixer.clipAction(n,e);return r.play(),this.state.animationTotal++,r}stopModelAnimation(e,t){let n;t instanceof qa?n=t:nu(t)?n=e.animations[t]:su(t)&&(n=e.animations.find(t)),n&&(this.mixer.uncacheAction(n,e),this.state.animationTotal--)}render(e){return $u(this,void 0,void 0,(function*(){return Tp.needRender=!0,yield null==e?void 0:e(),new Promise((e=>{const t=()=>{Tp.needRender=!1,this.signals.afterRender.remove(t),e()};this.signals.afterRender.add(t),this.trigerRender()}))}))}trigerRender(e=1){this.state.useFreq+=e,this.state.useFreq>50&&(this.state.useFreq=10)}_passesObserver(){this.passObj.outlinePass.enabled=!!this.scener.selectedObjects.edge.length,this.passObj.gammaCorrectionPass.enabled=3001===this.renderer.outputEncoding}autoRender(e){if(this.state.useFreq<=0&&!Tp.needRender)return;this.state.useFreq>0&&this.state.useFreq--,Tp.needRender&&(Tp.needRender=!1),Ep=performance.now(),this.signals.beforeRender.dispatch(),this._passesObserver(),this.renderer.clear(),this.effectComposer.render();const t=this.scene.autoUpdate;this.scene.autoUpdate=!1,this.rendererCSS2D&&this.rendererManager.internalOptions.enableRenderCss2D&&this.rendererCSS2D.render(this.scene,this.camera),this.rendererCSS2DHalf&&this.rendererManager.internalOptions.enableRenderCss2DHalf&&this.rendererCSS2DHalf.render(this.scene,this.camera),this.rendererCSS3D&&this.rendererManager.internalOptions.enableRenderCss3D&&this.rendererCSS3D.render(this.scene,this.camera),this.scene.autoUpdate=t,this.postRender.forEach((t=>t(e))),this.signals.afterRender.dispatch(),Ap=performance.now(),this.signals.sceneRendered.dispatch(Ap-Ep)}animate(e){this._loop=requestAnimationFrame((e=>{this.animate(e)}));const t=Cp.getDelta();this.controls.update(),this.state.animationTotal>0&&(this.mixer.update(t),this.signals.modelAnimation.dispatch()),Mu.update()&&this.signals.tweenUpdate.dispatch(),this.postUpdate.forEach((t=>t(e))),this.autoRender(e),this.signals.getSceneInfo.dispatch(this.info.state)}getOffsetByPosition(e){const t=new V(e.x,e.y,e.z).project(this.camera),n=this.renderer.domElement.getBoundingClientRect();return{left:Math.round(n.left+n.width/2*(t.x+1)),top:Math.round(n.top+n.height/2*(1-t.y))}}getPositionByOffset(e,t=.1){const n=new V(0,0,0),r=new V(0,0,0),i=this.renderer.domElement.getBoundingClientRect();r.set(e.offsetX/i.width*2-1,-e.offsetY/i.height*2+1,t),r.unproject(this.camera),r.sub(this.camera.position).normalize();const s=r.distanceTo(this.camera.position);return n.copy(this.camera.position).add(r.multiplyScalar(s)),n}getIntersects(e,t=this.scener.intersectsList.getAll()){let n={offsetX:0,offsetY:0};if(e instanceof MouseEvent)n={offsetX:e.offsetX,offsetY:e.offsetY};else if(e instanceof TouchEvent){const{changedTouches:t}=e,r=this.renderer.domElement.getBoundingClientRect();n={offsetX:t[0].clientX-r.left,offsetY:t[0].clientY-r.top}}else n=e;const r=new p;r.set(n.offsetX/this.container.offsetWidth*2-1,-n.offsetY/this.container.offsetHeight*2+1);const i=new fc;return i.setFromCamera(r,this.camera),ru(t)?i.intersectObjects(t,!0):i.intersectObject(t,!0)}rayClash(e=this.camera.position,t=new V(0,-1,0),n=this.scener.intersectsList.meshOfModelList){const r=new fc;return r.set(e,t),ru(n)?r.intersectObjects(n,!0):r.intersectObject(n,!0)}setHoverEnabled(e){this.options.hoverEnabled=e}clearSignals(){for(const e in this.signals)this.signals[e].removeAll()}dispose(){return new Promise((e=>{cancelAnimationFrame(this._loop),setTimeout((()=>{Mu.removeAll(),this.clearSignals(),this.scene.remove(),this.pmremGenerator.dispose(),this.renderer.forceContextLoss(),this.renderer.dispose(),this.container.remove(),e()}),100)}))}_signalsEventListenr(){const e=()=>{const{offsetWidth:e,offsetHeight:t}=this.container;this.passObj.renderPass.camera=this.camera,this.passObj.outlinePass.renderCamera=this.camera,this.passObj.sobelPass.uniforms.resolution.value.x=self.innerWidth*self.devicePixelRatio,this.passObj.sobelPass.uniforms.resolution.value.y=self.innerHeight*self.devicePixelRatio,this.camera.aspect=e/t,this.camera.updateProjectionMatrix(),this.renderer.setSize(e,t),this.rendererCSS3D&&this.rendererCSS3D.setSize(e,t),this.rendererCSS2D&&this.rendererCSS2D.setSize(e,t),this.rendererCSS2DHalf&&this.rendererCSS2DHalf.setSize(e,t),this.effectComposer&&this.effectComposer.setSize(e,t),this.trigerRender()};setTimeout((()=>e())),this.signals.windowResize.add(e),this.signals.cameraObjectChange.add(e),this.signals.sceneChanged.add((()=>this.trigerRender())),this.signals.backgroundChanged.add((()=>this.trigerRender())),this.signals.objectAdded.add((()=>this.trigerRender())),this.signals.objectRemoved.add((()=>this.trigerRender())),this.signals.objectChanged.add((()=>this.trigerRender())),this.signals.materialAdded.add((()=>this.trigerRender())),this.signals.materialRemoved.add((()=>this.trigerRender())),this.signals.materialChanged.add((()=>this.trigerRender())),this.signals.geometryChanged.add((()=>this.trigerRender())),this.signals.cameraChange.add((()=>this.trigerRender())),this.signals.tweenUpdate.add((()=>this.trigerRender())),this.signals.modelAnimation.add((()=>this.trigerRender())),this.signals.outlineChange.add((e=>{const{objects:t,options:n}=e,{color:r,hideColor:i,edgeThickness:s,edgeStrength:o,pulsePeriod:a}=Object.assign(Object.assign({},{color:"#fff",hideColor:"#999",edgeThickness:3,edgeStrength:10,pulsePeriod:0}),n);this.passObj.outlinePass.selectedObjects=t,this.passObj.outlinePass.visibleEdgeColor.set(r),this.passObj.outlinePass.hiddenEdgeColor.set(i),this.passObj.outlinePass.edgeThickness=s,this.passObj.outlinePass.edgeStrength=o,this.passObj.outlinePass.pulsePeriod=a,this.trigerRender()}))}_containerAddEventListener(e){const t=[0,0];let n=null;const r=i=>{var s,o;this.signals.mouseUp.dispatch(i);const a=i.offsetX-(null!==(s=null==n?void 0:n.offsetX)&&void 0!==s?s:0),l=i.offsetY-(null!==(o=null==n?void 0:n.offsetY)&&void 0!==o?o:0);if(Math.abs(a)>2||Math.abs(l)>2)return t[0]=0,void(t[1]=0);setTimeout((()=>{0!==t[0]&&0===t[1]&&(0===i.button?(this.signals.click.dispatch(i),this._triggerSceneEventInAllObject("click",i)):2===i.button&&(this.signals.rightClick.dispatch(i),this._triggerSceneEventInAllObject("rightClick",i))),t[0]=0,t[1]=0}),300),e.removeEventListener("mouseup",r,!1)};let i=!1,s=null,o=null;const a=[0,0],l=e=>{var t,n;s&&clearTimeout(s);const r=e.changedTouches[0].clientX-(null!==(t=null==o?void 0:o.changedTouches[0].clientX)&&void 0!==t?t:0),l=e.changedTouches[0].clientY-(null!==(n=null==o?void 0:o.changedTouches[0].clientY)&&void 0!==n?n:0);if(Math.abs(r)>2||Math.abs(l)>2)return a[0]=0,void(a[1]=0);i?(i=!1,a[0]=0,a[1]=0,this.signals.rightClick.dispatch(e),this._triggerSceneEventInAllObject("rightClick",e)):setTimeout((()=>{0!==a[0]&&0===a[1]?(this.signals.click.dispatch(e),this._triggerSceneEventInAllObject("click",e)):0!==a[0]&&0!==a[1]&&a[1]-a[0]<=300&&(this.signals.dblClick.dispatch(e),this._triggerSceneEventInAllObject("dblClick",e)),a[0]=0,a[1]=0}),300)};e.addEventListener("mousedown",(i=>{n=i,this.signals.mouseDown.dispatch(i),0===t[0]?t[0]=performance.now():0===t[1]&&(t[1]=performance.now()),e.addEventListener("mouseup",r,!1)}),!1),e.addEventListener("mousemove",(e=>{this.signals.mouseMove.dispatch(e),this.options.hoverEnabled&&this._triggerSceneEventInAllObject("hover",e)}),!1),e.addEventListener("dblclick",(e=>{this.signals.dblClick.dispatch(e),this._triggerSceneEventInAllObject("dblClick",e)}),!1),e.addEventListener("wheel",(e=>{this.signals.mouseWheel.dispatch(e)}),{passive:!0}),e.addEventListener("touchstart",(t=>{0===a[0]?a[0]=performance.now():0===a[1]&&(a[1]=performance.now()),o=t,s=setTimeout((()=>{i=!0}),800),e.addEventListener("touchend",l,{once:!0})}),{passive:!0}),e.addEventListener("contextmenu",(e=>e.preventDefault()),!1),document.addEventListener("keydown",(e=>{this.signals.keyDown.dispatch(e)}),!1),document.addEventListener("keyup",(e=>{this.signals.keyUp.dispatch(e)}),!1)}_triggerSceneEventInAllObject(e,t){const n=this.getIntersects(t,this.scener.intersectsList.getAll());if(0===n.length)return this.selectModel&&this.signals.modelHover.numListeners>0&&this.signals.modelUnHover.dispatch(this.selectModel),this.selectPoi&&this.signals.poiHover.numListeners>0&&this.signals.poiUnHover.dispatch(this.selectPoi),this.selectModel=null,this.selectPoi=null,void this.signals.sceneClick.dispatch({type:e,event:t});"click"===e&&n.length>0&&this.signals.selectPosition.dispatch(n[0].point);const r={object:null,type:null},i=[],s=[];function o(e){return e.parent?"Sbm"===e.parent.stype||"Model"===e.parent.stype?e.parent:o(e.parent):void 0}function a(e){return!!e.visible&&(!e.parent||a(e.parent))}n.forEach((e=>{if(e.object.parent instanceof Np){const t=e.object.parent;a(t)&&(r.object||(r.type="Poi",r.object=e.object),-1===i.findIndex((e=>e.poi.uuid===t.uuid))&&i.push({poi:t,sourceData:e}))}else if(e.object instanceof Xe){const t=o(e.object);t&&a(t)&&(r.object||(r.type="Model",r.object=e.object),s.push({model:t,sourceData:e}))}}));const l=e.slice(0,1).toUpperCase()+e.slice(1);"Model"===r.type?(e=>{var t;const{model:n}=e[0];if(n)if("Hover"===l)(null===(t=this.selectModel)||void 0===t?void 0:t.uuid)!==n.uuid&&(this.signals.modelHover.dispatch({target:n,currentTarget:r.object,intersects:e}),this.selectModel=n);else{let t=null;"Click"===l?(t=n.onClick,n.dispatchEvent({type:"click"})):"RightClick"===l?(t=n.onRightClick,n.dispatchEvent({type:"rightClick"})):"DblClick"===l&&(t=n.onDblClick,n.dispatchEvent({type:"dblClick"})),t?t(n):n.isEventPropagation=!0,n.isEventPropagation&&(this.signals[`model${l}`].dispatch({target:n,currentTarget:r.object,intersects:e}),n.isEventPropagation=!1)}})(s):"Poi"===r.type&&(e=>{var t;const{poi:n}=e[0];if(n)if("Hover"===l)(null===(t=this.selectPoi)||void 0===t?void 0:t.uuid)!==n.uuid&&(this.signals.poiHover.dispatch(n),this.selectPoi=n);else{let e=null;"Click"===l?(e=n.onClick,n.dispatchEvent({type:"click"})):"RightClick"===l?(e=n.onRightClick,n.dispatchEvent({type:"rightClick"})):"DblClick"===l&&(e=n.onDblClick,n.dispatchEvent({type:"dblClick"})),e?e(n):n.isEventPropagation=!0,n.isEventPropagation&&(this.signals[`poi${l}`].dispatch(n),n.isEventPropagation=!1)}})(i)}_getManagerScene(e){return this.scene.children.find((t=>t.name===`${e.toLocaleLowerCase()}Manager`))}}const Rp={onLoad:null,onClick:null,onDblClick:null,onRightClick:null};class Lp extends Au{constructor(e){super(e,"Sbm"),this.isEventPropagation=!1;const{onLoad:t,onClick:n,onDblClick:r,onRightClick:i}=Object.assign(Object.assign({},Rp),e);this.onLoad=(null==t?void 0:t.bind(this))||null,this.onClick=(null==n?void 0:n.bind(this))||null,this.onDblClick=(null==r?void 0:r.bind(this))||null,this.onRightClick=(null==i?void 0:i.bind(this))||null}getBoundingBox(){return new q(new V,new V).setFromObject(this)}eventPropagation(){this.isEventPropagation=!0}setEnvMap(e,t,n={}){Jh(e,t).then((e=>{this.traverse((t=>{if(t instanceof Wt&&t.material instanceof Aa){const{reflectivity:r=.5}=n;t.material.envMap=e,t.material.reflectivity=r,Tp.needRender=!0}}))}))}sClone(e){return new Lp({id:`${this.sid}_clone`,url:""}).sCopy(this,e)}}const Ip={onLoad:null,onClick:null,onDblClick:null,onRightClick:null};class Dp extends Au{constructor(e){super(e,"Model");const{format:t,onLoad:n,onClick:r,onDblClick:i,onRightClick:s}=Object.assign(Object.assign({},Ip),e);this.formatType=t,this.isEventPropagation=!1,this.onLoad=(null==n?void 0:n.bind(this))||null,this.onClick=(null==r?void 0:r.bind(this))||null,this.onDblClick=(null==i?void 0:i.bind(this))||null,this.onRightClick=(null==s?void 0:s.bind(this))||null}getBoundingBox(){return new q(new V,new V).setFromObject(this)}eventPropagation(){this.isEventPropagation=!0}setEnvMap(e,t,n={}){Jh(e,t).then((e=>{this.traverse((t=>{if(t instanceof Wt&&t.material instanceof Aa){const{reflectivity:r=.5}=n;t.material.envMap=e,t.material.reflectivity=r,Tp.needRender=!0}}))}))}sClone(e){return new Dp({id:`${this.sid}_clone`,url:"",format:this.formatType}).sCopy(this,e)}}const Op={position:{x:0,y:0,z:0},scale:{x:16,y:16,z:1},stype:"Icon"};class Bp extends hs{constructor(e,t){super(e);const{position:n,scale:r,stype:i}=Object.assign(Object.assign({},Op),t);this.stype=i,this.position.set(n.x,n.y,n.z),this.scale.set(r.x,r.y,r.z),this.renderOrder=1}}class Np extends Au{constructor(e,t){super(t,"Poi"),this.isEventPropagation=!1;const{name:n,nameScale:r={x:16,y:16,z:1},onClick:i,onDblClick:s,onRightClick:o}=t;this.onClick=(null==i?void 0:i.bind(this))||null,this.onDblClick=(null==s?void 0:s.bind(this))||null,this.onRightClick=(null==o?void 0:o.bind(this))||null,this.icon=this._createIcon(e),this.text=null,this.name&&this._createText({position:{x:0,y:10,z:0},name:n,scale:r}),this.renderOrder=11}getBoundingBox(e=50){e=e<=0?50:e;const t=new V,n=new V,r=new V(e,e,e);return t.copy(this.position),n.copy(this.position),t.sub(r),n.add(r),new q(t,n)}eventPropagation(){this.isEventPropagation=!0}sClone(e){return new Np(this.icon.material,{id:`${this.sid}_clone`,url:"",name:this.name}).sCopy(this,e)}_createIcon(e){const t=new Bp(e);return this.add(t),t}_createText(e){const t=this._createCanvasText(e.name||""),n=new B(t);n.flipY=!0,n.version+=1;const r=new Ji({map:n,depthTest:!0});this.text=new Bp(r,e),this.add(this.text)}_createCanvasText(e,t){const n=document.createElement("canvas");n.width=256,n.height=256;const r=n.getContext("2d"),{fontFamily:i,fontSize:s,color:o,textAlign:a,textBaseline:l}=Object.assign(Object.assign({},{fontFamily:"Microsoft YaHei",fontSize:32,color:"#fff",textAlign:"center",textBaseline:"bottom"}),t);return r&&(r.save(),r.font=s+"px "+i,r.textAlign=a,r.textBaseline=l,r.shadowColor="black",r.strokeStyle="black",r.lineWidth=3,r.fillStyle=o,r.strokeText(e,128,128),r.fillText(e,128,128),r.restore()),n}}class zp extends Eu{constructor(e,t="Point"){const{radius:n=10,color:r=255,opacity:i=1}=e;super(function(e){return new ma(e,32,32)}(n),function(e,t){return new ot({color:e,opacity:t,transparent:!0})}(r,i),e,t)}setOptions(e){const{color:t,opacity:n,radius:r,position:i}=e,s=this.material;t&&(s.color=new P(t)),n&&(s.opacity=n),r&&(this.geometry=new ma(r,32,32)),i&&this.position.copy(Hh(i)),s.version++,Tp.needRender=!0}}class Up extends zp{constructor(e){super(e,"Node"),this.graphs=e.graphs}}class kp extends Eu{constructor(e){const{radius:t=50,color:n=65280,opacity:r=1}=e;super(function(e){return new To(e,64)}(t),function(e,t){return new ot({color:e,opacity:t,transparent:!0,side:2})}(n,r),e,"Circle"),this.rotation.set(Math.PI/2,0,0)}setOptions(e){const{color:t,opacity:n,radius:r,position:i}=e,s=this.material;t&&(s.color=new P(t)),n&&(s.opacity=n),r&&(this.geometry=new To(r,64)),i&&this.position.copy(Hh(i)),s.version++,Tp.needRender=!0}}class Fp extends Eu{constructor(e){const{start:t,end:n,imgUrl:r,width:i=20,color:s=65280,opacity:o=1,animation:a=!1,passable:l=0,restrict:c=0}=e,h=Hh(t),u=Hh(n),d=h.distanceTo(u);super(function(e,t,n,r=new V(0,1,0)){const i=n/2,s=new V,o=new V;s.subVectors(t,e),s.normalize(),o.crossVectors(s,r);const a=new V(o.x*i,o.y*i,o.z*i),l=new V(-o.x*i,-o.y*i,-o.z*i),c=new V;c.addVectors(e,a);const h=new V;h.addVectors(e,l);const u=new V;u.addVectors(t,l);const d=new V;d.addVectors(t,a);const p=new At;return p.setAttribute("position",new yt([c.x,c.y,c.z,h.x,h.y,h.z,u.x,u.y,u.z,u.x,u.y,u.z,d.x,d.y,d.z,c.x,c.y,c.z],3)),p.setAttribute("uv",new yt([0,0,1,0,1,1,1,1,0,1,0,0],2)),p}(h,u,i),function(e,t,n,r,i,s){const o=new ot({color:n,side:2,transparent:!0,opacity:r});let a;return i&&(a=(new il).load(i,(n=>{a.repeat.set(1,e/(t*(n.image.height/n.image.width))*.63*(n.image.height/n.image.height)),o.color.set(16777215)})),a.wrapS=1e3,a.wrapT=1e3,a.flipY=!0,a.matrixAutoUpdate=!0,tu(s)&&s?Tu(a.offset,{y:-1,x:0},{repeat:!0,duration:500}):iu(s)&&Tu(a.offset,{y:-1,x:0},Object.assign(Object.assign({},s),{repeat:!0})),o.map=a),o}(d,i,s,o,r,a),e,"Link"),this.passable=l,this.restrict=c}}class Hp extends Au{constructor(e){super(e,"Topology");const{type:t="line"}=e;this.type=t,this.nodes=[],this.links=[],this.info=e,this.create()}create(){const{nodes:e,renderLink:t=!0,linkWidth:n=20,linkColor:r=65280,renderNode:i=!0,nodeColor:s=255,nodeRadius:o=n/2,imgUrl:a,animation:l=!1}=this.info,c=[];for(const h of e){const e=this.createNode(Object.assign(Object.assign({},h),{radius:o,color:s}));if(!1===i&&e.hide(),this.nodes.push(e),!a&&t){const e=ru(r)?r[h.graphs[0].passable]?r[h.graphs[0].passable]:r[0]:r;this.createCircle({id:`${h.id}_circle`,name:`${h.name||h.id}_circle`,position:h.position,radius:n/2,color:e})}if(t)for(let e=0;e<h.graphs.length;e++){const{linkInfo:t,targetNodeId:i,passable:s,restrict:o}=h.graphs[e],{id:u,name:d}=t,p=this.info.nodes.find((e=>e.id===i));if(!c.includes(u)&&p){c.push(u);const e=ru(r)?r[s]?r[s]:r[0]:r,t=this.createLink({id:u,name:d,start:h.position,end:p.position,width:n,color:e,imgUrl:a,animation:l,passable:s,restrict:o});this.links.push(t)}}}}createNode(e){const t=new Up(Object.assign({},e));return this.add(t),t}createCircle(e){const t=new kp(Object.assign(Object.assign({},e),{rotation:{x:Math.PI/2,y:0,z:0}}));return this.add(t),t}createLink(e){const t=new Fp(Object.assign({},e));return this.add(t),t}resetNodes(e){const{linkWidth:t=20,linkColor:n=65280,nodeColor:r=255,imgUrl:i,animation:s=!1}=this.info,o=[...this.info.nodes];this.info.nodes=[...e];const a=[];for(let t=0;t<o.length;t++){const n=e.find((e=>e.id===o[t].id));(!n||Hh(n.position).distanceTo(Hh(o[t].position))>1)&&a.push(o[t])}for(let e=0;e<a.length;e++){const t=this.nodes.findIndex((t=>a[e].id===t.sid));this.remove(this.nodes[t]),this.nodes.splice(t,1)}const l=[];for(let t=0;t<e.length;t++){const n=o.find((n=>n.id===e[t].id));(!n||Hh(n.position).distanceTo(Hh(e[t].position))>1)&&l.push(e[t])}for(let e=0;e<l.length;e++){const n=this.createNode(Object.assign(Object.assign({},l[e]),{radius:t/2,color:r}));this.nodes.push(n)}const c=[];for(let e=0;e<o.length;e++)for(let t=0;t<o[e].graphs.length;t++)c.push(Object.assign(Object.assign({},o[e].graphs[t]),{sourceNodeId:o[e].id.toString()}));const h=[];for(let t=0;t<e.length;t++)for(let n=0;n<e[t].graphs.length;n++)h.push(Object.assign(Object.assign({},e[t].graphs[n]),{sourceNodeId:e[t].id.toString()}));const u=[];for(let t=0;t<c.length;t++){const n=h.find((e=>e.linkInfo.id===c[t].linkInfo.id));if(n){const r=o.find((e=>e.id===n.targetNodeId)),i=e.find((e=>e.id===n.targetNodeId));r&&i&&Hh(r.position).distanceTo(Hh(i.position))>1&&u.push(c[t])}else u.push(c[t])}for(let e=0;e<u.length;e++){const t=this.links.findIndex((t=>u[e].linkInfo.id===t.sid));this.remove(this.links[t]),this.links.splice(t,1)}const d=[];for(let t=0;t<h.length;t++){const n=c.find((e=>e.linkInfo.id===h[t].linkInfo.id));if(n){const r=o.find((e=>e.id===n.targetNodeId)),i=e.find((e=>e.id===n.targetNodeId));r&&i&&Hh(r.position).distanceTo(Hh(i.position))>1&&d.push(h[t])}else d.push(h[t])}for(let r=0;r<d.length;r++){const{linkInfo:o,targetNodeId:a,sourceNodeId:l,passable:c,restrict:h}=d[r],{id:u,name:p}=o,f=e.find((e=>e.id===l)),m=e.find((e=>e.id===a));if(f&&m){const e=ru(n)?n[c]?n[c]:n[0]:n,r=this.createLink({id:u,name:p,start:f.position,end:m.position,width:t,color:e,imgUrl:i,animation:s,passable:c,restrict:h});this.links.push(r)}}}}function Gp(e,t,n=new V(0,1,0)){const r=t/2,i=new At;let s=[],o=[];if(e.length<2)return i;for(let t=0;t<e.length-1;t++){const i=Hh(e[t]),a=Hh(e[t+1]),l=new V,c=new V;l.subVectors(a,i),l.normalize(),c.crossVectors(l,n);const h=new V(c.x*r,c.y*r,c.z*r),u=new V(-c.x*r,-c.y*r,-c.z*r),d=new V;d.addVectors(i,h);const p=new V;p.addVectors(i,u);const f=new V;f.addVectors(a,u);const m=new V;m.addVectors(a,h),s=[...s,d.x,d.y,d.z,p.x,p.y,p.z,f.x,f.y,f.z,f.x,f.y,f.z,m.x,m.y,m.z,d.x,d.y,d.z],o=[...o,0,0,1,0,1,1,1,1,0,1,0,0]}return i.setAttribute("position",new yt(s,3)),i.setAttribute("uv",new yt(o,2)),i}class jp extends Eu{constructor(e,t="Line"){const{points:n,width:r=20,color:i=65280,opacity:s=1}=e;super(Gp(n,r),function(e,t){return new ot({color:e,side:2,transparent:!0,opacity:t})}(i,s),e,t),this.params=e,this.points=n,this.frustumCulled=!1}setOptions(e){const{color:t,opacity:n,points:r,width:i}=e;this.points=r;const s=this.material;t&&(s.color=new P(t)),n&&(s.opacity=n),r&&i?this.geometry=Gp(r,i):r?this.geometry=Gp(r,this.params.width||20):i&&(this.geometry=Gp(this.points,i)),s.version++,Tp.needRender=!0}}function Vp(e){const t=[];for(let n=0;n<e.length;n++)t.push(new p(e[n].x,e[n].z));return t.length>2?new fa(new Bo(t)):new At}class Wp extends Eu{constructor(e,t="Polygon"){const{yHeight:n,points:r,color:i=16776960,opacity:s=1}=e;super(Vp(r),function(e,t){return new ot({color:e,opacity:t,transparent:!0,side:2})}(i,s),e,t),this.points=r,this.position.set(0,n,0),this.rotation.set(Math.PI/2,0,0)}setOptions(e){const{color:t,opacity:n,yHeight:r,points:i}=e,s=this.material;t&&(s.color=new P(t)),n&&(s.opacity=n),r&&this.position.set(0,r,0),i&&(this.geometry=Vp(i)),s.version++,Tp.needRender=!0}}class Xp extends Au{constructor(e){super(e,"Canvas3D"),this.create(e)}create(e){const{points:t=[],lines:n=[],polygons:r=[],circles:i=[]}=e;for(let e=0;e<t.length;e++)this.createPoint(t[e]);for(let e=0;e<n.length;e++)this.createLine(n[e]);for(let e=0;e<r.length;e++)this.createPolygon(r[e]);for(let e=0;e<i.length;e++)this.createCircle(i[e])}createPoint(e){const t=new zp(e);return this.add(t),Tp.needRender=!0,t}getPoint(e){return this.getChildForType("Point",e)}removePoint(e){const t=this.getPoint(e);t&&this.remove(t),Tp.needRender=!0}createLine(e){const t=new jp(e);return this.add(t),Tp.needRender=!0,t}getLine(e){return this.getChildForType("Line",e)}removeLine(e){const t=this.getLine(e);t&&this.remove(t),Tp.needRender=!0}createPolygon(e){const t=new Wp(e);return this.add(t),Tp.needRender=!0,t}getPolygon(e){return this.getChildForType("Polygon",e)}removePolygon(e){const t=this.getPolygon(e);t&&this.remove(t),Tp.needRender=!0}createCircle(e){const t=new kp(e);return this.add(t),Tp.needRender=!0,t}getCircle(e){return this.getChildForType("Circle",e)}removeCircle(e){const t=this.getCircle(e);t&&this.remove(t),Tp.needRender=!0}getChildForType(e,t){for(let n=0;n<this.children.length;n++)if(this.children[n].stype===e&&this.children[n].sid===t)return this.children[n];return null}}class qp extends Eu{constructor(e,t,n){super(e,t,n,"Ground")}}var Yp=Object.freeze({__proto__:null,BaseObject3D:Au,BaseMesh:Eu,SceneManage:Cu,Group:Pu,PluginObject:Ru,PoiNode:Ku,Sbm:Lp,Model:Dp,Poi:Np,Icon:Bp,Topology:Hp,Point:zp,Line:jp,Polygon:Wp,Circle:kp,Node:Up,Link:Fp,Canvas3D:Xp,Ground:qp});class Zp{constructor(e,t){this.type=e,this.scene=new Cu({id:`${e.toLocaleLowerCase()}Manager`}),this.viewport=t,this.viewport.scener.addObject(this.scene)}update(){if(0===this.scene.children.length)return;const e=e=>{const{level:t,handleHide:n,autoUpdate:r}=e,{max:i=null,min:s=null}=t;if(r)e.autoUpdate=!1,this.viewport.signals.objectChanged.dispatch();else if(!n&&(i||s)){const t=this.viewport.camera.position.distanceTo(e.position);((e,t)=>{e.visible!==t&&(e instanceof Ku&&e._setElementDisplay(t),e.visible=t,e.matrixAutoUpdate=t,e.autoUpdate=!0)})(e,!(i&&t>i||s&&t<s))}};this.scene.traverse((t=>{(t instanceof Au||t instanceof Eu)&&e(t)}))}getById(e,t=this.type){return this._getChildByTypeAndProp(t,"sid",e)[0]||null}getByName(e,t=this.type){return this._getChildByTypeAndProp(t,"name",e)}getByUserDataProperty(e,t){const n=[];return this.scene.traverse((r=>{r instanceof Au&&iu(r)&&r.stype===this.type&&(su(e)&&e(r.userData)||eu(e)&&r.userData[e]===t)&&n.push(r)})),n}removeById(e){const t=this.getById(e);return!!t&&(this.viewport.scener.removeObject(t),!0)}createGroup(e){const t=new Pu(e);return this.viewport.scener.addObject(t,this.scene),t}getGroupById(e){return this._getChildByTypeAndProp("Group","sid",e)[0]||null}getGroupByName(e){return this._getChildByTypeAndProp("Group","name",e)}getAllGroup(){const e=[];return this.scene.traverse((t=>{t instanceof Pu&&iu(t)&&"Group"===t.stype&&e.push(t)})),e}removeGroupById(e){const t=this.getGroupById(e);return!!t&&(this.viewport.scener.removeObject(t),!0)}clear(){if(0!==this.scene.children.length)for(let e=this.scene.children.length-1;e>=0;e--)this.viewport.scener.removeObject(this.scene.children[e])}getAll(){const e=[];return this.scene.traverse((t=>{((t instanceof Au||t instanceof Eu)&&iu(t)&&t.stype===this.type||iu(t)&&t.userData.stype===this.type)&&e.push(t)})),e}hideAll(){this.getAll().forEach((e=>{e.hide?e.hide():e.visible=!1})),this.viewport.signals.objectChanged.dispatch()}showAll(){this.getAll().forEach((e=>{e.show?e.show():e.visible=!0})),this.viewport.signals.objectChanged.dispatch()}_getChildByTypeAndProp(e,t,n){const r=[];return t&&n?(this.scene.traverse((i=>{((i instanceof Au||i instanceof Eu)&&iu(i)&&i.stype===e&&i[t]===n||iu(i)&&i.userData.stype===e&&i.userData[t]===n)&&r.push(i)})),r):r}}class Jp extends Zp{constructor(e){super("Light",e),class{static init(){const e=[1,0,0,2e-5,1,0,0,503905e-9,1,0,0,.00201562,1,0,0,.00453516,1,0,0,.00806253,1,0,0,.0125978,1,0,0,.018141,1,0,0,.0246924,1,0,0,.0322525,1,0,0,.0408213,1,0,0,.0503999,1,0,0,.0609894,1,0,0,.0725906,1,0,0,.0852058,1,0,0,.0988363,1,0,0,.113484,1,0,0,.129153,1,0,0,.145839,1,0,0,.163548,1,0,0,.182266,1,0,0,.201942,1,0,0,.222314,1,0,0,.241906,1,0,0,.262314,1,0,0,.285754,1,0,0,.310159,1,0,0,.335426,1,0,0,.361341,1,0,0,.387445,1,0,0,.412784,1,0,0,.438197,1,0,0,.466966,1,0,0,.49559,1,0,0,.523448,1,0,0,.549938,1,0,0,.57979,1,0,0,.608746,1,0,0,.636185,1,0,0,.664748,1,0,0,.69313,1,0,0,.71966,1,0,0,.747662,1,0,0,.774023,1,0,0,.799775,1,0,0,.825274,1,0,0,.849156,1,0,0,.873248,1,0,0,.89532,1,0,0,.917565,1,0,0,.937863,1,0,0,.958139,1,0,0,.976563,1,0,0,.994658,1,0,0,1.0112,1,0,0,1.02712,1,0,0,1.04189,1,0,0,1.05568,1,0,0,1.06877,1,0,0,1.08058,1,0,0,1.09194,1,0,0,1.10191,1,0,0,1.11161,1,0,0,1.1199,1,0,0,1.12813,.999547,-4.48815e-7,.0224417,199902e-10,.999495,-113079e-10,.0224406,503651e-9,.999496,-452317e-10,.0224406,.00201461,.999496,-101772e-9,.0224406,.00453287,.999495,-180928e-9,.0224406,.00805845,.999497,-282702e-9,.0224406,.0125914,.999496,-407096e-9,.0224406,.0181319,.999498,-554114e-9,.0224406,.02468,.999499,-723768e-9,.0224406,.0322363,.999495,-916058e-9,.0224405,.0408009,.999499,-.00113101,.0224408,.050375,.999494,-.00136863,.0224405,.0609586,.999489,-.00162896,.0224401,.0725537,.999489,-.00191201,.0224414,.0851619,.999498,-.00221787,.0224413,.0987867,.999492,-.00254642,.0224409,.113426,.999507,-.00289779,.0224417,.129088,.999494,-.0032716,.0224386,.145767,.999546,-.0036673,.0224424,.163472,.999543,-.00408166,.0224387,.182182,.999499,-.00450056,.0224338,.201843,.999503,-.00483661,.0224203,.222198,.999546,-.00452928,.022315,.241714,.999508,-.00587403,.0224329,.262184,.999509,-.00638806,.0224271,.285609,.999501,-.00691028,.0224166,.309998,.999539,-.00741979,.0223989,.335262,.999454,-.00786282,.0223675,.361154,.999529,-.00811928,.0222828,.387224,.999503,-.00799941,.0221063,.41252,.999561,-.00952753,.0223057,.438006,.999557,-.0099134,.0222065,.466735,.999541,-.0100935,.0220402,.495332,.999562,-.00996821,.0218067,.523197,.999556,-.0105031,.0217096,.550223,.999561,-.0114191,.0217215,.579498,.999588,-.0111818,.0213357,.608416,.999633,-.0107725,.0208689,.635965,.999527,-.0121671,.0210149,.664476,.999508,-.0116005,.020431,.692786,.999568,-.0115604,.0199791,.719709,.999671,-.0121117,.0197415,.74737,.999688,-.0110769,.0188846,.773692,.99962,-.0122368,.0188452,.799534,.999823,-.0110325,.0178001,.825046,.999599,-.0114923,.0174221,.849075,.999619,-.0105923,.0164345,.872999,.999613,-.0105988,.0158227,.895371,.99964,-.00979861,.0148131,.917364,.99977,-.00967238,.0140721,.938002,.999726,-.00869175,.0129543,.957917,.99973,-.00866872,.0122329,.976557,.999773,-.00731956,.0108958,.994459,.999811,-.00756027,.0102715,1.01118,.999862,-.00583732,.00878781,1.02701,.999835,-.00631438,.00827529,1.04186,.999871,-.00450785,.00674583,1.05569,.999867,-.00486079,.00621041,1.06861,.999939,-.00322072,.00478301,1.08064,.999918,-.00318199,.00406395,1.09181,1.00003,-.00193348,.00280682,1.10207,.999928,-.00153729,.00198741,1.11152,.999933,-623666e-9,917714e-9,1.12009,1,-102387e-11,9.07581e-7,1.12813,.997866,-8.96716e-7,.0448334,199584e-10,.997987,-225945e-10,.0448389,502891e-9,.997987,-903781e-10,.0448388,.00201156,.997985,-203351e-9,.0448388,.00452602,.997986,-361514e-9,.0448388,.00804629,.997987,-56487e-8,.0448389,.0125724,.997988,-813423e-9,.0448389,.0181045,.997984,-.00110718,.0448387,.0246427,.997985,-.00144616,.0448388,.0321875,.997987,-.00183038,.044839,.0407392,.997983,-.00225987,.0448387,.0502986,.997991,-.00273467,.0448389,.0608667,.997984,-.00325481,.0448384,.0724444,.998002,-.00382043,.044839,.0850348,.997997,-.00443145,.0448396,.0986372,.998007,-.00508796,.0448397,.113255,.998008,-.00578985,.04484,.128891,.998003,-.00653683,.0448384,.145548,.997983,-.00732713,.0448358,.163221,.997985,-.00815454,.0448358,.181899,.998005,-.00898985,.0448286,.201533,.998026,-.00964404,.0447934,.221821,.998055,-.00922677,.044611,.241282,.99804,-.0117361,.0448245,.261791,.998048,-.0127628,.0448159,.285181,.998088,-.0138055,.0447996,.30954,.998058,-.0148206,.0447669,.334751,.998099,-.0156998,.044697,.36061,.998116,-.0161976,.0445122,.386603,.998195,-.015945,.0441711,.411844,.998168,-.0183947,.0444255,.43773,.998184,-.0197913,.0443809,.466009,.998251,-.0201426,.0440689,.494574,.998305,-.0198847,.0435632,.522405,.998273,-.0210577,.043414,.549967,.998254,-.0227901,.0433943,.578655,.998349,-.0223108,.0426529,.60758,.99843,-.0223088,.042,.635524,.998373,-.0241141,.0418987,.663621,.998425,-.0231446,.0408118,.691906,.998504,-.0233684,.0400565,.719339,.998443,-.0241652,.0394634,.74643,.99848,-.0228715,.0380002,.773086,.998569,-.023519,.0372322,.798988,.998619,-.0223108,.0356468,.824249,.998594,-.0223105,.034523,.848808,.998622,-.0213426,.0328887,.87227,.998669,-.0207912,.0314374,.895157,.998705,-.0198416,.0296925,.916769,.998786,-.0189168,.0279634,.937773,.998888,-.0178811,.0261597,.957431,.99906,-.0166845,.0242159,.976495,.999038,-.0155464,.0222638,.994169,.999237,-.0141349,.0201967,1.01112,.999378,-.0129324,.0181744,1.02692,.999433,-.0113192,.0159898,1.04174,.999439,-.0101244,.0140385,1.05559,.999614,-.00837456,.0117826,1.06852,.999722,-.00721769,.00983745,1.08069,.999817,-.00554067,.00769002,1.09176,.99983,-.00426961,.005782,1.10211,.999964,-.00273904,.00374503,1.11152,1.00001,-.00136739,.00187176,1.12031,.999946,393227e-10,-28919e-9,1.12804,.995847,-13435e-10,.0671785,19916e-9,.995464,-338387e-10,.0671527,501622e-9,.99547,-135355e-9,.0671531,.00200649,.995471,-30455e-8,.0671532,.00451461,.99547,-541423e-9,.0671531,.008026,.995471,-84598e-8,.0671531,.0125407,.99547,-.00121823,.0671531,.0180589,.99547,-.00165817,.0671531,.0245806,.995463,-.00216583,.0671526,.0321062,.995468,-.00274127,.0671527,.0406366,.995474,-.00338447,.0671534,.0501717,.995473,-.00409554,.0671533,.0607131,.995478,-.00487451,.0671531,.0722618,.995476,-.00572148,.0671532,.0848191,.995477,-.00663658,.0671539,.0983882,.995498,-.00761986,.0671541,.112972,.995509,-.00867094,.0671542,.128568,.995509,-.00978951,.0671531,.145183,.995503,-.0109725,.0671491,.162808,.995501,-.012211,.0671465,.181441,.99553,-.0134565,.0671371,.201015,.99555,-.014391,.0670831,.221206,.99558,-.014351,.0668883,.240813,.995577,-.0173997,.0671055,.261257,.995602,-.0191111,.0671178,.284467,.995623,-.0206705,.0670946,.308765,.995658,-.022184,.0670472,.333905,.995705,-.0234832,.0669417,.359677,.995719,-.0241933,.0666714,.385554,.995786,-.0243539,.066266,.410951,.995887,-.0271866,.0664367,.437163,.995944,-.0296012,.0664931,.464842,.996004,-.0301045,.0660105,.49332,.996128,-.0298311,.0652694,.521131,.996253,-.0316426,.0650739,.549167,.996244,-.0339043,.0649433,.57737,.996309,-.033329,.0638926,.606073,.996417,-.0338935,.0630849,.634527,.996372,-.0353104,.0625083,.66256,.996542,-.0348942,.0611986,.690516,.996568,-.0351614,.060069,.718317,.996711,-.0354317,.0588522,.74528,.996671,-.0349513,.0571902,.772061,.996865,-.0345622,.0555321,.798089,.996802,-.0342566,.0537816,.823178,.996992,-.0330862,.0516095,.847949,.996944,-.0324666,.0495537,.871431,.997146,-.0309544,.0470302,.894357,.997189,-.0299372,.0446043,.916142,.997471,-.0281389,.0418812,.937193,.997515,-.0268702,.0391823,.957,.997812,-.0247166,.0361338,.975936,.998027,-.0233525,.0333945,.99391,.998233,-.0209839,.0301917,1.01075,.998481,-.0194309,.027271,1.02669,.998859,-.0169728,.0240162,1.04173,.99894,-.0152322,.0210517,1.05551,.999132,-.0127497,.0178632,1.06856,.999369,-.0108282,.014787,1.08054,.999549,-.00845886,.0116185,1.09185,.999805,-.0063937,.00867209,1.10207,.99985,-.00414582,.00566823,1.1117,.999912,-.00207443,.00277562,1.12022,1.00001,870226e-10,-53766e-9,1.12832,.991943,-178672e-11,.0893382,198384e-10,.991952,-450183e-10,.089339,499849e-9,.991956,-180074e-9,.0893394,.0019994,.991955,-405167e-9,.0893393,.00449867,.991953,-720298e-9,.0893391,.00799764,.991955,-.00112548,.0893393,.0124964,.991957,-.0016207,.0893395,.0179951,.991958,-.00220601,.0893396,.0244939,.991947,-.00288137,.0893385,.0319929,.991962,-.00364693,.0893399,.0404933,.991965,-.00450264,.0893399,.049995,.99198,-.00544862,.0893411,.0604995,.99197,-.00648491,.0893397,.0720074,.991976,-.00761164,.089341,.0845207,.99198,-.00882891,.0893405,.0980413,.991982,-.0101367,.0893396,.112571,.992008,-.011535,.0893415,.128115,.992026,-.0130228,.0893414,.144672,.992064,-.0145966,.0893418,.162241,.992041,-.0162421,.0893359,.180801,.992086,-.0178888,.0893214,.200302,.992157,-.0190368,.0892401,.220332,.992181,-.0195584,.0890525,.240144,.992175,-.0227257,.0892153,.260728,.99221,-.0254195,.089304,.283473,.99222,-.0274883,.0892703,.307673,.992317,-.0294905,.0892027,.332729,.992374,-.0311861,.0890577,.358387,.992505,-.0320656,.0886994,.384102,.992568,-.0329715,.0883198,.409767,.992675,-.036006,.0883602,.436145,.992746,-.0392897,.0884591,.463217,.992873,-.0399337,.0878287,.491557,.992934,-.040231,.0870108,.519516,.993091,-.0422013,.0865857,.547741,.993259,-.0443503,.0861937,.575792,.993455,-.0446368,.0851187,.604233,.993497,-.0454299,.0840576,.632925,.993694,-.0463296,.0829671,.660985,.993718,-.0470619,.0817185,.688714,.993973,-.0468838,.0800294,.716743,.994207,-.046705,.0781286,.74377,.994168,-.0469698,.0763337,.77042,.9945,-.0456816,.0738184,.796659,.994356,-.0455518,.0715545,.821868,.994747,-.0439488,.0686085,.846572,.994937,-.0430056,.065869,.870435,.995142,-.0413414,.0626446,.893272,.995451,-.0396521,.05929,.915376,.995445,-.0378453,.0558503,.936196,.995967,-.0355219,.0520949,.956376,.996094,-.0335146,.048377,.975327,.996622,-.030682,.0442575,.993471,.996938,-.0285504,.0404693,1.01052,.997383,-.0253399,.0360903,1.02637,.997714,-.0231651,.0322176,1.04139,.998249,-.0198138,.0278433,1.05542,.998596,-.0174337,.0238759,1.06846,.998946,-.0141349,.0195944,1.08056,.99928,-.0115603,.0156279,1.09181,.999507,-.00839065,.0114607,1.10213,.999697,-.005666,.00763325,1.11169,.999869,-.00269902,.00364946,1.12042,1.00001,623836e-10,-319288e-10,1.12832,.987221,-222675e-11,.111332,197456e-10,.98739,-561116e-10,.111351,497563e-9,.987448,-224453e-9,.111357,.00199031,.987441,-505019e-9,.111357,.0044782,.987442,-897816e-9,.111357,.00796129,.987442,-.00140284,.111357,.0124396,.987444,-.00202012,.111357,.0179132,.987442,-.00274964,.111357,.0243824,.987446,-.00359147,.111357,.0318474,.987435,-.00454562,.111356,.0403086,.987461,-.00561225,.111358,.0497678,.987458,-.00679125,.111358,.0602239,.987443,-.0080828,.111356,.0716792,.987476,-.0094872,.111358,.0841364,.98749,-.0110044,.111361,.097597,.987508,-.0126344,.111362,.112062,.987494,-.0143767,.111357,.127533,.987526,-.0162307,.111359,.144015,.987558,-.0181912,.111361,.161502,.987602,-.0202393,.111355,.179979,.987692,-.022273,.111346,.199386,.987702,-.0235306,.111215,.219183,.987789,-.0247628,.111061,.239202,.987776,-.0280668,.111171,.259957,.987856,-.0316751,.111327,.282198,.987912,-.0342468,.111282,.306294,.988,-.0367205,.111198,.331219,.988055,-.0387766,.110994,.356708,.988241,-.0397722,.110547,.382234,.988399,-.0416076,.110198,.408227,.988539,-.0448192,.110137,.434662,.988661,-.0483793,.110143,.461442,.988967,-.0495895,.109453,.489318,.989073,-.0506797,.108628,.517516,.989274,-.0526953,.108003,.545844,.989528,-.054578,.107255,.573823,.989709,-.0561503,.106294,.601944,.989991,-.056866,.104896,.630855,.990392,-.0572914,.103336,.658925,.990374,-.0586224,.10189,.686661,.990747,-.0584764,.099783,.714548,.991041,-.0582662,.0974309,.74186,.991236,-.0584118,.0951678,.768422,.991585,-.0573055,.0921581,.794817,.991984,-.0564241,.0891167,.820336,.9921,-.0553608,.085805,.84493,.992749,-.0533816,.0820354,.868961,.99288,-.0518661,.0782181,.891931,.993511,-.0492492,.0738935,.914186,.993617,-.0471956,.0696402,.93532,.99411,-.044216,.0649659,.95543,.994595,-.0416654,.0603177,.974685,.994976,-.0384314,.0553493,.992807,.995579,-.0353491,.0503942,1.00996,.996069,-.0319787,.0452123,1.02606,.996718,-.028472,.0400112,1.04114,.997173,-.0250789,.0349456,1.05517,.997818,-.0213326,.029653,1.0683,.998318,-.0178509,.024549,1.0805,.998853,-.0141118,.0194197,1.09177,.999218,-.0105914,.0143869,1.1022,.999594,-.00693474,.00943517,1.11175,.99975,-.00340478,.00464051,1.12056,1.00001,109172e-9,-112821e-9,1.12853,.983383,-266524e-11,.133358,196534e-10,.981942,-671009e-10,.133162,494804e-9,.981946,-268405e-9,.133163,.00197923,.981944,-603912e-9,.133163,.00445326,.981941,-.00107362,.133162,.00791693,.981946,-.00167755,.133163,.0123703,.981944,-.00241569,.133162,.0178135,.981945,-.00328807,.133163,.0242466,.981945,-.00429472,.133162,.03167,.981955,-.00543573,.133164,.0400846,.981951,-.00671105,.133163,.0494901,.981968,-.00812092,.133165,.0598886,.981979,-.00966541,.133166,.0712811,.981996,-.0113446,.133168,.083669,.982014,-.0131585,.133169,.0970533,.982011,-.0151073,.133167,.111438,.982062,-.0171906,.133172,.126826,.9821,-.0194067,.133175,.143215,.982149,-.0217502,.133176,.160609,.982163,-.0241945,.133173,.178981,.982247,-.0265907,.133148,.198249,.982291,-.027916,.132974,.217795,.982396,-.0299663,.132868,.238042,.982456,-.0334544,.132934,.258901,.982499,-.0378636,.133137,.280639,.982617,-.0409274,.133085,.304604,.98274,-.0438523,.132985,.329376,.982944,-.0462288,.132728,.354697,.98308,-.0475995,.132228,.380102,.983391,-.0501901,.131924,.406256,.983514,-.0535899,.131737,.432735,.98373,-.0571858,.131567,.459359,.984056,-.0592353,.130932,.486637,.984234,-.0610488,.130092,.51509,.984748,-.0630758,.12923,.543461,.985073,-.0647398,.128174,.571376,.985195,-.0671941,.127133,.599414,.985734,-.0681345,.125576,.628134,.986241,-.0686089,.123639,.656399,.986356,-.0698511,.121834,.684258,.986894,-.0700931,.119454,.711818,.987382,-.0698321,.116718,.739511,.988109,-.0693975,.113699,.766267,.988363,-.0689584,.110454,.792456,.989112,-.0672353,.106602,.81813,.989241,-.0662034,.10267,.842889,.990333,-.0638938,.0981381,.867204,.990591,-.0618534,.0935388,.89038,.991106,-.0593117,.088553,.912576,.991919,-.0562676,.0832187,.934118,.992111,-.0534085,.0778302,.954254,.992997,-.0495459,.0720453,.973722,.993317,-.0463707,.0663458,.991949,.994133,-.0421245,.0601883,1.00936,.994705,-.0384977,.0542501,1.02559,.995495,-.0340956,.0479862,1.04083,.996206,-.030105,.041887,1.05497,.996971,-.0256095,.0355355,1.06824,.997796,-.0213932,.0293655,1.08056,.998272,-.0169612,.0232926,1.09182,.998857,-.0126756,.0172786,1.10219,.99939,-.00832486,.0113156,1.11192,.999752,-.00410826,.00557892,1.12075,1,150957e-9,-119101e-9,1.12885,.975169,-309397e-11,.154669,195073e-10,.975439,-779608e-10,.154712,491534e-9,.975464,-311847e-9,.154716,.00196617,.975464,-701656e-9,.154716,.00442387,.975462,-.0012474,.154715,.0078647,.975461,-.00194906,.154715,.0122886,.975464,-.00280667,.154715,.0176959,.975468,-.00382025,.154716,.0240867,.975471,-.00498985,.154716,.0314612,.975472,-.00631541,.154717,.0398199,.975486,-.00779719,.154718,.0491639,.975489,-.00943505,.154718,.0594932,.975509,-.0112295,.154721,.0708113,.97554,-.0131802,.154724,.0831176,.975557,-.0152876,.154726,.096415,.975585,-.0175512,.154728,.110705,.975605,-.0199713,.154729,.125992,.975645,-.0225447,.154729,.142272,.975711,-.0252649,.154735,.159549,.975788,-.0280986,.154736,.177805,.975872,-.0308232,.154704,.196911,.975968,-.0324841,.154525,.216324,.976063,-.0351281,.154432,.236628,.976157,-.0388618,.15446,.257539,.976204,-.0437704,.154665,.278975,.976358,-.047514,.154652,.302606,.976571,-.0508638,.154535,.327204,.976725,-.0534995,.154221,.352276,.977013,-.0555547,.153737,.377696,.977294,-.0586728,.153403,.403855,.977602,-.0622715,.15312,.430333,.977932,-.0658166,.152755,.456855,.978241,-.0689877,.152233,.483668,.978602,-.0712805,.15132,.512097,.979234,-.0732775,.150235,.540455,.97977,-.075163,.148978,.568486,.979995,-.0778026,.147755,.596524,.98078,-.0791854,.146019,.624825,.981628,-.0799666,.143906,.653403,.982067,-.0808532,.141561,.681445,.98271,-.0816024,.139025,.708918,.983734,-.0812511,.135764,.736594,.98431,-.0806201,.132152,.763576,.985071,-.0801605,.12846,.789797,.98618,-.0784208,.124084,.815804,.986886,-.0766643,.1193,.840869,.987485,-.0747744,.114236,.864952,.988431,-.0716701,.108654,.888431,.988886,-.0691609,.102994,.910963,.990024,-.0654048,.0967278,.932629,.990401,-.0619765,.090384,.95313,.991093,-.0579296,.0837885,.972587,.992018,-.0536576,.0770171,.991184,.992536,-.0493719,.0701486,1.00863,.993421,-.0444813,.062953,1.02494,.993928,-.040008,.0560455,1.04017,.994994,-.0347982,.04856,1.05463,.995866,-.0301017,.0416152,1.06807,.996916,-.0248225,.0342597,1.08039,.997766,-.0199229,.0271668,1.09177,.998479,-.0147422,.0201387,1.10235,.99921,-.00980173,.0131944,1.11206,.999652,-.0047426,.00640712,1.12104,.999998,891673e-10,-10379e-8,1.12906,.967868,-351885e-11,.175947,193569e-10,.968001,-886733e-10,.175972,487782e-9,.96801,-354697e-9,.175973,.00195115,.968012,-798063e-9,.175974,.00439006,.968011,-.00141879,.175973,.00780461,.968011,-.00221686,.175973,.0121948,.968016,-.00319231,.175974,.0175607,.968019,-.00434515,.175974,.0239027,.968018,-.00567538,.175974,.0312208,.968033,-.00718308,.175977,.0395158,.968049,-.00886836,.175979,.0487885,.968047,-.0107312,.175978,.0590394,.968072,-.0127719,.175981,.0702705,.968108,-.0149905,.175986,.0824836,.968112,-.0173866,.175985,.0956783,.968173,-.0199611,.175993,.109862,.96827,-.0227128,.176008,.125033,.968292,-.025639,.17601,.141193,.968339,-.0287299,.176007,.158336,.968389,-.0319399,.176001,.176441,.968501,-.034941,.175962,.195359,.968646,-.0370812,.175793,.214686,.968789,-.0402329,.175708,.234973,.96886,-.0442601,.1757,.255871,.969013,-.049398,.175876,.277238,.969242,-.0539932,.17594,.300326,.969419,-.0577299,.175781,.324702,.969763,-.0605643,.175432,.349527,.970093,-.0634488,.174992,.374976,.970361,-.0670589,.174611,.401097,.970825,-.0708246,.174226,.427496,.971214,-.0742871,.173684,.453858,.971622,-.0782608,.173186,.480637,.972175,-.0813151,.172288,.508655,.972944,-.0832678,.170979,.536973,.973595,-.0855964,.169573,.565138,.974345,-.0882163,.168152,.593222,.975233,-.0901671,.166314,.621201,.976239,-.0912111,.163931,.649919,.977289,-.0916959,.161106,.678011,.978076,-.0927061,.158272,.705717,.979533,-.0925562,.15475,.733228,.980335,-.0918159,.150638,.760454,.981808,-.0908508,.146201,.786918,.983061,-.0896172,.141386,.812953,.984148,-.0871588,.135837,.838281,.985047,-.0850624,.130135,.862594,.986219,-.0818541,.123882,.88633,.987043,-.0784523,.117126,.908952,.988107,-.0749601,.110341,.930744,.988955,-.0703548,.102885,.951728,.989426,-.0662798,.0954167,.971166,.990421,-.0610834,.0876331,.989984,.991032,-.0562936,.0797785,1.00765,.992041,-.0508154,.0718166,1.02434,.992794,-.0454045,.0637125,1.03976,.993691,-.0398194,.0555338,1.05418,.994778,-.0341482,.0473388,1.06772,.995915,-.028428,.0391016,1.08028,.997109,-.022642,.0309953,1.09185,.998095,-.0168738,.0230288,1.10247,.998985,-.0111274,.0150722,1.11229,.999581,-.00543881,.00740605,1.12131,1.00003,162239e-9,-105549e-9,1.12946,.959505,-393734e-11,.196876,191893e-10,.959599,-992157e-10,.196895,483544e-9,.959641,-396868e-9,.196903,.0019342,.959599,-892948e-9,.196895,.00435193,.959603,-.00158747,.196896,.0077368,.959604,-.00248042,.196896,.0120888,.959605,-.00357184,.196896,.0174082,.959605,-.00486169,.196896,.0236949,.959613,-.00635008,.196897,.0309497,.959619,-.00803696,.196898,.0391725,.959636,-.00992255,.196901,.0483649,.959634,-.0120067,.1969,.0585266,.959675,-.0142898,.196906,.0696609,.959712,-.0167717,.196911,.0817678,.959752,-.0194524,.196918,.0948494,.959807,-.0223321,.196925,.10891,.959828,-.0254091,.196924,.123947,.959906,-.0286815,.196934,.139968,.960005,-.0321371,.196944,.156968,.960071,-.0357114,.196936,.17491,.960237,-.0389064,.196882,.193597,.960367,-.041623,.196731,.21285,.960562,-.0452655,.196654,.233075,.960735,-.0496207,.196643,.253941,.960913,-.0549379,.196774,.275278,.961121,-.0603414,.196893,.297733,.96139,-.0644244,.196717,.321877,.961818,-.067556,.196314,.346476,.962175,-.0712709,.195917,.371907,.96255,-.0752848,.1955,.397916,.963164,-.0792073,.195026,.424229,.963782,-.0828225,.194424,.450637,.964306,-.0873119,.193831,.477288,.964923,-.0911051,.192973,.504716,.966048,-.093251,.19151,.533053,.967024,-.0958983,.190013,.561366,.968038,-.09835,.188253,.589464,.969152,-.100754,.186257,.617433,.970557,-.102239,.183775,.645801,.972104,-.102767,.180645,.674278,.973203,-.103492,.177242,.702004,.975123,-.103793,.17345,.729529,.97641,-.102839,.168886,.756712,.978313,-.101687,.163892,.783801,.980036,-.100314,.158439,.809671,.981339,-.097836,.152211,.835402,.982794,-.0950006,.145679,.860081,.984123,-.0920994,.138949,.883757,.984918,-.0878641,.131283,.90685,.985999,-.083939,.123464,.928786,.987151,-.0791234,.115324,.94983,.987827,-.0739332,.106854,.96962,.988806,-.0688088,.0982691,.98861,.989588,-.0628962,.0893456,1.00667,.990438,-.0573146,.0805392,1.02344,.991506,-.0509433,.0713725,1.03933,.992492,-.0448724,.0623732,1.05378,.993663,-.0383497,.0530838,1.06747,.994956,-.0319593,.0439512,1.08007,.99634,-.025401,.0347803,1.09182,.99761,-.0189687,.0257954,1.1025,.99863,-.0124441,.0169893,1.11247,.99947,-.00614003,.00829498,1.12151,1.00008,216624e-9,-146107e-9,1.12993,.950129,-434955e-11,.217413,190081e-10,.950264,-10957e-8,.217444,47884e-8,.9503,-438299e-9,.217451,.00191543,.950246,-986124e-9,.21744,.00430951,.950246,-.00175311,.21744,.00766137,.950245,-.00273923,.21744,.011971,.950253,-.00394453,.217441,.0172385,.950258,-.00536897,.217442,.0234641,.950267,-.00701262,.217444,.030648,.950277,-.00887551,.217446,.038791,.950284,-.0109576,.217446,.0478931,.950312,-.0132591,.217451,.0579568,.950334,-.01578,.217454,.0689821,.950378,-.0185204,.217462,.0809714,.950417,-.0214803,.217467,.0939265,.950488,-.0246594,.217479,.10785,.950534,-.0280565,.217483,.122743,.950633,-.0316685,.217498,.138611,.950698,-.0354787,.217499,.155442,.950844,-.0394003,.217507,.173208,.950999,-.0426812,.217419,.191605,.951221,-.0461302,.217317,.21084,.951412,-.0502131,.217238,.230945,.951623,-.0549183,.21722,.251745,.951867,-.0604493,.217306,.273001,.952069,-.0665189,.217466,.294874,.952459,-.0709179,.217266,.318732,.952996,-.0746112,.216891,.34318,.953425,-.0789252,.216503,.36849,.953885,-.0833293,.216042,.394373,.954617,-.087371,.215469,.420505,.955429,-.0914054,.214802,.446907,.956068,-.0961671,.214146,.473522,.957094,-.10048,.213286,.50052,.958372,-.103248,.211796,.528715,.959654,-.106033,.21016,.557065,.961305,-.108384,.208149,.585286,.962785,-.111122,.206024,.613334,.964848,-.112981,.203442,.641334,.966498,-.113717,.19996,.669955,.968678,-.114121,.196105,.698094,.970489,-.114524,.191906,.725643,.972903,-.113792,.186963,.752856,.974701,-.112406,.181343,.780013,.976718,-.110685,.175185,.806268,.978905,-.108468,.168535,.832073,.980267,-.105061,.161106,.857149,.981967,-.101675,.153387,.881145,.983063,-.0974492,.145199,.904255,.984432,-.0925815,.136527,.926686,.985734,-.0877983,.127584,.947901,.986228,-.081884,.118125,.968111,.98719,-.0761208,.108594,.98719,.988228,-.0698196,.0989996,1.00559,.989046,-.0632739,.0890074,1.02246,.990242,-.056522,.0790832,1.03841,.991252,-.0495272,.0689182,1.05347,.992542,-.0425373,.0588592,1.06724,.994096,-.0353198,.0486833,1.08009,.995593,-.028235,.0385977,1.09177,.99711,-.0209511,.0286457,1.10274,.998263,-.0139289,.0188497,1.11262,.999254,-.0067359,.009208,1.12191,.999967,141846e-9,-657764e-10,1.13024,.935608,-474692e-11,.236466,187817e-10,.93996,-11971e-8,.237568,473646e-9,.939959,-478845e-9,.237567,.0018946,.939954,-.0010774,.237566,.00426284,.939956,-.00191538,.237566,.00757842,.939954,-.00299277,.237566,.0118413,.93996,-.00430961,.237567,.0170518,.939969,-.00586589,.237569,.02321,.939982,-.00766166,.237572,.0303164,.939987,-.00969686,.237572,.0383711,.939997,-.0119715,.237574,.0473751,.940031,-.0144858,.237581,.0573298,.940073,-.0172399,.237589,.0682366,.94012,-.0202335,.237598,.080097,.940162,-.0234663,.237604,.0929116,.940237,-.0269387,.237615,.106686,.940328,-.0306489,.237632,.121421,.940419,-.0345917,.237645,.137115,.940522,-.0387481,.237654,.153766,.940702,-.0429906,.237661,.17133,.940871,-.0465089,.237561,.189502,.941103,-.050531,.23748,.208616,.941369,-.0550657,.237423,.228595,.941641,-.0601337,.237399,.249287,.941903,-.0658804,.237443,.270467,.942224,-.0722674,.237597,.292024,.942633,-.0771788,.237419,.315272,.943172,-.0815623,.237068,.339579,.943691,-.0863973,.236682,.364717,.944382,-.0911536,.236213,.390435,.945392,-.0952967,.235562,.416425,.946185,-.0998948,.234832,.442772,.947212,-.104796,.234114,.469347,.948778,-.10928,.233222,.496162,.950149,-.113081,.231845,.523978,.951989,-.115893,.230005,.552295,.953921,-.11846,.227862,.580569,.955624,-.12115,.225439,.608698,.958234,-.123373,.222635,.636696,.960593,-.124519,.219093,.665208,.963201,-.124736,.214749,.693557,.965642,-.125012,.210059,.721334,.968765,-.124661,.204935,.748613,.971753,-.122996,.198661,.776224,.973751,-.120998,.191823,.802461,.976709,-.118583,.184359,.828399,.977956,-.115102,.176437,.853693,.979672,-.111077,.167681,.877962,.981816,-.10688,.158872,.901564,.98238,-.101469,.149398,.924057,.983964,-.0960013,.139436,.945751,.984933,-.0899626,.12943,.966272,.985694,-.0832973,.11894,.985741,.986822,-.0767082,.108349,1.00407,.987725,-.0693614,.0976026,1.02154,.98877,-.06211,.086652,1.03757,.990129,-.0544143,.0756182,1.05296,.991337,-.046744,.0645753,1.06683,.992978,-.0387931,.0534683,1.0798,.994676,-.030973,.0424137,1.09181,.99645,-.0230311,.0314035,1.10286,.997967,-.0152065,.0206869,1.11291,.99922,-.00744837,.010155,1.12237,1.00002,240209e-9,-752767e-10,1.13089,.922948,-515351e-11,.255626,186069e-10,.928785,-129623e-9,.257244,468009e-9,.928761,-51849e-8,.257237,.00187202,.928751,-.0011666,.257235,.00421204,.928751,-.00207395,.257234,.0074881,.928754,-.00324055,.257235,.0117002,.92876,-.00466639,.257236,.0168486,.928763,-.00635149,.257237,.0229334,.928774,-.00829584,.257239,.029955,.928791,-.0104995,.257243,.0379139,.928804,-.0129623,.257245,.0468108,.928847,-.0156846,.257255,.0566473,.92889,-.0186661,.257263,.0674246,.928924,-.0219067,.257268,.0791433,.928989,-.0254066,.257282,.0918076,.92909,-.0291651,.257301,.105419,.92918,-.0331801,.257316,.119978,.92929,-.0374469,.257332,.135491,.929453,-.041939,.257357,.151948,.929586,-.0464612,.257347,.169275,.929858,-.0503426,.257269,.187257,.930125,-.0548409,.257199,.206204,.930403,-.0598063,.257149,.22601,.930726,-.0652437,.257122,.246561,.931098,-.0712376,.257153,.267618,.931396,-.0777506,.257237,.288993,.931947,-.0832374,.257124,.311527,.932579,-.0883955,.25683,.335697,.933194,-.0937037,.256444,.360634,.934013,-.0987292,.255939,.386126,.935307,-.103215,.255282,.412018,.936374,-.108234,.254538,.438292,.93776,-.113234,.253728,.464805,.939599,-.118013,.25275,.491464,.941036,-.122661,.251404,.518751,.94337,-.125477,.249435,.547133,.945318,-.128374,.247113,.575456,.947995,-.130996,.244441,.60372,.950818,-.133438,.241352,.63174,.954378,-.135004,.237849,.659971,.957151,-.135313,.233188,.688478,.960743,-.13521,.228001,.716767,.964352,-.135007,.222249,.744349,.967273,-.133523,.21542,.771786,.969767,-.131155,.208039,.798639,.973195,-.128492,.200076,.824774,.975557,-.125094,.191451,.850222,.977692,-.120578,.18184,.874761,.98026,-.115882,.172102,.898497,.981394,-.110372,.161859,.921636,.982386,-.10415,.15108,.943467,.983783,-.0978128,.140407,.964045,.98422,-.0906171,.129058,.98398,.985447,-.0832921,.117614,1.00276,.986682,-.0754412,.10585,1.02047,.987326,-.0673885,.0940943,1.03678,.988707,-.0592565,.0822093,1.05218,.990185,-.050717,.070192,1.06652,.991866,-.0423486,.0582081,1.07965,.993897,-.0336118,.0460985,1.09188,.995841,-.0252178,.0342737,1.10307,.997605,-.0164893,.0224829,1.11324,.999037,-.00817112,.0110647,1.12262,1.00003,291686e-9,-168673e-9,1.13139,.915304,-552675e-11,.275999,183285e-10,.91668,-139285e-9,.276414,461914e-9,.916664,-55713e-8,.276409,.00184763,.916653,-.00125354,.276406,.00415715,.916651,-.00222851,.276405,.00739053,.916655,-.00348205,.276406,.0115478,.916653,-.00501414,.276405,.0166291,.916667,-.00682478,.276409,.0226346,.91668,-.00891398,.276412,.0295648,.91669,-.0112817,.276413,.0374199,.916727,-.013928,.276422,.0462016,.916759,-.0168528,.276429,.0559101,.916793,-.0200558,.276436,.0665466,.916849,-.0235373,.276448,.0781139,.916964,-.0272973,.276474,.0906156,.917047,-.0313344,.276491,.104051,.917152,-.0356465,.276511,.118424,.917286,-.0402271,.276533,.133736,.917469,-.0450408,.276564,.149978,.917686,-.0497872,.276563,.167057,.917953,-.0540937,.276493,.184846,.918228,-.0590709,.276437,.203614,.918572,-.0644277,.276398,.223212,.918918,-.0702326,.276362,.243584,.919356,-.076484,.276383,.264465,.919842,-.0830808,.276434,.285701,.920451,-.0892972,.276407,.307559,.921113,-.095016,.276128,.331501,.921881,-.100771,.275754,.356207,.923027,-.106029,.275254,.381477,.924364,-.111029,.274595,.40722,.925818,-.116345,.273841,.433385,.92746,-.121424,.272913,.459848,.929167,-.12657,.271837,.486493,.931426,-.131581,.270575,.513432,.934001,-.135038,.268512,.541502,.936296,-.138039,.266135,.569658,.939985,-.140687,.263271,.598375,.943516,-.143247,.260058,.626563,.94782,-.145135,.256138,.654711,.951023,-.145733,.251154,.683285,.955338,-.145554,.245562,.711831,.959629,-.145008,.239265,.739573,.963123,-.144003,.232064,.767027,.966742,-.141289,.224036,.794359,.969991,-.138247,.215305,.820361,.973403,-.134786,.206051,.846548,.975317,-.129966,.195914,.871541,.977647,-.12471,.185184,.895313,.980137,-.119086,.174161,.918398,.981031,-.112297,.162792,.940679,.982037,-.105372,.150952,.961991,.983164,-.097821,.138921,.981913,.983757,-.0897245,.126611,1.00109,.985036,-.0815974,.114228,1.01902,.986289,-.0727725,.101389,1.03604,.987329,-.0639323,.0886476,1.05149,.989193,-.0548109,.0756837,1.06619,.990716,-.045687,.0627581,1.07948,.992769,-.0364315,.0498337,1.09172,.99524,-.0271761,.0370305,1.1033,.997154,-.0179609,.0243959,1.11353,.998845,-.00878063,.0119567,1.12319,1.00002,259038e-9,-108146e-9,1.13177,.903945,-591681e-11,.295126,181226e-10,.903668,-148672e-9,.295037,455367e-9,.903677,-594683e-9,.29504,.00182145,.903673,-.00133805,.295039,.00409831,.903666,-.00237872,.295036,.00728584,.903668,-.00371676,.295037,.0113842,.903679,-.00535212,.29504,.0163936,.903684,-.00728479,.295041,.0223141,.903698,-.00951473,.295044,.0291462,.903718,-.0120419,.295049,.0368904,.903754,-.0148664,.295058,.0455477,.903801,-.017988,.29507,.0551194,.903851,-.0214064,.295082,.0656058,.903921,-.0251219,.295097,.0770109,.904002,-.0291337,.295116,.0893354,.904111,-.033441,.29514,.102583,.904246,-.0380415,.295169,.116755,.904408,-.0429258,.295202,.131853,.904637,-.0480468,.295245,.147869,.904821,-.0529208,.295214,.164658,.905163,-.0577748,.295185,.182274,.905469,-.0631763,.295143,.200828,.905851,-.068917,.295112,.2202,.906322,-.0750861,.295104,.240372,.906761,-.0815855,.295086,.261082,.90735,-.0882138,.295095,.282123,.908087,-.095082,.295139,.303563,.908826,-.101488,.29492,.327028,.909832,-.107577,.294577,.351464,.911393,-.113033,.294115,.376497,.912804,-.118629,.293446,.402115,.914081,-.124232,.292581,.428111,.91637,-.129399,.29166,.454442,.91814,-.134892,.290422,.481024,.921179,-.140069,.289194,.507924,.924544,-.144431,.287421,.535557,.927995,-.147498,.284867,.563984,.931556,-.150197,.281722,.5923,.935777,-.152711,.278207,.620832,.940869,-.154836,.274148,.649069,.945994,-.155912,.269057,.677746,.949634,-.155641,.262799,.706293,.955032,-.154809,.256097,.734278,.95917,-.153678,.248618,.761751,.962931,-.151253,.239794,.789032,.966045,-.147625,.230281,.815422,.96971,-.143964,.220382,.841787,.972747,-.139464,.209846,.867446,.975545,-.133459,.198189,.892004,.978381,-.127424,.186362,.915458,.979935,-.120506,.173964,.937948,.980948,-.11282,.161429,.959732,.982234,-.104941,.148557,.980118,.982767,-.0962905,.135508,.999463,.983544,-.0873625,.122338,1.01756,.984965,-.0783447,.108669,1.03492,.986233,-.0684798,.0949911,1.05087,.987796,-.0590867,.0811386,1.0656,.989885,-.0489145,.0673099,1.0794,.991821,-.0391,.0535665,1.09174,.99448,-.029087,.0397529,1.10341,.996769,-.019114,.0261463,1.11383,.998641,-.00947007,.0128731,1.1237,.999978,446316e-9,-169093e-9,1.13253,.888362,-627064e-11,.312578,178215e-10,.889988,-157791e-9,.313148,448451e-9,.889825,-631076e-9,.313092,.00179356,.88984,-.00141994,.313097,.00403554,.889828,-.0025243,.313092,.00717429,.889831,-.00394421,.313093,.0112099,.889831,-.00567962,.313093,.0161425,.889844,-.00773051,.313096,.0219724,.889858,-.0100968,.3131,.0286999,.889882,-.0127786,.313106,.0363256,.889918,-.0157757,.313116,.0448509,.889967,-.0190878,.313129,.0542758,.89003,-.022715,.313145,.0646032,.890108,-.0266566,.313165,.0758339,.890218,-.0309131,.313193,.0879729,.890351,-.0354819,.313226,.101019,.89051,-.0403613,.313263,.114979,.890672,-.0455385,.313294,.129848,.890882,-.0509444,.313333,.145616,.891189,-.0559657,.313324,.162122,.891457,-.0613123,.313281,.179524,.891856,-.0671488,.313281,.197855,.892312,-.0732732,.313268,.216991,.892819,-.0797865,.313263,.236924,.893369,-.0865269,.313247,.257433,.894045,-.0931592,.313205,.278215,.894884,-.100532,.313276,.299467,.895832,-.107716,.313205,.322276,.897043,-.114099,.312873,.34642,.898515,-.119941,.312331,.371187,.900191,-.126044,.311731,.396656,.90188,-.131808,.310859,.422488,.904359,-.137289,.309857,.448744,.906923,-.142991,.308714,.475239,.910634,-.148253,.307465,.501983,.914502,-.153332,.305774,.529254,.919046,-.156646,.303156,.557709,.923194,-.159612,.299928,.586267,.928858,-.162027,.296245,.614925,.934464,-.164203,.291832,.643187,.939824,-.165602,.286565,.671601,.944582,-.165383,.280073,.700213,.949257,-.164439,.272891,.728432,.954389,-.162953,.264771,.756082,.958595,-.161007,.255927,.78369,.962138,-.157243,.245769,.810769,.966979,-.152872,.235127,.836999,.969566,-.148209,.22347,.862684,.972372,-.142211,.211147,.887847,.975916,-.135458,.198606,.911843,.978026,-.128398,.185498,.934795,.979686,-.120313,.17171,.956787,.980748,-.11166,.158159,.978046,.981622,-.103035,.144399,.997693,.982356,-.0930328,.13001,1.01642,.983308,-.0834627,.115778,1.03366,.985037,-.0732249,.101327,1.05014,.986493,-.0628145,.086554,1.06507,.988484,-.0526556,.0720413,1.07907,.991051,-.0415744,.0571151,1.09189,.993523,-.0314275,.0426643,1.10369,.99628,-.0203603,.0279325,1.11423,.998344,-.0102446,.0138182,1.12421,.999997,42612e-8,-193628e-9,1.1333,.871555,-660007e-11,.329176,174749e-10,.875255,-166579e-9,.330571,441051e-9,.875644,-666394e-9,.330718,.00176441,.875159,-.00149903,.330536,.00396899,.87516,-.00266493,.330536,.007056,.875158,-.00416393,.330535,.0110251,.87516,-.00599598,.330535,.0158764,.875163,-.00816108,.330536,.0216101,.875174,-.0106591,.330538,.0282266,.875199,-.0134899,.330545,.0357266,.875257,-.0166538,.330563,.0441117,.875304,-.0201501,.330575,.0533821,.875373,-.0239785,.330595,.0635395,.875464,-.0281389,.330619,.0745872,.875565,-.0326301,.330645,.0865255,.875691,-.0374516,.330676,.0993599,.875897,-.0425993,.330733,.113093,.876091,-.0480576,.330776,.127722,.876353,-.0537216,.330826,.143227,.876649,-.0589807,.330809,.159462,.877034,-.0647865,.330819,.176642,.877443,-.0709789,.330817,.194702,.877956,-.0774782,.330832,.213577,.878499,-.0843175,.330822,.233246,.879144,-.0912714,.330804,.253512,.879982,-.0980824,.330766,.274137,.88097,-.105823,.330864,.295209,.882051,-.113671,.330896,.317226,.883397,-.120303,.330545,.341068,.884987,-.12667,.330068,.365613,.886789,-.133118,.329418,.390807,.889311,-.139024,.328683,.416494,.891995,-.144971,.327729,.442618,.895106,-.150747,.326521,.469131,.899527,-.156283,.325229,.495921,.90504,-.161707,.32378,.523162,.909875,-.165661,.32122,.55092,.91561,-.168755,.317942,.579928,.921225,-.171193,.313983,.608539,.927308,-.17319,.309636,.636854,.933077,-.174819,.304262,.66523,.938766,-.175002,.297563,.693609,.943667,-.173946,.289613,.722157,.949033,-.172221,.281227,.750021,.953765,-.169869,.271545,.777466,.95804,-.166578,.261034,.804853,.962302,-.161761,.249434,.831569,.966544,-.156636,.237484,.857779,.969372,-.150784,.224395,.883051,.972486,-.143672,.210786,.907864,.975853,-.135772,.196556,.931223,.977975,-.127942,.182307,.954061,.979122,-.118347,.167607,.97531,.980719,-.109112,.152739,.995666,.981223,-.0991789,.137932,1.01475,.98216,-.0883553,.122692,1.03253,.983379,-.0780825,.107493,1.04917,.985434,-.0665646,.0917791,1.06464,.987332,-.0557714,.0764949,1.07896,.990004,-.0442805,.060721,1.09199,.992975,-.0331676,.0452284,1.10393,.995811,-.0219547,.0297934,1.11476,.9982,-.0107613,.0146415,1.12484,1.00002,248678e-9,-14555e-8,1.13413,.859519,-693595e-11,.347264,171673e-10,.859843,-17503e-8,.347394,433219e-9,.859656,-700076e-9,.347319,.00173277,.859671,-.00157517,.347325,.00389875,.859669,-.00280028,.347324,.00693112,.85967,-.0043754,.347324,.01083,.859665,-.00630049,.347321,.0155954,.859685,-.0085755,.347328,.0212278,.859694,-.0112003,.347329,.0277273,.859718,-.0141747,.347336,.0350946,.85976,-.0174988,.347348,.0433314,.85982,-.0211722,.347366,.0524384,.859892,-.0251941,.347387,.0624168,.860006,-.0295649,.347422,.0732708,.860122,-.0342825,.347453,.0849999,.860282,-.0393462,.347499,.0976102,.860482,-.0447513,.347554,.111104,.860719,-.0504775,.347614,.125479,.860998,-.0563577,.347666,.140703,.861322,-.0619473,.347662,.156681,.861724,-.0681277,.347684,.173597,.862198,-.0746567,.347709,.191371,.862733,-.0815234,.347727,.209976,.863371,-.0886643,.347744,.229351,.86414,-.0957908,.347734,.24934,.865138,-.102912,.34772,.269797,.866182,-.110924,.3478,.290654,.867436,-.119223,.347911,.312074,.869087,-.126197,.347649,.335438,.870859,-.133145,.347222,.359732,.872997,-.139869,.346645,.38467,.875939,-.146089,.345935,.41019,.879012,-.152334,.345012,.436218,.883353,-.15821,.343924,.462641,.888362,-.164097,.342636,.489449,.895026,-.169528,.341351,.516629,.900753,-.174408,.339115,.544109,.906814,-.17751,.335809,.572857,.912855,-.180101,.331597,.601554,.919438,-.182116,.32698,.630198,.925962,-.183494,.321449,.658404,.931734,-.184159,.314595,.686625,.93762,-.18304,.306462,.71531,.943858,-.181323,.297514,.744272,.948662,-.178683,.287447,.771462,.953299,-.175379,.276166,.798593,.957346,-.170395,.263758,.8256,.962565,-.165042,.251019,.852575,.966075,-.158655,.237011,.878316,.969048,-.151707,.222518,.90329,.972423,-.143271,.207848,.927745,.975833,-.134824,.192463,.950859,.977629,-.125444,.1768,.972947,.978995,-.114949,.161033,.993263,.980533,-.104936,.145523,1.01337,.980745,-.0935577,.129799,1.03128,.981814,-.0822956,.113486,1.04825,.983943,-.0710082,.0972925,1.06405,.986141,-.0587931,.0808138,1.0785,.988878,-.0472755,.0644915,1.09204,.992132,-.0349128,.0478128,1.10413,.9953,-.0232407,.031621,1.11527,.998117,-.0112713,.0154935,1.12551,1.00003,339743e-9,-195763e-9,1.13504,.845441,-729126e-11,.364305,169208e-10,.843588,-183164e-9,.363506,425067e-9,.843412,-73253e-8,.36343,.00169999,.843401,-.00164818,.363426,.00382495,.843399,-.00293008,.363425,.00679993,.843401,-.00457822,.363425,.010625,.843394,-.00659249,.363421,.0153002,.843398,-.00897282,.363421,.0208258,.843415,-.0117191,.363426,.0272024,.843438,-.0148312,.363432,.0344305,.843483,-.018309,.363447,.0425116,.84356,-.0221521,.363472,.0514471,.843646,-.0263597,.363499,.061238,.843743,-.0309315,.363527,.0718873,.84388,-.0358658,.363569,.0833969,.844079,-.0411624,.363631,.0957742,.844279,-.0468128,.363688,.109015,.844549,-.0527923,.363761,.123124,.844858,-.0588204,.363817,.138044,.84522,-.0647573,.36383,.153755,.845669,-.0713181,.363879,.170394,.846155,-.0781697,.363908,.187861,.846789,-.0853913,.363969,.206176,.847502,-.0928086,.363999,.225244,.8484,-.10005,.363997,.244926,.849461,-.107615,.364008,.265188,.850562,-.115814,.364055,.28587,.851962,-.124334,.364179,.306926,.854326,-.131995,.364233,.329605,.856295,-.139338,.363856,.35359,.858857,-.146346,.363347,.37831,.862428,-.152994,.362807,.403722,.866203,-.159463,.361963,.429537,.871629,-.165623,.36112,.456,.877365,-.171649,.359917,.482773,.883744,-.177151,.35848,.509705,.890693,-.182381,.356523,.537215,.897278,-.186076,.3533,.565493,.903958,-.188602,.349095,.594293,.910908,-.190755,.344215,.623165,.918117,-.192063,.338606,.651573,.924644,-.192758,.331544,.679869,.931054,-.192238,.323163,.708668,.937303,-.190035,.313529,.737201,.943387,-.187162,.303152,.764977,.948494,-.183876,.29146,.792683,.952546,-.178901,.277917,.819228,.958077,-.173173,.264753,.846559,.962462,-.16645,.25002,.872962,.966569,-.159452,.234873,.898729,.969108,-.15074,.218752,.923126,.973072,-.141523,.202673,.947278,.975452,-.132075,.186326,.969938,.977784,-.121257,.169396,.991325,.97899,-.110182,.153044,1.01123,.979777,-.0989634,.136485,1.0299,.980865,-.0865894,.119343,1.04727,.982432,-.0746115,.102452,1.06341,.984935,-.0621822,.0852423,1.07834,.987776,-.0495694,.0678546,1.092,.99103,-.0372386,.0506917,1.1043,.99474,-.0244353,.0333316,1.11576,.997768,-.0121448,.0164348,1.12617,1.00003,31774e-8,-169504e-9,1.13598,.825551,-756799e-11,.378425,165099e-10,.82664,-190922e-9,.378923,416504e-9,.826323,-763495e-9,.378779,.0016656,.826359,-.00171789,.378795,.00374768,.82636,-.00305402,.378795,.00666259,.826368,-.00477185,.378798,.0104104,.826364,-.00687131,.378795,.0149912,.826368,-.00935232,.378795,.0204054,.826376,-.0122146,.378797,.0266532,.826399,-.0154581,.378803,.0337355,.82646,-.0190825,.378824,.0416537,.826525,-.0230873,.378846,.0504091,.826614,-.0274719,.378876,.0600032,.82674,-.0322355,.378917,.0704393,.826888,-.0373766,.378964,.0817195,.827078,-.0428936,.379024,.0938492,.827318,-.0487778,.379099,.106828,.82764,-.0549935,.379199,.120659,.827926,-.0611058,.379227,.13526,.828325,-.0675054,.379275,.150713,.828801,-.0743455,.379332,.167034,.8294,-.0815523,.379415,.184209,.830094,-.0890779,.379495,.202203,.8309,-.096736,.379555,.220945,.831943,-.104135,.379577,.240306,.833037,-.112106,.379604,.260317,.834278,-.120554,.379668,.2808,.836192,-.129128,.3799,.301654,.838671,-.137541,.380109,.323502,.840939,-.14523,.379809,.347176,.844575,-.15248,.379593,.371706,.848379,-.159607,.37909,.39688,.853616,-.166267,.378617,.422702,.858921,-.172698,.377746,.448919,.865324,-.178823,.376749,.475661,.872207,-.184542,.375363,.502599,.880018,-.189836,.373657,.529914,.88694,-.194294,.370673,.557683,.894779,-.197022,.36662,.586848,.902242,-.199108,.36138,.615831,.909914,-.200398,.355434,.644478,.917088,-.20094,.348173,.672905,.923888,-.200671,.339482,.701327,.930495,-.198773,.32956,.730101,.937247,-.195394,.318363,.758383,.943108,-.191956,.306323,.786539,.948296,-.187227,.292576,.813637,.953472,-.181165,.278234,.840793,.958485,-.174119,.263054,.867712,.962714,-.166564,.246756,.893635,.966185,-.158181,.229945,.919028,.970146,-.148275,.212633,.943413,.973491,-.138157,.195229,.966627,.975741,-.127574,.178048,.988817,.977238,-.11554,.160312,1.00924,.978411,-.10364,.142857,1.02845,.979811,-.0913122,.125317,1.04648,.98116,-.0782558,.107627,1.06284,.983543,-.0655957,.0895862,1.07798,.986789,-.0520411,.0713756,1.092,.990292,-.0389727,.053228,1.10484,.994187,-.025808,.0351945,1.11642,.997499,-.0126071,.0173198,1.12703,.999999,275604e-9,-148602e-9,1.13674,.81075,-78735e-10,.394456,161829e-10,.808692,-198293e-9,.393453,407564e-9,.80846,-792877e-9,.39334,.00162965,.808595,-.00178416,.393407,.00366711,.808597,-.00317182,.393408,.00651934,.808598,-.00495589,.393408,.0101866,.808591,-.00713627,.393403,.0146689,.808592,-.00971285,.393402,.0199667,.80861,-.0126855,.393407,.0260803,.808633,-.0160538,.393413,.0330107,.80868,-.0198175,.393429,.0407589,.808748,-.0239758,.393453,.0493264,.808854,-.0285286,.39349,.0587161,.808992,-.0334748,.39354,.0689304,.809141,-.0388116,.393588,.0799707,.809352,-.0445375,.39366,.0918432,.809608,-.0506427,.393742,.104549,.809915,-.0570708,.393834,.118085,.810253,-.0633526,.393885,.132377,.810687,-.0700966,.393953,.147537,.811233,-.0772274,.394047,.163543,.811865,-.0847629,.394148,.180394,.812648,-.0925663,.394265,.198051,.813583,-.100416,.394363,.216443,.814683,-.108119,.394402,.235502,.815948,-.11644,.394489,.255242,.817278,-.125036,.394542,.275441,.819605,-.133655,.39486,.296094,.822256,-.142682,.395248,.317309,.825349,-.150756,.395241,.340516,.829605,-.158392,.395285,.364819,.83391,-.165801,.394922,.389736,.839808,-.172677,.394691,.415409,.845708,-.179448,.394006,.441546,.853025,-.185746,.393279,.46832,.859666,-.191684,.391655,.495302,.86789,-.197146,.390068,.52262,.875845,-.201904,.38727,.550336,.882634,-.205023,.382688,.578825,.891076,-.207098,.377543,.608103,.900589,-.208474,.371752,.63723,.90791,-.209068,.364016,.665769,.915971,-.208655,.355593,.694428,.923455,-.20729,.345439,.723224,.931514,-.203821,.334099,.751925,.937885,-.19986,.321069,.780249,.943136,-.194993,.306571,.8077,.948818,-.189132,.291556,.83497,.954433,-.181617,.275745,.86188,.959078,-.173595,.258695,.888562,.962705,-.164855,.240825,.914008,.966753,-.155129,.22268,.939145,.970704,-.144241,.204542,.963393,.973367,-.133188,.185927,.985983,.975984,-.121146,.167743,1.00704,.976994,-.108366,.149218,1.02715,.978485,-.0956746,.13131,1.0455,.980074,-.0820733,.112513,1.06221,.98225,-.0684061,.0938323,1.07782,.98553,-.0549503,.0749508,1.09199,.989529,-.0407857,.055848,1.10508,.993536,-.0271978,.0368581,1.11684,.997247,-.0132716,.0181845,1.12789,1,431817e-9,-198809e-9,1.13792,.785886,-812608e-11,.405036,157669e-10,.790388,-205278e-9,.407355,398297e-9,.790145,-820824e-9,.407231,.00159263,.790135,-.00184681,.407226,.00358336,.790119,-.00328316,.407218,.00637039,.790126,-.00512988,.40722,.0099539,.79013,-.00738684,.407221,.0143339,.790135,-.0100538,.407221,.0195107,.790134,-.0131306,.407217,.0254848,.79016,-.0166169,.407224,.0322572,.790197,-.020512,.407236,.0398284,.790273,-.0248157,.407263,.0482014,.790381,-.029527,.407304,.0573777,.790521,-.0346446,.407355,.0673602,.790704,-.0401665,.40742,.0781522,.790925,-.0460896,.407499,.0897582,.791195,-.0524017,.407589,.10218,.791522,-.0590121,.407691,.11541,.791878,-.0654876,.407748,.12939,.792361,-.0725207,.407849,.144237,.792942,-.0799844,.407963,.159924,.79362,-.0877896,.408087,.176425,.794529,-.0958451,.408259,.193733,.795521,-.103827,.408362,.211756,.796778,-.111937,.408482,.230524,.798027,-.120521,.408547,.249967,.799813,-.129242,.408721,.269926,.802387,-.138048,.409148,.290338,.805279,-.147301,.409641,.311193,.809251,-.155895,.410154,.333611,.813733,-.163942,.410297,.357615,.819081,-.171666,.410373,.382339,.825427,-.178905,.410348,.407828,.83172,-.185812,.409486,.434034,.83877,-.192318,.408776,.460493,.845817,-.198249,.407176,.487346,.854664,-.204034,.405719,.514832,.863495,-.208908,.403282,.542401,.871883,-.212765,.399293,.570683,.88065,-.214911,.393803,.599947,.89004,-.216214,.387536,.62932,.898476,-.216745,.379846,.658319,.906738,-.216387,.370625,.687138,.914844,-.215053,.360139,.71601,.923877,-.212007,.348849,.745124,.931925,-.207481,.335639,.773366,.938054,-.202418,.320798,.801636,.943895,-.196507,.304772,.829055,.949468,-.189009,.288033,.856097,.955152,-.180539,.270532,.88301,.959403,-.171437,.251639,.909296,.963309,-.161661,.232563,.934868,.967399,-.150425,.213231,.959662,.972009,-.138659,.194247,.98302,.97433,-.126595,.174718,1.00517,.975823,-.113205,.155518,1.02566,.976371,-.0996096,.136709,1.04418,.978705,-.0860754,.117571,1.06146,.981477,-.0714438,.0980046,1.07777,.984263,-.0572304,.0782181,1.09214,.988423,-.0428875,.0584052,1.10553,.993,-.0282442,.038522,1.11758,.99704,-.0140183,.0190148,1.12864,.999913,369494e-9,-145203e-9,1.13901,.777662,-84153e-10,.423844,154403e-10,.770458,-211714e-9,.419915,38845e-8,.770716,-846888e-9,.420055,.00155386,.770982,-.00190567,.420202,.00349653,.770981,-.00338782,.420201,.00621606,.77098,-.00529338,.4202,.00971274,.770983,-.00762223,.4202,.0139867,.770985,-.0103741,.420198,.0190381,.770996,-.0135489,.4202,.0248677,.771029,-.0171461,.420212,.0314764,.771052,-.0211647,.420215,.0388648,.771131,-.0256048,.420245,.047036,.771235,-.0304647,.420284,.0559911,.771383,-.0357436,.420341,.0657346,.771591,-.0414392,.420423,.0762694,.771819,-.0475462,.420506,.0875984,.772123,-.0540506,.420617,.099727,.772464,-.060797,.42072,.112637,.772855,-.0675393,.420799,.126313,.773317,-.0748323,.420893,.140824,.773981,-.0825681,.421058,.15617,.774746,-.0906307,.421226,.172322,.77566,-.0988982,.421397,.189253,.776837,-.106994,.421569,.206912,.778097,-.115528,.421704,.225359,.779588,-.124317,.421849,.24447,.781574,-.133139,.422097,.264156,.784451,-.142179,.422615,.284318,.787682,-.15165,.423269,.304902,.792433,-.160771,.424396,.3265,.797359,-.169166,.424772,.35014,.803986,-.177149,.425475,.374768,.809504,-.184745,.424996,.399928,.815885,-.19173,.424247,.425796,.823513,-.198525,.423515,.452287,.832549,-.204709,.422787,.479321,.841653,-.210447,.421187,.506718,.850401,-.215501,.418519,.53432,.859854,-.219752,.414715,.56242,.869364,-.222305,.409462,.591558,.878837,-.223744,.402926,.621074,.888636,-.224065,.395043,.650538,.898132,-.223742,.38564,.679538,.907181,-.222308,.375378,.708674,.915621,-.219837,.363212,.737714,.9239,-.215233,.349313,.767014,.931644,-.209592,.334162,.795133,.938887,-.203644,.317943,.823228,.945282,-.196349,.300581,.850822,.950758,-.18742,.282195,.877594,.956146,-.177879,.262481,.904564,.960355,-.167643,.242487,.930741,.965256,-.156671,.222668,.955868,.968029,-.144123,.201907,.979869,.97251,-.131305,.18202,1.00291,.974925,-.118335,.161909,1.02392,.975402,-.103714,.142129,1.0433,.976987,-.089415,.122447,1.06089,.979677,-.0748858,.102248,1.07713,.983184,-.0596086,.0814851,1.09218,.987466,-.0447671,.0609484,1.10585,.992348,-.0295217,.0401835,1.11829,.996674,-.0143917,.0198163,1.12966,1.00003,321364e-9,-149983e-9,1.1402,.757901,-869074e-11,.436176,151011e-10,.751195,-217848e-9,.432317,378533e-9,.751178,-871373e-9,.432307,.0015141,.751195,-.00196061,.432317,.0034068,.751198,-.00348552,.432318,.00605659,.751195,-.00544599,.432315,.00946353,.751207,-.00784203,.43232,.013628,.751213,-.0106732,.43232,.0185499,.751221,-.0139393,.432319,.0242302,.751244,-.0176398,.432325,.0306694,.7513,-.0217743,.432348,.0378698,.751358,-.0263412,.432367,.0458321,.751458,-.0313396,.432404,.0545587,.751608,-.0367682,.432464,.0640543,.7518,-.0426246,.43254,.0743222,.752065,-.0489031,.432645,.0853668,.752376,-.0555828,.432762,.0971911,.752715,-.0623861,.432859,.109768,.753137,-.069415,.432958,.123126,.753676,-.0770039,.433099,.137308,.754345,-.084971,.433272,.15229,.755235,-.0932681,.433504,.168075,.756186,-.10171,.433693,.184625,.757363,-.110019,.433857,.201897,.75884,-.11887,.434102,.220014,.760467,-.127881,.434306,.238778,.762969,-.136766,.434751,.258172,.765823,-.14612,.43529,.278062,.769676,-.15566,.436236,.298437,.774909,-.165177,.437754,.319532,.77994,-.17402,.438343,.342505,.785757,-.182201,.438609,.366693,.792487,-.190104,.438762,.391668,.80038,-.197438,.438795,.417494,.808494,-.204365,.438226,.443933,.817695,-.210714,.437283,.470929,.828111,-.216651,.436087,.498569,.837901,-.221804,.433717,.526165,.847813,-.226318,.430133,.554155,.858314,-.229297,.425213,.582822,.868891,-.230999,.418576,.612847,.878941,-.231155,.410405,.642445,.888809,-.230935,.400544,.672024,.898089,-.229343,.389613,.701366,.908081,-.226886,.377197,.730763,.916819,-.222676,.363397,.759642,.924968,-.216835,.347437,.788775,.932906,-.210245,.32995,.817135,.940025,-.202992,.312262,.844912,.946101,-.19436,.293313,.872164,.952835,-.184125,.273638,.899443,.957347,-.173657,.252385,.926389,.961434,-.162204,.231038,.951947,.965522,-.14979,.209834,.976751,.969412,-.136307,.188821,1.00022,.973902,-.122527,.168013,1.02229,.974045,-.108213,.147634,1.04199,.975775,-.0927397,.12705,1.06019,.978383,-.0778212,.106309,1.07711,.98211,-.0621216,.0849279,1.09245,.986517,-.0463847,.0633519,1.10651,.991696,-.0309353,.0419698,1.11903,.996349,-.0150914,.0206272,1.13073,1.00003,442449e-9,-231396e-9,1.14146,.727498,-885074e-11,.441528,145832e-10,.730897,-223525e-9,.443589,368298e-9,.730796,-893996e-9,.443528,.00147303,.730805,-.00201149,.443533,.00331433,.730814,-.00357596,.443538,.00589222,.730815,-.00558734,.443538,.00920678,.730822,-.00804544,.44354,.0132582,.730836,-.0109501,.443545,.0180468,.730848,-.0143008,.443546,.0235732,.730871,-.0180969,.443552,.0298382,.730915,-.022338,.443567,.0368438,.730982,-.0270225,.443591,.044591,.731076,-.0321491,.443627,.0530831,.731245,-.0377166,.443699,.0623243,.73144,-.0437216,.443777,.0723181,.7317,-.0501576,.443881,.0830691,.732034,-.0569942,.444014,.0945809,.732388,-.0638756,.444113,.106825,.732853,-.071203,.444247,.119859,.733473,-.0790076,.444442,.13369,.734195,-.0871937,.444645,.148304,.735069,-.095696,.444877,.163702,.736169,-.10426,.445133,.179861,.73747,-.112853,.44537,.196778,.738991,-.12199,.445651,.214496,.740865,-.131153,.445958,.232913,.743637,-.140245,.446548,.251977,.746797,-.149722,.447246,.271551,.751517,-.159341,.448656,.291774,.756156,-.169106,.449866,.312455,.761519,-.178436,.450919,.334552,.768295,-.186904,.451776,.358491,.776613,-.195117,.452832,.383446,.783966,-.202695,.45249,.408945,.793542,-.20985,.452587,.435364,.803192,-.216403,.451852,.462336,.813892,-.22251,.450708,.48987,.824968,-.227676,.4486,.517697,.835859,-.232443,.445156,.545975,.846825,-.235775,.440351,.574483,.858085,-.237897,.433641,.604246,.868825,-.238074,.425354,.634101,.879638,-.237661,.415383,.664201,.889966,-.236186,.404136,.693918,.899479,-.233599,.390917,.723481,.908769,-.229737,.376352,.75258,.917966,-.223836,.360372,.781764,.926304,-.217067,.342551,.811139,.934626,-.209309,.324238,.839585,.941841,-.20071,.304484,.867044,.94789,-.190602,.283607,.894579,.954196,-.179253,.262205,.921743,.958383,-.167646,.239847,.948026,.963119,-.155073,.218078,.973296,.966941,-.141426,.195899,.998135,.970836,-.126849,.174121,1.02021,.973301,-.112296,.153052,1.04085,.97448,-.0964965,.131733,1.05946,.977045,-.080489,.10997,1.07693,.980751,-.064844,.0881657,1.09254,.985475,-.0481938,.0657987,1.10697,.991089,-.0319185,.0435215,1.12004,.996122,-.0158088,.0214779,1.13173,1.00001,372455e-9,-200295e-9,1.14291,.708622,-907597e-11,.45304,141962e-10,.711162,-228911e-9,.454662,358052e-9,.709812,-914446e-9,.453797,.00143034,.709865,-.00205819,.453834,.00321935,.709864,-.00365894,.453833,.00572331,.709855,-.00571692,.453826,.00894278,.709862,-.00823201,.453828,.012878,.709875,-.011204,.453832,.0175295,.709896,-.0146323,.453839,.0228978,.709925,-.0185163,.453847,.0289839,.709974,-.0228551,.453866,.0357894,.710045,-.0276473,.453892,.0433161,.710133,-.032891,.453924,.0515665,.710292,-.0385851,.453992,.0605458,.710485,-.0447254,.45407,.0702574,.710769,-.0513051,.454192,.0807077,.711106,-.0582733,.454329,.091896,.711516,-.0652866,.45446,.103814,.712071,-.0728426,.454653,.116508,.712676,-.0808307,.45484,.129968,.713476,-.0892216,.455096,.144206,.714377,-.0979047,.455346,.159212,.715579,-.106531,.455647,.174973,.716977,-.115492,.455961,.191504,.71862,-.124821,.456315,.208835,.72084,-.134079,.4568,.226869,.723786,-.143427,.457521,.245582,.727464,-.153061,.458475,.264957,.732771,-.162768,.460239,.284948,.736515,-.172627,.460899,.30522,.743519,-.182487,.463225,.326717,.750041,-.191295,.464027,.350113,.758589,-.199746,.465227,.374782,.767703,-.207584,.465877,.400226,.777484,-.214973,.465996,.426442,.788792,-.221796,.466019,.453688,.800194,-.228038,.465083,.481246,.811234,-.233346,.462506,.509086,.822859,-.238073,.459257,.537338,.835082,-.241764,.454863,.566108,.846332,-.244241,.448163,.595126,.858355,-.244736,.439709,.625574,.87034,-.244278,.429837,.65617,.881027,-.24255,.418002,.686029,.891007,-.239912,.404325,.716039,.900874,-.236133,.389222,.745518,.911072,-.230672,.373269,.775026,.920359,-.22356,.355083,.804521,.928604,-.215591,.335533,.834045,.937175,-.206503,.315278,.861612,.942825,-.196684,.293653,.889131,.949805,-.185116,.271503,.916853,.955535,-.172703,.248821,.943541,.959843,-.159978,.225591,.970132,.964393,-.146375,.202719,.994709,.968008,-.131269,.179928,1.0186,.971013,-.11569,.158007,1.03928,.973334,-.1003,.13624,1.05887,.975775,-.0833352,.1138,1.07652,.979579,-.0668981,.0913141,1.09297,.984323,-.0500902,.0683051,1.10734,.990351,-.0332377,.0451771,1.12084,.995823,-.0161491,.0221705,1.13296,1.0001,234083e-9,-108712e-9,1.14441,.683895,-924677e-11,.46015,137429e-10,.68833,-233383e-9,.463134,346865e-9,.688368,-933547e-9,.463159,.00138748,.688367,-.00210049,.463159,.00312187,.688369,-.00373415,.463159,.00555004,.688377,-.00583449,.463163,.00867216,.688386,-.00840128,.463166,.0124884,.688398,-.0114343,.463169,.0169993,.688418,-.0149329,.463175,.0222054,.688453,-.0188964,.463188,.028108,.688515,-.0233239,.463214,.0347085,.68857,-.0282136,.463231,.0420091,.688679,-.033564,.463276,.0500132,.688854,-.0393733,.463356,.0587255,.689038,-.0456354,.46343,.0681476,.689321,-.0523433,.463553,.0782897,.689662,-.059412,.463693,.0891501,.690188,-.0665736,.4639,.100735,.690755,-.0743106,.464107,.113074,.691405,-.0824722,.464329,.126161,.692198,-.0910484,.464585,.140007,.693196,-.0998778,.464893,.154612,.69454,-.108651,.465285,.169984,.695921,-.117855,.465596,.186106,.697749,-.12734,.466056,.203034,.700375,-.136714,.466771,.220703,.703395,-.146386,.467579,.239062,.707904,-.156096,.469067,.258188,.711673,-.165904,.469851,.277759,.717489,-.175812,.471815,.297935,.724051,-.185931,.47389,.318916,.731965,-.195238,.47587,.341591,.741151,-.204021,.477523,.366062,.751416,-.212113,.478881,.391396,.761848,-.21979,.479226,.417599,.771886,-.2267,.478495,.444401,.783998,-.232991,.477622,.472084,.796523,-.238645,.475833,.500193,.808851,-.243396,.472568,.52865,.821191,-.247226,.467857,.557362,.834261,-.250102,.461871,.586768,.846762,-.251056,.453543,.617085,.859867,-.250604,.443494,.647659,.871948,-.248783,.431711,.678119,.882967,-.245855,.417911,.708399,.892826,-.242168,.401993,.738256,.90332,-.237062,.385371,.767999,.913633,-.22997,.366837,.798191,.922774,-.221687,.346372,.827756,.931371,-.212345,.325682,.856425,.938929,-.20206,.303665,.884299,.944821,-.190981,.280786,.912023,.951792,-.178065,.2573,.939669,.957712,-.164634,.233448,.96655,.961912,-.150863,.209504,.992366,.966382,-.13577,.18597,1.01633,.969588,-.119593,.162905,1.03843,.971777,-.103203,.14053,1.05841,.97433,-.0865888,.117909,1.07632,.978686,-.0690829,.0944101,1.09326,.983281,-.0516568,.0705671,1.10796,.989562,-.034558,.0468592,1.12182,.995465,-.0167808,.0229846,1.1342,.999991,373016e-9,-235606e-9,1.1459,.662251,-939016e-11,.468575,132714e-10,.666634,-237624e-9,.471675,335842e-9,.666411,-950385e-9,.471516,.00134321,.666399,-.00213833,.471509,.00302221,.666386,-.0038014,.471499,.00537283,.666405,-.00593958,.471511,.00839533,.666406,-.00855253,.471508,.0120898,.666428,-.0116401,.471519,.0164569,.666444,-.0152015,.471522,.0214971,.66649,-.0192362,.471543,.027212,.666537,-.0237428,.471558,.033603,.666617,-.0287198,.471591,.0406728,.666718,-.0341647,.471631,.0484238,.666889,-.0400759,.47171,.0568621,.667104,-.0464479,.471805,.0659915,.667374,-.0532677,.471923,.0758178,.667772,-.0603805,.472098,.0863425,.668371,-.0677392,.472363,.0975917,.668971,-.0756028,.472596,.109567,.669696,-.0839293,.472869,.122272,.670481,-.0926683,.473126,.135718,.6715,-.1016,.473442,.149914,.672911,-.110566,.47389,.164882,.674512,-.119984,.474354,.180602,.67651,-.129574,.474922,.19711,.679292,-.139106,.475764,.214371,.682798,-.148993,.476886,.232405,.686955,-.158737,.478179,.251153,.691406,-.168754,.479432,.270436,.697438,-.178703,.481481,.290374,.704761,-.188955,.484143,.311044,.713599,-.198814,.487007,.333003,.723194,-.207869,.488962,.357144,.732601,-.216189,.489815,.382169,.744193,-.22398,.490888,.408227,.754907,-.231156,.490355,.434928,.767403,-.23747,.489548,.462599,.78107,-.243503,.488274,.490908,.793893,-.248114,.484843,.519421,.807296,-.25222,.4803,.548561,.820529,-.255265,.474097,.577772,.833716,-.256741,.466041,.607782,.848403,-.25637,.456547,.638807,.860755,-.254804,.443946,.670058,.874012,-.251834,.430852,.700749,.885619,-.247867,.414903,.731446,.896069,-.242634,.397276,.761191,.906266,-.236093,.378535,.791053,.916759,-.227543,.358038,.821298,.92523,-.21783,.335705,.850747,.93436,-.207534,.313797,.879258,.941631,-.195983,.289671,.907734,.947564,-.183567,.265319,.935206,.953681,-.169345,.240815,.962739,.960008,-.154909,.216119,.989227,.964145,-.140161,.192096,1.01465,.968171,-.123411,.167855,1.03737,.969859,-.106525,.144817,1.05767,.972666,-.0891023,.12149,1.0761,.977055,-.0718094,.0975306,1.09336,.982527,-.0534213,.0730217,1.10878,.989001,-.0355579,.0483366,1.12285,.99512,-.0176383,.023938,1.13548,1.00007,368831e-9,-211581e-9,1.14744,.651047,-960845e-11,.484101,12922e-9,.644145,-241347e-9,.478968,324578e-9,.64396,-965142e-9,.478831,.00129798,.64396,-.00217154,.47883,.00292046,.643968,-.00386049,.478835,.00519202,.643974,-.00603186,.478838,.0081128,.643977,-.0086854,.478836,.011683,.643982,-.0118207,.478834,.0159031,.644024,-.0154374,.478856,.0207743,.644059,-.0195343,.478868,.0262975,.644122,-.0241103,.478896,.0324747,.644207,-.0291638,.478933,.039309,.64432,-.0346919,.478981,.0468029,.644481,-.0406919,.479053,.0549614,.644722,-.047159,.479169,.0637909,.645013,-.0540748,.479302,.0732974,.645503,-.0612001,.479541,.0834898,.646117,-.0687303,.479829,.0943873,.646707,-.0767846,.480061,.105991,.647431,-.0852465,.480343,.11831,.64831,-.0940719,.48066,.131348,.649486,-.103056,.481083,.14514,.650864,-.112261,.481528,.159676,.652604,-.121852,.482102,.174979,.654825,-.131505,.482813,.191079,.657876,-.141189,.483876,.207927,.661339,-.151239,.48499,.225586,.665463,-.161091,.486279,.243947,.670542,-.171235,.487968,.262957,.677361,-.181347,.49053,.282781,.685672,-.191679,.493862,.303311,.694551,-.201781,.49699,.324607,.703753,-.211164,.498884,.347916,.713703,-.219675,.500086,.372628,.725911,-.227836,.501554,.398694,.73862,-.23533,.502193,.425529,.752118,-.241786,.501811,.453209,.76579,-.247865,.500185,.481381,.779568,-.252696,.497159,.51011,.793991,-.256802,.492765,.539322,.808182,-.259942,.486827,.569078,.821698,-.261703,.478386,.598818,.836009,-.262006,.468772,.629762,.849824,-.260333,.456352,.661366,.863888,-.257398,.442533,.69295,.876585,-.253264,.426573,.723608,.888665,-.248026,.408964,.754378,.899537,-.241487,.389677,.784761,.9094,-.233463,.368516,.814688,.920166,-.223397,.346624,.845009,.928899,-.21255,.322717,.874431,.937156,-.200869,.298698,.902922,.943861,-.188387,.273491,.931356,.949557,-.174341,.247866,.958854,.955862,-.158994,.222496,.986098,.961721,-.143664,.197522,1.01229,.965976,-.127412,.17302,1.03571,.968652,-.109798,.148954,1.05699,.971084,-.0916787,.125044,1.07587,.975584,-.0739634,.100577,1.09372,.98122,-.055322,.0753666,1.10948,.988253,-.0366825,.0498899,1.12394,.99482,-.0180389,.024611,1.13694,1.00001,229839e-9,-188283e-9,1.14919,.613867,-964198e-11,.479449,123452e-10,.621485,-244534e-9,.485399,313091e-9,.621429,-978202e-9,.485353,.00125245,.62112,-.00220004,.485114,.00281687,.621119,-.0039111,.485112,.00500783,.621122,-.00611091,.485112,.00782498,.621133,-.00879922,.485117,.0112687,.621152,-.0119756,.485125,.0153394,.621183,-.0156396,.485139,.0200382,.621227,-.0197898,.485158,.0253663,.621298,-.0244253,.485192,.0313261,.621388,-.0295441,.485233,.0379204,.621507,-.0351432,.485286,.0451523,.621693,-.0412198,.485378,.0530277,.621933,-.0477673,.485495,.0615522,.622232,-.0547574,.485635,.0707316,.622809,-.0619417,.485943,.0805883,.623407,-.069625,.486232,.0911267,.62406,-.077796,.486516,.102354,.624835,-.0863731,.486838,.114279,.625758,-.095251,.487188,.126902,.627043,-.104299,.487695,.140285,.628438,-.113724,.488163,.154397,.630325,-.123417,.488858,.169267,.632801,-.133137,.489754,.184941,.635784,-.143052,.490815,.20136,.639406,-.153132,.492048,.218643,.643872,-.163143,.49363,.236615,.6499,-.17333,.496009,.255449,.657201,-.183622,.498994,.275006,.666221,-.194019,.502888,.295354,.674419,-.204192,.505459,.316244,.683729,-.21406,.507771,.33849,.695584,-.222854,.510245,.363166,.708583,-.231315,.512293,.389071,.721233,-.238911,.512747,.415737,.735134,-.245657,.512482,.443331,.750179,-.251879,.511526,.471891,.765073,-.256911,.508935,.500892,.779794,-.261144,.504341,.530294,.794801,-.264316,.498515,.560144,.810339,-.266276,.491015,.590213,.824818,-.266981,.481126,.620865,.839375,-.265778,.468685,.652687,.853043,-.262748,.453925,.684759,.867335,-.258474,.437912,.716209,.88037,-.253187,.419648,.747508,.891711,-.246476,.39982,.77797,.902896,-.238735,.37879,.808586,.913601,-.22885,.355891,.838843,.923019,-.217656,.331773,.869014,.933432,-.205539,.307356,.898512,.939691,-.192595,.281321,.9269,.946938,-.178945,.255441,.955297,.952372,-.163587,.229013,.983231,.95909,-.147214,.203179,1.00971,.963675,-.13064,.17792,1.03438,.968247,-.113121,.152898,1.05625,.97001,-.0945824,.128712,1.07598,.974458,-.0755648,.103349,1.094,.980168,-.0571998,.0776731,1.1104,.987295,-.0377994,.0514445,1.12491,.994432,-.0186417,.025429,1.13851,.999975,542714e-9,-282356e-9,1.15108,.592656,-980249e-11,.486018,119532e-10,.598467,-247275e-9,.490781,301531e-9,.597934,-988317e-9,.490343,.00120517,.597903,-.00222366,.490319,.0027116,.597913,-.00395315,.490327,.00482077,.597919,-.00617653,.490329,.00753264,.597936,-.00889375,.490339,.0108478,.597956,-.0121043,.490347,.0147668,.597992,-.0158073,.490365,.0192905,.598032,-.0200017,.490382,.0244204,.598109,-.0246865,.49042,.0301593,.598215,-.0298594,.490474,.03651,.59833,-.0355167,.490524,.0434757,.598525,-.0416559,.490624,.0510629,.598778,-.0482692,.490753,.0592781,.599135,-.0553114,.49094,.0681304,.599802,-.062542,.491328,.0776467,.600361,-.0703638,.491598,.0878184,.60101,-.0786256,.491882,.0986573,.601811,-.0872962,.492232,.11018,.602861,-.0962284,.492684,.1224,.604167,-.10538,.493213,.135354,.605693,-.114896,.493799,.149034,.607682,-.124654,.494576,.163469,.610672,-.13456,.4959,.178747,.613313,-.144581,.496713,.194723,.617603,-.154703,.498499,.211617,.622174,-.16489,.500188,.229183,.628855,-.175164,.503072,.247786,.636963,-.185565,.506798,.267116,.644866,-.195911,.509719,.28702,.653741,-.206104,.512776,.307763,.664942,-.216447,.516812,.329631,.67633,-.22552,.519181,.353515,.690012,-.234316,.521681,.379226,.704243,-.242032,.523129,.405901,.719396,-.249172,.523768,.433585,.734471,-.255543,.522541,.462085,.750539,-.260697,.520217,.491233,.766365,-.26501,.516293,.521094,.781677,-.268409,.509708,.551014,.797132,-.270399,.501944,.581463,.812655,-.271247,.492025,.612402,.828592,-.270708,.480424,.643798,.844044,-.268085,.465955,.67682,.857305,-.263459,.448425,.708496,.87114,-.258151,.430243,.74046,.884936,-.251171,.410578,.771583,.895772,-.243305,.38862,.802234,.906961,-.234037,.365214,.833179,.917775,-.222714,.34116,.86353,.927883,-.210175,.31572,.893557,.936617,-.196925,.289159,.922976,.943384,-.182788,.261996,.951606,.949713,-.167965,.235324,.979958,.955818,-.151109,.208408,1.00765,.961344,-.133834,.182591,1.03329,.965469,-.115987,.156958,1.0557,.968693,-.09746,.132239,1.07583,.973165,-.0778514,.106195,1.09451,.979387,-.0585067,.0797669,1.11137,.98671,-.0390409,.0530263,1.12643,.994093,-.019408,.0263163,1.14016,1.00002,540029e-9,-194487e-9,1.15299,.574483,-989066e-11,.494533,114896e-10,.574478,-249127e-9,.494528,289403e-9,.574607,-996811e-9,.494637,.00115797,.574396,-.00224241,.494458,.00260498,.574377,-.00398632,.49444,.00463102,.574386,-.00622836,.494445,.00723623,.574401,-.0089683,.494453,.010421,.574419,-.0122056,.49446,.0141859,.574459,-.0159396,.494481,.0185322,.574525,-.0201692,.49452,.0234617,.574587,-.0248924,.494547,.0289762,.574697,-.0301074,.494604,.0350797,.574853,-.0358114,.494688,.0417767,.575027,-.041999,.494772,.0490718,.575294,-.0486618,.494915,.0569728,.575733,-.0557148,.495173,.0654955,.576356,-.0630489,.495537,.0746612,.576944,-.0709285,.495836,.0844615,.57765,-.0792723,.496177,.0949142,.578491,-.0880167,.496563,.10603,.579639,-.0969462,.497096,.117841,.580989,-.10622,.497684,.130367,.582587,-.115861,.498337,.143609,.584951,-.125605,.499414,.157625,.587602,-.135608,.500518,.172413,.59076,-.145742,.501767,.187999,.594992,-.155934,.503542,.20445,.600656,-.166303,.506135,.221764,.607816,-.176681,.509542,.24002,.61522,-.187071,.51263,.258992,.623702,-.197465,.516021,.278773,.634192,-.207816,.520422,.299377,.644936,-.218183,.524073,.320802,.657888,-.2278,.528049,.34384,.670666,-.236747,.52986,.36916,.685626,-.24484,.531892,.395867,.701304,-.252071,.532727,.423488,.717727,-.258714,.532146,.452201,.733914,-.264211,.529883,.481579,.750529,-.26859,.5259,.511558,.76747,-.272046,.51999,.542042,.785189,-.274225,.513083,.572799,.800954,-.275189,.502936,.603816,.816962,-.274946,.490921,.635461,.83336,-.272695,.47684,.6676,.848143,-.268223,.459405,.70051,.861818,-.262768,.440319,.732902,.876828,-.255872,.420123,.765084,.889312,-.247703,.398379,.796391,.900412,-.238381,.374496,.827333,.912251,-.227783,.349874,.858385,.921792,-.214832,.323181,.888652,.931273,-.200949,.296624,.917763,.940295,-.186537,.269211,.947878,.946812,-.171538,.241447,.977016,.953588,-.155254,.213829,1.00501,.958841,-.137156,.186807,1.03179,.963746,-.118699,.160706,1.05502,.966468,-.0998358,.135504,1.07568,.971178,-.0805186,.109131,1.09479,.97831,-.0599348,.0818293,1.1123,.985886,-.0399661,.0545872,1.12771,.994021,-.0198682,.0269405,1.14186,1.00009,271022e-9,-12989e-8,1.15514,.538716,-990918e-11,.486732,109675e-10,.550656,-250642e-9,.497518,277412e-9,.55057,-.00100265,.497441,.00110974,.550903,-.00225672,.497733,.00249779,.550568,-.00401046,.497438,.00443906,.550574,-.00626613,.49744,.00693637,.550591,-.0090226,.497449,.00998921,.550623,-.0122795,.497469,.0135984,.550667,-.0160361,.497495,.0177654,.550724,-.0202908,.497526,.0224915,.550792,-.0250421,.497557,.0277795,.550918,-.0302878,.49763,.0336334,.551058,-.0360241,.497701,.0400573,.551276,-.0422473,.497824,.0470585,.551551,-.0489441,.497977,.0546433,.552074,-.0559596,.498312,.0628367,.552681,-.0633978,.498679,.071646,.553324,-.0713176,.499031,.0810746,.554011,-.0797268,.499365,.091129,.55488,-.0885238,.499779,.101837,.556171,-.0974417,.500444,.113239,.557498,-.106841,.501025,.125316,.559299,-.116533,.501864,.138128,.561647,-.126298,.502967,.151695,.564347,-.136388,.504129,.16604,.567863,-.146576,.505713,.181207,.572569,-.156832,.507953,.197259,.578919,-.167323,.511186,.214258,.585387,-.177712,.514042,.232038,.593134,-.188184,.517484,.250733,.603295,-.198717,.522345,.270454,.613854,-.209177,.526751,.290807,.626092,-.219644,.531595,.312202,.637868,-.229494,.534721,.334435,.652458,-.238718,.538304,.359184,.666985,-.247061,.539875,.385637,.683301,-.254652,.541042,.41328,.69998,-.261376,.540735,.441903,.717824,-.267085,.539139,.471609,.734617,-.271465,.534958,.501446,.753663,-.27528,.53032,.532571,.770512,-.277617,.522134,.563641,.787356,-.278525,.51206,.595067,.806252,-.278512,.50119,.627226,.822061,-.277023,.486791,.659402,.838959,-.273175,.470467,.692874,.85379,-.267238,.450688,.725702,.868268,-.260327,.429741,.75832,.881994,-.251946,.407223,.790189,.893885,-.242432,.383214,.821625,.905118,-.231904,.357297,.853011,.916045,-.219545,.330733,.883773,.927614,-.205378,.303916,.914435,.936005,-.190388,.275941,.944502,.944533,-.1749,.247493,.974439,.950758,-.158588,.218996,1.00286,.957078,-.141027,.191559,1.0304,.962448,-.121507,.164457,1.05466,.964993,-.102068,.138636,1.0761,.970017,-.0822598,.111861,1.09541,.97661,-.062033,.0843438,1.11317,.985073,-.0409832,.0558496,1.12911,.993515,-.020146,.0275331,1.1438,1.00006,27329e-8,-107883e-9,1.15736,.525324,-999341e-11,.498153,105385e-10,.526513,-251605e-9,.499277,265329e-9,.526517,-.00100641,.499282,.0010613,.526588,-.00226466,.499337,.00238823,.526539,-.0040255,.499302,.00424535,.526547,-.00628954,.499306,.00663364,.526561,-.00905628,.499313,.00955337,.526593,-.0123253,.499334,.0130054,.526642,-.0160957,.499365,.0169911,.5267,-.0203661,.499396,.0215122,.526792,-.0251347,.499451,.0265718,.526904,-.0303985,.499511,.0321732,.527079,-.0361554,.499617,.0383231,.527285,-.0423982,.499731,.045026,.527602,-.0491121,.499924,.0522936,.528166,-.0561127,.500306,.0601528,.52879,-.0635988,.5007,.0686059,.529421,-.071581,.501048,.0776518,.530144,-.0799854,.501421,.0873148,.531062,-.0888032,.501884,.0976084,.532374,-.0977643,.50259,.108588,.533828,-.107197,.50329,.120234,.53581,-.116887,.504312,.132602,.538063,-.126755,.505365,.145721,.5409,-.136819,.506668,.159617,.544882,-.147117,.508731,.174369,.550238,-.157446,.511601,.190028,.556038,-.167988,.514431,.206587,.563031,-.178364,.517808,.224046,.571543,-.189007,.521937,.242503,.582255,-.199546,.527415,.261977,.59272,-.210084,.531682,.282162,.605648,-.220448,.537123,.303426,.61785,-.230593,.540664,.325323,.632223,-.240238,.544467,.348993,.648819,-.24887,.547594,.375462,.665825,-.256657,.54912,.403024,.683389,-.263711,.549294,.431773,.701495,-.269666,.547649,.461494,.719197,-.274169,.543786,.491623,.737906,-.278124,.538644,.522994,.756652,-.280632,.531057,.554775,.775279,-.281741,.521972,.586441,.792688,-.281652,.509613,.618596,.811894,-.280345,.496497,.651462,.827938,-.277128,.47968,.684023,.844837,-.271646,.460688,.718024,.859239,-.264397,.438872,.751207,.874088,-.256144,.41577,.784232,.887693,-.246311,.391369,.816191,.899402,-.235497,.365872,.847828,.910973,-.223631,.338618,.87934,.92204,-.209874,.310803,.910325,.930987,-.194265,.281802,.940695,.94,-.178125,.252836,.970958,.948018,-.161479,.224239,1.00078,.955141,-.144038,.195857,1.0288,.960513,-.124915,.168487,1.05371,.963964,-.104284,.141495,1.07596,.968713,-.0838732,.114437,1.09628,.975524,-.0635579,.0863105,1.11448,.98431,-.042291,.0574774,1.13069,.992916,-.0209131,.0284343,1.14568,.999926,743097e-9,-379265e-9,1.15955,.501042,-998428e-11,.498726,100306e-10,.502992,-252112e-9,.500665,253283e-9,.502417,-.00100791,.500092,.00101259,.502965,-.00226919,.500621,.00227978,.502318,-.00403109,.499994,.00405011,.502333,-.00629832,.500005,.00632868,.502362,-.00906907,.500027,.00911446,.502369,-.0123423,.500023,.0124078,.50243,-.0161178,.500066,.016211,.502493,-.0203937,.500103,.0205256,.502592,-.0251684,.500166,.0253548,.502707,-.0304389,.50023,.0307029,.502881,-.0362015,.500335,.0365753,.503124,-.0424507,.500488,.0429798,.503443,-.0491582,.500686,.0499268,.504083,-.0561476,.501155,.0574541,.504668,-.0636846,.501524,.0655408,.505319,-.0716834,.501904,.0742072,.50609,-.0800925,.502321,.0834699,.507122,-.0888425,.502896,.0933603,.508414,-.097855,.503603,.10391,.509955,-.107304,.504416,.115113,.512061,-.116921,.505565,.127054,.514419,-.12689,.506732,.139709,.517529,-.136934,.508338,.153173,.522085,-.147327,.510987,.167528,.526986,-.157612,.513527,.182708,.533122,-.168213,.516717,.198881,.540807,-.178688,.520832,.215986,.550687,-.189511,.52632,.234335,.560567,-.199998,.531009,.253375,.571698,-.210652,.535839,.273499,.584364,-.220917,.541091,.294355,.599066,-.23137,.546875,.316525,.614148,-.241206,.551306,.339671,.631157,-.250379,.555187,.36531,.647919,-.258397,.556595,.392767,.666112,-.265528,.556949,.421397,.686158,-.271827,.556617,.451433,.704838,-.27674,.552975,.482131,.723957,-.280733,.547814,.513458,.74262,-.283359,.53997,.545446,.762009,-.284541,.530422,.57775,.781314,-.284507,.518546,.610434,.799116,-.283309,.504178,.643178,.817604,-.280378,.48843,.676248,.83459,-.275619,.469457,.709698,.850974,-.26856,.447698,.744245,.866747,-.260094,.424791,.777695,.881412,-.249929,.399913,.810392,.8936,-.239137,.37308,.842872,.905943,-.226818,.345705,.874677,.916408,-.213699,.31706,.906257,.927215,-.198428,.288444,.936881,.935625,-.181643,.258329,.96795,.944076,-.164386,.228488,.998216,.951229,-.146339,.199763,1.02689,.958793,-.127709,.172153,1.0535,.963219,-.107244,.144989,1.07646,.967562,-.0857764,.11685,1.09675,.974866,-.0645377,.0880571,1.11576,.983353,-.0431732,.0587352,1.13227,.992503,-.0218356,.0294181,1.1478,1.00003,605203e-9,-231013e-9,1.16207,.482935,-101177e-10,.504695,968142e-11,.477554,-251521e-9,.499071,240676e-9,.477904,-.00100683,.499436,96342e-8,.478368,-.00226636,.499899,.0021687,.477977,-.00402719,.499513,.00385384,.477993,-.00629226,.499525,.0060221,.478011,-.00906011,.499536,.00867289,.478051,-.0123305,.499566,.0118074,.478089,-.016102,.499587,.0154269,.478171,-.0203736,.499645,.0195341,.478254,-.025143,.499692,.0241318,.47839,-.0304071,.499779,.0292247,.478588,-.0361631,.499911,.0348196,.478812,-.0424023,.500046,.0409231,.479208,-.0490724,.500326,.047552,.479841,-.0560722,.500805,.0547377,.480392,-.0636125,.501152,.0624607,.481068,-.0716134,.501561,.0707473,.481898,-.0800062,.502054,.0796118,.483022,-.0886568,.502728,.0890974,.484332,-.0977553,.503479,.0992099,.486126,-.107173,.504546,.10999,.488066,-.11677,.50557,.121476,.490521,-.126725,.506849,.133672,.494232,-.136793,.50911,.146731,.498302,-.147116,.511345,.160577,.503565,-.157446,.514344,.175335,.510902,-.168121,.518824,.191207,.519263,-.178799,.523666,.208058,.528204,-.189407,.528296,.225875,.538854,-.200145,.533724,.244782,.551278,-.210701,.539833,.264753,.565222,-.221303,.546131,.285745,.579403,-.231688,.551496,.307592,.595469,-.241718,.556809,.330582,.610929,-.250992,.559641,.354995,.629433,-.259602,.562379,.382471,.648504,-.267038,.563676,.411126,.66756,-.273388,.562092,.440924,.689143,-.278788,.560807,.472118,.709056,-.282783,.555701,.503774,.729855,-.285836,.548698,.536364,.748954,-.287078,.538544,.56895,.768373,-.287133,.526711,.601991,.78827,-.285839,.512511,.635403,.807465,-.283238,.496323,.668797,.825194,-.27906,.477638,.702584,.842203,-.272286,.456253,.736393,.857749,-.263854,.432412,.77096,.874799,-.253943,.407806,.80489,.887497,-.24237,.38033,.83771,.89966,-.230278,.352446,.870376,.911753,-.21646,.323268,.902256,.923011,-.202071,.294314,.933306,.932375,-.185519,.264104,.965177,.940537,-.167604,.234035,.996303,.948904,-.149068,.20412,1.0261,.955263,-.129539,.175431,1.05304,.960303,-.109932,.148116,1.07617,.965512,-.0880572,.119693,1.09742,.973466,-.0660548,.0901619,1.11721,.98284,-.0439228,.0599875,1.13436,.992216,-.0219588,.0298975,1.15006,.999946,119402e-9,-208547e-10,1.16471,.447827,-100414e-10,.491543,914833e-11,.454778,-251257e-9,.499172,22891e-8,.453519,-.00100342,.497787,914184e-9,.45357,-.00225776,.497847,.00205701,.453578,-.00401371,.497855,.00365705,.45357,-.00627107,.497841,.00571453,.453598,-.00902968,.497864,.00823019,.453627,-.0122888,.497882,.0112049,.453684,-.0160475,.497923,.0146405,.453764,-.0203044,.49798,.0185394,.453866,-.0250576,.498049,.0229054,.453996,-.0303028,.49813,.0277424,.454196,-.0360379,.498267,.0330587,.454457,-.0422521,.498445,.0388613,.454926,-.0488393,.498812,.0451767,.455525,-.0558653,.499272,.0520153,.456074,-.0633772,.499625,.0593754,.456752,-.0713606,.500049,.0672751,.457648,-.07971,.500615,.0757447,.458849,-.0883032,.501399,.0848231,.46029,-.0974095,.502293,.0945135,.462,-.106729,.503301,.104848,.464121,-.116354,.504533,.115884,.466889,-.126214,.506172,.127652,.470744,-.136324,.508667,.14024,.47488,-.146595,.510995,.153673,.480845,-.157027,.514832,.168053,.488262,-.167658,.519506,.183508,.496547,-.178343,.524347,.199948,.506254,-.188916,.52983,.217503,.517961,-.199975,.536357,.236272,.531484,-.210624,.543641,.256096,.545496,-.221227,.550048,.277085,.559497,-.231568,.555076,.298615,.575752,-.241698,.560541,.321547,.591999,-.251172,.564156,.345602,.610654,-.260178,.567607,.371851,.630484,-.268094,.56923,.40076,.651807,-.274661,.569779,.430801,.67239,-.280331,.566791,.461939,.693024,-.284501,.562007,.493854,.715473,-.287852,.555791,.526992,.736323,-.28929,.546345,.560102,.755771,-.289405,.534,.593543,.775424,-.2881,.519114,.627256,.795447,-.285562,.502543,.661464,.815319,-.281416,.484773,.695206,.831769,-.275523,.463445,.729044,.849464,-.267516,.440269,.764069,.866775,-.257584,.415049,.799089,.881252,-.245817,.388049,.831948,.894209,-.233127,.35889,.865526,.906922,-.219579,.329915,.89818,.919686,-.204491,.300441,.930013,.929044,-.188962,.269445,.962061,.938393,-.171079,.238402,.994214,.94661,-.15199,.208204,1.02533,.953095,-.131953,.178653,1.0529,.958644,-.111233,.150684,1.0771,.963925,-.0903098,.122359,1.09855,.971995,-.0680505,.0923342,1.11874,.981658,-.0448512,.0614195,1.13635,.991649,-.0221931,.0303582,1.15238,.999985,393403e-9,-111086e-9,1.16772,.396806,-971563e-11,.457671,842355e-11,.429186,-249421e-9,.495017,21625e-8,.429324,-998052e-9,.495173,865322e-9,.429175,-.00224487,.494999,.00194637,.429129,-.00399041,.494952,.00346004,.429153,-.00623476,.494974,.00540684,.429168,-.0089773,.494983,.00778714,.429207,-.0122175,.495012,.0106022,.429257,-.0159542,.495047,.0138535,.429338,-.0201864,.495106,.0175443,.429431,-.0249104,.495165,.0216774,.429587,-.0301252,.495279,.0262594,.429796,-.0358249,.495432,.0312968,.430065,-.0419972,.495621,.0367985,.430588,-.0485144,.496061,.042798,.43113,-.0555028,.496472,.0492914,.431743,-.0629852,.496904,.0562907,.432448,-.0709256,.497369,.0638056,.433414,-.0791942,.498032,.071885,.434638,-.0877346,.498854,.0805517,.43611,-.0968056,.499812,.0898047,.437859,-.106002,.500891,.0997142,.440017,-.115648,.502198,.110289,.443236,-.125427,.504389,.121644,.44697,-.135492,.506809,.133769,.451689,-.145746,.509858,.146787,.45811,-.156219,.514247,.160793,.465305,-.166834,.518816,.175791,.474085,-.177546,.524331,.191906,.484808,-.188262,.53104,.209199,.49732,-.199346,.538511,.227825,.509693,-.209951,.544554,.247269,.524367,-.220533,.551616,.267978,.539228,-.231082,.557368,.289672,.55644,-.241342,.563782,.31268,.574204,-.250964,.568851,.33651,.593388,-.260306,.57312,.362219,.613358,-.268667,.574916,.390322,.634512,-.275591,.575053,.420478,.65563,-.281328,.572404,.451614,.678265,-.285948,.568893,.484112,.70011,-.289408,.561878,.517348,.723005,-.291328,.55359,.551355,.743744,-.291418,.541099,.585109,.763949,-.290252,.526489,.619487,.784186,-.287648,.509496,.65404,.804304,-.283782,.491484,.688649,.823629,-.278067,.470517,.723133,.84094,-.270588,.44705,.757163,.857852,-.261188,.421252,.792816,.874934,-.249313,.394191,.827248,.888709,-.236492,.365359,.861074,.902589,-.222185,.336016,.894417,.914201,-.207314,.30527,.926825,.925978,-.191146,.274532,.9595,.93512,-.174135,.243393,.991583,.943656,-.155231,.212414,1.02356,.951719,-.134403,.182005,1.05239,.957164,-.113023,.153043,1.07754,.962656,-.0914493,.124186,1.09984,.970695,-.0694179,.0941654,1.12,.980749,-.0466199,.0629671,1.13849,.991205,-.0227032,.0311146,1.15494,.999884,632388e-9,-254483e-9,1.1706,.379821,-957289e-11,.460637,789337e-11,.405188,-247483e-9,.491396,204064e-9,.404796,-989434e-9,.490914,815853e-9,.40483,-.00222607,.490949,.00183559,.40473,-.00395723,.49084,.00326332,.404731,-.00618287,.490836,.00509945,.404768,-.00890258,.490871,.00734463,.404791,-.0121156,.490883,.00999992,.404857,-.0158214,.490938,.0130676,.404943,-.0200178,.491004,.0165503,.405059,-.0247027,.491093,.0204521,.405213,-.0298729,.491205,.0247788,.405399,-.0355226,.491333,.0295373,.405731,-.0416352,.491604,.034741,.406303,-.0480807,.492116,.0404255,.406814,-.0550458,.492506,.0465732,.407404,-.0624652,.492926,.0532058,.408149,-.0702958,.493442,.0603442,.409128,-.0784623,.494136,.0680297,.410408,-.087007,.495054,.0762786,.411813,-.0959639,.495962,.0851046,.413735,-.105075,.497257,.0945878,.416137,-.114646,.498882,.104725,.41934,-.124394,.501132,.11563,.423326,-.134328,.503883,.127325,.428419,-.14458,.50747,.139911,.43484,-.154979,.511964,.153481,.442641,-.165628,.517328,.168114,.452511,-.176365,.524258,.183995,.463473,-.187298,.531248,.200953,.475564,-.198244,.538367,.219176,.488664,-.208938,.545175,.238514,.504073,-.219599,.553227,.259129,.520832,-.230378,.560653,.280997,.538455,-.240703,.567523,.303821,.55709,-.250548,.573287,.327948,.576646,-.259964,.577795,.353362,.596705,-.268721,.580077,.380336,.618053,-.276054,.58018,.4101,.640303,-.282176,.578747,.44161,.662365,-.286931,.574294,.474106,.684542,-.290521,.567035,.507549,.707984,-.292672,.558687,.541853,.730913,-.293189,.547606,.576581,.752948,-.292199,.533471,.61172,.773452,-.289508,.516395,.646339,.794715,-.285716,.497873,.682131,.814251,-.280051,.476845,.716396,.833057,-.272873,.453449,.751503,.84959,-.263982,.427857,.786085,.867022,-.252745,.400335,.821355,.882277,-.239655,.371304,.85646,.895375,-.225386,.340397,.890828,.909347,-.209587,.310005,.923532,.921885,-.193433,.2796,.956419,.932127,-.176135,.247276,.989445,.941869,-.157872,.216186,1.02221,.949735,-.137577,.185602,1.05195,.956617,-.115285,.155767,1.07822,.961974,-.0928418,.126103,1.10149,.96972,-.0700592,.0956758,1.12207,.98012,-.0474671,.0643269,1.1408,.990825,-.0238113,.0320863,1.1577,.999876,381574e-9,-812203e-10,1.17403,.367636,-961342e-11,.469176,753287e-11,.380377,-244772e-9,.485434,191797e-9,.380416,-978857e-9,.485475,767015e-9,.380376,-.00220165,.485435,.00172522,.380419,-.00391408,.485487,.00306734,.380438,-.00611549,.485505,.00479332,.380462,-.00880558,.485525,.00690391,.380496,-.0119837,.485551,.00940039,.38056,-.0156487,.485605,.0122848,.38064,-.0197988,.485666,.0155601,.380767,-.0244324,.48577,.0192313,.380909,-.0295444,.485871,.0233032,.381142,-.0351321,.48606,.0277861,.381472,-.0411535,.486336,.0326939,.382015,-.0475408,.486833,.0380565,.382523,-.0544395,.487231,.0438615,.383129,-.061784,.487683,.0501332,.383952,-.0695085,.488313,.0568996,.38498,-.0775819,.489077,.0641952,.386331,-.0860443,.490113,.0720324,.387788,-.0948406,.491099,.0804379,.389808,-.103899,.492566,.0894899,.39252,-.113313,.494601,.0992098,.395493,-.123007,.496619,.109641,.399826,-.132859,.499912,.120919,.405341,-.143077,.504061,.133107,.411932,-.153465,.508905,.146263,.420591,-.164108,.515482,.160544,.43101,-.174893,.523191,.176123,.441881,-.185839,.53026,.192757,.453919,-.196633,.537295,.210535,.468715,-.207611,.546156,.229886,.485182,-.218517,.555173,.250543,.501926,-.229249,.562728,.27221,.51785,-.239481,.567494,.294892,.536947,-.249395,.573889,.318987,.557115,-.259,.578831,.344348,.577966,-.268075,.582055,.371223,.599489,-.276115,.583307,.399834,.62479,-.282523,.583902,.431415,.647504,-.287663,.57953,.464301,.670601,-.291538,.573103,.498123,.693539,-.293842,.563731,.532662,.717385,-.294681,.553169,.567925,.741533,-.293717,.539908,.603502,.762142,-.291156,.521902,.639074,.783014,-.28719,.502815,.674439,.805158,-.281773,.482598,.710497,.823646,-.274682,.458949,.7456,.841879,-.266184,.433129,.781085,.859515,-.255682,.406064,.816,.875335,-.242849,.376509,.851074,.890147,-.228329,.345502,.886473,.903144,-.212491,.31428,.920751,.916618,-.195695,.282994,.954606,.927953,-.178267,.251091,.988402,.937414,-.159549,.219107,1.02141,.946823,-.140022,.18896,1.05167,.954651,-.118154,.158667,1.07819,.959955,-.0946636,.128808,1.1025,.96858,-.0711792,.0973787,1.12391,.97938,-.0475046,.0650965,1.14322,.990498,-.024059,.0326267,1.16077,.999844,-512408e-10,112444e-9,1.17727,.316912,-934977e-11,.425996,695559e-11,.356423,-241372e-9,.479108,179562e-9,.356272,-965292e-9,.478897,71811e-8,.356262,-.00217182,.478894,.00161574,.356265,-.00386092,.478895,.00287261,.356278,-.0060324,.478905,.00448907,.356293,-.00868565,.478914,.00646572,.356346,-.0118207,.478965,.00880438,.356395,-.0154355,.479001,.0115066,.356484,-.019529,.479075,.0145762,.356609,-.0240991,.47918,.018018,.356766,-.0291413,.479305,.0218379,.357009,-.0346498,.479512,.0260454,.357424,-.0405462,.479909,.0306657,.357899,-.0468825,.480337,.0357054,.358424,-.0536887,.480771,.0411728,.359041,-.0609416,.481242,.0470841,.359903,-.0685239,.481943,.0534831,.360932,-.0764883,.482741,.0603795,.362196,-.0848364,.483688,.0678028,.363847,-.0935002,.484947,.0758086,.365972,-.102471,.486588,.0844173,.368741,-.111751,.488787,.0937199,.372146,-.121334,.491405,.103732,.377114,-.131147,.495604,.114608,.38226,-.141213,.499436,.126345,.389609,-.151632,.505334,.139116,.397925,-.162073,.51168,.152995,.407824,-.172819,.518876,.168071,.420014,-.183929,.527639,.184495,.434266,-.195032,.537588,.20232,.447352,-.205792,.544379,.221189,.463726,-.216704,.553422,.241616,.481406,-.227531,.562074,.263298,.498707,-.238017,.568227,.286116,.518039,-.247936,.574473,.3101,.538277,-.257437,.579191,.335401,.561166,-.266829,.584807,.362246,.583189,-.275329,.586476,.390609,.606024,-.28234,.585578,.420998,.632419,-.287924,.584496,.454357,.656128,-.291972,.577766,.488233,.679953,-.29456,.56875,.523248,.704654,-.295816,.558388,.559168,.729016,-.295157,.544826,.595326,.752062,-.292779,.528273,.631864,.773138,-.288681,.508482,.667793,.794869,-.283358,.487341,.704035,.815101,-.27608,.46354,.739925,.834212,-.26767,.438672,.775539,.852368,-.257397,.411239,.810895,.870207,-.245689,.3829,.846472,.884063,-.231452,.351496,.881788,.898284,-.215561,.31895,.917438,.912964,-.198208,.287367,.952422,.924666,-.180426,.254487,.987551,.934429,-.161525,.222226,1.02142,.943485,-.141197,.191143,1.05218,.9521,-.120085,.161112,1.07937,.957876,-.0975881,.130982,1.10403,.966943,-.0726842,.0990553,1.12616,.978313,-.0483705,.0662818,1.14619,.990048,-.0239072,.0329243,1.16413,.999984,461885e-9,-772859e-10,1.18099,.321287,-935049e-11,.455413,659662e-11,.332595,-237513e-9,.471437,167562e-9,.332729,-949964e-9,.471618,670192e-9,.332305,-.00213618,.471028,.00150712,.332326,-.00379765,.471055,.00267959,.332344,-.00593353,.471072,.00418751,.332356,-.00854349,.471077,.00603172,.332403,-.0116268,.471121,.00821362,.332461,-.0151824,.47117,.0107357,.332552,-.0192088,.471251,.0136014,.332657,-.0237024,.47133,.0168152,.332835,-.0286615,.471487,.0203853,.333083,-.0340765,.471708,.0243212,.333547,-.0398563,.47219,.0286518,.333989,-.0460916,.472587,.0333763,.334532,-.0527897,.473054,.0385084,.335167,-.0599284,.473568,.0440638,.33608,-.0673514,.474362,.0500962,.337146,-.0752237,.475231,.0566022,.338462,-.083418,.476282,.0636272,.34014,-.0919382,.477615,.0712153,.342341,-.100741,.479404,.079417,.345088,-.109905,.481618,.0882631,.349049,-.119369,.485081,.0978851,.353939,-.129033,.489317,.108336,.359893,-.139038,.494309,.119698,.366945,-.149411,.499983,.132024,.375814,-.159843,.507185,.145558,.387112,-.170664,.516392,.160433,.40023,-.181897,.526519,.176648,.412555,-.192785,.53423,.193922,.427023,-.203663,.542741,.212662,.443685,-.214695,.552066,.232944,.461499,-.225561,.560762,.254495,.480975,-.236257,.569421,.277531,.501,-.24639,.576101,.301724,.521691,-.256101,.581493,.327112,.543478,-.265289,.585221,.353917,.566094,-.273938,.587614,.381941,.589578,-.281679,.587991,.41172,.614583,-.287655,.585928,.444148,.641813,-.292228,.582092,.478617,.666189,-.295172,.57398,.51397,.690475,-.29648,.561676,.550118,.715543,-.296203,.548758,.586933,.740405,-.293999,.532792,.62384,.762183,-.28998,.512735,.660723,.786069,-.28478,.492402,.69807,.806812,-.277568,.469058,.734422,.826987,-.268951,.443017,.770946,.844588,-.259049,.415501,.80699,.863725,-.2471,.387328,.842107,.879137,-.234157,.356108,.878078,.894634,-.218719,.324315,.914058,.909162,-.201293,.291813,.949922,.92072,-.18267,.258474,.985337,.93158,-.163212,.225593,1.0205,.941238,-.142771,.193986,1.05273,.949293,-.120956,.163392,1.08075,.956226,-.0985743,.132934,1.10559,.96546,-.075118,.101255,1.12823,.977403,-.0497921,.0675441,1.149,.989648,-.0241574,.0334681,1.16765,1.00001,5762e-7,-184807e-9,1.18519,.303474,-916603e-11,.4542,61243e-10,.308894,-232869e-9,.462306,155592e-9,.309426,-931661e-9,.463093,622499e-9,.308643,-.0020949,.461933,.00139979,.308651,-.0037242,.461941,.00248874,.308662,-.00581873,.46195,.00388933,.308687,-.00837818,.461974,.00560247,.308728,-.0114016,.462011,.00762948,.308789,-.0148884,.462067,.00997326,.308882,-.0188369,.462151,.0126375,.309007,-.0232436,.462263,.0156271,.30918,-.0281054,.462417,.0189498,.309442,-.0334065,.462667,.0226167,.309901,-.0390589,.463162,.0266614,.310331,-.0452042,.463555,.0310715,.310858,-.0517735,.464019,.0358698,.311576,-.0587359,.464669,.0410848,.312436,-.0660383,.465406,.0467453,.313526,-.0737266,.466339,.0528718,.314903,-.0817574,.467504,.0595039,.316814,-.090167,.469226,.0666888,.318965,-.0987555,.470981,.0744658,.322077,-.107792,.473814,.082912,.325947,-.117098,.477241,.0920846,.331008,-.126602,.48184,.102137,.337893,-.136619,.488334,.113135,.345106,-.146838,.494415,.12511,.355111,-.157357,.503275,.138356,.365095,-.167955,.510966,.152686,.378344,-.179157,.521508,.16856,.391599,-.190143,.530455,.18561,.407786,-.20123,.541275,.204308,.425294,-.212456,.551784,.224623,.444021,-.223568,.561493,.246172,.463418,-.234154,.569886,.268979,.484077,-.244546,.577116,.293411,.505513,-.254301,.582914,.318936,.527672,-.263564,.587208,.345856,.550565,-.272332,.589277,.374054,.573656,-.280011,.588426,.403276,.59827,-.286924,.587504,.43474,.624731,-.291994,.583401,.468767,.652396,-.295159,.576997,.504411,.67732,-.296954,.565863,.54114,.703147,-.296877,.552316,.57816,.728715,-.295147,.536773,.616124,.752448,-.291275,.51771,.653885,.775169,-.285905,.496087,.691537,.799307,-.279064,.474232,.729251,.819482,-.270294,.447676,.766267,.837659,-.260032,.419656,.802616,.856903,-.248497,.391328,.838583,.873325,-.235252,.360285,.874711,.889788,-.221126,.329215,.91077,.904486,-.204304,.296392,.94653,.917711,-.185562,.262159,.983828,.928969,-.165635,.229142,1.01955,.939707,-.14442,.19673,1.05317,.948167,-.122147,.165095,1.0823,.955222,-.099098,.13451,1.10791,.964401,-.0755332,.102476,1.1312,.976605,-.0513817,.0689667,1.15218,.989085,-.0258499,.034506,1.17129,.999908,617773e-9,-271268e-9,1.18961,.285803,-905752e-11,.452348,572272e-11,.284689,-22732e-8,.450581,143626e-9,.285263,-910214e-9,.451482,575099e-9,.285302,-.00204784,.451553,.00129395,.285318,-.00364057,.451574,.0023006,.28533,-.00568813,.451585,.00359547,.285361,-.00819001,.451618,.00517934,.285397,-.0111458,.45165,.007054,.285447,-.0145536,.451688,.00922167,.285527,-.0184127,.451758,.0116869,.285688,-.0227207,.451929,.0144555,.28584,-.0274712,.452055,.0175341,.286136,-.0326278,.452369,.0209406,.286574,-.0381792,.452853,.0246965,.287012,-.0441879,.453272,.0287996,.287542,-.0506096,.453752,.033268,.288299,-.0573634,.454488,.0381504,.289186,-.0645458,.455294,.0434447,.290302,-.0720405,.456301,.0491973,.291776,-.0799046,.457648,.0554453,.29372,-.088117,.459483,.0622311,.296052,-.0965328,.461571,.0695992,.299563,-.105409,.465085,.077658,.30335,-.114553,.468506,.0864176,.309167,-.123917,.474423,.0961078,.31529,-.13381,.47995,.106643,.324163,-.144021,.488592,.118322,.333272,-.154382,.496461,.131133,.344224,-.165015,.50562,.145208,.357733,-.176168,.516719,.16073,.373046,-.187468,.528513,.177807,.38788,-.198488,.537713,.196072,.405133,-.209545,.547999,.21605,.423845,-.220724,.55759,.237484,.443777,-.231518,.566246,.26039,.464824,-.242035,.574326,.284835,.486635,-.251898,.58037,.310518,.51012,-.261304,.58568,.337678,.535301,-.270384,.590197,.366242,.559193,-.27841,.590569,.395873,.583544,-.285325,.588161,.426857,.608834,-.291113,.584249,.459477,.635753,-.294882,.57763,.494734,.664367,-.297088,.569479,.532023,.689688,-.297364,.555064,.569629,.715732,-.295949,.539522,.608124,.741307,-.292259,.521613,.646231,.764949,-.287063,.49969,.684938,.788599,-.28012,.476747,.723548,.81048,-.27153,.45116,.761135,.831372,-.261289,.424101,.798916,.850092,-.249559,.39443,.835952,.867777,-.236348,.363849,.871606,.884632,-.221569,.332477,.907843,.90047,-.20618,.300667,.944187,.914524,-.188771,.266552,.981371,.926892,-.168362,.232349,1.01841,.937951,-.146761,.199359,1.05308,.947236,-.123813,.1675,1.0839,.954367,-.099984,.136166,1.11047,.963907,-.0759278,.103808,1.13414,.976218,-.0511367,.0697061,1.15575,.988772,-.0267415,.0352529,1.17531,.999888,-520778e-9,289926e-9,1.19389,.263546,-883274e-11,.441896,526783e-11,.262352,-221849e-9,.439889,132311e-9,.262325,-886683e-9,.439848,528824e-9,.26228,-.00199476,.439765,.00118975,.262372,-.00354671,.439922,.00211568,.26239,-.00554141,.439941,.00330652,.262412,-.00797888,.439961,.00476346,.262453,-.0108584,.440002,.00648818,.262528,-.0141788,.440085,.0084835,.262615,-.017938,.440166,.0107533,.262744,-.0221346,.440291,.0133044,.262939,-.026762,.440493,.0161445,.263277,-.0317573,.440889,.0192974,.26368,-.0371832,.441338,.0227699,.264106,-.0430371,.441753,.0265698,.264624,-.0493035,.442227,.0307178,.265378,-.0558669,.442985,.0352616,.266253,-.0628718,.443795,.0401968,.267478,-.0701569,.445008,.04559,.269062,-.077845,.446599,.0514539,.270926,-.0857941,.448349,.0578382,.273693,-.0940773,.451221,.0648363,.276746,-.102704,.454097,.0724389,.281693,-.111735,.459517,.0808744,.287335,-.121004,.46531,.0901551,.29448,-.130734,.472605,.100371,.30257,-.140777,.480251,.111644,.312465,-.15111,.489444,.124111,.324856,-.16189,.500919,.137979,.33774,-.172946,.511317,.153163,.35255,-.184152,.522684,.169817,.367786,-.19522,.53248,.187886,.385474,-.20632,.543326,.207634,.404976,-.217744,.554109,.229165,.425203,-.228691,.563395,.252068,.446704,-.239299,.571565,.276471,.468951,-.249348,.577935,.302323,.493487,-.258933,.584309,.329882,.517861,-.268009,.58773,.358525,.543309,-.276238,.589612,.388585,.569704,-.28356,.589294,.419787,.594871,-.289497,.585137,.452114,.622555,-.294452,.580356,.486466,.651167,-.296918,.57185,.523079,.677332,-.297647,.558428,.5611,.703718,-.296321,.542232,.599592,.730262,-.293339,.524541,.639138,.754304,-.288036,.502691,.677978,.778051,-.281018,.479212,.716537,.801557,-.272414,.454071,.75586,.822559,-.262419,.425952,.794477,.843051,-.250702,.397313,.832664,.86232,-.237264,.366534,.869876,.879044,-.222716,.334816,.906973,.896362,-.206827,.303143,.943558,.910342,-.189659,.269699,.979759,.924119,-.171108,.236411,1.01718,.935374,-.149579,.202224,1.05289,.944295,-.126295,.16989,1.08496,.952227,-.101511,.138089,1.11256,.962041,-.0766392,.105053,1.1375,.97528,-.0511967,.070329,1.15983,.988476,-.025463,.0351268,1.17987,.999962,286808e-10,145564e-10,1.19901,.227089,-841413e-11,.404216,472707e-11,.239725,-215083e-9,.426708,120833e-9,.239904,-860718e-9,.427028,483555e-9,.239911,-.00193661,.427039,.00108806,.239914,-.00344276,.42704,.00193457,.239933,-.00537907,.427064,.00302363,.239944,-.00774482,.427065,.00435604,.239993,-.01054,.427122,.00593398,.240052,-.0137626,.427179,.00775987,.240148,-.0174115,.427279,.00983854,.240278,-.021484,.42741,.0121763,.240472,-.0259729,.427618,.0147827,.240839,-.0308131,.428086,.0176837,.241201,-.0360893,.428482,.0208775,.241626,-.0417723,.428907,.0243821,.242207,-.0478337,.42952,.0282228,.24298,-.0542199,.430332,.0324333,.243881,-.0610015,.431222,.0370252,.245123,-.0680874,.432512,.0420535,.24667,-.0755482,.434088,.0475414,.248779,-.0832873,.436323,.0535542,.251665,-.0913546,.439509,.0601716,.255305,-.0998489,.443478,.0674282,.260049,-.108576,.448713,.0754673,.266192,-.117754,.455524,.084339,.273158,-.127294,.4627,.0941683,.282131,-.137311,.472068,.10515,.293332,-.147736,.483565,.117402,.304667,-.158357,.493702,.130824,.317785,-.169274,.504708,.145724,.333245,-.180595,.517107,.16215,.349843,-.191892,.528849,.180149,.367944,-.203168,.540301,.199746,.387579,-.214443,.551514,.221047,.408247,-.225624,.560906,.243981,.43014,-.236422,.56959,.268513,.452669,-.24654,.576098,.294409,.476196,-.256157,.580925,.322002,.501157,-.265289,.584839,.351052,.527632,-.273671,.587614,.3812,.555754,-.281254,.589119,.412994,.581682,-.287448,.585204,.445498,.608196,-.292614,.579006,.479505,.635661,-.296068,.571297,.514643,.664999,-.297395,.560855,.552213,.691039,-.296645,.544525,.591365,.7179,-.293785,.526535,.630883,.744059,-.289089,.50545,.670932,.76863,-.282239,.482514,.710904,.793273,-.273688,.457246,.750259,.814731,-.26328,.428872,.78948,.835603,-.251526,.399384,.828597,.85489,-.238339,.368811,.866892,.872828,-.223607,.336617,.90563,.889462,-.207538,.303997,.943538,.904929,-.190297,.270812,.980591,.919101,-.172034,.237453,1.01935,.930536,-.152058,.204431,1.05498,.941223,-.129515,.172495,1.08717,.94982,-.104263,.140175,1.11551,.960592,-.0781944,.106465,1.14098,.974629,-.051688,.0711592,1.16418,.98811,-.0253929,.0354432,1.18465,1.00004,804378e-9,-330876e-9,1.20462,.214668,-821282e-11,.406619,433582e-11,.218053,-208144e-9,.413025,109887e-9,.217987,-832212e-9,.412901,439362e-9,.217971,-.00187246,.412876,988623e-9,.217968,-.00332855,.41286,.00175772,.217985,-.00520055,.412882,.00274729,.218014,-.00748814,.412916,.00395842,.218054,-.0101901,.412957,.00539274,.218106,-.0133057,.413005,.00705348,.218217,-.0168342,.413139,.00894581,.218338,-.0207707,.413258,.0110754,.21855,-.0251001,.413509,.0134551,.218913,-.0297861,.413992,.0161081,.219265,-.0348956,.414383,.0190307,.219696,-.0403909,.414839,.0222458,.220329,-.0462003,.415567,.025792,.220989,-.0524208,.41621,.0296637,.222027,-.058948,.417385,.0339323,.223301,-.0658208,.418779,.0386055,.224988,-.0730347,.420665,.0437355,.227211,-.0805274,.423198,.0493844,.230131,-.088395,.426566,.0556135,.233908,-.0966208,.43091,.0624829,.239092,-.105223,.437148,.0701636,.245315,-.11424,.444302,.0786949,.253166,-.12368,.453262,.0882382,.262374,-.133569,.463211,.0988682,.273145,-.143836,.474271,.110727,.285512,-.154577,.4863,.123945,.299512,-.165501,.498817,.138581,.314287,-.176698,.510341,.154676,.331083,-.188066,.522583,.172459,.349615,-.199597,.534879,.191979,.369318,-.210843,.546083,.21309,.390377,-.222068,.5562,.235998,.412411,-.233059,.564704,.260518,.435715,-.24357,.572314,.286795,.461196,-.253356,.579395,.314559,.485587,-.262362,.581985,.343581,.511908,-.270895,.584347,.374367,.539798,-.278452,.58505,.406015,.567974,-.284877,.583344,.439168,.594303,-.290124,.577348,.473005,.622951,-.294183,.570751,.508534,.652404,-.296389,.561541,.544764,.679291,-.296605,.546426,.582927,.706437,-.294095,.528599,.622681,.734485,-.28978,.508676,.663567,.758841,-.283363,.484768,.704092,.78537,-.275015,.460434,.745101,.807315,-.264689,.432166,.784712,.8271,-.252597,.401807,.824241,.849191,-.239154,.371458,.863803,.867046,-.224451,.338873,.903063,.8852,-.208342,.306175,.942763,.901771,-.190684,.272759,.981559,.915958,-.172105,.239306,1.02048,.928046,-.152214,.206071,1.05765,.939961,-.130247,.17367,1.08999,.948711,-.10672,.142201,1.11829,.959305,-.0808688,.108454,1.14467,.973009,-.0539145,.0728109,1.16839,.987631,-.0262947,.0360625,1.19004,.999978,.00132758,-559424e-9,1.21058,.193925,-793421e-11,.391974,392537e-11,.196746,-200315e-9,.397675,991033e-10,.19667,-801099e-9,.397521,396342e-9,.196633,-.00180246,.397445,891829e-9,.196654,-.00320443,.397482,.00158582,.196659,-.00500647,.39748,.00247867,.196683,-.0072086,.397506,.00357167,.196728,-.00981001,.397562,.00486675,.196792,-.0128096,.397633,.00636707,.19689,-.0162055,.397746,.00807752,.197017,-.0199943,.397884,.0100052,.19729,-.024139,.39827,.0121691,.197583,-.0286671,.398639,.0145755,.197927,-.0335858,.399034,.0172355,.198383,-.0388806,.399554,.0201718,.199002,-.0444736,.400289,.0234194,.199739,-.0504583,.401111,.026984,.200784,-.056729,.402349,.0309217,.202075,-.0633643,.403841,.0352496,.203898,-.0703247,.406076,.0400313,.206199,-.0775565,.408841,.0453282,.209252,-.085184,.41259,.0511794,.213638,-.0931994,.418288,.0577459,.21881,-.101617,.424681,.0650508,.225642,-.11052,.433429,.0732759,.233717,-.119772,.442897,.0824683,.242823,-.129505,.452888,.0927484,.254772,-.139906,.466407,.104417,.266603,-.150402,.477413,.117211,.28073,-.161395,.490519,.131598,.295399,-.172465,.50201,.147407,.312705,-.183982,.515311,.165031,.331335,-.195532,.52786,.184336,.351037,-.206971,.5392,.205361,.372175,-.218117,.54941,.228043,.394548,-.229327,.558642,.25267,.419598,-.240052,.567861,.279071,.443922,-.249937,.573332,.306882,.471495,-.259407,.58013,.33661,.496769,-.267749,.580564,.367328,.524951,-.275524,.581696,.399753,.55318,-.282148,.579885,.433134,.581577,-.287533,.575471,.467534,.609231,-.291612,.567445,.502943,.637478,-.293911,.557657,.53871,.667795,-.295096,.546535,.576568,.694272,-.294073,.529561,.614929,.722937,-.290386,.510561,.655909,.749682,-.284481,.487846,.697663,.774754,-.276188,.462487,.738515,.799301,-.266215,.43481,.779802,.820762,-.254116,.404879,.820045,.843231,-.240393,.374559,.860294,.861857,-.225503,.341582,.900965,.880815,-.209382,.308778,.941727,.89766,-.19155,.275232,.980916,.912926,-.172346,.240938,1.02162,.926391,-.151799,.207223,1.0597,.938429,-.129968,.17484,1.09291,.947834,-.10651,.142984,1.12248,.958432,-.0824098,.109902,1.149,.972402,-.0565242,.0744454,1.1733,.987191,-.028427,.0373794,1.19538,.999975,385685e-10,-4203e-8,1.21676,.178114,-766075e-11,.385418,354027e-11,.176074,-191966e-9,.381002,887135e-10,.17601,-767549e-9,.380861,354715e-9,.17598,-.00172696,.380798,798168e-9,.175994,-.00307012,.380824,.00141928,.176017,-.00479684,.380858,.00221859,.176019,-.00690648,.380839,.00319714,.176072,-.00939888,.380913,.0043572,.176131,-.0122726,.380979,.005702,.176239,-.0155264,.38112,.00723689,.176371,-.0191551,.381272,.00896907,.176638,-.023117,.381669,.0109194,.176912,-.0274633,.382015,.0130903,.177279,-.032173,.382476,.0154949,.17774,-.0372219,.383041,.0181669,.178344,-.0426132,.38378,.0211209,.179153,-.0483309,.384773,.0243899,.180197,-.0543447,.386076,.0280062,.181581,-.0607122,.387809,.032004,.18344,-.0673855,.390205,.036453,.186139,-.0743989,.393944,.0414162,.189432,-.0817731,.39832,.0469394,.193795,-.0895464,.404188,.0531442,.199641,-.0978264,.4121,.0601374,.206679,-.106499,.421425,.0680078,.214865,-.115654,.431504,.076919,.224406,-.125268,.442526,.0868835,.235876,-.135475,.455465,.0981875,.248335,-.146023,.4681,.110759,.262868,-.157016,.482069,.124885,.278962,-.168245,.496182,.140645,.295082,-.17958,.507401,.157838,.313738,-.191227,.520252,.17695,.333573,-.202718,.531708,.197817,.356433,-.214424,.544509,.220785,.378853,-.225492,.55373,.245306,.402717,-.236236,.561348,.271593,.428375,-.246568,.568538,.299776,.454724,-.255941,.573462,.329433,.482291,-.264511,.576356,.360598,.509706,-.272129,.576446,.393204,.538805,-.278979,.575298,.427227,.568919,-.284528,.572154,.462157,.596804,-.288801,.564691,.497997,.625987,-.291334,.555134,.534467,.656414,-.292722,.545051,.571736,.683916,-.292185,.528813,.610158,.711809,-.290043,.51106,.649061,.739547,-.285246,.490103,.690081,.766914,-.277647,.465523,.732554,.791375,-.267603,.437718,.773982,.814772,-.256109,.40882,.81609,.836691,-.242281,.377823,.856849,.856984,-.227155,.34496,.898363,.876332,-.210395,.311335,.939471,.894988,-.192612,.277703,.980799,.911113,-.173236,.243019,1.02215,.924092,-.152258,.209037,1.06139,.936828,-.129575,.175909,1.09635,.946869,-.10594,.143852,1.12707,.958284,-.081318,.110289,1.15419,.972325,-.0556133,.0747232,1.17909,.986878,-.0297899,.0383149,1.20163,.999936,-.00197169,912402e-9,1.22338,.151174,-720365e-11,.351531,309789e-11,.155594,-18279e-8,.361806,78608e-9,.156099,-731569e-9,.362982,314615e-9,.156053,-.00164578,.362869,707845e-9,.156093,-.0029261,.362961,.00125884,.156099,-.00457155,.362959,.00196783,.15612,-.00658224,.362982,.00283622,.156168,-.00895774,.363048,.00386625,.156221,-.0116962,.363101,.00506109,.156324,-.0147973,.363241,.00642675,.156476,-.0182503,.363448,.00797175,.156731,-.0220266,.36384,.00971484,.156994,-.026176,.364179,.0116575,.157341,-.0306701,.36462,.0138207,.157867,-.0354591,.365364,.0162356,.15846,-.0406141,.366111,.0189092,.159308,-.0460519,.367248,.021885,.160426,-.0518096,.368767,.0252004,.161877,-.0578906,.370745,.0288825,.163995,-.0642812,.373831,.0330139,.16655,-.0710067,.377366,.0376283,.170237,-.0781522,.382799,.0428493,.175096,-.0857172,.389915,.0487324,.181069,-.0938025,.398487,.0554214,.188487,-.102363,.408799,.0630189,.197029,-.111343,.419991,.071634,.206684,-.120812,.431455,.0812797,.218698,-.131033,.445746,.0923651,.230726,-.141373,.457471,.104545,.245516,-.152387,.472388,.118449,.261551,-.163628,.486671,.133923,.277437,-.174814,.49762,.150849,.296662,-.186713,.51162,.169924,.31795,-.198513,.525435,.190848,.339422,-.210119,.536267,.213504,.362143,-.221354,.545982,.237947,.387198,-.23224,.555364,.264427,.412349,-.24257,.561489,.292519,.439274,-.252284,.566903,.322561,.466779,-.261023,.569614,.353952,.496011,-.26899,.571589,.387278,.524964,-.275498,.570325,.421356,.556518,-.281449,.568792,.457314,.584363,-.285526,.560268,.493199,.614214,-.28844,.55205,.530276,.645684,-.289777,.541906,.56855,.673446,-.289722,.526464,.606927,.701924,-.287792,.509872,.645945,.73037,-.284315,.490649,.685564,.757405,-.278804,.467964,.726511,.784025,-.269543,.441468,.768601,.808255,-.258117,.41216,.811321,.830739,-.244728,.380606,.853496,.851914,-.229428,.348111,.895374,.872586,-.212508,.314732,.937674,.891581,-.194025,.280338,.979869,.907641,-.174711,.245203,1.02253,.922233,-.153509,.21077,1.06371,.935878,-.130418,.177399,1.09972,.946338,-.105558,.144507,1.13124,.957265,-.080059,.110508,1.15973,.971668,-.0539766,.0742311,1.18515,.9866,-.0277101,.0375224,1.20858,1.00021,-515531e-9,135226e-9,1.23135,.137468,-686011e-11,.345041,273315e-11,.13703,-173378e-9,.343936,690761e-10,.136986,-693048e-9,.34383,276126e-9,.136964,-.00155931,.343761,621337e-9,.137003,-.00277211,.343863,.00110494,.137012,-.00433103,.343868,.00172744,.137043,-.00623606,.343916,.00249022,.13709,-.0084868,.343986,.00339559,.137145,-.0110814,.344045,.00444687,.137242,-.0140187,.344177,.00565007,.137431,-.0172713,.344491,.00701868,.137644,-.0208605,.344805,.00856042,.13791,-.024792,.345172,.0102863,.138295,-.0290461,.345734,.0122185,.138764,-.0335957,.346371,.0143771,.139415,-.038467,.347298,.0167894,.140272,-.0436176,.348527,.0194895,.141457,-.0491016,.350276,.0225043,.14303,-.0548764,.352646,.0258962,.145289,-.0610096,.356206,.0297168,.148502,-.0674777,.361488,.0340562,.152188,-.074345,.367103,.0389534,.157359,-.0817442,.375247,.0445541,.16379,-.0896334,.385064,.0509535,.171376,-.098005,.396082,.0582611,.179901,-.106817,.407418,.06654,.189892,-.116239,.420031,.075994,.201838,-.12627,.434321,.0867239,.214311,-.136701,.447631,.0987517,.228902,-.147616,.462046,.112353,.245107,-.158871,.476942,.127605,.262292,-.170261,.490285,.144469,.281215,-.182017,.503783,.163282,.301058,-.193729,.515505,.183873,.322752,-.205512,.52682,.206466,.347547,-.217214,.539473,.231194,.370969,-.227966,.546625,.257288,.397533,-.238555,.55472,.285789,.42398,-.248278,.559468,.315746,.452928,-.257422,.564095,.347724,.482121,-.265306,.565426,.380922,.510438,-.272043,.563205,.415639,.541188,-.277614,.561087,.451702,.571667,-.281927,.554922,.48845,.602432,-.285015,.546838,.526442,.634126,-.286512,.537415,.564896,.662816,-.286388,.522906,.604037,.692411,-.284734,.507003,.643795,.720946,-.281297,.488398,.68298,.748293,-.276262,.466353,.723466,.776931,-.269978,.443573,.764565,.801065,-.260305,.415279,.805838,.825843,-.247426,.384773,.849985,.84807,-.232437,.352555,.893174,.869122,-.215806,.318642,.936564,.888963,-.197307,.28381,.980253,.905547,-.177203,.247888,1.02463,.918554,-.155542,.212904,1.06714,.931395,-.131948,.1787,1.10451,.941749,-.106723,.145902,1.13694,.954551,-.0804939,.111193,1.1666,.970279,-.0534239,.0744697,1.19249,.986117,-.0257452,.0368788,1.21665,.999938,.00190634,-.0010291,1.23981,.118493,-647439e-11,.32272,23772e-10,.118765,-163023e-9,.323456,598573e-10,.118772,-65212e-8,.323477,239447e-9,.118843,-.00146741,.323657,538881e-9,.118804,-.00260846,.323553,95826e-8,.118826,-.00407576,.323595,.00149845,.118846,-.00586826,.323617,.00216047,.118886,-.00798578,.32367,.00294679,.118947,-.0104273,.323753,.00386124,.119055,-.0131909,.323922,.00490999,.119241,-.0162444,.324251,.00610804,.11944,-.0196339,.324544,.00745805,.119739,-.0233378,.325026,.00897805,.12011,-.0273179,.325586,.0106895,.120571,-.0316143,.326231,.0126073,.12124,-.0361939,.327264,.0147654,.122162,-.0410511,.328733,.0172001,.123378,-.0462233,.330659,.0199375,.125183,-.0517109,.333754,.0230498,.127832,-.0575652,.338507,.026597,.130909,-.0637441,.343666,.0306345,.135221,-.0704302,.351063,.035273,.14082,-.0776364,.360604,.0406137,.146781,-.0852293,.369638,.0466788,.155121,-.0935351,.3827,.0537628,.16398,-.102234,.39522,.0617985,.173926,-.111465,.40793,.07097,.185137,-.121296,.42105,.0813426,.19826,-.13169,.435735,.0931596,.212938,-.142614,.450932,.106547,.229046,-.153884,.465726,.121575,.246246,-.165382,.479461,.138286,.264637,-.176806,.492106,.15666,.284959,-.188793,.504774,.17728,.308157,-.200763,.518805,.19988,.330951,-.21239,.528231,.224293,.3549,-.223521,.536376,.250541,.381502,-.234169,.544846,.278902,.409529,-.244077,.551717,.309227,.437523,-.253363,.55517,.341426,.467624,-.261659,.557772,.37518,.497268,-.268498,.556442,.41007,.528294,-.274018,.553915,.446445,.559053,-.278169,.549153,.483779,.589329,-.281229,.539878,.522249,.622503,-.282902,.53162,.561754,.652382,-.282815,.518119,.601544,.681847,-.281247,.502187,.641574,.712285,-.277986,.484824,.682633,.740094,-.273017,.463483,.723426,.768478,-.266692,.441299,.763747,.794556,-.258358,.415238,.805565,.819408,-.248807,.386912,.847254,.843411,-.236214,.356165,.891091,.862397,-.219794,.320562,.936174,.883113,-.201768,.285322,.982562,.90023,-.181672,.249713,1.02862,.915192,-.159279,.214546,1.07163,.928458,-.134725,.180285,1.10995,.94069,-.10913,.147119,1.14354,.953409,-.0821315,.112492,1.17372,.969537,-.0542677,.0752014,1.20043,.985612,-.0259096,.0370361,1.22528,.999835,.00298198,-.00151801,1.24959,.10097,-602574e-11,.300277,202619e-11,.101577,-152164e-9,.302077,511662e-10,.101572,-608889e-9,.302066,204751e-9,.101566,-.00136997,.302047,460753e-9,.101592,-.00243557,.302114,819497e-9,.101608,-.0038053,.30214,.00128154,.101627,-.00547906,.30216,.0018483,.101669,-.00745647,.302224,.00252223,.101732,-.00973615,.302318,.00330716,.101844,-.0123097,.302513,.00421061,.102025,-.0151681,.30285,.00524481,.102224,-.0183334,.303166,.0064154,.102515,-.0217819,.303654,.00774063,.102886,-.0255067,.304243,.0092398,.103395,-.029514,.305089,.0109339,.104109,-.0337912,.306301,.0128561,.105074,-.0383565,.30798,.0150338,.10654,-.0432132,.310726,.0175228,.108478,-.0484244,.314351,.0203648,.111015,-.0539339,.319032,.0236325,.114682,-.0598885,.32605,.0274188,.11911,-.0663375,.334109,.0317905,.124736,-.0733011,.344013,.0368502,.131479,-.0807744,.355358,.0427104,.139283,-.0888204,.367614,.0494788,.148054,-.0973394,.380072,.0572367,.159037,-.10665,.395678,.0662704,.169794,-.116221,.40795,.0763192,.18314,-.126632,.423546,.087956,.197515,-.137383,.438213,.101042,.213514,-.148641,.453248,.115827,.23065,-.160117,.46688,.132283,.249148,-.171807,.479962,.150644,.270219,-.183695,.494618,.171073,.292338,-.195574,.506937,.193378,.314999,-.207205,.516463,.217585,.340991,-.218955,.528123,.24428,.367982,-.229917,.537025,.272784,.39432,-.239737,.541627,.302742,.423364,-.249048,.546466,.335112,.453751,-.257329,.549466,.369032,.48416,-.264623,.549503,.404577,.515262,-.270411,.547008,.441337,.547036,-.274581,.542249,.479162,.576614,-.277266,.533015,.517904,.611143,-.279144,.525512,.558508,.640989,-.279001,.51154,.598995,.671182,-.277324,.495641,.639935,.700848,-.273908,.477526,.681017,.729862,-.269063,.457955,.722764,.758273,-.262282,.434846,.764349,.784121,-.254281,.409203,.806206,.809798,-.24505,.382694,.848617,.834953,-.233861,.354034,.892445,.856817,-.221308,.321764,.936263,.877609,-.205996,.288118,.982401,.897489,-.186702,.253277,1.02975,.913792,-.164618,.217963,1.07488,.92785,-.140023,.183221,1.11487,.940378,-.11328,.149385,1.14947,.95273,-.0853958,.114152,1.1807,.969059,-.0568698,.0769845,1.20912,.985574,-.0276502,.0381186,1.23498,.999943,.00239052,-.00126861,1.25987,.0852715,-560067e-11,.279021,171162e-11,.0854143,-140871e-9,.279483,430516e-10,.0854191,-563385e-9,.2795,172184e-9,.0854188,-.00126753,.279493,387464e-9,.0854229,-.00225337,.279501,68918e-8,.0854443,-.00352086,.279549,.00107803,.0854697,-.00506962,.279591,.00155536,.0855093,-.00689873,.279652,.00212354,.0855724,-.00900821,.279752,.00278703,.0856991,-.0113799,.280011,.0035551,.085855,-.0140314,.280297,.00443449,.0860682,-.016963,.280682,.00543636,.086344,-.0201438,.281159,.0065788,.0867426,-.0235999,.281886,.00787977,.087239,-.0273069,.282745,.0093606,.0879815,-.031269,.284139,.011056,.0891258,-.035531,.28647,.0130065,.0906909,-.0400947,.289708,.0152495,.0927624,-.0449638,.293904,.0178454,.0958376,-.0502427,.300471,.0208915,.0995827,-.0559514,.30806,.0244247,.104526,-.0622152,.317874,.0285721,.110532,-.0690046,.329332,.0334227,.117385,-.0763068,.341217,.0390466,.12522,-.084184,.353968,.0455786,.134037,-.0925248,.366797,.0530773,.144014,-.101487,.380209,.0617424,.156013,-.111273,.395956,.071777,.168872,-.121431,.41053,.0830905,.183089,-.132105,.425073,.0959341,.198763,-.143286,.439833,.110448,.216159,-.154841,.454507,.126769,.234859,-.166588,.468368,.14495,.255879,-.178626,.482846,.165233,.27677,-.190218,.493489,.187217,.301184,-.202227,.506549,.211659,.325852,-.213764,.5158,.237922,.352824,-.22487,.525442,.26632,.380882,-.235246,.532487,.296691,.410137,-.244847,.537703,.329179,.439787,-.253122,.540361,.363135,.472291,-.260517,.542734,.399222,.501856,-.266519,.538826,.436352,.534816,-.270905,.535152,.474505,.565069,-.273826,.525979,.513988,.597154,-.275333,.516394,.554852,.630473,-.275314,.506206,.596592,.660574,-.273323,.489769,.638117,.692015,-.270008,.472578,.680457,.720647,-.265001,.452134,.723008,.750528,-.258311,.430344,.765954,.777568,-.250046,.405624,.809012,.80387,-.240114,.378339,.852425,.828439,-.228737,.349877,.895346,.851472,-.216632,.318968,.940695,.873906,-.202782,.287489,.987235,.89467,-.187059,.254394,1.03348,.912281,-.168818,.221294,1.07812,.927358,-.146494,.18675,1.11928,.940385,-.120009,.152322,1.15609,.952672,-.0917183,.117514,1.18875,.968496,-.0620321,.0797405,1.21821,.985236,-.0314945,.0402383,1.24523,.99998,-575153e-9,110644e-9,1.27133,.0702429,-512222e-11,.255273,140947e-11,.0702981,-128826e-9,.255469,354488e-10,.0703691,-515562e-9,.255727,141874e-9,.0703805,-.00116,.255754,31929e-8,.0703961,-.00206224,.255813,567999e-9,.0704102,-.00322223,.255839,88871e-8,.0704298,-.00463928,.255863,.00128272,.0704759,-.00631375,.255953,.00175283,.0705434,-.00824317,.256079,.00230342,.0706693,-.010412,.25636,.0029443,.0708189,-.0128439,.256647,.00368031,.0710364,-.0155177,.257084,.00452614,.0713223,-.0184374,.257637,.00549706,.0717182,-.0216002,.258416,.00661246,.072321,-.0249966,.259699,.00790147,.0731446,-.0286566,.261475,.0093884,.0743352,-.0325888,.264132,.0111186,.0760676,-.036843,.26815,.013145,.078454,-.0414292,.273636,.0155251,.0818618,-.0464634,.281653,.0183525,.0857382,-.0519478,.289992,.0216642,.0908131,-.0579836,.30066,.0255956,.0967512,-.0645124,.312204,.0301954,.103717,-.0716505,.325001,.0356017,.111596,-.0793232,.338129,.041896,.120933,-.087645,.352853,.0492447,.130787,-.096492,.366192,.0576749,.142311,-.105973,.380864,.0673969,.155344,-.116182,.396575,.0785899,.169535,-.126815,.411443,.0912377,.185173,-.138015,.426256,.105607,.201755,-.149325,.439607,.121551,.221334,-.161207,.455467,.139608,.241461,-.173162,.469096,.159591,.26294,-.18504,.481014,.18156,.286776,-.196881,.493291,.205781,.311596,-.208311,.503556,.231819,.338667,-.219671,.513268,.260274,.366021,-.230451,.519414,.290862,.395875,-.240131,.526766,.323196,.425564,-.248566,.52905,.357071,.457094,-.256195,.530796,.393262,.488286,-.262331,.528703,.430797,.522291,-.267141,.52727,.470231,.554172,-.270411,.519848,.510477,.586427,-.271986,.510307,.551594,.619638,-.27192,.499158,.593849,.650656,-.269817,.483852,.636314,.68284,-.266267,.467515,.679679,.714356,-.26113,.44931,.723884,.742717,-.254067,.425789,.767245,.770894,-.245652,.401144,.811819,.797358,-.235554,.374224,.856315,.823377,-.223896,.346167,.901077,.847456,-.210865,.316056,.946502,.870697,-.196574,.284503,.993711,.891068,-.180814,.251628,1.04134,.909267,-.163314,.219065,1.08609,.925653,-.143304,.186446,1.12702,.940017,-.121322,.153416,1.16371,.952398,-.0973872,.120334,1.19712,.967568,-.0698785,.08352,1.22791,.984772,-.0390031,.0439209,1.25672,1.00026,-.0070087,.00315668,1.28428,.0556653,-459654e-11,.227325,112556e-11,.0565238,-116382e-9,.230826,284985e-10,.0565717,-465666e-9,.231026,114036e-9,.0565859,-.00104773,.231079,256656e-9,.0565761,-.00186255,.231025,45663e-8,.0565913,-.00291002,.231058,714664e-9,.0566108,-.00418998,.231085,.00103224,.0566532,-.00570206,.231169,.00141202,.0567473,-.00743666,.231417,.00186018,.0568567,-.00940298,.231661,.00238264,.0569859,-.0115991,.231895,.00298699,.0572221,-.0140096,.232456,.00368957,.057519,-.0166508,.233096,.00450303,.0579534,-.01951,.234094,.00544945,.0585922,-.0225991,.235629,.00655564,.0595647,-.0259416,.238106,.00785724,.0609109,-.0295661,.241557,.00939127,.0628751,-.0335126,.246652,.0112198,.0656908,-.0378604,.254091,.0134168,.0691347,-.0426543,.262666,.0160374,.0732165,-.0478967,.272029,.0191514,.0782863,-.0536716,.283007,.0228597,.0843973,-.0600683,.295732,.0272829,.0913598,-.0670095,.308779,.032484,.0994407,-.0745516,.322886,.0385886,.108189,-.082712,.336408,.0457133,.118574,-.0914927,.351692,.0539832,.129989,-.100854,.366502,.0635162,.142722,-.110837,.381675,.0744386,.156654,-.121353,.3963,.0868483,.172151,-.132414,.411477,.100963,.188712,-.143809,.42508,.116795,.208093,-.155765,.441328,.134715,.227936,-.167608,.454328,.154396,.249495,-.179579,.467235,.176179,.27362,-.191488,.480248,.200193,.296371,-.202618,.487886,.225775,.324234,-.214133,.499632,.25441,.353049,-.225212,.509532,.285077,.381785,-.234875,.514265,.317047,.414038,-.244205,.521282,.351874,.445251,-.252145,.522931,.388279,.476819,-.258433,.520947,.425825,.509209,-.263411,.517669,.465104,.542759,-.266732,.512841,.505741,.574822,-.268263,.503317,.547611,.609324,-.268489,.493035,.590953,.641772,-.266941,.478816,.63488,.674049,-.263297,.462863,.679072,.705071,-.257618,.442931,.723487,.734709,-.250625,.421299,.768708,.763704,-.24179,.397085,.814375,.791818,-.231115,.370577,.859907,.817439,-.21922,.34232,.906715,.843202,-.205658,.312627,.953943,.866639,-.190563,.280933,1.00185,.888129,-.173978,.248393,1.05105,.907239,-.155485,.216007,1.09704,.923893,-.134782,.183233,1.13857,.938882,-.11249,.150376,1.17539,.952464,-.0890706,.117177,1.20924,.968529,-.0646523,.0813095,1.24055,.984763,-.038606,.0439378,1.27018,1.00053,-.01238,.00598668,1.29873,.0437928,-409594e-11,.204012,8.79224e-7,.0440166,-103395e-9,.205049,221946e-10,.0440529,-413633e-9,.205225,887981e-10,.0440493,-930594e-9,.2052,199858e-9,.0439884,-.00165352,.204901,355495e-9,.0440716,-.0025849,.205255,556983e-9,.0440968,-.00372222,.205311,805326e-9,.0441359,-.00506478,.205391,.00110333,.0442231,-.00660384,.205638,.00145768,.0443254,-.00835246,.205877,.00187275,.0444832,-.0102992,.20627,.00235938,.0447001,-.0124449,.206796,.0029299,.0450168,-.0147935,.207593,.0036005,.0454816,-.017336,.208819,.00439246,.0462446,-.0201156,.211036,.00533864,.0473694,-.0231568,.214388,.00646984,.0490191,-.0264941,.219357,.00783856,.0512776,-.030184,.226061,.00950182,.0541279,-.0342661,.234094,.0115156,.0578989,-.0388539,.244297,.0139687,.0620835,-.0438735,.254457,.0169015,.0673497,-.04951,.266706,.0204554,.0731759,-.0556263,.278753,.0246606,.0803937,-.0624585,.29309,.0297126,.0879287,-.0697556,.305856,.0355868,.0970669,-.0778795,.321059,.0425768,.106508,-.0863541,.333873,.05056,.11776,-.0955935,.349008,.0598972,.130081,-.105438,.363776,.0706314,.144454,-.115899,.380112,.0828822,.1596,-.126827,.394843,.0967611,.176097,-.138161,.409033,.112381,.194726,-.149904,.424257,.129952,.213944,-.161675,.436945,.149333,.235516,-.173659,.450176,.170892,.260564,-.185963,.466305,.194984,.285183,-.197582,.477328,.220805,.311095,-.208697,.486566,.248694,.338924,-.219519,.494811,.279015,.369757,-.229766,.504065,.311725,.3996,-.238879,.507909,.345844,.430484,-.246802,.509805,.381749,.46413,-.253924,.511436,.420251,.497077,-.259319,.508787,.459957,.530434,-.263297,.50394,.501356,.565725,-.265619,.49804,.544252,.599254,-.265842,.487346,.587856,.631251,-.263978,.472975,.631969,.663972,-.26043,.457135,.677471,.697724,-.255358,.439844,.723744,.727725,-.248308,.417872,.770653,.756417,-.239181,.39273,.817357,.785419,-.22814,.367839,.864221,.81266,-.215681,.339449,.912701,.839391,-.201623,.309279,.962419,.86366,-.185624,.278029,1.0122,.885028,-.16797,.245294,1.06186,.904639,-.148336,.212689,1.10934,.922048,-.12637,.179616,1.15063,.936952,-.102928,.146749,1.18885,.951895,-.0785268,.112733,1.22352,.967198,-.0530153,.0760056,1.25681,.984405,-.02649,.0383183,1.28762,1.00021,70019e-8,-20039e-8,1.31656,.0325964,-355447e-11,.176706,6.55682e-7,.0329333,-899174e-10,.178527,165869e-10,.0329181,-359637e-9,.178453,663498e-10,.0329085,-808991e-9,.178383,149332e-9,.0329181,-.00143826,.178394,265873e-9,.0329425,-.00224678,.178517,416597e-9,.0329511,-.00323575,.17849,603299e-9,.033011,-.00439875,.178695,829422e-9,.0330733,-.00574059,.178843,.00109908,.0331857,-.00725896,.179176,.00141933,.0333445,-.00895289,.179618,.0017999,.0335674,-.0108219,.180238,.00225316,.033939,-.0128687,.181417,.00279765,.0345239,-.015114,.183395,.0034564,.0354458,-.017596,.186616,.00425864,.0368313,-.0203524,.191547,.00524936,.0386115,-.0234105,.197508,.00647033,.0410303,-.0268509,.205395,.00798121,.0442245,-.0307481,.215365,.0098557,.0478659,-.0350863,.225595,.0121417,.0522416,-.0399506,.236946,.0149385,.0574513,-.045357,.249442,.0183189,.0631208,-.0512863,.261222,.0223644,.0701124,-.0579273,.275418,.0272418,.0777331,-.0650652,.288989,.0329458,.0862709,-.0728813,.302546,.0396819,.096103,-.081363,.317164,.04757,.106976,-.0904463,.331733,.0567012,.119175,-.100105,.34661,.067202,.132919,-.110375,.362249,.0792588,.147727,-.121115,.376978,.0928672,.163618,-.132299,.390681,.108228,.182234,-.143887,.406571,.125502,.201809,-.155827,.42042,.144836,.225041,-.168357,.438411,.166706,.247621,-.18004,.450368,.189909,.27097,-.191536,.460083,.215251,.296658,-.203024,.469765,.243164,.325892,-.214056,.481837,.273388,.35406,-.224104,.487474,.305344,.384372,-.233489,.492773,.339741,.41749,-.241874,.498451,.376287,.45013,-.248834,.499632,.414195,.481285,-.254658,.495233,.454077,.519183,-.259367,.496401,.496352,.551544,-.261818,.487686,.538798,.587349,-.262964,.479453,.583626,.621679,-.262128,.467709,.629451,.654991,-.258998,.452123,.67566,.686873,-.254119,.433495,.723248,.719801,-.246946,.413657,.771156,.750355,-.237709,.390366,.81989,.780033,-.226549,.364947,.868601,.809254,-.214186,.337256,.920034,.836576,-.199639,.307395,.971706,.861774,-.183169,.275431,1.02479,.885707,-.165111,.243431,1.07837,.904742,-.144363,.210921,1.12783,.915604,-.121305,.17647,1.17254,.930959,-.0962119,.143106,1.21012,.948404,-.069969,.108112,1.24474,.967012,-.0427586,.0708478,1.27718,.984183,-.0147043,.032335,1.3083,.999577,.0142165,-.00726867,1.3382,.0229227,-299799e-11,.148623,4.62391e-7,.0232194,-758796e-10,.15054,117033e-10,.0232315,-303636e-9,.15063,468397e-10,.0232354,-683189e-9,.150624,105472e-9,.0232092,-.0012136,.150445,187744e-9,.0232523,-.00189765,.150679,294847e-9,.0232828,-.00273247,.150789,428013e-9,.0233371,-.00371287,.150995,591134e-9,.0234015,-.00484794,.15118,787642e-9,.023514,-.00612877,.151562,.00102547,.023679,-.00756125,.152116,.00131351,.0239559,-.00914651,.153162,.00166594,.0244334,-.010904,.155133,.00210182,.025139,-.0128615,.158035,.00264406,.0262598,-.0150628,.162751,.00332923,.0277875,-.0175532,.168944,.00419773,.0298472,-.0203981,.176835,.00530034,.0325444,-.023655,.186686,.00669777,.0355581,-.0272982,.196248,.00842661,.0392841,-.0314457,.207352,.0105854,.0436815,-.0361157,.219279,.0132458,.0485272,-.0412932,.230728,.0164736,.0541574,-.0470337,.242994,.0203715,.0609479,-.0535002,.257042,.0250953,.0685228,-.0605409,.27102,.0306856,.0768042,-.0680553,.28406,.037193,.0864844,-.0765011,.299186,.0449795,.0969415,-.0852674,.3132,.0538316,.108478,-.0947333,.327138,.0641149,.121705,-.10481,.342345,.0759185,.136743,-.115474,.358472,.0894116,.152986,-.126536,.374067,.104562,.170397,-.138061,.388267,.121632,.191392,-.150203,.406467,.140996,.211566,-.161751,.418641,.161696,.233567,-.173407,.430418,.184557,.257769,-.185397,.44277,.210092,.28531,-.197048,.457191,.237827,.311726,-.20784,.464712,.267253,.340537,-.218345,.472539,.299332,.372921,-.228306,.482331,.333988,.402924,-.236665,.484378,.369722,.434475,-.244097,.484717,.407836,.469736,-.250547,.487093,.448465,.505045,-.25511,.485575,.490263,.540262,-.258444,.481225,.534495,.576347,-.259903,.473481,.579451,.608656,-.259572,.4603,.625604,.646679,-.257908,.450341,.674511,.679902,-.253663,.431561,.723269,.714159,-.247419,.412684,.773263,.745345,-.239122,.389388,.824182,.778248,-.228837,.365361,.876634,.807208,-.216197,.337667,.92945,.835019,-.201772,.307197,.985261,.860261,-.185291,.274205,1.04299,.877601,-.165809,.240178,1.09816,.898211,-.143897,.207571,1.14694,.915789,-.119513,.174904,1.19008,.931831,-.0932919,.141423,1.2297,.949244,-.0656528,.105603,1.26553,.967527,-.0370262,.0679551,1.29986,.984139,-.00730117,.0283133,1.33252,.999713,.0234648,-.0121785,1.36397,.0152135,-245447e-11,.122795,3.04092e-7,.0151652,-615778e-10,.122399,76292e-10,.0151181,-245948e-9,.122023,304802e-10,.0151203,-553394e-9,.12203,686634e-10,.015125,-983841e-9,.122037,122463e-9,.0151427,-.00153774,.12214,192706e-9,.0151708,-.0022103,.122237,281219e-9,.0152115,-.00300741,.12238,390804e-9,.0152877,-.00392494,.1227,526317e-9,.015412,-.00496597,.123244,69443e-8,.0156201,-.00613314,.124228,90547e-8,.0159658,-.00744113,.125945,.0011732,.0165674,-.00892546,.129098,.00151888,.017487,-.010627,.133865,.00197007,.018839,-.0126043,.140682,.0025637,.020554,-.0148814,.148534,.00333637,.0226727,-.0175123,.157381,.00433738,.0251879,-.0205266,.166685,.00561664,.0283635,-.0240319,.177796,.00725563,.0318694,-.0279432,.188251,.00928811,.0361044,-.0324313,.200038,.011835,.0406656,-.0373527,.210685,.0149146,.0463846,-.0430132,.224182,.0187254,.0525696,-.0491013,.23634,.0232283,.0598083,-.0559175,.250013,.0286521,.0679437,-.0633657,.263981,.0350634,.0771181,-.0714602,.278072,.0425882,.0881273,-.0803502,.29511,.0514487,.0996628,-.0896903,.309976,.0615766,.112702,-.099644,.325611,.0732139,.126488,-.109829,.339321,.0862324,.142625,-.120859,.35574,.101275,.15953,-.131956,.369845,.117892,.176991,-.143145,.38146,.136205,.199715,-.155292,.40052,.157252,.220787,-.167066,.412055,.179966,.243697,-.178396,.423133,.204418,.272106,-.190433,.439524,.232141,.297637,-.201265,.447041,.261109,.325273,-.211834,.454488,.292627,.357219,-.221889,.465004,.326669,.387362,-.230729,.468527,.362426,.423131,-.23924,.475836,.401533,.45543,-.246067,.475017,.441902,.493393,-.251557,.478017,.484239,.526253,-.255571,.4709,.528586,.560554,-.257752,.463167,.574346,.599306,-.258076,.456452,.621655,.634541,-.256471,.443725,.670492,.668907,-.253283,.428719,.721943,.705619,-.247562,.411348,.772477,.739034,-.240626,.388939,.8264,.771408,-.231493,.36425,.881702,.803312,-.220125,.337321,.9385,.828457,-.206645,.305364,.997437,.854819,-.190664,.273715,1.05693,.878666,-.171429,.242218,1.11251,.898404,-.149235,.209556,1.16398,.917416,-.12435,.176863,1.21014,.933133,-.0972703,.142775,1.25178,.95066,-.0683607,.106735,1.29028,.968589,-.0378724,.0681609,1.32703,.984776,-.00605712,.0273966,1.36158,.99994,.0263276,-.0138124,1.3943,.00867437,-186005e-11,.0928979,1.73682e-7,.00864003,-466389e-10,.0925237,435505e-11,.00864593,-186594e-9,.0925806,174322e-10,.00864095,-419639e-9,.0924903,392862e-10,.00863851,-746272e-9,.0924589,702598e-10,.00868531,-.00116456,.0929,111188e-9,.00869667,-.00167711,.0928529,163867e-9,.00874332,-.00228051,.0930914,23104e-8,.00882709,-.00297864,.0935679,31741e-8,.00898874,-.00377557,.0946165,430186e-9,.00929346,-.00469247,.0967406,580383e-9,.00978271,-.00575491,.100084,783529e-9,.0105746,-.00701514,.105447,.00106304,.0116949,-.00851797,.112494,.00144685,.0130419,-.0102757,.119876,.00196439,.0148375,-.012381,.129034,.00266433,.0168725,-.01482,.137812,.00358364,.0193689,-.0176563,.147696,.00478132,.0222691,-.0209211,.157795,.00631721,.0256891,-.0246655,.168431,.00826346,.0294686,-.0288597,.178587,.0106714,.0340412,-.0336441,.190251,.0136629,.0393918,-.039033,.202999,.0173272,.0453947,-.0450087,.215655,.0217448,.0521936,-.0515461,.228686,.0269941,.0600279,-.058817,.242838,.033272,.0692398,-.0667228,.258145,.0406457,.0793832,-.0752401,.273565,.0492239,.0902297,-.0841851,.287735,.0590105,.102014,-.0936479,.301161,.0702021,.116054,-.103967,.317438,.0832001,.13191,-.114622,.334166,.0977951,.148239,-.125452,.348192,.113985,.165809,-.136453,.361094,.131928,.184616,-.147648,.373534,.151811,.207491,-.159607,.39101,.174476,.230106,-.171119,.402504,.198798,.257036,-.182906,.418032,.225796,.281172,-.193605,.425468,.254027,.312034,-.204771,.440379,.285713,.340402,-.214988,.445406,.319196,.370231,-.224711,.44968,.35537,.407105,-.233516,.460747,.393838,.439037,-.240801,.460624,.433747,.47781,-.24762,.465957,.477234,.510655,-.251823,.460054,.52044,.550584,-.255552,.459172,.567853,.585872,-.257036,.450311,.615943,.620466,-.257535,.437763,.667693,.660496,-.255248,.426639,.718988,.695578,-.251141,.409185,.772503,.732176,-.244718,.39015,.827023,.760782,-.236782,.362594,.885651,.79422,-.225923,.33711,.943756,.824521,-.213855,.308272,1.00874,.854964,-.197723,.278529,1.06764,.878065,-.179209,.246208,1.12836,.899834,-.157569,.21329,1.18318,.918815,-.133206,.181038,1.23161,.934934,-.106545,.146993,1.27644,.952115,-.0780574,.111175,1.31842,.96906,-.0478279,.0728553,1.35839,.985178,-.0160014,.032579,1.39697,1.00039,.0173126,-.0095256,1.43312,.00384146,-124311e-11,.0613583,7.78271e-8,.00390023,-314043e-10,.0622919,196626e-11,.00389971,-125622e-9,.0622632,787379e-11,.00389491,-282352e-9,.0620659,1778e-8,.00391618,-502512e-9,.0624687,320918e-10,.00392662,-784458e-9,.0625113,515573e-10,.00396053,-.00112907,.0628175,778668e-10,.00401911,-.00153821,.0633286,113811e-9,.00414994,-.0020208,.0646443,16445e-8,.00441223,-.00260007,.0673886,237734e-9,.00484427,-.0033097,.0716528,345929e-9,.00549109,-.00418966,.0774998,505987e-9,.00636293,-.00527331,.0844758,739208e-9,.00746566,-.00660428,.0921325,.00107347,.00876625,-.00818826,.0997067,.00153691,.0103125,-.0100811,.107433,.00217153,.0123309,-.0123643,.117088,.00303427,.0146274,-.0150007,.126438,.00416018,.0172295,-.0180531,.135672,.00561513,.0204248,-.0215962,.146244,.007478,.0241597,-.0256234,.157481,.00981046,.0284693,-.0302209,.169125,.0127148,.033445,-.0353333,.181659,.0162453,.0391251,-.0410845,.1944,.0205417,.0454721,-.0473451,.207082,.0256333,.0530983,-.0542858,.221656,.0317036,.0615356,-.0618384,.236036,.0388319,.0703363,-.0697631,.248398,.046974,.0810391,-.0784757,.263611,.0565246,.0920144,-.0873488,.275857,.0671724,.105584,-.0973652,.292555,.0798105,.119506,-.107271,.306333,.0935945,.134434,-.117608,.318888,.109106,.153399,-.128938,.337552,.127074,.171258,-.139944,.349955,.14643,.191059,-.151288,.361545,.168,.215069,-.163018,.378421,.192082,.237838,-.174226,.38879,.217838,.266965,-.186063,.405857,.246931,.292827,-.196909,.414146,.277505,.324352,-.207473,.426955,.310711,.354427,-.217713,.433429,.346794,.389854,-.227183,.443966,.385237,.420749,-.235131,.44471,.424955,.459597,-.242786,.451729,.468446,.495316,-.248767,.45072,.513422,.534903,-.253351,.450924,.560618,.572369,-.256277,.445266,.609677,.612383,-.2576,.438798,.660995,.644037,-.256931,.421693,.713807,.686749,-.254036,.4109,.767616,.719814,-.249785,.390151,.82533,.754719,-.244283,.367847,.888311,.792022,-.235076,.345013,.948177,.822404,-.225061,.316193,1.01661,.853084,-.211113,.287013,1.08075,.879871,-.19449,.255424,1.14501,.901655,-.174023,.222879,1.20203,.919957,-.1509,.18989,1.25698,.938412,-.124923,.15606,1.30588,.953471,-.0968139,.120512,1.3529,.970451,-.066734,.0828515,1.3986,.985522,-.034734,.0424458,1.44148,1.00099,-.00102222,678929e-9,1.48398,965494e-9,-6.27338e-7,.0306409,1.97672e-8,99168e-8,-158573e-10,.0314638,4.99803e-7,991068e-9,-634012e-10,.031363,200682e-11,974567e-9,-14144e-8,.03036,457312e-11,998079e-9,-252812e-9,.031496,860131e-11,.00102243,-396506e-9,.0319955,148288e-10,.00107877,-577593e-9,.0331376,249141e-10,.00121622,-816816e-9,.0359396,423011e-10,.0014455,-.00113761,.0399652,724613e-10,.00178791,-.00156959,.0450556,123929e-9,.00225668,-.00214064,.0508025,208531e-9,.00285627,-.00287655,.0568443,341969e-9,.0035991,-.00380271,.0630892,544158e-9,.00455524,-.00496264,.0702204,842423e-9,.00569143,-.0063793,.0773426,.00126704,.00716928,-.00813531,.0860839,.00186642,.00885307,-.0101946,.0944079,.00267014,.0109316,-.0126386,.103951,.00374033,.0133704,-.0154876,.113786,.0051304,.0161525,-.0187317,.123477,.00688858,.0194267,-.0224652,.133986,.00910557,.0230967,-.0265976,.143979,.0118074,.0273627,-.0312848,.154645,.0151266,.0323898,-.0365949,.166765,.0191791,.0379225,-.0422914,.177932,.0239236,.0447501,-.0487469,.19167,.0296568,.0519391,-.0556398,.203224,.0362924,.0599464,-.0631646,.215652,.0440585,.0702427,-.0714308,.232089,.0531619,.0806902,-.0800605,.245258,.0634564,.0923194,-.0892815,.258609,.0752481,.106938,-.09931,.276654,.0888914,.121238,-.109575,.289847,.104055,.138817,-.120461,.307566,.121266,.15595,-.131209,.320117,.139944,.178418,-.143049,.339677,.161591,.197875,-.154074,.349886,.184303,.224368,-.166307,.369352,.210669,.252213,-.178051,.386242,.238895,.277321,-.189335,.395294,.269182,.310332,-.200683,.412148,.302508,.338809,-.210856,.418266,.337264,.372678,-.220655,.428723,.374881,.405632,-.230053,.433887,.415656,.442293,-.237993,.439911,.457982,.477256,-.244897,.440175,.502831,.515592,-.250657,.441079,.550277,.550969,-.255459,.435219,.601102,.592883,-.257696,.432882,.651785,.629092,-.259894,.421054,.708961,.672033,-.258592,.41177,.763806,.709147,-.256525,.395267,.824249,.745367,-.254677,.375013,.8951,.784715,-.247892,.353906,.959317,.818107,-.240162,.327801,1.03153,.847895,-.229741,.298821,1.10601,.879603,-.213084,.269115,1.164,.902605,-.195242,.236606,1.22854,.922788,-.174505,.203442,1.29017,.944831,-.150169,.169594,1.34157,.959656,-.124099,.135909,1.3956,.972399,-.0960626,.0990563,1.45128,.986549,-.0657097,.0602348,1.50312,1.00013,-.0333558,.0186694,1.55364,619747e-11,-1e-7,.00778326,796756e-16,2.37499e-8,-9.99999e-8,282592e-10,1.14596e-10,100292e-11,-166369e-11,250354e-9,6.77492e-9,350752e-11,-637769e-11,357289e-9,6.31655e-8,826445e-11,-174689e-10,516179e-9,3.1851e-7,242481e-10,-450868e-10,.0010223,130577e-11,455631e-10,-89044e-9,.00144302,374587e-11,971222e-10,-178311e-9,.00241912,102584e-10,171403e-9,-313976e-9,.00354938,236481e-10,292747e-9,-520026e-9,.00513765,496014e-10,789827e-9,-.00118187,.0238621,139056e-9,.00114093,-.00171827,.0286691,244093e-9,.00176119,-.00249667,.0368565,420623e-9,.0022233,-.00333742,.0400469,65673e-8,.00343382,-.00481976,.0535751,.00109323,.00427602,-.00600755,.057099,.00155268,.00461435,-.00737637,.0551084,.00215031,.00695698,-.00971401,.0715767,.00316529,.00867619,-.0120943,.0793314,.00436995,.0106694,-.0148202,.0869391,.0058959,.0140351,-.0183501,.101572,.00798757,.0168939,-.022006,.11018,.0104233,.020197,-.0261568,.119041,.0134167,.0254702,-.0312778,.135404,.0173009,.0298384,-.0362469,.1437,.0215428,.035159,-.042237,.15512,.0268882,.0427685,-.0488711,.17128,.033235,.0494848,-.0557997,.181813,.0404443,.0592394,-.0635578,.198745,.0490043,.0681463,-.071838,.210497,.0588239,.0804753,-.0809297,.228864,.0702835,.0942205,-.0906488,.247008,.0834012,.106777,-.100216,.258812,.0975952,.124471,-.110827,.278617,.114162,.138389,-.121193,.287049,.131983,.159543,-.13253,.307151,.152541,.176432,-.143611,.31564,.174673,.201723,-.15548,.33538,.199842,.229721,-.167166,.355256,.227097,.250206,-.178238,.360047,.256014,.282118,-.189905,.378761,.28855,.312821,-.201033,.39181,.323348,.341482,-.211584,.397716,.360564,.377368,-.221314,.410141,.400004,.418229,-.230474,.423485,.442371,.444881,-.239443,.418874,.488796,.488899,-.245987,.427545,.535012,.520317,-.253948,.422147,.589678,.568566,-.256616,.42719,.637683,.599607,-.26376,.415114,.703363,.64222,-.268687,.408715,.771363,.685698,-.2694,.399722,.83574,.732327,-.266642,.388651,.897764,.769873,-.267712,.369198,.983312,.806733,-.263479,.346802,1.06222,.843466,-.254575,.321368,1.13477,.873008,-.242749,.29211,1.20712,.908438,-.22725,.262143,1.27465,.936321,-.207621,.228876,1.33203,.950353,-.187932,.19484,1.40439,.96442,-.165154,.163178,1.4732,.979856,-.139302,.127531,1.53574,.982561,-.11134,.0903457,1.59982,.996389,-.0808124,.0489007,1.6577],t=[1,0,0,0,1,791421e-36,0,0,1,104392e-29,0,0,1,349405e-26,0,0,1,109923e-23,0,0,1,947414e-22,0,0,1,359627e-20,0,0,1,772053e-19,0,0,1,108799e-17,0,0,1,110655e-16,0,0,1,865818e-16,0,0,.999998,5.45037e-10,0,0,.999994,2.85095e-9,0,0,.999989,1.26931e-8,0,0,.999973,4.89938e-8,0,0,.999947,1.66347e-7,0,0,.999894,5.02694e-7,0,0,.999798,136532e-11,0,0,.999617,335898e-11,0,0,.999234,752126e-11,0,0,.998258,152586e-10,0,0,.99504,266207e-10,0,0,.980816,236802e-10,0,0,.967553,207684e-11,0,0,.966877,403733e-11,0,0,.965752,741174e-11,0,0,.96382,127746e-10,0,0,.960306,202792e-10,0,0,.953619,280232e-10,0,0,.941103,278816e-10,0,0,.926619,160221e-10,0,0,.920983,235164e-10,0,0,.912293,311924e-10,0,.0158731,.899277,348118e-10,0,.0476191,.880884,26041e-9,0,.0793651,.870399,338726e-10,0,.111111,.856138,392906e-10,0,.142857,.837436,372874e-10,0,.174603,.820973,392558e-10,0,.206349,.803583,434658e-10,0,.238095,.782168,40256e-9,0,.269841,.764107,448159e-10,0,.301587,.743092,457627e-10,0,.333333,.721626,455314e-10,0,.365079,.700375,477335e-10,0,.396825,.677334,461072e-10,0,.428571,.655702,484393e-10,0,.460317,.632059,464583e-10,0,.492064,.610125,483923e-10,0,.52381,.58653,464342e-10,0,.555556,.564508,477033e-10,0,.587302,.541405,459263e-10,0,.619048,.519556,46412e-9,0,.650794,.497292,448913e-10,0,.68254,.475898,445789e-10,0,.714286,.454722,433496e-10,0,.746032,.434042,423054e-10,0,.777778,.414126,413737e-10,0,.809524,.394387,397265e-10,0,.84127,.375841,390709e-10,0,.873016,.357219,369938e-10,0,.904762,.340084,365618e-10,0,.936508,.322714,342533e-10,0,.968254,.306974,339596e-10,0,1,1,101524e-23,0,0,1,10292e-22,0,0,1,130908e-23,0,0,1,473331e-23,0,0,1,625319e-22,0,0,1,107932e-20,0,0,1,163779e-19,0,0,1,203198e-18,0,0,1,204717e-17,0,0,.999999,168995e-16,0,0,.999998,1.15855e-10,0,0,.999996,6.6947e-10,0,0,.999991,3.30863e-9,0,0,.999983,1.41737e-8,0,0,.999968,5.32626e-8,0,0,.99994,1.77431e-7,0,0,.999891,5.28835e-7,0,0,.999797,142169e-11,0,0,.999617,347057e-11,0,0,.999227,77231e-10,0,0,.998239,155753e-10,0,0,.994937,268495e-10,0,0,.980225,213742e-10,0,0,.967549,21631e-10,0,0,.966865,417989e-11,0,0,.965739,763341e-11,0,0,.963794,130892e-10,0,0,.960244,206456e-10,0,0,.953495,282016e-10,0,148105e-9,.940876,271581e-10,0,.002454,.926569,164159e-10,0,.00867491,.920905,239521e-10,0,.01956,.912169,315127e-10,0,.035433,.899095,346626e-10,0,.056294,.882209,290223e-10,0,.0818191,.870272,342992e-10,0,.111259,.855977,394164e-10,0,.142857,.837431,372343e-10,0,.174603,.820826,396691e-10,0,.206349,.803408,435395e-10,0,.238095,.782838,419579e-10,0,.269841,.763941,450953e-10,0,.301587,.742904,455847e-10,0,.333333,.721463,458833e-10,0,.365079,.700197,477159e-10,0,.396825,.677501,470641e-10,0,.428571,.655527,484732e-10,0,.460317,.6324,476834e-10,0,.492064,.609964,484213e-10,0,.52381,.586839,475541e-10,0,.555556,.564353,476951e-10,0,.587302,.541589,467611e-10,0,.619048,.519413,463493e-10,0,.650794,.497337,453994e-10,0,.68254,.475797,445308e-10,0,.714286,.454659,435787e-10,0,.746032,.434065,424839e-10,0,.777778,.414018,41436e-9,0,.809524,.39455,401902e-10,0,.84127,.375742,390813e-10,0,.873016,.357501,377116e-10,0,.904762,.339996,36535e-9,0,.936508,.323069,351265e-10,0,.968254,.306897,339112e-10,0,1,1,10396e-19,0,0,1,104326e-20,0,0,1,110153e-20,0,0,1,144668e-20,0,0,1,34528e-19,0,0,1,175958e-19,0,0,1,12627e-17,0,0,1,936074e-18,0,0,1,645742e-17,0,0,.999998,401228e-16,0,0,.999997,2.22338e-10,0,0,.999995,1.0967e-9,0,0,.999991,4.82132e-9,0,0,.999981,1.89434e-8,0,0,.999967,6.67716e-8,0,0,.999938,2.12066e-7,0,0,.999886,6.0977e-7,0,0,.999792,159504e-11,0,0,.999608,381191e-11,0,0,.999209,833727e-11,0,0,.998179,165288e-10,0,0,.994605,274387e-10,0,0,.979468,167316e-10,0,0,.967529,242877e-11,0,0,.966836,461696e-11,0,0,.96569,830977e-11,0,0,.963706,140427e-10,0,244659e-11,.960063,217353e-10,0,760774e-9,.953113,286606e-10,0,.00367261,.940192,247691e-10,0,.00940263,.927731,195814e-10,0,.018333,.920669,252531e-10,0,.0306825,.911799,324277e-10,0,.0465556,.89857,340982e-10,0,.0659521,.883283,319622e-10,0,.0887677,.86989,35548e-9,0,.114784,.855483,397143e-10,0,.143618,.837987,391665e-10,0,.174606,.820546,411306e-10,0,.206349,.802878,436753e-10,0,.238095,.783402,444e-7,0,.269841,.763439,458726e-10,0,.301587,.742925,467097e-10,0,.333333,.721633,478887e-10,0,.365079,.69985,481251e-10,0,.396825,.67783,491811e-10,0,.428571,.655126,488199e-10,0,.460318,.632697,496025e-10,0,.492064,.609613,48829e-9,0,.52381,.587098,492754e-10,0,.555556,.564119,482625e-10,0,.587302,.541813,482807e-10,0,.619048,.519342,471552e-10,0,.650794,.497514,466765e-10,0,.68254,.475879,455582e-10,0,.714286,.454789,446007e-10,0,.746032,.434217,435382e-10,0,.777778,.414086,421753e-10,0,.809524,.394744,412093e-10,0,.84127,.375782,396634e-10,0,.873016,.357707,386419e-10,0,.904762,.340038,370345e-10,0,.936508,.323284,359725e-10,0,.968254,.306954,3436e-8,0,1,1,599567e-19,0,0,1,600497e-19,0,0,1,614839e-19,0,0,1,686641e-19,0,0,1,972658e-19,0,0,1,221271e-18,0,0,1,833195e-18,0,0,1,403601e-17,0,0,.999999,206001e-16,0,0,.999998,1.01739e-10,0,0,.999997,4.70132e-10,0,0,.999993,2.00436e-9,0,0,.999988,7.83682e-9,0,0,.999979,2.80338e-8,0,0,.999962,9.17033e-8,0,0,.999933,2.74514e-7,0,0,.999881,7.53201e-7,0,0,.999783,189826e-11,0,0,.999594,440279e-11,0,0,.999178,93898e-10,0,0,.998073,181265e-10,0,0,.993993,280487e-10,0,0,.979982,149422e-10,0,0,.968145,378481e-11,0,0,.966786,53771e-10,0,0,.965611,947508e-11,0,388934e-10,.963557,156616e-10,0,9693e-7,.959752,235144e-10,0,.00370329,.952461,291568e-10,0,.00868428,.940193,240102e-10,0,.0161889,.929042,231235e-10,0,.0263948,.920266,273968e-10,0,.0394088,.911178,337915e-10,0,.0552818,.897873,333629e-10,0,.0740138,.884053,351405e-10,0,.0955539,.869455,378034e-10,0,.119795,.854655,399378e-10,0,.14656,.838347,419108e-10,0,.175573,.820693,440831e-10,0,.206388,.802277,445599e-10,0,.238095,.783634,472691e-10,0,.269841,.763159,476984e-10,0,.301587,.742914,491487e-10,0,.333333,.721662,502312e-10,0,.365079,.699668,502817e-10,0,.396825,.677839,51406e-9,0,.428571,.655091,511095e-10,0,.460317,.632665,516067e-10,0,.492064,.609734,512255e-10,0,.52381,.587043,510263e-10,0,.555556,.564298,50565e-9,0,.587302,.541769,497951e-10,0,.619048,.519529,492698e-10,0,.650794,.497574,482066e-10,0,.68254,.476028,473689e-10,0,.714286,.454961,461941e-10,0,.746032,.434341,450618e-10,0,.777778,.414364,438355e-10,0,.809524,.394832,424196e-10,0,.84127,.376109,412563e-10,0,.873016,.35779,396226e-10,0,.904762,.340379,384886e-10,0,.936508,.323385,368214e-10,0,.968254,.307295,356636e-10,0,1,1,106465e-17,0,0,1,106555e-17,0,0,1,107966e-17,0,0,1,114601e-17,0,0,1,137123e-17,0,0,1,21243e-16,0,0,.999999,489653e-17,0,0,.999999,160283e-16,0,0,.999998,62269e-15,0,0,.999997,2.51859e-10,0,0,.999996,9.96192e-10,0,0,.999992,3.74531e-9,0,0,.999986,1.32022e-8,0,0,.999975,4.33315e-8,0,0,.999959,1.31956e-7,0,0,.999927,3.72249e-7,0,0,.999871,9.72461e-7,0,0,.999771,235343e-11,0,0,.999572,52768e-10,0,0,.999133,109237e-10,0,0,.997912,203675e-10,0,0,.993008,279396e-10,0,0,.980645,139604e-10,0,0,.970057,646596e-11,0,0,.966717,65089e-10,0,474145e-10,.965497,111863e-10,0,89544e-8,.96334,179857e-10,0,.0032647,.959294,259045e-10,0,.0075144,.951519,292327e-10,0,.0138734,.940517,249769e-10,0,.0224952,.93014,26803e-9,0,.0334828,.91972,303656e-10,0,.0468973,.910294,353323e-10,0,.0627703,.897701,351002e-10,0,.0811019,.884522,388104e-10,0,.10186,.869489,412932e-10,0,.124985,.853983,415781e-10,0,.150372,.838425,454066e-10,0,.177868,.820656,471624e-10,0,.207245,.801875,475243e-10,0,.238143,.783521,505621e-10,0,.269841,.763131,50721e-9,0,.301587,.74261,523293e-10,0,.333333,.72148,528699e-10,0,.365079,.699696,538677e-10,0,.396825,.677592,539255e-10,0,.428571,.65525,546367e-10,0,.460317,.632452,541348e-10,0,.492064,.609903,544976e-10,0,.52381,.586928,536201e-10,0,.555556,.564464,535185e-10,0,.587302,.541801,524949e-10,0,.619048,.519681,51812e-9,0,.650794,.497685,507687e-10,0,.68254,.47622,496243e-10,0,.714286,.455135,485714e-10,0,.746032,.4346,471847e-10,0,.777778,.414564,459294e-10,0,.809524,.395165,444705e-10,0,.84127,.376333,430772e-10,0,.873016,.358197,416229e-10,0,.904762,.34064,401019e-10,0,.936508,.323816,386623e-10,0,.968254,.307581,370933e-10,0,1,1,991541e-17,0,0,1,992077e-17,0,0,1,100041e-16,0,0,1,10385e-15,0,0,1,115777e-16,0,0,1,150215e-16,0,0,.999999,254738e-16,0,0,.999999,598822e-16,0,0,.999998,1.79597e-10,0,0,.999997,6.02367e-10,0,0,.999994,2.06835e-9,0,0,.99999,6.94952e-9,0,0,.999984,2.23363e-8,0,0,.999972,6.78578e-8,0,0,.999952,1.93571e-7,0,0,.999919,5.16594e-7,0,0,.99986,128739e-11,0,0,.999753,299298e-11,0,0,.999546,648258e-11,0,0,.999074,129985e-10,0,0,.997671,232176e-10,0,0,.991504,256701e-10,0,0,.981148,131141e-10,0,0,.971965,869048e-11,0,280182e-10,.966624,808301e-11,0,695475e-9,.965344,135235e-10,0,.00265522,.963048,210592e-10,0,.00622975,.958673,287473e-10,0,.0116234,.950262,281379e-10,0,.018976,.940836,271089e-10,0,.0283844,.930996,30926e-9,0,.0399151,.919848,348359e-10,0,.0536063,.909136,366092e-10,0,.0694793,.897554,384162e-10,0,.0875342,.884691,430971e-10,0,.107749,.869414,447803e-10,0,.130087,.853462,452858e-10,0,.154481,.838187,495769e-10,0,.180833,.820381,502709e-10,0,.209005,.801844,522713e-10,0,.238791,.783061,541505e-10,0,.269869,.763205,553712e-10,0,.301587,.742362,564909e-10,0,.333333,.721393,572646e-10,0,.365079,.699676,581012e-10,0,.396825,.677395,58096e-9,0,.428571,.655208,585766e-10,0,.460317,.632451,583602e-10,0,.492064,.609839,580234e-10,0,.52381,.587093,577161e-10,0,.555556,.564467,568447e-10,0,.587302,.542043,563166e-10,0,.619048,.519826,55156e-9,0,.650794,.497952,541682e-10,0,.68254,.476477,528971e-10,0,.714286,.455412,514952e-10,0,.746032,.434926,502222e-10,0,.777778,.4149,485779e-10,0,.809524,.395552,472242e-10,0,.84127,.376712,454891e-10,0,.873016,.358622,440924e-10,0,.904762,.341048,422984e-10,0,.936508,.324262,408582e-10,0,.968254,.308013,390839e-10,0,1,1,613913e-16,0,0,1,614145e-16,0,0,1,617708e-16,0,0,1,633717e-16,0,0,1,681648e-16,0,0,1,808291e-16,0,0,1,1.14608e-10,0,0,.999998,2.10507e-10,0,0,.999997,4.99595e-10,0,0,.999995,1.39897e-9,0,0,.999994,4.19818e-9,0,0,.999988,1.27042e-8,0,0,.999979,3.75153e-8,0,0,.999965,1.06206e-7,0,0,.999945,2.85381e-7,0,0,.999908,7.23611e-7,0,0,.999846,17255e-10,0,0,.999733,386104e-11,0,0,.999511,808493e-11,0,0,.998993,156884e-10,0,0,.997326,265538e-10,0,0,.989706,206466e-10,0,0,.981713,130756e-10,0,70005e-10,.973636,106473e-10,0,464797e-9,.966509,10194e-9,0,.00201743,.965149,165881e-10,0,.00497549,.962669,249147e-10,0,.00953262,.95786,317449e-10,0,.0158211,.949334,281045e-10,0,.0239343,.941041,303263e-10,0,.0339372,.931575,356754e-10,0,.0458738,.920102,397075e-10,0,.059772,.908002,384886e-10,0,.075645,.897269,43027e-9,0,.0934929,.884559,479925e-10,0,.113302,.869161,48246e-9,0,.135045,.853342,509505e-10,0,.158678,.837633,542846e-10,0,.184136,.820252,554139e-10,0,.211325,.801872,581412e-10,0,.240113,.782418,585535e-10,0,.270306,.7631,610923e-10,0,.301594,.742183,613678e-10,0,.333333,.721098,627275e-10,0,.365079,.699512,629413e-10,0,.396825,.677372,636351e-10,0,.428571,.655059,633555e-10,0,.460317,.632567,636513e-10,0,.492064,.609784,628965e-10,0,.52381,.587237,625546e-10,0,.555556,.564525,615825e-10,0,.587302,.542181,605048e-10,0,.619048,.520017,596329e-10,0,.650794,.498204,581516e-10,0,.68254,.476742,569186e-10,0,.714286,.455803,553833e-10,0,.746032,.435251,537807e-10,0,.777778,.415374,522025e-10,0,.809524,.395921,503421e-10,0,.84127,.377253,488211e-10,0,.873016,.359021,468234e-10,0,.904762,.341637,453269e-10,0,.936508,.3247,433014e-10,0,.968254,.308625,418007e-10,0,1,1,2.86798e-10,0,0,1,2.86877e-10,0,0,1,2.88094e-10,0,0,1,2.93506e-10,0,0,1,3.09262e-10,0,0,.999999,3.48593e-10,0,0,.999999,4.44582e-10,0,0,.999998,6.88591e-10,0,0,.999996,1.34391e-9,0,0,.999993,3.17438e-9,0,0,.999989,8.35609e-9,0,0,.999983,2.28677e-8,0,0,.999974,6.23361e-8,0,0,.999959,1.65225e-7,0,0,.999936,4.19983e-7,0,0,.999896,101546e-11,0,0,.99983,232376e-11,0,0,.999709,50156e-10,0,0,.999469,10167e-9,0,0,.998886,190775e-10,0,0,.996819,300511e-10,0,0,.988837,185092e-10,0,1.68222e-7,.982178,134622e-10,0,259622e-9,.975017,125961e-10,0,.00142595,.967101,13507e-9,0,.00382273,.964905,205003e-10,0,.00764164,.96218,29546e-9,0,.0130121,.956821,343738e-10,0,.0200253,.948829,305063e-10,0,.0287452,.941092,346487e-10,0,.039218,.931883,412061e-10,0,.0514748,.920211,444651e-10,0,.0655351,.907307,431252e-10,0,.0814082,.89684,490382e-10,0,.0990939,.884119,53334e-9,0,.118583,.869148,54114e-9,0,.139856,.853377,578536e-10,0,.162882,.836753,592285e-10,0,.187615,.820063,622787e-10,0,.213991,.801694,645492e-10,0,.241918,.782116,65353e-9,0,.271267,.762673,674344e-10,0,.301847,.742133,682788e-10,0,.333333,.720779,691959e-10,0,.365079,.699386,696817e-10,0,.396826,.67732,699583e-10,0,.428572,.654888,698447e-10,0,.460318,.632499,694063e-10,0,.492064,.609825,691612e-10,0,.52381,.587287,681576e-10,0,.555556,.564743,674138e-10,0,.587302,.542409,661617e-10,0,.619048,.520282,647785e-10,0,.650794,.498506,633836e-10,0,.68254,.477102,615905e-10,0,.714286,.456167,601013e-10,0,.746032,.435728,581457e-10,0,.777778,.415809,564215e-10,0,.809524,.396517,544997e-10,0,.84127,.377737,525061e-10,0,.873016,.359698,506831e-10,0,.904762,.342164,48568e-9,0,.936508,.325417,467826e-10,0,.968254,.309186,446736e-10,0,1,1,1.09018e-9,0,0,1,1.0904e-9,0,0,1,1.09393e-9,0,0,1,1.1095e-9,0,0,1,1.154e-9,0,0,1,1.26089e-9,0,0,.999999,1.5059e-9,0,0,.999997,2.07899e-9,0,0,.999994,3.48164e-9,0,0,.999993,7.05728e-9,0,0,.999987,1.63692e-8,0,0,.999981,4.06033e-8,0,0,.999969,1.0245e-7,0,0,.999953,2.55023e-7,0,0,.999925,6.1511e-7,0,0,.999881,142218e-11,0,0,.99981,313086e-11,0,0,.99968,653119e-11,0,0,.999418,12832e-9,0,0,.998748,232497e-10,0,0,.996066,329522e-10,0,0,.988379,179613e-10,0,108799e-9,.982567,143715e-10,0,921302e-9,.976097,148096e-10,0,.00280738,.968475,178905e-10,0,.00596622,.964606,253921e-10,0,.0105284,.961564,348623e-10,0,.0165848,.955517,357612e-10,0,.0242,.948381,343493e-10,0,.03342,.941095,405849e-10,0,.0442777,.931923,475394e-10,0,.0567958,.91996,484328e-10,0,.0709879,.907419,502146e-10,0,.086861,.89618,561654e-10,0,.104415,.88337,587612e-10,0,.123643,.869046,618057e-10,0,.144531,.853278,657392e-10,0,.167057,.836091,66303e-9,0,.191188,.819644,704445e-10,0,.216878,.801246,714071e-10,0,.244062,.782031,740093e-10,0,.272649,.762066,74685e-9,0,.302509,.741964,766647e-10,0,.333442,.720554,766328e-10,0,.365079,.699098,777857e-10,0,.396826,.677189,774633e-10,0,.428572,.65484,776235e-10,0,.460318,.632496,770316e-10,0,.492064,.609908,762669e-10,0,.52381,.587312,753972e-10,0,.555556,.564938,739994e-10,0,.587302,.542577,728382e-10,0,.619048,.52062,71112e-9,0,.650794,.498819,694004e-10,0,.68254,.477555,675575e-10,0,.714286,.456568,653449e-10,0,.746032,.436278,636068e-10,0,.777778,.41637,613466e-10,0,.809524,.397144,594177e-10,0,.84127,.378412,570987e-10,0,.873016,.360376,550419e-10,0,.904762,.342906,527422e-10,0,.936508,.326136,506544e-10,0,.968254,.30997,484307e-10,0,1,1,3.54014e-9,0,0,1,3.54073e-9,0,0,1,3.54972e-9,0,0,1,3.58929e-9,0,0,1,3.70093e-9,0,0,.999999,3.96194e-9,0,0,.999998,4.53352e-9,0,0,.999997,5.78828e-9,0,0,.999994,8.63812e-9,0,0,.999991,1.53622e-8,0,0,.999985,3.16356e-8,0,0,.999977,7.12781e-8,0,0,.999964,1.66725e-7,0,0,.999945,3.90501e-7,0,0,.999912,8.95622e-7,0,0,.999866,198428e-11,0,0,.999786,421038e-11,0,0,.999647,850239e-11,0,0,.999356,162059e-10,0,0,.998563,282652e-10,0,0,.994928,336309e-10,0,244244e-10,.987999,178458e-10,0,523891e-9,.982893,159162e-10,0,.00194729,.977044,178056e-10,0,.00451099,.969972,230624e-10,0,.00835132,.964237,313922e-10,0,.013561,.960791,406145e-10,0,.0202056,.954292,372796e-10,0,.0283321,.948052,403199e-10,0,.0379739,.940938,479537e-10,0,.0491551,.931689,545292e-10,0,.0618918,.91987,54038e-9,0,.0761941,.907665,589909e-10,0,.0920672,.895281,642651e-10,0,.109511,.882621,659707e-10,0,.12852,.86873,709973e-10,0,.149085,.853008,742221e-10,0,.171189,.835944,761754e-10,0,.194809,.818949,797052e-10,0,.21991,.800951,812434e-10,0,.246447,.781847,838075e-10,0,.274352,.761649,84501e-9,0,.303535,.74152,860258e-10,0,.333857,.720495,866233e-10,0,.365104,.698742,868326e-10,0,.396826,.677096,87133e-9,0,.428572,.654782,863497e-10,0,.460318,.632335,860206e-10,0,.492064,.610031,849337e-10,0,.52381,.587457,838279e-10,0,.555556,.56513,82309e-9,0,.587302,.542877,803542e-10,0,.619048,.5209,786928e-10,0,.650794,.499291,765171e-10,0,.68254,.477971,744753e-10,0,.714286,.457221,72209e-9,0,.746032,.436803,697448e-10,0,.777778,.417083,675333e-10,0,.809524,.397749,648058e-10,0,.84127,.379177,625759e-10,0,.873016,.361061,598584e-10,0,.904762,.343713,575797e-10,0,.936508,.326894,549999e-10,0,.968254,.310816,527482e-10,0,1,1,1.0153e-8,0,0,1,1.01544e-8,0,0,1,1.01751e-8,0,0,1,1.02662e-8,0,0,1,1.0521e-8,0,0,.999999,1.11049e-8,0,0,.999999,1.23408e-8,0,0,.999996,1.4924e-8,0,0,.999992,2.04471e-8,0,0,.999989,3.26539e-8,0,0,.99998,6.03559e-8,0,0,.999971,1.23936e-7,0,0,.999955,2.69058e-7,0,0,.999933,5.93604e-7,0,0,.999901,129633e-11,0,0,.999847,275621e-11,0,0,.999761,564494e-11,0,0,.999607,110485e-10,0,0,.999282,204388e-10,0,0,.99831,341084e-10,0,2.2038e-7,.993288,294949e-10,0,242388e-9,.987855,192736e-10,0,.0012503,.983167,182383e-10,0,.0032745,.977908,218633e-10,0,.00646321,.971194,290662e-10,0,.0109133,.963867,386401e-10,0,.0166927,.95982,462827e-10,0,.0238494,.953497,420705e-10,0,.0324178,.947621,477743e-10,0,.0424225,.940611,568258e-10,0,.0538808,.931174,618061e-10,0,.0668047,.919919,627098e-10,0,.0812014,.907856,694714e-10,0,.0970745,.894509,735008e-10,0,.114424,.881954,763369e-10,0,.133246,.868309,821896e-10,0,.153534,.852511,83769e-9,0,.175275,.835821,881615e-10,0,.198453,.817981,896368e-10,0,.223042,.800504,930906e-10,0,.249009,.78141,945056e-10,0,.276304,.761427,963605e-10,0,.304862,.74094,968088e-10,0,.334584,.720233,981481e-10,0,.365322,.698592,979122e-10,0,.396826,.676763,981057e-10,0,.428571,.654808,973956e-10,0,.460318,.632326,962619e-10,0,.492064,.610049,952996e-10,0,.52381,.58763,933334e-10,0,.555556,.565261,917573e-10,0,.587302,.543244,896636e-10,0,.619048,.521273,873304e-10,0,.650794,.499818,852648e-10,0,.68254,.478536,823961e-10,0,.714286,.457826,79939e-9,0,.746032,.437549,77126e-9,0,.777778,.41776,743043e-10,0,.809524,.39863,716426e-10,0,.84127,.379954,686456e-10,0,.873016,.362025,660514e-10,0,.904762,.344581,630755e-10,0,.936508,.327909,605439e-10,0,.968254,.311736,576345e-10,0,1,1,2.63344e-8,0,0,1,2.63373e-8,0,0,1,2.63815e-8,0,0,1,2.65753e-8,0,0,1,2.71132e-8,0,0,.999999,2.83279e-8,0,0,.999997,3.0833e-8,0,0,.999995,3.58711e-8,0,0,.999992,4.61266e-8,0,0,.999985,6.7574e-8,0,0,.999977,1.1358e-7,0,0,.999966,2.13657e-7,0,0,.999948,4.31151e-7,0,0,.999923,8.96656e-7,0,0,.999884,186603e-11,0,0,.999826,381115e-11,0,0,.999732,754184e-11,0,0,.999561,143192e-10,0,0,.999191,257061e-10,0,0,.997955,405724e-10,0,744132e-10,.992228,276537e-10,0,716477e-9,.987638,208885e-10,0,.0022524,.983395,215226e-10,0,.00484816,.978614,270795e-10,0,.00860962,.972389,365282e-10,0,.0136083,.964392,474747e-10,0,.0198941,.95861,509141e-10,0,.0275023,.952806,48963e-9,0,.0364584,.94712,571119e-10,0,.04678,.940104,671704e-10,0,.0584799,.930398,687586e-10,0,.0715665,.919866,738161e-10,0,.086045,.907853,813235e-10,0,.101918,.894078,834582e-10,0,.119186,.881177,892093e-10,0,.137845,.867575,944548e-10,0,.157891,.852107,969607e-10,0,.179316,.835502,101456e-9,0,.202106,.81756,103256e-9,0,.226243,.79984,106954e-9,0,.251704,.780998,108066e-9,0,.278451,.761132,110111e-9,0,.306436,.740429,110459e-9,0,.335586,.719836,111219e-9,0,.365796,.698467,11145e-8,0,.3969,.676446,110393e-9,0,.428571,.654635,110035e-9,0,.460318,.632411,108548e-9,0,.492064,.609986,106963e-9,0,.52381,.587872,105238e-9,0,.555556,.565528,102665e-9,0,.587302,.543563,100543e-9,0,.619048,.52176,976182e-10,0,.650794,.500188,947099e-10,0,.68254,.479204,919929e-10,0,.714286,.458413,886139e-10,0,.746032,.438314,857839e-10,0,.777778,.418573,82411e-9,0,.809524,.39947,792211e-10,0,.84127,.380892,759546e-10,0,.873016,.362953,727571e-10,0,.904762,.345601,695738e-10,0,.936508,.328895,664907e-10,0,.968254,.312808,634277e-10,0,1,1,6.28647e-8,0,0,1,6.28705e-8,0,0,1,6.29587e-8,0,0,1,6.33441e-8,0,0,.999999,6.44087e-8,0,0,.999998,6.67856e-8,0,0,.999997,7.15889e-8,0,0,.999995,8.09577e-8,0,0,.999989,9.92764e-8,0,0,.999983,1.35834e-7,0,0,.999974,2.10482e-7,0,0,.999959,3.65215e-7,0,0,.999939,6.86693e-7,0,0,.999911,13472e-10,0,0,.999868,26731e-10,0,0,.999804,524756e-11,0,0,.9997,100403e-10,0,0,.99951,185019e-10,0,0,.999078,322036e-10,0,620676e-11,.997428,470002e-10,0,341552e-9,.99162,287123e-10,0,.00143727,.987479,234706e-10,0,.00349201,.983582,260083e-10,0,.0066242,.979186,337927e-10,0,.0109113,.97325,454689e-10,0,.0164064,.965221,573759e-10,0,.0231463,.957262,544114e-10,0,.0311571,.952211,587006e-10,0,.0404572,.946631,692256e-10,0,.0510592,.939391,787819e-10,0,.0629723,.929795,792368e-10,0,.0762025,.91965,875075e-10,0,.090753,.907737,950903e-10,0,.106626,.893899,972963e-10,0,.123822,.880239,10459e-8,0,.142337,.866562,107689e-9,0,.16217,.85164,113081e-9,0,.183314,.835021,116636e-9,0,.20576,.817311,120074e-9,0,.229496,.798845,121921e-9,0,.254502,.780479,12475e-8,0,.280753,.760694,125255e-9,0,.308212,.740142,126719e-9,0,.336825,.719248,12636e-8,0,.366517,.698209,126712e-9,0,.397167,.676398,125769e-9,0,.428578,.654378,124432e-9,0,.460318,.632484,123272e-9,0,.492064,.610113,12085e-8,0,.52381,.587931,118411e-9,0,.555556,.565872,11569e-8,0,.587302,.543814,112521e-9,0,.619048,.522265,109737e-9,0,.650794,.500835,106228e-9,0,.68254,.479818,102591e-9,0,.714286,.459258,991288e-10,0,.746032,.439061,952325e-10,0,.777778,.419552,91895e-9,0,.809524,.400399,879051e-10,0,.84127,.381976,844775e-10,0,.873016,.364009,806316e-10,0,.904762,.346761,771848e-10,0,.936508,.330049,735429e-10,0,.968254,.314018,702103e-10,0,1,1,1.39968e-7,0,0,1,1.39979e-7,0,0,1,1.40145e-7,0,0,1,1.4087e-7,0,0,.999999,1.42865e-7,0,0,.999998,1.47279e-7,0,0,.999997,1.56057e-7,0,0,.999992,1.7276e-7,0,0,.999989,2.04352e-7,0,0,.99998,2.6494e-7,0,0,.999969,3.83435e-7,0,0,.999953,6.18641e-7,0,0,.999929,108755e-11,0,0,.999898,201497e-11,0,0,.999849,381346e-11,0,0,.999778,719815e-11,0,0,.999661,133215e-10,0,0,.999451,238313e-10,0,0,.998936,401343e-10,0,113724e-9,.99662,517346e-10,0,820171e-9,.991094,304323e-10,0,.00238143,.987487,281757e-10,0,.00493527,.983731,320048e-10,0,.00856859,.979647,423905e-10,0,.0133393,.973837,562935e-10,0,.0192863,.96584,677442e-10,0,.0264369,.956309,623073e-10,0,.03481,.951523,704131e-10,0,.0444184,.946003,836594e-10,0,.0552713,.938454,911736e-10,0,.0673749,.929279,938264e-10,0,.0807329,.919239,103754e-9,0,.0953479,.907293,109928e-9,0,.111221,.893936,115257e-9,0,.128352,.879674,122265e-9,0,.14674,.865668,125733e-9,0,.166382,.850998,132305e-9,0,.187276,.834498,134844e-9,0,.209413,.816903,139276e-9,0,.232786,.798235,140984e-9,0,.257382,.779724,14378e-8,0,.283181,.760251,144623e-9,0,.310156,.739808,145228e-9,0,.338269,.718762,14539e-8,0,.367461,.697815,144432e-9,0,.397646,.67631,143893e-9,0,.428685,.654278,141846e-9,0,.460318,.632347,13935e-8,0,.492064,.610296,137138e-9,0,.52381,.588039,133806e-9,0,.555556,.566218,130755e-9,0,.587302,.544346,127128e-9,0,.619048,.522701,123002e-9,0,.650794,.501542,119443e-9,0,.68254,.480508,115055e-9,0,.714286,.460092,111032e-9,0,.746032,.440021,106635e-9,0,.777778,.420446,102162e-9,0,.809524,.401512,98184e-9,0,.84127,.38299,936497e-10,0,.873016,.365232,89813e-9,0,.904762,.347865,853073e-10,0,.936508,.331342,817068e-10,0,.968254,.315202,773818e-10,0,1,1,2.9368e-7,0,0,1,2.937e-7,0,0,1,2.93998e-7,0,0,1,2.95298e-7,0,0,.999999,2.98865e-7,0,0,.999998,3.067e-7,0,0,.999995,3.22082e-7,0,0,.999992,3.50767e-7,0,0,.999986,4.03538e-7,0,0,.999976,5.01372e-7,0,0,.999964,6.8562e-7,0,0,.999945,10374e-10,0,0,.999919,171269e-11,0,0,.999882,300175e-11,0,0,.999829,542144e-11,0,0,.999749,984182e-11,0,0,.99962,176213e-10,0,0,.999382,305995e-10,0,138418e-10,.998751,496686e-10,0,389844e-9,.995344,510733e-10,0,.00150343,.990768,345829e-10,0,.00352451,.987464,342841e-10,0,.00655379,.983846,399072e-10,0,.0106554,.980007,533219e-10,0,.0158723,.974494,696992e-10,0,.0222333,.96622,776754e-10,0,.029758,.956273,747718e-10,0,.0384596,.950952,864611e-10,0,.0483473,.945215,100464e-9,0,.0594266,.937287,103729e-9,0,.0717019,.928649,111665e-9,0,.0851752,.918791,12353e-8,0,.0998479,.906685,127115e-9,0,.115721,.893706,13628e-8,0,.132794,.879248,142427e-9,0,.151067,.864685,148091e-9,0,.170538,.850032,153517e-9,0,.191204,.833853,157322e-9,0,.213063,.816353,161086e-9,0,.236107,.797834,164111e-9,0,.260329,.778831,165446e-9,0,.285714,.759756,167492e-9,0,.312243,.739419,166928e-9,0,.339887,.718491,167e-6,0,.368604,.697392,165674e-9,0,.398329,.676102,163815e-9,0,.428961,.654243,162003e-9,0,.460331,.632176,158831e-9,0,.492064,.610407,155463e-9,0,.52381,.588394,152062e-9,0,.555556,.56645,147665e-9,0,.587302,.5449,14375e-8,0,.619048,.523276,138905e-9,0,.650794,.502179,134189e-9,0,.68254,.481359,129392e-9,0,.714286,.46092,124556e-9,0,.746032,.441084,11957e-8,0,.777778,.421517,114652e-9,0,.809524,.402721,109688e-9,0,.84127,.384222,104667e-9,0,.873016,.366534,999633e-10,0,.904762,.349205,950177e-10,0,.936508,.332702,907301e-10,0,.968254,.316599,859769e-10,0,1,1,5.85473e-7,0,0,1,5.85507e-7,0,0,1,5.8602e-7,0,0,.999999,5.88259e-7,0,0,.999999,5.94381e-7,0,0,.999998,6.07754e-7,0,0,.999995,6.33729e-7,0,0,.99999,6.8137e-7,0,0,.999984,7.67003e-7,0,0,.999973,9.21212e-7,0,0,.999959,120218e-11,0,0,.999936,172024e-11,0,0,.999907,268088e-11,0,0,.999866,445512e-11,0,0,.999806,768481e-11,0,0,.999716,1342e-8,0,0,.999576,232473e-10,0,0,.9993,391694e-10,0,129917e-9,.998498,608429e-10,0,845035e-9,.994132,489743e-10,0,.00237616,.99031,384644e-10,0,.00484456,.987409,421768e-10,0,.00832472,.983981,504854e-10,0,.0128643,.980268,671028e-10,0,.0184947,.974875,852749e-10,0,.025237,.966063,85531e-9,0,.0331046,.956779,900588e-10,0,.0421067,.950259,10577e-8,0,.0522487,.944239,119458e-9,0,.0635343,.936341,122164e-9,0,.0759654,.928047,134929e-9,0,.0895434,.918065,145544e-9,0,.104269,.906267,150531e-9,0,.120142,.893419,161652e-9,0,.137163,.878758,16593e-8,0,.15533,.863699,174014e-9,0,.174645,.848876,177877e-9,0,.195106,.833032,184049e-9,0,.21671,.815557,186088e-9,0,.239454,.797323,19054e-8,0,.263332,.778124,191765e-9,0,.288336,.758929,192535e-9,0,.314451,.738979,192688e-9,0,.341658,.718213,191522e-9,0,.369924,.696947,190491e-9,0,.399202,.675807,187913e-9,0,.429416,.654147,184451e-9,0,.460447,.63229,181442e-9,0,.492064,.610499,177139e-9,0,.523809,.588747,172596e-9,0,.555555,.566783,167457e-9,0,.587301,.545359,162518e-9,0,.619048,.523984,156818e-9,0,.650794,.502917,151884e-9,0,.68254,.482294,145514e-9,0,.714286,.461945,140199e-9,0,.746032,.442133,134101e-9,0,.777778,.422705,128374e-9,0,.809524,.403916,122996e-9,0,.84127,.38554,116808e-9,0,.873016,.367909,111973e-9,0,.904762,.350651,105938e-9,0,.936508,.334208,101355e-9,0,.968254,.318123,957629e-10,0,1,1,111633e-11,0,0,1,111639e-11,0,0,1,111725e-11,0,0,1,112096e-11,0,0,.999999,11311e-10,0,0,.999997,115315e-11,0,0,.999995,11956e-10,0,0,.999989,127239e-11,0,0,.999981,140772e-11,0,0,.999969,164541e-11,0,0,.999952,206607e-11,0,0,.999928,281783e-11,0,0,.999895,416835e-11,0,0,.999848,658728e-11,0,0,.999781,108648e-10,0,0,.999682,182579e-10,0,0,.999523,306003e-10,0,159122e-10,.999205,499862e-10,0,391184e-9,.998131,73306e-9,0,.00147534,.993334,513229e-10,0,.0034227,.99016,467783e-10,0,.00632232,.987321,523413e-10,0,.0102295,.984099,64267e-9,0,.0151794,.980432,843042e-10,0,.0211947,.974976,102819e-9,0,.0282899,.966429,996234e-10,0,.0364739,.957633,111074e-9,0,.0457522,.949422,128644e-9,0,.0561278,.943045,140076e-9,0,.0676023,.935448,146349e-9,0,.0801762,.927225,161854e-9,0,.0938499,.917033,169135e-9,0,.108623,.905762,179987e-9,0,.124496,.892879,189832e-9,0,.141469,.878435,195881e-9,0,.159541,.863114,20466e-8,0,.178713,.84776,209473e-9,0,.198985,.832084,214861e-9,0,.220355,.814915,217695e-9,0,.242823,.796711,220313e-9,0,.266385,.777603,22313e-8,0,.291036,.757991,222471e-9,0,.316767,.738371,222869e-9,0,.343563,.717872,221243e-9,0,.371402,.696619,218089e-9,0,.400248,.675379,21562e-8,0,.430047,.65411,21169e-8,0,.460709,.63241,206947e-9,0,.492079,.61046,201709e-9,0,.52381,.58903,196753e-9,0,.555556,.567267,189637e-9,0,.587302,.545886,184735e-9,0,.619048,.524714,177257e-9,0,.650794,.503789,171424e-9,0,.68254,.483204,164688e-9,0,.714286,.462976,157172e-9,0,.746032,.443294,151341e-9,0,.777778,.423988,143737e-9,0,.809524,.405325,138098e-9,0,.84127,.386981,130698e-9,0,.873016,.369436,125276e-9,0,.904762,.35219,118349e-9,0,.936508,.335804,11312e-8,0,.968254,.319749,106687e-9,0,1,1,204685e-11,0,0,1,204694e-11,0,0,1,204831e-11,0,0,.999999,205428e-11,0,0,.999999,207056e-11,0,0,.999997,210581e-11,0,0,.999993,21732e-10,0,0,.999987,229365e-11,0,0,.999979,250243e-11,0,0,.999965,286127e-11,0,0,.999947,348028e-11,0,0,.999918,455588e-11,0,0,.999881,643303e-11,0,0,.999828,970064e-11,0,0,.999753,153233e-10,0,0,.999642,24793e-9,0,0,.999464,402032e-10,0,122947e-9,.999089,635852e-10,0,807414e-9,.997567,857026e-10,0,.00227206,.992903,594912e-10,0,.00462812,.990011,578515e-10,0,.00794162,.987192,65399e-9,0,.0122534,.98418,819675e-10,0,.0175888,.980491,105514e-9,0,.0239635,.974779,121532e-9,0,.031387,.96675,119144e-9,0,.0398644,.958248,136125e-9,0,.0493982,.948884,155408e-9,0,.0599896,.941673,162281e-9,0,.0716382,.934521,176754e-9,0,.0843437,.926205,192873e-9,0,.0981056,.916089,200038e-9,0,.112923,.904963,213624e-9,0,.128796,.892089,221834e-9,0,.145725,.878028,232619e-9,0,.163709,.86249,238632e-9,0,.182749,.846587,247002e-9,0,.202847,.830988,250702e-9,0,.224001,.814165,255562e-9,0,.246214,.796135,257505e-9,0,.269482,.777052,258625e-9,0,.293805,.757201,258398e-9,0,.319176,.737655,256714e-9,0,.345587,.717477,255187e-9,0,.373021,.696433,251792e-9,0,.401454,.675084,247223e-9,0,.430844,.653907,242213e-9,0,.461125,.632561,237397e-9,0,.492187,.610658,229313e-9,0,.52381,.589322,224402e-9,0,.555556,.567857,216116e-9,0,.587302,.54652,209124e-9,0,.619048,.525433,201601e-9,0,.650794,.504679,192957e-9,0,.68254,.484203,186052e-9,0,.714286,.464203,177672e-9,0,.746032,.444549,170005e-9,0,.777778,.425346,162401e-9,0,.809524,.406706,1544e-7,0,.84127,.388576,147437e-9,0,.873016,.37094,139493e-9,0,.904762,.353996,133219e-9,0,.936508,.337391,125573e-9,0,.968254,.321648,119867e-9,0,1,1,362511e-11,0,0,1,362525e-11,0,0,1,362739e-11,0,0,.999999,363673e-11,0,0,.999998,366214e-11,0,0,.999996,371698e-11,0,0,.999992,382116e-11,0,0,.999986,400554e-11,0,0,.999976,432058e-11,0,0,.999961,485194e-11,0,0,.999938,574808e-11,0,0,.999908,726643e-11,0,0,.999865,984707e-11,0,0,.999807,142217e-10,0,0,.999723,215581e-10,0,0,.999602,336114e-10,0,119113e-10,.999398,527353e-10,0,355813e-9,.998946,805809e-10,0,.00137768,.996647,942908e-10,0,.00322469,.992298,668733e-10,0,.00597897,.989802,716564e-10,0,.00968903,.987019,821355e-10,0,.0143845,.984219,104555e-9,0,.0200831,.980425,131245e-9,0,.0267948,.974241,139613e-9,0,.034525,.967006,145931e-9,0,.0432757,.95893,167153e-9,0,.0530471,.949157,188146e-9,0,.0638386,.94062,194625e-9,0,.0756487,.933509,213721e-9,0,.0884762,.925088,229616e-9,0,.10232,.915178,239638e-9,0,.117178,.904093,254814e-9,0,.133051,.891337,263685e-9,0,.149939,.877326,274789e-9,0,.167841,.861794,280534e-9,0,.18676,.845758,289534e-9,0,.206696,.829792,294446e-9,0,.22765,.813037,296877e-9,0,.249625,.795285,300217e-9,0,.27262,.776323,299826e-9,0,.296636,.756673,299787e-9,0,.321671,.736856,297867e-9,0,.347718,.716883,294052e-9,0,.374768,.696089,289462e-9,0,.402804,.67505,285212e-9,0,.431796,.653509,27653e-8,0,.461695,.63258,271759e-9,0,.49242,.61104,262811e-9,0,.523822,.589567,255151e-9,0,.555556,.568322,246434e-9,0,.587302,.547235,237061e-9,0,.619048,.52616,228343e-9,0,.650794,.505716,219236e-9,0,.68254,.485274,209595e-9,0,.714286,.465411,201011e-9,0,.746032,.445854,19109e-8,0,.777778,.426911,182897e-9,0,.809524,.408222,173569e-9,0,.84127,.390307,165496e-9,0,.873016,.372624,156799e-9,0,.904762,.355804,14917e-8,0,.936508,.33924,140907e-9,0,.968254,.323534,134062e-9,0,1,1,622487e-11,0,0,1,62251e-10,0,0,1,622837e-11,0,0,.999999,624259e-11,0,0,.999998,628127e-11,0,0,.999996,636451e-11,0,0,.999991,65218e-10,0,0,.999984,679782e-11,0,0,.999973,726361e-11,0,0,.999955,803644e-11,0,0,.999931,931397e-11,0,0,.999896,114299e-10,0,0,.999847,149402e-10,0,0,.999784,207461e-10,0,0,.999692,302493e-10,0,0,.999554,454957e-10,0,997275e-10,.999326,690762e-10,0,724813e-9,.998757,101605e-9,0,.0020972,.995367,958745e-10,0,.00432324,.99209,832808e-10,0,.00746347,.989517,887601e-10,0,.0115534,.987008,10564e-8,0,.0166134,.98421,133179e-9,0,.0226552,.98021,161746e-9,0,.0296838,.973676,161821e-9,0,.0377016,.967052,178635e-9,0,.0467079,.959385,206765e-9,0,.0567013,.949461,22476e-8,0,.0676796,.939578,23574e-8,0,.0796403,.932416,25893e-8,0,.0925812,.923759,271228e-9,0,.106501,.914223,289165e-9,0,.121397,.902942,301156e-9,0,.13727,.890419,313852e-9,0,.15412,.876639,324408e-9,0,.171946,.861316,33249e-8,0,.190751,.84496,338497e-9,0,.210537,.828427,345861e-9,0,.231305,.811871,347863e-9,0,.253057,.794397,350225e-9,0,.275797,.775726,349915e-9,0,.299525,.75617,347297e-9,0,.324242,.736091,344232e-9,0,.349947,.716213,340835e-9,0,.376633,.695736,332369e-9,0,.404289,.674961,327943e-9,0,.432895,.653518,318533e-9,0,.462415,.632574,310391e-9,0,.492788,.61134,300755e-9,0,.523909,.590017,290506e-9,0,.555556,.568752,280446e-9,0,.587302,.548061,269902e-9,0,.619048,.52711,258815e-9,0,.650794,.506682,248481e-9,0,.68254,.486524,237141e-9,0,.714286,.466812,226872e-9,0,.746032,.44732,216037e-9,0,.777778,.428473,205629e-9,0,.809524,.409921,195691e-9,0,.84127,.392028,185457e-9,0,.873016,.374606,176436e-9,0,.904762,.357601,166508e-9,0,.936508,.341348,158385e-9,0,.968254,.32542,149203e-9,0,1,1,103967e-10,0,0,1,10397e-9,0,0,1,104019e-10,0,0,.999999,104231e-10,0,0,.999998,104806e-10,0,0,.999995,106042e-10,0,0,.999991,108366e-10,0,0,.999982,112415e-10,0,0,.999968,119174e-10,0,0,.99995,130227e-10,0,0,.999922,148176e-10,0,0,.999884,177303e-10,0,0,.99983,224564e-10,0,0,.999758,300966e-10,0,0,.999654,423193e-10,0,549083e-11,.999503,614848e-10,0,296087e-9,.999237,903576e-10,0,.00123144,.998491,1271e-7,0,.00295954,.994594,107754e-9,0,.00555829,.99178,103025e-9,0,.00907209,.989265,11154e-8,0,.0135257,.986998,136296e-9,0,.0189327,.984137,169154e-9,0,.0252993,.979798,196671e-9,0,.0326272,.97337,196678e-9,0,.0409157,.967239,223121e-9,0,.0501623,.959543,253809e-9,0,.0603638,.949466,265972e-9,0,.0715171,.939074,288372e-9,0,.0836187,.931118,310983e-9,0,.0966657,.922525,325561e-9,0,.110656,.912983,345725e-9,0,.125588,.901617,3556e-7,0,.141461,.889487,374012e-9,0,.158275,.875787,383445e-9,0,.176031,.860654,393972e-9,0,.19473,.844417,400311e-9,0,.214374,.82741,405004e-9,0,.234967,.810545,407378e-9,0,.256512,.793312,407351e-9,0,.279011,.774847,406563e-9,0,.302468,.755621,404903e-9,0,.326887,.735511,397486e-9,0,.352266,.715435,39357e-8,0,.378605,.695403,384739e-9,0,.405897,.674681,376108e-9,0,.43413,.65359,365997e-9,0,.463277,.632471,354957e-9,0,.493295,.61151,343593e-9,0,.524106,.59064,331841e-9,0,.555561,.569386,318891e-9,0,.587302,.548785,3072e-7,0,.619048,.528146,29361e-8,0,.650794,.507872,281709e-9,0,.68254,.487805,268627e-9,0,.714286,.468196,255887e-9,0,.746032,.448922,243997e-9,0,.777778,.430093,231662e-9,0,.809524,.411845,220339e-9,0,.84127,.393808,208694e-9,0,.873016,.376615,198045e-9,0,.904762,.359655,187375e-9,0,.936508,.343452,177371e-9,0,.968254,.32765,167525e-9,0,1,1,169351e-10,0,0,1,169356e-10,0,0,1,169427e-10,0,0,.999999,169736e-10,0,0,.999998,170575e-10,0,0,.999995,172372e-10,0,0,.99999,175739e-10,0,0,.999979,181568e-10,0,0,.999966,191206e-10,0,0,.999944,20677e-9,0,0,.999912,231644e-10,0,0,.999869,271268e-10,0,0,.999811,334272e-10,0,0,.99973,433979e-10,0,0,.999617,590083e-10,0,680315e-10,.999445,829497e-10,0,612796e-9,.999138,118019e-9,0,.00187408,.998095,156712e-9,0,.00395791,.993919,125054e-9,0,.00692144,.991333,126091e-9,0,.0107962,.989226,144912e-9,0,.0155986,.986954,175737e-9,0,.0213364,.983982,213883e-9,0,.0280114,.979128,234526e-9,0,.0356226,.973327,243725e-9,0,.0441668,.967416,2773e-7,0,.0536399,.959729,308799e-9,0,.0640376,.949758,322447e-9,0,.0753554,.939173,350021e-9,0,.0875893,.9296,370089e-9,0,.100736,.921181,391365e-9,0,.114793,.91164,413636e-9,0,.129759,.900435,427068e-9,0,.145632,.888183,441046e-9,0,.162412,.874772,454968e-9,0,.180101,.859566,461882e-9,0,.1987,.843579,471556e-9,0,.218213,.826453,474335e-9,0,.238641,.809164,477078e-9,0,.259989,.792179,47755e-8,0,.282262,.773866,472573e-9,0,.305464,.754944,469765e-9,0,.329599,.735133,462371e-9,0,.35467,.714858,453674e-9,0,.380678,.694829,443888e-9,0,.407622,.674453,432052e-9,0,.435493,.653685,420315e-9,0,.464275,.632666,406829e-9,0,.493938,.611676,392234e-9,0,.524422,.591193,379208e-9,0,.555624,.570145,36319e-8,0,.587302,.549566,349111e-9,0,.619048,.529278,334166e-9,0,.650794,.509026,318456e-9,0,.68254,.489186,30449e-8,0,.714286,.469662,289051e-9,0,.746032,.450691,275494e-9,0,.777778,.431841,261437e-9,0,.809524,.413752,247846e-9,0,.84127,.395951,235085e-9,0,.873016,.378633,222245e-9,0,.904762,.36194,210533e-9,0,.936508,.345599,198494e-9,0,.968254,.329999,188133e-9,0,1,1,269663e-10,0,0,1,26967e-9,0,0,1,269772e-10,0,0,.999999,270214e-10,0,0,.999998,271415e-10,0,0,.999994,27398e-9,0,0,.999988,278771e-10,0,0,.999977,287019e-10,0,0,.999961,300544e-10,0,0,.999937,322138e-10,0,0,.999904,356163e-10,0,0,.999854,409465e-10,0,0,.99979,492651e-10,0,0,.999699,621722e-10,0,8.8288e-7,.999572,819715e-10,0,223369e-9,.999381,111689e-9,0,.00105414,.999016,153862e-9,0,.0026493,.997437,187667e-9,0,.00508608,.993545,155672e-9,0,.00840554,.991135,161455e-9,0,.012629,.989157,188241e-9,0,.0177661,.986874,226229e-9,0,.0238198,.983714,268668e-9,0,.0307887,.978301,277109e-9,0,.0386688,.973227,303446e-9,0,.0474554,.967317,341851e-9,0,.0571428,.959477,370885e-9,0,.0677256,.950012,392753e-9,0,.0791988,.939484,42781e-8,0,.0915576,.928135,443866e-9,0,.104798,.919819,472959e-9,0,.118918,.910049,491551e-9,0,.133915,.899181,512616e-9,0,.149788,.886881,523563e-9,0,.166537,.87359,540183e-9,0,.184164,.858613,547386e-9,0,.202669,.842809,554809e-9,0,.222056,.825727,558316e-9,0,.242329,.808086,557824e-9,0,.263492,.790728,556346e-9,0,.285551,.772987,552672e-9,0,.30851,.7541,543738e-9,0,.332376,.734669,536107e-9,0,.357153,.714411,523342e-9,0,.382845,.694196,512238e-9,0,.409454,.674252,497465e-9,0,.436977,.65357,481096e-9,0,.465404,.632999,467054e-9,0,.494713,.611994,448771e-9,0,.524864,.591604,431889e-9,0,.555779,.571134,415238e-9,0,.587302,.550528,396369e-9,0,.619048,.530292,379477e-9,0,.650794,.510364,361488e-9,0,.68254,.490749,343787e-9,0,.714286,.471266,327822e-9,0,.746032,.452462,310626e-9,0,.777778,.433907,295352e-9,0,.809524,.415659,279179e-9,0,.84127,.398138,264685e-9,0,.873016,.380833,249905e-9,0,.904762,.364247,236282e-9,0,.936508,.348041,222905e-9,0,.968254,.332389,210522e-9,0,1,1,420604e-10,0,0,1,420614e-10,0,0,1,420757e-10,0,0,.999999,42138e-9,0,0,.999997,423067e-10,0,0,.999993,426668e-10,0,0,.999986,433372e-10,0,0,.999974,444857e-10,0,0,.999956,463554e-10,0,0,.99993,493105e-10,0,0,.999892,539077e-10,0,0,.999838,610005e-10,0,0,.999767,718822e-10,0,0,.999666,884581e-10,0,365471e-10,.999525,113398e-9,0,485623e-9,.999311,150043e-9,0,.00162096,.998865,200063e-9,0,.00355319,.996278,211014e-9,0,.00633818,.992956,189672e-9,0,.0100043,.991017,210262e-9,0,.0145648,.989055,244292e-9,0,.0200237,.986741,290481e-9,0,.0263798,.983288,334303e-9,0,.033629,.977784,340307e-9,0,.0417652,.973037,377864e-9,0,.0507821,.967181,4239e-7,0,.060673,.958971,443854e-9,0,.0714314,.950093,483039e-9,0,.0830518,.939552,517934e-9,0,.0955288,.927678,539449e-9,0,.108859,.918278,568604e-9,0,.123038,.908449,588505e-9,0,.138065,.897713,612473e-9,0,.153938,.885533,625575e-9,0,.170657,.872131,63854e-8,0,.188224,.857517,647034e-9,0,.20664,.841796,65209e-8,0,.225909,.824726,6544e-7,0,.246035,.807297,655744e-9,0,.267022,.789058,646716e-9,0,.288878,.77189,643898e-9,0,.311607,.753082,629973e-9,0,.335216,.7341,621564e-9,0,.359713,.714094,605171e-9,0,.385103,.693839,588752e-9,0,.41139,.673891,573294e-9,0,.438576,.653565,552682e-9,0,.466656,.633326,533446e-9,0,.495617,.612582,514635e-9,0,.525431,.59205,49303e-8,0,.556041,.571918,471842e-9,0,.587338,.551572,451713e-9,0,.619048,.531553,430049e-9,0,.650794,.51175,410445e-9,0,.68254,.49238,390098e-9,0,.714286,.473143,370033e-9,0,.746032,.45423,351205e-9,0,.777778,.435963,332049e-9,0,.809524,.41787,315021e-9,0,.84127,.400387,297315e-9,0,.873016,.383332,281385e-9,0,.904762,.366665,265397e-9,0,.936508,.350633,250601e-9,0,.968254,.334964,23589e-8,0,1,1,643736e-10,0,0,1,64375e-9,0,0,1,643947e-10,0,0,.999999,64481e-9,0,0,.999997,647143e-10,0,0,.999994,652119e-10,0,0,.999985,661359e-10,0,0,.999972,677116e-10,0,0,.999952,702599e-10,0,0,.999922,742517e-10,0,0,.99988,803906e-10,0,0,.99982,897315e-10,0,0,.999741,103838e-9,0,0,.999629,12496e-8,0,149024e-9,.999474,156161e-9,0,861027e-9,.999229,201034e-9,0,.00231198,.998662,259069e-9,0,.00458147,.995299,245439e-9,0,.00770895,.992732,24498e-8,0,.0117126,.990847,273211e-9,0,.0165989,.988911,316492e-9,0,.0223674,.98654,37161e-8,0,.0290135,.982636,410352e-9,0,.0365309,.977346,421756e-9,0,.0449117,.972909,475578e-9,0,.0541481,.966821,522482e-9,0,.0642326,.958686,545008e-9,0,.075158,.949754,589286e-9,0,.0869181,.939184,619995e-9,0,.0995074,.927505,654266e-9,0,.112922,.916606,682362e-9,0,.127157,.906707,704286e-9,0,.142212,.895937,725909e-9,0,.158085,.883913,743939e-9,0,.174776,.870642,755157e-9,0,.192287,.856241,764387e-9,0,.210619,.84069,771032e-9,0,.229775,.823728,765906e-9,0,.249761,.806481,767604e-9,0,.270582,.787924,754385e-9,0,.292243,.770588,749668e-9,0,.314753,.751991,731613e-9,0,.338118,.733407,717655e-9,0,.362347,.713688,700604e-9,0,.387447,.693595,678765e-9,0,.413424,.673426,657042e-9,0,.440284,.65359,635892e-9,0,.468027,.633576,611569e-9,0,.496645,.613144,586011e-9,0,.526122,.592711,563111e-9,0,.556417,.572722,537699e-9,0,.587451,.552762,512556e-9,0,.619048,.532985,489757e-9,0,.650794,.513219,464139e-9,0,.68254,.493992,442193e-9,0,.714286,.47509,418629e-9,0,.746032,.456287,397045e-9,0,.777778,.438152,375504e-9,0,.809524,.420294,35492e-8,0,.84127,.402749,335327e-9,0,.873016,.385879,316422e-9,0,.904762,.369352,298333e-9,0,.936508,.353301,281417e-9,0,.968254,.337781,265203e-9,0,1,1,968267e-10,0,0,1,968284e-10,0,0,1,968556e-10,0,0,.999999,969733e-10,0,0,.999997,972913e-10,0,0,.999993,979688e-10,0,0,.999984,992239e-10,0,0,.999969,101356e-9,0,0,.999946,104784e-9,0,0,.999913,110111e-9,0,0,.999868,118217e-9,0,0,.999801,130396e-9,0,0,.999712,148523e-9,0,124907e-10,.999589,175233e-9,0,355405e-9,.999416,213999e-9,0,.0013528,.999136,268529e-9,0,.00312557,.998367,333088e-9,0,.00573045,.994701,304757e-9,0,.00919397,.992497,318031e-9,0,.0135261,.990608,353863e-9,0,.0187278,.988715,409044e-9,0,.0247947,.986241,472967e-9,0,.0317196,.981696,495104e-9,0,.039494,.977097,532873e-9,0,.0481087,.972583,594447e-9,0,.0575549,.966142,636867e-9,0,.0678242,.95823,669899e-9,0,.0789089,.949677,719499e-9,0,.0908023,.939226,750584e-9,0,.103499,.927501,793183e-9,0,.116993,.915199,81995e-8,0,.131282,.90498,847654e-9,0,.146364,.894243,868929e-9,0,.162237,.882154,884278e-9,0,.178902,.869161,898108e-9,0,.196358,.854751,901254e-9,0,.21461,.839368,90679e-8,0,.23366,.822874,901541e-9,0,.253512,.805514,897297e-9,0,.274174,.78716,881856e-9,0,.29565,.769061,870032e-9,0,.31795,.751,851719e-9,0,.341081,.732614,830671e-9,0,.365053,.713171,806569e-9,0,.389874,.693472,78338e-8,0,.415553,.673528,756404e-9,0,.442098,.653397,726872e-9,0,.469512,.633781,700494e-9,0,.497794,.613877,67105e-8,0,.526935,.593506,640361e-9,0,.556908,.573667,613502e-9,0,.587657,.553932,583177e-9,0,.61906,.534345,554375e-9,0,.650794,.515042,527811e-9,0,.68254,.495674,499367e-9,0,.714286,.477132,47429e-8,0,.746032,.458609,447726e-9,0,.777778,.440354,424205e-9,0,.809524,.422765,399549e-9,0,.84127,.405472,378315e-9,0,.873016,.388482,355327e-9,0,.904762,.372191,336122e-9,0,.936508,.356099,315247e-9,0,.968254,.340737,29794e-8,0,1,1,143327e-9,0,0,1,14333e-8,0,0,1,143366e-9,0,0,.999999,143524e-9,0,0,.999996,143952e-9,0,0,.999991,144862e-9,0,0,.999981,146544e-9,0,0,.999966,149391e-9,0,0,.999941,153946e-9,0,0,.999905,160971e-9,0,0,.999852,171562e-9,0,0,.99978,18729e-8,0,0,.999681,210386e-9,0,826239e-10,.999546,243906e-9,0,664807e-9,.999352,291739e-9,0,.00196192,.999027,357419e-9,0,.00405941,.997886,422349e-9,0,.00699664,.99419,385008e-9,0,.0107896,.99214,409775e-9,0,.0154415,.990274,456418e-9,0,.0209488,.988455,527008e-9,0,.0273037,.985804,597685e-9,0,.0344969,.98103,613124e-9,0,.0425183,.976674,668321e-9,0,.0513575,.972021,736985e-9,0,.0610046,.965274,773789e-9,0,.0714508,.958046,830852e-9,0,.0826877,.949333,875766e-9,0,.0947085,.939135,917088e-9,0,.107507,.927119,952244e-9,0,.121078,.91469,990626e-9,0,.135419,.903006,.00101304,0,.150526,.892368,.00103834,0,.166399,.880231,.00105002,0,.183038,.867432,.00106331,0,.200443,.853208,.00106783,0,.218618,.837956,.00106458,0,.237566,.821772,.00105945,0,.257291,.804328,.00104685,0,.2778,.786465,.00103178,0,.2991,.768004,.00101077,0,.321199,.74972,985504e-9,0,.344106,.731682,962893e-9,0,.36783,.712813,932146e-9,0,.392383,.693139,89871e-8,0,.417774,.673566,869678e-9,0,.444013,.653483,835525e-9,0,.471107,.633891,799853e-9,0,.49906,.614433,766838e-9,0,.527869,.594586,732227e-9,0,.557517,.574769,696442e-9,0,.587966,.555149,663935e-9,0,.61913,.535898,629826e-9,0,.650794,.516753,596486e-9,0,.68254,.497816,567078e-9,0,.714286,.479034,534399e-9,0,.746032,.460975,507013e-9,0,.777778,.442935,477421e-9,0,.809524,.425263,451101e-9,0,.84127,.408248,424964e-9,0,.873016,.391339,39993e-8,0,.904762,.37513,377619e-9,0,.936508,.359172,354418e-9,0,.968254,.343876,334823e-9,0,1,1,209042e-9,0,0,1,209045e-9,0,0,1,209093e-9,0,0,.999999,209304e-9,0,0,.999996,209871e-9,0,0,.999991,211078e-9,0,0,.999979,213304e-9,0,0,.999963,217061e-9,0,0,.999933,223042e-9,0,0,.999894,232206e-9,0,0,.999837,245901e-9,0,0,.999756,266023e-9,0,102927e-11,.999648,295204e-9,0,233468e-9,.999499,336958e-9,0,.00108237,.999283,395563e-9,0,.00268832,.998896,473785e-9,0,.00511138,.997006,520008e-9,0,.00837705,.993819,497261e-9,0,.0124928,.991632,523722e-9,0,.0174561,.989875,587258e-9,0,.0232596,.988109,676329e-9,0,.0298932,.985155,747701e-9,0,.0373453,.980479,768803e-9,0,.0456045,.976271,841054e-9,0,.0546593,.971347,911469e-9,0,.0644994,.964528,953057e-9,0,.0751152,.957632,.00102221,0,.0864981,.948681,.00106122,0,.0986407,.938716,.00111857,0,.111537,.926629,.00114762,0,.125182,.914025,.00118995,0,.139571,.901026,.00121228,0,.154703,.890358,.00123946,0,.170576,.878283,.0012527,0,.18719,.865459,.00125536,0,.204547,.851407,.00126134,0,.222648,.836276,.00124759,0,.241498,.820436,.00124443,0,.261101,.803253,.00122071,0,.281465,.785562,.00120107,0,.302595,.76718,.00117762,0,.324501,.748551,.00114289,0,.347192,.730564,.00110872,0,.370679,.712253,.00107636,0,.394973,.692867,.00103646,0,.420085,.673695,996793e-9,0,.446027,.653912,95675e-8,0,.47281,.634129,916739e-9,0,.500441,.615004,874401e-9,0,.528921,.595587,833411e-9,0,.558244,.575965,794556e-9,0,.588384,.5566,75196e-8,0,.619281,.537428,716381e-9,0,.650795,.518623,676558e-9,0,.68254,.499964,64074e-8,0,.714286,.481356,605984e-9,0,.746032,.463279,570256e-9,0,.777778,.445673,540138e-9,0,.809524,.428032,507299e-9,0,.84127,.411112,479553e-9,0,.873016,.394444,450737e-9,0,.904762,.378247,424269e-9,0,.936508,.362415,399111e-9,0,.968254,.347103,375274e-9,0,1,1,300729e-9,0,0,1,300733e-9,0,0,1,300797e-9,0,0,.999998,301072e-9,0,0,.999996,301817e-9,0,0,.999989,303398e-9,0,0,.999977,306309e-9,0,0,.999958,311209e-9,0,0,.999927,318975e-9,0,0,.999884,330804e-9,0,0,.99982,34834e-8,0,0,.999733,373854e-9,0,326995e-10,.999613,410424e-9,0,477174e-9,.999447,462047e-9,0,.00161099,.999204,533322e-9,0,.00353153,.998725,624964e-9,0,.00627965,.995871,631786e-9,0,.0098693,.993194,632017e-9,0,.0143011,.991541,68923e-8,0,.019568,.989773,766892e-9,0,.0256593,.987647,863668e-9,0,.0325625,.984193,922089e-9,0,.0402647,.980016,970749e-9,0,.0487532,.975859,.00106027,0,.058016,.970514,.00112239,0,.0680419,.963625,.00117212,0,.0788208,.956959,.00125211,0,.0903439,.947956,.00129411,0,.102604,.93809,.00135879,0,.115594,.92659,.00139309,0,.129309,.913829,.00143253,0,.143745,.90005,.00145809,0,.158901,.888129,.0014748,0,.174774,.87607,.00148756,0,.191365,.863461,.00148714,0,.208674,.849594,.00148892,0,.226705,.834531,.00146496,0,.245461,.81903,.0014579,0,.264947,.802122,.00143039,0,.28517,.78445,.00139717,0,.306137,.766434,.00136312,0,.327857,.747816,.00132597,0,.350341,.729519,.00128323,0,.373598,.711454,.00123803,0,.397642,.692699,.00119097,0,.422485,.673723,.00114565,0,.448139,.654386,.00109552,0,.474619,.634673,.00104553,0,.501933,.615554,99985e-8,0,.530089,.596462,948207e-9,0,.559087,.577385,902299e-9,0,.588913,.558257,856448e-9,0,.619525,.5392,810395e-9,0,.650826,.520543,768558e-9,0,.68254,.502206,7239e-7,0,.714286,.48402,685794e-9,0,.746032,.465779,64471e-8,0,.777778,.448455,609583e-9,0,.809524,.431091,57227e-8,0,.84127,.414147,54042e-8,0,.873016,.39765,506545e-9,0,.904762,.381576,477635e-9,0,.936508,.365881,448446e-9,0,.968254,.350582,421424e-9,0,1,1,427144e-9,0,0,1,427151e-9,0,0,1,427232e-9,0,0,.999998,42759e-8,0,0,.999995,428555e-9,0,0,.999988,430603e-9,0,0,.999976,434368e-9,0,0,.999952,440688e-9,0,0,.999919,450667e-9,0,0,.999871,46578e-8,0,0,.999801,488024e-9,0,0,.999704,520092e-9,0,129791e-9,.999572,565553e-9,0,821056e-9,.999389,628906e-9,0,.00225241,.999114,714911e-9,0,.00449109,.998488,819218e-9,0,.00756249,.995234,80415e-8,0,.0114716,.993021,830181e-9,0,.0162131,.991407,902645e-9,0,.021776,.989625,996934e-9,0,.0281471,.987064,.00109707,0,.0353118,.983265,.00114353,0,.0432562,.979535,.0012272,0,.0519665,.975224,.00132642,0,.0614298,.969574,.00138092,0,.0716348,.963021,.00145896,0,.0825709,.956046,.00152834,0,.094229,.947136,.00158217,0,.106602,.937313,.0016347,0,.119682,.926073,.00168383,0,.133465,.913121,.00171627,0,.147947,.899165,.00174229,0,.163125,.885891,.00176137,0,.178998,.873783,.00176406,0,.195566,.861331,.00176156,0,.21283,.847569,.00175346,0,.230793,.832785,.00172753,0,.249459,.817442,.00170204,0,.268832,.800613,.00166576,0,.28892,.783597,.00162909,0,.30973,.76571,.0015826,0,.331271,.747021,.00153106,0,.353554,.728593,.00148036,0,.37659,.710661,.00142808,0,.400391,.692426,.00136906,0,.424973,.673623,.00131066,0,.450347,.65494,.00125569,0,.476531,.635448,.00119517,0,.503535,.616221,.00113828,0,.531372,.597531,.0010816,0,.560047,.578795,.00102673,0,.589554,.559892,970985e-9,0,.619869,.541307,919773e-9,0,.650923,.522608,868479e-9,0,.68254,.504484,82137e-8,0,.714286,.486603,772916e-9,0,.746032,.468802,730353e-9,0,.777778,.451172,684955e-9,0,.809524,.434348,647565e-9,0,.84127,.417445,605863e-9,0,.873016,.401077,571885e-9,0,.904762,.385039,536034e-9,0,.936508,.369483,504227e-9,0,.968254,.354272,473165e-9,0,1,1,599525e-9,0,0,1,599533e-9,0,0,1,599639e-9,0,0,.999998,600097e-9,0,0,.999994,601336e-9,0,0,.999987,603958e-9,0,0,.999972,608775e-9,0,0,.999949,616842e-9,0,0,.999912,629534e-9,0,0,.999857,648658e-9,0,0,.999781,676615e-9,0,538873e-11,.999674,716574e-9,0,308602e-9,.999528,772641e-9,0,.00127003,.999326,849806e-9,0,.00300783,.999009,952682e-9,0,.00556637,.998112,.00106394,0,.00895889,.994496,.00102228,0,.0131827,.992806,.00108586,0,.0182277,.991211,.0011759,0,.0240795,.989415,.00128955,0,.030723,.986499,.00139038,0,.0381418,.982679,.00144539,0,.046321,.978839,.00153954,0,.0552459,.974295,.00164417,0,.0649034,.968784,.00171517,0,.0752814,.962324,.00180282,0,.0863693,.954956,.00186387,0,.0981578,.94624,.00193817,0,.110639,.936517,.00198156,0,.123806,.925186,.00203042,0,.137655,.91252,.0020664,0,.15218,.898441,.00207822,0,.16738,.884394,.0020992,0,.183253,.871273,.00208748,0,.199799,.859057,.00208686,0,.21702,.845243,.00205519,0,.234918,.830723,.00202868,0,.253496,.815801,.00199501,0,.272761,.79914,.00194193,0,.292719,.782372,.00188824,0,.313377,.76482,.00183695,0,.334745,.746586,.00177418,0,.356833,.7281,.00170628,0,.379654,.709842,.00164063,0,.403221,.692019,.00157355,0,.427548,.67364,.00150262,0,.452651,.655277,.00143473,0,.478545,.636438,.00136371,0,.505246,.617364,.00129911,0,.532768,.598603,.00123014,0,.561122,.580195,.00116587,0,.590309,.561786,.00110398,0,.620318,.543377,.00104148,0,.651102,.525093,983984e-9,0,.682545,.506791,92667e-8,0,.714286,.489291,874326e-9,0,.746032,.471811,821734e-9,0,.777778,.454435,774698e-9,0,.809524,.437493,727302e-9,0,.84127,.420977,684039e-9,0,.873016,.404729,64373e-8,0,.904762,.388756,60285e-8,0,.936508,.373344,56765e-8,0,.968254,.358191,531929e-9,0,1,1,832169e-9,0,0,1,832178e-9,0,0,1,83231e-8,0,0,.999998,832893e-9,0,0,.999995,834465e-9,0,0,.999985,837791e-9,0,0,.999969,843893e-9,0,0,.999944,854086e-9,0,0,.999903,870071e-9,0,0,.999843,894042e-9,0,0,.999759,928865e-9,0,531805e-10,.999643,978242e-9,0,579365e-9,.99948,.00104684,0,.00182774,.999255,.00114012,0,.00387804,.998885,.00126188,0,.00675709,.997405,.00135888,0,.010468,.99424,.00133626,0,.0150018,.992458,.00140905,0,.0203443,.990929,.00152305,0,.0264786,.989116,.00165882,0,.0333875,.985624,.00174128,0,.0410536,.982003,.00182108,0,.0494609,.978336,.00194498,0,.0585941,.973184,.00202708,0,.0684396,.9678,.00212166,0,.0789851,.961348,.00221366,0,.0902199,.953841,.00228219,0,.102134,.94534,.00235662,0,.114721,.935552,.00240572,0,.127972,.924064,.00244405,0,.141884,.911827,.00247557,0,.156451,.897731,.00248374,0,.171672,.883409,.00249863,0,.187545,.868625,.00246688,0,.20407,.856529,.00246523,0,.221249,.842999,.00242368,0,.239083,.828505,.00237354,0,.257578,.813825,.00232588,0,.276738,.797813,.00226731,0,.296569,.781097,.00219704,0,.31708,.764038,.00212394,0,.338281,.746067,.00204786,0,.360181,.727687,.00196728,0,.382794,.709571,.00188779,0,.406133,.691503,.00180532,0,.430213,.673673,.00171849,0,.45505,.655732,.00164147,0,.480662,.637399,.00155858,0,.507065,.618616,.00147641,0,.534278,.60005,.00140125,0,.562313,.581713,.00132441,0,.59118,.563546,.00125014,0,.620875,.545605,.00118249,0,.651373,.527559,.0011116,0,.682593,.509764,.00104979,0,.714286,.49193,985977e-9,0,.746032,.475011,928592e-9,0,.777778,.457878,873466e-9,0,.809524,.440979,819585e-9,0,.84127,.424613,772365e-9,0,.873016,.408549,722195e-9,0,.904762,.392771,680014e-9,0,.936508,.377317,636797e-9,0,.968254,.362352,598318e-9,0,1,1,.00114313,0,0,1,.00114314,0,0,.999999,.00114331,0,0,.999998,.00114404,0,0,.999994,.00114601,0,0,.999984,.00115019,0,0,.999967,.00115784,0,0,.999937,.0011706,0,0,.999894,.00119054,0,0,.999828,.00122031,0,0,.999735,.00126331,0,169263e-9,.999606,.00132382,0,949167e-9,.999426,.0014071,0,.00249668,.999173,.00151895,0,.00486392,.99873,.00166102,0,.00806323,.996243,.0017023,0,.0120895,.993779,.00172782,0,.0169288,.9919,.0018108,0,.0225633,.990524,.00196028,0,.028974,.98868,.00212014,0,.036142,.984663,.00217598,0,.044049,.981457,.00230563,0,.0526781,.977608,.00243966,0,.0620137,.972215,.00251336,0,.0720418,.966798,.0026285,0,.0827499,.960241,.00271409,0,.0941271,.952489,.00278381,0,.106164,.944127,.00285399,0,.118852,.934282,.00290994,0,.132185,.923271,.00294558,0,.146157,.910803,.00296269,0,.160766,.896705,.00296803,0,.176007,.88238,.00296637,0,.19188,.867116,.00293163,0,.208385,.853636,.00289418,0,.225523,.840469,.00284663,0,.243296,.82639,.00278594,0,.261709,.811759,.00271618,0,.280767,.796113,.00263187,0,.300476,.779518,.00254589,0,.320845,.763142,.00246003,0,.341883,.745464,.00236529,0,.363601,.727491,.00226536,0,.386011,.709414,.00216375,0,.409128,.691396,.00207127,0,.432967,.67368,.00197106,0,.457545,.656049,.00187022,0,.482881,.638188,.00177605,0,.508992,.620177,.00168482,0,.535899,.601506,.00158909,0,.563619,.58362,.00150583,0,.592165,.565496,.00141791,0,.621544,.54789,.00133693,0,.651743,.530323,.00126038,0,.682709,.512795,.00118556,0,.714286,.495199,.00111527,0,.746032,.478101,.0010489,0,.777778,.461511,984264e-9,0,.809524,.444879,92591e-8,0,.84127,.428424,866582e-9,0,.873016,.412495,814463e-9,0,.904762,.396975,764498e-9,0,.936508,.381614,715967e-9,0,.968254,.366732,672483e-9,0,1,1,.00155501,0,0,1,.00155503,0,0,1,.00155524,0,0,.999998,.00155615,0,0,.999994,.0015586,0,0,.999983,.00156379,0,0,.999963,.0015733,0,0,.999932,.00158911,0,0,.999882,.00161376,0,0,.99981,.00165041,0,100875e-10,.999708,.00170304,0,367658e-9,.999565,.00177658,0,.0014234,.999368,.00187688,0,.00327939,.999081,.00200989,0,.00596629,.99852,.00217177,0,.0094852,.99549,.0021745,0,.013824,.993252,.00222357,0,.0189642,.991727,.00235022,0,.0248856,.989951,.00250561,0,.0315669,.988029,.00268829,0,.0389882,.984029,.0027496,0,.0471302,.980683,.00289793,0,.0559754,.976554,.00303315,0,.0655081,.97139,.00313257,0,.0757138,.965544,.00323656,0,.08658,.95912,.00333432,0,.0980954,.951183,.0034039,0,.110251,.942974,.00347515,0,.123038,.932642,.00350381,0,.13645,.922158,.00354519,0,.150482,.909404,.00353851,0,.165129,.896071,.0035435,0,.18039,.881206,.00349936,0,.196263,.866077,.00347256,0,.212748,.85093,.003415,0,.229847,.837703,.00333367,0,.247561,.823878,.003249,0,.265895,.809449,.00316347,0,.284854,.794379,.00306351,0,.304445,.778138,.0029499,0,.324675,.761997,.00284099,0,.345555,.744938,.00272104,0,.367095,.727212,.00260715,0,.389309,.709549,.00248855,0,.41221,.691704,.00236783,0,.435814,.673689,.00225178,0,.460138,.656453,.00213765,0,.485203,.639128,.00202178,0,.511028,.621512,.00191443,0,.537634,.603598,.00180977,0,.565041,.58559,.00170456,0,.593268,.567852,.00160927,0,.622327,.5503,.00151395,0,.652217,.533033,.00142499,0,.682907,.515942,.00133955,0,.714296,.498814,.0012602,0,.746032,.481595,.00118188,0,.777778,.465117,.00111171,0,.809524,.448865,.00104091,0,.84127,.432711,976618e-9,0,.873016,.416822,91859e-8,0,.904762,.401272,857704e-9,0,.936508,.386226,807172e-9,0,.968254,.371321,75464e-8,0,1,1,.00209596,0,0,1,.00209598,0,0,1,.00209624,0,0,.999997,.00209736,0,0,.999991,.00210039,0,0,.999979,.00210678,0,0,.999959,.00211847,0,0,.999925,.0021379,0,0,.99987,.00216809,0,0,.999791,.00221281,0,681487e-10,.999677,.00227669,0,658161e-9,.999521,.00236533,0,.00200635,.999301,.00248514,0,.0041779,.998977,.00264185,0,.00718648,.998191,.00281695,0,.0110239,.994801,.00278518,0,.015672,.993091,.00288774,0,.0211091,.991571,.00303931,0,.0273123,.9897,.00321643,0,.034259,.987023,.00337332,0,.0419282,.983289,.00346146,0,.0502998,.979892,.00363704,0,.0593562,.975111,.00373601,0,.069081,.970351,.0038842,0,.0794598,.964131,.00397053,0,.0904798,.957747,.00408078,0,.10213,.949536,.00413533,0,.1144,.941372,.00420305,0,.127284,.931049,.00422815,0,.140772,.920647,.00425048,0,.154862,.908033,.0042281,0,.169548,.895028,.00422026,0,.184828,.879968,.00415042,0,.200701,.864875,.00408821,0,.217167,.84918,.00400909,0,.234227,.834934,.00391178,0,.251884,.821397,.00380066,0,.270141,.807135,.00367974,0,.289004,.792363,.00355172,0,.308479,.776661,.003411,0,.328575,.760705,.00328123,0,.349301,.744408,.00314003,0,.370668,.726994,.0029906,0,.392689,.709598,.00285034,0,.415379,.692112,.00271179,0,.438754,.674435,.00257185,0,.46283,.65676,.00243425,0,.48763,.639982,.00230351,0,.513173,.622983,.0021777,0,.539482,.605471,.00204991,0,.566579,.58796,.00193759,0,.594488,.570463,.00181976,0,.623226,.553058,.00171497,0,.6528,.535894,.00161109,0,.683198,.519089,.00151394,0,.714354,.502454,.00142122,0,.746032,.485681,.00133488,0,.777778,.468935,.00124975,0,.809524,.452951,.00117309,0,.84127,.437139,.00110155,0,.873016,.421446,.00103124,0,.904762,.405951,966387e-9,0,.936508,.391003,908119e-9,0,.968254,.376198,848057e-9,0,1,1,.00280076,0,0,1,.00280078,0,0,.999999,.00280109,0,0,.999997,.00280246,0,0,.999992,.00280616,0,0,.999979,.00281396,0,0,.999956,.00282822,0,0,.999916,.00285186,0,0,.999857,.0028885,0,0,.999768,.00294259,0,196026e-9,.999645,.00301946,0,.00104842,.99947,.00312541,0,.00270199,.999229,.00326733,0,.00519449,.998852,.00344992,0,.00852602,.997558,.00361052,0,.0126804,.994417,.0035898,0,.017635,.992824,.00372393,0,.023365,.991344,.00390695,0,.0298456,.989337,.00410392,0,.0370529,.985811,.00420987,0,.0449651,.982772,.00437488,0,.0535615,.979001,.00455069,0,.0628243,.974102,.00464462,0,.0727368,.969197,.00480577,0,.0832844,.962759,.00487818,0,.0944545,.956207,.00498176,0,.106236,.947909,.00503392,0,.118619,.939596,.00507474,0,.131595,.929642,.00509798,0,.145159,.918807,.00508476,0,.159305,.906921,.00505634,0,.174028,.893312,.00498845,0,.189327,.878933,.0049133,0,.2052,.863986,.0048259,0,.221647,.847936,.00470848,0,.23867,.832253,.00456889,0,.25627,.818619,.00442726,0,.274453,.804788,.00427677,0,.293222,.790241,.00411906,0,.312585,.775162,.00394833,0,.33255,.759463,.00377366,0,.353126,.743598,.00361026,0,.374324,.72697,.00343627,0,.396158,.709646,.00326422,0,.418641,.69277,.00309717,0,.44179,.675371,.0029356,0,.465624,.657863,.00277712,0,.490163,.640772,.00261738,0,.515429,.624441,.0024737,0,.541445,.607497,.00233125,0,.568236,.590438,.00218994,0,.595828,.573224,.0020664,0,.624242,.556168,.00193526,0,.653496,.539232,.00182463,0,.683588,.522352,.00170735,0,.714482,.506172,.00160555,0,.746032,.489842,.00150451,0,.777778,.473463,.00140938,0,.809524,.457266,.00132568,0,.84127,.441609,.0012376,0,.873016,.426348,.00116265,0,.904762,.411002,.00108935,0,.936508,.396045,.00101946,0,.968254,.381448,955665e-9,0,1,1,.0037121,0,0,1,.00371213,0,0,1,.00371251,0,0,.999997,.00371417,0,0,.99999,.00371863,0,0,.999977,.00372807,0,0,.99995,.00374529,0,0,.999908,.0037738,0,0,.999843,.00381789,0,123596e-10,.999745,.00388273,0,407442e-9,.999608,.00397443,0,.0015447,.999415,.00409998,0,.00351385,.999143,.00426662,0,.0063316,.9987,.00447625,0,.00998679,.996363,.00455323,0,.0144569,.994021,.00461052,0,.0197151,.992372,.00476359,0,.0257344,.991007,.00499101,0,.0324882,.988767,.0051972,0,.0399517,.984872,.00528407,0,.0481022,.982004,.00548926,0,.0569191,.977714,.00564385,0,.0663839,.973076,.0057693,0,.0764801,.967565,.0058924,0,.0871928,.961384,.00599629,0,.0985095,.954435,.00605998,0,.110419,.946303,.0061133,0,.122912,.937662,.00612028,0,.13598,.927867,.00612209,0,.149617,.916475,.00604813,0,.163817,.90541,.00603088,0,.178577,.891591,.00592218,0,.193894,.877573,.00578854,0,.209767,.862511,.00566648,0,.226196,.846861,.00551481,0,.243182,.83068,.00533754,0,.260728,.815725,.00515487,0,.278837,.802321,.0049655,0,.297515,.787826,.00475421,0,.316768,.773454,.00456002,0,.336605,.758224,.00434727,0,.357034,.74265,.00414444,0,.378067,.726729,.00393738,0,.399717,.710155,.00373575,0,.421998,.693312,.00353736,0,.444928,.67653,.00334368,0,.468523,.659444,.00315981,0,.492806,.642051,.00297809,0,.517798,.625758,.00280592,0,.543525,.609615,.00264254,0,.570012,.592919,.00248459,0,.597288,.576298,.00233327,0,.625379,.559489,.00219519,0,.654307,.542891,.00205441,0,.684084,.526255,.00193385,0,.714693,.509853,.00180745,0,.746044,.494131,.00169817,0,.777778,.478114,.0015913,0,.809524,.462274,.00148981,0,.84127,.446412,.00139537,0,.873016,.431274,.00130984,0,.904762,.41635,.00122403,0,.936508,.401476,.00114809,0,.968254,.386993,.00107563,0,1,1,.00488216,0,0,1,.0048822,0,0,1,.00488265,0,0,.999997,.00488463,0,0,.999988,.00488999,0,0,.999974,.00490129,0,0,.999946,.00492191,0,0,.999897,.00495598,0,0,.999825,.00500855,0,744791e-10,.999718,.00508559,0,712744e-9,.999565,.005194,0,.00215249,.999352,.00534147,0,.00444576,.999046,.00553523,0,.00759218,.998492,.00577016,0,.0115714,.995564,.00578487,0,.0163557,.993339,.00586414,0,.021915,.991834,.00606002,0,.0282201,.990496,.00633312,0,.0352433,.987826,.00651941,0,.042959,.98383,.00660842,0,.0513439,.98109,.00685523,0,.0603772,.976131,.00695778,0,.0700402,.971922,.00714236,0,.0803163,.965901,.00721437,0,.0911908,.959606,.00732017,0,.102651,.952504,.00735788,0,.114686,.944365,.00738493,0,.127286,.935652,.00737969,0,.140443,.925813,.00733612,0,.154151,.914397,.00723094,0,.168405,.903257,.00714002,0,.183201,.890015,.00700149,0,.198536,.876014,.00682813,0,.214409,.861436,.00665567,0,.23082,.845752,.00644526,0,.24777,.829169,.00621635,0,.265263,.813435,.00597789,0,.283301,.799701,.00575694,0,.301889,.785726,.00549866,0,.321035,.77152,.0052503,0,.340746,.75683,.00499619,0,.361032,.741951,.0047543,0,.381904,.726367,.0045084,0,.403374,.710537,.00426784,0,.425457,.693965,.00403487,0,.448169,.677724,.0038075,0,.47153,.66117,.00359431,0,.495561,.644274,.00338354,0,.520284,.627449,.00318163,0,.545725,.611645,.00299672,0,.571911,.595614,.00281016,0,.598873,.579426,.00264252,0,.62664,.563016,.00247509,0,.655239,.546728,.00232647,0,.684692,.530539,.00217803,0,.714999,.514164,.00204216,0,.746106,.498344,.00191403,0,.777778,.482957,.00179203,0,.809524,.467336,.00167695,0,.84127,.451994,.00157567,0,.873016,.436514,.00147113,0,.904762,.42178,.00138034,0,.936508,.407271,.00129219,0,.968254,.392822,.0012098,0,1,1,.00637427,0,0,1,.00637431,0,0,.999999,.00637485,0,0,.999996,.00637721,0,0,.999987,.00638357,0,0,.999971,.006397,0,0,.999939,.00642142,0,0,.999888,.00646177,0,0,.999807,.00652387,0,207916e-9,.999689,.00661454,0,.00112051,.99952,.00674155,0,.00287719,.999283,.00691313,0,.00550145,.998936,.00713598,0,.00897928,.998165,.00738501,0,.0132829,.994847,.00734388,0,.01838,.993182,.00749991,0,.0242381,.991665,.0077246,0,.030826,.989708,.00797579,0,.0381152,.986663,.00813011,0,.0460794,.983288,.00830365,0,.0546951,.980104,.00853496,0,.0639411,.974855,.00861045,0,.0737988,.97045,.00879133,0,.0842516,.964509,.00886377,0,.0952848,.957594,.00890346,0,.106886,.950546,.00893289,0,.119044,.942225,.00890074,0,.131749,.933365,.00886826,0,.144994,.923202,.0087316,0,.158772,.912605,.00863082,0,.173078,.901099,.00847403,0,.187908,.888177,.00825838,0,.203261,.873955,.00801834,0,.219134,.860091,.00779026,0,.235527,.84434,.00752478,0,.252443,.828517,.00724074,0,.269883,.81239,.00693769,0,.287851,.79721,.00664817,0,.306352,.783489,.00634763,0,.325393,.769514,.00604221,0,.344981,.755419,.00573568,0,.365126,.741083,.00544359,0,.385839,.726059,.00515515,0,.407132,.710809,.00487139,0,.42902,.695052,.00459846,0,.45152,.678886,.00433412,0,.474651,.663042,.00407981,0,.498433,.646634,.00384264,0,.52289,.630117,.00360897,0,.548048,.613804,.00338863,0,.573936,.598338,.00318486,0,.600584,.582687,.00298377,0,.628027,.566809,.00280082,0,.656295,.550817,.00262255,0,.685417,.534937,.00245835,0,.715406,.519151,.00230574,0,.74624,.503118,.0021549,0,.777778,.487723,.00202008,0,.809524,.472725,.00189355,0,.84127,.457599,.00177108,0,.873016,.442558,.00165843,0,.904762,.427624,.00155494,0,.936508,.413171,.00145273,0,.968254,.399122,.00136454,0,1,1,.00826496,0,0,1,.00826499,0,0,1,.00826564,0,0,.999996,.00826842,0,0,.999987,.00827589,0,0,.999967,.00829167,0,0,.999933,.00832037,0,0,.999876,.00836768,0,109338e-10,.999786,.00844031,0,427145e-9,.999655,.00854603,0,.0016384,.999468,.00869337,0,.00372392,.999203,.008891,0,.00668513,.998803,.00914387,0,.0104968,.99748,.00935838,0,.015125,.994446,.00933309,0,.0205338,.99292,.00953084,0,.0266884,.991414,.0097893,0,.0335565,.989049,.0100228,0,.0411086,.98582,.0101664,0,.0493181,.982441,.0103582,0,.0581613,.978595,.0105292,0,.0676169,.973495,.0106274,0,.0776661,.968405,.0107261,0,.0882926,.962717,.0108234,0,.0994817,.955478,.0108102,0,.111221,.948275,.0107914,0,.123499,.940006,.0107161,0,.136308,.930831,.0106309,0,.149639,.920648,.0104083,0,.163485,.910205,.0102312,0,.177843,.898445,.0100051,0,.192707,.885986,.00971928,0,.208077,.872204,.00940747,0,.22395,.858436,.0091085,0,.240326,.843454,.00876595,0,.257208,.827437,.00839794,0,.274596,.811488,.00803692,0,.292496,.796039,.00767352,0,.310911,.781083,.0073097,0,.329849,.767642,.00694032,0,.349316,.753901,.00657476,0,.369323,.740131,.00622699,0,.38988,.725845,.0058838,0,.410999,.710991,.00555586,0,.432696,.696002,.00523089,0,.454987,.680461,.00492494,0,.47789,.664875,.00463464,0,.501426,.649273,.00435422,0,.52562,.63302,.0040875,0,.550498,.61705,.00384075,0,.576089,.601154,.00359557,0,.602427,.586008,.00337636,0,.629544,.570699,.00316019,0,.657479,.555166,.00296033,0,.686264,.539645,.00277552,0,.715924,.524159,.00259499,0,.746459,.508682,.00243257,0,.777789,.493163,.00227851,0,.809524,.478004,.00213083,0,.84127,.46347,.00199502,0,.873016,.448778,.00186967,0,.904762,.434105,.00174732,0,.936508,.419576,.00163861,0,.968254,.405541,.00153341,0,1,1,.0106462,0,0,1,.0106462,0,0,.999999,.010647,0,0,.999995,.0106502,0,0,.999985,.0106589,0,0,.999964,.0106773,0,0,.999925,.0107106,0,0,.999861,.0107655,0,712986e-10,.999763,.0108497,0,743959e-9,.999616,.0109716,0,.00227361,.999408,.0111408,0,.0046983,.999112,.0113659,0,.00800158,.998637,.0116475,0,.0121493,.996223,.0117231,0,.0171023,.994006,.0118064,0,.0228218,.992444,.0120254,0,.0292711,.991028,.0123314,0,.036417,.98803,.0124954,0,.0442295,.984816,.0126538,0,.0526815,.981399,.0128537,0,.0617492,.977085,.0129694,0,.0714114,.972154,.013091,0,.0816495,.966617,.0131166,0,.0924472,.960628,.0131583,0,.10379,.953295,.0131094,0,.115665,.94575,.0129966,0,.128062,.937654,.0128796,0,.140972,.927716,.0126477,0,.154387,.917932,.0123889,0,.168301,.907719,.012131,0,.182709,.89584,.0118013,0,.197608,.883526,.0114145,0,.212994,.870301,.0110075,0,.228867,.856272,.0106019,0,.245227,.842251,.0101938,0,.262074,.826466,.00973254,0,.279412,.810859,.0092846,0,.297244,.795051,.00883304,0,.315575,.780053,.00840272,0,.334412,.76575,.00796438,0,.35376,.752298,.00752526,0,.373631,.739153,.00711486,0,.394034,.725514,.00670361,0,.414983,.711473,.00632656,0,.436491,.696936,.00595206,0,.458575,.682126,.00559191,0,.481253,.667027,.00525362,0,.504547,.651875,.00493805,0,.528481,.636463,.00462848,0,.553081,.620641,.00433936,0,.578377,.604931,.00407,0,.604404,.589549,.00380864,0,.631197,.574712,.00357049,0,.658795,.559775,.00334466,0,.687238,.544514,.00312505,0,.716559,.529555,.00293199,0,.746776,.514402,.00274204,0,.777849,.499302,.00256647,0,.809524,.484114,.00239901,0,.84127,.469308,.00225148,0,.873016,.455133,.00210178,0,.904762,.440939,.0019727,0,.936508,.426627,.00184382,0,.968254,.412509,.00172548,0,1,1,.013628,0,0,1,.0136281,0,0,.999999,.0136289,0,0,.999995,.0136327,0,0,.999983,.0136427,0,0,.99996,.0136638,0,0,.999917,.0137022,0,0,.999846,.0137652,0,204597e-9,.999736,.0138615,0,.00116837,.999573,.0140007,0,.00303325,.99934,.0141927,0,.00580613,.999004,.0144457,0,.00945626,.998407,.0147489,0,.0139421,.995464,.014731,0,.0192202,.993328,.0148283,0,.0252495,.991799,.0150797,0,.0319921,.990397,.0154316,0,.0394138,.986835,.0155005,0,.0474843,.983938,.0157308,0,.0561763,.980154,.0158753,0,.0654661,.975659,.0159581,0,.0753326,.970171,.0159832,0,.0857571,.964803,.0160084,0,.0967236,.958366,.0159484,0,.108218,.950613,.0158001,0,.120227,.942874,.0155845,0,.132741,.935005,.0154292,0,.145751,.924991,.0150742,0,.159249,.914814,.0146757,0,.17323,.904743,.0143097,0,.187687,.893216,.0138695,0,.202619,.880769,.0133706,0,.218021,.868136,.0128606,0,.233894,.85469,.0123403,0,.250238,.840593,.0118091,0,.267052,.825808,.011253,0,.284341,.81009,.0107099,0,.302106,.79504,.0101636,0,.320354,.779757,.00964041,0,.33909,.764697,.00911896,0,.358322,.750913,.00859533,0,.378059,.738175,.00811592,0,.398311,.725242,.00764504,0,.41909,.711864,.00718885,0,.440412,.698009,.00675843,0,.462292,.683841,.00634984,0,.484748,.669391,.00595502,0,.507802,.654731,.00558671,0,.531477,.639805,.00523578,0,.555802,.624789,.00490834,0,.580805,.609325,.00459448,0,.606522,.593975,.00430342,0,.63299,.578983,.00403019,0,.66025,.564442,.0037707,0,.688346,.549835,.0035316,0,.717319,.535039,.00330255,0,.7472,.520403,.00308932,0,.777982,.505687,.00289335,0,.809524,.490939,.00270818,0,.84127,.476233,.0025343,0,.873016,.461624,.00237097,0,.904762,.447833,.00222065,0,.936508,.433992,.00207561,0,.968254,.420147,.00194955,0,1,1,.0173415,0,0,1,.0173416,0,0,.999999,.0173426,0,0,.999995,.0173468,0,0,.999983,.0173582,0,0,.999954,.0173822,0,0,.999908,.0174258,0,669501e-11,.999828,.0174973,0,427399e-9,.999705,.0176063,0,.00171019,.999524,.0177631,0,.0039248,.999263,.0179781,0,.00705382,.998878,.018258,0,.0110552,.998012,.0185551,0,.0158812,.994614,.0184264,0,.0214852,.993132,.0186385,0,.0278239,.991563,.0189067,0,.0348585,.989298,.0191577,0,.0425544,.986036,.0192522,0,.050881,.982558,.0194063,0,.059811,.978531,.019486,0,.0693209,.974198,.0195847,0,.0793895,.968148,.0194749,0,.0899984,.962565,.0194277,0,.101132,.956041,.0192991,0,.112775,.947749,.0189893,0,.124917,.94018,.018704,0,.137547,.93165,.0183458,0,.150655,.921798,.0178775,0,.164236,.911573,.0173618,0,.178281,.901569,.0168482,0,.192788,.890341,.016265,0,.207752,.877835,.0156199,0,.223171,.865472,.0149516,0,.239044,.852905,.0143274,0,.255371,.838906,.0136643,0,.272153,.824888,.0129903,0,.289393,.809977,.0123218,0,.307093,.794697,.0116572,0,.325259,.780028,.0110307,0,.343896,.765124,.0104236,0,.363012,.750411,.0098219,0,.382617,.737264,.00924397,0,.402719,.724799,.00868719,0,.423332,.712253,.00816476,0,.444469,.699267,.00767262,0,.466146,.685618,.00719746,0,.488383,.671736,.00673916,0,.511199,.657777,.00631937,0,.534618,.643497,.00592411,0,.558668,.62889,.00553928,0,.58338,.614299,.0051934,0,.608787,.599197,.00485985,0,.634929,.584175,.00454357,0,.661849,.569541,.00425787,0,.689594,.555193,.00397905,0,.718211,.540947,.00372364,0,.747742,.526593,.00348599,0,.778205,.512335,.00326103,0,.80953,.498017,.00305137,0,.84127,.483609,.00285485,0,.873016,.469368,.00267472,0,.904762,.455037,.00249945,0,.936508,.441493,.00234792,0,.968254,.428147,.00219936,0,1,1,.0219422,0,0,1,.0219423,0,0,.999998,.0219434,0,0,.999993,.0219481,0,0,.999981,.021961,0,0,.999949,.0219879,0,0,.999896,.0220367,0,593194e-10,.999808,.0221167,0,75364e-8,.99967,.0222383,0,.00237884,.999466,.0224125,0,.00495612,.999174,.0226495,0,.00844887,.998725,.0229525,0,.0128058,.996979,.0231123,0,.0179742,.994317,.0230742,0,.0239047,.992781,.0232895,0,.0305526,.991191,.0235734,0,.0378786,.987787,.0236152,0,.0458475,.985092,.0237994,0,.0544287,.981121,.0238553,0,.0635952,.976924,.0238706,0,.0733233,.97218,.0238704,0,.0835922,.965956,.0236598,0,.0943839,.959998,.0234735,0,.105682,.953245,.0232277,0,.117474,.944445,.0226973,0,.129747,.937087,.0223527,0,.142491,.928341,.0218144,0,.155697,.9184,.0211516,0,.169358,.907959,.0204553,0,.183469,.89808,.0197673,0,.198024,.887047,.0189915,0,.21302,.875221,.0182082,0,.228455,.86269,.0173584,0,.244329,.850735,.0165718,0,.260639,.837545,.0157524,0,.277389,.823639,.0149482,0,.29458,.809699,.0141431,0,.312216,.794797,.0133527,0,.3303,.780578,.0126193,0,.34884,.766019,.0118914,0,.367842,.751447,.0111839,0,.387315,.737275,.010514,0,.40727,.724545,.00987277,0,.427717,.712644,.00926569,0,.448671,.700432,.00869029,0,.470149,.687664,.00814691,0,.492167,.674288,.00763012,0,.514746,.660966,.00714437,0,.537911,.647264,.00668457,0,.561688,.633431,.00626581,0,.586108,.619133,.00585593,0,.611206,.604935,.00548188,0,.637022,.590236,.00513288,0,.663599,.575473,.0047906,0,.690989,.561228,.00448895,0,.719242,.547054,.00420233,0,.748411,.533175,.00392869,0,.778531,.519163,.00367445,0,.809583,.505328,.00344097,0,.84127,.491446,.00322003,0,.873016,.477356,.00301283,0,.904762,.46356,.00282592,0,.936508,.449623,.00264956,0,.968254,.436068,.00246956,0,1,1,.0276135,0,0,1,.0276136,0,0,.999998,.0276148,0,0,.999993,.0276201,0,0,.999976,.0276342,0,0,.999945,.027664,0,0,.999884,.0277179,0,18679e-8,.999784,.027806,0,.00119607,.99963,.0279394,0,.00318407,.999401,.0281295,0,.00613601,.999066,.0283858,0,.00999963,.998524,.0287027,0,.0147164,.995702,.0286256,0,.0202295,.993593,.0286733,0,.0264876,.992067,.0288989,0,.0334452,.990548,.0292135,0,.0410621,.986775,.0291296,0,.0493032,.984054,.0293099,0,.0581381,.979481,.0291881,0,.0675397,.975297,.0291598,0,.0774848,.96981,.028954,0,.0879528,.963524,.028628,0,.0989258,.957398,.0283135,0,.110388,.950088,.0278469,0,.122327,.941538,.0271798,0,.134729,.933332,.0265388,0,.147587,.924392,.0257776,0,.160889,.914581,.024916,0,.174631,.904347,.0240242,0,.188806,.894324,.0231229,0,.203409,.883724,.022153,0,.218437,.872207,.0211355,0,.233888,.859927,.0201048,0,.249761,.848373,.0191263,0,.266056,.836023,.0181306,0,.282774,.82289,.0171718,0,.299917,.809324,.0162196,0,.317488,.795361,.0152622,0,.335493,.781253,.01439,0,.353936,.767338,.013533,0,.372825,.753156,.0127244,0,.392168,.739122,.0119454,0,.411976,.725358,.0112054,0,.432259,.712949,.010487,0,.453032,.701621,.00984032,0,.47431,.689703,.00921495,0,.496111,.677216,.00862492,0,.518456,.664217,.00806882,0,.541367,.65137,.00755922,0,.564872,.638,.00705705,0,.589001,.62453,.00661266,0,.613789,.610601,.00618432,0,.639277,.59676,.00578033,0,.66551,.582433,.00540927,0,.692539,.568026,.00506104,0,.720422,.55414,.0047353,0,.749216,.540178,.00442889,0,.778974,.526513,.00414363,0,.809711,.512954,.00388237,0,.84127,.499403,.00362875,0,.873016,.486026,.00340827,0,.904762,.472345,.00318598,0,.936508,.458828,.00297635,0,.968254,.445379,.00279447,0,1,1,.0345716,0,0,1,.0345717,0,0,.999999,.034573,0,0,.999991,.0345787,0,0,.999974,.0345941,0,0,.999937,.0346263,0,188589e-11,.999869,.0346847,0,409238e-9,.999757,.0347798,0,.0017674,.999582,.0349233,0,.00413658,.999322,.0351265,0,.00747408,.998939,.0353967,0,.0117157,.998219,.0357018,0,.0167966,.994974,.0354726,0,.0226572,.993201,.0355621,0,.0292445,.991573,.0357641,0,.0365123,.989301,.0359252,0,.0444203,.985712,.0358017,0,.0529334,.982411,.0358353,0,.0620214,.977827,.035617,0,.0716574,.973278,.0354398,0,.0818186,.967397,.0350483,0,.0924846,.960696,.0344795,0,.103638,.954349,.0339861,0,.115263,.946066,.0331323,0,.127348,.938012,.032359,0,.13988,.929413,.0314413,0,.152849,.920355,.0304103,0,.166248,.910586,.0292785,0,.18007,.900609,.0281391,0,.194308,.890093,.0269103,0,.208958,.880013,.0257269,0,.224018,.869001,.0244671,0,.239485,.85751,.0232252,0,.255359,.84582,.0220117,0,.271638,.834383,.0208274,0,.288324,.822158,.0196628,0,.305419,.809056,.0185306,0,.322927,.795832,.0174174,0,.340851,.782547,.0163758,0,.359199,.7689,.015391,0,.377975,.755526,.0144488,0,.397189,.741681,.0135372,0,.416851,.728178,.0126957,0,.436971,.714642,.0118812,0,.457564,.702756,.0111165,0,.478644,.69175,.0104145,0,.500229,.680159,.00974439,0,.522339,.668073,.00911926,0,.544997,.655405,.00851393,0,.56823,.642921,.00797637,0,.592068,.629993,.00745119,0,.616546,.616828,.00696972,0,.641705,.603305,.00652425,0,.66759,.589833,.00610188,0,.694255,.575945,.00570834,0,.72176,.561745,.00533384,0,.750168,.548277,.00500001,0,.779545,.534467,.00467582,0,.809933,.521032,.00438092,0,.841272,.507877,.00410348,0,.873016,.494654,.00383618,0,.904762,.481592,.00358699,0,.936508,.468509,.00337281,0,.968254,.455293,.00316196,0,1,1,.0430698,0,0,1,.0430699,0,0,.999998,.0430713,0,0,.999991,.0430773,0,0,.99997,.0430936,0,0,.999928,.0431277,0,406396e-10,.999852,.0431893,0,744376e-9,.999724,.0432895,0,.0024806,.999527,.0434397,0,.00524779,.99923,.0436507,0,.00898164,.998783,.0439255,0,.0136083,.997507,.0441104,0,.0190582,.994418,.0438225,0,.0252694,.992864,.0439396,0,.0321879,.991127,.0440962,0,.039767,.987331,.0438408,0,.0479667,.984819,.0438991,0,.056752,.980384,.0435906,0,.0660929,.975846,.0432543,0,.075963,.970748,.0428293,0,.0863398,.964303,.042153,0,.0972035,.95772,.0414111,0,.108537,.950747,.0405893,0,.120325,.942533,.0394887,0,.132554,.934045,.0383544,0,.145215,.924942,.037057,0,.158296,.915811,.0356993,0,.17179,.90612,.0342401,0,.185691,.896434,.0328078,0,.199993,.886021,.031288,0,.214691,.876081,.0297776,0,.229782,.865608,.0282334,0,.245265,.854924,.026749,0,.261138,.843607,.02526,0,.277401,.832456,.0238214,0,.294056,.821342,.0224682,0,.311104,.809303,.0211297,0,.328548,.796468,.0198387,0,.346394,.784046,.0186227,0,.364645,.771262,.0174561,0,.38331,.758118,.0163806,0,.402396,.745075,.0153287,0,.421912,.731926,.0143647,0,.44187,.71863,.0134363,0,.462283,.705414,.0125603,0,.483165,.693792,.0117508,0,.504535,.683108,.0110016,0,.52641,.67183,.0102757,0,.548816,.66015,.00962044,0,.571776,.647907,.00898031,0,.595323,.635734,.00840811,0,.619489,.623208,.00786211,0,.644317,.610438,.00734953,0,.669852,.597345,.00687688,0,.696148,.584138,.00643469,0,.723267,.5707,.00602236,0,.75128,.556966,.0056324,0,.780258,.543607,.00528277,0,.810268,.530213,.00493999,0,.841311,.516912,.00462265,0,.873016,.503916,.0043307,0,.904762,.491146,.00406858,0,.936508,.478439,.00381436,0,.968254,.465834,.00358003,0,1,1,.0534039,0,0,1,.053404,0,0,.999998,.0534055,0,0,.999989,.0534116,0,0,.999968,.0534283,0,0,.999918,.0534633,0,155895e-9,.99983,.0535262,0,.00120914,.999685,.0536281,0,.00334944,.999461,.0537799,0,.00653077,.999119,.0539902,0,.0106718,.998582,.0542524,0,.0156907,.995919,.0540318,0,.0215147,.993735,.0538914,0,.0280801,.992126,.0539557,0,.0353323,.990266,.0540401,0,.0432247,.986317,.0536064,0,.0517172,.983213,.0534425,0,.0607754,.978303,.0528622,0,.0703698,.973665,.0523363,0,.0804742,.968091,.0516165,0,.0910667,.961026,.0505434,0,.102128,.954333,.049523,0,.113641,.946372,.0481698,0,.125591,.938254,.0467674,0,.137965,.929516,.0452341,0,.150754,.920106,.0435083,0,.163947,.910899,.0417399,0,.177537,.901532,.0399389,0,.191516,.891919,.0380901,0,.205881,.882006,.0362341,0,.220626,.871965,.0343444,0,.235749,.862145,.0324832,0,.251248,.852058,.0306681,0,.267121,.84161,.0289097,0,.283368,.830806,.0272079,0,.299992,.820476,.0256089,0,.316992,.809514,.0240394,0,.334374,.797865,.0225379,0,.35214,.785621,.0211235,0,.370296,.773765,.0197908,0,.388849,.761629,.0185235,0,.407807,.748891,.0173358,0,.427178,.736437,.0162305,0,.446974,.723707,.0151778,0,.467207,.710606,.0141791,0,.487892,.698019,.0132592,0,.509046,.686203,.0123887,0,.530687,.675692,.0115976,0,.552839,.664826,.0108325,0,.575527,.65349,.0101348,0,.59878,.641774,.00947756,0,.622634,.629794,.00886058,0,.647128,.617647,.00828526,0,.672308,.60534,.00775312,0,.698231,.592718,.00726033,0,.724958,.579746,.00679731,0,.752563,.566763,.00636111,0,.781127,.553515,.00595228,0,.810733,.540118,.00556876,0,.841426,.527325,.00523051,0,.873016,.514265,.00490712,0,.904762,.501406,.00460297,0,.936508,.488922,.00431247,0,.968254,.476541,.0040472,0,1,1,.0659184,0,0,1,.0659185,0,0,.999998,.06592,0,0,.999988,.0659259,0,0,.999963,.0659423,0,0,.999907,.0659764,0,374198e-9,.999806,.0660376,0,.00182071,.999639,.0661361,0,.0043894,.999378,.0662814,0,.00800055,.998985,.0664779,0,.0125594,.998285,.0666914,0,.0179786,.995071,.0661989,0,.0241822,.993172,.0660454,0,.031106,.991438,.0660105,0,.0386952,.988428,.0656875,0,.0469032,.985218,.0652913,0,.0556905,.981128,.0647107,0,.065023,.976015,.0638491,0,.0748717,.97097,.062993,0,.0852112,.964582,.0617927,0,.0960199,.957383,.0603626,0,.107279,.949969,.0588128,0,.118971,.941843,.0570274,0,.131084,.933624,.0551885,0,.143604,.924543,.053122,0,.156521,.914919,.0508897,0,.169825,.905773,.0486418,0,.18351,.896434,.0463364,0,.197569,.887195,.0440623,0,.211997,.877706,.0417799,0,.226789,.867719,.03945,0,.241944,.858587,.037243,0,.257458,.849317,.0350956,0,.273331,.839585,.0329852,0,.289563,.829856,.0310028,0,.306154,.819589,.0290953,0,.323108,.809714,.0272738,0,.340426,.79934,.0255631,0,.358113,.788224,.0239175,0,.376175,.776619,.0223831,0,.394616,.76521,.0209298,0,.413445,.753716,.0195786,0,.432671,.741564,.0183001,0,.452305,.729413,.0171259,0,.472358,.717146,.0159933,0,.492845,.70436,.0149495,0,.513783,.69219,.0139681,0,.535189,.680289,.0130577,0,.557087,.669611,.0122198,0,.5795,.659113,.0114174,0,.602459,.648148,.0106729,0,.625997,.636905,.00998997,0,.650154,.625154,.00934313,0,.674976,.613481,.00874839,0,.700518,.60154,.00818265,0,.726845,.58943,.00766889,0,.754032,.576828,.00717153,0,.782167,.564194,.00672696,0,.811344,.551501,.00630863,0,.841644,.538635,.00592177,0,.873016,.525724,.00554888,0,.904762,.513209,.00520225,0,.936508,.500457,.00488231,0,.968254,.48799,.00457153,0,1,1,.0810131,0,0,1,.0810133,0,0,.999997,.0810145,0,0,.999985,.08102,0,0,.999956,.0810347,0,195026e-10,.999893,.0810656,0,719316e-9,.999777,.0811205,0,.00259774,.999583,.081208,0,.00561807,.999281,.0813343,0,.00967472,.998813,.0814969,0,.0146627,.997597,.0815217,0,.0204902,.994379,.0808502,0,.0270802,.992744,.0806792,0,.0343674,.990745,.0804589,0,.0422974,.986646,.0796107,0,.0508242,.983611,.0790913,0,.0599087,.978869,.0780746,0,.0695175,.973475,.0768218,0,.0796223,.967845,.0754926,0,.0901983,.960778,.0737063,0,.101224,.953333,.0718052,0,.112682,.945274,.0695946,0,.124555,.936955,.0672492,0,.136831,.928319,.0647732,0,.149496,.919075,.0620947,0,.162542,.909114,.0591816,0,.175958,.900137,.0563917,0,.189739,.891069,.0535392,0,.203877,.882262,.0507642,0,.218368,.873232,.0479793,0,.233208,.864042,.045226,0,.248393,.855002,.0425413,0,.263923,.846569,.0400126,0,.279796,.837714,.0375269,0,.296012,.828918,.0352027,0,.312573,.819783,.0330011,0,.329479,.810129,.0308908,0,.346734,.800866,.0289112,0,.364342,.79093,.0270255,0,.382307,.780593,.0252758,0,.400637,.769511,.0236178,0,.419337,.758558,.0220652,0,.438418,.747632,.0206289,0,.457889,.736146,.0192873,0,.477761,.724093,.0180333,0,.49805,.71234,.0168264,0,.51877,.700201,.015746,0,.53994,.687949,.0147027,0,.561581,.676163,.0137512,0,.583718,.665001,.0128655,0,.60638,.65472,.0120366,0,.629599,.644213,.0112604,0,.653415,.633382,.0105413,0,.677874,.62212,.00986498,0,.70303,.610631,.00923308,0,.728948,.599078,.00864206,0,.755706,.587519,.00811784,0,.783396,.575505,.00761237,0,.812121,.563148,.00713949,0,.841989,.550828,.00668379,0,.873035,.538458,.00627715,0,.904762,.525905,.00588336,0,.936508,.513517,.00552687,0,.968254,.501395,.00519681,0,1,1,.0991506,0,0,1,.0991504,0,0,.999996,.0991515,0,0,.999984,.0991558,0,0,.999947,.0991672,0,114389e-9,.999874,.0991912,0,.00121503,.999739,.0992331,0,.00356108,.999514,.0992983,0,.00705578,.999159,.0993877,0,.011574,.998586,.0994837,0,.017003,.995731,.0988425,0,.0232484,.993384,.098276,0,.0302318,.991615,.0979269,0,.0378884,.989029,.0973432,0,.0461641,.985373,.0963539,0,.0550136,.981278,.0952306,0,.0643988,.975777,.0936233,0,.0742868,.970526,.0920219,0,.0846501,.963755,.0898912,0,.0954644,.956676,.0876064,0,.106709,.948099,.0847751,0,.118367,.939718,.0818638,0,.130423,.931305,.078857,0,.142862,.922342,.0756127,0,.155674,.912842,.0721473,0,.168849,.903304,.0686195,0,.182378,.89411,.0650589,0,.196255,.885512,.0616022,0,.210473,.877193,.0582434,0,.225027,.86877,.0548979,0,.239915,.860267,.0516095,0,.255132,.851915,.048468,0,.270678,.843912,.0454447,0,.286551,.83604,.0425612,0,.302751,.828245,.0398752,0,.31928,.820159,.0373198,0,.336138,.81167,.034916,0,.35333,.802659,.0326402,0,.370858,.793921,.0304901,0,.388728,.784713,.0284857,0,.406944,.774946,.0266186,0,.425515,.76448,.0248593,0,.444449,.753793,.0232114,0,.463756,.743506,.0217039,0,.483447,.732555,.0202841,0,.503535,.720965,.0189648,0,.524036,.709422,.0177189,0,.544968,.697756,.0165626,0,.56635,.685565,.015483,0,.588208,.673987,.0144892,0,.610569,.66244,.0135607,0,.633466,.651675,.0126956,0,.656936,.641598,.0118788,0,.681025,.63121,.0111261,0,.705788,.620514,.010437,0,.731289,.609366,.00978747,0,.757606,.598137,.00917257,0,.784834,.586966,.00859778,0,.813085,.575549,.00806803,0,.842485,.563797,.00757294,0,.87313,.551758,.00710592,0,.904762,.539894,.0066841,0,.936508,.527901,.00627901,0,.968254,.515819,.00590506,0,1,1,.120864,0,0,1,.120864,0,0,.999996,.120864,0,0,.99998,.120867,0,0,.99994,.120872,0,323781e-9,.999852,.120884,0,.00188693,.999693,.120903,0,.00473489,.999426,.120929,0,.00872704,.999002,.120955,0,.0137237,.998235,.120918,0,.0196068,.994608,.119764,0,.0262803,.992997,.119265,0,.0336657,.990968,.11863,0,.0416987,.987002,.117261,0,.0503261,.983524,.116009,0,.0595035,.97875,.114252,0,.0691935,.972652,.11193,0,.0793645,.966613,.109555,0,.0899894,.959275,.106612,0,.101045,.951272,.103375,0,.112512,.942323,.0996594,0,.124372,.933679,.0958841,0,.136611,.924822,.0919265,0,.149216,.915742,.0878061,0,.162176,.906348,.0834894,0,.175482,.896883,.079085,0,.189125,.88774,.0746745,0,.203098,.87986,.0705773,0,.217396,.871998,.0665005,0,.232015,.864325,.0625413,0,.24695,.856685,.0586781,0,.2622,.84925,.0550063,0,.277761,.841719,.0514727,0,.293634,.834755,.0481398,0,.309819,.827853,.0450172,0,.326315,.820888,.0420969,0,.343126,.813616,.0393702,0,.360254,.805767,.0367771,0,.377701,.797338,.0343274,0,.395474,.789122,.0320529,0,.413577,.780601,.0299485,0,.432018,.771424,.0279812,0,.450804,.761502,.0261054,0,.469944,.751166,.0243942,0,.489451,.741276,.0228087,0,.509337,.730898,.0213265,0,.529617,.719878,.0199307,0,.550307,.708379,.0186574,0,.571428,.697165,.0174446,0,.593003,.685554,.0163144,0,.615059,.673631,.015276,0,.637628,.662385,.0143003,0,.660746,.651059,.0134112,0,.68446,.640451,.0125794,0,.70882,.630536,.011793,0,.733893,.620316,.0110547,0,.759756,.609722,.0103668,0,.786505,.598804,.00973009,0,.814259,.587871,.00912812,0,.843157,.577121,.00858916,0,.87334,.566019,.00807333,0,.904762,.554664,.00759687,0,.936508,.543101,.00714759,0,.968254,.531558,.00673418,0,1,1,.146767,0,0,1,.146767,0,0,.999997,.146767,0,0,.999977,.146765,0,320658e-11,.999929,.146762,0,682576e-9,.999823,.146753,0,.00276402,.999633,.146735,0,.00614771,.999314,.146699,0,.0106613,.998796,.14662,0,.0161546,.997124,.146107,0,.0225063,.994062,.144857,0,.0296198,.992154,.144011,0,.037417,.989186,.142712,0,.0458348,.985279,.140926,0,.0548211,.980826,.13885,0,.0643326,.975056,.136168,0,.074333,.969005,.133217,0,.0847917,.961554,.12959,0,.0956828,.954206,.125886,0,.106984,.945046,.121335,0,.118675,.935678,.116492,0,.130741,.926748,.111635,0,.143166,.917764,.106625,0,.155939,.908358,.101325,0,.169049,.899219,.0960249,0,.182487,.890089,.0906527,0,.196245,.881488,.0853905,0,.210317,.874031,.0804177,0,.224697,.866932,.0756005,0,.23938,.859976,.0709019,0,.254364,.853375,.0664391,0,.269646,.846971,.0622012,0,.285223,.840483,.058129,0,.301096,.833969,.0542762,0,.317265,.82806,.0507042,0,.333729,.822128,.047368,0,.350491,.815989,.044272,0,.367554,.809336,.0413444,0,.38492,.802177,.038601,0,.402594,.79441,.0360227,0,.420582,.786573,.0336383,0,.438891,.778619,.0314321,0,.457527,.77,.029362,0,.476499,.760698,.0274102,0,.49582,.750932,.0256146,0,.5155,.740993,.023974,0,.535555,.731159,.0224182,0,.556,.720836,.0209889,0,.576855,.709913,.0196411,0,.598143,.698415,.0183824,0,.619888,.68745,.0172222,0,.642123,.676154,.0161509,0,.664883,.664383,.0151397,0,.688211,.6533,.0141873,0,.71216,.642072,.0133105,0,.736792,.631412,.0124932,0,.762186,.621622,.0117408,0,.788439,.611681,.0110358,0,.815672,.60142,.0103775,0,.844034,.59083,.00975623,0,.873699,.580254,.00918084,0,.904765,.569841,.00864721,0,.936508,.559224,.00815731,0,.968254,.548315,.00767924,0,1,1,.177563,0,0,1,.177563,0,0,.999994,.177562,0,0,.999972,.177555,0,664171e-10,.999914,.177536,0,.0012276,.999787,.177496,0,.00388025,.999556,.17742,0,.00783463,.999165,.177285,0,.0128953,.9985,.177037,0,.0189053,.995388,.175634,0,.025742,.993102,.174375,0,.033309,.990992,.173121,0,.0415298,.986932,.170896,0,.0503425,.982786,.16847,0,.0596964,.977592,.165455,0,.0695498,.971075,.161676,0,.0798676,.963967,.157458,0,.0906201,.956397,.152836,0,.101783,.947489,.147467,0,.113333,.937564,.14145,0,.125254,.928182,.135383,0,.137529,.919027,.129212,0,.150144,.909618,.12276,0,.163088,.900492,.116273,0,.176351,.891671,.1098,0,.189924,.883146,.103362,0,.203799,.875151,.0970799,0,.21797,.868338,.0911732,0,.232433,.862033,.0854966,0,.247182,.856107,.0800691,0,.262216,.850644,.0749618,0,.27753,.845261,.070079,0,.293124,.839885,.0654321,0,.308997,.834609,.0610975,0,.325149,.829083,.0569741,0,.341581,.82404,.0531736,0,.358294,.818968,.049665,0,.37529,.813496,.0463856,0,.392573,.807533,.0433217,0,.410148,.80099,.0404402,0,.428019,.793891,.0377578,0,.446192,.786281,.0352616,0,.464676,.778773,.0329577,0,.483478,.770737,.030808,0,.502608,.762094,.0287964,0,.522079,.752898,.0269254,0,.541905,.743306,.0251926,0,.5621,.733416,.023595,0,.582684,.723742,.0221155,0,.603677,.713542,.0207435,0,.625106,.702755,.019434,0,.646998,.691484,.0182046,0,.66939,.680531,.0170771,0,.692324,.66953,.0160339,0,.715849,.658126,.0150677,0,.740028,.646933,.0141551,0,.764937,.636107,.0133179,0,.790673,.625271,.0125284,0,.817358,.615225,.0117937,0,.84515,.605678,.0111181,0,.874244,.59583,.0104759,0,.904828,.585704,.00986672,0,.936508,.575413,.00929712,0,.968254,.565373,.00876713,0,1,1,.214058,0,0,.999999,.214058,0,0,.999994,.214055,0,0,.999966,.214039,0,259642e-9,.999893,.213998,0,.00200075,.999737,.21391,0,.00527775,.999449,.213745,0,.00983959,.99896,.213458,0,.0154755,.9979,.212855,0,.0220249,.994278,.210779,0,.0293654,.992254,.20926,0,.0374021,.98881,.206908,0,.0460604,.984715,.204009,0,.0552802,.979738,.200471,0,.0650127,.972884,.195813,0,.0752175,.965996,.190856,0,.0858612,.957974,.185077,0,.0969155,.949155,.17868,0,.108356,.939288,.171513,0,.120163,.928996,.163838,0,.132319,.919563,.156246,0,.144808,.910004,.148359,0,.157618,.900791,.140417,0,.170737,.892135,.132569,0,.184155,.883803,.124741,0,.197866,.876034,.117091,0,.211861,.869219,.109835,0,.226134,.863062,.102859,0,.240682,.857795,.0962928,0,.255499,.853009,.0900725,0,.270583,.848603,.0842101,0,.285931,.844335,.0786527,0,.301542,.840208,.0734397,0,.317415,.836035,.0685334,0,.33355,.83172,.0639275,0,.349948,.827135,.0595909,0,.36661,.822797,.0556204,0,.383539,.818387,.0519394,0,.400738,.813565,.0485317,0,.41821,.808142,.0453138,0,.435961,.802212,.0423354,0,.453997,.79573,.0395553,0,.472324,.788741,.036988,0,.490951,.781093,.0345688,0,.509887,.773597,.0323297,0,.529144,.765622,.0302719,0,.548735,.757083,.0283477,0,.568674,.747992,.0265562,0,.588979,.738591,.0248844,0,.609671,.728719,.0233342,0,.630773,.719146,.0219081,0,.652314,.709165,.0205711,0,.674328,.69875,.0193248,0,.696854,.687884,.0181582,0,.719942,.676818,.0170746,0,.743651,.666247,.0160718,0,.768057,.655284,.0151262,0,.793253,.64401,.0142561,0,.819363,.633353,.0134327,0,.846547,.622674,.012653,0,.875017,.612265,.0119354,0,.905021,.602455,.0112533,0,.936508,.593147,.0106234,0,.968254,.583592,.0100213,0,1,1,.25717,0,0,1,.25717,0,0,.999992,.257164,0,0,.999958,.257135,0,641715e-9,.999864,.25706,0,.00305314,.999666,.256897,0,.00700975,.999302,.256596,0,.0122194,.998663,.25607,0,.0184622,.995607,.254123,0,.0255773,.993094,.252081,0,.0334439,.9907,.249867,0,.0419696,.98594,.246118,0,.0510823,.981214,.242049,0,.0607242,.974966,.236869,0,.0708486,.967589,.230724,0,.081417,.95915,.223635,0,.0923974,.950257,.21596,0,.103763,.940165,.207296,0,.115491,.929396,.197901,0,.127562,.919288,.188437,0,.13996,.909428,.178762,0,.15267,.900105,.169072,0,.165679,.891418,.159478,0,.178979,.883347,.15002,0,.192558,.875992,.140813,0,.20641,.869466,.13196,0,.220529,.863699,.123501,0,.234907,.858553,.115436,0,.249542,.854379,.107901,0,.264428,.850894,.10088,0,.279564,.847632,.0942296,0,.294947,.844571,.0879861,0,.310575,.84163,.0821534,0,.326448,.838542,.0766409,0,.342566,.835412,.0715322,0,.358929,.831899,.0666883,0,.37554,.828177,.0622175,0,.392399,.82416,.0580452,0,.409511,.820393,.054267,0,.426878,.816068,.0507172,0,.444506,.811201,.0474041,0,.4624,.805785,.0443174,0,.480566,.799878,.0414562,0,.499013,.793469,.0388147,0,.517749,.786473,.0363453,0,.536785,.778874,.0340225,0,.556134,.771277,.0318599,0,.575809,.763426,.0298859,0,.595827,.755044,.0280357,0,.616207,.746161,.0262979,0,.636973,.737124,.0247295,0,.65815,.72761,.0232514,0,.679772,.717822,.0218755,0,.701876,.708279,.0205942,0,.724509,.698333,.0193947,0,.74773,.68802,.0182717,0,.771609,.677321,.0172044,0,.79624,.666504,.0162122,0,.821743,.656184,.0152924,0,.84828,.64556,.0144326,0,.876069,.634636,.0136157,0,.905404,.624124,.0128612,0,.936508,.613914,.0121435,0,.968254,.603589,.0114887,0,1,1,.307946,0,0,.999999,.307945,0,0,.999988,.307934,0,204479e-10,.999944,.307886,0,.00127833,.999824,.307756,0,.00445047,.999565,.30748,0,.00914673,.999085,.306966,0,.0150498,.998103,.306004,0,.0219367,.994249,.303028,0,.0296485,.991807,.300435,0,.038068,.987773,.296554,0,.0471062,.982673,.2916,0,.0566942,.976623,.285641,0,.0667768,.968757,.27815,0,.0773099,.959849,.269529,0,.088257,.950663,.260248,0,.0995879,.940129,.249704,0,.111277,.92895,.238291,0,.123304,.917996,.226501,0,.13565,.907813,.214669,0,.148299,.898305,.202835,0,.161237,.889626,.191158,0,.174455,.88175,.179695,0,.187941,.874715,.168548,0,.201687,.868746,.15792,0,.215687,.863703,.147807,0,.229933,.859315,.138149,0,.24442,.855538,.128993,0,.259145,.852428,.120414,0,.274103,.850168,.112498,0,.289293,.848132,.105054,0,.304711,.846291,.0981087,0,.320357,.844431,.0915942,0,.33623,.842493,.0855056,0,.35233,.840368,.0798204,0,.368658,.83798,.0745097,0,.385214,.83523,.0695424,0,.402002,.832091,.0649092,0,.419023,.828667,.0606291,0,.436282,.824805,.0566523,0,.453782,.820988,.0530229,0,.471529,.816635,.0496364,0,.489528,.811725,.0464658,0,.507788,.806316,.0435082,0,.526317,.800469,.0407873,0,.545124,.794107,.038255,0,.564221,.787218,.0358825,0,.583621,.779872,.0336785,0,.603341,.772097,.0316379,0,.623397,.764484,.0297379,0,.643812,.756428,.0279581,0,.664611,.748022,.0263153,0,.685824,.739268,.0247799,0,.707488,.73024,.0233385,0,.729646,.720893,.0220035,0,.752354,.71119,.0207555,0,.77568,.701791,.0195843,0,.799715,.692184,.0184891,0,.824574,.682258,.0174541,0,.850417,.67206,.0164873,0,.877466,.661717,.0155959,0,.90604,.651462,.0147519,0,.936528,.641467,.0139727,0,.968254,.631229,.0132363,0,1,1,.367573,0,0,.999999,.367571,0,0,.999984,.367553,0,183382e-9,.999925,.367473,0,.00225254,.999759,.367259,0,.00628165,.99941,.366801,0,.0117858,.998739,.365946,0,.0184359,.995529,.363191,0,.0260114,.992875,.360171,0,.0343581,.989135,.355981,0,.0433637,.984166,.350401,0,.0529438,.977871,.343348,0,.0630334,.96951,.334341,0,.0735805,.959964,.323862,0,.0845437,.950162,.312521,0,.095889,.938882,.299577,0,.107588,.926992,.285573,0,.119617,.915589,.271212,0,.131957,.904791,.256611,0,.144591,.895177,.242224,0,.157503,.886403,.227952,0,.170682,.878957,.214192,0,.184117,.872418,.200795,0,.197799,.867029,.188015,0,.21172,.862835,.175975,0,.225873,.859411,.164526,0,.240253,.856655,.153693,0,.254854,.854519,.14352,0,.269673,.852828,.13397,0,.284707,.851412,.124984,0,.299953,.850609,.116748,0,.315408,.849855,.10905,0,.331073,.849017,.101839,0,.346946,.848079,.0951359,0,.363028,.846911,.0888774,0,.379318,.845445,.0830375,0,.395818,.84362,.0775844,0,.41253,.841411,.0725054,0,.429457,.838768,.0677691,0,.446602,.835801,.0634016,0,.463968,.832341,.0593095,0,.481561,.828424,.0555121,0,.499386,.824312,.052024,0,.51745,.819918,.0487865,0,.535761,.815072,.0457801,0,.554328,.809863,.0430184,0,.573162,.804164,.0404245,0,.592275,.798034,.0380146,0,.611681,.791436,.0357436,0,.631398,.784498,.0336475,0,.651445,.777125,.0316666,0,.671845,.769365,.0298122,0,.692628,.761579,.0281001,0,.713827,.753746,.0265049,0,.735484,.745573,.0250067,0,.75765,.737083,.0236026,0,.78039,.728545,.0223302,0,.803789,.719691,.0211243,0,.82796,.710569,.0199983,0,.853056,.701216,.0189569,0,.879298,.692094,.0179702,0,.907014,.682909,.0170418,0,.936691,.673509,.0161732,0,.968254,.663863,.0153406,0,1,1,.437395,0,0,.999998,.437394,0,0,.99998,.437363,0,616704e-9,.999891,.437232,0,.00367925,.999656,.436877,0,.00867446,.999148,.436121,0,.0150679,.997959,.434564,0,.022531,.993464,.430134,0,.0308507,.990606,.426077,0,.0398805,.985027,.419397,0,.0495148,.978491,.41118,0,.0596749,.969643,.40048,0,.0703001,.959189,.38769,0,.0813427,.948223,.373575,0,.0927641,.935955,.357622,0,.104533,.923237,.34043,0,.116624,.911074,.322735,0,.129015,.899724,.30479,0,.141687,.890189,.287392,0,.154626,.881796,.270248,0,.167818,.874781,.253659,0,.181252,.869166,.237786,0,.194918,.864725,.222618,0,.208807,.861565,.208356,0,.222913,.859284,.194867,0,.237229,.857677,.18212,0,.25175,.856714,.17018,0,.266473,.856155,.158969,0,.281392,.8558,.148413,0,.296505,.855672,.138578,0,.311811,.855538,.129345,0,.327306,.855689,.120861,0,.342991,.855767,.112969,0,.358864,.855618,.105593,0,.374925,.85525,.0987451,0,.391176,.854583,.0923727,0,.407616,.853534,.0864143,0,.424249,.852061,.0808338,0,.441076,.850253,.0756771,0,.4581,.848004,.0708612,0,.475324,.845333,.0663784,0,.492754,.842376,.0622631,0,.510394,.838956,.0584112,0,.528251,.835121,.0548328,0,.546331,.830842,.0514838,0,.564644,.826212,.048355,0,.583198,.821522,.0454714,0,.602005,.816551,.0428263,0,.621078,.811211,.0403612,0,.640434,.805479,.038039,0,.660089,.799409,.0358739,0,.680066,.79306,.0338727,0,.70039,.786395,.0319985,0,.721094,.779416,.030241,0,.742215,.77214,.0285951,0,.7638,.764636,.0270747,0,.785912,.756836,.0256354,0,.808628,.749315,.0243027,0,.832055,.741561,.0230497,0,.856338,.733589,.0218801,0,.88169,.725479,.020784,0,.908441,.717255,.0197702,0,.937125,.708829,.0188168,0,.968254,.700191,.0179113,0,1,1,.518937,0,0,.999998,.518933,0,0,.999967,.518883,0,.00147741,.999832,.51866,0,.00573221,.999466,.518057,0,.011826,.998644,.516752,0,.0192116,.994458,.512347,0,.027573,.991223,.507675,0,.0367099,.985515,.500188,0,.046487,.978308,.490408,0,.0568071,.968359,.477357,0,.0675984,.95682,.461752,0,.0788059,.943929,.443796,0,.090386,.930224,.423893,0,.102304,.916514,.402682,0,.114532,.903653,.380914,0,.127047,.892315,.359212,0,.139828,.882942,.338102,0,.152861,.875438,.31773,0,.16613,.869642,.298186,0,.179624,.865304,.279491,0,.193332,.862382,.261804,0,.207247,.860666,.245146,0,.22136,.859788,.229406,0,.235666,.859608,.214605,0,.250158,.859912,.200691,0,.264832,.86053,.187623,0,.279684,.861368,.17539,0,.294711,.862237,.163901,0,.309911,.863127,.153175,0,.32528,.863923,.143147,0,.340819,.864567,.133781,0,.356524,.865013,.125042,0,.372397,.86539,.116952,0,.388438,.865591,.109476,0,.404645,.865517,.102542,0,.421022,.865084,.0960688,0,.437569,.864309,.0900499,0,.454287,.863151,.0844328,0,.471181,.861649,.0792218,0,.488253,.859742,.0743482,0,.505507,.857446,.0697963,0,.522947,.854757,.0655364,0,.54058,.851783,.061608,0,.558412,.848516,.0579701,0,.576449,.844897,.0545742,0,.594701,.840956,.0514167,0,.613178,.836676,.0484598,0,.631892,.832075,.0456934,0,.650856,.827191,.0431178,0,.670088,.822295,.0407718,0,.689606,.817294,.0386032,0,.709434,.812013,.0365675,0,.7296,.806465,.0346547,0,.750138,.800691,.0328717,0,.771093,.794709,.031211,0,.792519,.788493,.0296504,0,.814488,.782049,.0281782,0,.837097,.775403,.0267965,0,.860481,.76857,.0255002,0,.884842,.761536,.0242759,0,.910494,.754303,.0231142,0,.937985,.74692,.0220305,0,.968254,.739745,.0210192,0,1,1,.613914,0,0,.999996,.613907,0,963597e-10,.999942,.613814,0,.00301247,.999704,.613407,0,.00870385,.999046,.612302,0,.0160714,.995516,.608266,0,.0245899,.991726,.602863,0,.0339681,.985157,.593956,0,.0440254,.97642,.581748,0,.0546409,.964404,.565183,0,.0657284,.950601,.545273,0,.0772246,.935158,.522129,0,.0890812,.919364,.496782,0,.10126,.904754,.470571,0,.113731,.89176,.444037,0,.126469,.881492,.418322,0,.139454,.873656,.393522,0,.15267,.868053,.369795,0,.166101,.864336,.347171,0,.179736,.862259,.325737,0,.193565,.861556,.305532,0,.207578,.861776,.286416,0,.221769,.862661,.268355,0,.23613,.864015,.251334,0,.250656,.865711,.235352,0,.265343,.867519,.220302,0,.280187,.869351,.206161,0,.295183,.871144,.192908,0,.31033,.872839,.180505,0,.325624,.874307,.168848,0,.341065,.875667,.158021,0,.35665,.876758,.147877,0,.37238,.87764,.138441,0,.388253,.878237,.129627,0,.404269,.878563,.121415,0,.42043,.878572,.113741,0,.436735,.87842,.106652,0,.453187,.878057,.100097,0,.469786,.877413,.0940128,0,.486536,.87646,.0883462,0,.503439,.875233,.0830924,0,.520498,.8737,.0781975,0,.537717,.871873,.07364,0,.555102,.86978,.0694103,0,.572657,.867405,.0654696,0,.59039,.864751,.0617914,0,.608307,.861818,.0583491,0,.626419,.858645,.0551443,0,.644733,.855307,.0521894,0,.663264,.851736,.0494334,0,.682025,.847927,.0468504,0,.701032,.843888,.0444261,0,.720308,.839629,.0421497,0,.739875,.835158,.0400082,0,.759764,.830509,.0380076,0,.780014,.825714,.0361488,0,.800673,.820729,.0343956,0,.821803,.815751,.0327781,0,.843492,.810752,.031275,0,.86586,.805587,.0298542,0,.889087,.800317,.0285397,0,.913466,.79489,.0272948,0,.93952,.789314,.0261139,0,.96835,.783593,.0249938,0,1,1,.724258,0,0,.999992,.724243,0,726889e-9,.99987,.724044,0,.00569574,.999336,.72317,0,.0131702,.996271,.719432,0,.0220738,.991159,.712576,0,.0319405,.982465,.700927,0,.0425202,.97049,.684297,0,.0536599,.953973,.661244,0,.065258,.935546,.633804,0,.0772427,.916596,.603071,0,.0895616,.899353,.57105,0,.102175,.885216,.539206,0,.11505,.875076,.508714,0,.128164,.868334,.479571,0,.141495,.864414,.451796,0,.155026,.862678,.425328,0,.168745,.862835,.400352,0,.182639,.864067,.376532,0,.196699,.866086,.35391,0,.210915,.868557,.332424,0,.225282,.871271,.312053,0,.239792,.874058,.292764,0,.25444,.8768,.27453,0,.269223,.87939,.257297,0,.284135,.8819,.24114,0,.299174,.884187,.225934,0,.314337,.886262,.211669,0,.329622,.888119,.198311,0,.345026,.889709,.185783,0,.360549,.891054,.174063,0,.376189,.892196,.163143,0,.391946,.893101,.152952,0,.407819,.893803,.143475,0,.423808,.894277,.134647,0,.439914,.894532,.126434,0,.456137,.894576,.1188,0,.472479,.894393,.111694,0,.48894,.893976,.105069,0,.505523,.893346,.0989077,0,.52223,.892502,.0931724,0,.539064,.891441,.0878276,0,.556028,.890276,.082903,0,.573125,.888972,.0783505,0,.590361,.887469,.0741083,0,.607741,.885785,.0701633,0,.62527,.883914,.0664835,0,.642957,.881872,.0630567,0,.660809,.879651,.0598527,0,.678836,.877267,.0568615,0,.69705,.874717,.05406,0,.715465,.872012,.0514378,0,.734098,.869157,.0489805,0,.752968,.866155,.0466727,0,.772101,.863014,.0445056,0,.791529,.859748,.0424733,0,.81129,.856416,.0405957,0,.831438,.852958,.0388273,0,.852044,.849382,.0371619,0,.87321,.845694,.0355959,0,.89509,.841893,.0341155,0,.917932,.837981,.0327141,0,.942204,.833963,.0313856,0,.968981,.829847,.0301275,0,1,1,.85214,0,0,.999969,.852095,0,.00279627,.999483,.851408,0,.0107635,.994545,.84579,0,.0206454,.986188,.835231,0,.0315756,.969847,.814687,0,.0432021,.945951,.783735,0,.0553396,.91917,.746074,0,.0678766,.895488,.706938,0,.0807395,.878232,.669534,0,.0938767,.868252,.635168,0,.10725,.863873,.603069,0,.120832,.863369,.572514,0,.134598,.86545,.543169,0,.148533,.868803,.514578,0,.16262,.872794,.486762,0,.176849,.87702,.459811,0,.19121,.881054,.433654,0,.205694,.884974,.408574,0,.220294,.888587,.384525,0,.235005,.891877,.36156,0,.24982,.894793,.339661,0,.264737,.89743,.318913,0,.279751,.899796,.299302,0,.294859,.901943,.280843,0,.310058,.903858,.263481,0,.325346,.905574,.247197,0,.340721,.907069,.231915,0,.356181,.908379,.217614,0,.371725,.90952,.20425,0,.387353,.910483,.191758,0,.403063,.91128,.180092,0,.418854,.911936,.169222,0,.434727,.912454,.159098,0,.450682,.912835,.149668,0,.466718,.913078,.140884,0,.482837,.913192,.132709,0,.499038,.913175,.125095,0,.515324,.91304,.118012,0,.531695,.912781,.111417,0,.548153,.91241,.105281,0,.5647,.911924,.0995691,0,.581338,.911331,.0942531,0,.59807,.910637,.0893076,0,.6149,.90984,.0846998,0,.63183,.908941,.0804044,0,.648865,.907944,.0763984,0,.666011,.906857,.0726638,0,.683273,.90568,.0691783,0,.700659,.904416,.0659222,0,.718176,.903067,.0628782,0,.735834,.901637,.0600307,0,.753646,.900128,.0573647,0,.771625,.898544,.0548668,0,.78979,.89689,.052527,0,.808162,.895165,.0503306,0,.826771,.893371,.0482668,0,.845654,.891572,.0463605,0,.864863,.889763,.0445998,0,.884472,.887894,.0429451,0,.904592,.885967,.0413884,0,.925407,.883984,.0399225,0,.947271,.881945,.0385405,0,.97105,.879854,.0372362,0,1,.999804,.995833,0,0,.938155,.933611,0,.0158731,.864755,.854311,0,.0317461,.888594,.865264,0,.0476191,.905575,.863922,0,.0634921,.915125,.850558,0,.0793651,.920665,.829254,0,.0952381,.924073,.802578,0,.111111,.926304,.772211,0,.126984,.927829,.739366,0,.142857,.928924,.705033,0,.15873,.92973,.670019,0,.174603,.930339,.634993,0,.190476,.930811,.600485,0,.206349,.931191,.566897,0,.222222,.93149,.534485,0,.238095,.931737,.503429,0,.253968,.931939,.473811,0,.269841,.932108,.445668,0,.285714,.93225,.418993,0,.301587,.932371,.393762,0,.31746,.932474,.369939,0,.333333,.932562,.347479,0,.349206,.932638,.326336,0,.365079,.932703,.306462,0,.380952,.93276,.287805,0,.396825,.932809,.270313,0,.412698,.932851,.253933,0,.428571,.932887,.23861,0,.444444,.932917,.224289,0,.460317,.932943,.210917,0,.47619,.932965,.19844,0,.492063,.932982,.186807,0,.507937,.932995,.175966,0,.52381,.933005,.165869,0,.539683,.933011,.156468,0,.555556,.933013,.147719,0,.571429,.933013,.139579,0,.587302,.93301,.132007,0,.603175,.933004,.124965,0,.619048,.932994,.118416,0,.634921,.932982,.112326,0,.650794,.932968,.106663,0,.666667,.93295,.101397,0,.68254,.932931,.0964993,0,.698413,.932908,.0919438,0,.714286,.932883,.0877057,0,.730159,.932856,.0837623,0,.746032,.932827,.0800921,0,.761905,.932796,.0766754,0,.777778,.932762,.0734936,0,.793651,.932727,.0705296,0,.809524,.932689,.0677676,0,.825397,.93265,.0651929,0,.84127,.932609,.0627917,0,.857143,.932565,.0605515,0,.873016,.932521,.0584606,0,.888889,.932474,.0565082,0,.904762,.932427,.0546841,0,.920635,.932377,.0529793,0,.936508,.932326,.0513851,0,.952381,.932274,.0498936,0,.968254,.93222,.0484975,0,.984127,.932164,.0471899,0,1],n=new Float32Array(e),r=new Float32Array(t);mn.LTC_FLOAT_1=new _s(n,64,64,1023,1015,300,1001,1001,1006,1003,1),mn.LTC_FLOAT_2=new _s(r,64,64,1023,1015,300,1001,1001,1006,1003,1),mn.LTC_FLOAT_1.needsUpdate=!0,mn.LTC_FLOAT_2.needsUpdate=!0;const i=new Uint16Array(e.length);e.forEach((function(e,t){i[t]=Zc.toHalfFloat(e)}));const s=new Uint16Array(t.length);t.forEach((function(e,t){s[t]=Zc.toHalfFloat(e)})),mn.LTC_HALF_1=new _s(i,64,64,1023,1016,300,1001,1001,1006,1003,1),mn.LTC_HALF_2=new _s(s,64,64,1023,1016,300,1001,1001,1006,1003,1),mn.LTC_HALF_1.needsUpdate=!0,mn.LTC_HALF_2.needsUpdate=!0}}.init()}createAmbientLight(e){const{id:t,name:n="",color:r=10132122,intensity:i=1}=e,s=new wl(r,i);return s.name=n,s.userData.sid=t,s.userData.stype="Light",this.viewport.scener.addObject(s,this.scene),s}setAmbientLight(e){const{id:t,name:n="",color:r=10132122,intensity:i=1}=e,s=this.getById(t);return!!s&&(s.name=n,s.color=new P(r),s.intensity=i,this.viewport.signals.objectChanged.dispatch(),!0)}createDirectionalLight(e){const{id:t,name:n="",color:r=10132122,intensity:i=1,position:s={x:1e3,y:1e3,z:1e3},target:o={x:-1e3,y:-1e3,z:-1e3},openShadow:a=!1,shadowAutoUpdate:l=!1,mapSize:c=4096}=e,h=new xl(r,i);if(h.name=n,h.userData.sid=t,h.userData.stype="Light",h.position.set(s.x,s.y,s.z),h.target.position.set(o.x,o.y,o.z),h.castShadow=a,a){const e=h.position.distanceTo(h.target.position);h.shadow.camera.left=-e,h.shadow.camera.right=e,h.shadow.camera.top=e,h.shadow.camera.bottom=-e,h.shadow.camera.far=e,h.shadow.autoUpdate=l,h.shadow.mapSize.width=c,h.shadow.mapSize.height=c,h.shadow.camera.updateProjectionMatrix()}return this.viewport.scener.addObject(h,this.scene),this.viewport.scener.addObject(h.target,this.scene),h}setDirectionalLight(e){const{id:t,name:n="",color:r=10132122,intensity:i=1,position:s={x:1e3,y:1e3,z:1e3},target:o={x:-1e3,y:-1e3,z:-1e3},openShadow:a=!1,shadowAutoUpdate:l=!1,mapSize:c=4096}=e,h=this.getById(t);if(!h)return!1;if(h.name=n,h.color=new P(r),h.intensity=i,h.position.set(s.x,s.y,s.z),h.target.position.set(o.x,o.y,o.z),h.castShadow=a,a){const e=h.position.distanceTo(h.target.position);h.shadow.camera.left=-e,h.shadow.camera.right=e,h.shadow.camera.top=e,h.shadow.camera.bottom=-e,h.shadow.camera.far=e,h.shadow.autoUpdate=l,h.shadow.mapSize.width=c,h.shadow.mapSize.height=c,h.shadow.camera.updateProjectionMatrix()}return this.viewport.signals.objectChanged.dispatch(),!0}createHemisphereLight(e){const{id:t,name:n="",skyColor:r=16777215,groundColor:i=14540253,intensity:s=1,position:o={x:0,y:0,z:0}}=e,a=new ol(r,i,s);return a.name=n,a.position.set(o.x,o.y,o.z),a.userData.sid=t,a.userData.stype="Light",this.viewport.scener.addObject(a,this.scene),a}setHemisphereLight(e){const{id:t,name:n="",skyColor:r=16777215,groundColor:i=14540253,intensity:s=1,position:o={x:0,y:0,z:0}}=e,a=this.getById(t);return!!a&&(a.name=n,a.color=new P(r),a.groundColor=new P(i),a.intensity=s,a.position.set(o.x,o.y,o.z),this.viewport.signals.objectChanged.dispatch(),!0)}createSpotLight(e){const{id:t,name:n="",color:r=16777215,intensity:i=1,angle:s=45,position:o={x:0,y:500,z:0},target:a={x:0,y:0,z:0},openShadow:l=!1,shadowAutoUpdate:c=!1,mapSize:h=4096}=e,u=Hh(o).distanceTo(Hh(a)),d=new dl(r,i,u,Math.PI/360*s,0,0);if(d.name=n,d.position.set(o.x,o.y,o.z),d.userData.sid=t,d.userData.stype="Light",d.castShadow=l,d.target.position.set(a.x,a.y,a.z),d.target.castShadow=l,d.target.receiveShadow=!0,d.target.updateMatrixWorld(),l){const e=d.position.distanceTo(d.target.position);d.shadow.autoUpdate=c,d.shadow.mapSize.width=h,d.shadow.mapSize.height=h,d.shadow.focus=.6,d.shadow.camera.far=e,d.shadow.camera.updateProjectionMatrix()}return this.viewport.scener.addObject(d,this.scene),d}setSpotLight(e){const{id:t,name:n="",color:r=16777215,intensity:i=1,angle:s=45,position:o={x:0,y:500,z:0},target:a={x:0,y:0,z:0},openShadow:l=!1,shadowAutoUpdate:c=!1,mapSize:h=4096}=e,u=this.getById(t);if(!u)return!1;const d=Hh(o).distanceTo(Hh(a));if(u.name=n,u.color=new P(r),u.intensity=i,u.distance=d,u.angle=Math.PI/360*s,u.position.set(o.x,o.y,o.z),u.castShadow=l,u.target.position.set(a.x,a.y,a.z),u.target.castShadow=l,u.target.updateMatrixWorld(),l){const e=u.position.distanceTo(u.target.position);u.shadow.autoUpdate=c,u.shadow.mapSize.width=h,u.shadow.mapSize.height=h,u.shadow.focus=.6,u.shadow.camera.far=e,u.shadow.camera.updateProjectionMatrix()}return this.viewport.signals.objectChanged.dispatch(),!0}createPointLight(e){const{id:t,name:n="",color:r=16777215,intensity:i=1,distance:s=5e3,position:o={x:0,y:500,z:0},openShadow:a=!1,shadowAutoUpdate:l=!1,mapSize:c=4096}=e,h=new vl(r,i,s);return h.name=n,h.userData.sid=t,h.userData.stype="Light",h.position.set(o.x,o.y,o.z),h.castShadow=a,a&&(h.shadow.camera.far=s,h.shadow.autoUpdate=l,h.shadow.mapSize.width=c,h.shadow.mapSize.height=c,h.shadow.camera.updateProjectionMatrix()),this.viewport.scener.addObject(h,this.scene),h}setPointLight(e){const{id:t,name:n="",color:r=16777215,intensity:i=1,distance:s=5e3,position:o={x:0,y:500,z:0},openShadow:a=!1,shadowAutoUpdate:l=!1,mapSize:c=4096}=e,h=this.getById(t);return!!h&&(h.name=n,h.color=new P(r),h.intensity=i,h.distance=s,h.position.set(o.x,o.y,o.z),h.castShadow=a,a&&(h.shadow.camera.far=s,h.shadow.autoUpdate=l,h.shadow.mapSize.width=c,h.shadow.mapSize.height=c,h.shadow.camera.updateProjectionMatrix()),this.viewport.signals.objectChanged.dispatch(),!0)}createRectAreaLight(e){const{id:t,name:n="",color:r=16777215,intensity:i=1,width:s=10,height:o=10,position:a={x:0,y:0,z:0}}=e,l=new bl(r,i,s,o);return l.name=n,l.userData.sid=t,l.userData.stype="Light",l.position.set(a.x,a.y,a.z),this.viewport.scener.addObject(l,this.scene),l}setRectAreaLight(e){const{id:t,name:n="",color:r=16777215,intensity:i=1,width:s=10,height:o=10,position:a={x:0,y:0,z:0}}=e,l=this.getById(t);return!!l&&(l.name=n,l.color=new P(r),l.intensity=i,l.width=s,l.height=o,l.position.set(a.x,a.y,a.z),this.viewport.signals.objectChanged.dispatch(),!0)}updateAllShadow(){this.getAll().forEach((e=>{var t;!1===(null===(t=e.shadow)||void 0===t?void 0:t.autoUpdate)&&(e.shadow.needsUpdate=!0)})),this.viewport.signals.objectChanged.dispatch()}}
|
|
36
|
+
/*!
|
|
37
|
+
localForage -- Offline Storage, Improved
|
|
38
|
+
Version 1.9.0
|
|
39
|
+
https://localforage.github.io/localForage
|
|
40
|
+
(c) 2013-2017 Mozilla, Apache License 2.0
|
|
41
|
+
*/var Qp,Kp=(function(e,t){e.exports=function e(t,n,r){function i(o,a){if(!n[o]){if(!t[o]){if(!a&&vd)return vd(o);if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[o]={exports:{}};t[o][0].call(c.exports,(function(e){return i(t[o][1][e]||e)}),c,c.exports,e,t,n,r)}return n[o].exports}for(var s=vd,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){(function(e){var n,r,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var s=0,o=new i(h),a=e.document.createTextNode("");o.observe(a,{characterData:!0}),n=function(){a.data=s=++s%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){h(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(h,0)};else{var l=new e.MessageChannel;l.port1.onmessage=h,n=function(){l.port2.postMessage(0)}}var c=[];function h(){var e,t;r=!0;for(var n=c.length;n;){for(t=c,c=[],e=-1;++e<n;)t[e]();n=c.length}r=!1}t.exports=function(e){1!==c.push(e)||r||n()}}).call(this,void 0!==gd?gd:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){var r=e(1);function i(){}var s={},o=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function c(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,e!==i&&p(this,e)}function h(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function u(e,t,n){r((function(){var r;try{r=t(n)}catch(t){return s.reject(e,t)}r===e?s.reject(e,new TypeError("Cannot resolve promise with itself")):s.resolve(e,r)}))}function d(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function p(e,t){var n=!1;function r(t){n||(n=!0,s.reject(e,t))}function i(t){n||(n=!0,s.resolve(e,t))}var o=f((function(){t(i,r)}));"error"===o.status&&r(o.value)}function f(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}t.exports=c,c.prototype.catch=function(e){return this.then(null,e)},c.prototype.then=function(e,t){if("function"!=typeof e&&this.state===a||"function"!=typeof t&&this.state===o)return this;var n=new this.constructor(i);return this.state!==l?u(n,this.state===a?e:t,this.outcome):this.queue.push(new h(n,e,t)),n},h.prototype.callFulfilled=function(e){s.resolve(this.promise,e)},h.prototype.otherCallFulfilled=function(e){u(this.promise,this.onFulfilled,e)},h.prototype.callRejected=function(e){s.reject(this.promise,e)},h.prototype.otherCallRejected=function(e){u(this.promise,this.onRejected,e)},s.resolve=function(e,t){var n=f(d,t);if("error"===n.status)return s.reject(e,n.value);var r=n.value;if(r)p(e,r);else{e.state=a,e.outcome=t;for(var i=-1,o=e.queue.length;++i<o;)e.queue[i].callFulfilled(t)}return e},s.reject=function(e,t){e.state=o,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},c.resolve=function(e){return e instanceof this?e:s.resolve(new this(i),e)},c.reject=function(e){var t=new this(i);return s.reject(t,e)},c.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=new Array(n),a=0,l=-1,c=new this(i);++l<n;)h(e[l],l);return c;function h(e,i){t.resolve(e).then((function(e){o[i]=e,++a!==n||r||(r=!0,s.resolve(c,o))}),(function(e){r||(r=!0,s.reject(c,e))}))}},c.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=-1,a=new this(i);++o<n;)l(e[o]);return a;function l(e){t.resolve(e).then((function(e){r||(r=!0,s.resolve(a,e))}),(function(e){r||(r=!0,s.reject(a,e))}))}}},{1:1}],3:[function(e,t,n){(function(t){"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==gd?gd:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}();function s(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var o=Promise;function a(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function l(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e.catch(n)}function c(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function h(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var u="local-forage-detect-blob-support",d=void 0,p={},f=Object.prototype.toString,m="readonly",g="readwrite";function v(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i<t;i++)r[i]=e.charCodeAt(i);return n}function y(e){return"boolean"==typeof d?o.resolve(d):function(e){return new o((function(t){var n=e.transaction(u,g),r=s([""]);n.objectStore(u).put(r,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}(e).then((function(e){return d=e}))}function x(e){var t=p[e.name],n={};n.promise=new o((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function w(e){var t=p[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function b(e,t){var n=p[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function _(e,t){return new o((function(n,r){if(p[e.name]=p[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return n(e.db);x(e),e.db.close()}var s=[e.name];t&&s.push(e.version);var o=i.open.apply(i,s);t&&(o.onupgradeneeded=function(t){var n=o.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(u)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),o.onerror=function(e){e.preventDefault(),r(o.error)},o.onsuccess=function(){n(o.result),w(e)}}))}function M(e){return _(e,!1)}function S(e){return _(e,!0)}function T(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),r=e.version<e.db.version,i=e.version>e.db.version;if(r&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||n){if(n){var s=e.db.version+1;s>e.version&&(e.version=s)}return!0}return!1}function E(e){return s([v(atob(e.data))],{type:e.type})}function A(e){return e&&e.__local_forage_encoded_blob}function C(e){var t=this,n=t._initReady().then((function(){var e=p[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return l(n,e,e),n}function P(e,t,n,r){void 0===r&&(r=1);try{var i=e.db.transaction(e.storeName,t);n(null,i)}catch(i){if(r>0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return o.resolve().then((function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),S(e)})).then((function(){return function(e){x(e);for(var t=p[e.name],n=t.forages,r=0;r<n.length;r++){var i=n[r];i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null)}return e.db=null,M(e).then((function(t){return e.db=t,T(e)?S(e):t})).then((function(r){e.db=t.db=r;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=r})).catch((function(t){throw b(e,t),t}))}(e).then((function(){P(e,t,n,r-1)}))})).catch(n);n(i)}}var R={_driver:"asyncStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=e[r];var i=p[n.name];i||(i={forages:[],db:null,dbReady:null,deferredOperations:[]},p[n.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=C);var s=[];function a(){return o.resolve()}for(var l=0;l<i.forages.length;l++){var c=i.forages[l];c!==t&&s.push(c._initReady().catch(a))}var h=i.forages.slice(0);return o.all(s).then((function(){return n.db=i.db,M(n)})).then((function(e){return n.db=e,T(n,t._defaultConfig.version)?S(n):e})).then((function(e){n.db=i.db=e,t._dbInfo=n;for(var r=0;r<h.length;r++){var s=h[r];s!==t&&(s._dbInfo.db=n.db,s._dbInfo.version=n.version)}}))},_support:function(){try{if(!i||!i.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}(),iterate:function(e,t){var n=this,r=new o((function(t,r){n.ready().then((function(){P(n._dbInfo,m,(function(i,s){if(i)return r(i);try{var o=s.objectStore(n._dbInfo.storeName).openCursor(),a=1;o.onsuccess=function(){var n=o.result;if(n){var r=n.value;A(r)&&(r=E(r));var i=e(r,n.key,a++);void 0!==i?t(i):n.continue()}else t()},o.onerror=function(){r(o.error)}}catch(e){r(e)}}))})).catch(r)}));return a(r,t),r},getItem:function(e,t){var n=this;e=c(e);var r=new o((function(t,r){n.ready().then((function(){P(n._dbInfo,m,(function(i,s){if(i)return r(i);try{var o=s.objectStore(n._dbInfo.storeName).get(e);o.onsuccess=function(){var e=o.result;void 0===e&&(e=null),A(e)&&(e=E(e)),t(e)},o.onerror=function(){r(o.error)}}catch(e){r(e)}}))})).catch(r)}));return a(r,t),r},setItem:function(e,t,n){var r=this;e=c(e);var i=new o((function(n,i){var s;r.ready().then((function(){return s=r._dbInfo,"[object Blob]"===f.call(t)?y(s.db).then((function(e){return e?t:function(e){return new o((function(t,n){var r=new FileReader;r.onerror=n,r.onloadend=function(n){var r=btoa(n.target.result||"");t({__local_forage_encoded_blob:!0,data:r,type:e.type})},r.readAsBinaryString(e)}))}(t)})):t})).then((function(t){P(r._dbInfo,g,(function(s,o){if(s)return i(s);try{var a=o.objectStore(r._dbInfo.storeName);null===t&&(t=void 0);var l=a.put(t,e);o.oncomplete=function(){void 0===t&&(t=null),n(t)},o.onabort=o.onerror=function(){var e=l.error?l.error:l.transaction.error;i(e)}}catch(e){i(e)}}))})).catch(i)}));return a(i,n),i},removeItem:function(e,t){var n=this;e=c(e);var r=new o((function(t,r){n.ready().then((function(){P(n._dbInfo,g,(function(i,s){if(i)return r(i);try{var o=s.objectStore(n._dbInfo.storeName).delete(e);s.oncomplete=function(){t()},s.onerror=function(){r(o.error)},s.onabort=function(){var e=o.error?o.error:o.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return a(r,t),r},clear:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){P(t._dbInfo,g,(function(r,i){if(r)return n(r);try{var s=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=s.error?s.error:s.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return a(n,e),n},length:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){P(t._dbInfo,m,(function(r,i){if(r)return n(r);try{var s=i.objectStore(t._dbInfo.storeName).count();s.onsuccess=function(){e(s.result)},s.onerror=function(){n(s.error)}}catch(e){n(e)}}))})).catch(n)}));return a(n,e),n},key:function(e,t){var n=this,r=new o((function(t,r){e<0?t(null):n.ready().then((function(){P(n._dbInfo,m,(function(i,s){if(i)return r(i);try{var o=s.objectStore(n._dbInfo.storeName),a=!1,l=o.openKeyCursor();l.onsuccess=function(){var n=l.result;n?0===e||a?t(n.key):(a=!0,n.advance(e)):t(null)},l.onerror=function(){r(l.error)}}catch(e){r(e)}}))})).catch(r)}));return a(r,t),r},keys:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){P(t._dbInfo,m,(function(r,i){if(r)return n(r);try{var s=i.objectStore(t._dbInfo.storeName).openKeyCursor(),o=[];s.onsuccess=function(){var t=s.result;t?(o.push(t.key),t.continue()):e(o)},s.onerror=function(){n(s.error)}}catch(e){n(e)}}))})).catch(n)}));return a(n,e),n},dropInstance:function(e,t){t=h.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r,s=this;if(e.name){var l=e.name===n.name&&s._dbInfo.db?o.resolve(s._dbInfo.db):M(e).then((function(t){var n=p[e.name],r=n.forages;n.db=t;for(var i=0;i<r.length;i++)r[i]._dbInfo.db=t;return t}));r=e.storeName?l.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.version+1;x(e);var r=p[e.name],s=r.forages;t.close();for(var a=0;a<s.length;a++){var l=s[a];l._dbInfo.db=null,l._dbInfo.version=n}return new o((function(t,r){var s=i.open(e.name,n);s.onerror=function(e){s.result.close(),r(e)},s.onupgradeneeded=function(){s.result.deleteObjectStore(e.storeName)},s.onsuccess=function(){var e=s.result;e.close(),t(e)}})).then((function(e){r.db=e;for(var t=0;t<s.length;t++){var n=s[t];n._dbInfo.db=e,w(n._dbInfo)}})).catch((function(t){throw(b(e,t)||o.resolve()).catch((function(){})),t}))}})):l.then((function(t){x(e);var n=p[e.name],r=n.forages;t.close();for(var s=0;s<r.length;s++)r[s]._dbInfo.db=null;return new o((function(t,n){var r=i.deleteDatabase(e.name);r.onerror=r.onblocked=function(e){var t=r.result;t&&t.close(),n(e)},r.onsuccess=function(){var e=r.result;e&&e.close(),t(e)}})).then((function(e){n.db=e;for(var t=0;t<r.length;t++)w(r[t]._dbInfo)})).catch((function(t){throw(b(e,t)||o.resolve()).catch((function(){})),t}))}))}else r=o.reject("Invalid arguments");return a(r,t),r}};var L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",I=/^~~local_forage_type~([^~]+)~/,D="__lfsc__:",O=D.length,B="arbf",N="blob",z="si08",U="ui08",k="uic8",F="si16",H="si32",G="ur16",j="ui32",V="fl32",W="fl64",X=O+B.length,q=Object.prototype.toString;function Y(e){var t,n,r,i,s,o=.75*e.length,a=e.length,l=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var c=new ArrayBuffer(o),h=new Uint8Array(c);for(t=0;t<a;t+=4)n=L.indexOf(e[t]),r=L.indexOf(e[t+1]),i=L.indexOf(e[t+2]),s=L.indexOf(e[t+3]),h[l++]=n<<2|r>>4,h[l++]=(15&r)<<4|i>>2,h[l++]=(3&i)<<6|63&s;return c}function Z(e){var t,n=new Uint8Array(e),r="";for(t=0;t<n.length;t+=3)r+=L[n[t]>>2],r+=L[(3&n[t])<<4|n[t+1]>>4],r+=L[(15&n[t+1])<<2|n[t+2]>>6],r+=L[63&n[t+2]];return n.length%3==2?r=r.substring(0,r.length-1)+"=":n.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var J={serialize:function(e,t){var n="";if(e&&(n=q.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===q.call(e.buffer))){var r,i=D;e instanceof ArrayBuffer?(r=e,i+=B):(r=e.buffer,"[object Int8Array]"===n?i+=z:"[object Uint8Array]"===n?i+=U:"[object Uint8ClampedArray]"===n?i+=k:"[object Int16Array]"===n?i+=F:"[object Uint16Array]"===n?i+=G:"[object Int32Array]"===n?i+=H:"[object Uint32Array]"===n?i+=j:"[object Float32Array]"===n?i+=V:"[object Float64Array]"===n?i+=W:t(new Error("Failed to get type for BinaryArray"))),t(i+Z(r))}else if("[object Blob]"===n){var s=new FileReader;s.onload=function(){var n="~~local_forage_type~"+e.type+"~"+Z(this.result);t(D+N+n)},s.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},deserialize:function(e){if(e.substring(0,O)!==D)return JSON.parse(e);var t,n=e.substring(X),r=e.substring(O,X);if(r===N&&I.test(n)){var i=n.match(I);t=i[1],n=n.substring(i[0].length)}var o=Y(n);switch(r){case B:return o;case N:return s([o],{type:t});case z:return new Int8Array(o);case U:return new Uint8Array(o);case k:return new Uint8ClampedArray(o);case F:return new Int16Array(o);case G:return new Uint16Array(o);case H:return new Int32Array(o);case j:return new Uint32Array(o);case V:return new Float32Array(o);case W:return new Float64Array(o);default:throw new Error("Unkown type: "+r)}},stringToBuffer:Y,bufferToString:Z};function Q(e,t,n,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,r)}function K(e,t,n,r,i,s){e.executeSql(n,r,i,(function(e,o){o.code===o.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,a){a.rows.length?s(e,o):Q(e,t,(function(){e.executeSql(n,r,i,s)}),s)}),s):s(e,o)}),s)}function $(e,t,n,r){var i=this;e=c(e);var s=new o((function(s,o){i.ready().then((function(){void 0===t&&(t=null);var a=t,l=i._dbInfo;l.serializer.serialize(t,(function(t,c){c?o(c):l.db.transaction((function(n){K(n,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){s(a)}),(function(e,t){o(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(r>0)return void s($.apply(i,[e,a,n,r-1]));o(t)}}))}))})).catch(o)}));return a(s,n),s}function ee(e){return new o((function(t,n){e.transaction((function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,r){for(var i=[],s=0;s<r.rows.length;s++)i.push(r.rows.item(s).name);t({db:e,storeNames:i})}),(function(e,t){n(t)}))}),(function(e){n(e)}))}))}var te={_driver:"webSQLStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var r in e)n[r]="string"!=typeof e[r]?e[r].toString():e[r];var i=new o((function(e,r){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return r(e)}n.db.transaction((function(i){Q(i,n,(function(){t._dbInfo=n,e()}),(function(e,t){r(t)}))}),r)}));return n.serializer=J,i},_support:"function"==typeof openDatabase,iterate:function(e,t){var n=this,r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){K(n,i,"SELECT * FROM "+i.storeName,[],(function(n,r){for(var s=r.rows,o=s.length,a=0;a<o;a++){var l=s.item(a),c=l.value;if(c&&(c=i.serializer.deserialize(c)),void 0!==(c=e(c,l.key,a+1)))return void t(c)}t()}),(function(e,t){r(t)}))}))})).catch(r)}));return a(r,t),r},getItem:function(e,t){var n=this;e=c(e);var r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){K(n,i,"SELECT * FROM "+i.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,n){var r=n.rows.length?n.rows.item(0).value:null;r&&(r=i.serializer.deserialize(r)),t(r)}),(function(e,t){r(t)}))}))})).catch(r)}));return a(r,t),r},setItem:function(e,t,n){return $.apply(this,[e,t,n,1])},removeItem:function(e,t){var n=this;e=c(e);var r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){K(n,i,"DELETE FROM "+i.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){r(t)}))}))})).catch(r)}));return a(r,t),r},clear:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){K(t,r,"DELETE FROM "+r.storeName,[],(function(){e()}),(function(e,t){n(t)}))}))})).catch(n)}));return a(n,e),n},length:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){K(t,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],(function(t,n){var r=n.rows.item(0).c;e(r)}),(function(e,t){n(t)}))}))})).catch(n)}));return a(n,e),n},key:function(e,t){var n=this,r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){K(n,i,"SELECT key FROM "+i.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,n){var r=n.rows.length?n.rows.item(0).key:null;t(r)}),(function(e,t){r(t)}))}))})).catch(r)}));return a(r,t),r},keys:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){K(t,r,"SELECT key FROM "+r.storeName,[],(function(t,n){for(var r=[],i=0;i<n.rows.length;i++)r.push(n.rows.item(i).key);e(r)}),(function(e,t){n(t)}))}))})).catch(n)}));return a(n,e),n},dropInstance:function(e,t){t=h.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r,i=this;return a(r=e.name?new o((function(t){var r;r=e.name===n.name?i._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:r,storeNames:[e.storeName]}):t(ee(r))})).then((function(e){return new o((function(t,n){e.db.transaction((function(r){function i(e){return new o((function(t,n){r.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){n(t)}))}))}for(var s=[],a=0,l=e.storeNames.length;a<l;a++)s.push(i(e.storeNames[a]));o.all(s).then((function(){t()})).catch((function(e){n(e)}))}),(function(e){n(e)}))}))})):o.reject("Invalid arguments"),t),r}};function ne(e,t){var n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}function re(){return!function(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}()||localStorage.length>0}var ie={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var n in e)t[n]=e[n];return t.keyPrefix=ne(e,this._defaultConfig),re()?(this._dbInfo=t,t.serializer=J,o.resolve()):o.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var n=this,r=n.ready().then((function(){for(var t=n._dbInfo,r=t.keyPrefix,i=r.length,s=localStorage.length,o=1,a=0;a<s;a++){var l=localStorage.key(a);if(0===l.indexOf(r)){var c=localStorage.getItem(l);if(c&&(c=t.serializer.deserialize(c)),void 0!==(c=e(c,l.substring(i),o++)))return c}}}));return a(r,t),r},getItem:function(e,t){var n=this;e=c(e);var r=n.ready().then((function(){var t=n._dbInfo,r=localStorage.getItem(t.keyPrefix+e);return r&&(r=t.serializer.deserialize(r)),r}));return a(r,t),r},setItem:function(e,t,n){var r=this;e=c(e);var i=r.ready().then((function(){void 0===t&&(t=null);var n=t;return new o((function(i,s){var o=r._dbInfo;o.serializer.serialize(t,(function(t,r){if(r)s(r);else try{localStorage.setItem(o.keyPrefix+e,t),i(n)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||s(e),s(e)}}))}))}));return a(i,n),i},removeItem:function(e,t){var n=this;e=c(e);var r=n.ready().then((function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return a(r,t),r},clear:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n);0===r.indexOf(e)&&localStorage.removeItem(r)}}));return a(n,e),n},length:function(e){var t=this.keys().then((function(e){return e.length}));return a(t,e),t},key:function(e,t){var n=this,r=n.ready().then((function(){var t,r=n._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(r.keyPrefix.length)),t}));return a(r,t),r},keys:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo,n=localStorage.length,r=[],i=0;i<n;i++){var s=localStorage.key(i);0===s.indexOf(e.keyPrefix)&&r.push(s.substring(e.keyPrefix.length))}return r}));return a(n,e),n},dropInstance:function(e,t){if(t=h.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var r,i=this;return a(r=e.name?new o((function(t){e.storeName?t(ne(e,i._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):o.reject("Invalid arguments"),t),r}},se=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},oe=function(e,t){for(var n=e.length,r=0;r<n;){if(se(e[r],t))return!0;r++}return!1},ae=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},le={},ce={},he={INDEXEDDB:R,WEBSQL:te,LOCALSTORAGE:ie},ue=[he.INDEXEDDB._driver,he.WEBSQL._driver,he.LOCALSTORAGE._driver],de=["dropInstance"],pe=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(de),fe={description:"",driver:ue.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function me(e,t){e[t]=function(){var n=arguments;return e.ready().then((function(){return e[t].apply(e,n)}))}}function ge(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(ae(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}var ve=new(function(){function e(t){for(var n in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),he)if(he.hasOwnProperty(n)){var r=he[n],i=r._driver;this[n]=i,le[i]||this.defineDriver(r)}this._defaultConfig=ge({},fe),this._config=ge({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":r(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var r=new o((function(t,n){try{var r=e._driver,i=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void n(i);for(var s=pe.concat("_initStorage"),l=0,c=s.length;l<c;l++){var h=s[l];if((!oe(de,h)||e[h])&&"function"!=typeof e[h])return void n(i)}!function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),n=o.reject(t);return a(n,arguments[arguments.length-1]),n}},n=0,r=de.length;n<r;n++){var i=de[n];e[i]||(e[i]=t(i))}}();var u=function(n){le[r]&&console.info("Redefining LocalForage driver: "+r),le[r]=e,ce[r]=n,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(u,n):u(!!e._support):u(!0)}catch(e){n(e)}}));return l(r,t,n),r},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var r=le[e]?o.resolve(le[e]):o.reject(new Error("Driver not found."));return l(r,t,n),r},e.prototype.getSerializer=function(e){var t=o.resolve(J);return l(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return l(n,e,e),n},e.prototype.setDriver=function(e,t,n){var r=this;ae(e)||(e=[e]);var i=this._getSupportedDrivers(e);function s(){r._config.driver=r.driver()}function a(e){return r._extend(e),s(),r._ready=r._initStorage(r._config),r._ready}var c=null!==this._driverSet?this._driverSet.catch((function(){return o.resolve()})):o.resolve();return this._driverSet=c.then((function(){var e=i[0];return r._dbInfo=null,r._ready=null,r.getDriver(e).then((function(e){r._driver=e._driver,s(),r._wrapLibraryMethodsWithReady(),r._initDriver=function(e){return function(){var t=0;return function n(){for(;t<e.length;){var i=e[t];return t++,r._dbInfo=null,r._ready=null,r.getDriver(i).then(a).catch(n)}s();var l=new Error("No available storage method found.");return r._driverSet=o.reject(l),r._driverSet}()}}(i)}))})).catch((function(){s();var e=new Error("No available storage method found.");return r._driverSet=o.reject(e),r._driverSet})),l(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!ce[e]},e.prototype._extend=function(e){ge(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=pe.length;e<t;e++)me(this,pe[e])},e.prototype.createInstance=function(t){return new e(t)},e}());t.exports=ve},{3:3}]},{},[4])(4)}(Qp={exports:{}}),Qp.exports);class $p extends DataView{constructor(e,t){super(e),this.isLE=!0,this.appKeys=t}byteRevers(e,t){const n=t%this.appKeys.length;return e^this.appKeys[n]}getSoonUint8(e){return this.byteRevers(this.getUint8(e),e)}getSoonUint16(e){const t=new DataView(new Uint8Array(2).buffer);for(let n=0;n<2;n++)t.setUint8(n,this.getSoonUint8(e+n));return t.getUint16(0,this.isLE)}getSoonUint32(e){const t=new DataView(new Uint8Array(4).buffer);for(let n=0;n<4;n++)t.setUint8(n,this.getSoonUint8(e+n));return t.getUint32(0,this.isLE)}getSoonFloat32(e){const t=new DataView(new Uint8Array(4).buffer);for(let n=0;n<4;n++)t.setUint8(n,this.getSoonUint8(e+n));return t.getFloat32(0,this.isLE)}}const ef=new Map,tf=e=>{if(ef.has(e))return ef.get(e);const t=new B;return ef.set(e,t),(new tl).load(e,(e=>{t.image=e,t.needsUpdate=!0})),t.wrapS=1e3,t.wrapT=1e3,t.flipY=!1,t.anisotropy=16,t.mipmaps=[],t.generateMipmaps=!0,t},nf=(e,t,n)=>{const[r,i,s,o,a]=t,l=o<1;return new Aa({name:e,color:new P(r,i,s),opacity:o,transparent:l,alphaTest:.01,map:n,side:a,shininess:0,specular:0})};var rf=function(){function e(){}return e.prototype.toJson=function(e,t){var n=this.xmlStringToXmlDom(e),r=this.xmlToJson(n);return t?(t.removeLineBreaks&&this.removeLineBreaks(r),t.removeComments&&this.removeCommentProperties(r),t.transformTextOnly&&this.transformTextOnly(r),r):r},e.prototype.xmlStringToXmlDom=function(e){return(new DOMParser).parseFromString(e,"text/xml")},e.prototype.removeLineBreaks=function(e){var t=this;Object.keys(e).forEach((function(n,r){"#text"===n&&Array.isArray(e[n])&&delete e[n],"object"==typeof e[n]&&t.removeLineBreaks(e[n])}))},e.prototype.removeCommentProperties=function(e){var t=this;Object.keys(e).forEach((function(n,r){"#comment"===n&&delete e[n],"object"==typeof e[n]&&t.removeCommentProperties(e[n])}))},e.prototype.transformTextOnly=function(e){var t=this;Object.keys(e).forEach((function(n,r){var i=Object.keys(e[n]).length>1,s=Object.keys(e[n])[0];i||"object"==typeof e[n][s]?t.transformTextOnly(e[n]):"object"==typeof e[n]&&e[n]["#text"]&&(e[n]=e[n]["#text"])}))},e.prototype.xmlToJson=function(e){var t={};if(1==e.nodeType){if(e.attributes.length>0){t._attributes={};for(var n=0;n<e.attributes.length;n++){var r=e.attributes.item(n);t._attributes[r.nodeName]=r.nodeValue}}}else 3==e.nodeType&&(t=e.nodeValue);if(e.hasChildNodes())for(var i=0;i<e.childNodes.length;i++){var s=e.childNodes.item(i),o=s.nodeName;if(void 0===t[o])t[o]=this.xmlToJson(s);else{if(void 0===t[o].push){var a=t[o];t[o]=[],t[o].push(a)}t[o].push(this.xmlToJson(s))}}return t},e}();function sf(e){return fetch(e).then((e=>e.text())).then((e=>Promise.resolve(function(e){return(new rf).toJson(e,{transformTextOnly:!0,removeComments:!0,removeLineBreaks:!0})}(e))))}class of{constructor(){this.materials=new Map}parseObject(e,t){const n=new Lp(t),{materialsCache:r,meshsCache:i}=e;for(const[e,t]of Object.entries(r)){if(this.materials.has(e))continue;const{textureUrl:n,materialInfo:r}=t;let i=null;n&&(i=tf(n));const s=nf(e,r,i);this.materials.set(e,s)}for(const[e,t]of Object.entries(i)){const{materialId:r,position:i,uv:s}=t,o=this.materials.get(r.toString());if(o){const t=new At,r=new Float32Array(i),a=new Float32Array(s);r.length>0&&t.setAttribute("position",new ct(r,3)),a.length>0&&t.setAttribute("uv",new ct(a,2)),t.computeVertexNormals();const l=new Eu(t,o,{id:e,name:e});n.add(l)}}return n}}class af extends Zp{constructor(e){super("Sbm",e),this.viewport=e,this.modelMaps=new Map,this.store=Kp.createInstance({name:"soonspace",storeName:"sbmData"})}load(e,t){return this._loadItem(e,t)}parse(e,t,n){return $u(this,void 0,void 0,(function*(){const r=e=>{var n;if(!this.modelMaps.get(t.url)){const n=e.sClone();this.modelMaps.set(t.url,n)}return null===(n=e.onLoad)||void 0===n||n.call(e,e),e};if(e instanceof ArrayBuffer)return(new class{constructor(){this.materials=new Map,this.sbmInfo=null}load(e,t){return this.sbmInfo=e,fetch(e.url).then((e=>e.arrayBuffer())).then((n=>this.parseBuffer(n,e,t)))}parseBuffer(e,t,n){return $u(this,void 0,void 0,(function*(){this.sbmInfo=t;const r=new DataView(e);let i=0;const s=[];for(let e=0;e<8;e++)s.push(r.getUint8(i)),i+=1;if("SBK-----"!==String.fromCharCode(...s))return Promise.reject(`In soonspacejs: sbm 资源模型(${this.sbmInfo.url})格式或数据错误!`);const o=[],a=[],l=[];for(let e=0;e<32;e++)o.push(r.getUint8(i)),i+=1;const c=r.getUint8(i);i+=1;const h=r.getUint8(i);i+=1;for(let e=0;e<32;e++)a.push(r.getUint8(i)),i+=1;for(let e=0;e<64;e++)l.push(r.getUint8(i)),i+=1;const u=[...a,...l,...o],d=[];for(let e=0;e<u.length;e++)(e<=7||e>23&&e<=31||e>39&&e<=55||e>63&&e<=87||e>95&&e<=103)&&d.push(u[e]);if(64!==d.length)return Promise.reject(`In soonspacejs: sbm 资源模型(${this.sbmInfo.url} 数据错误!`);if(1===c){const e=r.buffer.slice(i,r.buffer.byteLength),t=new $p(e,d);return 1===h||2===h?this._parseV2(t,n):3===h?this._parseV3(t,n):Promise.reject(`In soonspacejs: sbm 资源模型(${this.sbmInfo.url})版本错误!`)}return new Lp(this.sbmInfo)}))}_parseV2(e,t){return $u(this,void 0,void 0,(function*(){let n=0;const r=performance.now();n+=66;const i={total:0,loaded:0,timeStamp:0};if(!this.sbmInfo)return Promise.reject("In soonspacejs: sbm 模型资源解析时 'sbmInfo' 缺失!");const s=new Lp(this.sbmInfo),o=e.getSoonUint16(n);n+=2;const a=e.getSoonUint16(n);n+=2,i.total=a;const l={};for(let t=0;t<o;++t){const t=e.getSoonUint16(n).toString();n+=2,l[t]={materialInfo:[]},n+=4,n+=4,n+=4,n+=4;const r=e.getSoonFloat32(n);n+=4;const i=e.getSoonFloat32(n);n+=4;const s=e.getSoonFloat32(n);n+=4;const o=e.getSoonFloat32(n);n+=4,n+=4,n+=4,n+=4,n+=4;let a=e.getSoonUint8(n);n+=1,0===a?a=0:1===a?a=1:2===a&&(a=2);const c=e.getSoonUint16(n);n+=2;let h=null;if(c>0){let r="",i="";for(let t=0;t<c;t++){const t=e.getSoonUint8(n);t>127?i=i+"%"+t.toString(16).toUpperCase():i.length>0?(r+=decodeURIComponent(i)+String.fromCharCode(t),i=""):r+=String.fromCharCode(t),n+=1}r=r.replace("\\","/");const{url:s,isPlatform:o}=this.sbmInfo,a=this.getTextureUrl(s,r,o);l[t].textureUrl=a,h=tf(a)}if(!this.materials.has(t)){const e=[r,i,s,o,a],n=nf(t,e,h);this.materials.set(t,n),l[t].materialInfo=e}}const c={};for(let o=0;o<a;++o){const o=e.getSoonUint16(n);n+=2;const a=e.getSoonUint16(n).toString();n+=2,c[o]={materialId:a,position:new ArrayBuffer(0),uv:new ArrayBuffer(0)};const l=[],h=[],u=[],d=[],f=e.getSoonUint16(n);if(n+=2,f>0)for(let t=0;t<f;t++){const t=new V;t.setX(e.getSoonFloat32(n)),n+=4,t.setY(e.getSoonFloat32(n)),n+=4,t.setZ(e.getSoonFloat32(n)),n+=4,l.push(t)}const m=e.getSoonUint16(n);if(n+=2,m>0)for(let t=0;t<m;t++){const t=new V;t.setX(e.getSoonFloat32(n)),n+=4,t.setY(e.getSoonFloat32(n)),n+=4,t.setZ(e.getSoonFloat32(n)),n+=4}const g=e.getSoonUint16(n);if(n+=2,g>0)for(let t=0;t<g;t++){const t=new p;t.setX(e.getSoonFloat32(n)),n+=4,t.setY(e.getSoonFloat32(n)),n+=4,h.push(t)}const v=e.getSoonUint16(n);if(n+=2,v>0)for(let t=0;t<v;t++){const t=e.getSoonUint16(n);n+=2;const r=e.getSoonUint16(n);n+=2;const i=e.getSoonUint16(n);n+=2;const s=[t,r,i];u.push(s),h.length>0&&d.push([h[s[0]],h[s[1]],h[s[2]]])}const y=[],x=[];for(let e=0;e<u.length;e++){const t=u[e],n=l[t[0]],r=l[t[1]],i=l[t[2]];y.push(...n.toArray(),...r.toArray(),...i.toArray());let s=new p,o=new p,a=new p;const c=d[e];void 0!==c&&(s=c[0],o=c[1],a=c[2]),x.push(...s.toArray(),...o.toArray(),...a.toArray())}const w=new Float32Array(y),b=new Float32Array(x);c[o].position=w.buffer,c[o].uv=b.buffer;const _=new At;w.length>0&&_.setAttribute("position",new ct(w,3)),b.length>0&&_.setAttribute("uv",new ct(b,2)),_.computeVertexNormals();const M=this.materials.get(a);if(M){const e=new Eu(_,M,{id:o,name:o.toString()});s.add(e)}i.loaded++,i.timeStamp=performance.now()-r,t&&t(i)}const h={materialsCache:l,meshsCache:c};return Promise.resolve({sbm:s,caches:h})}))}_parseV3(e,t){let n=0;n+=66;const r=performance.now(),i={total:0,loaded:0,timeStamp:0};if(!this.sbmInfo)return Promise.reject("In soonspacejs: sbm 模型资源解析时 'sbmInfo' 缺失!");const s=new Lp(this.sbmInfo),o=e.getSoonUint16(n);n+=2;const a=e.getSoonUint16(n);n+=2,i.total=a;const l={};for(let t=0;t<o;++t){const t=e.getSoonUint16(n).toString();n+=2,l[t]={materialInfo:[]},n+=4,n+=4,n+=4,n+=4;const r=e.getSoonFloat32(n);n+=4;const i=e.getSoonFloat32(n);n+=4;const s=e.getSoonFloat32(n);n+=4;const o=e.getSoonFloat32(n);n+=4,n+=4,n+=4,n+=4,n+=4;let a=e.getSoonUint8(n);n+=1,0===a?a=0:1===a?a=1:2===a&&(a=2);const c=e.getSoonUint16(n);n+=2;let h=null;if(c>0){let r="",i="";for(let t=0;t<c;t++){const t=e.getSoonUint8(n);t>127?i=i+"%"+t.toString(16).toUpperCase():i.length>0?(r+=decodeURIComponent(i)+String.fromCharCode(t),i=""):r+=String.fromCharCode(t),n+=1}r=r.replace("\\","/");const{url:s,isPlatform:o}=this.sbmInfo,a=this.getTextureUrl(s,r,o);l[t].textureUrl=a,h=tf(a)}if(!this.materials.has(t)){const e=[r,i,s,o,a],n=nf(t,e,h);this.materials.set(t,n),l[t].materialInfo=e}}const c={};for(let o=0;o<a;++o){const o=e.getSoonUint16(n).toString();n+=2;const a=e.getSoonUint16(n);if(n+=2,a>0){let t="";for(let r=0;r<a;r++){const r=e.getUint8(n);r>127?t=t+"%"+r.toString(16).toUpperCase():t.length>0&&(t=""),n+=1}}const l=e.getSoonUint16(n).toString();n+=2,c[o]={materialId:l,position:new ArrayBuffer(0),uv:new ArrayBuffer(0)};const h=[],u=[],d=[],f=[],m=e.getSoonUint32(n);if(n+=4,m>0)for(let t=0;t<m;t++){const t=new V;t.setX(e.getSoonFloat32(n)),n+=4,t.setY(e.getSoonFloat32(n)),n+=4,t.setZ(e.getSoonFloat32(n)),n+=4,h.push(t)}const g=e.getSoonUint32(n);if(n+=4,g>0)for(let t=0;t<g;t++){const t=new V;t.setX(e.getSoonFloat32(n)),n+=4,t.setY(e.getSoonFloat32(n)),n+=4,t.setZ(e.getSoonFloat32(n)),n+=4}const v=e.getSoonUint32(n);if(n+=4,v>0)for(let t=0;t<v;t++){const t=new p;t.setX(e.getSoonFloat32(n)),n+=4,t.setY(e.getSoonFloat32(n)),n+=4,u.push(t)}const y=e.getSoonUint32(n);if(n+=4,y>0)for(let t=0;t<y;t++){const t=e.getSoonUint32(n);n+=4;const r=e.getSoonUint32(n);n+=4;const i=e.getSoonUint32(n);n+=4;const s=[t,r,i];d.push(s),u.length>0&&f.push([u[s[0]],u[s[1]],u[s[2]]])}const x=[],w=[];for(let e=0;e<d.length;e++){const t=d[e],n=h[t[0]],r=h[t[1]],i=h[t[2]];x.push(...n.toArray(),...r.toArray(),...i.toArray());let s=new p,o=new p,a=new p;const l=f[e];void 0!==l&&(s=l[0],o=l[1],a=l[2]),w.push(...s.toArray(),...o.toArray(),...a.toArray())}const b=new Float32Array(x),_=new Float32Array(w);c[o].position=b.buffer,c[o].uv=_.buffer;const M=new At;if(b.length>0&&M.setAttribute("position",new ct(b,3)),_.length>0&&M.setAttribute("uv",new ct(_,2)),M.computeVertexNormals(),this.materials.has(l)){const e=new Eu(M,this.materials.get(l),{id:o,name:o});s.add(e)}i.loaded++,i.timeStamp=performance.now()-r,t&&t(i)}const h={materialsCache:l,meshsCache:c};return Promise.resolve({sbm:s,caches:h})}getTextureUrl(e,t,n){let r="",i=t;const s=i.lastIndexOf("/");if(-1!==s&&(i=i.substring(s+1)),r=e,n){const e=r.split("/");e.length>1&&(e.splice(e.length-3,e.length),r=e.join("/")+"/Maps/"+i)}else{const e=r.lastIndexOf("/");-1!==e&&(r=r.substring(0,e+1)+"Maps/"+i)}return r}}).parseBuffer(e,t,n).then((e=>{let n;if(e instanceof Lp)n=e;else{const{sbm:r,caches:i}=e;n=r;const s=()=>{i&&this.viewport.options.useIndexedDB&&this.store.setItem(`${t.url}_object`,i)};"function"==typeof requestIdleCallback?requestIdleCallback(s):setTimeout(s)}return r(n)}));const i=(new of).parseObject(e,t);return r(i)}))}clone(e,t,n){return new Promise(((r,i)=>{"Sbm"!==e.stype&&i("In soonspacejs: 方法 cloneSbm 参入对象类型错误!");const{id:s,name:o,level:a,visible:l,position:c,rotation:h,scale:u,onClick:d,onDblClick:p,onRightClick:f,onLoad:m,userData:g}=t,v=e.sClone();s&&(v.sid=s),o&&(v.name=o),a&&(v.level=a),tu(l)&&(v.visible=l),c&&v.position.set(c.x,c.y,c.z),h&&v.rotation.set(h.x,h.y,h.z),u&&v.scale.set(u.x,u.y,u.z),v.onClick=d?d.bind(v):null,v.onDblClick=p?p.bind(v):null,v.onRightClick=f?f.bind(v):null,v.onLoad=m?m.bind(v):null,v.onLoad&&v.onLoad(v),g&&(v.userData=g),null!==n&&this.viewport.scener.addObject(v,n||this.scene||e.parent),r(v)}))}loadToGroup(e,t,n){return $u(this,void 0,void 0,(function*(){const r=new Pu(e);for(let e=0;e<t.length;e++)try{const i=yield this._loadItem(t[e],(r=>{n&&n({modelTotal:t.length,loadingModelIndex:e+1,current:r})}),null);r.add(i)}catch(e){console.error(e)}return this.viewport.scener.addObject(r,this.scene),r}))}addForGroup(e,t,n){return $u(this,void 0,void 0,(function*(){const r=this.getGroupById(e);if(r)for(let e=0;e<t.length;e++)try{const i=yield this._loadItem(t[e],(r=>{n&&n({modelTotal:t.length,loadingModelIndex:e+1,current:r})}),null);this.viewport.scener.addObject(i,r)}catch(e){console.error(e)}return r}))}createGroupFromXml(e,t){return new Promise((n=>$u(this,void 0,void 0,(function*(){let r=!1;const i=yield sf(t),s=new Pu(e),{ProjectInfo:o,Building:a}=i.Project,l=e=>$u(this,void 0,void 0,(function*(){const i=t.split(o.Title+".xml")[0],{id:l,name:c}=e._attributes,{name:h}=e.FileSource._attributes,u=o.Title+c,d=yield this._loadItem({id:l,name:u,url:i+h.replace("\\","/")},void 0,null);let p;if(s.add(d),p=ru(a.ObjectHierarchy.Entity)?a.ObjectHierarchy.Entity.find((e=>e._attributes.id===l)):a.ObjectHierarchy.Entity,!p)return;const f=p.Entity.filter((e=>"FACILITY"===e._attributes.type)),m=f.length;if(0===m&&r)this.viewport.scener.addObject(s,this.scene),n(s);else for(let e=0;e<m;e++){const{id:t,name:o,longname:a,position:l,scale:c,orient:h}=f[e]._attributes,u=l.split(","),p=c.split(","),g=h.split(","),v=yield this._loadItem({id:t,name:o,url:i+a+".sbm",position:{x:10*Number(u[0].trim()),y:10*Number(u[1].trim()),z:10*Number(u[2].trim())},scale:{x:10*Number(p[0].trim()),y:10*Number(p[1].trim()),z:10*Number(p[2].trim())}},void 0,null);v.quaternion.set(Number(g[1].trim()),Number(g[2].trim()),Number(g[3].trim()),Number(g[0].trim())),d.add(v),r&&e===m-1&&(this.viewport.scener.addObject(s,this.scene),n(s))}})),{Floor:c}=a.Floors;ru(c)?c.forEach(((e,t)=>{t===c.length-1&&(r=!0),l(e)})):iu(c)&&(r=!0,l(c))}))))}clearIdb(){return this.store.clear()}_loadItem(e,t,n=this.scene){return $u(this,void 0,void 0,(function*(){const{url:r}=e,{useIndexedDB:i}=this.viewport.options,s=this.modelMaps.get(r);if(s)return this.clone(s,e,n);let o=null,a=null,l=null;return i&&(a=yield this.store.getItem(`${r}_object`),a?l=yield this.parse(a,e,t):o=yield this.store.getItem(r)),l||(o||(o=yield this._fetchBuffer(e)),l=yield this.parse(o,e,t)),null!==n&&this.viewport.scener.addObject(l,n||this.scene),l}))}_fetchBuffer(e){const{url:t}=e,{useIndexedDB:n}=this.viewport.options;return fetch(t).then((e=>e.arrayBuffer())).then((e=>Promise.resolve(e)))}}
|
|
42
|
+
/*!
|
|
43
|
+
fflate - fast JavaScript compression/decompression
|
|
44
|
+
<https://101arrowz.github.io/fflate>
|
|
45
|
+
Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
|
|
46
|
+
version 0.6.9
|
|
47
|
+
*/var lf={},cf=function(e){return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},hf=function(e){return new Worker(e)};try{URL.revokeObjectURL(cf(""))}catch(rf){cf=function(e){return"data:application/javascript;charset=UTF-8,"+encodeURI(e)},hf=function(e){return new Worker(e,{type:"module"})}}var uf=Uint8Array,df=Uint16Array,pf=Uint32Array,ff=new uf([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mf=new uf([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),gf=new uf([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),vf=function(e,t){for(var n=new df(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new pf(n[30]);for(r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return[n,i]},yf=vf(ff,2),xf=yf[0],wf=yf[1];xf[28]=258,wf[258]=28;for(var bf=vf(mf,0),_f=bf[0],Mf=bf[1],Sf=new df(32768),Tf=0;Tf<32768;++Tf){var Ef=(43690&Tf)>>>1|(21845&Tf)<<1;Ef=(61680&(Ef=(52428&Ef)>>>2|(13107&Ef)<<2))>>>4|(3855&Ef)<<4,Sf[Tf]=((65280&Ef)>>>8|(255&Ef)<<8)>>>1}var Af=function(e,t,n){for(var r=e.length,i=0,s=new df(t);i<r;++i)++s[e[i]-1];var o,a=new df(t);for(i=0;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;if(n){o=new df(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],h=t-e[i],u=a[e[i]-1]++<<h,d=u|(1<<h)-1;u<=d;++u)o[Sf[u]>>>l]=c}else for(o=new df(r),i=0;i<r;++i)e[i]&&(o[i]=Sf[a[e[i]-1]++]>>>15-e[i]);return o},Cf=new uf(288);for(Tf=0;Tf<144;++Tf)Cf[Tf]=8;for(Tf=144;Tf<256;++Tf)Cf[Tf]=9;for(Tf=256;Tf<280;++Tf)Cf[Tf]=7;for(Tf=280;Tf<288;++Tf)Cf[Tf]=8;var Pf=new uf(32);for(Tf=0;Tf<32;++Tf)Pf[Tf]=5;var Rf=Af(Cf,9,0),Lf=Af(Cf,9,1),If=Af(Pf,5,0),Df=Af(Pf,5,1),Of=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},Bf=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},Nf=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},zf=function(e){return(e/8|0)+(7&e&&1)},Uf=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof df?df:e instanceof pf?pf:uf)(n-t);return r.set(e.subarray(t,n)),r},kf=function(e,t,n){var r=e.length;if(!r||n&&!n.l&&r<5)return t||new uf(0);var i=!t||n,s=!n||n.i;n||(n={}),t||(t=new uf(3*r));var o=function(e){var n=t.length;if(e>n){var r=new uf(Math.max(2*n,e));r.set(t),t=r}},a=n.f||0,l=n.p||0,c=n.b||0,h=n.l,u=n.d,d=n.m,p=n.n,f=8*r;do{if(!h){n.f=a=Bf(e,l,1);var m=Bf(e,l+1,3);if(l+=3,!m){var g=e[(A=zf(l)+4)-4]|e[A-3]<<8,v=A+g;if(v>r){if(s)throw"unexpected EOF";break}i&&o(c+g),t.set(e.subarray(A,v),c),n.b=c+=g,n.p=l=8*v;continue}if(1==m)h=Lf,u=Df,d=9,p=5;else{if(2!=m)throw"invalid block type";var y=Bf(e,l,31)+257,x=Bf(e,l+10,15)+4,w=y+Bf(e,l+5,31)+1;l+=14;for(var b=new uf(w),_=new uf(19),M=0;M<x;++M)_[gf[M]]=Bf(e,l+3*M,7);l+=3*x;var S=Of(_),T=(1<<S)-1,E=Af(_,S,1);for(M=0;M<w;){var A,C=E[Bf(e,l,T)];if(l+=15&C,(A=C>>>4)<16)b[M++]=A;else{var P=0,R=0;for(16==A?(R=3+Bf(e,l,3),l+=2,P=b[M-1]):17==A?(R=3+Bf(e,l,7),l+=3):18==A&&(R=11+Bf(e,l,127),l+=7);R--;)b[M++]=P}}var L=b.subarray(0,y),I=b.subarray(y);d=Of(L),p=Of(I),h=Af(L,d,1),u=Af(I,p,1)}if(l>f){if(s)throw"unexpected EOF";break}}i&&o(c+131072);for(var D=(1<<d)-1,O=(1<<p)-1,B=l;;B=l){var N=(P=h[Nf(e,l)&D])>>>4;if((l+=15&P)>f){if(s)throw"unexpected EOF";break}if(!P)throw"invalid length/literal";if(N<256)t[c++]=N;else{if(256==N){B=l,h=null;break}var z=N-254;if(N>264){var U=ff[M=N-257];z=Bf(e,l,(1<<U)-1)+xf[M],l+=U}var k=u[Nf(e,l)&O],F=k>>>4;if(!k)throw"invalid distance";if(l+=15&k,I=_f[F],F>3&&(U=mf[F],I+=Nf(e,l)&(1<<U)-1,l+=U),l>f){if(s)throw"unexpected EOF";break}i&&o(c+131072);for(var H=c+z;c<H;c+=4)t[c]=t[c-I],t[c+1]=t[c+1-I],t[c+2]=t[c+2-I],t[c+3]=t[c+3-I];c=H}}n.l=h,n.p=B,n.b=c,h&&(a=1,n.m=d,n.d=u,n.n=p)}while(!a);return c==t.length?t:Uf(t,0,c)},Ff=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8},Hf=function(e,t,n){n<<=7&t;var r=t/8|0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Gf=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=n.slice();if(!i)return[Zf,0];if(1==i){var o=new uf(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,h=1,u=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=i-1;)a=n[n[c].f<n[u].f?c++:u++],l=n[c!=h&&n[c].f<n[u].f?c++:u++],n[h++]={s:-1,f:a.f+l.f,l:a,r:l};var d=s[0].s;for(r=1;r<i;++r)s[r].s>d&&(d=s[r].s);var p=new df(d+1),f=jf(n[h-1],p,0);if(f>t){r=0;var m=0,g=f-t,v=1<<g;for(s.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));r<i;++r){var y=s[r].s;if(!(p[y]>t))break;m+=v-(1<<f-p[y]),p[y]=t}for(m>>>=g;m>0;){var x=s[r].s;p[x]<t?m-=1<<t-p[x]++-1:++r}for(;r>=0&&m;--r){var w=s[r].s;p[w]==t&&(--p[w],++m)}f=t}return[new uf(p),f]},jf=function(e,t,n){return-1==e.s?Math.max(jf(e.l,t,n+1),jf(e.r,t,n+1)):t[e.s]=n},Vf=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new df(++t),r=0,i=e[0],s=1,o=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[a]}return[n.subarray(0,r),t]},Wf=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Xf=function(e,t,n){var r=n.length,i=zf(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;s<r;++s)e[i+s+4]=n[s];return 8*(i+4+r)},qf=function(e,t,n,r,i,s,o,a,l,c,h){Ff(t,h++,n),++i[256];for(var u=Gf(i,15),d=u[0],p=u[1],f=Gf(s,15),m=f[0],g=f[1],v=Vf(d),y=v[0],x=v[1],w=Vf(m),b=w[0],_=w[1],M=new df(19),S=0;S<y.length;++S)M[31&y[S]]++;for(S=0;S<b.length;++S)M[31&b[S]]++;for(var T=Gf(M,7),E=T[0],A=T[1],C=19;C>4&&!E[gf[C-1]];--C);var P,R,L,I,D=c+5<<3,O=Wf(i,Cf)+Wf(s,Pf)+o,B=Wf(i,d)+Wf(s,m)+o+14+3*C+Wf(M,E)+(2*M[16]+3*M[17]+7*M[18]);if(D<=O&&D<=B)return Xf(t,h,e.subarray(l,l+c));if(Ff(t,h,1+(B<O)),h+=2,B<O){P=Af(d,p,0),R=d,L=Af(m,g,0),I=m;var N=Af(E,A,0);for(Ff(t,h,x-257),Ff(t,h+5,_-1),Ff(t,h+10,C-4),h+=14,S=0;S<C;++S)Ff(t,h+3*S,E[gf[S]]);h+=3*C;for(var z=[y,b],U=0;U<2;++U){var k=z[U];for(S=0;S<k.length;++S){var F=31&k[S];Ff(t,h,N[F]),h+=E[F],F>15&&(Ff(t,h,k[S]>>>5&127),h+=k[S]>>>12)}}}else P=Rf,R=Cf,L=If,I=Pf;for(S=0;S<a;++S)if(r[S]>255){F=r[S]>>>18&31,Hf(t,h,P[F+257]),h+=R[F+257],F>7&&(Ff(t,h,r[S]>>>23&31),h+=ff[F]);var H=31&r[S];Hf(t,h,L[H]),h+=I[H],H>3&&(Hf(t,h,r[S]>>>5&8191),h+=mf[H])}else Hf(t,h,P[r[S]]),h+=R[r[S]];return Hf(t,h,P[256]),h+R[256]},Yf=new pf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Zf=new uf(0),Jf=function(e,t,n,r,i,s){var o=e.length,a=new uf(r+o+5*(1+Math.ceil(o/7e3))+i),l=a.subarray(r,a.length-i),c=0;if(!t||o<8)for(var h=0;h<=o;h+=65535){var u=h+65535;u<o?c=Xf(l,c,e.subarray(h,u)):(l[h]=s,c=Xf(l,c,e.subarray(h,o)))}else{for(var d=Yf[t-1],p=d>>>13,f=8191&d,m=(1<<n)-1,g=new df(32768),v=new df(m+1),y=Math.ceil(n/3),x=2*y,w=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<x)&m},b=new pf(25e3),_=new df(288),M=new df(32),S=0,T=0,E=(h=0,0),A=0,C=0;h<o;++h){var P=w(h),R=32767&h,L=v[P];if(g[R]=L,v[P]=R,A<=h){var I=o-h;if((S>7e3||E>24576)&&I>423){c=qf(e,l,0,b,_,M,T,E,C,h-C,c),E=S=T=0,C=h;for(var D=0;D<286;++D)_[D]=0;for(D=0;D<30;++D)M[D]=0}var O=2,B=0,N=f,z=R-L&32767;if(I>2&&P==w(h-z))for(var U=Math.min(p,I)-1,k=Math.min(32767,h),F=Math.min(258,I);z<=k&&--N&&R!=L;){if(e[h+O]==e[h+O-z]){for(var H=0;H<F&&e[h+H]==e[h+H-z];++H);if(H>O){if(O=H,B=z,H>U)break;var G=Math.min(z,H-2),j=0;for(D=0;D<G;++D){var V=h-z+D+32768&32767,W=V-g[V]+32768&32767;W>j&&(j=W,L=V)}}}z+=(R=L)-(L=g[R])+32768&32767}if(B){b[E++]=268435456|wf[O]<<18|Mf[B];var X=31&wf[O],q=31&Mf[B];T+=ff[X]+mf[q],++_[257+X],++M[q],A=h+O,++S}else b[E++]=e[h],++_[e[h]]}}c=qf(e,l,s,b,_,M,T,E,C,h-C,c),!s&&7&c&&(c=Xf(l,c+1,Zf))}return Uf(a,0,r+zf(c)+i)},Qf=function(){for(var e=new pf(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Kf=function(){var e=-1;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Qf[255&n^t[r]]^n>>>8;e=n},d:function(){return~e}}},$f=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,s=n.length,o=0;o!=s;){for(var a=Math.min(o+2655,s);o<a;++o)i+=r+=n[o];r=(65535&r)+15*(r>>16),i=(65535&i)+15*(i>>16)}e=r,t=i},d:function(){return(255&(e%=65521))<<24|e>>>8<<16|(255&(t%=65521))<<8|t>>>8}}},em=function(e,t,n,r,i){return Jf(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},tm=function(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n},nm=function(e,t,n){for(var r=e(),i=e.toString(),s=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/ /g,"").split(","),o=0;o<r.length;++o){var a=r[o],l=s[o];if("function"==typeof a){t+=";"+l+"=";var c=a.toString();if(a.prototype)if(-1!=c.indexOf("[native code]")){var h=c.indexOf(" ",8)+1;t+=c.slice(h,c.indexOf("(",h))}else for(var u in t+=c,a.prototype)t+=";"+l+".prototype."+u+"="+a.prototype[u].toString();else t+=c}else n[l]=a}return[t,n]},rm=[],im=function(e,t,n,r){var i;if(!rm[n]){for(var s="",o={},a=e.length-1,l=0;l<a;++l)s=(i=nm(e[l],s,o))[0],o=i[1];rm[n]=nm(e[a],s,o)}var c=tm({},rm[n][1]);return function(e,t,n,r,i){var s=hf(lf[t]||(lf[t]=cf(e)));return s.onerror=function(e){return i(e.error,null)},s.onmessage=function(e){return i(null,e.data)},s.postMessage(n,r),s}(rm[n][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",n,c,function(e){var t=[];for(var n in e)(e[n]instanceof uf||e[n]instanceof df||e[n]instanceof pf)&&t.push((e[n]=new e[n].constructor(e[n])).buffer);return t}(c),r)},sm=function(){return[uf,df,pf,ff,mf,gf,xf,_f,Lf,Df,Sf,Af,Of,Bf,Nf,zf,Uf,kf,Om,um,dm]},om=function(){return[uf,df,pf,ff,mf,gf,wf,Mf,Rf,Cf,If,Pf,Sf,Yf,Zf,Af,Ff,Hf,Gf,jf,Vf,Wf,Xf,qf,zf,Uf,Jf,em,Rm,um]},am=function(){return[wm,Mm,xm,Kf,Qf]},lm=function(){return[bm,_m]},cm=function(){return[Sm,xm,$f]},hm=function(){return[Tm]},um=function(e){return postMessage(e,[e.buffer])},dm=function(e){return e&&e.size&&new uf(e.size)},pm=function(e,t,n,r,i,s){var o=im(n,r,i,(function(e,t){o.terminate(),s(e,t)}));return o.postMessage([e,t],t.consume?[e.buffer]:[]),function(){o.terminate()}},fm=function(e){return e.ondata=function(e,t){return postMessage([e,t],[e.buffer])},function(t){return e.push(t.data[0],t.data[1])}},mm=function(e,t,n,r,i){var s,o=im(e,r,i,(function(e,n){e?(o.terminate(),t.ondata.call(t,e)):(n[1]&&o.terminate(),t.ondata.call(t,e,n[0],n[1]))}));o.postMessage(n),t.push=function(e,n){if(s)throw"stream finished";if(!t.ondata)throw"no stream handler";o.postMessage([e,s=n],[e.buffer])},t.terminate=function(){o.terminate()}},gm=function(e,t){return e[t]|e[t+1]<<8},vm=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},ym=function(e,t){return vm(e,t)+4294967296*vm(e,t+4)},xm=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},wm=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&xm(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},bm=function(e){if(31!=e[0]||139!=e[1]||8!=e[2])throw"invalid gzip data";var t=e[3],n=10;4&t&&(n+=e[10]|2+(e[11]<<8));for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(2&t)},_m=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},Mm=function(e){return 10+(e.filename&&e.filename.length+1||0)},Sm=function(e,t){var n=t.level,r=0==n?0:n<6?1:9==n?3:2;e[0]=120,e[1]=r<<6|(r?32-2*r:1)},Tm=function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"};function Em(e,t){return t||"function"!=typeof e||(t=e,e={}),this.ondata=t,e}var Am=function(){function e(e,t){t||"function"!=typeof e||(t=e,e={}),this.ondata=t,this.o=e||{}}return e.prototype.p=function(e,t){this.ondata(em(e,this.o,0,0,!t),t)},e.prototype.push=function(e,t){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";this.d=t,this.p(e,t||!1)},e}(),Cm=function(e,t){mm([om,function(){return[fm,Am]}],this,Em.call(this,e,t),(function(e){var t=new Am(e.data);onmessage=fm(t)}),6)};function Pm(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return pm(e,t,[om],(function(e){return um(Rm(e.data[0],e.data[1]))}),0,n)}function Rm(e,t){return em(e,t||{},0,0)}var Lm=function(){function e(e){this.s={},this.p=new uf(0),this.ondata=e}return e.prototype.e=function(e){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";var t=this.p.length,n=new uf(t+e.length);n.set(this.p),n.set(e,t),this.p=n},e.prototype.c=function(e){this.d=this.s.i=e||!1;var t=this.s.b,n=kf(this.p,this.o,this.s);this.ondata(Uf(n,t,this.s.b),this.d),this.o=Uf(n,this.s.b-32768),this.s.b=this.o.length,this.p=Uf(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),Im=function(e){this.ondata=e,mm([sm,function(){return[fm,Lm]}],this,0,(function(){var e=new Lm;onmessage=fm(e)}),7)};function Dm(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return pm(e,t,[sm],(function(e){return um(Om(e.data[0],dm(e.data[1])))}),1,n)}function Om(e,t){return kf(e,t)}var Bm=function(){function e(e,t){this.c=Kf(),this.l=0,this.v=1,Am.call(this,e,t)}return e.prototype.push=function(e,t){Am.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e),this.l+=e.length;var n=em(e,this.o,this.v&&Mm(this.o),t&&8,!t);this.v&&(wm(n,this.o),this.v=0),t&&(xm(n,n.length-8,this.c.d()),xm(n,n.length-4,this.l)),this.ondata(n,t)},e}(),Nm=function(e,t){mm([om,am,function(){return[fm,Am,Bm]}],this,Em.call(this,e,t),(function(e){var t=new Bm(e.data);onmessage=fm(t)}),8)};function zm(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return pm(e,t,[om,am,function(){return[Um]}],(function(e){return um(Um(e.data[0],e.data[1]))}),2,n)}function Um(e,t){t||(t={});var n=Kf(),r=e.length;n.p(e);var i=em(e,t,Mm(t),8),s=i.length;return wm(i,t),xm(i,s-8,n.d()),xm(i,s-4,r),i}var km=function(){function e(e){this.v=1,Lm.call(this,e)}return e.prototype.push=function(e,t){if(Lm.prototype.e.call(this,e),this.v){var n=this.p.length>3?bm(this.p):4;if(n>=this.p.length&&!t)return;this.p=this.p.subarray(n),this.v=0}if(t){if(this.p.length<8)throw"invalid gzip stream";this.p=this.p.subarray(0,-8)}Lm.prototype.c.call(this,t)},e}(),Fm=function(e){this.ondata=e,mm([sm,lm,function(){return[fm,Lm,km]}],this,0,(function(){var e=new km;onmessage=fm(e)}),9)};function Hm(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return pm(e,t,[sm,lm,function(){return[Gm]}],(function(e){return um(Gm(e.data[0]))}),3,n)}function Gm(e,t){return kf(e.subarray(bm(e),-8),t||new uf(_m(e)))}var jm=function(){function e(e,t){this.c=$f(),this.v=1,Am.call(this,e,t)}return e.prototype.push=function(e,t){Am.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){this.c.p(e);var n=em(e,this.o,this.v&&2,t&&4,!t);this.v&&(Sm(n,this.o),this.v=0),t&&xm(n,n.length-4,this.c.d()),this.ondata(n,t)},e}(),Vm=function(e,t){mm([om,cm,function(){return[fm,Am,jm]}],this,Em.call(this,e,t),(function(e){var t=new jm(e.data);onmessage=fm(t)}),10)};function Wm(e,t){t||(t={});var n=$f();n.p(e);var r=em(e,t,2,4);return Sm(r,t),xm(r,r.length-4,n.d()),r}var Xm=function(){function e(e){this.v=1,Lm.call(this,e)}return e.prototype.push=function(e,t){if(Lm.prototype.e.call(this,e),this.v){if(this.p.length<2&&!t)return;this.p=this.p.subarray(2),this.v=0}if(t){if(this.p.length<4)throw"invalid zlib stream";this.p=this.p.subarray(0,-4)}Lm.prototype.c.call(this,t)},e}(),qm=function(e){this.ondata=e,mm([sm,hm,function(){return[fm,Lm,Xm]}],this,0,(function(){var e=new Xm;onmessage=fm(e)}),11)};function Ym(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return pm(e,t,[sm,hm,function(){return[Zm]}],(function(e){return um(Zm(e.data[0],dm(e.data[1])))}),5,n)}function Zm(e,t){return kf((Tm(e),e.subarray(2,-4)),t)}var Jm=function(){function e(e){this.G=km,this.I=Lm,this.Z=Xm,this.ondata=e}return e.prototype.push=function(e,t){if(!this.ondata)throw"no stream handler";if(this.s)this.s.push(e,t);else{if(this.p&&this.p.length){var n=new uf(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length)}else this.p=e;if(this.p.length>2){var r=this,i=function(){r.ondata.apply(r,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(i):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(i):new this.Z(i),this.s.push(this.p,t),this.p=null}}},e}(),Qm=function(){function e(e){this.G=Fm,this.I=Im,this.Z=qm,this.ondata=e}return e.prototype.push=function(e,t){Jm.prototype.push.call(this,e,t)},e}(),Km=function(e,t,n,r){for(var i in e){var s=e[i],o=t+i;s instanceof uf?n[o]=[s,r]:Array.isArray(s)?n[o]=[s[0],tm(r,s[1])]:Km(s,o+"/",n,r)}},$m="undefined"!=typeof TextEncoder&&new TextEncoder,eg="undefined"!=typeof TextDecoder&&new TextDecoder,tg=0;try{eg.decode(Zf,{stream:!0}),tg=1}catch(rf){}var ng=function(e){for(var t="",n=0;;){var r=e[n++],i=(r>127)+(r>223)+(r>239);if(n+i>e.length)return[t,Uf(e,n-1)];i?3==i?(r=((15&r)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,t+=String.fromCharCode(55296|r>>10,56320|1023&r)):t+=1&i?String.fromCharCode((31&r)<<6|63&e[n++]):String.fromCharCode((15&r)<<12|(63&e[n++])<<6|63&e[n++]):t+=String.fromCharCode(r)}},rg=function(){function e(e){this.ondata=e,tg?this.t=new TextDecoder:this.p=Zf}return e.prototype.push=function(e,t){if(!this.ondata)throw"no callback";if(t=!!t,this.t){if(this.ondata(this.t.decode(e,{stream:!0}),t),t){if(this.t.decode().length)throw"invalid utf-8 data";this.t=null}}else{if(!this.p)throw"stream finished";var n=new uf(this.p.length+e.length);n.set(this.p),n.set(e,this.p.length);var r=ng(n),i=r[0],s=r[1];if(t){if(s.length)throw"invalid utf-8 data";this.p=null}else this.p=s;this.ondata(i,t)}},e}(),ig=function(){function e(e){this.ondata=e}return e.prototype.push=function(e,t){if(!this.ondata)throw"no callback";if(this.d)throw"stream finished";this.ondata(sg(e),this.d=t||!1)},e}();function sg(e,t){if(t){for(var n=new uf(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}if($m)return $m.encode(e);var i=e.length,s=new uf(e.length+(e.length>>1)),o=0,a=function(e){s[o++]=e};for(r=0;r<i;++r){if(o+5>s.length){var l=new uf(o+8+(i-r<<1));l.set(s),s=l}var c=e.charCodeAt(r);c<128||t?a(c):c<2048?(a(192|c>>6),a(128|63&c)):c>55295&&c<57344?(a(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++r))>>18),a(128|c>>12&63),a(128|c>>6&63),a(128|63&c)):(a(224|c>>12),a(128|c>>6&63),a(128|63&c))}return Uf(s,0,o)}function og(e,t){if(t){for(var n="",r=0;r<e.length;r+=16384)n+=String.fromCharCode.apply(null,e.subarray(r,r+16384));return n}if(eg)return eg.decode(e);var i=ng(e),s=i[0];if(i[1].length)throw"invalid utf-8 data";return s}var ag=function(e){return 1==e?3:e<6?2:9==e?1:0},lg=function(e,t){return t+30+gm(e,t+26)+gm(e,t+28)},cg=function(e,t,n){var r=gm(e,t+28),i=og(e.subarray(t+46,t+46+r),!(2048&gm(e,t+8))),s=t+46+r,o=vm(e,t+20),a=n&&4294967295==o?hg(e,s):[o,vm(e,t+24),vm(e,t+42)],l=a[0],c=a[1],h=a[2];return[gm(e,t+10),l,c,i,s+gm(e,t+30)+gm(e,t+32),h]},hg=function(e,t){for(;1!=gm(e,t);t+=4+gm(e,t+2));return[ym(e,t+12),ym(e,t+4),ym(e,t+20)]},ug=function(e){var t=0;if(e)for(var n in e){var r=e[n].length;if(r>65535)throw"extra field too long";t+=r+4}return t},dg=function(e,t,n,r,i,s,o,a){var l=r.length,c=n.extra,h=a&&a.length,u=ug(c);xm(e,t,null!=o?33639248:67324752),t+=4,null!=o&&(e[t++]=20,e[t++]=n.os),e[t]=20,t+=2,e[t++]=n.flag<<1|(null==s&&8),e[t++]=i&&8,e[t++]=255&n.compression,e[t++]=n.compression>>8;var d=new Date(null==n.mtime?Date.now():n.mtime),p=d.getFullYear()-1980;if(p<0||p>119)throw"date not in range 1980-2099";if(xm(e,t,p<<25|d.getMonth()+1<<21|d.getDate()<<16|d.getHours()<<11|d.getMinutes()<<5|d.getSeconds()>>>1),t+=4,null!=s&&(xm(e,t,n.crc),xm(e,t+4,s),xm(e,t+8,n.size)),xm(e,t+12,l),xm(e,t+14,u),t+=16,null!=o&&(xm(e,t,h),xm(e,t+6,n.attrs),xm(e,t+10,o),t+=14),e.set(r,t),t+=l,u)for(var f in c){var m=c[f],g=m.length;xm(e,t,+f),xm(e,t+2,g),e.set(m,t+4),t+=4+g}return h&&(e.set(a,t),t+=h),t},pg=function(e,t,n,r,i){xm(e,t,101010256),xm(e,t+8,n),xm(e,t+10,n),xm(e,t+12,r),xm(e,t+16,i)},fg=function(){function e(e){this.filename=e,this.c=Kf(),this.size=0,this.compression=0}return e.prototype.process=function(e,t){this.ondata(null,e,t)},e.prototype.push=function(e,t){if(!this.ondata)throw"no callback - add to ZIP archive before pushing";this.c.p(e),this.size+=e.length,t&&(this.crc=this.c.d()),this.process(e,t||!1)},e}(),mg=function(){function e(e,t){var n=this;t||(t={}),fg.call(this,e),this.d=new Am(t,(function(e,t){n.ondata(null,e,t)})),this.compression=8,this.flag=ag(t.level)}return e.prototype.process=function(e,t){try{this.d.push(e,t)}catch(e){this.ondata(e,null,t)}},e.prototype.push=function(e,t){fg.prototype.push.call(this,e,t)},e}(),gg=function(){function e(e,t){var n=this;t||(t={}),fg.call(this,e),this.d=new Cm(t,(function(e,t,r){n.ondata(e,t,r)})),this.compression=8,this.flag=ag(t.level),this.terminate=this.d.terminate}return e.prototype.process=function(e,t){this.d.push(e,t)},e.prototype.push=function(e,t){fg.prototype.push.call(this,e,t)},e}(),vg=function(){function e(e){this.ondata=e,this.u=[],this.d=1}return e.prototype.add=function(e){var t=this;if(2&this.d)throw"stream finished";var n=sg(e.filename),r=n.length,i=e.comment,s=i&&sg(i),o=r!=e.filename.length||s&&i.length!=s.length,a=r+ug(e.extra)+30;if(r>65535)throw"filename too long";var l=new uf(a);dg(l,0,e,n,o);var c=[l],h=function(){for(var e=0,n=c;e<n.length;e++){var r=n[e];t.ondata(null,r,!1)}c=[]},u=this.d;this.d=0;var d=this.u.length,p=tm(e,{f:n,u:o,o:s,t:function(){e.terminate&&e.terminate()},r:function(){if(h(),u){var e=t.u[d+1];e?e.r():t.d=1}u=1}}),f=0;e.ondata=function(n,r,i){if(n)t.ondata(n,r,i),t.terminate();else if(f+=r.length,c.push(r),i){var s=new uf(16);xm(s,0,134695760),xm(s,4,e.crc),xm(s,8,f),xm(s,12,e.size),c.push(s),p.c=f,p.b=a+f+16,p.crc=e.crc,p.size=e.size,u&&p.r(),u=1}else u&&h()},this.u.push(p)},e.prototype.end=function(){var e=this;if(2&this.d){if(1&this.d)throw"stream finishing";throw"stream finished"}this.d?this.e():this.u.push({r:function(){1&e.d&&(e.u.splice(-1,1),e.e())},t:function(){}}),this.d=3},e.prototype.e=function(){for(var e=0,t=0,n=0,r=0,i=this.u;r<i.length;r++)n+=46+(l=i[r]).f.length+ug(l.extra)+(l.o?l.o.length:0);for(var s=new uf(n+22),o=0,a=this.u;o<a.length;o++){var l=a[o];dg(s,e,l,l.f,l.u,l.c,t,l.o),e+=46+l.f.length+ug(l.extra)+(l.o?l.o.length:0),t+=l.b}pg(s,e,this.u.length,n,t),this.ondata(null,s,!0),this.d=2},e.prototype.terminate=function(){for(var e=0,t=this.u;e<t.length;e++)t[e].t();this.d=2},e}(),yg=function(){function e(){}return e.prototype.push=function(e,t){this.ondata(null,e,t)},e.compression=0,e}(),xg=function(){function e(){var e=this;this.i=new Lm((function(t,n){e.ondata(null,t,n)}))}return e.prototype.push=function(e,t){try{this.i.push(e,t)}catch(n){this.ondata(n,e,t)}},e.compression=8,e}(),wg=function(){function e(e,t){var n=this;t<32e4?this.i=new Lm((function(e,t){n.ondata(null,e,t)})):(this.i=new Im((function(e,t,r){n.ondata(e,t,r)})),this.terminate=this.i.terminate)}return e.prototype.push=function(e,t){this.i.terminate&&(e=Uf(e,0)),this.i.push(e,t)},e.compression=8,e}(),bg=function(){function e(e){this.onfile=e,this.k=[],this.o={0:yg},this.p=Zf}return e.prototype.push=function(e,t){var n=this;if(!this.onfile)throw"no callback";if(!this.p)throw"stream finished";if(this.c>0){var r=Math.min(this.c,e.length),i=e.subarray(0,r);if(this.c-=r,this.d?this.d.push(i,!this.c):this.k[0].push(i),(e=e.subarray(r)).length)return this.push(e,t)}else{var s=0,o=0,a=void 0,l=void 0;this.p.length?e.length?((l=new uf(this.p.length+e.length)).set(this.p),l.set(e,this.p.length)):l=this.p:l=e;for(var c=l.length,h=this.c,u=h&&this.d,d=function(){var e,t=vm(l,o);if(67324752==t){s=1,a=o,p.d=null,p.c=0;var r=gm(l,o+6),i=gm(l,o+8),u=2048&r,d=8&r,f=gm(l,o+26),m=gm(l,o+28);if(c>o+30+f+m){var g=[];p.k.unshift(g),s=2;var v,y=vm(l,o+18),x=vm(l,o+22),w=og(l.subarray(o+30,o+=30+f),!u);4294967295==y?(e=d?[-2]:hg(l,o),y=e[0],x=e[1]):d&&(y=-1),o+=m,p.c=y;var b={name:w,compression:i,start:function(){if(!b.ondata)throw"no callback";if(y){var e=n.o[i];if(!e)throw"unknown compression type "+i;(v=y<0?new e(w):new e(w,y,x)).ondata=function(e,t,n){b.ondata(e,t,n)};for(var t=0,r=g;t<r.length;t++){var s=r[t];v.push(s,!1)}n.k[0]==g&&n.c?n.d=v:v.push(Zf,!0)}else b.ondata(null,Zf,!0)},terminate:function(){v&&v.terminate&&v.terminate()}};y>=0&&(b.size=y,b.originalSize=x),p.onfile(b)}return"break"}if(h){if(134695760==t)return a=o+=12+(-2==h&&8),s=3,p.c=0,"break";if(33639248==t)return a=o-=4,s=3,p.c=0,"break"}},p=this;o<c-4&&"break"!==d();++o);if(this.p=Zf,h<0){var f=s?l.subarray(0,a-12-(-2==h&&8)-(134695760==vm(l,a-16)&&4)):l.subarray(0,o);u?u.push(f,!!s):this.k[+(2==s)].push(f)}if(2&s)return this.push(l.subarray(o),t);this.p=l.subarray(o)}if(t){if(this.c)throw"invalid zip file";this.p=null}},e.prototype.register=function(e){this.o[e.compression]=e},e}(),_g=Object.freeze({__proto__:null,Deflate:Am,AsyncDeflate:Cm,deflate:Pm,deflateSync:Rm,Inflate:Lm,AsyncInflate:Im,inflate:Dm,inflateSync:Om,Gzip:Bm,AsyncGzip:Nm,gzip:zm,gzipSync:Um,Gunzip:km,AsyncGunzip:Fm,gunzip:Hm,gunzipSync:Gm,Zlib:jm,AsyncZlib:Vm,zlib:function(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return pm(e,t,[om,cm,function(){return[Wm]}],(function(e){return um(Wm(e.data[0],e.data[1]))}),4,n)},zlibSync:Wm,Unzlib:Xm,AsyncUnzlib:qm,unzlib:Ym,unzlibSync:Zm,compress:zm,AsyncCompress:Nm,compressSync:Um,Compress:Bm,Decompress:Jm,AsyncDecompress:Qm,decompress:function(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";return 31==e[0]&&139==e[1]&&8==e[2]?Hm(e,t,n):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?Dm(e,t,n):Ym(e,t,n)},decompressSync:function(e,t){return 31==e[0]&&139==e[1]&&8==e[2]?Gm(e,t):8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31?Om(e,t):Zm(e,t)},DecodeUTF8:rg,EncodeUTF8:ig,strToU8:sg,strFromU8:og,ZipPassThrough:fg,ZipDeflate:mg,AsyncZipDeflate:gg,Zip:vg,zip:function(e,t,n){if(n||(n=t,t={}),"function"!=typeof n)throw"no callback";var r={};Km(e,"",r,t);var i=Object.keys(r),s=i.length,o=0,a=0,l=s,c=new Array(s),h=[],u=function(){for(var e=0;e<h.length;++e)h[e]()},d=function(){var e=new uf(a+22),t=o,r=a-o;a=0;for(var i=0;i<l;++i){var s=c[i];try{var h=s.c.length;dg(e,a,s,s.f,s.u,h);var u=30+s.f.length+ug(s.extra),d=a+u;e.set(s.c,d),dg(e,o,s,s.f,s.u,h,a,s.m),o+=16+u+(s.m?s.m.length:0),a=d+h}catch(e){return n(e,null)}}pg(e,o,c.length,r,t),n(null,e)};s||d();for(var p=function(e){var t=i[e],l=r[t],p=l[0],f=l[1],m=Kf(),g=p.length;m.p(p);var v=sg(t),y=v.length,x=f.comment,w=x&&sg(x),b=w&&w.length,_=ug(f.extra),M=0==f.level?0:8,S=function(r,i){if(r)u(),n(r,null);else{var l=i.length;c[e]=tm(f,{size:g,crc:m.d(),c:i,f:v,m:w,u:y!=t.length||w&&x.length!=b,compression:M}),o+=30+y+_+l,a+=76+2*(y+_)+(b||0)+l,--s||d()}};if(y>65535&&S("filename too long",null),M)if(g<16e4)try{S(null,Rm(p,f))}catch(e){S(e,null)}else h.push(Pm(p,f,S));else S(null,p)},f=0;f<l;++f)p(f);return u},zipSync:function(e,t){t||(t={});var n={},r=[];Km(e,"",n,t);var i=0,s=0;for(var o in n){var a=n[o],l=a[0],c=a[1],h=0==c.level?0:8,u=(M=sg(o)).length,d=c.comment,p=d&&sg(d),f=p&&p.length,m=ug(c.extra);if(u>65535)throw"filename too long";var g=h?Rm(l,c):l,v=g.length,y=Kf();y.p(l),r.push(tm(c,{size:l.length,crc:y.d(),c:g,f:M,m:p,u:u!=o.length||p&&d.length!=f,o:i,compression:h})),i+=30+u+m+v,s+=76+2*(u+m)+(f||0)+v}for(var x=new uf(s+22),w=i,b=s-i,_=0;_<r.length;++_){var M=r[_];dg(x,M.o,M,M.f,M.u,M.c.length);var S=30+M.f.length+ug(M.extra);x.set(M.c,M.o+S),dg(x,i,M,M.f,M.u,M.c.length,M.o,M.m),i+=16+S+(M.m?M.m.length:0)}return pg(x,i,r.length,b,w),x},UnzipPassThrough:yg,UnzipInflate:xg,AsyncUnzipInflate:wg,Unzip:bg,unzip:function(e,t){if("function"!=typeof t)throw"no callback";for(var n=[],r=function(){for(var e=0;e<n.length;++e)n[e]()},i={},s=e.length-22;101010256!=vm(e,s);--s)if(!s||e.length-s>65558)return void t("invalid zip file",null);var o=gm(e,s+8);o||t(null,{});var a=o,l=vm(e,s+16),c=4294967295==l;if(c){if(s=vm(e,s-12),101075792!=vm(e,s))return void t("invalid zip file",null);a=o=vm(e,s+32),l=vm(e,s+48)}for(var h=function(s){var a=cg(e,l,c),h=a[0],u=a[1],d=a[2],p=a[3],f=a[4],m=a[5],g=lg(e,m);l=f;var v=function(e,n){e?(r(),t(e,null)):(i[p]=n,--o||t(null,i))};if(h)if(8==h){var y=e.subarray(g,g+u);if(u<32e4)try{v(null,Om(y,new uf(d)))}catch(e){v(e,null)}else n.push(Dm(y,{size:d},v))}else v("unknown compression type "+h,null);else v(null,Uf(e,g,g+u))},u=0;u<a;++u)h();return r},unzipSync:function(e){for(var t={},n=e.length-22;101010256!=vm(e,n);--n)if(!n||e.length-n>65558)throw"invalid zip file";var r=gm(e,n+8);if(!r)return{};var i=vm(e,n+16),s=4294967295==i;if(s){if(n=vm(e,n-12),101075792!=vm(e,n))throw"invalid zip file";r=vm(e,n+32),i=vm(e,n+48)}for(var o=0;o<r;++o){var a=cg(e,i,s),l=a[0],c=a[1],h=a[2],u=a[3],d=a[4],p=a[5],f=lg(e,p);if(i=d,l){if(8!=l)throw"unknown compression type "+l;t[u]=Om(e.subarray(f,f+c),new uf(h))}else t[u]=Uf(e,f,f+c)}return t}});function Mg(e,t,n){const r=n.length-e-1;if(t>=n[r])return r-1;if(t<=n[e])return e;let i=e,s=r,o=Math.floor((i+s)/2);for(;t<n[o]||t>=n[o+1];)t<n[o]?s=o:i=o,o=Math.floor((i+s)/2);return o}function Sg(e,t){let n=1;for(let t=2;t<=e;++t)n*=t;let r=1;for(let e=2;e<=t;++e)r*=e;for(let n=2;n<=e-t;++n)r*=n;return n/r}class Tg extends eo{constructor(e,t,n,r,i){super(),this.degree=e,this.knots=t,this.controlPoints=[],this.startKnot=r||0,this.endKnot=i||this.knots.length-1;for(let e=0;e<n.length;++e){const t=n[e];this.controlPoints[e]=new N(t.x,t.y,t.z,t.w)}}getPoint(e,t=new V){const n=t,r=this.knots[this.startKnot]+e*(this.knots[this.endKnot]-this.knots[this.startKnot]),i=function(e,t,n,r){const i=Mg(e,r,t),s=function(e,t,n,r){const i=[],s=[],o=[];i[0]=1;for(let a=1;a<=n;++a){s[a]=t-r[e+1-a],o[a]=r[e+a]-t;let n=0;for(let e=0;e<a;++e){const t=o[e+1],r=s[a-e],l=i[e]/(t+r);i[e]=n+t*l,n=r*l}i[a]=n}return i}(i,r,e,t),o=new N(0,0,0,0);for(let t=0;t<=e;++t){const r=n[i-e+t],a=s[t],l=r.w*a;o.x+=r.x*l,o.y+=r.y*l,o.z+=r.z*l,o.w+=r.w*a}return o}(this.degree,this.knots,this.controlPoints,r);return 1!==i.w&&i.divideScalar(i.w),n.set(i.x,i.y,i.z)}getTangent(e,t=new V){const n=t,r=this.knots[0]+e*(this.knots[this.knots.length-1]-this.knots[0]),i=function(e,t,n,r,i){return function(e){const t=e.length,n=[],r=[];for(let i=0;i<t;++i){const t=e[i];n[i]=new V(t.x,t.y,t.z),r[i]=t.w}const i=[];for(let e=0;e<t;++e){const t=n[e].clone();for(let n=1;n<=e;++n)t.sub(i[e-n].clone().multiplyScalar(Sg(e,n)*r[n]));i[e]=t.divideScalar(r[0])}return i}(function(e,t,n,r,i){const s=i<e?i:e,o=[],a=Mg(e,r,t),l=function(e,t,n,r,i){const s=[];for(let e=0;e<=n;++e)s[e]=0;const o=[];for(let e=0;e<=r;++e)o[e]=s.slice(0);const a=[];for(let e=0;e<=n;++e)a[e]=s.slice(0);a[0][0]=1;const l=s.slice(0),c=s.slice(0);for(let r=1;r<=n;++r){l[r]=t-i[e+1-r],c[r]=i[e+r]-t;let n=0;for(let e=0;e<r;++e){const t=c[e+1],i=l[r-e];a[r][e]=t+i;const s=a[e][r-1]/a[r][e];a[e][r]=n+t*s,n=i*s}a[r][r]=n}for(let e=0;e<=n;++e)o[0][e]=a[e][n];for(let e=0;e<=n;++e){let t=0,i=1;const l=[];for(let e=0;e<=n;++e)l[e]=s.slice(0);l[0][0]=1;for(let s=1;s<=r;++s){let r=0;const c=e-s,h=n-s;e>=s&&(l[i][0]=l[t][0]/a[h+1][c],r=l[i][0]*a[c][h]);const u=e-1<=h?s-1:n-e;for(let e=c>=-1?1:-c;e<=u;++e)l[i][e]=(l[t][e]-l[t][e-1])/a[h+1][c+e],r+=l[i][e]*a[c+e][h];e<=h&&(l[i][s]=-l[t][s-1]/a[h+1][e],r+=l[i][s]*a[e][h]),o[s][e]=r;const d=t;t=i,i=d}}let h=n;for(let e=1;e<=r;++e){for(let t=0;t<=n;++t)o[e][t]*=h;h*=n-e}return o}(a,r,e,s,t),c=[];for(let e=0;e<n.length;++e){const t=n[e].clone(),r=t.w;t.x*=r,t.y*=r,t.z*=r,c[e]=t}for(let t=0;t<=s;++t){const n=c[a-e].clone().multiplyScalar(l[t][0]);for(let r=1;r<=e;++r)n.add(c[a-e+r].clone().multiplyScalar(l[t][r]));o[t]=n}for(let e=s+1;e<=i+1;++e)o[e]=new N(0,0,0);return o}(e,t,n,r,i))}(this.degree,this.knots,this.controlPoints,r,1);return n.copy(i[1]).normalize(),n}}let Eg,Ag,Cg;class Pg extends Ka{constructor(e){super(e)}load(e,t,n,r){const i=this,s=""===i.path?Tl.extractUrlBase(e):i.path,o=new el(this.manager);o.setPath(i.path),o.setResponseType("arraybuffer"),o.setRequestHeader(i.requestHeader),o.setWithCredentials(i.withCredentials),o.load(e,(function(n){try{t(i.parse(n,s))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e,t){if(function(e){const t="Kaydara FBX Binary \0";return e.byteLength>=t.length&&t===Xg(e,0,t.length)}(e))Eg=(new Og).parse(e);else{const t=Xg(e);if(!function(e){const t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"];let n=0;function r(t){const r=e[t-1];return e=e.slice(n+t),n++,r}for(let e=0;e<t.length;++e)if(r(1)===t[e])return!1;return!0}(t))throw new Error("THREE.FBXLoader: Unknown format.");if(zg(t)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+zg(t));Eg=(new Dg).parse(t)}const n=new il(this.manager).setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);return new Rg(n,this.manager).parse(Eg)}}class Rg{constructor(e,t){this.textureLoader=e,this.manager=t}parse(){Ag=this.parseConnections();const e=this.parseImages(),t=this.parseTextures(e),n=this.parseMaterials(t),r=this.parseDeformers(),i=(new Lg).parse(r);return this.parseScene(r,i,n),Cg}parseConnections(){const e=new Map;return"Connections"in Eg&&Eg.Connections.connections.forEach((function(t){const n=t[0],r=t[1],i=t[2];e.has(n)||e.set(n,{parents:[],children:[]});const s={ID:r,relationship:i};e.get(n).parents.push(s),e.has(r)||e.set(r,{parents:[],children:[]});const o={ID:n,relationship:i};e.get(r).children.push(o)})),e}parseImages(){const e={},t={};if("Video"in Eg.Objects){const n=Eg.Objects.Video;for(const r in n){const i=n[r];if(e[parseInt(r)]=i.RelativeFilename||i.Filename,"Content"in i){const e=i.Content instanceof ArrayBuffer&&i.Content.byteLength>0,s="string"==typeof i.Content&&""!==i.Content;if(e||s){const e=this.parseImage(n[r]);t[i.RelativeFilename||i.Filename]=e}}}}for(const n in e){const r=e[n];void 0!==t[r]?e[n]=t[r]:e[n]=e[n].split("\\").pop()}return e}parseImage(e){const t=e.Content,n=e.RelativeFilename||e.Filename,r=n.slice(n.lastIndexOf(".")+1).toLowerCase();let i;switch(r){case"bmp":i="image/bmp";break;case"jpg":case"jpeg":i="image/jpeg";break;case"png":i="image/png";break;case"tif":i="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",n),i="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+r+'" is not supported.')}if("string"==typeof t)return"data:"+i+";base64,"+t;{const e=new Uint8Array(t);return window.URL.createObjectURL(new Blob([e],{type:i}))}}parseTextures(e){const t=new Map;if("Texture"in Eg.Objects){const n=Eg.Objects.Texture;for(const r in n){const i=this.parseTexture(n[r],e);t.set(parseInt(r),i)}}return t}parseTexture(e,t){const n=this.loadTexture(e,t);n.ID=e.id,n.name=e.attrName;const r=e.WrapModeU,i=e.WrapModeV,s=void 0!==r?r.value:0,o=void 0!==i?i.value:0;if(n.wrapS=0===s?1e3:1001,n.wrapT=0===o?1e3:1001,"Scaling"in e){const t=e.Scaling.value;n.repeat.x=t[0],n.repeat.y=t[1]}return n}loadTexture(e,t){let n;const r=this.textureLoader.path,i=Ag.get(e.id).children;let s;void 0!==i&&i.length>0&&void 0!==t[i[0].ID]&&(n=t[i[0].ID],0!==n.indexOf("blob:")&&0!==n.indexOf("data:")||this.textureLoader.setPath(void 0));const o=e.FileName.slice(-3).toLowerCase();if("tga"===o){const t=this.manager.getHandler(".tga");null===t?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",e.RelativeFilename),s=new B):(t.setPath(this.textureLoader.path),s=t.load(n))}else"psd"===o?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",e.RelativeFilename),s=new B):s=this.textureLoader.load(n);return this.textureLoader.setPath(r),s}parseMaterials(e){const t=new Map;if("Material"in Eg.Objects){const n=Eg.Objects.Material;for(const r in n){const i=this.parseMaterial(n[r],e);null!==i&&t.set(parseInt(r),i)}}return t}parseMaterial(e,t){const n=e.id,r=e.attrName;let i=e.ShadingModel;if("object"==typeof i&&(i=i.value),!Ag.has(n))return null;const s=this.parseParameters(e,t,n);let o;switch(i.toLowerCase()){case"phong":o=new Aa;break;case"lambert":o=new Ra;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',i),o=new Aa}return o.setValues(s),o.name=r,o}parseParameters(e,t,n){const r={};e.BumpFactor&&(r.bumpScale=e.BumpFactor.value),e.Diffuse?r.color=(new P).fromArray(e.Diffuse.value):!e.DiffuseColor||"Color"!==e.DiffuseColor.type&&"ColorRGB"!==e.DiffuseColor.type||(r.color=(new P).fromArray(e.DiffuseColor.value)),e.DisplacementFactor&&(r.displacementScale=e.DisplacementFactor.value),e.Emissive?r.emissive=(new P).fromArray(e.Emissive.value):!e.EmissiveColor||"Color"!==e.EmissiveColor.type&&"ColorRGB"!==e.EmissiveColor.type||(r.emissive=(new P).fromArray(e.EmissiveColor.value)),e.EmissiveFactor&&(r.emissiveIntensity=parseFloat(e.EmissiveFactor.value)),e.Opacity&&(r.opacity=parseFloat(e.Opacity.value)),r.opacity<1&&(r.transparent=!0),e.ReflectionFactor&&(r.reflectivity=e.ReflectionFactor.value),e.Shininess&&(r.shininess=e.Shininess.value),e.Specular?r.specular=(new P).fromArray(e.Specular.value):e.SpecularColor&&"Color"===e.SpecularColor.type&&(r.specular=(new P).fromArray(e.SpecularColor.value));const i=this;return Ag.get(n).children.forEach((function(e){const n=e.relationship;switch(n){case"Bump":r.bumpMap=i.getTexture(t,e.ID);break;case"Maya|TEX_ao_map":r.aoMap=i.getTexture(t,e.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":r.map=i.getTexture(t,e.ID),void 0!==r.map&&(r.map.encoding=3001);break;case"DisplacementColor":r.displacementMap=i.getTexture(t,e.ID);break;case"EmissiveColor":r.emissiveMap=i.getTexture(t,e.ID),void 0!==r.emissiveMap&&(r.emissiveMap.encoding=3001);break;case"NormalMap":case"Maya|TEX_normal_map":r.normalMap=i.getTexture(t,e.ID);break;case"ReflectionColor":r.envMap=i.getTexture(t,e.ID),void 0!==r.envMap&&(r.envMap.mapping=303,r.envMap.encoding=3001);break;case"SpecularColor":r.specularMap=i.getTexture(t,e.ID),void 0!==r.specularMap&&(r.specularMap.encoding=3001);break;case"TransparentColor":case"TransparencyFactor":r.alphaMap=i.getTexture(t,e.ID),r.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",n)}})),r}getTexture(e,t){return"LayeredTexture"in Eg.Objects&&t in Eg.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),t=Ag.get(t).children[0].ID),e.get(t)}parseDeformers(){const e={},t={};if("Deformer"in Eg.Objects){const n=Eg.Objects.Deformer;for(const r in n){const i=n[r],s=Ag.get(parseInt(r));if("Skin"===i.attrType){const t=this.parseSkeleton(s,n);t.ID=r,s.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),t.geometryID=s.parents[0].ID,e[r]=t}else if("BlendShape"===i.attrType){const e={id:r};e.rawTargets=this.parseMorphTargets(s,n),e.id=r,s.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),t[r]=e}}}return{skeletons:e,morphTargets:t}}parseSkeleton(e,t){const n=[];return e.children.forEach((function(e){const r=t[e.ID];if("Cluster"!==r.attrType)return;const i={ID:e.ID,indices:[],weights:[],transformLink:(new be).fromArray(r.TransformLink.a)};"Indexes"in r&&(i.indices=r.Indexes.a,i.weights=r.Weights.a),n.push(i)})),{rawBones:n,bones:[]}}parseMorphTargets(e,t){const n=[];for(let r=0;r<e.children.length;r++){const i=e.children[r],s=t[i.ID],o={name:s.attrName,initialWeight:s.DeformPercent,id:s.id,fullWeights:s.FullWeights.a};if("BlendShapeChannel"!==s.attrType)return;o.geoID=Ag.get(parseInt(i.ID)).children.filter((function(e){return void 0===e.relationship}))[0].ID,n.push(o)}return n}parseScene(e,t,n){Cg=new Ni;const r=this.parseModels(e.skeletons,t,n),i=Eg.Objects.Model,s=this;r.forEach((function(e){const t=i[e.ID];s.setLookAtProperties(e,t),Ag.get(e.ID).parents.forEach((function(t){const n=r.get(t.ID);void 0!==n&&n.add(e)})),null===e.parent&&Cg.add(e)})),this.bindSkeleton(e.skeletons,t,r),this.createAmbientLight(),Cg.traverse((function(e){if(e.userData.transformData){e.parent&&(e.userData.transformData.parentMatrix=e.parent.matrix,e.userData.transformData.parentMatrixWorld=e.parent.matrixWorld);const t=jg(e.userData.transformData);e.applyMatrix4(t),e.updateWorldMatrix()}}));const o=(new Ig).parse();1===Cg.children.length&&Cg.children[0].isGroup&&(Cg.children[0].animations=o,Cg=Cg.children[0]),Cg.animations=o}parseModels(e,t,n){const r=new Map,i=Eg.Objects.Model;for(const s in i){const o=parseInt(s),a=i[s],l=Ag.get(o);let c=this.buildSkeleton(l,e,o,a.attrName);if(!c){switch(a.attrType){case"Camera":c=this.createCamera(l);break;case"Light":c=this.createLight(l);break;case"Mesh":c=this.createMesh(l,t,n);break;case"NurbsCurve":c=this.createCurve(l,t);break;case"LimbNode":case"Root":c=new bs;break;case"Null":default:c=new Ni}c.name=a.attrName?ac.sanitizeNodeName(a.attrName):"",c.ID=o}this.getTransformData(c,a),r.set(o,c)}return r}buildSkeleton(e,t,n,r){let i=null;return e.parents.forEach((function(e){for(const s in t){const o=t[s];o.rawBones.forEach((function(t,s){if(t.ID===e.ID){const e=i;i=new bs,i.matrixWorld.copy(t.transformLink),i.name=r?ac.sanitizeNodeName(r):"",i.ID=n,o.bones[s]=i,null!==e&&i.add(e)}}))}})),i}createCamera(e){let t,n;if(e.children.forEach((function(e){const t=Eg.Objects.NodeAttribute[e.ID];void 0!==t&&(n=t)})),void 0===n)t=new Xe;else{let e=0;void 0!==n.CameraProjectionType&&1===n.CameraProjectionType.value&&(e=1);let r=1;void 0!==n.NearPlane&&(r=n.NearPlane.value/1e3);let i=1e3;void 0!==n.FarPlane&&(i=n.FarPlane.value/1e3);let s=window.innerWidth,o=window.innerHeight;void 0!==n.AspectWidth&&void 0!==n.AspectHeight&&(s=n.AspectWidth.value,o=n.AspectHeight.value);const a=s/o;let l=45;void 0!==n.FieldOfView&&(l=n.FieldOfView.value);const c=n.FocalLength?n.FocalLength.value:null;switch(e){case 0:t=new $t(l,a,r,i),null!==c&&t.setFocalLength(c);break;case 1:t=new Mn(-s/2,s/2,o/2,-o/2,r,i);break;default:console.warn("THREE.FBXLoader: Unknown camera type "+e+"."),t=new Xe}}return t}createLight(e){let t,n;if(e.children.forEach((function(e){const t=Eg.Objects.NodeAttribute[e.ID];void 0!==t&&(n=t)})),void 0===n)t=new Xe;else{void 0!==n.LightType&&n.LightType.value;let r=16777215;void 0!==n.Color&&(r=(new P).fromArray(n.Color.value));let i=void 0===n.Intensity?1:n.Intensity.value/100;void 0!==n.CastLightOnObject&&0===n.CastLightOnObject.value&&(i=0);let s=0;void 0!==n.FarAttenuationEnd&&(s=void 0!==n.EnableFarAttenuation&&0===n.EnableFarAttenuation.value?0:n.FarAttenuationEnd.value);const o=1;switch(e){case 0:t=new vl(r,i,s,o);break;case 1:t=new xl(r,i);break;case 2:let e=Math.PI/3;void 0!==n.InnerAngle&&(e=d.degToRad(n.InnerAngle.value));let a=0;void 0!==n.OuterAngle&&(a=d.degToRad(n.OuterAngle.value),a=Math.max(a,1)),t=new dl(r,i,s,e,a,o);break;default:console.warn("THREE.FBXLoader: Unknown light type "+n.LightType.value+", defaulting to a PointLight."),t=new vl(r,i)}void 0!==n.CastShadows&&1===n.CastShadows.value&&(t.castShadow=!0)}return t}createMesh(e,t,n){let r,i=null,s=null;const o=[];return e.children.forEach((function(e){t.has(e.ID)&&(i=t.get(e.ID)),n.has(e.ID)&&o.push(n.get(e.ID))})),o.length>1?s=o:o.length>0?s=o[0]:(s=new Aa({color:13421772}),o.push(s)),"color"in i.attributes&&o.forEach((function(e){e.vertexColors=!0})),i.FBX_Deformer?(r=new ws(i,s),r.normalizeSkinWeights()):r=new Wt(i,s),r}createCurve(e,t){const n=e.children.reduce((function(e,n){return t.has(n.ID)&&(e=t.get(n.ID)),e}),null),r=new Is({color:3342591,linewidth:1});return new Us(n,r)}getTransformData(e,t){const n={};"InheritType"in t&&(n.inheritType=parseInt(t.InheritType.value)),n.eulerOrder="RotationOrder"in t?Vg(t.RotationOrder.value):"ZYX","Lcl_Translation"in t&&(n.translation=t.Lcl_Translation.value),"PreRotation"in t&&(n.preRotation=t.PreRotation.value),"Lcl_Rotation"in t&&(n.rotation=t.Lcl_Rotation.value),"PostRotation"in t&&(n.postRotation=t.PostRotation.value),"Lcl_Scaling"in t&&(n.scale=t.Lcl_Scaling.value),"ScalingOffset"in t&&(n.scalingOffset=t.ScalingOffset.value),"ScalingPivot"in t&&(n.scalingPivot=t.ScalingPivot.value),"RotationOffset"in t&&(n.rotationOffset=t.RotationOffset.value),"RotationPivot"in t&&(n.rotationPivot=t.RotationPivot.value),e.userData.transformData=n}setLookAtProperties(e,t){"LookAtProperty"in t&&Ag.get(e.ID).children.forEach((function(t){if("LookAtProperty"===t.relationship){const n=Eg.Objects.Model[t.ID];if("Lcl_Translation"in n){const t=n.Lcl_Translation.value;void 0!==e.target?(e.target.position.fromArray(t),Cg.add(e.target)):e.lookAt((new V).fromArray(t))}}}))}bindSkeleton(e,t,n){const r=this.parsePoseNodes();for(const i in e){const s=e[i];Ag.get(parseInt(s.ID)).parents.forEach((function(e){if(t.has(e.ID)){const t=e.ID;Ag.get(t).parents.forEach((function(e){n.has(e.ID)&&n.get(e.ID).bind(new Ts(s.bones),r[e.ID])}))}}))}}parsePoseNodes(){const e={};if("Pose"in Eg.Objects){const t=Eg.Objects.Pose;for(const n in t)if("BindPose"===t[n].attrType&&t[n].NbPoseNodes>0){const r=t[n].PoseNode;Array.isArray(r)?r.forEach((function(t){e[t.Node]=(new be).fromArray(t.Matrix.a)})):e[r.Node]=(new be).fromArray(r.Matrix.a)}}return e}createAmbientLight(){if("GlobalSettings"in Eg&&"AmbientColor"in Eg.GlobalSettings){const e=Eg.GlobalSettings.AmbientColor.value,t=e[0],n=e[1],r=e[2];if(0!==t||0!==n||0!==r){const e=new P(t,n,r);Cg.add(new wl(e,1))}}}}class Lg{parse(e){const t=new Map;if("Geometry"in Eg.Objects){const n=Eg.Objects.Geometry;for(const r in n){const i=Ag.get(parseInt(r)),s=this.parseGeometry(i,n[r],e);t.set(parseInt(r),s)}}return t}parseGeometry(e,t,n){switch(t.attrType){case"Mesh":return this.parseMeshGeometry(e,t,n);case"NurbsCurve":return this.parseNurbsGeometry(t)}}parseMeshGeometry(e,t,n){const r=n.skeletons,i=[],s=e.parents.map((function(e){return Eg.Objects.Model[e.ID]}));if(0===s.length)return;const o=e.children.reduce((function(e,t){return void 0!==r[t.ID]&&(e=r[t.ID]),e}),null);e.children.forEach((function(e){void 0!==n.morphTargets[e.ID]&&i.push(n.morphTargets[e.ID])}));const a=s[0],l={};"RotationOrder"in a&&(l.eulerOrder=Vg(a.RotationOrder.value)),"InheritType"in a&&(l.inheritType=parseInt(a.InheritType.value)),"GeometricTranslation"in a&&(l.translation=a.GeometricTranslation.value),"GeometricRotation"in a&&(l.rotation=a.GeometricRotation.value),"GeometricScaling"in a&&(l.scale=a.GeometricScaling.value);const c=jg(l);return this.genGeometry(t,o,i,c)}genGeometry(e,t,n,r){const i=new At;e.attrName&&(i.name=e.attrName);const s=this.parseGeoNode(e,t),o=this.genBuffers(s),a=new yt(o.vertex,3);if(a.applyMatrix4(r),i.setAttribute("position",a),o.colors.length>0&&i.setAttribute("color",new yt(o.colors,3)),t&&(i.setAttribute("skinIndex",new ft(o.weightsIndices,4)),i.setAttribute("skinWeight",new yt(o.vertexWeights,4)),i.FBX_Deformer=t),o.normal.length>0){const e=(new f).getNormalMatrix(r),t=new yt(o.normal,3);t.applyNormalMatrix(e),i.setAttribute("normal",t)}if(o.uvs.forEach((function(e,t){let n="uv"+(t+1).toString();0===t&&(n="uv"),i.setAttribute(n,new yt(o.uvs[t],2))})),s.material&&"AllSame"!==s.material.mappingType){let e=o.materialIndex[0],t=0;if(o.materialIndex.forEach((function(n,r){n!==e&&(i.addGroup(t,r-t,e),e=n,t=r)})),i.groups.length>0){const t=i.groups[i.groups.length-1],n=t.start+t.count;n!==o.materialIndex.length&&i.addGroup(n,o.materialIndex.length-n,e)}0===i.groups.length&&i.addGroup(0,o.materialIndex.length,o.materialIndex[0])}return this.addMorphTargets(i,e,n,r),i}parseGeoNode(e,t){const n={};if(n.vertexPositions=void 0!==e.Vertices?e.Vertices.a:[],n.vertexIndices=void 0!==e.PolygonVertexIndex?e.PolygonVertexIndex.a:[],e.LayerElementColor&&(n.color=this.parseVertexColors(e.LayerElementColor[0])),e.LayerElementMaterial&&(n.material=this.parseMaterialIndices(e.LayerElementMaterial[0])),e.LayerElementNormal&&(n.normal=this.parseNormals(e.LayerElementNormal[0])),e.LayerElementUV){n.uv=[];let t=0;for(;e.LayerElementUV[t];)e.LayerElementUV[t].UV&&n.uv.push(this.parseUVs(e.LayerElementUV[t])),t++}return n.weightTable={},null!==t&&(n.skeleton=t,t.rawBones.forEach((function(e,t){e.indices.forEach((function(r,i){void 0===n.weightTable[r]&&(n.weightTable[r]=[]),n.weightTable[r].push({id:t,weight:e.weights[i]})}))}))),n}genBuffers(e){const t={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]};let n=0,r=0,i=!1,s=[],o=[],a=[],l=[],c=[],h=[];const u=this;return e.vertexIndices.forEach((function(d,p){let f,m=!1;d<0&&(d^=-1,m=!0);let g=[],v=[];if(s.push(3*d,3*d+1,3*d+2),e.color){const t=Fg(p,n,d,e.color);a.push(t[0],t[1],t[2])}if(e.skeleton){if(void 0!==e.weightTable[d]&&e.weightTable[d].forEach((function(e){v.push(e.weight),g.push(e.id)})),v.length>4){i||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),i=!0);const e=[0,0,0,0],t=[0,0,0,0];v.forEach((function(n,r){let i=n,s=g[r];t.forEach((function(t,n,r){if(i>t){r[n]=i,i=t;const o=e[n];e[n]=s,s=o}}))})),g=e,v=t}for(;v.length<4;)v.push(0),g.push(0);for(let e=0;e<4;++e)c.push(v[e]),h.push(g[e])}if(e.normal){const t=Fg(p,n,d,e.normal);o.push(t[0],t[1],t[2])}e.material&&"AllSame"!==e.material.mappingType&&(f=Fg(p,n,d,e.material)[0]),e.uv&&e.uv.forEach((function(e,t){const r=Fg(p,n,d,e);void 0===l[t]&&(l[t]=[]),l[t].push(r[0]),l[t].push(r[1])})),r++,m&&(u.genFace(t,e,s,f,o,a,l,c,h,r),n++,r=0,s=[],o=[],a=[],l=[],c=[],h=[])})),t}genFace(e,t,n,r,i,s,o,a,l,c){for(let h=2;h<c;h++)e.vertex.push(t.vertexPositions[n[0]]),e.vertex.push(t.vertexPositions[n[1]]),e.vertex.push(t.vertexPositions[n[2]]),e.vertex.push(t.vertexPositions[n[3*(h-1)]]),e.vertex.push(t.vertexPositions[n[3*(h-1)+1]]),e.vertex.push(t.vertexPositions[n[3*(h-1)+2]]),e.vertex.push(t.vertexPositions[n[3*h]]),e.vertex.push(t.vertexPositions[n[3*h+1]]),e.vertex.push(t.vertexPositions[n[3*h+2]]),t.skeleton&&(e.vertexWeights.push(a[0]),e.vertexWeights.push(a[1]),e.vertexWeights.push(a[2]),e.vertexWeights.push(a[3]),e.vertexWeights.push(a[4*(h-1)]),e.vertexWeights.push(a[4*(h-1)+1]),e.vertexWeights.push(a[4*(h-1)+2]),e.vertexWeights.push(a[4*(h-1)+3]),e.vertexWeights.push(a[4*h]),e.vertexWeights.push(a[4*h+1]),e.vertexWeights.push(a[4*h+2]),e.vertexWeights.push(a[4*h+3]),e.weightsIndices.push(l[0]),e.weightsIndices.push(l[1]),e.weightsIndices.push(l[2]),e.weightsIndices.push(l[3]),e.weightsIndices.push(l[4*(h-1)]),e.weightsIndices.push(l[4*(h-1)+1]),e.weightsIndices.push(l[4*(h-1)+2]),e.weightsIndices.push(l[4*(h-1)+3]),e.weightsIndices.push(l[4*h]),e.weightsIndices.push(l[4*h+1]),e.weightsIndices.push(l[4*h+2]),e.weightsIndices.push(l[4*h+3])),t.color&&(e.colors.push(s[0]),e.colors.push(s[1]),e.colors.push(s[2]),e.colors.push(s[3*(h-1)]),e.colors.push(s[3*(h-1)+1]),e.colors.push(s[3*(h-1)+2]),e.colors.push(s[3*h]),e.colors.push(s[3*h+1]),e.colors.push(s[3*h+2])),t.material&&"AllSame"!==t.material.mappingType&&(e.materialIndex.push(r),e.materialIndex.push(r),e.materialIndex.push(r)),t.normal&&(e.normal.push(i[0]),e.normal.push(i[1]),e.normal.push(i[2]),e.normal.push(i[3*(h-1)]),e.normal.push(i[3*(h-1)+1]),e.normal.push(i[3*(h-1)+2]),e.normal.push(i[3*h]),e.normal.push(i[3*h+1]),e.normal.push(i[3*h+2])),t.uv&&t.uv.forEach((function(t,n){void 0===e.uvs[n]&&(e.uvs[n]=[]),e.uvs[n].push(o[n][0]),e.uvs[n].push(o[n][1]),e.uvs[n].push(o[n][2*(h-1)]),e.uvs[n].push(o[n][2*(h-1)+1]),e.uvs[n].push(o[n][2*h]),e.uvs[n].push(o[n][2*h+1])}))}addMorphTargets(e,t,n,r){if(0===n.length)return;e.morphTargetsRelative=!0,e.morphAttributes.position=[];const i=this;n.forEach((function(n){n.rawTargets.forEach((function(n){const s=Eg.Objects.Geometry[n.geoID];void 0!==s&&i.genMorphGeometry(e,t,s,r,n.name)}))}))}genMorphGeometry(e,t,n,r,i){const s=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],o=void 0!==n.Vertices?n.Vertices.a:[],a=void 0!==n.Indexes?n.Indexes.a:[],l=3*e.attributes.position.count,c=new Float32Array(l);for(let e=0;e<a.length;e++){const t=3*a[e];c[t]=o[3*e],c[t+1]=o[3*e+1],c[t+2]=o[3*e+2]}const h={vertexIndices:s,vertexPositions:c},u=this.genBuffers(h),d=new yt(u.vertex,3);d.name=i||n.attrName,d.applyMatrix4(r),e.morphAttributes.position.push(d)}parseNormals(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,r=e.Normals.a;let i=[];return"IndexToDirect"===n&&("NormalIndex"in e?i=e.NormalIndex.a:"NormalsIndex"in e&&(i=e.NormalsIndex.a)),{dataSize:3,buffer:r,indices:i,mappingType:t,referenceType:n}}parseUVs(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,r=e.UV.a;let i=[];return"IndexToDirect"===n&&(i=e.UVIndex.a),{dataSize:2,buffer:r,indices:i,mappingType:t,referenceType:n}}parseVertexColors(e){const t=e.MappingInformationType,n=e.ReferenceInformationType,r=e.Colors.a;let i=[];return"IndexToDirect"===n&&(i=e.ColorIndex.a),{dataSize:4,buffer:r,indices:i,mappingType:t,referenceType:n}}parseMaterialIndices(e){const t=e.MappingInformationType,n=e.ReferenceInformationType;if("NoMappingInformation"===t)return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:n};const r=e.Materials.a,i=[];for(let e=0;e<r.length;++e)i.push(e);return{dataSize:1,buffer:r,indices:i,mappingType:t,referenceType:n}}parseNurbsGeometry(e){if(void 0===Tg)return console.error("THREE.FBXLoader: The loader relies on NURBSCurve for any nurbs present in the model. Nurbs will show up as empty geometry."),new At;const t=parseInt(e.Order);if(isNaN(t))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",e.Order,e.id),new At;const n=t-1,r=e.KnotVector.a,i=[],s=e.Points.a;for(let e=0,t=s.length;e<t;e+=4)i.push((new N).fromArray(s,e));let o,a;if("Closed"===e.Form)i.push(i[0]);else if("Periodic"===e.Form){o=n,a=r.length-1-o;for(let e=0;e<n;++e)i.push(i[e])}const l=new Tg(n,r,i,o,a).getPoints(12*i.length);return(new At).setFromPoints(l)}}class Ig{parse(){const e=[],t=this.parseClips();if(void 0!==t)for(const n in t){const r=t[n],i=this.addClip(r);e.push(i)}return e}parseClips(){if(void 0===Eg.Objects.AnimationCurve)return;const e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);const t=this.parseAnimationLayers(e);return this.parseAnimStacks(t)}parseAnimationCurveNodes(){const e=Eg.Objects.AnimationCurveNode,t=new Map;for(const n in e){const r=e[n];if(null!==r.attrName.match(/S|R|T|DeformPercent/)){const e={id:r.id,attr:r.attrName,curves:{}};t.set(e.id,e)}}return t}parseAnimationCurves(e){const t=Eg.Objects.AnimationCurve;for(const n in t){const r={id:t[n].id,times:t[n].KeyTime.a.map(Ug),values:t[n].KeyValueFloat.a},i=Ag.get(r.id);if(void 0!==i){const t=i.parents[0].ID,n=i.parents[0].relationship;n.match(/X/)?e.get(t).curves.x=r:n.match(/Y/)?e.get(t).curves.y=r:n.match(/Z/)?e.get(t).curves.z=r:n.match(/d|DeformPercent/)&&e.has(t)&&(e.get(t).curves.morph=r)}}}parseAnimationLayers(e){const t=Eg.Objects.AnimationLayer,n=new Map;for(const r in t){const t=[],i=Ag.get(parseInt(r));void 0!==i&&(i.children.forEach((function(n,r){if(e.has(n.ID)){const i=e.get(n.ID);if(void 0!==i.curves.x||void 0!==i.curves.y||void 0!==i.curves.z){if(void 0===t[r]){const e=Ag.get(n.ID).parents.filter((function(e){return void 0!==e.relationship}))[0].ID;if(void 0!==e){const i=Eg.Objects.Model[e.toString()];if(void 0===i)return void console.warn("THREE.FBXLoader: Encountered a unused curve.",n);const s={modelName:i.attrName?ac.sanitizeNodeName(i.attrName):"",ID:i.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};Cg.traverse((function(e){e.ID===i.id&&(s.transform=e.matrix,e.userData.transformData&&(s.eulerOrder=e.userData.transformData.eulerOrder))})),s.transform||(s.transform=new be),"PreRotation"in i&&(s.preRotation=i.PreRotation.value),"PostRotation"in i&&(s.postRotation=i.PostRotation.value),t[r]=s}}t[r]&&(t[r][i.attr]=i)}else if(void 0!==i.curves.morph){if(void 0===t[r]){const e=Ag.get(n.ID).parents.filter((function(e){return void 0!==e.relationship}))[0].ID,i=Ag.get(e).parents[0].ID,s=Ag.get(i).parents[0].ID,o=Ag.get(s).parents[0].ID,a=Eg.Objects.Model[o],l={modelName:a.attrName?ac.sanitizeNodeName(a.attrName):"",morphName:Eg.Objects.Deformer[e].attrName};t[r]=l}t[r][i.attr]=i}}})),n.set(parseInt(r),t))}return n}parseAnimStacks(e){const t=Eg.Objects.AnimationStack,n={};for(const r in t){const i=Ag.get(parseInt(r)).children;i.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");const s=e.get(i[0].ID);n[r]={name:t[r].attrName,layer:s}}return n}addClip(e){let t=[];const n=this;return e.layer.forEach((function(e){t=t.concat(n.generateTracks(e))})),new qa(e.name,-1,t)}generateTracks(e){const t=[];let n=new V,r=new j,i=new V;if(e.transform&&e.transform.decompose(n,r,i),n=n.toArray(),r=(new Le).setFromQuaternion(r,e.eulerOrder).toArray(),i=i.toArray(),void 0!==e.T&&Object.keys(e.T.curves).length>0){const r=this.generateVectorTrack(e.modelName,e.T.curves,n,"position");void 0!==r&&t.push(r)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){const n=this.generateRotationTrack(e.modelName,e.R.curves,r,e.preRotation,e.postRotation,e.eulerOrder);void 0!==n&&t.push(n)}if(void 0!==e.S&&Object.keys(e.S.curves).length>0){const n=this.generateVectorTrack(e.modelName,e.S.curves,i,"scale");void 0!==n&&t.push(n)}if(void 0!==e.DeformPercent){const n=this.generateMorphTrack(e);void 0!==n&&t.push(n)}return t}generateVectorTrack(e,t,n,r){const i=this.getTimesForAllAxes(t),s=this.getKeyframeTrackValues(i,t,n);return new Xa(e+"."+r,i,s)}generateRotationTrack(e,t,n,r,i,s){void 0!==t.x&&(this.interpolateRotations(t.x),t.x.values=t.x.values.map(d.degToRad)),void 0!==t.y&&(this.interpolateRotations(t.y),t.y.values=t.y.values.map(d.degToRad)),void 0!==t.z&&(this.interpolateRotations(t.z),t.z.values=t.z.values.map(d.degToRad));const o=this.getTimesForAllAxes(t),a=this.getKeyframeTrackValues(o,t,n);void 0!==r&&((r=r.map(d.degToRad)).push(s),r=(new Le).fromArray(r),r=(new j).setFromEuler(r)),void 0!==i&&((i=i.map(d.degToRad)).push(s),i=(new Le).fromArray(i),i=(new j).setFromEuler(i).invert());const l=new j,c=new Le,h=[];for(let e=0;e<a.length;e+=3)c.set(a[e],a[e+1],a[e+2],s),l.setFromEuler(c),void 0!==r&&l.premultiply(r),void 0!==i&&l.multiply(i),l.toArray(h,e/3*4);return new Va(e+".quaternion",o,h)}generateMorphTrack(e){const t=e.DeformPercent.curves.morph,n=t.values.map((function(e){return e/100})),r=Cg.getObjectByName(e.modelName).morphTargetDictionary[e.morphName];return new Ga(e.modelName+".morphTargetInfluences["+r+"]",t.times,n)}getTimesForAllAxes(e){let t=[];if(void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),t=t.sort((function(e,t){return e-t})),t.length>1){let e=1,n=t[0];for(let r=1;r<t.length;r++){const i=t[r];i!==n&&(t[e]=i,n=i,e++)}t=t.slice(0,e)}return t}getKeyframeTrackValues(e,t,n){const r=n,i=[];let s=-1,o=-1,a=-1;return e.forEach((function(e){if(t.x&&(s=t.x.times.indexOf(e)),t.y&&(o=t.y.times.indexOf(e)),t.z&&(a=t.z.times.indexOf(e)),-1!==s){const e=t.x.values[s];i.push(e),r[0]=e}else i.push(r[0]);if(-1!==o){const e=t.y.values[o];i.push(e),r[1]=e}else i.push(r[1]);if(-1!==a){const e=t.z.values[a];i.push(e),r[2]=e}else i.push(r[2])})),i}interpolateRotations(e){for(let t=1;t<e.values.length;t++){const n=e.values[t-1],r=e.values[t]-n,i=Math.abs(r);if(i>=180){const s=i/180,o=r/s;let a=n+o;const l=e.times[t-1],c=(e.times[t]-l)/s;let h=l+c;const u=[],d=[];for(;h<e.times[t];)u.push(h),h+=c,d.push(a),a+=o;e.times=qg(e.times,t,u),e.values=qg(e.values,t,d)}}}}class Dg{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(e){this.nodeStack.push(e),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(e,t){this.currentProp=e,this.currentPropName=t}parse(e){this.currentIndent=0,this.allNodes=new Ng,this.nodeStack=[],this.currentProp=[],this.currentPropName="";const t=this,n=e.split(/[\r\n]+/);return n.forEach((function(e,r){const i=e.match(/^[\s\t]*;/),s=e.match(/^[\s\t]*$/);if(i||s)return;const o=e.match("^\\t{"+t.currentIndent+"}(\\w+):(.*){",""),a=e.match("^\\t{"+t.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),l=e.match("^\\t{"+(t.currentIndent-1)+"}}");o?t.parseNodeBegin(e,o):a?t.parseNodeProperty(e,a,n[++r]):l?t.popStack():e.match(/^[^\s\t}]/)&&t.parseNodePropertyContinued(e)})),this.allNodes}parseNodeBegin(e,t){const n=t[1].trim().replace(/^"/,"").replace(/"$/,""),r=t[2].split(",").map((function(e){return e.trim().replace(/^"/,"").replace(/"$/,"")})),i={name:n},s=this.parseNodeAttr(r),o=this.getCurrentNode();0===this.currentIndent?this.allNodes.add(n,i):n in o?("PoseNode"===n?o.PoseNode.push(i):void 0!==o[n].id&&(o[n]={},o[n][o[n].id]=o[n]),""!==s.id&&(o[n][s.id]=i)):"number"==typeof s.id?(o[n]={},o[n][s.id]=i):"Properties70"!==n&&(o[n]="PoseNode"===n?[i]:i),"number"==typeof s.id&&(i.id=s.id),""!==s.name&&(i.attrName=s.name),""!==s.type&&(i.attrType=s.type),this.pushStack(i)}parseNodeAttr(e){let t=e[0];""!==e[0]&&(t=parseInt(e[0]),isNaN(t)&&(t=e[0]));let n="",r="";return e.length>1&&(n=e[1].replace(/^(\w+)::/,""),r=e[2]),{id:t,name:n,type:r}}parseNodeProperty(e,t,n){let r=t[1].replace(/^"/,"").replace(/"$/,"").trim(),i=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===r&&","===i&&(i=n.replace(/"/g,"").replace(/,$/,"").trim());const s=this.getCurrentNode();if("Properties70"!==s.name){if("C"===r){const e=i.split(",").slice(1),t=parseInt(e[0]),n=parseInt(e[1]);let o=i.split(",").slice(3);o=o.map((function(e){return e.trim().replace(/^"/,"")})),r="connections",i=[t,n],function(e,t){for(let n=0,r=e.length,i=t.length;n<i;n++,r++)e[r]=t[n]}(i,o),void 0===s[r]&&(s[r]=[])}"Node"===r&&(s.id=i),r in s&&Array.isArray(s[r])?s[r].push(i):"a"!==r?s[r]=i:s.a=i,this.setCurrentProp(s,r),"a"===r&&","!==i.slice(-1)&&(s.a=Wg(i))}else this.parseNodeSpecialProperty(e,r,i)}parseNodePropertyContinued(e){const t=this.getCurrentNode();t.a+=e,","!==e.slice(-1)&&(t.a=Wg(t.a))}parseNodeSpecialProperty(e,t,n){const r=n.split('",').map((function(e){return e.trim().replace(/^\"/,"").replace(/\s/,"_")})),i=r[0],s=r[1],o=r[2],a=r[3];let l=r[4];switch(s){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=Wg(l)}this.getPrevNode()[i]={type:s,type2:o,flag:a,value:l},this.setCurrentProp(this.getPrevNode(),i)}}class Og{parse(e){const t=new Bg(e);t.skip(23);const n=t.getUint32();if(n<6400)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+n);const r=new Ng;for(;!this.endOfContent(t);){const e=this.parseNode(t,n);null!==e&&r.add(e.name,e)}return r}endOfContent(e){return e.size()%16==0?(e.getOffset()+160+16&-16)>=e.size():e.getOffset()+160+16>=e.size()}parseNode(e,t){const n={},r=t>=7500?e.getUint64():e.getUint32(),i=t>=7500?e.getUint64():e.getUint32();t>=7500?e.getUint64():e.getUint32();const s=e.getUint8(),o=e.getString(s);if(0===r)return null;const a=[];for(let t=0;t<i;t++)a.push(this.parseProperty(e));const l=a.length>0?a[0]:"",c=a.length>1?a[1]:"",h=a.length>2?a[2]:"";for(n.singleProperty=1===i&&e.getOffset()===r;r>e.getOffset();){const r=this.parseNode(e,t);null!==r&&this.parseSubNode(o,n,r)}return n.propertyList=a,"number"==typeof l&&(n.id=l),""!==c&&(n.attrName=c),""!==h&&(n.attrType=h),""!==o&&(n.name=o),n}parseSubNode(e,t,n){if(!0===n.singleProperty){const e=n.propertyList[0];Array.isArray(e)?(t[n.name]=n,n.a=e):t[n.name]=e}else if("Connections"===e&&"C"===n.name){const e=[];n.propertyList.forEach((function(t,n){0!==n&&e.push(t)})),void 0===t.connections&&(t.connections=[]),t.connections.push(e)}else if("Properties70"===n.name)Object.keys(n).forEach((function(e){t[e]=n[e]}));else if("Properties70"===e&&"P"===n.name){let e=n.propertyList[0],r=n.propertyList[1];const i=n.propertyList[2],s=n.propertyList[3];let o;0===e.indexOf("Lcl ")&&(e=e.replace("Lcl ","Lcl_")),0===r.indexOf("Lcl ")&&(r=r.replace("Lcl ","Lcl_")),o="Color"===r||"ColorRGB"===r||"Vector"===r||"Vector3D"===r||0===r.indexOf("Lcl_")?[n.propertyList[4],n.propertyList[5],n.propertyList[6]]:n.propertyList[4],t[e]={type:r,type2:i,flag:s,value:o}}else void 0===t[n.name]?"number"==typeof n.id?(t[n.name]={},t[n.name][n.id]=n):t[n.name]=n:"PoseNode"===n.name?(Array.isArray(t[n.name])||(t[n.name]=[t[n.name]]),t[n.name].push(n)):void 0===t[n.name][n.id]&&(t[n.name][n.id]=n)}parseProperty(e){const t=e.getString(1);let n;switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":return n=e.getUint32(),e.getArrayBuffer(n);case"S":return n=e.getUint32(),e.getString(n);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":const r=e.getUint32(),i=e.getUint32(),s=e.getUint32();if(0===i)switch(t){case"b":case"c":return e.getBooleanArray(r);case"d":return e.getFloat64Array(r);case"f":return e.getFloat32Array(r);case"i":return e.getInt32Array(r);case"l":return e.getInt64Array(r)}void 0===_g&&console.error("THREE.FBXLoader: External library fflate.min.js required.");const o=Zm(new Uint8Array(e.getArrayBuffer(s))),a=new Bg(o.buffer);switch(t){case"b":case"c":return a.getBooleanArray(r);case"d":return a.getFloat64Array(r);case"f":return a.getFloat32Array(r);case"i":return a.getInt32Array(r);case"l":return a.getInt64Array(r)}default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}class Bg{constructor(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===t||t}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(e){this.offset+=e}getBoolean(){return 1==(1&this.getUint8())}getBooleanArray(e){const t=[];for(let n=0;n<e;n++)t.push(this.getBoolean());return t}getUint8(){const e=this.dv.getUint8(this.offset);return this.offset+=1,e}getInt16(){const e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}getInt32(){const e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}getInt32Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getInt32());return t}getUint32(){const e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}getInt64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),2147483648&t?(t=4294967295&~t,e=4294967295&~e,4294967295===e&&(t=t+1&4294967295),e=e+1&4294967295,-(4294967296*t+e)):4294967296*t+e}getInt64Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getInt64());return t}getUint64(){let e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),4294967296*t+e}getFloat32(){const e=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}getFloat32Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getFloat32());return t}getFloat64(){const e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}getFloat64Array(e){const t=[];for(let n=0;n<e;n++)t.push(this.getFloat64());return t}getArrayBuffer(e){const t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}getString(e){let t=[];for(let n=0;n<e;n++)t[n]=this.getUint8();const n=t.indexOf(0);return n>=0&&(t=t.slice(0,n)),Tl.decodeText(new Uint8Array(t))}}class Ng{add(e,t){this[e]=t}}function zg(e){const t=e.match(/FBXVersion: (\d+)/);if(t)return parseInt(t[1]);throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function Ug(e){return e/46186158e3}const kg=[];function Fg(e,t,n,r){let i;switch(r.mappingType){case"ByPolygonVertex":i=e;break;case"ByPolygon":i=t;break;case"ByVertice":i=n;break;case"AllSame":i=r.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+r.mappingType)}"IndexToDirect"===r.referenceType&&(i=r.indices[i]);const s=i*r.dataSize,o=s+r.dataSize;return function(e,t,n,r){for(let i=n,s=0;i<r;i++,s++)e[s]=t[i];return e}(kg,r.buffer,s,o)}const Hg=new Le,Gg=new V;function jg(e){const t=new be,n=new be,r=new be,i=new be,s=new be,o=new be,a=new be,l=new be,c=new be,h=new be,u=new be,p=new be,f=e.inheritType?e.inheritType:0;if(e.translation&&t.setPosition(Gg.fromArray(e.translation)),e.preRotation){const t=e.preRotation.map(d.degToRad);t.push(e.eulerOrder),n.makeRotationFromEuler(Hg.fromArray(t))}if(e.rotation){const t=e.rotation.map(d.degToRad);t.push(e.eulerOrder),r.makeRotationFromEuler(Hg.fromArray(t))}if(e.postRotation){const t=e.postRotation.map(d.degToRad);t.push(e.eulerOrder),i.makeRotationFromEuler(Hg.fromArray(t)),i.invert()}e.scale&&s.scale(Gg.fromArray(e.scale)),e.scalingOffset&&a.setPosition(Gg.fromArray(e.scalingOffset)),e.scalingPivot&&o.setPosition(Gg.fromArray(e.scalingPivot)),e.rotationOffset&&l.setPosition(Gg.fromArray(e.rotationOffset)),e.rotationPivot&&c.setPosition(Gg.fromArray(e.rotationPivot)),e.parentMatrixWorld&&(u.copy(e.parentMatrix),h.copy(e.parentMatrixWorld));const m=n.clone().multiply(r).multiply(i),g=new be;g.extractRotation(h);const v=new be;v.copyPosition(h);const y=v.clone().invert().multiply(h),x=g.clone().invert().multiply(y),w=s,b=new be;if(0===f)b.copy(g).multiply(m).multiply(x).multiply(w);else if(1===f)b.copy(g).multiply(x).multiply(m).multiply(w);else{const e=(new be).scale((new V).setFromMatrixScale(u)).clone().invert(),t=x.clone().multiply(e);b.copy(g).multiply(m).multiply(t).multiply(w)}const _=c.clone().invert(),M=o.clone().invert();let S=t.clone().multiply(l).multiply(c).multiply(n).multiply(r).multiply(i).multiply(_).multiply(a).multiply(o).multiply(s).multiply(M);const T=(new be).copyPosition(S),E=h.clone().multiply(T);return p.copyPosition(E),S=p.clone().multiply(b),S.premultiply(h.invert()),S}function Vg(e){const t=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return 6===(e=e||0)?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),t[0]):t[e]}function Wg(e){return e.split(",").map((function(e){return parseFloat(e)}))}function Xg(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=e.byteLength),Tl.decodeText(new Uint8Array(e,t,n))}function qg(e,t,n){return e.slice(0,t).concat(n).concat(e.slice(t))}class Yg extends rl{constructor(e){super(e)}parse(e){e.length<19&&console.error("THREE.TGALoader: Not enough data to contain header.");let t=0;const n=new Uint8Array(e),r={id_length:n[t++],colormap_type:n[t++],image_type:n[t++],colormap_index:n[t++]|n[t++]<<8,colormap_length:n[t++]|n[t++]<<8,colormap_size:n[t++],origin:[n[t++]|n[t++]<<8,n[t++]|n[t++]<<8],width:n[t++]|n[t++]<<8,height:n[t++]|n[t++]<<8,pixel_size:n[t++],flags:n[t++]};!function(e){switch(e.image_type){case 1:case 9:(e.colormap_length>256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case 2:case 3:case 10:case 11:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case 0:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)}(r),r.id_length+t>e.length&&console.error("THREE.TGALoader: No data."),t+=r.id_length;let i=!1,s=!1,o=!1;switch(r.image_type){case 9:i=!0,s=!0;break;case 1:s=!0;break;case 10:i=!0;break;case 2:break;case 11:i=!0,o=!0;break;case 3:o=!0}const a=new Uint8Array(r.width*r.height*4),l=function(e,t,n,r,i){let s,o;const a=n.pixel_size>>3,l=n.width*n.height*a;if(t&&(o=i.subarray(r,r+=n.colormap_length*(n.colormap_size>>3))),e){let e,t,n;s=new Uint8Array(l);let o=0;const c=new Uint8Array(a);for(;o<l;)if(e=i[r++],t=1+(127&e),128&e){for(n=0;n<a;++n)c[n]=i[r++];for(n=0;n<t;++n)s.set(c,o+n*a);o+=a*t}else{for(t*=a,n=0;n<t;++n)s[o+n]=i[r++];o+=t}}else s=i.subarray(r,r+=t?n.width*n.height:l);return{pixel_data:s,palettes:o}}(i,s,r,t,n);return function(e,t,n,i,s){let a,l,c,h,u,d;switch((48&r.flags)>>4){default:case 2:a=0,c=1,u=t,l=0,h=1,d=n;break;case 0:a=0,c=1,u=t,l=n-1,h=-1,d=-1;break;case 3:a=t-1,c=-1,u=-1,l=0,h=1,d=n;break;case 1:a=t-1,c=-1,u=-1,l=n-1,h=-1,d=-1}if(o)switch(r.pixel_size){case 8:!function(e,t,n,i,s,o,a,l){let c,h,u,d=0;const p=r.width;for(u=t;u!==i;u+=n)for(h=s;h!==a;h+=o,d++)c=l[d],e[4*(h+p*u)+0]=c,e[4*(h+p*u)+1]=c,e[4*(h+p*u)+2]=c,e[4*(h+p*u)+3]=255}(e,l,h,d,a,c,u,i);break;case 16:!function(e,t,n,i,s,o,a,l){let c,h,u=0;const d=r.width;for(h=t;h!==i;h+=n)for(c=s;c!==a;c+=o,u+=2)e[4*(c+d*h)+0]=l[u+0],e[4*(c+d*h)+1]=l[u+0],e[4*(c+d*h)+2]=l[u+0],e[4*(c+d*h)+3]=l[u+1]}(e,l,h,d,a,c,u,i);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(r.pixel_size){case 8:!function(e,t,n,i,s,o,a,l,c){const h=c;let u,d,p,f=0;const m=r.width;for(p=t;p!==i;p+=n)for(d=s;d!==a;d+=o,f++)u=l[f],e[4*(d+m*p)+3]=255,e[4*(d+m*p)+2]=h[3*u+0],e[4*(d+m*p)+1]=h[3*u+1],e[4*(d+m*p)+0]=h[3*u+2]}(e,l,h,d,a,c,u,i,s);break;case 16:!function(e,t,n,i,s,o,a,l){let c,h,u,d=0;const p=r.width;for(u=t;u!==i;u+=n)for(h=s;h!==a;h+=o,d+=2)c=l[d+0]+(l[d+1]<<8),e[4*(h+p*u)+0]=(31744&c)>>7,e[4*(h+p*u)+1]=(992&c)>>2,e[4*(h+p*u)+2]=(31&c)<<3,e[4*(h+p*u)+3]=32768&c?0:255}(e,l,h,d,a,c,u,i);break;case 24:!function(e,t,n,i,s,o,a,l){let c,h,u=0;const d=r.width;for(h=t;h!==i;h+=n)for(c=s;c!==a;c+=o,u+=3)e[4*(c+d*h)+3]=255,e[4*(c+d*h)+2]=l[u+0],e[4*(c+d*h)+1]=l[u+1],e[4*(c+d*h)+0]=l[u+2]}(e,l,h,d,a,c,u,i);break;case 32:!function(e,t,n,i,s,o,a,l){let c,h,u=0;const d=r.width;for(h=t;h!==i;h+=n)for(c=s;c!==a;c+=o,u+=4)e[4*(c+d*h)+2]=l[u+0],e[4*(c+d*h)+1]=l[u+1],e[4*(c+d*h)+0]=l[u+2],e[4*(c+d*h)+3]=l[u+3]}(e,l,h,d,a,c,u,i);break;default:console.error("THREE.TGALoader: Format not supported.")}}(a,r.width,r.height,l.pixel_data,l.palettes),{data:a,width:r.width,height:r.height,flipY:!0,generateMipmaps:!0,minFilter:1008}}}class Zg extends Ka{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new ev(e)})),this.register((function(e){return new ov(e)})),this.register((function(e){return new av(e)})),this.register((function(e){return new tv(e)})),this.register((function(e){return new nv(e)})),this.register((function(e){return new rv(e)})),this.register((function(e){return new iv(e)})),this.register((function(e){return new sv(e)})),this.register((function(e){return new Kg(e)})),this.register((function(e){return new lv(e)}))}load(e,t,n,r){const i=this;let s;s=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:Tl.extractUrlBase(e),this.manager.itemStart(e);const o=function(t){r?r(t):console.error(t),i.manager.itemError(e),i.manager.itemEnd(e)},a=new el(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(n){try{i.parse(n,s,(function(n){t(n),i.manager.itemEnd(e)}),o)}catch(e){o(e)}}),n,o)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}unregister(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,r){let i;const s={},o={};if("string"==typeof e)i=e;else if(Tl.decodeText(new Uint8Array(e,0,4))===cv){try{s[Qg.KHR_BINARY_GLTF]=new hv(e)}catch(e){return void(r&&r(e))}i=s[Qg.KHR_BINARY_GLTF].content}else i=Tl.decodeText(new Uint8Array(e));const a=JSON.parse(i);if(void 0===a.asset||a.asset.version[0]<2)return void(r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const l=new Dv(a,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e<this.pluginCallbacks.length;e++){const t=this.pluginCallbacks[e](l);o[t.name]=t,s[t.name]=!0}if(a.extensionsUsed)for(let e=0;e<a.extensionsUsed.length;++e){const t=a.extensionsUsed[e],n=a.extensionsRequired||[];switch(t){case Qg.KHR_MATERIALS_UNLIT:s[t]=new $g;break;case Qg.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:s[t]=new fv;break;case Qg.KHR_DRACO_MESH_COMPRESSION:s[t]=new uv(a,this.dracoLoader);break;case Qg.KHR_TEXTURE_TRANSFORM:s[t]=new dv;break;case Qg.KHR_MESH_QUANTIZATION:s[t]=new mv;break;default:n.indexOf(t)>=0&&void 0===o[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}l.setExtensions(s),l.setPlugins(o),l.parse(n,r)}parseAsync(e,t){const n=this;return new Promise((function(r,i){n.parse(e,t,r,i)}))}}function Jg(){let e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}const Qg={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"};class Kg{constructor(e){this.parser=e,this.name=Qg.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,r=t.length;n<r;n++){const r=t[n];r.extensions&&r.extensions[this.name]&&void 0!==r.extensions[this.name].light&&e._addNodeRef(this.cache,r.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let r=t.cache.get(n);if(r)return r;const i=t.json,s=((i.extensions&&i.extensions[this.name]||{}).lights||[])[e];let o;const a=new P(16777215);void 0!==s.color&&a.fromArray(s.color);const l=void 0!==s.range?s.range:0;switch(s.type){case"directional":o=new xl(a),o.target.position.set(0,0,-1),o.add(o.target);break;case"point":o=new vl(a),o.distance=l;break;case"spot":o=new dl(a),o.distance=l,s.spot=s.spot||{},s.spot.innerConeAngle=void 0!==s.spot.innerConeAngle?s.spot.innerConeAngle:0,s.spot.outerConeAngle=void 0!==s.spot.outerConeAngle?s.spot.outerConeAngle:Math.PI/4,o.angle=s.spot.outerConeAngle,o.penumbra=1-s.spot.innerConeAngle/s.spot.outerConeAngle,o.target.position.set(0,0,-1),o.add(o.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+s.type)}return o.position.set(0,0,0),o.decay=2,void 0!==s.intensity&&(o.intensity=s.intensity),o.name=t.createUniqueName(s.name||"light_"+e),r=Promise.resolve(o),t.cache.add(n,r),r}createNodeAttachment(e){const t=this,n=this.parser,r=n.json.nodes[e],i=(r.extensions&&r.extensions[this.name]||{}).light;return void 0===i?null:this._loadLight(i).then((function(e){return n._getNodeRef(t.cache,i,e)}))}}class $g{constructor(){this.name=Qg.KHR_MATERIALS_UNLIT}getMaterialType(){return ot}extendParams(e,t,n){const r=[];e.color=new P(1,1,1),e.opacity=1;const i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){const t=i.baseColorFactor;e.color.fromArray(t),e.opacity=t[3]}void 0!==i.baseColorTexture&&r.push(n.assignTexture(e,"map",i.baseColorTexture,3001))}return Promise.all(r)}}class ev{constructor(e){this.parser=e,this.name=Qg.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Ea:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],s=r.extensions[this.name];if(void 0!==s.clearcoatFactor&&(t.clearcoat=s.clearcoatFactor),void 0!==s.clearcoatTexture&&i.push(n.assignTexture(t,"clearcoatMap",s.clearcoatTexture)),void 0!==s.clearcoatRoughnessFactor&&(t.clearcoatRoughness=s.clearcoatRoughnessFactor),void 0!==s.clearcoatRoughnessTexture&&i.push(n.assignTexture(t,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),void 0!==s.clearcoatNormalTexture&&(i.push(n.assignTexture(t,"clearcoatNormalMap",s.clearcoatNormalTexture)),void 0!==s.clearcoatNormalTexture.scale)){const e=s.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new p(e,e)}return Promise.all(i)}}class tv{constructor(e){this.parser=e,this.name=Qg.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Ea:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[];t.sheenColor=new P(0,0,0),t.sheenRoughness=0,t.sheen=1;const s=r.extensions[this.name];return void 0!==s.sheenColorFactor&&t.sheenColor.fromArray(s.sheenColorFactor),void 0!==s.sheenRoughnessFactor&&(t.sheenRoughness=s.sheenRoughnessFactor),void 0!==s.sheenColorTexture&&i.push(n.assignTexture(t,"sheenColorMap",s.sheenColorTexture,3001)),void 0!==s.sheenRoughnessTexture&&i.push(n.assignTexture(t,"sheenRoughnessMap",s.sheenRoughnessTexture)),Promise.all(i)}}class nv{constructor(e){this.parser=e,this.name=Qg.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Ea:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],s=r.extensions[this.name];return void 0!==s.transmissionFactor&&(t.transmission=s.transmissionFactor),void 0!==s.transmissionTexture&&i.push(n.assignTexture(t,"transmissionMap",s.transmissionTexture)),Promise.all(i)}}class rv{constructor(e){this.parser=e,this.name=Qg.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Ea:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],s=r.extensions[this.name];t.thickness=void 0!==s.thicknessFactor?s.thicknessFactor:0,void 0!==s.thicknessTexture&&i.push(n.assignTexture(t,"thicknessMap",s.thicknessTexture)),t.attenuationDistance=s.attenuationDistance||0;const o=s.attenuationColor||[1,1,1];return t.attenuationColor=new P(o[0],o[1],o[2]),Promise.all(i)}}class iv{constructor(e){this.parser=e,this.name=Qg.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Ea:null}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=n.extensions[this.name];return t.ior=void 0!==r.ior?r.ior:1.5,Promise.resolve()}}class sv{constructor(e){this.parser=e,this.name=Qg.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?Ea:null}extendMaterialParams(e,t){const n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const i=[],s=r.extensions[this.name];t.specularIntensity=void 0!==s.specularFactor?s.specularFactor:1,void 0!==s.specularTexture&&i.push(n.assignTexture(t,"specularIntensityMap",s.specularTexture));const o=s.specularColorFactor||[1,1,1];return t.specularColor=new P(o[0],o[1],o[2]),void 0!==s.specularColorTexture&&i.push(n.assignTexture(t,"specularColorMap",s.specularColorTexture,3001)),Promise.all(i)}}class ov{constructor(e){this.parser=e,this.name=Qg.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;const i=r.extensions[this.name],s=t.options.ktx2Loader;if(!s){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,i.source,s)}}class av{constructor(e){this.parser=e,this.name=Qg.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,r=n.json,i=r.textures[e];if(!i.extensions||!i.extensions[t])return null;const s=i.extensions[t],o=r.images[s.source];let a=n.textureLoader;if(o.uri){const e=n.options.manager.getHandler(o.uri);null!==e&&(a=e)}return this.detectSupport().then((function(i){if(i)return n.loadTextureImage(e,o,a);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}class lv{constructor(e){this.name=Qg.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const e=n.extensions[this.name],r=this.parser.getDependency("buffer",e.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([r,i.ready]).then((function(t){const n=e.byteOffset||0,r=e.byteLength||0,s=e.count,o=e.byteStride,a=new ArrayBuffer(s*o),l=new Uint8Array(t[0],n,r);return i.decodeGltfBuffer(new Uint8Array(a),s,o,l,e.mode,e.filter),a}))}return null}}const cv="glTF";class hv{constructor(e){this.name=Qg.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,12);if(this.header={magic:Tl.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==cv)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-12,r=new DataView(e,12);let i=0;for(;i<n;){const t=r.getUint32(i,!0);i+=4;const n=r.getUint32(i,!0);if(i+=4,1313821514===n){const n=new Uint8Array(e,12+i,t);this.content=Tl.decodeText(n)}else if(5130562===n){const n=12+i;this.body=e.slice(n,n+t)}i+=t}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class uv{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Qg.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,r=this.dracoLoader,i=e.extensions[this.name].bufferView,s=e.extensions[this.name].attributes,o={},a={},l={};for(const e in s){const t=Mv[e]||e.toLowerCase();o[t]=s[e]}for(const t in e.attributes){const r=Mv[t]||t.toLowerCase();if(void 0!==s[t]){const i=n.accessors[e.attributes[t]],s=xv[i.componentType];l[r]=s,a[r]=!0===i.normalized}}return t.getDependency("bufferView",i).then((function(e){return new Promise((function(t){r.decodeDracoFile(e,(function(e){for(const t in e.attributes){const n=e.attributes[t],r=a[t];void 0!==r&&(n.normalized=r)}t(e)}),o,l)}))}))}}class dv{constructor(){this.name=Qg.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),void 0===t.offset&&void 0===t.rotation&&void 0===t.scale||(e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class pv extends Ta{constructor(e){super(),this.isGLTFSpecularGlossinessMaterial=!0;const t=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),n=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),r=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),i=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),s=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.roughness += geometryRoughness;","material.roughness = min( material.roughness, 1.0 );","material.specularColor = specularFactor;"].join("\n"),o={specular:{value:(new P).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=o,this.onBeforeCompile=function(e){for(const t in o)e.uniforms[t]=o[t];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",t).replace("#include <metalnessmap_pars_fragment>",n).replace("#include <roughnessmap_fragment>",r).replace("#include <metalnessmap_fragment>",i).replace("#include <lights_physical_fragment>",s)},Object.defineProperties(this,{specular:{get:function(){return o.specular.value},set:function(e){o.specular.value=e}},specularMap:{get:function(){return o.specularMap.value},set:function(e){o.specularMap.value=e,e?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return o.glossiness.value},set:function(e){o.glossiness.value=e}},glossinessMap:{get:function(){return o.glossinessMap.value},set:function(e){o.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(e)}copy(e){return super.copy(e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this}}class fv{constructor(){this.name=Qg.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity"]}getMaterialType(){return pv}extendParams(e,t,n){const r=t.extensions[this.name];e.color=new P(1,1,1),e.opacity=1;const i=[];if(Array.isArray(r.diffuseFactor)){const t=r.diffuseFactor;e.color.fromArray(t),e.opacity=t[3]}if(void 0!==r.diffuseTexture&&i.push(n.assignTexture(e,"map",r.diffuseTexture,3001)),e.emissive=new P(0,0,0),e.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,e.specular=new P(1,1,1),Array.isArray(r.specularFactor)&&e.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture){const t=r.specularGlossinessTexture;i.push(n.assignTexture(e,"glossinessMap",t)),i.push(n.assignTexture(e,"specularMap",t,3001))}return Promise.all(i)}createMaterial(e){const t=new pv(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=0,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t}}class mv{constructor(){this.name=Qg.KHR_MESH_QUANTIZATION}}class gv extends Ba{constructor(e,t,n,r){super(e,t,n,r)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,i=e*r*3+r;for(let e=0;e!==r;e++)t[e]=n[i+e];return t}}gv.prototype.beforeStart_=gv.prototype.copySampleValue_,gv.prototype.afterEnd_=gv.prototype.copySampleValue_,gv.prototype.interpolate_=function(e,t,n,r){const i=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=2*o,l=3*o,c=r-t,h=(n-t)/c,u=h*h,d=u*h,p=e*l,f=p-l,m=-2*d+3*u,g=d-u,v=1-m,y=g-u+h;for(let e=0;e!==o;e++){const t=s[f+e+o],n=s[f+e+a]*c,r=s[p+e+o],l=s[p+e]*c;i[e]=v*t+y*n+m*r+g*l}return i};const vv=new j;class yv extends gv{interpolate_(e,t,n,r){const i=super.interpolate_(e,t,n,r);return vv.fromArray(i).normalize().toArray(i),i}}const xv={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},wv={9728:1003,9729:1006,9984:1004,9985:1007,9986:1005,9987:1008},bv={33071:1001,33648:1002,10497:1e3},_v={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Mv={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Sv={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},Tv={CUBICSPLINE:void 0,LINEAR:2301,STEP:2300};function Ev(e){return void 0===e.DefaultMaterial&&(e.DefaultMaterial=new Ta({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:0})),e.DefaultMaterial}function Av(e,t,n){for(const r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function Cv(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function Pv(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){const n=t.extras.targetNames;if(e.morphTargetInfluences.length===n.length){e.morphTargetDictionary={};for(let t=0,r=n.length;t<r;t++)e.morphTargetDictionary[n[t]]=t}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Rv(e){const t=e.extensions&&e.extensions[Qg.KHR_DRACO_MESH_COMPRESSION];let n;return n=t?"draco:"+t.bufferView+":"+t.indices+":"+Lv(t.attributes):e.indices+":"+Lv(e.attributes)+":"+e.mode,n}function Lv(e){let t="";const n=Object.keys(e).sort();for(let r=0,i=n.length;r<i;r++)t+=n[r]+":"+e[n[r]]+";";return t}function Iv(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}class Dv{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new Jg,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={},"undefined"!=typeof createImageBitmap&&!1===/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?this.textureLoader=new Ll(this.options.manager):this.textureLoader=new il(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new el(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,r=this.json,i=this.extensions;this.cache.removeAll(),this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])})).then((function(t){const s={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};Av(i,s,r),Cv(s,r),Promise.all(n._invokeAll((function(e){return e.afterRoot&&e.afterRoot(s)}))).then((function(){e(s)}))})).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let n=0,r=t.length;n<r;n++){const r=t[n].joints;for(let t=0,n=r.length;t<n;t++)e[r[t]].isBone=!0}for(let t=0,r=e.length;t<r;t++){const r=e[t];void 0!==r.mesh&&(this._addNodeRef(this.meshCache,r.mesh),void 0!==r.skin&&(n[r.mesh].isSkinnedMesh=!0)),void 0!==r.camera&&this._addNodeRef(this.cameraCache,r.camera)}}_addNodeRef(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const r=n.clone(),i=(e,t)=>{const n=this.associations.get(e);null!=n&&this.associations.set(t,n);for(const[n,r]of e.children.entries())i(r,t.children[n])};return i(n,r),r.name+="_instance_"+e.uses[t]++,r}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const r=e(t[n]);if(r)return r}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let r=0;r<t.length;r++){const i=e(t[r]);i&&n.push(i)}return n}getDependency(e,t){const n=e+":"+t;let r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this.loadNode(t);break;case"mesh":r=this._invokeOne((function(e){return e.loadMesh&&e.loadMesh(t)}));break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne((function(e){return e.loadBufferView&&e.loadBufferView(t)}));break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne((function(e){return e.loadMaterial&&e.loadMaterial(t)}));break;case"texture":r=this._invokeOne((function(e){return e.loadTexture&&e.loadTexture(t)}));break;case"skin":r=this.loadSkin(t);break;case"animation":r=this.loadAnimation(t);break;case"camera":r=this.loadCamera(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(n,r)}return r}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,r=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(r.map((function(t,r){return n.getDependency(e,r)}))),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[Qg.KHR_BINARY_GLTF].body);const r=this.options;return new Promise((function(e,i){n.load(Tl.resolveURL(t.uri,r.path),e,void 0,(function(){i(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){const n=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+n)}))}loadAccessor(e){const t=this,n=this.json,r=this.json.accessors[e];if(void 0===r.bufferView&&void 0===r.sparse)return Promise.resolve(null);const i=[];return void 0!==r.bufferView?i.push(this.getDependency("bufferView",r.bufferView)):i.push(null),void 0!==r.sparse&&(i.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),i.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(i).then((function(e){const i=e[0],s=_v[r.type],o=xv[r.componentType],a=o.BYTES_PER_ELEMENT,l=a*s,c=r.byteOffset||0,h=void 0!==r.bufferView?n.bufferViews[r.bufferView].byteStride:void 0,u=!0===r.normalized;let d,p;if(h&&h!==l){const e=Math.floor(c/h),n="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+e+":"+r.count;let l=t.cache.get(n);l||(d=new o(i,e*h,r.count*h/a),l=new qi(d,h/a),t.cache.add(n,l)),p=new Zi(l,s,c%h/a,u)}else d=null===i?new o(r.count*s):new o(i,c,r.count*s),p=new ct(d,s,u);if(void 0!==r.sparse){const t=_v.SCALAR,n=xv[r.sparse.indices.componentType],a=r.sparse.indices.byteOffset||0,l=r.sparse.values.byteOffset||0,c=new n(e[1],a,r.sparse.count*t),h=new o(e[2],l,r.sparse.count*s);null!==i&&(p=new ct(p.array.slice(),p.itemSize,p.normalized));for(let e=0,t=c.length;e<t;e++){const t=c[e];if(p.setX(t,h[e*s]),s>=2&&p.setY(t,h[e*s+1]),s>=3&&p.setZ(t,h[e*s+2]),s>=4&&p.setW(t,h[e*s+3]),s>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return p}))}loadTexture(e){const t=this.json,n=this.options,r=t.textures[e].source,i=t.images[r];let s=this.textureLoader;if(i.uri){const e=n.manager.getHandler(i.uri);null!==e&&(s=e)}return this.loadTextureImage(e,r,s)}loadTextureImage(e,t,n){const r=this,i=this.json,s=i.textures[e],o=i.images[t],a=(o.uri||o.bufferView)+":"+s.sampler;if(this.textureCache[a])return this.textureCache[a];const l=this.loadImageSource(t,n).then((function(t){t.flipY=!1,s.name&&(t.name=s.name);const n=(i.samplers||{})[s.sampler]||{};return t.magFilter=wv[n.magFilter]||1006,t.minFilter=wv[n.minFilter]||1008,t.wrapS=bv[n.wrapS]||1e3,t.wrapT=bv[n.wrapT]||1e3,r.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[a]=l,l}loadImageSource(e,t){const n=this.json,r=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((e=>e.clone()));const i=n.images[e],s=self.URL||self.webkitURL;let o=i.uri||"",a=!1;if(void 0!==i.bufferView)o=this.getDependency("bufferView",i.bufferView).then((function(e){a=!0;const t=new Blob([e],{type:i.mimeType});return o=s.createObjectURL(t),o}));else if(void 0===i.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const l=Promise.resolve(o).then((function(e){return new Promise((function(n,i){let s=n;!0===t.isImageBitmapLoader&&(s=function(e){const t=new B(e);t.needsUpdate=!0,n(t)}),t.load(Tl.resolveURL(e,r.path),s,void 0,i)}))})).then((function(e){var t;return!0===a&&s.revokeObjectURL(o),e.userData.mimeType=i.mimeType||((t=i.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",o),e}));return this.sourceCache[e]=l,l}assignTexture(e,t,n,r){const i=this;return this.getDependency("texture",n.index).then((function(s){if(void 0===n.texCoord||0==n.texCoord||"aoMap"===t&&1==n.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+t+" not yet supported."),i.extensions[Qg.KHR_TEXTURE_TRANSFORM]){const e=void 0!==n.extensions?n.extensions[Qg.KHR_TEXTURE_TRANSFORM]:void 0;if(e){const t=i.associations.get(s);s=i.extensions[Qg.KHR_TEXTURE_TRANSFORM].extendTexture(s,e),i.associations.set(s,t)}}return void 0!==r&&(s.encoding=r),e[t]=s,s}))}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const r=void 0===t.attributes.tangent,i=void 0!==t.attributes.color,s=void 0===t.attributes.normal;if(e.isPoints){const e="PointsMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new js,st.prototype.copy.call(t,n),t.color.copy(n.color),t.map=n.map,t.sizeAttenuation=!1,this.cache.add(e,t)),n=t}else if(e.isLine){const e="LineBasicMaterial:"+n.uuid;let t=this.cache.get(e);t||(t=new Is,st.prototype.copy.call(t,n),t.color.copy(n.color),this.cache.add(e,t)),n=t}if(r||i||s){let e="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(e+="specular-glossiness:"),r&&(e+="derivative-tangents:"),i&&(e+="vertex-colors:"),s&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=n.clone(),i&&(t.vertexColors=!0),s&&(t.flatShading=!0),r&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(n))),n=t}n.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),e.material=n}getMaterialType(){return Ta}loadMaterial(e){const t=this,n=this.json,r=this.extensions,i=n.materials[e];let s;const o={},a=i.extensions||{},l=[];if(a[Qg.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const e=r[Qg.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];s=e.getMaterialType(),l.push(e.extendParams(o,i,t))}else if(a[Qg.KHR_MATERIALS_UNLIT]){const e=r[Qg.KHR_MATERIALS_UNLIT];s=e.getMaterialType(),l.push(e.extendParams(o,i,t))}else{const n=i.pbrMetallicRoughness||{};if(o.color=new P(1,1,1),o.opacity=1,Array.isArray(n.baseColorFactor)){const e=n.baseColorFactor;o.color.fromArray(e),o.opacity=e[3]}void 0!==n.baseColorTexture&&l.push(t.assignTexture(o,"map",n.baseColorTexture,3001)),o.metalness=void 0!==n.metallicFactor?n.metallicFactor:1,o.roughness=void 0!==n.roughnessFactor?n.roughnessFactor:1,void 0!==n.metallicRoughnessTexture&&(l.push(t.assignTexture(o,"metalnessMap",n.metallicRoughnessTexture)),l.push(t.assignTexture(o,"roughnessMap",n.metallicRoughnessTexture))),s=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),l.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)}))))}!0===i.doubleSided&&(o.side=2);const c=i.alphaMode||"OPAQUE";if("BLEND"===c?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,"MASK"===c&&(o.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&s!==ot&&(l.push(t.assignTexture(o,"normalMap",i.normalTexture)),o.normalScale=new p(1,1),void 0!==i.normalTexture.scale)){const e=i.normalTexture.scale;o.normalScale.set(e,e)}return void 0!==i.occlusionTexture&&s!==ot&&(l.push(t.assignTexture(o,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(o.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&s!==ot&&(o.emissive=(new P).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&s!==ot&&l.push(t.assignTexture(o,"emissiveMap",i.emissiveTexture,3001)),Promise.all(l).then((function(){let n;return n=s===pv?r[Qg.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new s(o),i.name&&(n.name=i.name),Cv(n,i),t.associations.set(n,{materials:e}),i.extensions&&Av(r,n,i),n}))}createUniqueName(e){const t=ac.sanitizeNodeName(e||"");let n=t;for(let e=1;this.nodeNamesUsed[n];++e)n=t+"_"+e;return this.nodeNamesUsed[n]=!0,n}loadGeometries(e){const t=this,n=this.extensions,r=this.primitiveCache;function i(e){return n[Qg.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return Bv(n,e,t)}))}const s=[];for(let n=0,o=e.length;n<o;n++){const o=e[n],a=Rv(o),l=r[a];if(l)s.push(l.promise);else{let e;e=o.extensions&&o.extensions[Qg.KHR_DRACO_MESH_COMPRESSION]?i(o):Bv(new At,o,t),r[a]={primitive:o,promise:e},s.push(e)}}return Promise.all(s)}loadMesh(e){const t=this,n=this.json,r=this.extensions,i=n.meshes[e],s=i.primitives,o=[];for(let e=0,t=s.length;e<t;e++){const t=void 0===s[e].material?Ev(this.cache):this.getDependency("material",s[e].material);o.push(t)}return o.push(t.loadGeometries(s)),Promise.all(o).then((function(n){const o=n.slice(0,n.length-1),a=n[n.length-1],l=[];for(let n=0,c=a.length;n<c;n++){const c=a[n],h=s[n];let u;const d=o[n];if(4===h.mode||5===h.mode||6===h.mode||void 0===h.mode)u=!0===i.isSkinnedMesh?new ws(c,d):new Wt(c,d),!0!==u.isSkinnedMesh||u.geometry.attributes.skinWeight.normalized||u.normalizeSkinWeights(),5===h.mode?u.geometry=Nv(u.geometry,1):6===h.mode&&(u.geometry=Nv(u.geometry,2));else if(1===h.mode)u=new Hs(c,d);else if(3===h.mode)u=new Us(c,d);else if(2===h.mode)u=new Gs(c,d);else{if(0!==h.mode)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+h.mode);u=new Ys(c,d)}Object.keys(u.geometry.morphAttributes).length>0&&Pv(u,i),u.name=t.createUniqueName(i.name||"mesh_"+e),Cv(u,i),h.extensions&&Av(r,u,h),t.assignFinalMaterial(u),l.push(u)}for(let n=0,r=l.length;n<r;n++)t.associations.set(l[n],{meshes:e,primitives:n});if(1===l.length)return l[0];const c=new Ni;t.associations.set(c,{meshes:e});for(let e=0,t=l.length;e<t;e++)c.add(l[e]);return c}))}loadCamera(e){let t;const n=this.json.cameras[e],r=n[n.type];if(r)return"perspective"===n.type?t=new $t(d.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===n.type&&(t=new Mn(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),Cv(t,n),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")}loadSkin(e){const t=this.json.skins[e],n={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(n):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return n.inverseBindMatrices=e,n}))}loadAnimation(e){const t=this.json.animations[e],n=[],r=[],i=[],s=[],o=[];for(let e=0,a=t.channels.length;e<a;e++){const a=t.channels[e],l=t.samplers[a.sampler],c=a.target,h=void 0!==c.node?c.node:c.id,u=void 0!==t.parameters?t.parameters[l.input]:l.input,d=void 0!==t.parameters?t.parameters[l.output]:l.output;n.push(this.getDependency("node",h)),r.push(this.getDependency("accessor",u)),i.push(this.getDependency("accessor",d)),s.push(l),o.push(c)}return Promise.all([Promise.all(n),Promise.all(r),Promise.all(i),Promise.all(s),Promise.all(o)]).then((function(n){const r=n[0],i=n[1],s=n[2],o=n[3],a=n[4],l=[];for(let e=0,t=r.length;e<t;e++){const t=r[e],n=i[e],c=s[e],h=o[e],u=a[e];if(void 0===t)continue;let d;switch(t.updateMatrix(),t.matrixAutoUpdate=!0,Sv[u.path]){case Sv.weights:d=Ga;break;case Sv.rotation:d=Va;break;case Sv.position:case Sv.scale:default:d=Xa}const p=t.name?t.name:t.uuid,f=void 0!==h.interpolation?Tv[h.interpolation]:2301,m=[];Sv[u.path]===Sv.weights?t.traverse((function(e){e.morphTargetInfluences&&m.push(e.name?e.name:e.uuid)})):m.push(p);let g=c.array;if(c.normalized){const e=Iv(g.constructor),t=new Float32Array(g.length);for(let n=0,r=g.length;n<r;n++)t[n]=g[n]*e;g=t}for(let e=0,t=m.length;e<t;e++){const t=new d(m[e]+"."+Sv[u.path],n.array,g,f);"CUBICSPLINE"===h.interpolation&&(t.createInterpolant=function(e){return new(this instanceof Va?yv:gv)(this.times,this.values,this.getValueSize()/3,e)},t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(t)}}const c=t.name?t.name:"animation_"+e;return new qa(c,void 0,l)}))}createNodeMesh(e){const t=this.json,n=this,r=t.nodes[e];return void 0===r.mesh?null:n.getDependency("mesh",r.mesh).then((function(e){const t=n._getNodeRef(n.meshCache,r.mesh,e);return void 0!==r.weights&&t.traverse((function(e){if(e.isMesh)for(let t=0,n=r.weights.length;t<n;t++)e.morphTargetInfluences[t]=r.weights[t]})),t}))}loadNode(e){const t=this.json,n=this.extensions,r=this,i=t.nodes[e],s=i.name?r.createUniqueName(i.name):"";return function(){const t=[],n=r._invokeOne((function(t){return t.createNodeMesh&&t.createNodeMesh(e)}));return n&&t.push(n),void 0!==i.camera&&t.push(r.getDependency("camera",i.camera).then((function(e){return r._getNodeRef(r.cameraCache,i.camera,e)}))),r._invokeAll((function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)})).forEach((function(e){t.push(e)})),Promise.all(t)}().then((function(t){let o;if(o=!0===i.isBone?new bs:t.length>1?new Ni:1===t.length?t[0]:new Xe,o!==t[0])for(let e=0,n=t.length;e<n;e++)o.add(t[e]);if(i.name&&(o.userData.name=i.name,o.name=s),Cv(o,i),i.extensions&&Av(n,o,i),void 0!==i.matrix){const e=new be;e.fromArray(i.matrix),o.applyMatrix4(e)}else void 0!==i.translation&&o.position.fromArray(i.translation),void 0!==i.rotation&&o.quaternion.fromArray(i.rotation),void 0!==i.scale&&o.scale.fromArray(i.scale);return r.associations.has(o)||r.associations.set(o,{}),r.associations.get(o).nodes=e,o}))}loadScene(e){const t=this.json,n=this.extensions,r=this.json.scenes[e],i=this,s=new Ni;r.name&&(s.name=i.createUniqueName(r.name)),Cv(s,r),r.extensions&&Av(n,s,r);const o=r.nodes||[],a=[];for(let e=0,n=o.length;e<n;e++)a.push(Ov(o[e],s,t,i));return Promise.all(a).then((function(){return i.associations=(e=>{const t=new Map;for(const[e,n]of i.associations)(e instanceof st||e instanceof B)&&t.set(e,n);return e.traverse((e=>{const n=i.associations.get(e);null!=n&&t.set(e,n)})),t})(s),s}))}}function Ov(e,t,n,r){const i=n.nodes[e];return r.getDependency("node",e).then((function(e){if(void 0===i.skin)return e;let t;return r.getDependency("skin",i.skin).then((function(e){t=e;const n=[];for(let e=0,i=t.joints.length;e<i;e++)n.push(r.getDependency("node",t.joints[e]));return Promise.all(n)})).then((function(n){return e.traverse((function(e){if(!e.isMesh)return;const r=[],i=[];for(let e=0,s=n.length;e<s;e++){const s=n[e];if(s){r.push(s);const n=new be;void 0!==t.inverseBindMatrices&&n.fromArray(t.inverseBindMatrices.array,16*e),i.push(n)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[e])}e.bind(new Ts(r,i),e.matrixWorld)})),e}))})).then((function(e){t.add(e);const s=[];if(i.children){const t=i.children;for(let i=0,o=t.length;i<o;i++){const o=t[i];s.push(Ov(o,e,n,r))}}return Promise.all(s)}))}function Bv(e,t,n){const r=t.attributes,i=[];function s(t,r){return n.getDependency("accessor",t).then((function(t){e.setAttribute(r,t)}))}for(const t in r){const n=Mv[t]||t.toLowerCase();n in e.attributes||i.push(s(r[t],n))}if(void 0!==t.indices&&!e.index){const r=n.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));i.push(r)}return Cv(e,t),function(e,t,n){const r=t.attributes,i=new q;if(void 0===r.POSITION)return;{const e=n.json.accessors[r.POSITION],t=e.min,s=e.max;if(void 0===t||void 0===s)return void console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");if(i.set(new V(t[0],t[1],t[2]),new V(s[0],s[1],s[2])),e.normalized){const t=Iv(xv[e.componentType]);i.min.multiplyScalar(t),i.max.multiplyScalar(t)}}const s=t.targets;if(void 0!==s){const e=new V,t=new V;for(let r=0,i=s.length;r<i;r++){const i=s[r];if(void 0!==i.POSITION){const r=n.json.accessors[i.POSITION],s=r.min,o=r.max;if(void 0!==s&&void 0!==o){if(t.setX(Math.max(Math.abs(s[0]),Math.abs(o[0]))),t.setY(Math.max(Math.abs(s[1]),Math.abs(o[1]))),t.setZ(Math.max(Math.abs(s[2]),Math.abs(o[2]))),r.normalized){const e=Iv(xv[r.componentType]);t.multiplyScalar(e)}e.max(t)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(e)}e.boundingBox=i;const o=new de;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,e.boundingSphere=o}(e,t,n),Promise.all(i).then((function(){return void 0!==t.targets?function(e,t,n){let r=!1,i=!1,s=!1;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(void 0!==n.POSITION&&(r=!0),void 0!==n.NORMAL&&(i=!0),void 0!==n.COLOR_0&&(s=!0),r&&i&&s)break}if(!r&&!i&&!s)return Promise.resolve(e);const o=[],a=[],l=[];for(let c=0,h=t.length;c<h;c++){const h=t[c];if(r){const t=void 0!==h.POSITION?n.getDependency("accessor",h.POSITION):e.attributes.position;o.push(t)}if(i){const t=void 0!==h.NORMAL?n.getDependency("accessor",h.NORMAL):e.attributes.normal;a.push(t)}if(s){const t=void 0!==h.COLOR_0?n.getDependency("accessor",h.COLOR_0):e.attributes.color;l.push(t)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(l)]).then((function(t){const n=t[0],o=t[1],a=t[2];return r&&(e.morphAttributes.position=n),i&&(e.morphAttributes.normal=o),s&&(e.morphAttributes.color=a),e.morphTargetsRelative=!0,e}))}(e,t.targets,n):e}))}function Nv(e,t){let n=e.getIndex();if(null===n){const t=[],r=e.getAttribute("position");if(void 0===r)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),n=e.getIndex()}const r=n.count-2,i=[];if(2===t)for(let e=1;e<=r;e++)i.push(n.getX(0)),i.push(n.getX(e)),i.push(n.getX(e+1));else for(let e=0;e<r;e++)e%2==0?(i.push(n.getX(e)),i.push(n.getX(e+1)),i.push(n.getX(e+2))):(i.push(n.getX(e+2)),i.push(n.getX(e+1)),i.push(n.getX(e)));i.length/3!==r&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=e.clone();return s.setIndex(i),s}const zv=new WeakMap;class Uv extends Ka{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,r){const i=new el(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,(e=>{const n={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,n).then(t).catch(r)}),n,r)}decodeDracoFile(e,t,n,r){const i={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,i).then(t)}decodeGeometry(e,t){for(const e in t.attributeTypes){const n=t.attributeTypes[e];void 0!==n.BYTES_PER_ELEMENT&&(t.attributeTypes[e]=n.name)}const n=JSON.stringify(t);if(zv.has(e)){const t=zv.get(e);if(t.key===n)return t.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let r;const i=this.workerNextTaskID++,s=e.byteLength,o=this._getWorker(i,s).then((n=>(r=n,new Promise(((n,s)=>{r._callbacks[i]={resolve:n,reject:s},r.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))))).then((e=>this._createGeometry(e.geometry)));return o.catch((()=>!0)).then((()=>{r&&i&&this._releaseTask(r,i)})),zv.set(e,{key:n,promise:o}),o}_createGeometry(e){const t=new At;e.index&&t.setIndex(new ct(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const r=e.attributes[n],i=r.name,s=r.array,o=r.itemSize;t.setAttribute(i,new ct(s,o))}return t}_loadLibrary(e,t){const n=new el(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise(((t,r)=>{n.load(e,t,void 0,r)}))}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then((t=>{const n=t[0];e||(this.decoderConfig.wasmBinary=t[1]);const r=kv.toString(),i=["/* draco decoder */",n,"","/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([i]))})),this.decoderPending}_getWorker(e,t){return this._initDecoder().then((()=>{if(this.workerPool.length<this.workerLimit){const e=new Worker(this.workerSourceURL);e._callbacks={},e._taskCosts={},e._taskLoad=0,e.postMessage({type:"init",decoderConfig:this.decoderConfig}),e.onmessage=function(t){const n=t.data;switch(n.type){case"decode":e._callbacks[n.id].resolve(n);break;case"error":e._callbacks[n.id].reject(n);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+n.type+'"')}},this.workerPool.push(e)}else this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n}))}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map((e=>e._taskLoad)))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function kv(){let e,t;function n(e,t,n,r,i,s){const o=s.num_components(),a=n.num_points()*o,l=a*i.BYTES_PER_ELEMENT,c=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,i),h=e._malloc(l);t.GetAttributeDataArrayForAllPoints(n,s,c,l,h);const u=new i(e.HEAPF32.buffer,h,a).slice();return e._free(h),{name:r,array:u,itemSize:o}}onmessage=function(r){const i=r.data;switch(i.type){case"init":e=i.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":const r=i.buffer,s=i.taskConfig;t.then((e=>{const t=e.draco,o=new t.Decoder,a=new t.DecoderBuffer;a.Init(new Int8Array(r),r.byteLength);try{const e=function(e,t,r,i){const s=i.attributeIDs,o=i.attributeTypes;let a,l;const c=t.GetEncodedGeometryType(r);if(c===e.TRIANGULAR_MESH)a=new e.Mesh,l=t.DecodeBufferToMesh(r,a);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");a=new e.PointCloud,l=t.DecodeBufferToPointCloud(r,a)}if(!l.ok()||0===a.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+l.error_msg());const h={index:null,attributes:[]};for(const r in s){const l=self[o[r]];let c,u;if(i.useUniqueIDs)u=s[r],c=t.GetAttributeByUniqueId(a,u);else{if(u=t.GetAttributeId(a,e[s[r]]),-1===u)continue;c=t.GetAttribute(a,u)}h.attributes.push(n(e,t,a,r,l,c))}return c===e.TRIANGULAR_MESH&&(h.index=function(e,t,n){const r=3*n.num_faces(),i=4*r,s=e._malloc(i);t.GetTrianglesUInt32Array(n,i,s);const o=new Uint32Array(e.HEAPF32.buffer,s,r).slice();return e._free(s),{array:o,itemSize:1}}(e,t,a)),e.destroy(a),h}(t,o,a,s),r=e.attributes.map((e=>e.array.buffer));e.index&&r.push(e.index.array.buffer),self.postMessage({type:"decode",id:i.id,geometry:e},r)}catch(e){console.error(e),self.postMessage({type:"error",id:i.id,error:e.message})}finally{t.destroy(a),t.destroy(o)}}))}}}class Fv extends Zp{constructor(e){super("Model",e),this.viewport=e,this.gltfLoader=null,this.fbxLoader=null,this.modelMaps=new Map,this.store=Kp.createInstance({name:"soonspace",storeName:"modelData"}),this.dracoDecoderPath=null}setDracoDecoderPath(e){this.dracoDecoderPath=e}load(e){return this._loadItem(e)}parse(e,t,n){return new Promise(((r,i)=>{const s=new Dp(Object.assign({format:e},n)),o=new Ja;o.addHandler(/\.tga$/i,new Yg);const{url:a}=n,l=e.toLocaleUpperCase(),c=a.substring(0,a.lastIndexOf("/")+1);if("GLTF"===l||"GLB"===l||"SBMX"===l){if(this.gltfLoader||(this.gltfLoader=new Zg(o)),this.dracoDecoderPath&&!this.gltfLoader.dracoLoader){const e=new Uv;e.setDecoderPath(this.dracoDecoderPath),this.gltfLoader.setDRACOLoader(e)}this.gltfLoader.parse(t,c,(e=>{const{animations:t}=e;if(t&&t.length>0&&(s.animations=t),e.scene.traverse((e=>{"AmbientLight"!==e.type&&"DirectionalLight"!==e.type||(e.visible=!1),e.castShadow=!0,e.receiveShadow=!0})),s.add(e.scene),!this.modelMaps.get(a)){const e=s.sClone();this.modelMaps.set(a,e)}r(s)}),(e=>{i(e)}))}else if("FBX"===l){this.fbxLoader||(this.fbxLoader=new Pg(o));const e=this.fbxLoader.parse(t,c),{animations:n}=e;if(n&&n.length>0&&(s.animations=n),e.traverse((e=>{"AmbientLight"!==e.type&&"DirectionalLight"!==e.type||(e.visible=!1),e.castShadow=!0,e.receiveShadow=!0})),s.add(e),!this.modelMaps.get(a)){const e=s.sClone();this.modelMaps.set(a,e)}r(s)}else i(`In soonspacejs: 加载通用模型资源(id:${n.id}, url:${a})格式错误,当前支持 fbx、gltf、glb !`)}))}clone(e,t,n){return new Promise(((r,i)=>$u(this,void 0,void 0,(function*(){"Model"!==e.stype&&i("In soonspacejs: 方法 cloneModel 参入对象类型错误!");const{id:s,name:o,level:a,visible:l,position:c,rotation:h,scale:u,onClick:d,onDblClick:p,onRightClick:f,onLoad:m,userData:g}=t;function v(e,t,n){n(e,t);for(let r=0;r<e.children.length;r++)v(e.children[r],t.children[r],n)}const y=yield function(e){const t=new Map,n=new Map;let r;return r=e instanceof Au||e instanceof Eu?e.sClone():e.clone(),v(e,r,(function(e,r){t.set(r,e),n.set(e,r)})),r.traverse((function(e){if(e instanceof ws){const r=e,i=t.get(e),s=i.skeleton.bones;r.skeleton=i.skeleton.clone(),r.bindMatrix.copy(i.bindMatrix),r.skeleton.bones=s.map((function(e){return n.get(e)})),r.bind(r.skeleton,r.bindMatrix)}})),r}(e);y.animations=yield y.animations.map((e=>e.clone())),yield this._copyMaterial(y),s&&(y.sid=s),o&&(y.name=o),a&&(y.level=a),!1===l&&y.hide(),c&&y.position.set(c.x,c.y,c.z),h&&y.rotation.set(h.x,h.y,h.z),u&&y.scale.set(u.x,u.y,u.z),y.onClick=d?d.bind(y):null,y.onDblClick=p?p.bind(y):null,y.onRightClick=f?f.bind(y):null,y.onLoad=m?m.bind(y):null,y.onLoad&&y.onLoad(y),g&&(y.userData=g),null!==n&&this.viewport.scener.addObject(y,n||e.parent||this.scene),r(y)}))))}loadToGroup(e,t){return $u(this,void 0,void 0,(function*(){const n=new Pu(e);for(let e=0;e<t.length;e++)try{const r=yield this._loadItem(t[e],null);n.add(r)}catch(e){console.error(e)}return this.viewport.scener.addObject(n,this.scene),n}))}addForGroup(e,t){return $u(this,void 0,void 0,(function*(){const n=this.getGroupById(e);if(n)for(let e=0;e<t.length;e++)try{const r=yield this._loadItem(t[e],null);this.viewport.scener.addObject(r,n)}catch(e){console.error(e)}return n}))}clearIdb(){return this.store.clear()}_loadItem(e,t=this.scene){var n;return $u(this,void 0,void 0,(function*(){const{url:r}=e,{useIndexedDB:i}=this.viewport.options,s=r.slice(r.lastIndexOf(".")+1),o=this.modelMaps.get(r);let a=null;if(o)return this.clone(o,e,t);i&&(a=yield this.store.getItem(r)),a||(a=yield this._fetchBuffer(e));const l=yield this.parse(s,a,e);return null===(n=l.onLoad)||void 0===n||n.call(l,l),null!==t&&this.viewport.scener.addObject(l,t||this.scene),l}))}_fetchBuffer(e){const{url:t}=e,{useIndexedDB:n}=this.viewport.options;return fetch(t).then((e=>e.arrayBuffer())).then((e=>(n&&(Qh(t)&&(e=Kh(e)),this.store.setItem(t,e)),e)))}_copyMaterial(e){e.traverse((e=>{e instanceof Wt&&(ru(e.material)?e.material=e.material.map((e=>e.clone())):e.material instanceof st&&(e.material=e.material.clone()))}))}}class Hv extends Zp{constructor(e){super("Poi",e),this.materials=new Map}create(e){const t=this._createMaterial(e.url),n=new Np(t,e);return this.viewport.scener.addObject(n,this.scene),n}clone(e,t,n){"Poi"!==e.stype&&console.error("In soonspacejs: 方法 clonePoi 参入对象类型错误!");const{id:r,name:i,level:s,visible:o,position:a,rotation:l,scale:c,onClick:h,onDblClick:u,onRightClick:d,userData:p}=t,f=e.sClone();return this._copyMaterial(f),r&&(f.sid=r),i&&(f.name=i),s&&(f.level=s),tu(o)&&(f.visible=o),a&&f.position.set(a.x,a.y,a.z),l&&f.rotation.set(l.x,l.y,l.z),c&&f.scale.set(c.x,c.y,c.z),f.onClick=h?h.bind(f):null,f.onDblClick=u?u.bind(f):null,f.onRightClick=d?d.bind(f):null,p&&(f.userData=p),null!==n&&this.viewport.scener.addObject(f,n||this.scene||e.parent),f}createToGroup(e,t){const n=new Pu(e);return t.forEach((e=>{const t=this._createMaterial(e.url),r=new Np(t,e);n.add(r)})),this.viewport.scener.addObject(n,this.scene),n}addForGroup(e,t){const n=this.getGroupById(e);return n&&(t.forEach((e=>{const t=this._createMaterial(e.url),r=new Np(t,e);n.add(r)})),this.viewport.scener.addObject(n,this.scene)),n}_createMaterial(e){const t=this.materials.get(e);if(!t){const t=(new il).load(e);t.flipY=!0;const n=new Ji({map:t,color:16777215});return this.materials.set(e,n),n}return t}_copyMaterial(e){e.traverse((e=>{(e instanceof Wt||e instanceof hs)&&(ru(e.material)?e.material=e.material.map((e=>e.clone())):e.material instanceof st&&(e.material=e.material.clone()))}))}}class Gv extends Zp{constructor(e){super("PoiNode",e)}create(e){this._openEnableRenderCss(e);const t=new Ku(e);return this.viewport.scener.addObject(t,this.scene),t}createToGroup(e,t){const n=new Pu(e);return t.forEach((e=>{this._openEnableRenderCss(e);const t=new Ku(e);n.add(t)})),this.viewport.scener.addObject(n,this.scene),n}addForGroup(e,t){const n=this.getGroupById(e);return n&&(t.forEach((e=>{const t=new Ku(e);n.add(t)})),this.viewport.scener.addObject(n,this.scene)),n}_openEnableRenderCss(e){switch(e.type){case"2d":case"2D":this.viewport.rendererManager.setInternalState("enableRenderCss2D",!0);break;case"2.5d":case"2.5D":this.viewport.rendererManager.setInternalState("enableRenderCss2DHalf",!0);break;case"3d":case"3D":this.viewport.rendererManager.setInternalState("enableRenderCss3D",!0)}}}class jv extends Zp{constructor(e){super("Canvas3D",e)}create(e){const t=new Xp(e);return this.viewport.scener.addObject(t,this.scene),t}createToGroup(e,t){const n=new Pu(e);return t.forEach((e=>{const t=new Xp(e);n.add(t)})),this.viewport.scener.addObject(n,this.scene),n}addForGroup(e,t){const n=this.getGroupById(e);return n&&(t.forEach((e=>{const t=new Xp(e);n.add(t)})),this.viewport.scener.addObject(n,this.scene)),n}}class Vv{constructor(){this.graph=[],this.queue=null,this.distance=[],this.previous=[]}setGraph(e){if(!ru(e))return console.error("In soonspacejs: 内容错误 - 路径计算! ( dijkstra setGraph method graph isn't an array )");if(!(e.length<1))for(let t=0;t<e.length;t++){const n=e[t];if(2!==n.length)return console.error(`In soonspacejs: 内容错误 - 路径计算! ( dijkstra setGraph method graph item must be an array and contain 2 values [name, vertices], Failed at index: ${t} )`);const r=n[0],i=n[1];this.graph[r]=[];for(let e=0;e<i.length;e++){const t=i[e],n=t[0],s=t[1];this.graph[r][n]=s}}}getPath(e,t){if(void 0===this.graph[e])return console.error(`In soonspacejs: 内容错误 - 路径计算! ( dijkstra getPath method source ${e} doesn't exist )`),[];if(void 0===this.graph[t])return console.error(`In soonspacejs: 内容错误 - 路径计算! ( dijkstra getPath method target ${t} doesn't exist )`),[];if(e===t)return[];let n;for(this.queue=new Zh,this.queue.add(e,0),this.previous[e]=null;n=this.queue.shift();){if(n===t){const e=[];for(;nu(n)&&null!==this.previous[n];)e.unshift(n),n=this.previous[n];return e}const e=this.queue.getDistance(n);if(e===1/0)return[];for(const t in this.graph[n]){const r=this.queue.getDistance(Number(t)),i=e+this.graph[n][t];i<r&&(this.queue.update(Number(t),i),this.previous[t]=n)}}return[]}}class Wv extends Zp{constructor(e){super("Topology",e),this.dijkstra=new Vv}createFromGml(e){const{url:t,linkWidth:n=20,linkColor:r=65280,renderNode:i=!0,nodeColor:s=255}=e;return sf(t).then((t=>{if(!t||!t.MultiLayeredGraph)return Promise.reject('In soonspace: createTopologyFromGml "url" path error!');const o=[],a=new Map;let l=[],c=[];const h=t.MultiLayeredGraph.SpaceLayerMember.SpaceLayer.X_floor;ru(h)?h.forEach((e=>{l=[...l,...e.state],c=[...c,...e.transition]})):(l=[...l,...h.state],c=[...c,...h.transition]),l.forEach(((e,t)=>{const n=e.State._attributes["gml:id"],r=e.State.topoNode["gml:Node"].node_name;o.push({id:eu(n)?n:"",name:eu(r)?r:"",position:{x:Number(e.State.topoNode["gml:Node"].xcoord["#text"]),y:Number(e.State.topoNode["gml:Node"].zcoord["#text"]),z:-1*Number(e.State.topoNode["gml:Node"].ycoord["#text"])},graphs:[]}),a.set(n,t)})),c.forEach((e=>{const t=e.Transition.topoEdge["gml:Edge"]["gml:directedNode"][0]._attributes["xlink:href"],n=e.Transition.topoEdge["gml:Edge"]["gml:directedNode"][1]._attributes["xlink:href"],r=e.Transition.topoEdge["gml:Edge"].length["#text"],i=e.Transition.topoEdge["gml:Edge"].restrict["#text"],s=e.Transition.topoEdge["gml:Edge"].passable["#text"],l=a.get(t),c=a.get(n),h=e.Transition._attributes["gml:id"],u=e.Transition.topoEdge["gml:Edge"].link_name["#text"];void 0!==l&&void 0!==c&&("2"!==s&&"3"!==s&&o[l].graphs.push({targetNodeId:n,linkInfo:{id:h,name:u},enable:!0,length:parseInt(r),restrict:parseInt(i),passable:parseInt(s)}),"1"!==s&&"3"!==s&&o[c].graphs.push({targetNodeId:t,linkInfo:{id:h,name:u},enable:!0,length:parseInt(r),restrict:parseInt(i),passable:parseInt(s)}))})),this.setDijkstraGraph(o);const u=new Hp(Object.assign(Object.assign({},e),{type:"network",nodes:o,linkWidth:n,renderLink:!0,linkColor:r,renderNode:i,nodeColor:s}));return this.viewport.scener.addObject(u,this.scene),Promise.resolve(u)}))}create(e){const t=this.generateLineTopologyInfoNodeGraphs(e);this.setDijkstraGraph(t.nodes);const n=new Hp(t);return this.viewport.scener.addObject(n,this.scene),n}resetNodes(e,t){const n=this.generateLineTopologyInfoNodeGraphs(Object.assign(Object.assign({},e.info),{nodes:t}));return e.resetNodes(n.nodes),this.viewport.signals.objectChanged.dispatch(),e}createToGroup(e,t){const n=new Pu(e);return t.forEach((e=>{const t=this.generateLineTopologyInfoNodeGraphs(e);this.setDijkstraGraph(t.nodes);const r=new Hp(t);n.add(r)})),this.viewport.scener.addObject(n,this.scene),n}addForGroup(e,t){const n=this.getGroupById(e);return n&&t.forEach((e=>{const t=this.generateLineTopologyInfoNodeGraphs(e);this.setDijkstraGraph(t.nodes);const r=new Hp(t);n.add(r)})),n}getShortestPath(e,t){const{nodes:n}=e.info,r=Hh(t.start),i=Hh(t.end);let s=null,o=1/0,a=null,l=1/0;if(n.forEach((e=>{if(e.graphs.length>0){const t=Hh(e.position),n=t.distanceTo(r),c=t.distanceTo(i);n<o&&(o=n,s=Number(e.id)),c<l&&(l=c,a=Number(e.id))}})),s&&a){const o=this.dijkstra.getPath(s,a);if(o.length>0){const s=[{id:"startPoint",position:r,graphs:[]}];o.forEach((e=>{const t=n.find((t=>t.id==e));t&&s.push(t)})),s.push({id:"endPoint",position:i,graphs:[]});for(let e=0;e<s.length;e++)s[e].position.y+=1;const a=Object.assign(Object.assign(Object.assign({},t),{type:"line",nodes:s}),e.getSpaceAttribute(!0));this.generateLineTopologyInfoNodeGraphs(a);const l=new Hp(a);return this.viewport.scener.addObject(l,this.scene),l}}return null}getShortestPathByMultipleStartPoints(e,t){const{nodes:n}=e.info,r=[];t.start.forEach((e=>{const i=Hh(e),s=Hh(t.end);let o=null,a=1/0,l=null,c=1/0;if(n.forEach((e=>{if(e.graphs.length>0){const t=Hh(e.position),n=t.distanceTo(i),r=t.distanceTo(s);n<a&&(a=n,o=Number(e.id)),r<c&&(c=r,l=Number(e.id))}})),o&&l){let e=0;const t=this.dijkstra.getPath(o,l);if(t.length>0){const o=[{id:"startPoint",position:i,graphs:[]}];t.forEach(((t,r)=>{const s=n.find((e=>e.id==t));s&&(e+=0===r?Hh(s.position).distanceTo(i):Hh(s.position).distanceTo(Hh(o[o.length-1].position)),o.push(s))})),o.push({id:"endPoint",position:s,graphs:[]}),e+=s.distanceTo(Hh(o[o.length-1].position)),r.push({nodeInfo:o,pathLength:e})}}}));let i=[],s=1/0;if(r.forEach((({nodeInfo:e,pathLength:t})=>{t<s&&(s=t,i=e)})),i.length){for(let e=0;e<i.length;e++)i[e].position.y+=1;const n=Object.assign(Object.assign({},t),{type:"line",nodes:i,position:e.getWorldPosition(new V),rotation:(new Le).setFromQuaternion(e.getWorldQuaternion(new j)),scale:e.getWorldScale(new V)});this.generateLineTopologyInfoNodeGraphs(n);const r=new Hp(n);return this.viewport.scener.addObject(r,this.scene),r}return null}getShortestPathByMultipleEndPoints(e,t){const{nodes:n}=e.info,r=[];t.end.forEach((e=>{const i=Hh(t.start),s=Hh(e);let o=null,a=1/0,l=null,c=1/0;if(n.forEach((e=>{if(e.graphs.length>0){const t=Hh(e.position),n=t.distanceTo(i),r=t.distanceTo(s);n<a&&(a=n,o=Number(e.id)),r<c&&(c=r,l=Number(e.id))}})),o&&l){let e=0;const t=this.dijkstra.getPath(o,l);if(t.length>0){const o=[{id:"startPoint",position:i,graphs:[]}];t.forEach(((t,r)=>{const s=n.find((e=>e.id==t));s&&(e+=0===r?Hh(s.position).distanceTo(i):Hh(s.position).distanceTo(Hh(o[o.length-1].position)),o.push(s))})),o.push({id:"endPoint",position:s,graphs:[]}),e+=s.distanceTo(Hh(o[o.length-1].position)),r.push({nodeInfo:o,pathLength:e})}}}));let i=[],s=1/0;if(r.forEach((({nodeInfo:e,pathLength:t})=>{t<s&&(s=t,i=e)})),i.length){for(let e=0;e<i.length;e++)i[e].position.y+=1;const n=Object.assign(Object.assign({},t),{type:"line",nodes:i,position:e.getWorldPosition(new V),rotation:(new Le).setFromQuaternion(e.getWorldQuaternion(new j)),scale:e.getWorldScale(new V)});this.generateLineTopologyInfoNodeGraphs(n);const r=new Hp(n);return this.viewport.scener.addObject(r,this.scene),r}return null}setDijkstraGraph(e){const t=[];e.forEach((n=>{if(n.graphs&&n.graphs.length>0){const r=[];n.graphs.forEach((t=>{const i=e.find((e=>e.id===t.targetNodeId));i&&r.push([Number(t.targetNodeId),t.length||Hh(n.position).distanceTo(Hh(i.position))])})),t.push([Number(n.id),r])}})),t.length>0&&this.dijkstra.setGraph(t)}generateLineTopologyInfoNodeGraphs(e){if("line"===e.type)for(let t=0;t<e.nodes.length;t++)if(t===e.nodes.length-1)e.nodes[t].graphs=[];else{const n=e.nodes[t],r=e.nodes[t+1];e.nodes[t].graphs=[{targetNodeId:r.id.toString(),linkInfo:{id:`${n.id}_to_${r.id}`,name:`${n.name||n.id}_to_${r.name||r.id}`},enable:!0,length:Hh(e.nodes[t].position).distanceTo(Hh(r.position)),restrict:0,passable:0}]}return e}}class Xv extends Us{constructor(e,t){const n=new At;n.setAttribute("position",new yt([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),n.computeBoundingSphere(),super(n,new Is({fog:!1})),this.light=e,this.color=t,this.type="RectAreaLightHelper";const r=new At;r.setAttribute("position",new yt([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),r.computeBoundingSphere(),this.add(new Wt(r,new ot({side:1,fog:!1})))}updateMatrixWorld(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);const e=this.material.color,t=Math.max(e.r,e.g,e.b);t>1&&e.multiplyScalar(1/t),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld),this.children[0].matrixWorld.copy(this.matrixWorld)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}class qv extends Zp{constructor(e){super("Helper",e)}addGridHelper(e){const{id:t,size:n=1e3,divisions:r=20,color:i="#fff",position:s={x:0,y:0,z:0},rotation:o={x:0,y:0,z:0},scale:a={x:1,y:1,z:1}}=e,l=new Oc(n,r,i,i);return l.position.set(s.x,s.y,s.z),l.rotation.set(o.x,o.y,o.z),l.scale.set(a.x,a.y,a.z),l.userData.sid=t,l.userData.stype="Helper",this.viewport.scener.addObject(l,this.scene),l}addAxesHelper(e){const{id:t,axesLength:n=1e3}=e,r=new Yc(n);return r.userData.sid=t,r.userData.stype="Helper",this.viewport.scener.addObject(r,this.scene),r}addBoxHelper(e){const{id:t,box:n,color:r="#00ff00"}=e,i=new Vc(n,new P(r));return i.userData.sid=t,i.userData.stype="Helper",this.viewport.scener.addObject(i,this.scene),i}addPlaneHelper(e){const{id:t,width:n=500,height:r=500,color:i="#00ff00",opacity:s=.2,position:o={x:0,y:0,z:0},rotation:a={x:0,y:0,z:0},scale:l={x:1,y:1,z:1}}=e,c=new Eu(new pn(n,r),new ot({color:i,opacity:s,transparent:s<1,side:2}),{id:t,position:o,rotation:a,scale:l});return c.userData.sid=t,c.userData.stype="Helper",this.viewport.scener.addObject(c,this.scene),c}addGroundHelper(e){const{imgUrl:t,id:n,width:r=500,height:i=500,opacity:s=1,position:o={x:0,y:0,z:0},rotation:a={x:0,y:0,z:0},scale:l={x:1,y:1,z:1},repeat:c={x:10,y:10}}=e,h=(new il).load(t),u=new pn(r,i);u.computeBoundingBox();const d=new Ta({side:2,map:h,transparent:s<1,opacity:s,roughness:.8});d.map&&(d.map.repeat.set(c.x,c.x),d.map.wrapS=1e3,d.map.wrapT=1e3,d.map.version++),a.x-=Math.PI/2,d.version++;const p=new qp(u,d,{id:n,position:o,rotation:a,scale:l});return p.userData.sid=n,p.userData.stype="Helper",this.viewport.scener.addObject(p,this.scene),p}addDirectionalLightHelper(e){const{id:t,light:n,color:r,size:i=50}=e,s=new Uc(n,i,r);return s.userData.sid=t,s.userData.stype="Helper",this.viewport.scener.addObject(s,this.scene),s}addHemisphereLightHelper(e){const{id:t,light:n,color:r,size:i=20}=e,s=new Dc(n,i,r);return s.userData.sid=t,s.userData.stype="Helper",this.viewport.scener.addObject(s,this.scene),s}addSpotLightHelper(e){const{id:t,light:n,color:r}=e,i=new Mc(n,r);return i.userData.sid=t,i.userData.stype="Helper",this.viewport.scener.addObject(i,this.scene),i}addPointLightHelper(e){const{id:t,light:n,color:r,size:i=20}=e,s=new Pc(n,i,r);return s.userData.sid=t,s.userData.stype="Helper",this.viewport.scener.addObject(s,this.scene),s}addRectAreaLightHelper(e){const{id:t,light:n,color:r}=e,i=new Xv(n,r);return i.userData.sid=t,i.userData.stype="Helper",this.viewport.scener.addObject(i,this.scene),i}}class Yv extends Zp{constructor(e){super("PluginObject",e)}createObject(e,t){const n=new Ru(e);return t&&n.add(t),this.viewport.scener.addObject(n,this.scene),n}addToObject(e,t){const n=this.getById(e);return n?(this.viewport.scener.addObject(t,n),n):null}}class Zv{constructor(e){this.viewport=e,this.needUpdate=!1,this.store={LightManager:new Jp(e),sbmManager:new af(e),modelManager:new Fv(e),poiManager:new Hv(e),poiNodeManager:new Gv(e),canvas3DManager:new jv(e),topologyManager:new Wv(e),helperManager:new qv(e),pluginObjectManager:new Yv(e)},this.postUpdate=new Map;for(const e in this.store)this.postUpdate.set(e,this.store[e].update.bind(this.store[e]));e.postUpdate.set("ManagerRender",this.update.bind(this))}update(){const e=performance.now();this.postUpdate.forEach((e=>e())),this.viewport.signals.loadRendered.dispatch(performance.now()-e)}clearObject(){this.store.sbmManager.clear(),this.store.modelManager.clear(),this.store.poiManager.clear(),this.store.poiNodeManager.clear(),this.store.canvas3DManager.clear(),this.store.topologyManager.clear(),this.store.helperManager.clear(),this.store.pluginObjectManager.clear()}clear(){this.clearObject(),this.store.LightManager.clear()}}self.THREE=sh;class Jv{constructor(e){this.THREE=sh,this.version="2.3.18",this.animation=Tu,this.library=Yp,this.utils=lu,this.plugins={};const{el:t,options:n={},events:r={}}=e;if(this.domElement=document.querySelector(t),this.options=Object.assign(Object.assign({},{showInfo:!1,showStats:!1,showGrid:!1,background:{color:11459572,alpha:!1},fog:!1,controls:{},hoverEnabled:!1,closeInfoLog:!1,closeWarnLog:!0,useIndexedDB:!0,logarithmicDepthBuffer:!0}),n),this.viewport=new Pp(this.options),this.signals=this.viewport.signals,this.manager=new Zv(this.viewport),!this.domElement)throw new Error(`In SoonSpace: Can't find element by "${t}"!`);this.domElement.appendChild(this.viewport.container),this._init(),this._initEvents(r),this._initDefaultLight()}_init(){const{showGrid:e,background:t,fog:n,controls:r,closeInfoLog:i,closeWarnLog:s,useIndexedDB:o}=this.options;i||(Fh(" ____ ____ _ \n / ___| ___ ___ _ __ / ___| _ __ __ _ ___ ___ (_)___ \n \\___ \\ / _ \\ / _ \\| '_ \\\\___ \\| '_ \\ / _` |/ __/ _ \\ | / __| \n ___) | (_) | (_) | | | |___) | |_) | (_| | (_| __/_ | \\__ \\ \n |____/ \\___/ \\___/|_| |_|____/| .__/ \\__,_|\\___\\___(_)/ |___/ \n |_| |__/ \n",{color:"#3eaf7c"}),Fh("soonspacejs",{color:"#3eaf7c","font-size":"24px"}),Fh(`当前版本: ${this.version}`,{color:"#3eaf7c","font-size":"12px"}),Fh("文档: http://www.xwbuilders.com:8800",{color:"#3eaf7c","font-size":"12px"}),Fh("样例: http://www.xwbuilders.com:8800/examples",{color:"#3eaf7c","font-size":"12px"}),Fh("GitHub: https://github.com/soonspacejs",{color:"#3eaf7c","font-size":"12px"})),e&&this.addGridHelper(!0===e?{id:"defaultGridHelper"}:e),(null==t?void 0:t.skyBox)?eu(null==t?void 0:t.skyBox)?this.setSphereSkyBackground(null==t?void 0:t.skyBox):iu(null==t?void 0:t.skyBox)&&this.setSkyBackground(t.skyBox.dirPath,t.skyBox.fileNames):(null==t?void 0:t.img)?this.setBackgroundImage(t.img):(null==t?void 0:t.color)&&this.setBackgroundColor(t.color),n&&this.openSceneFog(!0===n?void 0:n),r&&this.setControlsOptions(r),s&&(window.console.warn=function(){}),o&&!window.indexedDB&&(this.options.useIndexedDB=!1,window.console.warn("Your browser doesn't support a stable version of IndexedDB. Such and such feature will not be available."))}_initEvents(e){const{modelHover:t,modelUnHover:n,modelClick:r,modelRightClick:i,modelDblClick:s,poiHover:o,poiUnHover:a,poiClick:l,poiRightClick:c,poiDblClick:h,selectPosition:u,sceneClick:d,resize:p}=e;t&&this.signals.modelHover.add(t),n&&this.signals.modelUnHover.add(n),r&&this.signals.modelClick.add(r),i&&this.signals.modelRightClick.add(i),s&&this.signals.modelDblClick.add(s),o&&this.signals.poiHover.add(o),a&&this.signals.poiUnHover.add(a),l&&this.signals.poiClick.add(l),c&&this.signals.poiRightClick.add(c),h&&this.signals.poiDblClick.add(h),u&&this.signals.selectPosition.add(u),d&&this.signals.sceneClick.add(d),p&&this.signals.windowResize.add(p),this.signals.windowResize.dispatch(),window.addEventListener("resize",(()=>this.signals.windowResize.dispatch()),!1)}_initDefaultLight(){this.createAmbientLight({id:"defaultAmbientLight",name:"defaultAmbientLight"}),this.createDirectionalLight({id:"defaultDirectionalLight",name:"defaultDirectionalLight"}),this.createHemisphereLight({id:"defaultHemisphereLight",name:"defaulHemisphereLight",intensity:.1})}registerPlugin(e,t){const n=new e(this);return this.plugins[t]=n,n}getPlugin(e){return this.plugins[e]?this.plugins[e]:null}createPluginObject(e,t){return this.manager.store.pluginObjectManager.createObject(e,t)}addToPluginObject(e,t){return this.manager.store.pluginObjectManager.addToObject(e,t)}getPluginObjectById(e){return this.manager.store.pluginObjectManager.getById(e)}getPluginObjectByName(e){return this.manager.store.pluginObjectManager.getByName(e)}removePluginObjectById(e){return this.manager.store.pluginObjectManager.removeById(e)}setSobel(e){this.viewport.setSobel(e)}setBloom(e){this.viewport.setBloom(e)}setColorSpace(e){this.viewport.setColorSpace(e)}setHoverEnabled(e){this.viewport.setHoverEnabled(e)}setBackgroundColor(e){this.viewport.setBackgroundColor(e)}setBackgroundImage(e){this.viewport.setBackgroundImage(e)}setSphereSkyBackground(e){this.viewport.setSphereSkyBackground(e)}setSkyBackground(e,t){this.viewport.setSkyBackground(e,t)}setEnvironment(){return this.viewport.setEnvironment()}playModelAnimation(e,t){return this.viewport.playModelAnimation(e,t)}stopModelAnimation(e,t){this.viewport.stopModelAnimation(e,t)}getOffsetByPosition(e){return this.viewport.getOffsetByPosition(e)}getPositionByOffset(e,t){return this.viewport.getPositionByOffset(e,t)}render(e){return this.viewport.render(e)}clearSignals(){this.viewport.clearSignals()}dispose(){return this.clear(),this.clearSignals(),this.viewport.dispose()}getCameraViewpoint(){return this.viewport.cameraManager.getCameraViewpoint()}setCameraViewpoint(e){this.viewport.cameraManager.setCameraViewpoint(e)}flyTo(e,t="frontTop",n){return this.viewport.cameraManager.flyTo(e,t,n)}flyToBoundingBox(e,t="frontTop",n){return this.viewport.cameraManager.flyToBoundingBox(e,t,n)}flyToObj(e,t="frontTop",n){return this.viewport.cameraManager.flyToObj(e,t,n)}flyMainViewpoint(e="frontTop",t){return this.flyToObj(this.viewport.scene,e,t)}surroundOnTarget(e,t){return this.viewport.cameraManager.surroundOnTarget(e,t)}surroundOnObject(e,t){return this.viewport.cameraManager.surroundOnObject(e,t)}getObjectLabelPos(e,t="frontTop",n){return this.viewport.cameraManager.getObjectLabelPos(e,t,n)}setControlsOptions(e){return this.viewport.controls.setOptions(e)}addObject(e,t){this.viewport.scener.addObject(e,t)}removeObject(e){this.viewport.scener.removeObject(e)}openSceneFog(e){this.viewport.scener.openSceneFog(e)}closeSceneFog(){this.viewport.scener.closeSceneFog()}setSky(e){return this.viewport.setSky(e)}edgeShow(e,t){return this.viewport.scener.edgeShow(e,t)}unEdgeShow(e){return this.viewport.scener.unEdgeShow(e)}strokeShow(e,t){return this.viewport.scener.strokeShow(e,t)}unStrokeShow(e){return this.viewport.scener.unStrokeShow(e)}opacityShow(e,t){return this.viewport.scener.opacityShow(e,t)}unOpacityShow(e){return this.viewport.scener.unOpacityShow(e)}highlightShow(e,t){return this.viewport.scener.highlightShow(e,t)}unHighlightShow(e){return this.viewport.scener.unHighlightShow(e)}emissiveShow(e,t){return this.viewport.scener.emissiveShow(e,t)}unEmissiveShow(e){return this.viewport.scener.unEmissiveShow(e)}clearObject(){this.manager.clearObject()}clear(){this.manager.clear()}createAmbientLight(e){return this.manager.store.LightManager.createAmbientLight(e)}setAmbientLight(e){return this.manager.store.LightManager.setAmbientLight(e)}createDirectionalLight(e){return this.manager.store.LightManager.createDirectionalLight(e)}setDirectionalLight(e){return this.manager.store.LightManager.setDirectionalLight(e)}createHemisphereLight(e){return this.manager.store.LightManager.createHemisphereLight(e)}setHemisphereLight(e){return this.manager.store.LightManager.setHemisphereLight(e)}createSpotLight(e){return this.manager.store.LightManager.createSpotLight(e)}setSpotLight(e){return this.manager.store.LightManager.setSpotLight(e)}createPointLight(e){return this.manager.store.LightManager.createPointLight(e)}setPointLight(e){return this.manager.store.LightManager.setPointLight(e)}createRectAreaLight(e){return this.manager.store.LightManager.createRectAreaLight(e)}setRectAreaLight(e){return this.manager.store.LightManager.setRectAreaLight(e)}getLightById(e){return this.manager.store.LightManager.getById(e)}removeLightById(e){return this.manager.store.LightManager.removeById(e)}getAllLight(){return this.manager.store.LightManager.getAll()}clearLight(){return this.manager.store.LightManager.clear()}showAllLight(){return this.manager.store.LightManager.showAll()}hideAllLight(){return this.manager.store.LightManager.hideAll()}updateAllShadow(){return this.manager.store.LightManager.updateAllShadow()}loadSbm(e,t){return this.manager.store.sbmManager.load(e,t)}parseSbm(e,t,n){return this.manager.store.sbmManager.parse(e,t,n)}cloneSbm(e,t,n){return this.manager.store.sbmManager.clone(e,t,n)}getSbmById(e){return this.manager.store.sbmManager.getById(e)}getSbmByName(e){return this.manager.store.sbmManager.getByName(e)}getSbmByUserDataProperty(e,t){return this.manager.store.sbmManager.getByUserDataProperty(e,t)}removeSbmById(e){return this.manager.store.sbmManager.removeById(e)}createGroupForSbm(e){return this.manager.store.sbmManager.createGroup(e)}loadSbmToGroup(e,t,n){return this.manager.store.sbmManager.loadToGroup(e,t,n)}addSbmForGroup(e,t,n){return this.manager.store.sbmManager.addForGroup(e,t,n)}createSbmGroupFromXml(e,t){return this.manager.store.sbmManager.createGroupFromXml(e,t)}getSbmGroupById(e){return this.manager.store.sbmManager.getGroupById(e)}getSbmGroupByName(e){return this.manager.store.sbmManager.getGroupByName(e)}getAllSbmGroup(){return this.manager.store.sbmManager.getAllGroup()}removeSbmGroupById(e){return this.manager.store.sbmManager.removeGroupById(e)}clearSbm(){return this.manager.store.sbmManager.clear()}getAllSbm(){return this.manager.store.sbmManager.getAll()}showAllSbm(){return this.manager.store.sbmManager.showAll()}hideAllSbm(){return this.manager.store.sbmManager.hideAll()}getSbmModelMaps(){return this.manager.store.sbmManager.modelMaps}setSbmModelMaps(e){this.manager.store.sbmManager.modelMaps=e}clearIdb(){return Promise.all([this.manager.store.sbmManager.clearIdb(),this.manager.store.modelManager.clearIdb()])}setModelDracoDecoderPath(e){return this.manager.store.modelManager.setDracoDecoderPath(e)}loadModel(e){return this.manager.store.modelManager.load(e)}cloneModel(e,t,n){return this.manager.store.modelManager.clone(e,t,n)}getModelById(e){return this.manager.store.modelManager.getById(e)}getModelByName(e){return this.manager.store.modelManager.getByName(e)}getModelByUserDataProperty(e,t){return this.manager.store.modelManager.getByUserDataProperty(e,t)}removeModelById(e){return this.manager.store.modelManager.removeById(e)}createGroupForModel(e){return this.manager.store.modelManager.createGroup(e)}loadModelToGroup(e,t){return this.manager.store.modelManager.loadToGroup(e,t)}addModelForGroup(e,t){return this.manager.store.modelManager.addForGroup(e,t)}getModelGroupById(e){return this.manager.store.modelManager.getGroupById(e)}getModelGroupByName(e){return this.manager.store.modelManager.getGroupByName(e)}getAllModelGroup(){return this.manager.store.modelManager.getAllGroup()}removeModelGroupById(e){return this.manager.store.modelManager.removeGroupById(e)}clearModel(){return this.manager.store.modelManager.clear()}getAllModel(){return this.manager.store.modelManager.getAll()}showAllModel(){return this.manager.store.modelManager.showAll()}hideAllModel(){return this.manager.store.modelManager.hideAll()}createPoi(e){return this.manager.store.poiManager.create(e)}clonePoi(e,t,n){return this.manager.store.poiManager.clone(e,t,n)}getPoiById(e){return this.manager.store.poiManager.getById(e)}getPoiByName(e){return this.manager.store.poiManager.getByName(e)}getPoiByUserDataProperty(e,t){return this.manager.store.poiManager.getByUserDataProperty(e,t)}removePoiById(e){return this.manager.store.poiManager.removeById(e)}createGroupForPoi(e){return this.manager.store.poiManager.createGroup(e)}createPoiToGroup(e,t){return this.manager.store.poiManager.createToGroup(e,t)}addPoiForGroup(e,t){return this.manager.store.poiManager.addForGroup(e,t)}getPoiGroupById(e){return this.manager.store.poiManager.getGroupById(e)}getPoiGroupByName(e){return this.manager.store.poiManager.getGroupByName(e)}getAllPoiGroup(){return this.manager.store.poiManager.getAllGroup()}removePoiGroupById(e){return this.manager.store.poiManager.removeGroupById(e)}clearPoi(){return this.manager.store.poiManager.clear()}getAllPoi(){return this.manager.store.poiManager.getAll()}showAllPoi(){return this.manager.store.poiManager.showAll()}hideAllPoi(){return this.manager.store.poiManager.hideAll()}createPoiNode(e){return this.manager.store.poiNodeManager.create(e)}getPoiNodeById(e){return this.manager.store.poiNodeManager.getById(e)}getPoiNodeByName(e){return this.manager.store.poiNodeManager.getByName(e)}getPoiNodeByUserDataProperty(e,t){return this.manager.store.poiNodeManager.getByUserDataProperty(e,t)}removePoiNodeById(e){return this.manager.store.poiNodeManager.removeById(e)}createGroupForPoiNode(e){return this.manager.store.poiNodeManager.createGroup(e)}createPoiNodeToGroup(e,t){return this.manager.store.poiNodeManager.createToGroup(e,t)}addPoiNodeForGroup(e,t){return this.manager.store.poiNodeManager.addForGroup(e,t)}getPoiNodeGroupById(e){return this.manager.store.poiNodeManager.getGroupById(e)}getPoiNodeGroupByName(e){return this.manager.store.poiNodeManager.getGroupByName(e)}getAllPoiNodeGroup(){return this.manager.store.poiNodeManager.getAllGroup()}removePoiNodeGroupById(e){return this.manager.store.poiNodeManager.removeGroupById(e)}clearPoiNode(){return this.manager.store.poiNodeManager.clear()}getAllPoiNode(){return this.manager.store.poiNodeManager.getAll()}showAllPoiNode(){return this.manager.store.poiNodeManager.showAll()}hideAllPoiNode(){return this.manager.store.poiNodeManager.hideAll()}createCanvas3D(e){return this.manager.store.canvas3DManager.create(e)}getCanvas3DById(e){return this.manager.store.canvas3DManager.getById(e)}getCanvas3DByName(e){return this.manager.store.canvas3DManager.getByName(e)}getCanvas3DByUserDataProperty(e,t){return this.manager.store.canvas3DManager.getByUserDataProperty(e,t)}removeCanvas3DById(e){return this.manager.store.canvas3DManager.removeById(e)}createGroupForCanvas3D(e){return this.manager.store.canvas3DManager.createGroup(e)}createCanvas3DToGroup(e,t){return this.manager.store.canvas3DManager.createToGroup(e,t)}addCanvas3DForGroup(e,t){return this.manager.store.canvas3DManager.addForGroup(e,t)}getCanvas3DGroupById(e){return this.manager.store.canvas3DManager.getGroupById(e)}getCanvas3DGroupByName(e){return this.manager.store.canvas3DManager.getGroupByName(e)}getAllCanvas3DGroup(){return this.manager.store.canvas3DManager.getAllGroup()}removeCanvas3DGroupById(e){return this.manager.store.canvas3DManager.removeGroupById(e)}clearCanvas3D(){return this.manager.store.canvas3DManager.clear()}getAllCanvas3D(){return this.manager.store.canvas3DManager.getAll()}showAllCanvas3D(){return this.manager.store.canvas3DManager.showAll()}hideAllCanvas3D(){return this.manager.store.canvas3DManager.hideAll()}getShortestPath(e,t){return this.manager.store.topologyManager.getShortestPath(e,t)}getShortestPathByMultipleStartPoints(e,t){return this.manager.store.topologyManager.getShortestPathByMultipleStartPoints(e,t)}getShortestPathByMultipleEndPoints(e,t){return this.manager.store.topologyManager.getShortestPathByMultipleEndPoints(e,t)}createTopologyFromGml(e){return this.manager.store.topologyManager.createFromGml(e)}createTopology(e){return this.manager.store.topologyManager.create(e)}resetTopologyNodes(e,t){return this.manager.store.topologyManager.resetNodes(e,t)}getTopologyById(e){return this.manager.store.topologyManager.getById(e)}getTopologyByName(e){return this.manager.store.topologyManager.getByName(e)}getTopologyByUserDataProperty(e,t){return this.manager.store.topologyManager.getByUserDataProperty(e,t)}removeTopologyById(e){return this.manager.store.topologyManager.removeById(e)}createGroupForTopology(e){return this.manager.store.topologyManager.createGroup(e)}createTopologyToGroup(e,t){return this.manager.store.topologyManager.createToGroup(e,t)}addTopologyForGroup(e,t){return this.manager.store.topologyManager.addForGroup(e,t)}getTopologyGroupById(e){return this.manager.store.topologyManager.getGroupById(e)}getTopologyGroupByName(e){return this.manager.store.topologyManager.getGroupByName(e)}getAllTopologyGroup(){return this.manager.store.topologyManager.getAllGroup()}removeTopologyGroupById(e){return this.manager.store.topologyManager.removeGroupById(e)}clearTopology(){return this.manager.store.topologyManager.clear()}getAllTopology(){return this.manager.store.topologyManager.getAll()}showAllTopology(){return this.manager.store.topologyManager.showAll()}hideAllTopology(){return this.manager.store.topologyManager.hideAll()}addGridHelper(e){return this.manager.store.helperManager.addGridHelper(e)}addAxesHelper(e){return this.manager.store.helperManager.addAxesHelper(e)}addBoxHelper(e){return this.manager.store.helperManager.addBoxHelper(e)}addPlaneHelper(e){return this.manager.store.helperManager.addPlaneHelper(e)}createGround(e){return console.warn("In soonspacejs: 'createGround' 已弃用,请使用 'addGroundHelper'!"),this.addGroundHelper(e)}addGroundHelper(e){return this.manager.store.helperManager.addGroundHelper(e)}addDirectionalLightHelper(e){return this.manager.store.helperManager.addDirectionalLightHelper(e)}addHemisphereLightHelper(e){return this.manager.store.helperManager.addHemisphereLightHelper(e)}addSpotLightHelper(e){return this.manager.store.helperManager.addSpotLightHelper(e)}addPointLightHelper(e){return this.manager.store.helperManager.addPointLightHelper(e)}addRectAreaLightHelper(e){return this.manager.store.helperManager.addRectAreaLightHelper(e)}getHelperById(e){return this.manager.store.helperManager.getById(e)}removeHelperById(e){return this.manager.store.helperManager.removeById(e)}clearHelper(){return this.manager.store.helperManager.clear()}showAllHelper(){return this.manager.store.helperManager.showAll()}hideAllHelper(){return this.manager.store.helperManager.hideAll()}}Jv.THREE=sh,Jv.THREE_PLUGINS={TransformControls:mh,Lensflare:{Lensflare:Uh,LensflareElement:kh}};const{THREE_PLUGINS:Qv}=Jv;export default class{constructor(e){this.ssp=e,this.control=null,this.options=null}start(e,t={}){const{mode:n="translate",onUpdate:r,onDragStart:i,onDragEnd:s}=t;return this.options=t,this.control=new Qv.TransformControls(this.ssp.viewport.camera,this.ssp.viewport.rendererManager.interactiveContainer),this.control.attach(e),this.control.setMode(n),this.control.addEventListener("dragging-changed",(t=>{this.ssp.viewport.controls.enabled=!t.value,t.value?null==i||i(e):null==s||s(e)})),this.control.addEventListener("objectChange",(()=>{null==r||r(e),this.ssp.signals.objectChanged.dispatch(e)})),this.ssp.addObject(this.control),this.control}close(){var e,t;this.control&&(this.ssp.removeObject(this.control),this.control.detach(),this.control=null,null===(t=null===(e=this.options)||void 0===e?void 0:e.onClose)||void 0===t||t.call(e)),this.ssp.signals.objectRemoved.dispatch()}changeMode(e){var t,n;e&&(null===(n=null===(t=this.control)||void 0===t?void 0:t.setMode)||void 0===n||n.call(t,e),this.ssp.signals.objectChanged.dispatch())}}
|