fengmap.plugin.loader.min.js 216.4 KB
/**Released Version v3.1.6,BUILD 117,Time 1713867365299. Fengmap Javascript SDK , see: https://www.fengmap.com for details**/
!function(t,i){"object"==typeof exports&&"object"==typeof module?module.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof exports?exports.fengmap=i():t.fengmap=i()}(this,function(){return n=[function(C,I,t){"use strict";t.r(I);var a={},b=(t.r(a),t.d(a,"ShadowMaterial",function(){return tn}),t.d(a,"SpriteMaterial",function(){return nn}),t.d(a,"RawShaderMaterial",function(){return on}),t.d(a,"ShaderMaterial",function(){return hn}),t.d(a,"PointsMaterial",function(){return an}),t.d(a,"MeshPhysicalMaterial",function(){return cn}),t.d(a,"MeshStandardMaterial",function(){return un}),t.d(a,"MeshPhongMaterial",function(){return fn}),t.d(a,"MeshToonMaterial",function(){return ln}),t.d(a,"MeshNormalMaterial",function(){return dn}),t.d(a,"MeshLambertMaterial",function(){return vn}),t.d(a,"MeshDepthMaterial",function(){return pn}),t.d(a,"MeshDistanceMaterial",function(){return wn}),t.d(a,"MeshBasicMaterial",function(){return mn}),t.d(a,"MeshMatcapMaterial",function(){return bn}),t.d(a,"LineDashedMaterial",function(){return gn}),t.d(a,"LineBasicMaterial",function(){return Mn}),t.d(a,"Material",function(){return n}),{arraySlice:function(t,i,n){return b.isTypedArray(t)?new t.constructor(t.subarray(i,void 0!==n?n:t.length)):t.slice(i,n)},convertArray:function(t,i,n){return!t||!n&&t.constructor===i?t:"number"==typeof i.BYTES_PER_ELEMENT?new i(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(n){for(var t=n.length,i=new Array(t),s=0;s!==t;++s)i[s]=s;return i.sort(function(t,i){return n[t]-n[i]}),i},sortedArray:function(t,i,n){for(var s=t.length,e=new t.constructor(s),r=0,h=0;h!==s;++r)for(var o=n[r]*i,a=0;a!==i;++a)e[h++]=t[o+a];return e},flattenJSON:function(t,i,n,s){for(var e=1,r=t[0];void 0!==r&&void 0===r[s];)r=t[e++];if(void 0!==r){var h=r[s];if(void 0!==h)if(Array.isArray(h))for(;void 0!==(h=r[s])&&(i.push(r.time),n.push.apply(n,h)),void 0!==(r=t[e++]););else if(void 0!==h.toArray)for(;void 0!==(h=r[s])&&(i.push(r.time),h.toArray(n,n.length)),void 0!==(r=t[e++]););else for(;void 0!==(h=r[s])&&(i.push(r.time),n.push(h)),void 0!==(r=t[e++]););}},subclip:function(t,i,n,s,e){e=e||30;for(var r=t.clone(),h=(r.name=i,[]),o=0;o<r.tracks.length;++o){for(var a=r.tracks[o],u=a.getValueSize(),c=[],f=[],l=0;l<a.times.length;++l){var d=a.times[l]*e;if(!(d<n||s<=d)){c.push(a.times[l]);for(var v=0;v<u;++v)f.push(a.values[l*u+v])}}0!==c.length&&(a.times=b.convertArray(c,a.times.constructor),a.values=b.convertArray(f,a.values.constructor),h.push(a))}r.tracks=h;for(var p=1/0,o=0;o<r.tracks.length;++o)p>r.tracks[o].times[0]&&(p=r.tracks[o].times[0]);for(o=0;o<r.tracks.length;++o)r.tracks[o].shift(-1*p);return r.resetDuration(),r}}),N=0,D=1,V=2,X=1,U=100,q=204,Y=205,Z=3,W=0,G=1001,_=3200,z=0,K=7680,Q=519,$=.001;function e(t,i,n,s){this.parameterPositions=t,this.u=0,this.resultBuffer=void 0!==s?s:new i.constructor(n),this.sampleValues=i,this.valueSize=n}function J(t,i,n,s){e.call(this,t,i,n,s),this.M=-0,this.T=-0,this.O=-0,this.R=-0}function tt(t,i,n,s){e.call(this,t,i,n,s)}function it(t,i,n,s){e.call(this,t,i,n,s)}function r(t,i,n,s){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===i||0===i.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=b.convertArray(i,this.TimeBufferType),this.values=b.convertArray(n,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}function nt(t,i,n){r.call(this,t,i,n)}function st(t,i,n,s){r.call(this,t,i,n,s)}function et(t,i,n,s){r.call(this,t,i,n,s)}Object.assign(e.prototype,{evaluate:function(t){var i,n=this.parameterPositions,s=this.u,e=n[s],r=n[s-1];t:{i:{n:{s:if(!(t<e)){for(var h=s+2;;){if(void 0===e){if(t<r)break s;return s=n.length,this.u=s,this.afterEnd_(s-1,t,r)}if(s===h)break;if(r=e,t<(e=n[++s]))break i}i=n.length;break n}if(r<=t)break t;var o=n[1];t<o&&(s=2,r=o);for(h=s-2;;){if(void 0===r)return this.u=0,this.beforeStart_(0,t,e);if(s===h)break;if(e=r,(r=n[--s-1])<=t)break i}i=s,s=0}for(;s<i;){var a=s+i>>>1;t<n[a]?i=a:s=1+a}if(e=n[s],void 0===(r=n[s-1]))return this.u=0,this.beforeStart_(0,t,e);if(void 0===e)return s=n.length,this.u=s,this.afterEnd_(s-1,r,t)}this.u=s,this.intervalChanged_(s,r,e)}return this.interpolate_(s,r,t,e)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var i=this.resultBuffer,n=this.sampleValues,s=this.valueSize,e=t*s,r=0;r!==s;++r)i[r]=n[e+r];return i},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(e.prototype,{beforeStart_:e.prototype.copySampleValue_,afterEnd_:e.prototype.copySampleValue_}),J.prototype=Object.assign(Object.create(e.prototype),{constructor:J,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(t,i,n){var s=this.parameterPositions,e=t-2,r=t+1,h=s[e],o=s[r];if(void 0===h)switch(this.getSettings_().endingStart){case 2401:e=t,h=2*i-n;break;case 2402:h=i+s[e=s.length-2]-s[e+1];break;default:e=t,h=n}if(void 0===o)switch(this.getSettings_().endingEnd){case 2401:r=t,o=2*n-i;break;case 2402:o=n+s[r=1]-s[0];break;default:r=t-1,o=i}var a=.5*(n-i),u=this.valueSize;this.M=a/(i-h),this.O=a/(o-n),this.T=e*u,this.R=r*u},interpolate_:function(t,i,n,s){for(var e=this.resultBuffer,r=this.sampleValues,h=this.valueSize,o=t*h,a=o-h,u=this.T,c=this.R,t=this.M,f=this.O,n=(n-i)/(s-i),s=n*n,i=s*n,l=-t*i+2*t*s-t*n,d=(1+t)*i+(-1.5-2*t)*s+(-.5+t)*n+1,v=(-1-f)*i+(1.5+f)*s+.5*n,p=f*i-f*s,w=0;w!==h;++w)e[w]=l*r[u+w]+d*r[a+w]+v*r[o+w]+p*r[c+w];return e}}),tt.prototype=Object.assign(Object.create(e.prototype),{constructor:tt,interpolate_:function(t,i,n,s){for(var e=this.resultBuffer,r=this.sampleValues,h=this.valueSize,o=t*h,a=o-h,u=(n-i)/(s-i),c=1-u,f=0;f!==h;++f)e[f]=r[a+f]*c+r[o+f]*u;return e}}),it.prototype=Object.assign(Object.create(e.prototype),{constructor:it,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(r.prototype,{constructor:r,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(t){return new it(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new tt(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new J(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var i;switch(t){case 2300:i=this.InterpolantFactoryMethodDiscrete;break;case 2301:i=this.InterpolantFactoryMethodLinear;break;case 2302:i=this.InterpolantFactoryMethodSmooth}if(void 0===i){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}console.warn("THREE.KeyframeTrack:",n)}else this.createInterpolant=i;return this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var i=this.times,n=0,s=i.length;n!==s;++n)i[n]+=t;return this},scale:function(t){if(1!==t)for(var i=this.times,n=0,s=i.length;n!==s;++n)i[n]*=t;return this},trim:function(t,i){for(var n,s=this.times,e=s.length,r=0,h=e-1;r!==e&&s[r]<t;)++r;for(;-1!==h&&s[h]>i;)--h;return++h,0===r&&h===e||(h<=r&&(r=(h=Math.max(h,1))-1),n=this.getValueSize(),this.times=b.arraySlice(s,r,h),this.values=b.arraySlice(this.values,r*n,h*n)),this},validate:function(){for(var t=!0,i=this.getValueSize(),n=(i-Math.floor(i)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1),this.times),s=this.values,e=n.length,r=(0===e&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1),null),h=0;h!==e;h++){var o=n[h];if("number"==typeof o&&isNaN(o)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,h,o),t=!1;break}if(null!==r&&o<r){console.error("THREE.KeyframeTrack: Out of order keys.",this,h,o,r),t=!1;break}r=o}if(void 0!==s&&b.isTypedArray(s))for(var h=0,a=s.length;h!==a;++h){var u=s[h];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,h,u),t=!1;break}}return t},optimize:function(){for(var t=b.arraySlice(this.times),i=b.arraySlice(this.values),n=this.getValueSize(),s=2302===this.getInterpolation(),e=1,r=t.length-1,h=1;h<r;++h){var o=!1,a=t[h];if(a!==t[h+1]&&(1!==h||a!==a[0]))if(s)o=!0;else for(var u=h*n,c=u-n,f=u+n,l=0;l!==n;++l){var d=i[u+l];if(d!==i[c+l]||d!==i[f+l]){o=!0;break}}if(o){if(h!==e){t[e]=t[h];for(var v=h*n,p=e*n,l=0;l!==n;++l)i[p+l]=i[v+l]}++e}}if(0<r){t[e]=t[r];for(v=r*n,p=e*n,l=0;l!==n;++l)i[p+l]=i[v+l];++e}return e!==t.length?(this.times=b.arraySlice(t,0,e),this.values=b.arraySlice(i,0,e*n)):(this.times=t,this.values=i),this},clone:function(){var t=b.arraySlice(this.times,0),i=b.arraySlice(this.values,0),t=new this.constructor(this.name,t,i);return t.createInterpolant=this.createInterpolant,t}}),nt.prototype=Object.assign(Object.create(r.prototype),{constructor:nt,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),st.prototype=Object.assign(Object.create(r.prototype),{constructor:st,ValueTypeName:"color"}),et.prototype=Object.assign(Object.create(r.prototype),{constructor:et,ValueTypeName:"number"});for(var h=[],rt=0;rt<256;rt++)h[rt]=(rt<16?"0":"")+rt.toString(16);var w={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0,s=4294967295*Math.random()|0;return(h[255&t]+h[t>>8&255]+h[t>>16&255]+h[t>>24&255]+"-"+h[255&i]+h[i>>8&255]+"-"+h[i>>16&15|64]+h[i>>24&255]+"-"+h[63&n|128]+h[n>>8&255]+"-"+h[n>>16&255]+h[n>>24&255]+h[255&s]+h[s>>8&255]+h[s>>16&255]+h[s>>24&255]).toUpperCase()},clamp:function(t,i,n){return Math.max(i,Math.min(n,t))},euclideanModulo:function(t,i){return(t%i+i)%i},mapLinear:function(t,i,n,s,e){return s+(t-i)*(e-s)/(n-i)},lerp:function(t,i,n){return(1-n)*t+n*i},smoothstep:function(t,i,n){return t<=i?0:n<=t?1:(t=(t-i)/(n-i))*t*(3-2*t)},smootherstep:function(t,i,n){return t<=i?0:n<=t?1:(t=(t-i)/(n-i))*t*t*(t*(6*t-15)+10)},randInt:function(t,i){return t+Math.floor(Math.random()*(i-t+1))},randFloat:function(t,i){return t+Math.random()*(i-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*w.DEG2RAD},radToDeg:function(t){return t*w.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,i,n,s,e){var r=Math.cos,h=Math.sin,o=r(n/2),n=h(n/2),a=r((i+s)/2),u=h((i+s)/2),c=r((i-s)/2),f=h((i-s)/2),r=r((s-i)/2),h=h((s-i)/2);"XYX"===e?t.set(o*u,n*c,n*f,o*a):"YZY"===e?t.set(n*f,o*u,n*c,o*a):"ZXZ"===e?t.set(n*c,n*f,o*u,o*a):"XZX"===e?t.set(o*u,n*h,n*r,o*a):"YXY"===e?t.set(n*r,o*u,n*h,o*a):"ZYZ"===e?t.set(n*h,n*r,o*u,o*a):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};function l(t,i,n,s){this.S=t||0,this.B=i||0,this.P=n||0,this.L=void 0!==s?s:1}function ht(t,i,n,s){e.call(this,t,i,n,s)}function ot(t,i,n,s){r.call(this,t,i,n,s)}function at(t,i,n,s){r.call(this,t,i,n,s)}function ut(t,i,n,s){r.call(this,t,i,n,s)}function ct(t,i,n){this.name=t,this.tracks=n,this.duration=void 0!==i?i:-1,this.uuid=w.generateUUID(),this.duration<0&&this.resetDuration()}function ft(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var i,n,s=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return et;case"vector":case"vector2":case"vector3":case"vector4":return ut;case"color":return st;case"quaternion":return ot;case"bool":case"boolean":return nt;case"string":return at}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);return void 0===t.times&&(b.flattenJSON(t.keys,i=[],n=[],"value"),t.times=i,t.values=n),void 0!==s.parse?s.parse(t):new s(t.name,t.times,t.values,t.interpolation)}Object.assign(l,{slerp:function(t,i,n,s){return n.copy(t).slerp(i,s)},slerpFlat:function(t,i,n,s,e,r,h){var o,a,u,c=n[s+0],f=n[s+1],l=n[s+2],n=n[s+3],s=e[r+0],d=e[r+1],v=e[r+2],e=e[r+3];n===e&&c===s&&f===d&&l===v||(r=1-h,o=0<=(a=c*s+f*d+l*v+n*e)?1:-1,(u=1-a*a)>Number.EPSILON&&(u=Math.sqrt(u),a=Math.atan2(u,a*o),r=Math.sin(r*a)/u,h=Math.sin(h*a)/u),c=c*r+s*(a=h*o),f=f*r+d*a,l=l*r+v*a,n=n*r+e*a,r===1-h&&(c*=u=1/Math.sqrt(c*c+f*f+l*l+n*n),f*=u,l*=u,n*=u)),t[i]=c,t[i+1]=f,t[i+2]=l,t[i+3]=n}}),Object.defineProperties(l.prototype,{x:{get:function(){return this.S},set:function(t){this.S=t,this.H()}},y:{get:function(){return this.B},set:function(t){this.B=t,this.H()}},z:{get:function(){return this.P},set:function(t){this.P=t,this.H()}},w:{get:function(){return this.L},set:function(t){this.L=t,this.H()}}}),Object.assign(l.prototype,{isQuaternion:!0,set:function(t,i,n,s){return this.S=t,this.B=i,this.P=n,this.L=s,this.H(),this},clone:function(){return new this.constructor(this.S,this.B,this.P,this.L)},copy:function(t){return this.S=t.x,this.B=t.y,this.P=t.z,this.L=t.w,this.H(),this},setFromEuler:function(t,i){var n,s,e,r,h,o,a;if(t&&t.isEuler)return h=t.S,o=t.B,n=t.P,t=t.order,r=Math.cos,a=Math.sin,s=r(h/2),e=r(o/2),r=r(n/2),h=a(h/2),o=a(o/2),a=a(n/2),"XYZ"===t?(this.S=h*e*r+s*o*a,this.B=s*o*r-h*e*a,this.P=s*e*a+h*o*r,this.L=s*e*r-h*o*a):"YXZ"===t?(this.S=h*e*r+s*o*a,this.B=s*o*r-h*e*a,this.P=s*e*a-h*o*r,this.L=s*e*r+h*o*a):"ZXY"===t?(this.S=h*e*r-s*o*a,this.B=s*o*r+h*e*a,this.P=s*e*a+h*o*r,this.L=s*e*r-h*o*a):"ZYX"===t?(this.S=h*e*r-s*o*a,this.B=s*o*r+h*e*a,this.P=s*e*a-h*o*r,this.L=s*e*r+h*o*a):"YZX"===t?(this.S=h*e*r+s*o*a,this.B=s*o*r+h*e*a,this.P=s*e*a-h*o*r,this.L=s*e*r-h*o*a):"XZY"===t&&(this.S=h*e*r-s*o*a,this.B=s*o*r-h*e*a,this.P=s*e*a+h*o*r,this.L=s*e*r+h*o*a),!1!==i&&this.H(),this;throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.")},setFromAxisAngle:function(t,i){var i=i/2,n=Math.sin(i);return this.S=t.x*n,this.B=t.y*n,this.P=t.z*n,this.L=Math.cos(i),this.H(),this},setFromRotationMatrix:function(t){var i,t=t.elements,n=t[0],s=t[4],e=t[8],r=t[1],h=t[5],o=t[9],a=t[2],u=t[6],t=t[10],c=n+h+t;return 0<c?(i=.5/Math.sqrt(c+1),this.L=.25/i,this.S=(u-o)*i,this.B=(e-a)*i,this.P=(r-s)*i):h<n&&t<n?(i=2*Math.sqrt(1+n-h-t),this.L=(u-o)/i,this.S=.25*i,this.B=(s+r)/i,this.P=(e+a)/i):t<h?(i=2*Math.sqrt(1+h-n-t),this.L=(e-a)/i,this.S=(s+r)/i,this.B=.25*i,this.P=(o+u)/i):(i=2*Math.sqrt(1+t-n-h),this.L=(r-s)/i,this.S=(e+a)/i,this.B=(o+u)/i,this.P=.25*i),this.H(),this},setFromUnitVectors:function(t,i){var n=t.dot(i)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this.S=-t.y,this.B=t.x,this.P=0):(this.S=0,this.B=-t.z,this.P=t.y)):(this.S=t.y*i.z-t.z*i.y,this.B=t.z*i.x-t.x*i.z,this.P=t.x*i.y-t.y*i.x),this.L=n,this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(w.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,i){var n=this.angleTo(t);return 0!==n&&(i=Math.min(1,i/n),this.slerp(t,i)),this},inverse:function(){return this.conjugate()},conjugate:function(){return this.S*=-1,this.B*=-1,this.P*=-1,this.H(),this},dot:function(t){return this.S*t.S+this.B*t.B+this.P*t.P+this.L*t.L},lengthSq:function(){return this.S*this.S+this.B*this.B+this.P*this.P+this.L*this.L},length:function(){return Math.sqrt(this.S*this.S+this.B*this.B+this.P*this.P+this.L*this.L)},normalize:function(){var t=this.length();return 0===t?(this.S=0,this.B=0,this.P=0,this.L=1):(this.S=this.S*(t=1/t),this.B=this.B*t,this.P=this.P*t,this.L=this.L*t),this.H(),this},multiply:function(t,i){return void 0!==i?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,i)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,i){var n=t.S,s=t.B,e=t.P,t=t.L,r=i.S,h=i.B,o=i.P,i=i.L;return this.S=n*i+t*r+s*o-e*h,this.B=s*i+t*h+e*r-n*o,this.P=e*i+t*o+n*h-s*r,this.L=t*i-n*r-s*h-e*o,this.H(),this},slerp:function(t,i){if(0!==i){if(1===i)return this.copy(t);var n,s=this.S,e=this.B,r=this.P,h=this.L,o=h*t.L+s*t.S+e*t.B+r*t.P;o<0?(this.L=-t.L,this.S=-t.S,this.B=-t.B,this.P=-t.P,o=-o):this.copy(t),1<=o?(this.L=h,this.S=s,this.B=e,this.P=r):((t=1-o*o)<=Number.EPSILON?(this.L=(n=1-i)*h+i*this.L,this.S=n*s+i*this.S,this.B=n*e+i*this.B,this.P=n*r+i*this.P,this.normalize()):(n=Math.sqrt(t),t=Math.atan2(n,o),o=Math.sin((1-i)*t)/n,i=Math.sin(i*t)/n,this.L=h*o+this.L*i,this.S=s*o+this.S*i,this.B=e*o+this.B*i,this.P=r*o+this.P*i),this.H())}return this},equals:function(t){return t.S===this.S&&t.B===this.B&&t.P===this.P&&t.L===this.L},fromArray:function(t,i){return this.S=t[i=void 0===i?0:i],this.B=t[i+1],this.P=t[i+2],this.L=t[i+3],this.H(),this},toArray:function(t,i){return(t=void 0===t?[]:t)[i=void 0===i?0:i]=this.S,t[i+1]=this.B,t[i+2]=this.P,t[i+3]=this.L,t},fromBufferAttribute:function(t,i){return this.S=t.getX(i),this.B=t.getY(i),this.P=t.getZ(i),this.L=t.getW(i),this},F:function(t){return this.H=t,this},H:function(){}}),ht.prototype=Object.assign(Object.create(e.prototype),{constructor:ht,interpolate_:function(t,i,n,s){for(var e=this.resultBuffer,r=this.sampleValues,h=this.valueSize,o=t*h,a=(n-i)/(s-i),u=o+h;o!==u;o+=4)l.slerpFlat(e,0,r,o-h,r,o,a);return e}}),ot.prototype=Object.assign(Object.create(r.prototype),{constructor:ot,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(t){return new ht(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),at.prototype=Object.assign(Object.create(r.prototype),{constructor:at,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ut.prototype=Object.assign(Object.create(r.prototype),{constructor:ut,ValueTypeName:"vector"}),Object.assign(ct,{parse:function(t){for(var i=[],n=t.tracks,s=1/(t.fps||1),e=0,r=n.length;e!==r;++e)i.push(ft(n[e]).scale(s));return new ct(t.name,t.duration,i)},CreateFromMorphTargetSequence:function(t,i,n,s){for(var e=i.length,r=[],h=0;h<e;h++){var o=[],a=((u=[]).push((h+e-1)%e,h,(h+1)%e),o.push(0,1,0),b.getKeyframeOrder(u)),u=b.sortedArray(u,1,a),o=b.sortedArray(o,1,a);s||0!==u[0]||(u.push(e),o.push(o[0])),r.push(new et(".morphTargetInfluences["+i[h].name+"]",u,o).scale(1/n))}return new ct(t,-1,r)},findByName:function(t,i){var n=t;Array.isArray(t)||(n=t.geometry&&t.geometry.animations||t.animations);for(var s=0;s<n.length;s++)if(n[s].name===i)return n[s];return null},CreateClipsFromMorphTargetSequences:function(t,i,n){for(var s={},e=/^([\w-]*?)([\d]+)$/,r=0,h=t.length;r<h;r++){var o=t[r],a=o.name.match(e);a&&1<a.length&&((a=s[u=a[1]])||(s[u]=a=[]),a.push(o))}var u,c=[];for(u in s)c.push(ct.CreateFromMorphTargetSequence(u,s[u],i,n));return c},parseAnimation:function(t,i){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,i,n,s,e){var r;0!==n.length&&(b.flattenJSON(n,n=[],r=[],s),0!==n.length)&&e.push(new t(i,n,r))},s=[],e=t.name||"default",r=t.length||-1,h=t.fps||30,o=t.hierarchy||[],a=0;a<o.length;a++){var u=o[a].keys;if(u&&0!==u.length)if(u[0].morphTargets){for(var c,f={},l=0;l<u.length;l++)if(u[l].morphTargets)for(var d=0;d<u[l].morphTargets.length;d++)f[u[l].morphTargets[d]]=-1;for(c in f){for(var v=[],p=[],d=0;d!==u[l].morphTargets.length;++d){var w=u[l];v.push(w.time),p.push(w.morphTarget===c?1:0)}s.push(new et(".morphTargetInfluence["+c+"]",v,p))}r=f.length*(h||1)}else{var m=".bones["+i[a].name+"]";n(ut,m+".position",u,"pos",s),n(ot,m+".quaternion",u,"rot",s),n(ut,m+".scale",u,"scl",s)}}return 0===s.length?null:new ct(e,r,s)}}),Object.assign(ct.prototype,{resetDuration:function(){for(var t=0,i=0,n=this.tracks.length;i!==n;++i)var s=this.tracks[i],t=Math.max(t,s.times[s.times.length-1]);return this.duration=t,this},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){for(var t=!0,i=0;i<this.tracks.length;i++)t=t&&this.tracks[i].validate();return t},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},clone:function(){for(var t=[],i=0;i<this.tracks.length;i++)t.push(this.tracks[i].clone());return new ct(this.name,this.duration,t)}});var t="\\[\\]\\.:\\/",lt=new RegExp("["+t+"]","g"),dt="[^"+t+"]",t="[^"+t.replace("\\.","")+"]",i=/((?:WC+[\/:])*)/.source.replace("WC",dt),t=/(WCOD+)?/.source.replace("WCOD",t),vt=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",dt),dt=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",dt),pt=new RegExp("^"+i+t+vt+dt+"$"),wt=["material","materials","bones"];function mt(t,i,n){n=n||c.parseTrackName(i);this.C=t,this.I=t.subscribe_(i,n)}function c(t,i,n){this.path=i,this.parsedPath=n||c.parseTrackName(i),this.node=c.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}Object.assign(mt.prototype,{getValue:function(t,i){this.bind();var n=this.C.nCachedObjects_,n=this.I[n];void 0!==n&&n.getValue(t,i)},setValue:function(t,i){for(var n=this.I,s=this.C.nCachedObjects_,e=n.length;s!==e;++s)n[s].setValue(t,i)},bind:function(){for(var t=this.I,i=this.C.nCachedObjects_,n=t.length;i!==n;++i)t[i].bind()},unbind:function(){for(var t=this.I,i=this.C.nCachedObjects_,n=t.length;i!==n;++i)t[i].unbind()}}),Object.assign(c,{Composite:mt,create:function(t,i,n){return new(t&&t.isAnimationObjectGroup?c.Composite:c)(t,i,n)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(lt,"")},parseTrackName:function(t){var i=pt.exec(t);if(!i)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var n,i={nodeName:i[2],objectName:i[3],objectIndex:i[4],propertyName:i[5],propertyIndex:i[6]},s=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==s&&-1!==s&&(n=i.nodeName.substring(s+1),-1!==wt.indexOf(n))&&(i.nodeName=i.nodeName.substring(0,s),i.objectName=n),null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i},findNode:function(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){i=function t(i){for(var n=0;n<i.length;n++){var s=i[n];if(s.name===e||s.uuid===e)return s;s=t(s.children);if(s)return s}return null}(t.children);if(i)return i}return null}}),Object.assign(c.prototype,{N:function(){},D:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,i){t[i]=this.node[this.propertyName]},function(t,i){for(var n=this.resolvedProperty,s=0,e=n.length;s!==e;++s)t[i++]=n[s]},function(t,i){t[i]=this.resolvedProperty[this.propertyIndex]},function(t,i){this.resolvedProperty.toArray(t,i)}],SetterByBindingTypeAndVersioning:[[function(t,i){this.targetObject[this.propertyName]=t[i]},function(t,i){this.targetObject[this.propertyName]=t[i],this.targetObject.needsUpdate=!0},function(t,i){this.targetObject[this.propertyName]=t[i],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,i){for(var n=this.resolvedProperty,s=0,e=n.length;s!==e;++s)n[s]=t[i++]},function(t,i){for(var n=this.resolvedProperty,s=0,e=n.length;s!==e;++s)n[s]=t[i++];this.targetObject.needsUpdate=!0},function(t,i){for(var n=this.resolvedProperty,s=0,e=n.length;s!==e;++s)n[s]=t[i++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,i){this.resolvedProperty[this.propertyIndex]=t[i]},function(t,i){this.resolvedProperty[this.propertyIndex]=t[i],this.targetObject.needsUpdate=!0},function(t,i){this.resolvedProperty[this.propertyIndex]=t[i],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,i){this.resolvedProperty.fromArray(t,i)},function(t,i){this.resolvedProperty.fromArray(t,i),this.targetObject.needsUpdate=!0},function(t,i){this.resolvedProperty.fromArray(t,i),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,i){this.bind(),this.getValue(t,i)},setValue:function(t,i){this.bind(),this.setValue(t,i)},bind:function(){var t=this.node,i=this.parsedPath,n=i.objectName,s=i.propertyName,e=i.propertyIndex;if(t||(t=c.findNode(this.rootNode,i.nodeName)||this.rootNode,this.node=t),this.getValue=this.N,this.setValue=this.D,t){if(n){var r=i.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);for(var t=t.skeleton.bones,h=0;h<t.length;h++)if(t[h].name===r){r=h;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==r){if(void 0===t[r])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[r]}}var o=t[s];if(void 0===o)i=i.nodeName,console.error("THREE.PropertyBinding: Trying to update property for track: "+i+"."+s+" but it wasn't found.",t);else{var i=this.Versioning.None,a=(void 0!==(this.targetObject=t).needsUpdate?i=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(i=this.Versioning.MatrixWorldNeedsUpdate),this.BindingType.Direct);if(void 0!==e){if("morphTargetInfluences"===s){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(t.geometry.isBufferGeometry){if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(h=0;h<this.node.geometry.morphAttributes.position.length;h++)if(t.geometry.morphAttributes.position[h].name===e){e=h;break}}else{if(!t.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(h=0;h<this.node.geometry.morphTargets.length;h++)if(t.geometry.morphTargets[h].name===e){e=h;break}}}a=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=e}else void 0!==o.fromArray&&void 0!==o.toArray?(a=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(a=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=s;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][i]}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this.V,this.setValue=this.X}}),Object.assign(c.prototype,{V:c.prototype.getValue,X:c.prototype.setValue});var bt=new g,Mt=new l;function g(t,i,n){this.x=t||0,this.y=i||0,this.z=n||0}Object.assign(g.prototype,{isVector3:!0,set:function(t,i,n){return this.x=t,this.y=i,this.z=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,i){return void 0!==i?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,i)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this},addScaledVector:function(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this},sub:function(t,i){return void 0!==i?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,i)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this},multiply:function(t,i){return void 0!==i?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,i)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,i){return this.x=t.x*i.x,this.y=t.y*i.y,this.z=t.z*i.z,this},applyEuler:function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Mt.setFromEuler(t))},applyAxisAngle:function(t,i){return this.applyQuaternion(Mt.setFromAxisAngle(t,i))},applyMatrix3:function(t){var i=this.x,n=this.y,s=this.z,t=t.elements;return this.x=t[0]*i+t[3]*n+t[6]*s,this.y=t[1]*i+t[4]*n+t[7]*s,this.z=t[2]*i+t[5]*n+t[8]*s,this},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},applyMatrix4:function(t){var i=this.x,n=this.y,s=this.z,t=t.elements,e=1/(t[3]*i+t[7]*n+t[11]*s+t[15]);return this.x=(t[0]*i+t[4]*n+t[8]*s+t[12])*e,this.y=(t[1]*i+t[5]*n+t[9]*s+t[13])*e,this.z=(t[2]*i+t[6]*n+t[10]*s+t[14])*e,this},applyQuaternion:function(t){var i=this.x,n=this.y,s=this.z,e=t.x,r=t.y,h=t.z,t=t.w,o=t*i+r*s-h*n,a=t*n+h*i-e*s,u=t*s+e*n-r*i,i=-e*i-r*n-h*s;return this.x=o*t+i*-e+a*-h-u*-r,this.y=a*t+i*-r+u*-e-o*-h,this.z=u*t+i*-h+o*-r-a*-e,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){var i=this.x,n=this.y,s=this.z,t=t.elements;return this.x=t[0]*i+t[4]*n+t[8]*s,this.y=t[1]*i+t[5]*n+t[9]*s,this.z=t[2]*i+t[6]*n+t[10]*s,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,i){return this.x=Math.max(t.x,Math.min(i.x,this.x)),this.y=Math.max(t.y,Math.min(i.y,this.y)),this.z=Math.max(t.z,Math.min(i.z,this.z)),this},clampScalar:function(t,i){return this.x=Math.max(t,Math.min(i,this.x)),this.y=Math.max(t,Math.min(i,this.y)),this.z=Math.max(t,Math.min(i,this.z)),this},clampLength:function(t,i){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(i,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this},lerpVectors:function(t,i,n){return this.subVectors(i,t).multiplyScalar(n).add(t)},cross:function(t,i){return void 0!==i?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,i)):this.crossVectors(this,t)},crossVectors:function(t,i){var n=t.x,s=t.y,t=t.z,e=i.x,r=i.y,i=i.z;return this.x=s*i-t*r,this.y=t*e-n*i,this.z=n*r-s*e,this},projectOnVector:function(t){var i=t.lengthSq();return 0===i?this.set(0,0,0):(i=t.dot(this)/i,this.copy(t).multiplyScalar(i))},projectOnPlane:function(t){return bt.copy(this).projectOnVector(t),this.sub(bt)},reflect:function(t){return this.sub(bt.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){var i=Math.sqrt(this.lengthSq()*t.lengthSq());return 0===i?Math.PI/2:(t=this.dot(t)/i,Math.acos(w.clamp(t,-1,1)))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var i=this.x-t.x,n=this.y-t.y,t=this.z-t.z;return i*i+n*n+t*t},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,i,n){var s=Math.sin(i)*t;return this.x=s*Math.sin(n),this.y=Math.cos(i)*t,this.z=s*Math.cos(n),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,i,n){return this.x=t*Math.sin(i),this.y=n,this.z=t*Math.cos(i),this},setFromMatrixPosition:function(t){t=t.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(t){var i=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),t=this.setFromMatrixColumn(t,2).length();return this.x=i,this.y=n,this.z=t,this},setFromMatrixColumn:function(t,i){return this.fromArray(t.elements,4*i)},setFromMatrix3Column:function(t,i){return this.fromArray(t.elements,3*i)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,i){return this.x=t[i=void 0===i?0:i],this.y=t[i+1],this.z=t[i+2],this},toArray:function(t,i){return(t=void 0===t?[]:t)[i=void 0===i?0:i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t},fromBufferAttribute:function(t,i,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this}});var gt=new g,u=new m,yt=new g(0,0,0),Et=new g(1,1,1),Tt=new g,kt=new g,o=new g;function m(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function Ot(){}Object.assign(m.prototype,{isMatrix4:!0,set:function(t,i,n,s,e,r,h,o,a,u,c,f,l,d,v,p){var w=this.elements;return w[0]=t,w[4]=i,w[8]=n,w[12]=s,w[1]=e,w[5]=r,w[9]=h,w[13]=o,w[2]=a,w[6]=u,w[10]=c,w[14]=f,w[3]=l,w[7]=d,w[11]=v,w[15]=p,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new m).fromArray(this.elements)},copy:function(t){var i=this.elements,t=t.elements;return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],this},copyPosition:function(t){var i=this.elements,t=t.elements;return i[12]=t[12],i[13]=t[13],i[14]=t[14],this},extractBasis:function(t,i,n){return t.setFromMatrixColumn(this,0),i.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(t,i,n){return this.set(t.x,i.x,n.x,0,t.y,i.y,n.y,0,t.z,i.z,n.z,0,0,0,0,1),this},extractRotation:function(t){var i=this.elements,n=t.elements,s=1/gt.setFromMatrixColumn(t,0).length(),e=1/gt.setFromMatrixColumn(t,1).length(),t=1/gt.setFromMatrixColumn(t,2).length();return i[0]=n[0]*s,i[1]=n[1]*s,i[2]=n[2]*s,i[3]=0,i[4]=n[4]*e,i[5]=n[5]*e,i[6]=n[6]*e,i[7]=0,i[8]=n[8]*t,i[9]=n[9]*t,i[10]=n[10]*t,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this},makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var i,n,s,e,r,h,o,a,u,c,f,l,d=this.elements,v=t.x,p=t.y,w=t.z,m=Math.cos(v),v=Math.sin(v),b=Math.cos(p),p=Math.sin(p),M=Math.cos(w),w=Math.sin(w);return"XYZ"===t.order?(r=m*M,h=m*w,o=v*M,a=v*w,d[0]=b*M,d[4]=-b*w,d[8]=p,d[1]=h+o*p,d[5]=r-a*p,d[9]=-v*b,d[2]=a-r*p,d[6]=o+h*p,d[10]=m*b):"YXZ"===t.order?(n=b*w,s=p*M,d[0]=(i=b*M)+(e=p*w)*v,d[4]=s*v-n,d[8]=m*p,d[1]=m*w,d[5]=m*M,d[9]=-v,d[2]=n*v-s,d[6]=e+i*v,d[10]=m*b):"ZXY"===t.order?(n=b*w,s=p*M,d[0]=(i=b*M)-(e=p*w)*v,d[4]=-m*w,d[8]=s+n*v,d[1]=n+s*v,d[5]=m*M,d[9]=e-i*v,d[2]=-m*p,d[6]=v,d[10]=m*b):"ZYX"===t.order?(r=m*M,h=m*w,o=v*M,a=v*w,d[0]=b*M,d[4]=o*p-h,d[8]=r*p+a,d[1]=b*w,d[5]=a*p+r,d[9]=h*p-o,d[2]=-p,d[6]=v*b,d[10]=m*b):"YZX"===t.order?(u=m*b,c=m*p,f=v*b,l=v*p,d[0]=b*M,d[4]=l-u*w,d[8]=f*w+c,d[1]=w,d[5]=m*M,d[9]=-v*M,d[2]=-p*M,d[6]=c*w+f,d[10]=u-l*w):"XZY"===t.order&&(u=m*b,c=m*p,f=v*b,l=v*p,d[0]=b*M,d[4]=-w,d[8]=p*M,d[1]=u*w+l,d[5]=m*M,d[9]=c*w-f,d[2]=f*w-c,d[6]=v*M,d[10]=l*w+u),d[3]=0,d[7]=0,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(yt,t,Et)},lookAt:function(t,i,n){var s=this.elements;return o.subVectors(t,i),0===o.lengthSq()&&(o.z=1),o.normalize(),Tt.crossVectors(n,o),0===Tt.lengthSq()&&(1===Math.abs(n.z)?o.x+=1e-4:o.z+=1e-4,o.normalize(),Tt.crossVectors(n,o)),Tt.normalize(),kt.crossVectors(o,Tt),s[0]=Tt.x,s[4]=kt.x,s[8]=o.x,s[1]=Tt.y,s[5]=kt.y,s[9]=o.y,s[2]=Tt.z,s[6]=kt.z,s[10]=o.z,this},multiply:function(t,i){return void 0!==i?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,i)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,i){var t=t.elements,i=i.elements,n=this.elements,s=t[0],e=t[4],r=t[8],h=t[12],o=t[1],a=t[5],u=t[9],c=t[13],f=t[2],l=t[6],d=t[10],v=t[14],p=t[3],w=t[7],m=t[11],t=t[15],b=i[0],M=i[4],g=i[8],y=i[12],E=i[1],T=i[5],k=i[9],O=i[13],A=i[2],j=i[6],R=i[10],S=i[14],x=i[3],B=i[7],P=i[11],i=i[15];return n[0]=s*b+e*E+r*A+h*x,n[4]=s*M+e*T+r*j+h*B,n[8]=s*g+e*k+r*R+h*P,n[12]=s*y+e*O+r*S+h*i,n[1]=o*b+a*E+u*A+c*x,n[5]=o*M+a*T+u*j+c*B,n[9]=o*g+a*k+u*R+c*P,n[13]=o*y+a*O+u*S+c*i,n[2]=f*b+l*E+d*A+v*x,n[6]=f*M+l*T+d*j+v*B,n[10]=f*g+l*k+d*R+v*P,n[14]=f*y+l*O+d*S+v*i,n[3]=p*b+w*E+m*A+t*x,n[7]=p*M+w*T+m*j+t*B,n[11]=p*g+w*k+m*R+t*P,n[15]=p*y+w*O+m*S+t*i,this},multiplyScalar:function(t){var i=this.elements;return i[0]*=t,i[4]*=t,i[8]*=t,i[12]*=t,i[1]*=t,i[5]*=t,i[9]*=t,i[13]*=t,i[2]*=t,i[6]*=t,i[10]*=t,i[14]*=t,i[3]*=t,i[7]*=t,i[11]*=t,i[15]*=t,this},determinant:function(){var t=this.elements,i=t[0],n=t[4],s=t[8],e=t[12],r=t[1],h=t[5],o=t[9],a=t[13],u=t[2],c=t[6],f=t[10],l=t[14];return t[3]*(+e*o*c-s*a*c-e*h*f+n*a*f+s*h*l-n*o*l)+t[7]*(+i*o*l-i*a*f+e*r*f-s*r*l+s*a*u-e*o*u)+t[11]*(+i*a*c-i*h*l-e*r*c+n*r*l+e*h*u-n*a*u)+t[15]*(-s*h*u-i*o*c+i*h*f+s*r*c-n*r*f+n*o*u)},transpose:function(){var t=this.elements,i=t[1];return t[1]=t[4],t[4]=i,i=t[2],t[2]=t[8],t[8]=i,i=t[6],t[6]=t[9],t[9]=i,i=t[3],t[3]=t[12],t[12]=i,i=t[7],t[7]=t[13],t[13]=i,i=t[11],t[11]=t[14],t[14]=i,this},setPosition:function(t,i,n){var s=this.elements;return t.isVector3?(s[12]=t.x,s[13]=t.y,s[14]=t.z):(s[12]=t,s[13]=i,s[14]=n),this},getInverse:function(t,i){void 0!==i&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");var i=this.elements,t=t.elements,n=t[0],s=t[1],e=t[2],r=t[3],h=t[4],o=t[5],a=t[6],u=t[7],c=t[8],f=t[9],l=t[10],d=t[11],v=t[12],p=t[13],w=t[14],t=t[15],m=f*w*u-p*l*u+p*a*d-o*w*d-f*a*t+o*l*t,b=v*l*u-c*w*u-v*a*d+h*w*d+c*a*t-h*l*t,M=c*p*u-v*f*u+v*o*d-h*p*d-c*o*t+h*f*t,g=v*f*a-c*p*a-v*o*l+h*p*l+c*o*w-h*f*w,y=n*m+s*b+e*M+r*g;return 0==y?this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0):(i[0]=m*(m=1/y),i[1]=(p*l*r-f*w*r-p*e*d+s*w*d+f*e*t-s*l*t)*m,i[2]=(o*w*r-p*a*r+p*e*u-s*w*u-o*e*t+s*a*t)*m,i[3]=(f*a*r-o*l*r-f*e*u+s*l*u+o*e*d-s*a*d)*m,i[4]=b*m,i[5]=(c*w*r-v*l*r+v*e*d-n*w*d-c*e*t+n*l*t)*m,i[6]=(v*a*r-h*w*r-v*e*u+n*w*u+h*e*t-n*a*t)*m,i[7]=(h*l*r-c*a*r+c*e*u-n*l*u-h*e*d+n*a*d)*m,i[8]=M*m,i[9]=(v*f*r-c*p*r-v*s*d+n*p*d+c*s*t-n*f*t)*m,i[10]=(h*p*r-v*o*r+v*s*u-n*p*u-h*s*t+n*o*t)*m,i[11]=(c*o*r-h*f*r-c*s*u+n*f*u+h*s*d-n*o*d)*m,i[12]=g*m,i[13]=(c*p*e-v*f*e+v*s*l-n*p*l-c*s*w+n*f*w)*m,i[14]=(v*o*e-h*p*e-v*s*a+n*p*a+h*s*w-n*o*w)*m,i[15]=(h*f*e-c*o*e+c*s*a-n*f*a-h*s*l+n*o*l)*m,this)},invert:function(){var t=this.elements,i=t[0],n=t[1],s=t[2],e=t[3],r=t[4],h=t[5],o=t[6],a=t[7],u=t[8],c=t[9],f=t[10],l=t[11],d=t[12],v=t[13],p=t[14],w=t[15],m=c*p*a-v*f*a+v*o*l-h*p*l-c*o*w+h*f*w,b=d*f*a-u*p*a-d*o*l+r*p*l+u*o*w-r*f*w,M=u*v*a-d*c*a+d*h*l-r*v*l-u*h*w+r*c*w,g=d*c*o-u*v*o-d*h*f+r*v*f+u*h*p-r*c*p,y=i*m+n*b+s*M+e*g;return 0==y?this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0):(t[0]=m*(m=1/y),t[1]=(v*f*e-c*p*e-v*s*l+n*p*l+c*s*w-n*f*w)*m,t[2]=(h*p*e-v*o*e+v*s*a-n*p*a-h*s*w+n*o*w)*m,t[3]=(c*o*e-h*f*e-c*s*a+n*f*a+h*s*l-n*o*l)*m,t[4]=b*m,t[5]=(u*p*e-d*f*e+d*s*l-i*p*l-u*s*w+i*f*w)*m,t[6]=(d*o*e-r*p*e-d*s*a+i*p*a+r*s*w-i*o*w)*m,t[7]=(r*f*e-u*o*e+u*s*a-i*f*a-r*s*l+i*o*l)*m,t[8]=M*m,t[9]=(d*c*e-u*v*e-d*n*l+i*v*l+u*n*w-i*c*w)*m,t[10]=(r*v*e-d*h*e+d*n*a-i*v*a-r*n*w+i*h*w)*m,t[11]=(u*h*e-r*c*e-u*n*a+i*c*a+r*n*l-i*h*l)*m,t[12]=g*m,t[13]=(u*v*s-d*c*s+d*n*f-i*v*f-u*n*p+i*c*p)*m,t[14]=(d*h*s-r*v*s-d*n*o+i*v*o+r*n*p-i*h*p)*m,t[15]=(r*c*s-u*h*s+u*n*o-i*c*o-r*n*f+i*h*f)*m,this)},scale:function(t){var i=this.elements,n=t.x,s=t.y,t=t.z;return i[0]*=n,i[4]*=s,i[8]*=t,i[1]*=n,i[5]*=s,i[9]*=t,i[2]*=n,i[6]*=s,i[10]*=t,i[3]*=n,i[7]*=s,i[11]*=t,this},getMaxScaleOnAxis:function(){var t=this.elements,i=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],t=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(i,n,t))},makeTranslation:function(t,i,n){return this.set(1,0,0,t,0,1,0,i,0,0,1,n,0,0,0,1),this},makeRotationX:function(t){var i=Math.cos(t),t=Math.sin(t);return this.set(1,0,0,0,0,i,-t,0,0,t,i,0,0,0,0,1),this},makeRotationY:function(t){var i=Math.cos(t),t=Math.sin(t);return this.set(i,0,t,0,0,1,0,0,-t,0,i,0,0,0,0,1),this},makeRotationZ:function(t){var i=Math.cos(t),t=Math.sin(t);return this.set(i,-t,0,0,t,i,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,i){var n=Math.cos(i),i=Math.sin(i),s=1-n,e=t.x,r=t.y,t=t.z,h=s*e,o=s*r;return this.set(h*e+n,h*r-i*t,h*t+i*r,0,h*r+i*t,o*r+n,o*t-i*e,0,h*t-i*r,o*t+i*e,s*t*t+n,0,0,0,0,1),this},makeScale:function(t,i,n){return this.set(t,0,0,0,0,i,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(t,i,n){return this.set(1,i,n,0,t,1,n,0,t,i,1,0,0,0,0,1),this},compose:function(t,i,n){var s=this.elements,e=i.S,r=i.B,h=i.P,i=i.L,o=e+e,a=r+r,u=h+h,c=e*o,f=e*a,e=e*u,l=r*a,r=r*u,h=h*u,o=i*o,a=i*a,i=i*u,u=n.x,d=n.y,n=n.z;return s[0]=(1-(l+h))*u,s[1]=(f+i)*u,s[2]=(e-a)*u,s[3]=0,s[4]=(f-i)*d,s[5]=(1-(c+h))*d,s[6]=(r+o)*d,s[7]=0,s[8]=(e+a)*n,s[9]=(r-o)*n,s[10]=(1-(c+l))*n,s[11]=0,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=1,this},decompose:function(t,i,n){var s=this.elements,e=gt.set(s[0],s[1],s[2]).length(),r=gt.set(s[4],s[5],s[6]).length(),h=gt.set(s[8],s[9],s[10]).length(),t=(this.determinant()<0&&(e=-e),t.x=s[12],t.y=s[13],t.z=s[14],u.copy(this),1/e),s=1/r,o=1/h;return u.elements[0]*=t,u.elements[1]*=t,u.elements[2]*=t,u.elements[4]*=s,u.elements[5]*=s,u.elements[6]*=s,u.elements[8]*=o,u.elements[9]*=o,u.elements[10]*=o,i.setFromRotationMatrix(u),n.x=e,n.y=r,n.z=h,this},makePerspective:function(t,i,n,s,e,r){void 0===r&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var h=this.elements,o=2*e/(n-s),a=(i+t)/(i-t),n=(n+s)/(n-s),s=-(r+e)/(r-e),r=-2*r*e/(r-e);return h[0]=2*e/(i-t),h[4]=0,h[8]=a,h[12]=0,h[1]=0,h[5]=o,h[9]=n,h[13]=0,h[2]=0,h[6]=0,h[10]=s,h[14]=r,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this},makeOrthographic:function(t,i,n,s,e,r){var h=this.elements,o=1/(i-t),a=1/(n-s),u=1/(r-e),i=(i+t)*o,t=(n+s)*a,n=(r+e)*u;return h[0]=2*o,h[4]=0,h[8]=0,h[12]=-i,h[1]=0,h[5]=2*a,h[9]=0,h[13]=-t,h[2]=0,h[6]=0,h[10]=-2*u,h[14]=-n,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this},equals:function(t){for(var i=this.elements,n=t.elements,s=0;s<16;s++)if(i[s]!==n[s])return!1;return!0},fromArray:function(t,i){void 0===i&&(i=0);for(var n=0;n<16;n++)this.elements[n]=t[n+i];return this},toArray:function(t,i){var n=this.elements;return(t=void 0===t?[]:t)[i=void 0===i?0:i]=n[0],t[i+1]=n[1],t[i+2]=n[2],t[i+3]=n[3],t[i+4]=n[4],t[i+5]=n[5],t[i+6]=n[6],t[i+7]=n[7],t[i+8]=n[8],t[i+9]=n[9],t[i+10]=n[10],t[i+11]=n[11],t[i+12]=n[12],t[i+13]=n[13],t[i+14]=n[14],t[i+15]=n[15],t}}),Object.assign(Ot.prototype,{addEventListener:function(t,i){void 0===this.U&&(this.U={});var n=this.U;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(i)&&n[t].push(i)},hasEventListener:function(t,i){var n;return void 0!==this.U&&void 0!==(n=this.U)[t]&&-1!==n[t].indexOf(i)},removeEventListener:function(t,i){var n;void 0!==this.U&&void 0!==(t=this.U[t])&&-1!==(n=t.indexOf(i))&&t.splice(n,1)},dispatchEvent:function(t){if(void 0!==this.U){var i=this.U[t.type];if(void 0!==i){t.target=this;for(var n=i.slice(0),s=0,e=n.length;s<e;s++)n[s].call(this,t)}}}});var At=new m,jt=new l;function d(t,i,n,s){this.S=t||0,this.B=i||0,this.P=n||0,this.Y=s||d.DefaultOrder}function Rt(){this.mask=1}function St(){this.elements=[1,0,0,0,1,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}d.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],d.DefaultOrder="XYZ",Object.defineProperties(d.prototype,{x:{get:function(){return this.S},set:function(t){this.S=t,this.H()}},y:{get:function(){return this.B},set:function(t){this.B=t,this.H()}},z:{get:function(){return this.P},set:function(t){this.P=t,this.H()}},order:{get:function(){return this.Y},set:function(t){this.Y=t,this.H()}}}),Object.assign(d.prototype,{isEuler:!0,set:function(t,i,n,s){return this.S=t,this.B=i,this.P=n,this.Y=s||this.Y,this.H(),this},clone:function(){return new this.constructor(this.S,this.B,this.P,this.Y)},copy:function(t){return this.S=t.S,this.B=t.B,this.P=t.P,this.Y=t.Y,this.H(),this},setFromRotationMatrix:function(t,i,n){var s=w.clamp,t=t.elements,e=t[0],r=t[4],h=t[8],o=t[1],a=t[5],u=t[9],c=t[2],f=t[6],t=t[10];return"XYZ"===(i=i||this.Y)?(this.B=Math.asin(s(h,-1,1)),Math.abs(h)<.9999999?(this.S=Math.atan2(-u,t),this.P=Math.atan2(-r,e)):(this.S=Math.atan2(f,a),this.P=0)):"YXZ"===i?(this.S=Math.asin(-s(u,-1,1)),Math.abs(u)<.9999999?(this.B=Math.atan2(h,t),this.P=Math.atan2(o,a)):(this.B=Math.atan2(-c,e),this.P=0)):"ZXY"===i?(this.S=Math.asin(s(f,-1,1)),Math.abs(f)<.9999999?(this.B=Math.atan2(-c,t),this.P=Math.atan2(-r,a)):(this.B=0,this.P=Math.atan2(o,e))):"ZYX"===i?(this.B=Math.asin(-s(c,-1,1)),Math.abs(c)<.9999999?(this.S=Math.atan2(f,t),this.P=Math.atan2(o,e)):(this.S=0,this.P=Math.atan2(-r,a))):"YZX"===i?(this.P=Math.asin(s(o,-1,1)),Math.abs(o)<.9999999?(this.S=Math.atan2(-u,a),this.B=Math.atan2(-c,e)):(this.S=0,this.B=Math.atan2(h,t))):"XZY"===i?(this.P=Math.asin(-s(r,-1,1)),Math.abs(r)<.9999999?(this.S=Math.atan2(f,a),this.B=Math.atan2(h,e)):(this.S=Math.atan2(-u,t),this.B=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+i),this.Y=i,!1!==n&&this.H(),this},setFromQuaternion:function(t,i,n){return At.makeRotationFromQuaternion(t),this.setFromRotationMatrix(At,i,n)},setFromVector3:function(t,i){return this.set(t.x,t.y,t.z,i||this.Y)},reorder:function(t){return jt.setFromEuler(this),this.setFromQuaternion(jt,t)},equals:function(t){return t.S===this.S&&t.B===this.B&&t.P===this.P&&t.Y===this.Y},fromArray:function(t){return this.S=t[0],this.B=t[1],this.P=t[2],void 0!==t[3]&&(this.Y=t[3]),this.H(),this},toArray:function(t,i){return(t=void 0===t?[]:t)[i=void 0===i?0:i]=this.S,t[i+1]=this.B,t[i+2]=this.P,t[i+3]=this.Y,t},toVector3:function(t){return t?t.set(this.S,this.B,this.P):new g(this.S,this.B,this.P)},F:function(t){return this.H=t,this},H:function(){}}),Object.assign(Rt.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},enableAll:function(){this.mask=-1},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},disableAll:function(){this.mask=0},test:function(t){return 0!=(this.mask&t.mask)}}),Object.assign(St.prototype,{isMatrix3:!0,set:function(t,i,n,s,e,r,h,o,a){var u=this.elements;return u[0]=t,u[1]=s,u[2]=h,u[3]=i,u[4]=e,u[5]=o,u[6]=n,u[7]=r,u[8]=a,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var i=this.elements,t=t.elements;return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],this},extractBasis:function(t,i,n){return t.setFromMatrix3Column(this,0),i.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this},setFromMatrix4:function(t){t=t.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,i){var t=t.elements,i=i.elements,n=this.elements,s=t[0],e=t[3],r=t[6],h=t[1],o=t[4],a=t[7],u=t[2],c=t[5],t=t[8],f=i[0],l=i[3],d=i[6],v=i[1],p=i[4],w=i[7],m=i[2],b=i[5],i=i[8];return n[0]=s*f+e*v+r*m,n[3]=s*l+e*p+r*b,n[6]=s*d+e*w+r*i,n[1]=h*f+o*v+a*m,n[4]=h*l+o*p+a*b,n[7]=h*d+o*w+a*i,n[2]=u*f+c*v+t*m,n[5]=u*l+c*p+t*b,n[8]=u*d+c*w+t*i,this},multiplyScalar:function(t){var i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=t,i[4]*=t,i[7]*=t,i[2]*=t,i[5]*=t,i[8]*=t,this},determinant:function(){var t=this.elements,i=t[0],n=t[1],s=t[2],e=t[3],r=t[4],h=t[5],o=t[6],a=t[7],t=t[8];return i*r*t-i*h*a-n*e*t+n*h*o+s*e*a-s*r*o},getInverse:function(t,i){void 0!==i&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var i=t.elements,t=this.elements,n=i[0],s=i[1],e=i[2],r=i[3],h=i[4],o=i[5],a=i[6],u=i[7],i=i[8],c=i*h-o*u,f=o*a-i*r,l=u*r-h*a,d=n*c+s*f+e*l;return 0==d?this.set(0,0,0,0,0,0,0,0,0):(t[0]=c*(c=1/d),t[1]=(e*u-i*s)*c,t[2]=(o*s-e*h)*c,t[3]=f*c,t[4]=(i*n-e*a)*c,t[5]=(e*r-o*n)*c,t[6]=l*c,t[7]=(s*a-u*n)*c,t[8]=(h*n-s*r)*c,this)},transpose:function(){var t=this.elements,i=t[1];return t[1]=t[3],t[3]=i,i=t[2],t[2]=t[6],t[6]=i,i=t[5],t[5]=t[7],t[7]=i,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var i=this.elements;return t[0]=i[0],t[1]=i[3],t[2]=i[6],t[3]=i[1],t[4]=i[4],t[5]=i[7],t[6]=i[2],t[7]=i[5],t[8]=i[8],this},setUvTransform:function(t,i,n,s,e,r,h){var o=Math.cos(e),e=Math.sin(e);this.set(n*o,n*e,-n*(o*r+e*h)+r+t,-s*e,s*o,-s*(-e*r+o*h)+h+i,0,0,1)},scale:function(t,i){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=i,n[4]*=i,n[7]*=i,this},rotate:function(t){var i=Math.cos(t),t=Math.sin(t),n=this.elements,s=n[0],e=n[3],r=n[6],h=n[1],o=n[4],a=n[7];return n[0]=i*s+t*h,n[3]=i*e+t*o,n[6]=i*r+t*a,n[1]=-t*s+i*h,n[4]=-t*e+i*o,n[7]=-t*r+i*a,this},translate:function(t,i){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=i*n[2],n[4]+=i*n[5],n[7]+=i*n[8],this},equals:function(t){for(var i=this.elements,n=t.elements,s=0;s<9;s++)if(i[s]!==n[s])return!1;return!0},fromArray:function(t,i){void 0===i&&(i=0);for(var n=0;n<9;n++)this.elements[n]=t[n+i];return this},toArray:function(t,i){var n=this.elements;return(t=void 0===t?[]:t)[i=void 0===i?0:i]=n[0],t[i+1]=n[1],t[i+2]=n[2],t[i+3]=n[3],t[i+4]=n[4],t[i+5]=n[5],t[i+6]=n[6],t[i+7]=n[7],t[i+8]=n[8],t}});var xt=0,Bt=new g,Pt=new l,Lt=new m,Ht=new g,Ft=new g,Ct=new g,It=new l,Nt=new g(1,0,0),Dt=new g(0,1,0),Vt=new g(0,0,1),Xt={type:"added"},Ut={type:"removed"};function f(){Object.defineProperty(this,"id",{value:xt++}),this.uuid=w.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=f.DefaultUp.clone();var t=new g,i=new d,n=new l,s=new g(1,1,1);i.F(function(){n.setFromEuler(i,!1)}),n.F(function(){i.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:i},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new m},normalMatrix:{value:new St}}),this.matrix=new m,this.matrixWorld=new m,this.matrixAutoUpdate=f.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Rt,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function qt(){f.call(this),this.type="Camera",this.matrixWorldInverse=new m,this.projectionMatrix=new m,this.projectionMatrixInverse=new m}function Yt(t,i,n,s,e,r){qt.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==i?i:1,this.top=void 0!==n?n:1,this.bottom=void 0!==s?s:-1,this.near=void 0!==e?e:.1,this.far=void 0!==r?r:2e3,this.updateProjectionMatrix()}function Zt(t,i,n,s){qt.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==s?s:2e3,this.focus=10,this.aspect=void 0!==i?i:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function M(t,i,n,s){this.x=t||0,this.y=i||0,this.z=n||0,this.w=void 0!==s?s:1}function H(t,i){this.x=t||0,this.y=i||0}f.DefaultUp=new g(0,1,0),f.DefaultMatrixAutoUpdate=!0,f.prototype=Object.assign(Object.create(Ot.prototype),{constructor:f,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,i){this.quaternion.setFromAxisAngle(t,i)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(t,i){return Pt.setFromAxisAngle(t,i),this.quaternion.multiply(Pt),this},rotateOnWorldAxis:function(t,i){return Pt.setFromAxisAngle(t,i),this.quaternion.premultiply(Pt),this},rotateX:function(t){return this.rotateOnAxis(Nt,t)},rotateY:function(t){return this.rotateOnAxis(Dt,t)},rotateZ:function(t){return this.rotateOnAxis(Vt,t)},translateOnAxis:function(t,i){return Bt.copy(t).applyQuaternion(this.quaternion),this.position.add(Bt.multiplyScalar(i)),this},translateX:function(t){return this.translateOnAxis(Nt,t)},translateY:function(t){return this.translateOnAxis(Dt,t)},translateZ:function(t){return this.translateOnAxis(Vt,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4(Lt.getInverse(this.matrixWorld))},lookAt:function(t,i,n){t.isVector3?Ht.copy(t):Ht.set(t,i,n);t=this.parent;this.updateWorldMatrix(!0,!1),Ft.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Lt.lookAt(Ft,Ht,this.up):Lt.lookAt(Ht,Ft,this.up),this.quaternion.setFromRotationMatrix(Lt),t&&(Lt.extractRotation(t.matrixWorld),Pt.setFromRotationMatrix(Lt),this.quaternion.premultiply(Pt.inverse()))},add:function(t){if(1<arguments.length)for(var i=0;i<arguments.length;i++)this.add(arguments[i]);else t===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",t):t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),(t.parent=this).children.push(t),t.dispatchEvent(Xt)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t);return this},remove:function(t){if(1<arguments.length)for(var i=0;i<arguments.length;i++)this.remove(arguments[i]);else{var n=this.children.indexOf(t);-1!==n&&(t.parent=null,this.children.splice(n,1),t.dispatchEvent(Ut))}return this},attach:function(t){return this.updateWorldMatrix(!0,!1),Lt.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Lt.multiply(t.parent.matrixWorld)),t.applyMatrix4(Lt),t.updateWorldMatrix(!1,!1),this.add(t),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,i){if(this[t]===i)return this;for(var n=0,s=this.children.length;n<s;n++){var e=this.children[n].getObjectByProperty(t,i);if(void 0!==e)return e}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new g),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new l),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Ft,t,Ct),t},getWorldScale:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new g),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Ft,It,t),t},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new g),this.updateMatrixWorld(!0);var i=this.matrixWorld.elements;return t.set(i[8],i[9],i[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var i=this.children,n=0,s=i.length;n<s;n++)i[n].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var i=this.children,n=0,s=i.length;n<s;n++)i[n].traverseVisible(t)}},traverseAncestors:function(t){var i=this.parent;null!==i&&(t(i),i.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t=!(this.matrixWorldNeedsUpdate=!1));for(var i=this.children,n=0,s=i.length;n<s;n++)i[n].updateMatrixWorld(t)},updateWorldMatrix:function(t,i){var n=this.parent;if(!0===t&&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===i)for(var s=this.children,e=0,r=s.length;e<r;e++)s[e].updateWorldMatrix(!1,!0)},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,i){if(void 0===i&&(i=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===i)for(var n=0;n<t.children.length;n++){var s=t.children[n];this.add(s.clone())}return this}}),qt.prototype=Object.assign(Object.create(f.prototype),{constructor:qt,isCamera:!0,copy:function(t,i){return f.prototype.copy.call(this,t,i),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new g),this.updateMatrixWorld(!0);var i=this.matrixWorld.elements;return t.set(-i[8],-i[9],-i[10]).normalize()},updateMatrixWorld:function(t){f.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,i){f.prototype.updateWorldMatrix.call(this,t,i),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Yt.prototype=Object.assign(Object.create(qt.prototype),{constructor:Yt,isOrthographicCamera:!0,copy:function(t,i){return qt.prototype.copy.call(this,t,i),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,i,n,s,e,r){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=i,this.view.offsetX=n,this.view.offsetY=s,this.view.width=e,this.view.height=r,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t,i=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),s=(this.right+this.left)/2,e=(this.top+this.bottom)/2,r=s-i,s=s+i,i=e+n,e=e-n;null!==this.view&&this.view.enabled&&(n=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom,s=(r+=n*this.view.offsetX)+n*this.view.width,e=(i-=t*this.view.offsetY)-t*this.view.height),this.projectionMatrix.makeOrthographic(r,s,i,e,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)}}),Zt.prototype=Object.assign(Object.create(qt.prototype),{constructor:Zt,isPerspectiveCamera:!0,copy:function(t,i){return qt.prototype.copy.call(this,t,i),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){t=.5*this.getFilmHeight()/t;this.fov=2*w.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*w.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*w.RAD2DEG*Math.atan(Math.tan(.5*w.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,i,n,s,e,r){this.aspect=t/i,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=i,this.view.offsetX=n,this.view.offsetY=s,this.view.width=e,this.view.height=r,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t,i=this.near,n=i*Math.tan(.5*w.DEG2RAD*this.fov)/this.zoom,s=2*n,e=this.aspect*s,r=-.5*e,h=this.view,o=(null!==this.view&&this.view.enabled&&(o=h.fullWidth,t=h.fullHeight,r+=h.offsetX*e/o,n-=h.offsetY*s/t,e*=h.width/o,s*=h.height/t),this.filmOffset);0!==o&&(r+=i*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+e,n,n-s,i,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)}}),Object.defineProperties(M.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(M.prototype,{isVector4:!0,set:function(t,i,n,s){return this.x=t,this.y=i,this.z=n,this.w=s,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;case 3:this.w=i;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,i){return void 0!==i?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,i)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this.w=t.w+i.w,this},addScaledVector:function(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this.w+=t.w*i,this},sub:function(t,i){return void 0!==i?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,i)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this.w=t.w-i.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var i=this.x,n=this.y,s=this.z,e=this.w,t=t.elements;return this.x=t[0]*i+t[4]*n+t[8]*s+t[12]*e,this.y=t[1]*i+t[5]*n+t[9]*s+t[13]*e,this.z=t[2]*i+t[6]*n+t[10]*s+t[14]*e,this.w=t[3]*i+t[7]*n+t[11]*s+t[15]*e,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var i=Math.sqrt(1-t.w*t.w);return i<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/i,this.y=t.y/i,this.z=t.z/i),this},setAxisAngleFromRotationMatrix:function(t){var i,n,s,e,r,h,o,a,u,c,t=t.elements,f=t[0],l=t[4],d=t[8],v=t[1],p=t[5],w=t[9],m=t[2],b=t[6],t=t[10];return Math.abs(l-v)<.01&&Math.abs(d-m)<.01&&Math.abs(w-b)<.01?Math.abs(l+v)<.1&&Math.abs(d+m)<.1&&Math.abs(w+b)<.1&&Math.abs(f+p+t-3)<.1?this.set(1,0,0,0):(e=Math.PI,h=(t+1)/2,o=(l+v)/4,a=(d+m)/4,u=(w+b)/4,(r=(p+1)/2)<(c=(f+1)/2)&&h<c?s=c<.01?(i=0,n=.707106781):(n=o/(i=Math.sqrt(c)),a/i):h<r?s=r<.01?(n=0,i=.707106781):(i=o/(n=Math.sqrt(r)),u/n):h<.01?(n=i=.707106781,s=0):(i=a/(s=Math.sqrt(h)),n=u/s),this.set(i,n,s,e)):(c=Math.sqrt((b-w)*(b-w)+(d-m)*(d-m)+(v-l)*(v-l)),Math.abs(c)<.001&&(c=1),this.x=(b-w)/c,this.y=(d-m)/c,this.z=(v-l)/c,this.w=Math.acos((f+p+t-1)/2)),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,i){return this.x=Math.max(t.x,Math.min(i.x,this.x)),this.y=Math.max(t.y,Math.min(i.y,this.y)),this.z=Math.max(t.z,Math.min(i.z,this.z)),this.w=Math.max(t.w,Math.min(i.w,this.w)),this},clampScalar:function(t,i){return this.x=Math.max(t,Math.min(i,this.x)),this.y=Math.max(t,Math.min(i,this.y)),this.z=Math.max(t,Math.min(i,this.z)),this.w=Math.max(t,Math.min(i,this.w)),this},clampLength:function(t,i){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(i,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this.w+=(t.w-this.w)*i,this},lerpVectors:function(t,i,n){return this.subVectors(i,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,i){return this.x=t[i=void 0===i?0:i],this.y=t[i+1],this.z=t[i+2],this.w=t[i+3],this},toArray:function(t,i){return(t=void 0===t?[]:t)[i=void 0===i?0:i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t[i+3]=this.w,t},fromBufferAttribute:function(t,i,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this.w=t.getW(i),this}}),Object.defineProperties(H.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(H.prototype,{isVector2:!0,set:function(t,i){return this.x=t,this.y=i,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,i){return void 0!==i?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,i)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this},addScaledVector:function(t,i){return this.x+=t.x*i,this.y+=t.y*i,this},sub:function(t,i){return void 0!==i?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,i)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var i=this.x,n=this.y,t=t.elements;return this.x=t[0]*i+t[3]*n+t[6],this.y=t[1]*i+t[4]*n+t[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,i){return this.x=Math.max(t.x,Math.min(i.x,this.x)),this.y=Math.max(t.y,Math.min(i.y,this.y)),this},clampScalar:function(t,i){return this.x=Math.max(t,Math.min(i,this.x)),this.y=Math.max(t,Math.min(i,this.y)),this},clampLength:function(t,i){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(i,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){return Math.atan2(-this.y,-this.x)+Math.PI},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var i=this.x-t.x,t=this.y-t.y;return i*i+t*t},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this},lerpVectors:function(t,i,n){return this.subVectors(i,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,i){return this.x=t[i=void 0===i?0:i],this.y=t[i+1],this},toArray:function(t,i){return(t=void 0===t?[]:t)[i=void 0===i?0:i]=this.x,t[i+1]=this.y,t},fromBufferAttribute:function(t,i,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(i),this.y=t.getY(i),this},rotateAround:function(t,i){var n=Math.cos(i),i=Math.sin(i),s=this.x-t.x,e=this.y-t.y;return this.x=s*n-e*i+t.x,this.y=s*i+e*n+t.y,this}});var Wt={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={h:0,s:0,l:0},Gt={h:0,s:0,l:0};function v(t,i,n){return void 0===i&&void 0===n?this.set(t):this.setRGB(t,i,n)}function _t(t,i,n){return n<0&&(n+=1),1<n&&--n,n<1/6?t+6*(i-t)*n:n<.5?i:n<2/3?t+6*(i-t)*(2/3-n):t}function zt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Kt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}Object.assign(v.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,i,n){return this.r=t,this.g=i,this.b=n,this},setHSL:function(t,i,n){return t=w.euclideanModulo(t,1),i=w.clamp(i,0,1),n=w.clamp(n,0,1),0===i?this.r=this.g=this.b=n:(this.r=_t(i=2*n-(n=n<=.5?n*(1+i):n+i-n*i),n,t+1/3),this.g=_t(i,n,t),this.b=_t(i,n,t-1/3)),this},setStyle:function(i){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+i+" will be ignored.")}if(a=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(i)){var n,s,e,r,h=a[1],o=a[2];switch(h){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,t(n[5]),this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,t(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return s=parseFloat(n[1])/360,e=parseInt(n[2],10)/100,r=parseInt(n[3],10)/100,t(n[5]),this.setHSL(s,e,r)}}else if(a=/^\#([A-Fa-f0-9]+)$/.exec(i)){var h=a[1],a=h.length;if(3===a)return this.r=parseInt(h.charAt(0)+h.charAt(0),16)/255,this.g=parseInt(h.charAt(1)+h.charAt(1),16)/255,this.b=parseInt(h.charAt(2)+h.charAt(2),16)/255,this;if(6===a)return this.r=parseInt(h.charAt(0)+h.charAt(1),16)/255,this.g=parseInt(h.charAt(2)+h.charAt(3),16)/255,this.b=parseInt(h.charAt(4)+h.charAt(5),16)/255,this}return i&&0<i.length?this.setColorName(i):this},setColorName:function(t){var i=Wt[t];return void 0!==i?this.setHex(i):console.warn("THREE.Color: Unknown color "+t),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,i){return void 0===i&&(i=2),this.r=Math.pow(t.r,i),this.g=Math.pow(t.g,i),this.b=Math.pow(t.b,i),this},copyLinearToGamma:function(t,i){i=0<(i=void 0===i?2:i)?1/i:1;return this.r=Math.pow(t.r,i),this.g=Math.pow(t.g,i),this.b=Math.pow(t.b,i),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=zt(t.r),this.g=zt(t.g),this.b=zt(t.b),this},copyLinearToSRGB:function(t){return this.r=Kt(t.r),this.g=Kt(t.g),this.b=Kt(t.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var i,n=this.r,s=this.g,e=this.b,r=Math.max(n,s,e),h=Math.min(n,s,e),o=(h+r)/2;if(h===r)u=i=0;else{var a=r-h,u=o<=.5?a/(r+h):a/(2-r-h);switch(r){case n:i=(s-e)/a+(s<e?6:0);break;case s:i=(e-n)/a+2;break;case e:i=(n-s)/a+4}i/=6}return t.h=i,t.s=u,t.l=o,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,i,n){return this.getHSL(s),s.h+=t,s.s+=i,s.l+=n,this.setHSL(s.h,s.s,s.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,i){return this.r=t.r+i.r,this.g=t.g+i.g,this.b=t.b+i.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,i){return this.r+=(t.r-this.r)*i,this.g+=(t.g-this.g)*i,this.b+=(t.b-this.b)*i,this},lerpHSL:function(t,i){this.getHSL(s),t.getHSL(Gt);var t=w.lerp(s.h,Gt.h,i),n=w.lerp(s.s,Gt.s,i),i=w.lerp(s.l,Gt.l,i);return this.setHSL(t,n,i),this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,i){return this.r=t[i=void 0===i?0:i],this.g=t[i+1],this.b=t[i+2],this},toArray:function(t,i){return(t=void 0===t?[]:t)[i=void 0===i?0:i]=this.r,t[i+1]=this.g,t[i+2]=this.b,t}}),v.NAMES=Wt;var p=new g;function y(t,i,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=i,this.count=void 0!==t?t.length/i:0,this.normalized=!0===n,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function Qt(t,i,n){y.call(this,new Int8Array(t),i,n)}function $t(t,i,n){y.call(this,new Uint8Array(t),i,n)}function Jt(t,i,n){y.call(this,new Uint8ClampedArray(t),i,n)}function ti(t,i,n){y.call(this,new Int16Array(t),i,n)}function ii(t,i,n){y.call(this,new Uint16Array(t),i,n)}function ni(t,i,n){y.call(this,new Int32Array(t),i,n)}function si(t,i,n){y.call(this,new Uint32Array(t),i,n)}function E(t,i,n){y.call(this,new Float32Array(t),i,n)}function ei(t,i,n){y.call(this,new Float64Array(t),i,n)}Object.defineProperty(y.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(y.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,i,n){t*=this.itemSize,n*=i.itemSize;for(var s=0,e=this.itemSize;s<e;s++)this.array[t+s]=i.array[n+s];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var i=this.array,n=0,s=0,e=t.length;s<e;s++){var r=t[s];void 0===r&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",s),r=new v),i[n++]=r.r,i[n++]=r.g,i[n++]=r.b}return this},copyVector2sArray:function(t){for(var i=this.array,n=0,s=0,e=t.length;s<e;s++){var r=t[s];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",s),r=new H),i[n++]=r.x,i[n++]=r.y}return this},copyVector3sArray:function(t){for(var i=this.array,n=0,s=0,e=t.length;s<e;s++){var r=t[s];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",s),r=new g),i[n++]=r.x,i[n++]=r.y,i[n++]=r.z}return this},copyVector4sArray:function(t){for(var i=this.array,n=0,s=0,e=t.length;s<e;s++){var r=t[s];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",s),r=new M),i[n++]=r.x,i[n++]=r.y,i[n++]=r.z,i[n++]=r.w}return this},applyMatrix3:function(t){for(var i=0,n=this.count;i<n;i++)p.x=this.getX(i),p.y=this.getY(i),p.z=this.getZ(i),p.applyMatrix3(t),this.setXYZ(i,p.x,p.y,p.z);return this},applyMatrix4:function(t){for(var i=0,n=this.count;i<n;i++)p.x=this.getX(i),p.y=this.getY(i),p.z=this.getZ(i),p.applyMatrix4(t),this.setXYZ(i,p.x,p.y,p.z);return this},applyNormalMatrix:function(t){for(var i=0,n=this.count;i<n;i++)p.x=this.getX(i),p.y=this.getY(i),p.z=this.getZ(i),p.applyNormalMatrix(t),this.setXYZ(i,p.x,p.y,p.z);return this},transformDirection:function(t){for(var i=0,n=this.count;i<n;i++)p.x=this.getX(i),p.y=this.getY(i),p.z=this.getZ(i),p.transformDirection(t),this.setXYZ(i,p.x,p.y,p.z);return this},set:function(t,i){return this.array.set(t,i=void 0===i?0:i),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,i){return this.array[t*this.itemSize]=i,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,i){return this.array[t*this.itemSize+1]=i,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,i){return this.array[t*this.itemSize+2]=i,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,i){return this.array[t*this.itemSize+3]=i,this},setXY:function(t,i,n){return t*=this.itemSize,this.array[t+0]=i,this.array[t+1]=n,this},setXYZ:function(t,i,n,s){return t*=this.itemSize,this.array[t+0]=i,this.array[t+1]=n,this.array[t+2]=s,this},setXYZW:function(t,i,n,s,e){return t*=this.itemSize,this.array[t+0]=i,this.array[t+1]=n,this.array[t+2]=s,this.array[t+3]=e,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),(Qt.prototype=Object.create(y.prototype)).constructor=Qt,($t.prototype=Object.create(y.prototype)).constructor=$t,(Jt.prototype=Object.create(y.prototype)).constructor=Jt,(ti.prototype=Object.create(y.prototype)).constructor=ti,ii.prototype=Object.create(y.prototype),ii.prototype.constructor=ii,(ni.prototype=Object.create(y.prototype)).constructor=ni,si.prototype=Object.create(y.prototype),si.prototype.constructor=si,(E.prototype=Object.create(y.prototype)).constructor=E,(ei.prototype=Object.create(y.prototype)).constructor=ei;var ri=[new g,new g,new g,new g,new g,new g,new g,new g],hi=new g,oi=new bi,ai=new g,ui=new g,ci=new g,fi=new g,li=new g,di=new g,vi=new g,pi=new g,wi=new g,mi=new g;function bi(t,i){this.min=void 0!==t?t:new g(1/0,1/0,1/0),this.max=void 0!==i?i:new g(-1/0,-1/0,-1/0)}function Mi(t,i,n,s,e){for(var r=0,h=t.length-3;r<=h;r+=3){mi.fromArray(t,r);var o=e.x*Math.abs(mi.x)+e.y*Math.abs(mi.y)+e.z*Math.abs(mi.z),a=i.dot(mi),u=n.dot(mi),c=s.dot(mi);if(Math.max(-Math.max(a,u,c),Math.min(a,u,c))>o)return!1}return!0}Object.assign(bi.prototype,{isBox3:!0,set:function(t,i){return this.min.copy(t),this.max.copy(i),this},setFromArray:function(t){for(var i=1/0,n=1/0,s=1/0,e=-1/0,r=-1/0,h=-1/0,o=0,a=t.length;o<a;o+=3){var u=t[o],c=t[o+1],f=t[o+2];u<i&&(i=u),c<n&&(n=c),f<s&&(s=f),e<u&&(e=u),r<c&&(r=c),h<f&&(h=f)}return this.min.set(i,n,s),this.max.set(e,r,h),this},setFromBufferAttribute:function(t){for(var i=1/0,n=1/0,s=1/0,e=-1/0,r=-1/0,h=-1/0,o=0,a=t.count;o<a;o++){var u=t.getX(o),c=t.getY(o),f=t.getZ(o);u<i&&(i=u),c<n&&(n=c),f<s&&(s=f),e<u&&(e=u),r<c&&(r=c),h<f&&(h=f)}return this.min.set(i,n,s),this.max.set(e,r,h),this},setFromPoints:function(t){this.makeEmpty();for(var i=0,n=t.length;i<n;i++)this.expandByPoint(t[i]);return this},setFromCenterAndSize:function(t,i){i=hi.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this},setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new g),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new g),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(t){t.updateWorldMatrix(!1,!1);for(var i=t.geometry,n=(void 0!==i&&(null===i.boundingBox&&i.computeBoundingBox(),oi.copy(i.boundingBox),oi.applyMatrix4(t.matrixWorld),this.union(oi)),t.children),s=0,e=n.length;s<e;s++)this.expandByObject(n[s]);return this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,i){return void 0===i&&(console.warn("THREE.Box3: .getParameter() target is now required"),i=new g),i.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(t){return this.clampPoint(t.center,hi),hi.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){var i,n=0<t.normal.x?(i=t.normal.x*this.min.x,t.normal.x*this.max.x):(i=t.normal.x*this.max.x,t.normal.x*this.min.x);return 0<t.normal.y?(i+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(i+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),0<t.normal.z?(i+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(i+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),i<=-t.constant&&n>=-t.constant},intersectsTriangle:function(t){return!this.isEmpty()&&(this.getCenter(vi),pi.subVectors(this.max,vi),ai.subVectors(t.a,vi),ui.subVectors(t.b,vi),ci.subVectors(t.c,vi),fi.subVectors(ui,ai),li.subVectors(ci,ui),di.subVectors(ai,ci),!!Mi([0,-fi.z,fi.y,0,-li.z,li.y,0,-di.z,di.y,fi.z,0,-fi.x,li.z,0,-li.x,di.z,0,-di.x,-fi.y,fi.x,0,-li.y,li.x,0,-di.y,di.x,0],ai,ui,ci,pi))&&!!Mi([1,0,0,0,1,0,0,0,1],ai,ui,ci,pi)&&(wi.crossVectors(fi,li),Mi([wi.x,wi.y,wi.z],ai,ui,ci,pi))},clampPoint:function(t,i){return void 0===i&&(console.warn("THREE.Box3: .clampPoint() target is now required"),i=new g),i.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return hi.copy(t).clamp(this.min,this.max).sub(t).length()},getBoundingSphere:function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(hi).length(),t},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(t){return this.isEmpty()||(ri[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),ri[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),ri[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),ri[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),ri[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),ri[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),ri[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),ri[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(ri)),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var gi=new bi;function yi(t,i){this.center=void 0!==t?t:new g,this.radius=void 0!==i?i:0}function Ei(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}Object.assign(yi.prototype,{set:function(t,i){return this.center.copy(t),this.radius=i,this},setFromPoints:function(t,i){for(var n=this.center,s=(void 0!==i?n.copy(i):gi.setFromPoints(t).getCenter(n),0),e=0,r=t.length;e<r;e++)s=Math.max(s,n.distanceToSquared(t[e]));return this.radius=Math.sqrt(s),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var i=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=i*i},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,i){var n=this.center.distanceToSquared(t);return void 0===i&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),i=new g),i.copy(t),n>this.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new bi),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}}),Object.assign(Ei.prototype,{computeGroups:function(t){for(var i,n=[],s=void 0,e=t.faces,r=0;r<e.length;r++){var h=e[r];h.materialIndex!==s&&(s=h.materialIndex,void 0!==i&&(i.count=3*r-i.start,n.push(i)),i={start:3*r,materialIndex:s})}void 0!==i&&(i.count=3*r-i.start,n.push(i)),this.groups=n},fromGeometry:function(t){var i=t.faces,n=t.vertices,s=t.faceVertexUvs,e=s[0]&&0<s[0].length,r=s[1]&&0<s[1].length,h=t.morphTargets,o=h.length;if(0<o){for(var a=[],u=0;u<o;u++)a[u]={name:h[u].name,data:[]};this.morphTargets.position=a}var c=t.morphNormals,f=c.length;if(0<f){for(var l=[],u=0;u<f;u++)l[u]={name:c[u].name,data:[]};this.morphTargets.normal=l}var d=t.skinIndices,v=t.skinWeights,p=d.length===n.length,w=v.length===n.length;0<n.length&&0===i.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(u=0;u<i.length;u++){var m,b=i[u],M=(this.vertices.push(n[b.a],n[b.b],n[b.c]),b.vertexNormals),M=(3===M.length?this.normals.push(M[0],M[1],M[2]):(M=b.normal,this.normals.push(M,M,M)),b.vertexColors);3===M.length?this.colors.push(M[0],M[1],M[2]):(M=b.color,this.colors.push(M,M,M)),!0===e&&(void 0!==(m=s[0][u])?this.uvs.push(m[0],m[1],m[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",u),this.uvs.push(new H,new H,new H))),!0===r&&(void 0!==(m=s[1][u])?this.uvs2.push(m[0],m[1],m[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",u),this.uvs2.push(new H,new H,new H)));for(var g=0;g<o;g++){var y=h[g].vertices;a[g].data.push(y[b.a],y[b.b],y[b.c])}for(g=0;g<f;g++){var E=c[g].vertexNormals[u];l[g].data.push(E.a,E.b,E.c)}p&&this.skinIndices.push(d[b.a],d[b.b],d[b.c]),w&&this.skinWeights.push(v[b.a],v[b.b],v[b.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this}});var Ti=1,ki=new m,Oi=new f,Ai=new g,T=new bi,ji=new bi,k=new g;function Ri(){Object.defineProperty(this,"id",{value:Ti+=2}),this.uuid=w.generateUUID(),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={}}function O(t,i){f.call(this),this.type="Light",this.color=new v(t),this.intensity=void 0!==i?i:1,this.receiveShadow=void 0}function Si(t,i){O.call(this,t,i),this.type="AmbientLight",this.castShadow=void 0}Ri.prototype=Object.assign(Object.create(Ot.prototype),{constructor:Ri,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(65535<function(t){if(0===t.length)return-1/0;for(var i=t[0],n=1,s=t.length;n<s;++n)t[n]>i&&(i=t[n]);return i}(t)?si:ii)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,i){return this.attributes[t]=i,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,i,n){this.groups.push({start:t,count:i,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,i){this.drawRange.start=t,this.drawRange.count=i},applyMatrix4:function(t){var i=this.attributes.position,i=(void 0!==i&&(i.applyMatrix4(t),i.needsUpdate=!0),this.attributes.normal),n=(void 0!==i&&(n=(new St).getNormalMatrix(t),i.applyNormalMatrix(n),i.needsUpdate=!0),this.attributes.tangent);return void 0!==n&&(n.transformDirection(t),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return ki.makeRotationX(t),this.applyMatrix4(ki),this},rotateY:function(t){return ki.makeRotationY(t),this.applyMatrix4(ki),this},rotateZ:function(t){return ki.makeRotationZ(t),this.applyMatrix4(ki),this},translate:function(t,i,n){return ki.makeTranslation(t,i,n),this.applyMatrix4(ki),this},scale:function(t,i,n){return ki.makeScale(t,i,n),this.applyMatrix4(ki),this},lookAt:function(t){return Oi.lookAt(t),Oi.updateMatrix(),this.applyMatrix4(Oi.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ai).negate(),this.translate(Ai.x,Ai.y,Ai.z),this},setFromObject:function(t){var i,n,s=t.geometry;return t.isPoints||t.isLine?(n=new E(3*s.vertices.length,3),i=new E(3*s.colors.length,3),this.setAttribute("position",n.copyVector3sArray(s.vertices)),this.setAttribute("color",i.copyColorsArray(s.colors)),s.lineDistances&&s.lineDistances.length===s.vertices.length&&(n=new E(s.lineDistances.length,1),this.setAttribute("lineDistance",n.copyArray(s.lineDistances))),null!==s.boundingSphere&&(this.boundingSphere=s.boundingSphere.clone()),null!==s.boundingBox&&(this.boundingBox=s.boundingBox.clone())):t.isMesh&&s&&s.isGeometry&&this.fromGeometry(s),this},setFromPoints:function(t){for(var i=[],n=0,s=t.length;n<s;n++){var e=t[n];i.push(e.x,e.y,e.z||0)}return this.setAttribute("position",new E(i,3)),this},updateFromObject:function(t){var i,n=t.geometry;if(t.isMesh){var s=n.Z;if(!0===n.elementsNeedUpdate&&(s=void 0,n.elementsNeedUpdate=!1),void 0===s)return this.fromGeometry(n);s.verticesNeedUpdate=n.verticesNeedUpdate,s.normalsNeedUpdate=n.normalsNeedUpdate,s.colorsNeedUpdate=n.colorsNeedUpdate,s.uvsNeedUpdate=n.uvsNeedUpdate,s.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=s}return!0===n.verticesNeedUpdate&&(void 0!==(i=this.attributes.position)&&(i.copyVector3sArray(n.vertices),i.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(i=this.attributes.normal)&&(i.copyVector3sArray(n.normals),i.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(i=this.attributes.color)&&(i.copyColorsArray(n.colors),i.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(i=this.attributes.uv)&&(i.copyVector2sArray(n.uvs),i.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(i=this.attributes.lineDistance)&&(i.copyArray(n.lineDistances),i.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(t.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.Z=(new Ei).fromGeometry(t),this.fromDirectGeometry(t.Z)},fromDirectGeometry:function(t){var i,n=new Float32Array(3*t.vertices.length);for(i in this.setAttribute("position",new y(n,3).copyVector3sArray(t.vertices)),0<t.normals.length&&(n=new Float32Array(3*t.normals.length),this.setAttribute("normal",new y(n,3).copyVector3sArray(t.normals))),0<t.colors.length&&(n=new Float32Array(3*t.colors.length),this.setAttribute("color",new y(n,3).copyColorsArray(t.colors))),0<t.uvs.length&&(n=new Float32Array(2*t.uvs.length),this.setAttribute("uv",new y(n,2).copyVector2sArray(t.uvs))),0<t.uvs2.length&&(n=new Float32Array(2*t.uvs2.length),this.setAttribute("uv2",new y(n,2).copyVector2sArray(t.uvs2))),this.groups=t.groups,t.morphTargets){for(var s=[],e=t.morphTargets[i],r=0,h=e.length;r<h;r++){var o=e[r],a=new E(3*o.data.length,3);a.name=o.name,s.push(a.copyVector3sArray(o.data))}this.morphAttributes[i]=s}return 0<t.skinIndices.length&&(n=new E(4*t.skinIndices.length,4),this.setAttribute("skinIndex",n.copyVector4sArray(t.skinIndices))),0<t.skinWeights.length&&(n=new E(4*t.skinWeights.length,4),this.setAttribute("skinWeight",n.copyVector4sArray(t.skinWeights))),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new bi);var t=this.attributes.position,i=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),i)for(var n=0,s=i.length;n<s;n++){var e=i[n];T.setFromBufferAttribute(e),this.morphTargetsRelative?(k.addVectors(this.boundingBox.min,T.min),this.boundingBox.expandByPoint(k),k.addVectors(this.boundingBox.max,T.max),this.boundingBox.expandByPoint(k)):(this.boundingBox.expandByPoint(T.min),this.boundingBox.expandByPoint(T.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:function(){null===this.boundingSphere&&(this.boundingSphere=new yi);var t=this.attributes.position,i=this.morphAttributes.position;if(t){var n=this.boundingSphere.center;if(T.setFromBufferAttribute(t),i)for(var s=0,e=i.length;s<e;s++){var r=i[s];ji.setFromBufferAttribute(r),this.morphTargetsRelative?(k.addVectors(T.min,ji.min),T.expandByPoint(k),k.addVectors(T.max,ji.max),T.expandByPoint(k)):(T.expandByPoint(ji.min),T.expandByPoint(ji.max))}T.getCenter(n);for(var h=0,s=0,e=t.count;s<e;s++)k.fromBufferAttribute(t,s),h=Math.max(h,n.distanceToSquared(k));if(i)for(s=0,e=i.length;s<e;s++)for(var r=i[s],o=this.morphTargetsRelative,a=0,u=r.count;a<u;a++)k.fromBufferAttribute(r,a),o&&(Ai.fromBufferAttribute(t,a),k.add(Ai)),h=Math.max(h,n.distanceToSquared(k));this.boundingSphere.radius=Math.sqrt(h),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,i=this.attributes;if(i.position){var n=i.position.array;if(void 0===i.normal)this.setAttribute("normal",new y(new Float32Array(n.length),3));else for(var s=i.normal.array,e=0,r=s.length;e<r;e++)s[e]=0;var h,o,a,u=i.normal.array,c=new g,f=new g,l=new g,d=new g,v=new g;if(t)for(var p=t.array,e=0,r=t.count;e<r;e+=3)h=3*p[e+0],o=3*p[e+1],a=3*p[e+2],c.fromArray(n,h),f.fromArray(n,o),l.fromArray(n,a),d.subVectors(l,f),v.subVectors(c,f),d.cross(v),u[h]+=d.x,u[1+h]+=d.y,u[2+h]+=d.z,u[o]+=d.x,u[1+o]+=d.y,u[2+o]+=d.z,u[a]+=d.x,u[1+a]+=d.y,u[2+a]+=d.z;else for(e=0,r=n.length;e<r;e+=9)c.fromArray(n,e),f.fromArray(n,e+3),l.fromArray(n,e+6),d.subVectors(l,f),v.subVectors(c,f),d.cross(v),u[e]=d.x,u[e+1]=d.y,u[e+2]=d.z,u[e+3]=d.x,u[e+4]=d.y,u[e+5]=d.z,u[e+6]=d.x,u[e+7]=d.y,u[e+8]=d.z;this.normalizeNormals(),i.normal.needsUpdate=!0}},normalizeNormals:function(){for(var t=this.attributes.normal,i=0,n=t.count;i<n;i++)k.x=t.getX(i),k.y=t.getY(i),k.z=t.getZ(i),k.normalize(),t.setXYZ(i,k.x,k.y,k.z)},dispose:function(){this.dispatchEvent({type:"dispose"})}}),O.prototype=Object.assign(Object.create(f.prototype),{constructor:O,isLight:!0,copy:function(t){return f.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this}}),Si.prototype=Object.assign(Object.create(O.prototype),{constructor:Si,isAmbientLight:!0});var xi=new g,Bi=new g,Pi=new St;function Li(t,i){this.normal=void 0!==t?t:new g(1,0,0),this.constant=void 0!==i?i:0}Object.assign(Li.prototype,{isPlane:!0,set:function(t,i){return this.normal.copy(t),this.constant=i,this},setComponents:function(t,i,n,s){return this.normal.set(t,i,n),this.constant=s,this},setFromNormalAndCoplanarPoint:function(t,i){return this.normal.copy(t),this.constant=-i.dot(this.normal),this},setFromCoplanarPoints:function(t,i,n){n=xi.subVectors(n,i).cross(Bi.subVectors(t,i)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,i){return void 0===i&&(console.warn("THREE.Plane: .projectPoint() target is now required"),i=new g),i.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,i){void 0===i&&(console.warn("THREE.Plane: .intersectLine() target is now required"),i=new g);var n=t.delta(xi),s=this.normal.dot(n);return 0===s?0===this.distanceToPoint(t.start)?i.copy(t.start):void 0:(s=-(t.start.dot(this.normal)+this.constant)/s)<0||1<s?void 0:i.copy(n).multiplyScalar(s).add(t.start)},intersectsLine:function(t){var i=this.distanceToPoint(t.start),t=this.distanceToPoint(t.end);return i<0&&0<t||t<0&&0<i},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new g),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,i){i=i||Pi.getNormalMatrix(t),t=this.coplanarPoint(xi).applyMatrix4(t),i=this.normal.applyMatrix3(i).normalize();return this.constant=-t.dot(i),this},translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}});var Hi=new yi,Fi=new g;function Ci(t,i,n,s,e,r){this.planes=[void 0!==t?t:new Li,void 0!==i?i:new Li,void 0!==n?n:new Li,void 0!==s?s:new Li,void 0!==e?e:new Li,void 0!==r?r:new Li]}function Ii(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new H(512,512),this.map=null,this.mapPass=null,this.matrix=new m,this.W=new Ci,this.G=new H(1,1),this._=1,this.K=[new M(0,0,1,1)]}function Ni(){Ii.call(this,new Yt(-5,5,5,-5,.5,500))}function Di(t,i){O.call(this,t,i),this.type="DirectionalLight",this.position.copy(f.DefaultUp),this.updateMatrix(),this.target=new f,this.shadow=new Ni}function Vi(){Ii.call(this,new Zt(90,1,.5,500)),this.G=new H(4,2),this._=6,this.K=[new M(2,1,1,1),new M(0,1,1,1),new M(3,1,1,1),new M(1,1,1,1),new M(3,0,1,1),new M(1,0,1,1)],this.$=[new g(1,0,0),new g(-1,0,0),new g(0,0,1),new g(0,0,-1),new g(0,1,0),new g(0,-1,0)],this.J=[new g(0,1,0),new g(0,1,0),new g(0,1,0),new g(0,1,0),new g(0,0,1),new g(0,0,-1)]}function Xi(t,i,n,s){O.call(this,t,i),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==s?s:1,this.shadow=new Vi}function Ui(){Ii.call(this,new Zt(50,1,.5,500))}function qi(t,i,n,s,e,r){O.call(this,t,i),this.type="SpotLight",this.position.copy(f.DefaultUp),this.updateMatrix(),this.target=new f,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==s?s:Math.PI/3,this.penumbra=void 0!==e?e:0,this.decay=void 0!==r?r:1,this.shadow=new Ui}Object.assign(Ci.prototype,{set:function(t,i,n,s,e,r){var h=this.planes;return h[0].copy(t),h[1].copy(i),h[2].copy(n),h[3].copy(s),h[4].copy(e),h[5].copy(r),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var i=this.planes,n=0;n<6;n++)i[n].copy(t.planes[n]);return this},setFromProjectionMatrix:function(t){var i=this.planes,t=t.elements,n=t[0],s=t[1],e=t[2],r=t[3],h=t[4],o=t[5],a=t[6],u=t[7],c=t[8],f=t[9],l=t[10],d=t[11],v=t[12],p=t[13],w=t[14],t=t[15];return i[0].setComponents(r-n,u-h,d-c,t-v).normalize(),i[1].setComponents(r+n,u+h,d+c,t+v).normalize(),i[2].setComponents(r+s,u+o,d+f,t+p).normalize(),i[3].setComponents(r-s,u-o,d-f,t-p).normalize(),i[4].setComponents(r-e,u-a,d-l,t-w).normalize(),i[5].setComponents(r+e,u+a,d+l,t+w).normalize(),this},intersectsObject:function(t){var i=t.geometry;return null===i.boundingSphere&&i.computeBoundingSphere(),Hi.copy(i.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Hi)},intersectsSprite:function(t){return Hi.center.set(0,0,0),Hi.radius=.7071067811865476,Hi.applyMatrix4(t.matrixWorld),this.intersectsSphere(Hi)},intersectsSphere:function(t){for(var i=this.planes,n=t.center,s=-t.radius,e=0;e<6;e++)if(i[e].distanceToPoint(n)<s)return!1;return!0},intersectsBox:function(t){for(var i=this.planes,n=0;n<6;n++){var s=i[n];if(Fi.x=(0<s.normal.x?t.max:t.min).x,Fi.y=(0<s.normal.y?t.max:t.min).y,Fi.z=(0<s.normal.z?t.max:t.min).z,s.distanceToPoint(Fi)<0)return!1}return!0},containsPoint:function(t){for(var i=this.planes,n=0;n<6;n++)if(i[n].distanceToPoint(t)<0)return!1;return!0}}),Object.assign(Ii.prototype,{tt:new m,it:new g,nt:new g,getViewportCount:function(){return this._},getFrustum:function(){return this.W},updateMatrices:function(t){var i=this.camera,n=this.matrix,s=this.tt,e=this.nt,r=this.it;r.setFromMatrixPosition(t.matrixWorld),i.position.copy(r),e.setFromMatrixPosition(t.target.matrixWorld),i.lookAt(e),i.updateMatrixWorld(),s.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this.W.setFromProjectionMatrix(s),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(i.projectionMatrix),n.multiply(i.matrixWorldInverse)},getViewport:function(t){return this.K[t]},getFrameExtents:function(){return this.G},copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)}}),Ni.prototype=Object.assign(Object.create(Ii.prototype),{constructor:Ni,isDirectionalLightShadow:!0,updateMatrices:function(t){Ii.prototype.updateMatrices.call(this,t)}}),Di.prototype=Object.assign(Object.create(O.prototype),{constructor:Di,isDirectionalLight:!0,copy:function(t){return O.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Vi.prototype=Object.assign(Object.create(Ii.prototype),{constructor:Vi,isPointLightShadow:!0,updateMatrices:function(t,i){void 0===i&&(i=0);var n=this.camera,s=this.matrix,e=this.it,r=this.nt,h=this.tt;e.setFromMatrixPosition(t.matrixWorld),n.position.copy(e),r.copy(n.position),r.add(this.$[i]),n.up.copy(this.J[i]),n.lookAt(r),n.updateMatrixWorld(),s.makeTranslation(-e.x,-e.y,-e.z),h.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this.W.setFromProjectionMatrix(h)}}),Xi.prototype=Object.assign(Object.create(O.prototype),{constructor:Xi,isPointLight:!0,copy:function(t){return O.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Ui.prototype=Object.assign(Object.create(Ii.prototype),{constructor:Ui,isSpotLightShadow:!0,updateMatrices:function(t){var i=this.camera,n=2*w.RAD2DEG*t.angle,s=this.mapSize.width/this.mapSize.height,e=t.distance||i.far;n===i.fov&&s===i.aspect&&e===i.far||(i.fov=n,i.aspect=s,i.far=e,i.updateProjectionMatrix()),Ii.prototype.updateMatrices.call(this,t)}}),qi.prototype=Object.assign(Object.create(O.prototype),{constructor:qi,isSpotLight:!0,copy:function(t){return O.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}});var i={BROWSER:0,WX:1},Yi=(Object.freeze(i),i),Zi={document:"undefined"!=typeof document?document:{},window:"undefined"!=typeof window?window:{},environment:Yi.BROWSER,XMLHttpRequest:"undefined"!=typeof XMLHttpRequest?XMLHttpRequest:{}},Wi={enabled:!1,files:{},add:function(t,i){!1!==this.enabled&&(this.files[t]=i)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function Gi(t,i,n){var s=this,e=!1,r=0,h=0,o=void 0,a=[];this.onStart=void 0,this.onLoad=t,this.onProgress=i,this.onError=n,this.record=new Map,this.itemStart=function(t){this.record.has(t)||this.record.set(t,{}),h++,!1===e&&void 0!==s.onStart&&s.onStart(t,r,h),e=!0},this.itemEnd=function(t){this.record.delete(t),r++,void 0!==s.onProgress&&s.onProgress(t,r,h),r===h&&(e=!1,void 0!==s.onLoad)&&s.onLoad()},this.itemError=function(t){this.record.delete(t),void 0!==s.onError&&s.onError(t)},this.resolveURL=function(t){return o?o(t):t},this.setURLModifier=function(t){return o=t,this},this.addHandler=function(t,i){return a.push(t,i),this},this.removeHandler=function(t){t=a.indexOf(t);return-1!==t&&a.splice(t,2),this},this.getHandler=function(t){for(var i=0,n=a.length;i<n;i+=2){var s=a[i],e=a[i+1];if(s.global&&(s.lastIndex=0),s.test(t))return e}return null},this.isLoaded=function(){return 0===this.record.size}}var _i=new Gi;function zi(t){A.call(this,t)}zi.prototype=Object.assign(Object.create(A.prototype),{constructor:zi,load:function(n,s,t,i){void 0!==this.path&&(n=this.path+n),n=this.manager.resolveURL(n);var e,r,h,o=this,a=Wi.get(n);return void 0!==a?(o.manager.itemStart(n),setTimeout(function(){s&&s(a),o.manager.itemEnd(n)},0),a):Zi.environment===Yi.WX?(n.includes(wx.env.USER_DATA_PATH)?(r=wx.getFileSystemManager()).readFile({filePath:n,encoding:"base64",success:function(t){var t="data:image/png;base64,".concat(t.data),i=Zi.textureHelper.createImage({url:t,onload:function(){Wi.add(n,i),s&&s(i),o.manager.itemEnd(n),r.unlink({filePath:n,fail:function(t){},success:function(){}})}})},fail:function(t){console.error(t),i&&i(t),o.manager.itemError(n),o.manager.itemEnd(n)}}):e=Zi.textureHelper.createImage({url:n,onload:function(){Wi.add(n,e),s&&s(e),o.manager.itemEnd(n)},onerror:function(t){console.error(t),i&&i(t),o.manager.itemError(n),o.manager.itemEnd(n)}}),e):((h=Zi.document.createElementNS("http://www.w3.org/1999/xhtml","img")).addEventListener("load",u,!1),h.addEventListener("error",c,!1),"data:"!==n.substr(0,5)&&void 0!==this.crossOrigin&&(h.crossOrigin=this.crossOrigin),o.manager.itemStart(n),h.src=n,h);function u(){h.removeEventListener("load",u,!1),h.removeEventListener("error",c,!1),Wi.add(n,this),s&&s(this),o.manager.itemEnd(n)}function c(t){h.removeEventListener("load",u,!1),h.removeEventListener("error",c,!1),i&&i(t),o.manager.itemError(n),o.manager.itemEnd(n)}}});var Ki=0;function Qi(t,i,n,s,e,r,h,o,a,u){Object.defineProperty(this,"id",{value:Ki++}),this.uuid=w.generateUUID(),this.name="",this.image=void 0!==t?t:Qi.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==i?i:Qi.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:G,this.wrapT=void 0!==s?s:G,this.magFilter=void 0!==e?e:1006,this.minFilter=void 0!==r?r:1008,this.anisotropy=void 0!==a?a:1,this.format=void 0!==h?h:1023,this.internalFormat=null,this.type=void 0!==o?o:1009,this.offset=new H(0,0),this.repeat=new H(1,1),this.center=new H(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new St,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==u?u:3e3,this.version=0,this.onUpdate=null}function $i(t){A.call(this,t)}Qi.DEFAULT_IMAGE=void 0,Qi.DEFAULT_MAPPING=300,Qi.prototype=Object.assign(Object.create(Ot.prototype),{constructor:Qi,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(300===this.mapping){if(t.applyMatrix3(this.matrix),t.x<0||1<t.x)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case G:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||1<t.y)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case G:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}this.flipY&&(t.y=1-t.y)}return t}}),Object.defineProperty(Qi.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),$i.prototype=Object.assign(Object.create(A.prototype),{constructor:$i,load:function(i,n,t,s){var e=new Qi,r=new zi(this.manager);return r.setCrossOrigin(this.crossOrigin),r.setPath(this.path),r.load(i,function(t){e.image=t;t=0<i.search(/\.jpe?g($|\?)/i)||0===i.search(/^data\:image\/jpeg/);e.format=t?1022:1023,e.needsUpdate=!0,void 0!==n&&n(e)},t,s),e}});var Ji=0;function n(){Object.defineProperty(this,"id",{value:Ji++}),this.uuid=w.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=X,this.side=N,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=q,this.blendDst=Y,this.blendEquation=U,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Z,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Q,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=K,this.stencilZFail=K,this.stencilZPass=K,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.alphaTest=$,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function tn(t){n.call(this),this.type="ShadowMaterial",this.color=new v(0),this.transparent=!0,this.setValues(t)}function nn(t){n.call(this),this.type="SpriteMaterial",this.color=new v(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}function sn(t){var i,n={};for(i in t)for(var s in n[i]={},t[i]){var e=t[i][s];e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture)?n[i][s]=e.clone():Array.isArray(e)?n[i][s]=e.slice():n[i][s]=e}return n}n.prototype=Object.assign(Object.create(Ot.prototype),{constructor:n,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var i in t){var n,s=t[i];void 0===s?console.warn("THREE.Material: '"+i+"' parameter is undefined."):"shading"===i?(console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===s):void 0===(n=this[i])?console.warn("THREE."+this.type+": '"+i+"' is not a property of this material."):n&&n.isColor?n.set(s):n&&n.isVector3&&s&&s.isVector3?n.copy(s):this[i]=s}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var i=t.clippingPlanes,n=null;if(null!==i)for(var s=i.length,n=new Array(s),e=0;e!==s;++e)n[e]=i[e].clone();return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(n.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),((tn.prototype=Object.create(n.prototype)).constructor=tn).prototype.isShadowMaterial=!0,tn.prototype.copy=function(t){return n.prototype.copy.call(this,t),this.color.copy(t.color),this},((nn.prototype=Object.create(n.prototype)).constructor=nn).prototype.isSpriteMaterial=!0,nn.prototype.copy=function(t){return n.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this};var en="\nvoid main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",rn="\nvoid main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}\n";function hn(t){n.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=en,this.fragmentShader=rn,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!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,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function on(t){hn.call(this,t),this.type="RawShaderMaterial"}function an(t){n.call(this),this.type="PointsMaterial",this.color=new v(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}function un(t){n.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new v(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 v(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=z,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.vertexTangents=!1,this.setValues(t)}function cn(t){un.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new H(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(t)}function fn(t){n.call(this),this.type="MeshPhongMaterial",this.color=new v(16777215),this.specular=new v(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new v(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=z,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=W,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function ln(t){n.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new v(16777215),this.specular=new v(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new v(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=z,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function dn(t){n.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=z,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function vn(t){n.call(this),this.type="MeshLambertMaterial",this.color=new v(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new v(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=W,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function pn(t){n.call(this),this.type="MeshDepthMaterial",this.depthPacking=_,this.skinning=!1,this.morphTargets=!1,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(t)}function wn(t){n.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new g,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}function mn(t){n.call(this),this.type="MeshBasicMaterial",this.color=new v(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=W,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(t)}function bn(t){n.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new v(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=z,this.normalScale=new H(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Mn(t){n.call(this),this.type="LineBasicMaterial",this.color=new v(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(t)}function gn(t){Mn.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}function yn(t){A.call(this,t),this.textures={}}((hn.prototype=Object.create(n.prototype)).constructor=hn).prototype.isShaderMaterial=!0,hn.prototype.copy=function(t){return n.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=sn(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},((on.prototype=Object.create(hn.prototype)).constructor=on).prototype.isRawShaderMaterial=!0,((an.prototype=Object.create(n.prototype)).constructor=an).prototype.isPointsMaterial=!0,an.prototype.copy=function(t){return n.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this},((un.prototype=Object.create(n.prototype)).constructor=un).prototype.isMeshStandardMaterial=!0,un.prototype.copy=function(t){return n.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.vertexTangents=t.vertexTangents,this},((cn.prototype=Object.create(un.prototype)).constructor=cn).prototype.isMeshPhysicalMaterial=!0,cn.prototype.copy=function(t){return un.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new v).copy(t.sheen):this.sheen=null,this.transparency=t.transparency,this},((fn.prototype=Object.create(n.prototype)).constructor=fn).prototype.isMeshPhongMaterial=!0,fn.prototype.copy=function(t){return n.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((ln.prototype=Object.create(n.prototype)).constructor=ln).prototype.isMeshToonMaterial=!0,ln.prototype.copy=function(t){return n.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((dn.prototype=Object.create(n.prototype)).constructor=dn).prototype.isMeshNormalMaterial=!0,dn.prototype.copy=function(t){return n.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((vn.prototype=Object.create(n.prototype)).constructor=vn).prototype.isMeshLambertMaterial=!0,vn.prototype.copy=function(t){return n.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((pn.prototype=Object.create(n.prototype)).constructor=pn).prototype.isMeshDepthMaterial=!0,pn.prototype.copy=function(t){return n.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},((wn.prototype=Object.create(n.prototype)).constructor=wn).prototype.isMeshDistanceMaterial=!0,wn.prototype.copy=function(t){return n.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this},((mn.prototype=Object.create(n.prototype)).constructor=mn).prototype.isMeshBasicMaterial=!0,mn.prototype.copy=function(t){return n.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},((bn.prototype=Object.create(n.prototype)).constructor=bn).prototype.isMeshMatcapMaterial=!0,bn.prototype.copy=function(t){return n.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((Mn.prototype=Object.create(n.prototype)).constructor=Mn).prototype.isLineBasicMaterial=!0,Mn.prototype.copy=function(t){return n.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},((gn.prototype=Object.create(Mn.prototype)).constructor=gn).prototype.isLineDashedMaterial=!0,gn.prototype.copy=function(t){return Mn.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this},yn.prototype=Object.assign(Object.create(A.prototype),{constructor:yn,load:function(t,i,n,s){var e=this,r=new An(e.manager);r.setPath(e.path),r.load(t,function(t){i(e.parse(JSON.parse(t)))},n,s)},parse:function(t){var i=this.textures;function n(t){return void 0===i[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),i[t]}var s,e=new a[t.type];if(void 0!==t.uuid&&(e.uuid=t.uuid),void 0!==t.name&&(e.name=t.name),void 0!==t.color&&e.color.setHex(t.color),void 0!==t.roughness&&(e.roughness=t.roughness),void 0!==t.metalness&&(e.metalness=t.metalness),void 0!==t.sheen&&(e.sheen=(new v).setHex(t.sheen)),void 0!==t.emissive&&e.emissive.setHex(t.emissive),void 0!==t.specular&&e.specular.setHex(t.specular),void 0!==t.shininess&&(e.shininess=t.shininess),void 0!==t.clearcoat&&(e.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(e.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.fog&&(e.fog=t.fog),void 0!==t.flatShading&&(e.flatShading=t.flatShading),void 0!==t.blending&&(e.blending=t.blending),void 0!==t.combine&&(e.combine=t.combine),void 0!==t.side&&(e.side=t.side),void 0!==t.opacity&&(e.opacity=t.opacity),void 0!==t.transparent&&(e.transparent=t.transparent),void 0!==t.alphaTest&&(e.alphaTest=t.alphaTest),void 0!==t.depthTest&&(e.depthTest=t.depthTest),void 0!==t.depthWrite&&(e.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(e.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(e.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(e.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(e.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(e.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(e.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(e.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(e.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(e.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(e.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(e.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(e.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(e.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(e.rotation=t.rotation),1!==t.linewidth&&(e.linewidth=t.linewidth),void 0!==t.dashSize&&(e.dashSize=t.dashSize),void 0!==t.gapSize&&(e.gapSize=t.gapSize),void 0!==t.scale&&(e.scale=t.scale),void 0!==t.polygonOffset&&(e.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(e.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(e.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(e.skinning=t.skinning),void 0!==t.morphTargets&&(e.morphTargets=t.morphTargets),void 0!==t.morphNormals&&(e.morphNormals=t.morphNormals),void 0!==t.dithering&&(e.dithering=t.dithering),void 0!==t.vertexTangents&&(e.vertexTangents=t.vertexTangents),void 0!==t.visible&&(e.visible=t.visible),void 0!==t.toneMapped&&(e.toneMapped=t.toneMapped),void 0!==t.userData&&(e.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?e.vertexColors=0<t.vertexColors:e.vertexColors=t.vertexColors),void 0!==t.uniforms)for(var r in t.uniforms){var h=t.uniforms[r];switch(e.uniforms[r]={},h.type){case"t":e.uniforms[r].value=n(h.value);break;case"c":e.uniforms[r].value=(new v).setHex(h.value);break;case"v2":e.uniforms[r].value=(new H).fromArray(h.value);break;case"v3":e.uniforms[r].value=(new g).fromArray(h.value);break;case"v4":e.uniforms[r].value=(new M).fromArray(h.value);break;case"m3":e.uniforms[r].value=(new St).fromArray(h.value);case"m4":e.uniforms[r].value=(new m).fromArray(h.value);break;default:e.uniforms[r].value=h.value}}if(void 0!==t.defines&&(e.defines=t.defines),void 0!==t.vertexShader&&(e.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(e.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var o in t.extensions)e.extensions[o]=t.extensions[o];return void 0!==t.shading&&(e.flatShading=1===t.shading),void 0!==t.size&&(e.size=t.size),void 0!==t.sizeAttenuation&&(e.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(e.map=n(t.map)),void 0!==t.matcap&&(e.matcap=n(t.matcap)),void 0!==t.alphaMap&&(e.alphaMap=n(t.alphaMap)),void 0!==t.bumpMap&&(e.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(e.bumpScale=t.bumpScale),void 0!==t.normalMap&&(e.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(e.normalMapType=t.normalMapType),void 0!==t.normalScale&&(s=t.normalScale,!1===Array.isArray(s)&&(s=[s,s]),e.normalScale=(new H).fromArray(s)),void 0!==t.displacementMap&&(e.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(e.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(e.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(e.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(e.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(e.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(e.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(e.specularMap=n(t.specularMap)),void 0!==t.envMap&&(e.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(e.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(e.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(e.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(e.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(e.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(e.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(e.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(e.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatMap&&(e.clearcoatMap=n(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap=n(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(e.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(e.clearcoatNormalScale=(new H).fromArray(t.clearcoatNormalScale)),e},setTextures:function(t){return this.textures=t,this}});var En,Tn,kn,On;function A(t){this.manager=void 0!==t?t:_i,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}Object.assign(A.prototype,{load:function(){},parse:function(){},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this}}),Object.assign(A.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(t,i,n){for(var s=[],e=0;e<t.length;++e)s[e]=this.createMaterial(t[e],i,n);return s},createMaterial:(En={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},Tn=new v,kn=new $i,On=new yn,function(t,h,o){var a={};function i(t,i,n,s,e){var t=h+t,r=(new Gi).getHandler(t),r=(null!==r?r:(kn.setCrossOrigin(o),kn)).load(t),t=(void 0!==i&&(r.repeat.fromArray(i),1!==i[0]&&(r.wrapS=1e3),1!==i[1])&&(r.wrapT=1e3),void 0!==n&&r.offset.fromArray(n),void 0!==s&&("repeat"===s[0]&&(r.wrapS=1e3),"mirror"===s[0]&&(r.wrapS=1002),"repeat"===s[1]&&(r.wrapT=1e3),"mirror"===s[1])&&(r.wrapT=1002),void 0!==e&&(r.anisotropy=e),w.generateUUID());return a[t]=r,t}var n,s={uuid:w.generateUUID(),type:"MeshLambertMaterial"};for(n in t){var e=t[n];switch(n){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":s.name=e;break;case"blending":s.blending=En[e];break;case"colorAmbient":case"mapAmbient":break;case"colorDiffuse":s.color=Tn.fromArray(e).getHex();break;case"colorSpecular":s.specular=Tn.fromArray(e).getHex();break;case"colorEmissive":s.emissive=Tn.fromArray(e).getHex();break;case"specularCoef":s.shininess=e;break;case"shading":"basic"===e.toLowerCase()&&(s.type="MeshBasicMaterial"),"phong"===e.toLowerCase()&&(s.type="MeshPhongMaterial"),"standard"===e.toLowerCase()&&(s.type="MeshStandardMaterial");break;case"mapDiffuse":s.map=i(e,t.mapDiffuseRepeat,t.mapDiffuseOffset,t.mapDiffuseWrap,t.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":s.emissiveMap=i(e,t.mapEmissiveRepeat,t.mapEmissiveOffset,t.mapEmissiveWrap,t.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":s.lightMap=i(e,t.mapLightRepeat,t.mapLightOffset,t.mapLightWrap,t.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":s.aoMap=i(e,t.mapAORepeat,t.mapAOOffset,t.mapAOWrap,t.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":s.bumpMap=i(e,t.mapBumpRepeat,t.mapBumpOffset,t.mapBumpWrap,t.mapBumpAnisotropy);break;case"mapBumpScale":s.bumpScale=e;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":s.normalMap=i(e,t.mapNormalRepeat,t.mapNormalOffset,t.mapNormalWrap,t.mapNormalAnisotropy);break;case"mapNormalFactor":s.normalScale=e;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":s.specularMap=i(e,t.mapSpecularRepeat,t.mapSpecularOffset,t.mapSpecularWrap,t.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":s.metalnessMap=i(e,t.mapMetalnessRepeat,t.mapMetalnessOffset,t.mapMetalnessWrap,t.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":s.roughnessMap=i(e,t.mapRoughnessRepeat,t.mapRoughnessOffset,t.mapRoughnessWrap,t.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":s.alphaMap=i(e,t.mapAlphaRepeat,t.mapAlphaOffset,t.mapAlphaWrap,t.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":s.side=1;break;case"doubleSided":s.side=2;break;case"transparency":s.opacity=e;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":s[n]=e;break;case"vertexColors":!0===e&&(s.vertexColors=2),"face"===e&&(s.vertexColors=1)}}return"MeshBasicMaterial"===s.type&&delete s.emissive,"MeshPhongMaterial"!==s.type&&delete s.specular,s.opacity<1&&(s.transparent=!0),On.setTextures(a),On.parse(s)})});var j={};function An(t){A.call(this,t)}An.prototype=Object.assign(Object.create(A.prototype),{constructor:An,load:function(h,t,i,n){void 0===h&&(h=""),void 0!==this.path&&(h=this.path+h),h=this.manager.resolveURL(h);var o=this,s=Wi.get(h);if(void 0!==s)return setTimeout(function(){t&&t(s)},0),s;if(void 0===j[h]){var e=h.match(/^data:(.*?)(;base64)?,(.*)$/);if(e){var r=e[1],a=!!e[2],u=e[3],u=decodeURIComponent(u);a&&(u=atob(u));try{var c=(this.responseType||"").toLowerCase();switch(c){case"arraybuffer":case"blob":for(var f=new Uint8Array(u.length),l=0;l<u.length;l++)f[l]=u.charCodeAt(l);d="blob"===c?new Blob([f.buffer],{type:r}):f.buffer;break;case"document":var d=(new DOMParser).parseFromString(u,r);break;case"json":d=JSON.parse(u);break;default:d=u}setTimeout(function(){t&&t(d),o.manager.itemEnd(h)},0)}catch(t){setTimeout(function(){n&&n(t),o.manager.itemError(h),o.manager.itemEnd(h)},0)}}else{j[h]=[],j[h].push({onLoad:t,onProgress:i,onError:n});var v,p=new Zi.XMLHttpRequest;for(v in p.open("GET",h,!0),p.addEventListener("load",function(t){var i=this.response,n=j[h];if(delete j[h],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Wi.add(h,i);for(var s=0,e=n.length;s<e;s++)(r=n[s]).onLoad&&r.onLoad(i)}else{for(var r,s=0,e=n.length;s<e;s++)(r=n[s]).onError&&r.onError(t);o.manager.itemError(h)}o.manager.itemEnd(h)},!1),p.addEventListener("progress",function(t){for(var i=j[h],n=0,s=i.length;n<s;n++){var e=i[n];e.onProgress&&e.onProgress(t)}},!1),p.addEventListener("error",function(t){var i=j[h];delete j[h];for(var n=0,s=i.length;n<s;n++){var e=i[n];e.onError&&e.onError(t)}o.manager.itemError(h),o.manager.itemEnd(h)},!1),p.addEventListener("abort",function(t){var i=j[h];delete j[h];for(var n=0,s=i.length;n<s;n++){var e=i[n];e.onError&&e.onError(t)}o.manager.itemError(h),o.manager.itemEnd(h)},!1),void 0!==this.responseType&&(p.responseType=this.responseType),void 0!==this.withCredentials&&(p.withCredentials=this.withCredentials),p.overrideMimeType&&p.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)p.setRequestHeader(v,this.requestHeader[v]);p.send(null)}return o.manager.itemStart(h),p}j[h].push({onLoad:t,onProgress:i,onError:n})},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this},dispose:function(){j={}}});var jn={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var i="",n=0,s=t.length;n<s;n++)i+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(i))}catch(t){return i}},extractUrlBase:function(t){var i=t.lastIndexOf("/");return-1===i?"./":t.substr(0,i+1)}};function Rn(){f.call(this),this.type="Bone"}function Sn(){f.call(this),this.type="Group"}Rn.prototype=Object.assign(Object.create(f.prototype),{constructor:Rn,isBone:!0}),Sn.prototype=Object.assign(Object.create(f.prototype),{constructor:Sn,isGroup:!0});var xn=new g,Bn=new g,Pn=new g,Ln=new g,Hn=new g,Fn=new g,Cn=new g;function In(t,i){this.origin=void 0!==t?t:new g,this.direction=void 0!==i?i:new g(0,0,-1)}Object.assign(In.prototype,{set:function(t,i){return this.origin.copy(t),this.direction.copy(i),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,i){return void 0===i&&(console.warn("THREE.Ray: .at() target is now required"),i=new g),i.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(t){return this.origin.copy(this.at(t,xn)),this},closestPointToPoint:function(t,i){void 0===i&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),i=new g),i.subVectors(t,this.origin);t=i.dot(this.direction);return t<0?i.copy(this.origin):i.copy(this.direction).multiplyScalar(t).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(t){var i=xn.subVectors(t,this.origin).dot(this.direction);return(i<0?this.origin:(xn.copy(this.direction).multiplyScalar(i).add(this.origin),xn)).distanceToSquared(t)},distanceSqToSegment:function(t,i,n,s){Bn.copy(t).add(i).multiplyScalar(.5),Pn.copy(i).sub(t).normalize(),Ln.copy(this.origin).sub(Bn);var e,r,h,t=.5*t.distanceTo(i),i=-this.direction.dot(Pn),o=Ln.dot(this.direction),a=-Ln.dot(Pn),u=Ln.lengthSq(),c=Math.abs(1-i*i);return c=0<c?(r=i*o-a,h=t*c,0<=(e=i*a-o)?-h<=r?r<=h?(e*=c=1/c)*(e+i*(r*=c)+2*o)+r*(i*e+r+2*a)+u:(r=t,-(e=Math.max(0,-(i*r+o)))*e+r*(r+2*a)+u):(r=-t,-(e=Math.max(0,-(i*r+o)))*e+r*(r+2*a)+u):r<=-h?-(e=Math.max(0,-(-i*t+o)))*e+(r=0<e?-t:Math.min(Math.max(-t,-a),t))*(r+2*a)+u:r<=h?(e=0,(r=Math.min(Math.max(-t,-a),t))*(r+2*a)+u):-(e=Math.max(0,-(i*t+o)))*e+(r=0<e?t:Math.min(Math.max(-t,-a),t))*(r+2*a)+u):(r=0<i?-t:t,-(e=Math.max(0,-(i*r+o)))*e+r*(r+2*a)+u),n&&n.copy(this.direction).multiplyScalar(e).add(this.origin),s&&s.copy(Pn).multiplyScalar(r).add(Bn),c},intersectSphere:function(t,i){xn.subVectors(t.center,this.origin);var n=xn.dot(this.direction),s=xn.dot(xn)-n*n,t=t.radius*t.radius;return t<s||(s=n+(t=Math.sqrt(t-s)),(n=n-t)<0&&s<0)?null:n<0?this.at(s,i):this.at(n,i)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var i=t.normal.dot(this.direction);return 0===i?0===t.distanceToPoint(this.origin)?0:null:0<=(t=-(this.origin.dot(t.normal)+t.constant)/i)?t:null},intersectPlane:function(t,i){t=this.distanceToPlane(t);return null===t?null:this.at(t,i)},intersectsPlane:function(t){var i=t.distanceToPoint(this.origin);return 0===i||t.normal.dot(this.direction)*i<0},intersectBox:function(t,i){var n,s,e,r=1/this.direction.x,h=1/this.direction.y,o=1/this.direction.z,a=this.origin,r=0<=r?(n=(t.min.x-a.x)*r,(t.max.x-a.x)*r):(n=(t.max.x-a.x)*r,(t.min.x-a.x)*r),h=0<=h?(e=(t.min.y-a.y)*h,(t.max.y-a.y)*h):(e=(t.max.y-a.y)*h,(t.min.y-a.y)*h);return h<n||r<e||((n<e||n!=n)&&(n=e),(h<r||r!=r)&&(r=h),(e=0<=o?(s=(t.min.z-a.z)*o,(t.max.z-a.z)*o):(s=(t.max.z-a.z)*o,(t.min.z-a.z)*o))<n)||r<s||((n<s||n!=n)&&(n=s),(r=e<r||r!=r?e:r)<0)?null:this.at(0<=n?n:r,i)},intersectsBox:function(t){return null!==this.intersectBox(t,xn)},intersectTriangle:function(t,i,n,s,e){Hn.subVectors(i,t),Fn.subVectors(n,t),Cn.crossVectors(Hn,Fn);var r,i=this.direction.dot(Cn);if(0<i){if(s)return null;r=1}else{if(!(i<0))return null;r=-1,i=-i}Ln.subVectors(this.origin,t);n=r*this.direction.dot(Fn.crossVectors(Ln,Fn));return n<0||(s=r*this.direction.dot(Hn.cross(Ln)))<0||i<n+s||(t=-r*Ln.dot(Cn))<0?null:this.at(t/i,e)},applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}});var Nn=new g,Dn=new g,Vn=new m,Xn=new In,Un=new yi;function qn(t,i,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),f.call(this),this.type="Line",this.geometry=void 0!==t?t:new Ri,this.material=void 0!==i?i:new Mn}qn.prototype=Object.assign(Object.create(f.prototype),{constructor:qn,isLine:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var i=t.attributes.position,n=[0],s=1,e=i.count;s<e;s++)Nn.fromBufferAttribute(i,s-1),Dn.fromBufferAttribute(i,s),n[s]=n[s-1],n[s]+=Nn.distanceTo(Dn);t.setAttribute("lineDistance",new E(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var r=t.vertices;(n=t.lineDistances)[0]=0;for(s=1,e=r.length;s<e;s++)n[s]=n[s-1],n[s]+=r[s-1].distanceTo(r[s])}return this},raycast:function(t,i){var n=this.geometry,s=this.matrixWorld,e=t.params.Line.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Un.copy(n.boundingSphere),Un.applyMatrix4(s),Un.radius+=e,!1!==t.ray.intersectsSphere(Un)){Vn.getInverse(s),Xn.copy(t.ray).applyMatrix4(Vn);var s=e/((this.scale.x+this.scale.y+this.scale.z)/3),r=s*s,h=new g,o=new g,a=new g,u=new g,c=this&&this.isLineSegments?2:1;if(n.isBufferGeometry){var e=n.index,f=n.attributes.position.array;if(null!==e)for(var l=e.array,d=0,v=l.length-1;d<v;d+=c){var p=l[d],w=l[d+1];h.fromArray(f,3*p),o.fromArray(f,3*w),r<Xn.distanceSqToSegment(h,o,u,a)||(u.applyMatrix4(this.matrixWorld),(m=t.ray.origin.distanceTo(u))<t.near)||m>t.far||i.push({distance:m,point:a.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this})}else for(d=0,v=f.length/3-1;d<v;d+=c)h.fromArray(f,3*d),o.fromArray(f,3*d+3),r<Xn.distanceSqToSegment(h,o,u,a)||(u.applyMatrix4(this.matrixWorld),(m=t.ray.origin.distanceTo(u))<t.near)||m>t.far||i.push({distance:m,point:a.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this})}else if(n.isGeometry)for(var m,b=n.vertices,M=b.length,d=0;d<M-1;d+=c)r<Xn.distanceSqToSegment(b[d],b[d+1],u,a)||(u.applyMatrix4(this.matrixWorld),(m=t.ray.origin.distanceTo(u))<t.near)||m>t.far||i.push({distance:m,point:a.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this})}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var R=new g,Yn=new g,Zn=new g,Wn=new g,Gn=new g,_n=new g,zn=new g,Kn=new g,Qn=new g,$n=new g;function F(t,i,n){this.a=void 0!==t?t:new g,this.b=void 0!==i?i:new g,this.c=void 0!==n?n:new g}function Jn(t,i,n,s,e,r){this.a=t,this.b=i,this.c=n,this.normal=s&&s.isVector3?s:new g,this.vertexNormals=Array.isArray(s)?s:[],this.color=e&&e.isColor?e:new v,this.vertexColors=Array.isArray(e)?e:[],this.materialIndex=void 0!==r?r:0}Object.assign(F,{getNormal:function(t,i,n,s){void 0===s&&(console.warn("THREE.Triangle: .getNormal() target is now required"),s=new g),s.subVectors(n,i),R.subVectors(t,i),s.cross(R);n=s.lengthSq();return 0<n?s.multiplyScalar(1/Math.sqrt(n)):s.set(0,0,0)},getBarycoord:function(t,i,n,s,e){R.subVectors(s,i),Yn.subVectors(n,i),Zn.subVectors(t,i);var s=R.dot(R),n=R.dot(Yn),t=R.dot(Zn),i=Yn.dot(Yn),r=Yn.dot(Zn),h=s*i-n*n;return void 0===e&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),e=new g),0==h?e.set(-2,-1,-1):e.set(1-(i=(i*t-n*r)*(e=1/h))-(h=(s*r-n*t)*e),h,i)},containsPoint:function(t,i,n,s){return F.getBarycoord(t,i,n,s,Wn),0<=Wn.x&&0<=Wn.y&&Wn.x+Wn.y<=1},getUV:function(t,i,n,s,e,r,h,o){return this.getBarycoord(t,i,n,s,Wn),o.set(0,0),o.addScaledVector(e,Wn.x),o.addScaledVector(r,Wn.y),o.addScaledVector(h,Wn.z),o},isFrontFacing:function(t,i,n,s){return R.subVectors(n,i),Yn.subVectors(t,i),R.cross(Yn).dot(s)<0}}),Object.assign(F.prototype,{set:function(t,i,n){return this.a.copy(t),this.b.copy(i),this.c.copy(n),this},setFromPointsAndIndices:function(t,i,n,s){return this.a.copy(t[i]),this.b.copy(t[n]),this.c.copy(t[s]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){return R.subVectors(this.c,this.b),Yn.subVectors(this.a,this.b),.5*R.cross(Yn).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new g),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return F.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new Li),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,i){return F.getBarycoord(t,this.a,this.b,this.c,i)},getUV:function(t,i,n,s,e){return F.getUV(t,this.a,this.b,this.c,i,n,s,e)},containsPoint:function(t){return F.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return F.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,i){void 0===i&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),i=new g);var n=this.a,s=this.b,e=this.c,r=(Gn.subVectors(s,n),_n.subVectors(e,n),Kn.subVectors(t,n),Gn.dot(Kn)),h=_n.dot(Kn);if(r<=0&&h<=0)return i.copy(n);Qn.subVectors(t,s);var o=Gn.dot(Qn),a=_n.dot(Qn);if(0<=o&&a<=o)return i.copy(s);var u=r*a-o*h;if(u<=0&&0<=r&&o<=0)return c=r/(r-o),i.copy(n).addScaledVector(Gn,c);$n.subVectors(t,e);var c,f,t=Gn.dot($n),l=_n.dot($n);return 0<=l&&t<=l?i.copy(e):(r=t*h-r*l)<=0&&0<=h&&l<=0?(f=h/(h-l),i.copy(n).addScaledVector(_n,f)):(h=o*l-t*a)<=0&&0<=a-o&&0<=t-l?(zn.subVectors(e,s),f=(a-o)/(a-o+(t-l)),i.copy(s).addScaledVector(zn,f)):(c=r*(e=1/(h+r+u)),f=u*e,i.copy(n).addScaledVector(Gn,c).addScaledVector(_n,f))},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),Object.assign(Jn.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var i=0,n=t.vertexNormals.length;i<n;i++)this.vertexNormals[i]=t.vertexNormals[i].clone();for(i=0,n=t.vertexColors.length;i<n;i++)this.vertexColors[i]=t.vertexColors[i].clone();return this}});var ts=new m,is=new In,ns=new yi,ss=new g,es=new g,rs=new g,hs=new g,os=new g,as=new g,us=new g,cs=new g,fs=new g,ls=new H,ds=new H,vs=new H,ps=new g,ws=new g;function ms(t,i){f.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new Ri,this.material=void 0!==i?i:new mn,this.updateMorphTargets()}function bs(t,i,n,s,e,r,h,o){s=i.side===D?s.intersectTriangle(h,r,e,!0,o):s.intersectTriangle(e,r,h,i.side!==V,o);if(null===s)return null;ws.copy(o),ws.applyMatrix4(t.matrixWorld);e=n.ray.origin.distanceTo(ws);return e<n.near||e>n.far?null:{distance:e,point:ws.clone(),object:t}}function Ms(t,i,n,s,e,r,h,o,a,u,c,f){ss.fromBufferAttribute(e,u),es.fromBufferAttribute(e,c),rs.fromBufferAttribute(e,f);var l=t.morphTargetInfluences;if(i.morphTargets&&r&&l){us.set(0,0,0),cs.set(0,0,0),fs.set(0,0,0);for(var d=0,v=r.length;d<v;d++){var p=l[d],w=r[d];0!==p&&(hs.fromBufferAttribute(w,u),os.fromBufferAttribute(w,c),as.fromBufferAttribute(w,f),h?(us.addScaledVector(hs,p),cs.addScaledVector(os,p),fs.addScaledVector(as,p)):(us.addScaledVector(hs.sub(ss),p),cs.addScaledVector(os.sub(es),p),fs.addScaledVector(as.sub(rs),p)))}ss.add(us),es.add(cs),rs.add(fs)}e=bs(t,i,n,s,ss,es,rs,ps);return e&&(o&&(ls.fromBufferAttribute(o,u),ds.fromBufferAttribute(o,c),vs.fromBufferAttribute(o,f),e.uv=F.getUV(ps,ss,es,rs,ls,ds,vs,new H)),a&&(ls.fromBufferAttribute(a,u),ds.fromBufferAttribute(a,c),vs.fromBufferAttribute(a,f),e.uv2=F.getUV(ps,ss,es,rs,ls,ds,vs,new H)),t=new Jn(u,c,f),F.getNormal(ss,es,rs,t.normal),e.face=t),e}ms.prototype=Object.assign(Object.create(f.prototype),{constructor:ms,isMesh:!0,copy:function(t){return f.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,i,n,s=this.geometry;if(s.isBufferGeometry){var e=s.morphAttributes,r=Object.keys(e);if(0<r.length){var h=e[r[0]];if(void 0!==h)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,i=h.length;t<i;t++)n=h[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{e=s.morphTargets;void 0!==e&&0<e.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,i){var n=this.geometry,s=this.material,e=this.matrixWorld;if(void 0!==s&&(null===n.boundingSphere&&n.computeBoundingSphere(),ns.copy(n.boundingSphere),ns.applyMatrix4(e),!1!==t.ray.intersectsSphere(ns)&&(ts.getInverse(e),is.copy(t.ray).applyMatrix4(ts),null===n.boundingBox||!1!==is.intersectsBox(n.boundingBox))))if(n.isBufferGeometry){var r,h,o,a,u,c,f,l,d,v=n.index,p=n.attributes.position,w=n.morphAttributes.position,m=n.morphTargetsRelative,b=n.attributes.uv,M=n.attributes.uv2,g=n.groups,y=n.drawRange;if(null!==v)if(Array.isArray(s))for(a=0,c=g.length;a<c;a++)for(d=s[(l=g[a]).materialIndex],u=Math.max(l.start,y.start),f=Math.min(l.start+l.count,y.start+y.count);u<f;u+=3)r=v.getX(u),h=v.getX(u+1),o=v.getX(u+2),(B=Ms(this,d,t,is,p,w,m,b,M,r,h,o))&&(B.faceIndex=Math.floor(u/3),B.face.materialIndex=l.materialIndex,i.push(B));else for(a=Math.max(0,y.start),c=Math.min(v.count,y.start+y.count);a<c;a+=3)r=v.getX(a),h=v.getX(a+1),o=v.getX(a+2),(B=Ms(this,s,t,is,p,w,m,b,M,r,h,o))&&(B.faceIndex=Math.floor(a/3),i.push(B));else if(void 0!==p)if(Array.isArray(s))for(a=0,c=g.length;a<c;a++)for(d=s[(l=g[a]).materialIndex],u=Math.max(l.start,y.start),f=Math.min(l.start+l.count,y.start+y.count);u<f;u+=3)(B=Ms(this,d,t,is,p,w,m,b,M,r=u,h=u+1,o=u+2))&&(B.faceIndex=Math.floor(u/3),B.face.materialIndex=l.materialIndex,i.push(B));else for(a=Math.max(0,y.start),c=Math.min(p.count,y.start+y.count);a<c;a+=3)(B=Ms(this,s,t,is,p,w,m,b,M,r=a,h=a+1,o=a+2))&&(B.faceIndex=Math.floor(a/3),i.push(B))}else if(n.isGeometry){var E,T=Array.isArray(s),k=n.vertices,O=n.faces,e=n.faceVertexUvs[0];0<e.length&&(E=e);for(var A=0,j=O.length;A<j;A++){var R,S,x,B,P=O[A],L=T?s[P.materialIndex]:s;void 0!==L&&(R=k[P.a],S=k[P.b],x=k[P.c],B=bs(this,L,t,is,R,S,x,ps))&&(E&&E[A]&&(L=E[A],ls.copy(L[0]),ds.copy(L[1]),vs.copy(L[2]),B.uv=F.getUV(ps,R,S,x,ls,ds,vs,new H)),B.face=P,B.faceIndex=A,i.push(B))}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var gs=new m,ys=new m;function Es(t,i){if(this.bones=(t=t||[]).slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===i)this.calculateInverses();else if(this.bones.length===i.length)this.boneInverses=i.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,s=this.bones.length;n<s;n++)this.boneInverses.push(new m)}}function Ts(t,i){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),ms.call(this,t,i),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new m,this.bindMatrixInverse=new m}Object.assign(Es.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,i=this.bones.length;t<i;t++){var n=new m;this.bones[t]&&n.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(n)}},pose:function(){for(var t,i=0,n=this.bones.length;i<n;i++)(t=this.bones[i])&&t.matrixWorld.getInverse(this.boneInverses[i]);for(i=0,n=this.bones.length;i<n;i++)(t=this.bones[i])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:function(){for(var t=this.bones,i=this.boneInverses,n=this.boneMatrices,s=this.boneTexture,e=0,r=t.length;e<r;e++){var h=t[e]?t[e].matrixWorld:ys;gs.multiplyMatrices(h,i[e]),gs.toArray(n,16*e)}void 0!==s&&(s.needsUpdate=!0)},clone:function(){return new Es(this.bones,this.boneInverses)},getBoneByName:function(t){for(var i=0,n=this.bones.length;i<n;i++){var s=this.bones[i];if(s.name===t)return s}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}}),Ts.prototype=Object.assign(Object.create(ms.prototype),{constructor:Ts,isSkinnedMesh:!0,bind:function(t,i){this.skeleton=t,void 0===i&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),i=this.matrixWorld),this.bindMatrix.copy(i),this.bindMatrixInverse.getInverse(i)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new M,i=this.geometry.attributes.skinWeight,n=0,s=i.count;n<s;n++){t.x=i.getX(n),t.y=i.getY(n),t.z=i.getZ(n),t.w=i.getW(n);var e=1/t.manhattanLength();e!=1/0?t.multiplyScalar(e):t.set(1,0,0,0),i.setXYZW(n,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){ms.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var t={},ks=void 0,Os=t;function As(t,i){var n,s=t.split("."),e=Os;s[0]in e||!e.execScript||e.execScript("var "+s[0]);for(;s.length&&(n=s.shift());)s.length||i===ks?e=e[n]||(e[n]={}):e[n]=i}var S="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array&&"undefined"!=typeof DataView;function js(t){for(var i,n,s,e,r,h,o,a,u,c=t.length,f=0,l=Number.POSITIVE_INFINITY,d=0;d<c;++d)t[d]>f&&(f=t[d]),t[d]<l&&(l=t[d]);for(i=1<<f,n=new(S?Uint32Array:Array)(i),s=1,e=0,r=2;s<=f;){for(d=0;d<c;++d)if(t[d]===s){for(o=e,a=h=0;a<s;++a)h=h<<1|1&o,o>>=1;for(u=s<<16|d,a=h;a<i;a+=r)n[a]=u;++e}++s,e<<=1,r<<=1}return[n,f,l]}function Rs(t,i){switch(this.g=[],this.h=32768,this.d=this.f=this.a=this.l=0,this.input=S?new Uint8Array(t):t,this.m=!1,this.i=1,this.r=!1,(i?(i.index&&(this.a=i.index),i.bufferSize&&(this.h=i.bufferSize),i.bufferType&&(this.i=i.bufferType),i.resize):(i={},0))&&(this.r=i.resize),this.i){case 0:this.b=32768,this.c=new(S?Uint8Array:Array)(32768+this.h+258);break;case 1:this.b=0,this.c=new(S?Uint8Array:Array)(this.h),this.e=this.z,this.n=this.v,this.j=this.w;break;default:throw Error("invalid inflate mode")}}for(var vt=0,dt=1,i=(Rs.prototype.k=function(){for(;!this.m;){var t=x(this,3);switch(1&t&&(this.m=!0),t>>>=1){case 0:var i=this.input,n=this.a,s=this.c,e=this.b,r=i.length,h=ks,o=s.length,a=ks;if(this.d=this.f=0,r<=n+1)throw Error("invalid uncompressed block header: LEN");if(h=i[n++]|i[n++]<<8,r<=n+1)throw Error("invalid uncompressed block header: NLEN");if(h===~(i[n++]|i[n++]<<8))throw Error("invalid uncompressed block header: length verify");if(n+h>i.length)throw Error("input buffer is broken");switch(this.i){case 0:for(;e+h>s.length;){if(h-=a=o-e,S)s.set(i.subarray(n,n+a),e),e+=a,n+=a;else for(;a--;)s[e++]=i[n++];this.b=e,s=this.e(),e=this.b}break;case 1:for(;e+h>s.length;)s=this.e({p:2});break;default:throw Error("invalid inflate mode")}if(S)s.set(i.subarray(n,n+h),e),e+=h,n+=h;else for(;h--;)s[e++]=i[n++];this.a=n,this.b=e,this.c=s;break;case 1:this.j(Is,Xs);break;case 2:for(var u,c,f,l,r=x(this,5)+257,d=x(this,5)+1,v=x(this,4)+4,p=new(S?Uint8Array:Array)(Ss.length),w=ks,m=ks,b=ks,M=ks,M=0;M<v;++M)p[Ss[M]]=x(this,3);if(!S)for(M=v,v=p.length;M<v;++M)p[Ss[M]]=0;for(u=js(p),w=new(S?Uint8Array:Array)(r+d),M=0,l=r+d;M<l;)switch(f=Us(this,u),f){case 16:for(b=3+x(this,2);b--;)w[M++]=m;break;case 17:for(b=3+x(this,3);b--;)w[M++]=0;m=0;break;case 18:for(b=11+x(this,7);b--;)w[M++]=0;m=0;break;default:m=w[M++]=f}d=js(S?w.subarray(0,r):w.slice(0,r)),c=js(S?w.subarray(r):w.slice(r)),this.j(d,c);break;default:throw Error("unknown BTYPE: "+t)}}return this.n()},[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ss=S?new Uint16Array(i):i,i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],xs=S?new Uint16Array(i):i,i=[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],Bs=S?new Uint8Array(i):i,i=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Ps=S?new Uint16Array(i):i,i=[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],Ls=S?new Uint8Array(i):i,Hs=new(S?Uint8Array:Array)(288),Fs=0,Cs=Hs.length;Fs<Cs;++Fs)Hs[Fs]=Fs<=143?8:Fs<=255?9:Fs<=279?7:8;for(var Is=js(Hs),Ns=new(S?Uint8Array:Array)(30),Ds=0,Vs=Ns.length;Ds<Vs;++Ds)Ns[Ds]=5;var Xs=js(Ns);function x(t,i){for(var n,s=t.f,e=t.d,r=t.input,h=t.a,o=r.length;e<i;){if(o<=h)throw Error("input buffer is broken");s|=r[h++]<<e,e+=8}return n=s&(1<<i)-1,t.f=s>>>i,t.d=e-i,t.a=h,n}function Us(t,i){for(var n=t.f,s=t.d,e=t.input,r=t.a,h=e.length,o=i[0],a=i[1];s<a&&!(h<=r);)n|=e[r++]<<s,s+=8;if(s<(o=(i=o[n&(1<<a)-1])>>>16))throw Error("invalid code length: "+o);return t.f=n>>o,t.d=s-o,t.a=r,65535&i}function qs(t,i){var n,s;if(this.input=t,this.a=0,(i?(i.index&&(this.a=i.index),i.verify):(i={},0))&&(this.A=i.verify),n=t[this.a++],s=t[this.a++],(15&n)!==_s)throw Error("unsupported compression method");if(this.method=_s,0!=((n<<8)+s)%31)throw Error("invalid fcheck flag:"+((n<<8)+s)%31);if(32&s)throw Error("fdict flag is not supported");this.q=new Rs(t,{index:this.a,bufferSize:i.bufferSize,bufferType:i.bufferType,resize:i.resize})}Rs.prototype.j=function(t,i){var n=this.c,s=this.b;this.o=t;for(var e,r,h,o,a=n.length-258;256!==(e=Us(this,t));)if(e<256)a<=s&&(this.b=s,n=this.e(),s=this.b),n[s++]=e;else for(o=xs[r=e-257],0<Bs[r]&&(o+=x(this,Bs[r])),e=Us(this,i),h=Ps[e],0<Ls[e]&&(h+=x(this,Ls[e])),a<=s&&(this.b=s,n=this.e(),s=this.b);o--;)n[s]=n[s++-h];for(;8<=this.d;)this.d-=8,this.a--;this.b=s},Rs.prototype.w=function(t,i){var n=this.c,s=this.b;this.o=t;for(var e,r,h,o,a=n.length;256!==(e=Us(this,t));)if(e<256)a<=s&&(a=(n=this.e()).length),n[s++]=e;else for(o=xs[r=e-257],0<Bs[r]&&(o+=x(this,Bs[r])),e=Us(this,i),h=Ps[e],0<Ls[e]&&(h+=x(this,Ls[e])),a<s+o&&(a=(n=this.e()).length);o--;)n[s]=n[s++-h];for(;8<=this.d;)this.d-=8,this.a--;this.b=s},Rs.prototype.e=function(){var t,i,n=new(S?Uint8Array:Array)(this.b-32768),s=this.b-32768,e=this.c;if(S)n.set(e.subarray(32768,n.length));else for(t=0,i=n.length;t<i;++t)n[t]=e[t+32768];if(this.g.push(n),this.l+=n.length,S)e.set(e.subarray(s,32768+s));else for(t=0;t<32768;++t)e[t]=e[s+t];return this.b=32768,e},Rs.prototype.z=function(t){var i,n=this.input.length/this.a+1|0,s=this.input,e=this.c;return t&&("number"==typeof t.p&&(n=t.p),"number"==typeof t.u)&&(n+=t.u),s=n<2?(t=(s.length-this.a)/this.o[2]/2*258|0)<e.length?e.length+t:e.length<<1:e.length*n,S?(i=new Uint8Array(s)).set(e):i=e,this.c=i},Rs.prototype.n=function(){var t,i,n,s,e,r=0,h=this.c,o=this.g,a=new(S?Uint8Array:Array)(this.l+(this.b-32768));if(0===o.length)return S?this.c.subarray(32768,this.b):this.c.slice(32768,this.b);for(i=0,n=o.length;i<n;++i)for(s=0,e=(t=o[i]).length;s<e;++s)a[r++]=t[s];for(i=32768,n=this.b;i<n;++i)a[r++]=h[i];return this.g=[],this.buffer=a},Rs.prototype.v=function(){var t,i=this.b;return S?this.r?(t=new Uint8Array(i)).set(this.c.subarray(0,i)):t=this.c.subarray(0,i):(this.c.length>i&&(this.c.length=i),t=this.c),this.buffer=t},qs.prototype.k=function(){var t=this.input,i=this.q.k();if(this.a=this.q.a,this.A){var t=(t[this.a++]<<24|t[this.a++]<<16|t[this.a++]<<8|t[this.a++])>>>0,n=i;if("string"==typeof n){for(var s=n.split(""),e=0,r=s.length;e<r;e++)s[e]=(255&s[e].charCodeAt(0))>>>0;n=s}for(var h,o=1,a=0,u=n.length,c=0;0<u;){for(u-=h=1024<u?1024:u;a+=o+=n[c++],--h;);o%=65521,a%=65521}if(t!=(a<<16|o)>>>0)throw Error("invalid adler-32 checksum")}return i};var Ys,Zs,Ws,Gs,_s=8,zs=(As("Zlib.Inflate",qs),As("Zlib.Inflate.prototype.decompress",qs.prototype.k),{ADAPTIVE:dt,BLOCK:vt});if(Object.keys)Ys=Object.keys(zs);else for(Zs in Ys=[],Ws=0,zs)Ys[Ws++]=Zs;for(Ws=0,Gs=Ys.length;Ws<Gs;++Ws)As("Zlib.Inflate.BufferType."+(Zs=Ys[Ws]),zs[Zs]);var Ks=t.Zlib;function Qs(){this.type="Curve",this.arcLengthDivisions=200}Object.assign(Qs.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,i){t=this.getUtoTmapping(t);return this.getPoint(t,i)},getPoints:function(t){void 0===t&&(t=5);for(var i=[],n=0;n<=t;n++)i.push(this.getPoint(n/t));return i},getSpacedPoints:function(t){void 0===t&&(t=5);for(var i=[],n=0;n<=t;n++)i.push(this.getPointAt(n/t));return i},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var i,n,s=[],e=this.getPoint(0),r=0;for(s.push(0),n=1;n<=t;n++)r+=(i=this.getPoint(n/t)).distanceTo(e),s.push(r),e=i;return this.cacheArcLengths=s},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,i){for(var n,s=this.getLengths(),e=0,r=s.length,h=i||t*s[r-1],o=0,a=r-1;o<=a;)if((n=s[e=Math.floor(o+(a-o)/2)]-h)<0)o=e+1;else{if(!(0<n)){a=e;break}a=e-1}return s[e=a]===h?e/(r-1):(e+(h-(i=s[e]))/(s[e+1]-i))/(r-1)},getTangent:function(t){var i=t-1e-4,t=t+1e-4,i=(1<t&&(t=1),this.getPoint(i=i<0?0:i));return this.getPoint(t).clone().sub(i).normalize()},getTangentAt:function(t){t=this.getUtoTmapping(t);return this.getTangent(t)},computeFrenetFrames:function(t,i){for(var n,s=new g,e=[],r=[],h=[],o=new g,a=new m,u=0;u<=t;u++)e[u]=this.getTangentAt(u/t),e[u].normalize();r[0]=new g,h[0]=new g;var c=Number.MAX_VALUE,f=Math.abs(e[0].x),l=Math.abs(e[0].y),d=Math.abs(e[0].z);for(f<=c&&(c=f,s.set(1,0,0)),l<=c&&(c=l,s.set(0,1,0)),d<=c&&s.set(0,0,1),o.crossVectors(e[0],s).normalize(),r[0].crossVectors(e[0],o),h[0].crossVectors(e[0],r[0]),u=1;u<=t;u++)r[u]=r[u-1].clone(),h[u]=h[u-1].clone(),o.crossVectors(e[u-1],e[u]),o.length()>Number.EPSILON&&(o.normalize(),n=Math.acos(w.clamp(e[u-1].dot(e[u]),-1,1)),r[u].applyMatrix4(a.makeRotationAxis(o,n))),h[u].crossVectors(e[u],r[u]);if(!0===i)for(n=Math.acos(w.clamp(r[0].dot(r[t]),-1,1)),n/=t,0<e[0].dot(o.crossVectors(r[0],r[t]))&&(n=-n),u=1;u<=t;u++)r[u].applyMatrix4(a.makeRotationAxis(e[u],n*u)),h[u].crossVectors(e[u],r[u]);return{tangents:e,normals:r,binormals:h}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}});function $s(t,i,n,s,e){Qs.call(this),this.degree=t,this.knots=i,this.controlPoints=[],this.startKnot=s||0,this.endKnot=e||this.knots.length-1;for(var r=0;r<n.length;++r){var h=n[r];this.controlPoints[r]=new M(h.x,h.y,h.z,h.w)}}var B,P,L,Js,te,ie,ne={findSpan:function(t,i,n){var s=n.length-t-1;if(i>=n[s])return s-1;if(i<=n[t])return t;for(var e=t,r=s,h=Math.floor((e+r)/2);i<n[h]||i>=n[h+1];)i<n[h]?r=h:e=h,h=Math.floor((e+r)/2);return h},calcBasisFunctions:function(t,i,n,s){for(var e=[],r=[],h=[],o=e[0]=1;o<=n;++o){r[o]=i-s[t+1-o],h[o]=s[t+o]-i;for(var a=0,u=0;u<o;++u){var c=h[u+1],f=r[o-u],l=e[u]/(c+f);e[u]=a+c*l,a=f*l}e[o]=a}return e},calcBSplinePoint:function(t,i,n,s){for(var e=this.findSpan(t,s,i),r=this.calcBasisFunctions(e,s,t,i),h=new M(0,0,0,0),o=0;o<=t;++o){var a=n[e-t+o],u=r[o],c=a.w*u;h.x+=a.x*c,h.y+=a.y*c,h.z+=a.z*c,h.w+=a.w*u}return h},calcBasisFunctionDerivatives:function(t,i,n,s,e){for(var r=[],h=0;h<=n;++h)r[h]=0;for(var o=[],h=0;h<=s;++h)o[h]=r.slice(0);for(var a=[],h=0;h<=n;++h)a[h]=r.slice(0);a[0][0]=1;for(var u=r.slice(0),c=r.slice(0),f=1;f<=n;++f){u[f]=i-e[t+1-f],c[f]=e[t+f]-i;for(var l=0,d=0;d<f;++d){var v=c[d+1],p=u[f-d],w=(a[f][d]=v+p,a[d][f-1]/a[f][d]);a[d][f]=l+v*w,l=p*w}a[f][f]=l}for(f=0;f<=n;++f)o[0][f]=a[f][n];for(d=0;d<=n;++d){for(var m=0,b=1,M=[],h=0;h<=n;++h)M[h]=r.slice(0);for(var g=M[0][0]=1;g<=s;++g){var y=0,E=d-g,T=n-g;g<=d&&(M[b][0]=M[m][0]/a[1+T][E],y=M[b][0]*a[E][T]);for(var k=d-1<=T?g-1:n-d,f=-1<=E?1:-E;f<=k;++f)M[b][f]=(M[m][f]-M[m][f-1])/a[1+T][E+f],y+=M[b][f]*a[E+f][T];d<=T&&(M[b][g]=-M[m][g-1]/a[1+T][d],y+=M[b][g]*a[d][T]),o[g][d]=y;f=m,m=b,b=f}}for(d=n,g=1;g<=s;++g){for(f=0;f<=n;++f)o[g][f]*=d;d*=n-g}return o},calcBSplineDerivatives:function(t,i,n,s,e){for(var r=e<t?e:t,h=[],o=this.findSpan(t,s,i),a=this.calcBasisFunctionDerivatives(o,s,t,r,i),u=[],c=0;c<n.length;++c){var f=(d=n[c].clone()).w;d.x*=f,d.y*=f,d.z*=f,u[c]=d}for(var l=0;l<=r;++l){for(var d=u[o-t].clone().multiplyScalar(a[l][0]),v=1;v<=t;++v)d.add(u[o-t+v].clone().multiplyScalar(a[l][v]));h[l]=d}for(l=r+1;l<=e+1;++l)h[l]=new M(0,0,0);return h},calcKoverI:function(t,i){for(var n=1,s=2;s<=t;++s)n*=s;for(var e=1,s=2;s<=i;++s)e*=s;for(s=2;s<=t-i;++s)e*=s;return n/e},calcRationalCurveDerivatives:function(t){for(var i=t.length,n=[],s=[],e=0;e<i;++e){var r=t[e];n[e]=new g(r.x,r.y,r.z),s[e]=r.w}for(var h=[],o=0;o<i;++o){for(var a=n[o].clone(),e=1;e<=o;++e)a.sub(h[o-e].clone().multiplyScalar(this.calcKoverI(o,e)*s[e]));h[o]=a.divideScalar(s[0])}return h},calcNURBSDerivatives:function(t,i,n,s,e){t=this.calcBSplineDerivatives(t,i,n,s,e);return this.calcRationalCurveDerivatives(t)},calcSurfacePoint:function(t,i,n,s,e,r,h,o){for(var a=this.findSpan(t,r,n),u=this.findSpan(i,h,s),c=this.calcBasisFunctions(a,r,t,n),f=this.calcBasisFunctions(u,h,i,s),l=[],d=0;d<=i;++d){l[d]=new M(0,0,0,0);for(var v=0;v<=t;++v){var p=e[a-t+v][u-i+d].clone(),w=p.w;p.x*=w,p.y*=w,p.z*=w,l[d].add(p.multiplyScalar(c[v]))}}for(var m=new M(0,0,0,0),d=0;d<=i;++d)m.add(l[d].multiplyScalar(f[d]));m.divideScalar(m.w),o.set(m.x,m.y,m.z)}};function se(t){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ee(t){A.call(this,t)}function re(t,i){this.textureLoader=t,this.manager=i}function he(){}function oe(){}function ae(){}function ue(){}function ce(t,i){this.dv=new DataView(t),this.offset=0,this.littleEndian=void 0===i||i}function fe(){}function le(t){t=t.match(/FBXVersion: (\d+)/);if(t)return parseInt(t[1]);throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function de(t){return t/46186158e3}function ve(t,i,n,s){var e;switch(s.mappingType){case"ByPolygonVertex":e=t;break;case"ByPolygon":e=i;break;case"ByVertice":e=n;break;case"AllSame":e=s.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+s.mappingType)}for(var r=(e="IndexToDirect"===s.referenceType?s.indices[e]:e)*s.dataSize,h=r+s.dataSize,o=Js,a=s.buffer,u=h,c=r,f=0;c<u;c++,f++)o[f]=a[c];return o}function pe(t){var i,n=new m,s=new m,e=new m,r=new m,h=new m,o=new m,a=new m,u=new m,c=new m,f=new m,l=new m,d=t.inheritType||0,v=(t.translation&&n.setPosition(ie.fromArray(t.translation)),t.preRotation&&((v=t.preRotation.map(w.degToRad)).push(t.eulerOrder),s.makeRotationFromEuler(te.fromArray(v))),t.rotation&&((v=t.rotation.map(w.degToRad)).push(t.eulerOrder),e.makeRotationFromEuler(te.fromArray(v))),t.postRotation&&((v=t.postRotation.map(w.degToRad)).push(t.eulerOrder),r.makeRotationFromEuler(te.fromArray(v))),t.scale&&h.scale(ie.fromArray(t.scale)),t.scalingOffset&&a.setPosition(ie.fromArray(t.scalingOffset)),t.scalingPivot&&o.setPosition(ie.fromArray(t.scalingPivot)),t.rotationOffset&&u.setPosition(ie.fromArray(t.rotationOffset)),t.rotationPivot&&c.setPosition(ie.fromArray(t.rotationPivot)),t.parentMatrixWorld&&(f=t.parentMatrixWorld),s.multiply(e).multiply(r)),t=new m,p=(f.extractRotation(t),new m),t=(p.copyPosition(f),p=p.getInverse(p).multiply(f),p=t.getInverse(t).multiply(p),i=h,d=(0===d?t.multiply(v).multiply(p):1===d?t.multiply(p).multiply(v):(d=(new m).copy(h),p=p.multiply(d.getInverse(d)),t.multiply(v).multiply(p))).multiply(i),n.multiply(u).multiply(c).multiply(s).multiply(e).multiply(r).multiply(c.getInverse(c)).multiply(a).multiply(o).multiply(h).multiply(o.getInverse(o))),v=(new m).copyPosition(t),p=f.multiply(v);return l.copyPosition(p),l.multiply(d)}function we(t){var i=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return 6===(t=t||0)?(console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),i[0]):i[t]}function me(t){return t.split(",").map(function(t){return parseFloat(t)})}function be(t,i,n){return void 0===i&&(i=0),void 0===n&&(n=t.byteLength),jn.decodeText(new Uint8Array(t,i,n))}function Me(t,i,n){return t.slice(0,i).concat(n).concat(t.slice(i))}(($s.prototype=Object.create(Qs.prototype)).constructor=$s).prototype.getPoint=function(t){t=this.knots[this.startKnot]+t*(this.knots[this.endKnot]-this.knots[this.startKnot]),t=ne.calcBSplinePoint(this.degree,this.knots,this.controlPoints,t);return 1!=t.w&&t.divideScalar(t.w),new g(t.x,t.y,t.z)},$s.prototype.getTangent=function(t){t=this.knots[0]+t*(this.knots[this.knots.length-1]-this.knots[0]),t=ne.calcNURBSDerivatives(this.degree,this.knots,this.controlPoints,t,1)[1].clone();return t.normalize(),t},ee.prototype=Object.assign(Object.create(A.prototype),{constructor:ee,load:function(i,n,t,s){var e=this,r=""===e.path?jn.extractUrlBase(i):e.path,h=new An(this.manager);h.setPath(e.path),h.setResponseType("arraybuffer"),h.load(i,function(t){try{n(e.parse(t,r))}catch(t){setTimeout(function(){s&&s(t),e.manager.itemError(i)},0)}},t,s)},parse:function(t,i){if(s="Kaydara FBX Binary  \0",(n=t).byteLength>=s.length&&s===be(n,0,s.length))B=(new ue).parse(t);else{n=be(t);if(!function(n){var t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],s=0;for(var i=0;i<t.length;++i)if(function(t){var i=n[t-1];return n=n.slice(s+t),s++,i}(1)===t[i])return;return 1}(n))throw new Error("THREE.FBXLoader: Unknown format.");if(le(n)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+le(n));B=(new ae).parse(n)}var n,s;return new re(new $i(this.manager).setPath(this.resourcePath||i).setCrossOrigin(this.crossOrigin),this.manager).parse(B)}}),re.prototype={constructor:re,parse:function(){P=this.parseConnections();var t=this.parseImages(),t=this.parseTextures(t),t=this.parseMaterials(t),i=this.parseDeformers(),n=(new he).parse(i);return this.parseScene(i,n,t),L},parseConnections:function(){var e=new Map;return"Connections"in B&&B.Connections.connections.forEach(function(t){var i=t[0],n=t[1],t=t[2],s=(e.has(i)||e.set(i,{parents:[],children:[]}),{ID:n,relationship:t}),s=(e.get(i).parents.push(s),e.has(n)||e.set(n,{parents:[],children:[]}),{ID:i,relationship:t});e.get(n).children.push(s)}),e},parseImages:function(){var t={},i={};if("Video"in B.Objects){var n,s=B.Objects.Video;for(n in s){var e,r,h,o=s[n];t[e=parseInt(n)]=o.RelativeFilename||o.Filename,"Content"in o&&(h=o.Content instanceof ArrayBuffer&&0<o.Content.byteLength,r="string"==typeof o.Content&&""!==o.Content,h||r)&&(h=this.parseImage(s[n]),i[o.RelativeFilename||o.Filename]=h)}}for(e in t){var a=t[e];t[e]=void 0!==i[a]?i[a]:t[e].split("\\").pop()}return t},parseImage:function(t){var i,n=t.Content,s=t.RelativeFilename||t.Filename,e=s.slice(s.lastIndexOf(".")+1).toLowerCase();switch(e){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 ",s),i="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+e+'" is not supported.')}return"string"==typeof n?"data:"+i+";base64,"+n:(t=new Uint8Array(n),window.URL.createObjectURL(new Blob([t],{type:i})))},parseTextures:function(t){var i=new Map;if("Texture"in B.Objects){var n,s=B.Objects.Texture;for(n in s){var e=this.parseTexture(s[n],t);i.set(parseInt(n),e)}}return i},parseTexture:function(t,i){var i=this.loadTexture(t,i),n=(i.ID=t.id,i.name=t.attrName,t.WrapModeU),s=t.WrapModeV,n=void 0!==n?n.value:0,s=void 0!==s?s.value:0;return i.wrapS=0===n?1e3:G,i.wrapT=0===s?1e3:G,"Scaling"in t&&(n=t.Scaling.value,i.repeat.x=n[0],i.repeat.y=n[1]),i},loadTexture:function(t,i){var n,s=this.textureLoader.path,e=P.get(t.id).children,i=(void 0!==e&&0<e.length&&void 0!==i[e[0].ID]&&(0!==(n=i[e[0].ID]).indexOf("blob:")&&0!==n.indexOf("data:")||this.textureLoader.setPath(void 0)),t.FileName.slice(-3).toLowerCase());return e="tga"===i?null===(e=this.manager.getHandler(".tga"))?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",t.RelativeFilename),new Qi):e.load(n):"psd"===i?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",t.RelativeFilename),new Qi):this.textureLoader.load(n),this.textureLoader.setPath(s),e},parseMaterials:function(t){var i=new Map;if("Material"in B.Objects){var n,s=B.Objects.Material;for(n in s){var e=this.parseMaterial(s[n],t);null!==e&&i.set(parseInt(n),e)}}return i},parseMaterial:function(t,i){var n=t.id,s=t.attrName,e=t.ShadingModel;if("object"===se(e)&&(e=e.value),!P.has(n))return null;var r,t=this.parseParameters(t,i,n);switch(e.toLowerCase()){case"phong":r=new fn;break;case"lambert":r=new vn;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',e),r=new fn}return r.setValues(t),r.name=s,r},parseParameters:function(t,n,i){var s={},e=(t.BumpFactor&&(s.bumpScale=t.BumpFactor.value),t.Diffuse?s.color=(new v).fromArray(t.Diffuse.value):t.DiffuseColor&&"Color"===t.DiffuseColor.type&&(s.color=(new v).fromArray(t.DiffuseColor.value)),t.DisplacementFactor&&(s.displacementScale=t.DisplacementFactor.value),t.Emissive?s.emissive=(new v).fromArray(t.Emissive.value):t.EmissiveColor&&"Color"===t.EmissiveColor.type&&(s.emissive=(new v).fromArray(t.EmissiveColor.value)),t.EmissiveFactor&&(s.emissiveIntensity=parseFloat(t.EmissiveFactor.value)),t.Opacity&&(s.opacity=parseFloat(t.Opacity.value)),s.opacity<1&&(s.transparent=!0),t.ReflectionFactor&&(s.reflectivity=t.ReflectionFactor.value),t.Shininess&&(s.shininess=t.Shininess.value),t.Specular?s.specular=(new v).fromArray(t.Specular.value):t.SpecularColor&&"Color"===t.SpecularColor.type&&(s.specular=(new v).fromArray(t.SpecularColor.value)),this);return P.get(i).children.forEach(function(t){var i=t.relationship;switch(i){case"Bump":s.bumpMap=e.getTexture(n,t.ID);break;case"Maya|TEX_ao_map":s.aoMap=e.getTexture(n,t.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":s.map=e.getTexture(n,t.ID),s.map.encoding=3001;break;case"DisplacementColor":s.displacementMap=e.getTexture(n,t.ID);break;case"EmissiveColor":s.emissiveMap=e.getTexture(n,t.ID),s.emissiveMap.encoding=3001;break;case"NormalMap":case"Maya|TEX_normal_map":s.normalMap=e.getTexture(n,t.ID);break;case"ReflectionColor":s.envMap=e.getTexture(n,t.ID),s.envMap.mapping=303,s.envMap.encoding=3001;break;case"SpecularColor":s.specularMap=e.getTexture(n,t.ID),s.specularMap.encoding=3001;break;case"TransparentColor":s.alphaMap=e.getTexture(n,t.ID),s.transparent=!0;break;default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",i)}}),s},getTexture:function(t,i){return"LayeredTexture"in B.Objects&&i in B.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),i=P.get(i).children[0].ID),t.get(i)},parseDeformers:function(){var t={},i={};if("Deformer"in B.Objects){var n,s=B.Objects.Deformer;for(n in s){var e,r=s[n],h=P.get(parseInt(n));"Skin"===r.attrType?((e=this.parseSkeleton(h,s)).ID=n,1<h.parents.length&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),e.geometryID=h.parents[0].ID,t[n]=e):"BlendShape"===r.attrType&&((e={id:n}).rawTargets=this.parseMorphTargets(h,s),e.id=n,1<h.parents.length&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),i[n]=e)}}return{skeletons:t,morphTargets:i}},parseSkeleton:function(t,n){var s=[];return t.children.forEach(function(t){var i=n[t.ID];"Cluster"===i.attrType&&(t={ID:t.ID,indices:[],weights:[],transformLink:(new m).fromArray(i.TransformLink.a)},"Indexes"in i&&(t.indices=i.Indexes.a,t.weights=i.Weights.a),s.push(t))}),{rawBones:s,bones:[]}},parseMorphTargets:function(t,i){for(var n=[],s=0;s<t.children.length;s++){var e=t.children[s],r=i[e.ID],h={name:r.attrName,initialWeight:r.DeformPercent,id:r.id,fullWeights:r.FullWeights.a};if("BlendShapeChannel"!==r.attrType)return;h.geoID=P.get(parseInt(e.ID)).children.filter(function(t){return void 0===t.relationship})[0].ID,n.push(h)}return n},parseScene:function(t,i,n){L=new Sn;var s=this.parseModels(t.skeletons,i,n),e=B.Objects.Model,r=this,n=(s.forEach(function(i){var t=e[i.ID];r.setLookAtProperties(i,t),P.get(i.ID).parents.forEach(function(t){t=s.get(t.ID);void 0!==t&&t.add(i)}),null===i.parent&&L.add(i)}),this.bindSkeleton(t.skeletons,i,s),this.createAmbientLight(),this.setupMorphMaterials(),L.traverse(function(t){var i;t.userData.transformData&&(t.parent&&(t.userData.transformData.parentMatrixWorld=t.parent.matrix),i=pe(t.userData.transformData),t.applyMatrix4(i))}),(new oe).parse());1===L.children.length&&L.children[0].isGroup&&(L.children[0].animations=n,L=L.children[0]),L.animations=n},parseModels:function(t,i,n){var s,e=new Map,r=B.Objects.Model;for(s in r){var h=parseInt(s),o=r[s],a=P.get(h),u=this.buildSkeleton(a,t,h,o.attrName);if(!u){switch(o.attrType){case"Camera":u=this.createCamera(a);break;case"Light":u=this.createLight(a);break;case"Mesh":u=this.createMesh(a,i,n);break;case"NurbsCurve":u=this.createCurve(a,i);break;case"LimbNode":case"Root":u=new Rn;break;default:u=new Sn}u.name=o.attrName?c.sanitizeNodeName(o.attrName):"",u.ID=h}this.getTransformData(u,o),e.set(h,u)}return e},buildSkeleton:function(t,i,r,h){var o=null;return t.parents.forEach(function(s){for(var t in i){var e=i[t];e.rawBones.forEach(function(t,i){var n;t.ID===s.ID&&(n=o,(o=new Rn).matrixWorld.copy(t.transformLink),o.name=h?c.sanitizeNodeName(h):"",o.ID=r,e.bones[i]=o,null!==n)&&o.add(n)})}}),o},createCamera:function(t){var i,n;if(t.children.forEach(function(t){t=B.Objects.NodeAttribute[t.ID];void 0!==t&&(n=t)}),void 0===n)i=new f;else{var s=0,e=(void 0!==n.CameraProjectionType&&1===n.CameraProjectionType.value&&(s=1),1),r=(void 0!==n.NearPlane&&(e=n.NearPlane.value/1e3),1e3),h=(void 0!==n.FarPlane&&(r=n.FarPlane.value/1e3),window.innerWidth),o=window.innerHeight,a=(void 0!==n.AspectWidth&&void 0!==n.AspectHeight&&(h=n.AspectWidth.value,o=n.AspectHeight.value),h/o),u=45,c=(void 0!==n.FieldOfView&&(u=n.FieldOfView.value),n.FocalLength?n.FocalLength.value:null);switch(s){case 0:i=new Zt(u,a,e,r),null!==c&&i.setFocalLength(c);break;case 1:i=new Yt(-h/2,h/2,o/2,-o/2,e,r);break;default:console.warn("THREE.FBXLoader: Unknown camera type "+s+"."),i=new f}}return i},createLight:function(t){var i,n;if(t.children.forEach(function(t){t=B.Objects.NodeAttribute[t.ID];void 0!==t&&(n=t)}),void 0===n)i=new f;else{var t=void 0===n.LightType?0:n.LightType.value,s=16777215,e=(void 0!==n.Color&&(s=(new v).fromArray(n.Color.value)),void 0===n.Intensity?1:n.Intensity.value/100),r=(void 0!==n.CastLightOnObject&&0===n.CastLightOnObject.value&&(e=0),0);void 0!==n.FarAttenuationEnd&&(r=void 0!==n.EnableFarAttenuation&&0===n.EnableFarAttenuation.value?0:n.FarAttenuationEnd.value);switch(t){case 0:i=new Xi(s,e,r,1);break;case 1:i=new Di(s,e);break;case 2:var h=Math.PI/3,o=(void 0!==n.InnerAngle&&(h=w.degToRad(n.InnerAngle.value)),0);void 0!==n.OuterAngle&&(o=w.degToRad(n.OuterAngle.value),o=Math.max(o,1)),i=new qi(s,e,r,h,o,1);break;default:console.warn("THREE.FBXLoader: Unknown light type "+n.LightType.value+", defaulting to a PointLight."),i=new Xi(s,e)}void 0!==n.CastShadows&&1===n.CastShadows.value&&(i.castShadow=!0)}return i},createMesh:function(t,i,n){var s,e=null,r=null,h=[];return t.children.forEach(function(t){i.has(t.ID)&&(e=i.get(t.ID)),n.has(t.ID)&&h.push(n.get(t.ID))}),1<h.length?r=h:0<h.length?r=h[0]:(r=new fn({color:13421772}),h.push(r)),"color"in e.attributes&&h.forEach(function(t){t.vertexColors=!0}),e.FBX_Deformer?(h.forEach(function(t){t.skinning=!0}),(s=new Ts(e,r)).normalizeSkinWeights()):s=new ms(e,r),s},createCurve:function(t,n){return new qn(t.children.reduce(function(t,i){return t=n.has(i.ID)?n.get(i.ID):t},null),new Mn({color:3342591,linewidth:1}))},getTransformData:function(t,i){var n={};"InheritType"in i&&(n.inheritType=parseInt(i.InheritType.value)),"RotationOrder"in i?n.eulerOrder=we(i.RotationOrder.value):n.eulerOrder="ZYX","Lcl_Translation"in i&&(n.translation=i.Lcl_Translation.value),"PreRotation"in i&&(n.preRotation=i.PreRotation.value),"Lcl_Rotation"in i&&(n.rotation=i.Lcl_Rotation.value),"PostRotation"in i&&(n.postRotation=i.PostRotation.value),"Lcl_Scaling"in i&&(n.scale=i.Lcl_Scaling.value),"ScalingOffset"in i&&(n.scalingOffset=i.ScalingOffset.value),"ScalingPivot"in i&&(n.scalingPivot=i.ScalingPivot.value),"RotationOffset"in i&&(n.rotationOffset=i.RotationOffset.value),"RotationPivot"in i&&(n.rotationPivot=i.RotationPivot.value),t.userData.transformData=n},setLookAtProperties:function(i,t){"LookAtProperty"in t&&P.get(i.ID).children.forEach(function(t){"LookAtProperty"===t.relationship&&"Lcl_Translation"in(t=B.Objects.Model[t.ID])&&(t=t.Lcl_Translation.value,void 0!==i.target?(i.target.position.fromArray(t),L.add(i.target)):i.lookAt((new g).fromArray(t)))})},bindSkeleton:function(t,i,n){var s,e=this.parsePoseNodes();for(s in t){var r=t[s];P.get(parseInt(r.ID)).parents.forEach(function(t){i.has(t.ID)&&(t=t.ID,P.get(t).parents.forEach(function(t){n.has(t.ID)&&n.get(t.ID).bind(new Es(r.bones),e[t.ID])}))})}},parsePoseNodes:function(){var i={};if("Pose"in B.Objects){var t,n,s=B.Objects.Pose;for(t in s)"BindPose"===s[t].attrType&&(n=s[t].PoseNode,Array.isArray(n)?n.forEach(function(t){i[t.Node]=(new m).fromArray(t.Matrix.a)}):i[n.Node]=(new m).fromArray(n.Matrix.a))}return i},createAmbientLight:function(){var t,i,n;"GlobalSettings"in B&&"AmbientColor"in B.GlobalSettings&&(n=(i=B.GlobalSettings.AmbientColor.value)[0],t=i[1],i=i[2],0===n&&0===t&&0===i||(n=new v(n,t,i),L.add(new Si(n,1))))},setupMorphMaterials:function(){var s=this;L.traverse(function(n){n.isMesh&&n.geometry.morphAttributes.position&&n.geometry.morphAttributes.position.length&&(Array.isArray(n.material)?n.material.forEach(function(t,i){s.setupMorphMaterial(n,t,i)}):s.setupMorphMaterial(n,n.material))})},setupMorphMaterial:function(t,i,n){var s,e=t.uuid,r=i.uuid,h=!1;L.traverse(function(i){i.isMesh&&(Array.isArray(i.material)?i.material.forEach(function(t){t.uuid===r&&i.uuid!==e&&(h=!0)}):i.material.uuid===r&&i.uuid!==e&&(h=!0))}),!0===h?((s=i.clone()).morphTargets=!0,void 0===n?t.material=s:t.material[n]=s):i.morphTargets=!0}},he.prototype={constructor:he,parse:function(t){var i=new Map;if("Geometry"in B.Objects){var n,s=B.Objects.Geometry;for(n in s){var e=P.get(parseInt(n)),e=this.parseGeometry(e,s[n],t);i.set(parseInt(n),e)}}return i},parseGeometry:function(t,i,n){switch(i.attrType){case"Mesh":return this.parseMeshGeometry(t,i,n);case"NurbsCurve":return this.parseNurbsGeometry(i)}},parseMeshGeometry:function(t,i,n){var s,e=n.skeletons,r=[],h=t.parents.map(function(t){return B.Objects.Model[t.ID]});if(0!==h.length)return s=t.children.reduce(function(t,i){return t=void 0!==e[i.ID]?e[i.ID]:t},null),t.children.forEach(function(t){void 0!==n.morphTargets[t.ID]&&r.push(n.morphTargets[t.ID])}),t={},"RotationOrder"in(h=h[0])&&(t.eulerOrder=we(h.RotationOrder.value)),"InheritType"in h&&(t.inheritType=parseInt(h.InheritType.value)),"GeometricTranslation"in h&&(t.translation=h.GeometricTranslation.value),"GeometricRotation"in h&&(t.rotation=h.GeometricRotation.value),"GeometricScaling"in h&&(t.scale=h.GeometricScaling.value),h=pe(t),this.genGeometry(i,s,r,h)},genGeometry:function(t,i,n,s){var e,r,h=new Ri,o=(t.attrName&&(h.name=t.attrName),this.parseGeoNode(t,i)),a=this.genBuffers(o),u=new E(a.vertex,3);return u.applyMatrix4(s),h.setAttribute("position",u),0<a.colors.length&&h.setAttribute("color",new E(a.colors,3)),i&&(h.setAttribute("skinIndex",new ii(a.weightsIndices,4)),h.setAttribute("skinWeight",new E(a.vertexWeights,4)),h.FBX_Deformer=i),0<a.normal.length&&(u=(new St).getNormalMatrix(s),(i=new E(a.normal,3)).applyNormalMatrix(u),h.setAttribute("normal",i)),a.uvs.forEach(function(t,i){var n="uv"+(i+1).toString();h.setAttribute(n=0===i?"uv":n,new E(a.uvs[i],2))}),o.material&&"AllSame"!==o.material.mappingType&&(e=a.materialIndex[0],r=0,a.materialIndex.forEach(function(t,i){t!==e&&(h.addGroup(r,i-r,e),e=t,r=i)}),0<h.groups.length&&(i=(u=h.groups[h.groups.length-1]).start+u.count)!==a.materialIndex.length&&h.addGroup(i,a.materialIndex.length-i,e),0===h.groups.length)&&h.addGroup(0,a.materialIndex.length,a.materialIndex[0]),this.addMorphTargets(h,t,n,s),h},parseGeoNode:function(t,i){var e={};if(e.vertexPositions=void 0!==t.Vertices?t.Vertices.a:[],e.vertexIndices=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],t.LayerElementColor&&(e.color=this.parseVertexColors(t.LayerElementColor[0])),t.LayerElementMaterial&&(e.material=this.parseMaterialIndices(t.LayerElementMaterial[0])),t.LayerElementNormal&&(e.normal=this.parseNormals(t.LayerElementNormal[0])),t.LayerElementUV){e.uv=[];for(var n=0;t.LayerElementUV[n];)e.uv.push(this.parseUVs(t.LayerElementUV[n])),n++}return e.weightTable={},null!==i&&(e.skeleton=i).rawBones.forEach(function(n,s){n.indices.forEach(function(t,i){void 0===e.weightTable[t]&&(e.weightTable[t]=[]),e.weightTable[t].push({id:s,weight:n.weights[i]})})}),e},genBuffers:function(c){var f={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]},l=0,d=0,v=!1,p=[],w=[],m=[],b=[],M=[],g=[],y=this;return c.vertexIndices.forEach(function(n,s){var r,h,t,i,e=!1,o=(n<0&&(n^=-1,e=!0),[]),a=[];if(p.push(3*n,3*n+1,3*n+2),c.color&&(t=ve(s,l,n,c.color),m.push(t[0],t[1],t[2])),c.skeleton){for(void 0!==c.weightTable[n]&&c.weightTable[n].forEach(function(t){a.push(t.weight),o.push(t.id)}),4<a.length&&(v||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),v=!0),r=[0,0,0,0],h=[0,0,0,0],a.forEach(function(t,i){var s=t,e=o[i];h.forEach(function(t,i,n){t<s&&(n[i]=s,s=t,n=r[i],r[i]=e,e=n)})}),o=r,a=h);a.length<4;)a.push(0),o.push(0);for(var u=0;u<4;++u)M.push(a[u]),g.push(o[u])}c.normal&&(t=ve(s,l,n,c.normal),w.push(t[0],t[1],t[2])),c.material&&"AllSame"!==c.material.mappingType&&(i=ve(s,l,n,c.material)[0]),c.uv&&c.uv.forEach(function(t,i){t=ve(s,l,n,t);void 0===b[i]&&(b[i]=[]),b[i].push(t[0]),b[i].push(t[1])}),d++,e&&(y.genFace(f,c,p,i,w,m,b,M,g,d),l++,d=0,p=[],w=[],m=[],b=[],M=[],g=[])}),f},genFace:function(n,t,i,s,e,r,h,o,a,u){for(var c=2;c<u;c++)n.vertex.push(t.vertexPositions[i[0]]),n.vertex.push(t.vertexPositions[i[1]]),n.vertex.push(t.vertexPositions[i[2]]),n.vertex.push(t.vertexPositions[i[3*(c-1)]]),n.vertex.push(t.vertexPositions[i[3*(c-1)+1]]),n.vertex.push(t.vertexPositions[i[3*(c-1)+2]]),n.vertex.push(t.vertexPositions[i[3*c]]),n.vertex.push(t.vertexPositions[i[3*c+1]]),n.vertex.push(t.vertexPositions[i[3*c+2]]),t.skeleton&&(n.vertexWeights.push(o[0]),n.vertexWeights.push(o[1]),n.vertexWeights.push(o[2]),n.vertexWeights.push(o[3]),n.vertexWeights.push(o[4*(c-1)]),n.vertexWeights.push(o[4*(c-1)+1]),n.vertexWeights.push(o[4*(c-1)+2]),n.vertexWeights.push(o[4*(c-1)+3]),n.vertexWeights.push(o[4*c]),n.vertexWeights.push(o[4*c+1]),n.vertexWeights.push(o[4*c+2]),n.vertexWeights.push(o[4*c+3]),n.weightsIndices.push(a[0]),n.weightsIndices.push(a[1]),n.weightsIndices.push(a[2]),n.weightsIndices.push(a[3]),n.weightsIndices.push(a[4*(c-1)]),n.weightsIndices.push(a[4*(c-1)+1]),n.weightsIndices.push(a[4*(c-1)+2]),n.weightsIndices.push(a[4*(c-1)+3]),n.weightsIndices.push(a[4*c]),n.weightsIndices.push(a[4*c+1]),n.weightsIndices.push(a[4*c+2]),n.weightsIndices.push(a[4*c+3])),t.color&&(n.colors.push(r[0]),n.colors.push(r[1]),n.colors.push(r[2]),n.colors.push(r[3*(c-1)]),n.colors.push(r[3*(c-1)+1]),n.colors.push(r[3*(c-1)+2]),n.colors.push(r[3*c]),n.colors.push(r[3*c+1]),n.colors.push(r[3*c+2])),t.material&&"AllSame"!==t.material.mappingType&&(n.materialIndex.push(s),n.materialIndex.push(s),n.materialIndex.push(s)),t.normal&&(n.normal.push(e[0]),n.normal.push(e[1]),n.normal.push(e[2]),n.normal.push(e[3*(c-1)]),n.normal.push(e[3*(c-1)+1]),n.normal.push(e[3*(c-1)+2]),n.normal.push(e[3*c]),n.normal.push(e[3*c+1]),n.normal.push(e[3*c+2])),t.uv&&t.uv.forEach(function(t,i){void 0===n.uvs[i]&&(n.uvs[i]=[]),n.uvs[i].push(h[i][0]),n.uvs[i].push(h[i][1]),n.uvs[i].push(h[i][2*(c-1)]),n.uvs[i].push(h[i][2*(c-1)+1]),n.uvs[i].push(h[i][2*c]),n.uvs[i].push(h[i][2*c+1])})},addMorphTargets:function(n,s,t,e){var r;0!==t.length&&(n.morphTargetsRelative=!0,n.morphAttributes.position=[],r=this,t.forEach(function(t){t.rawTargets.forEach(function(t){var i=B.Objects.Geometry[t.geoID];void 0!==i&&r.genMorphGeometry(n,s,i,e,t.name)})}))},genMorphGeometry:function(t,i,n,s,e){for(var i=void 0!==i.PolygonVertexIndex?i.PolygonVertexIndex.a:[],r=void 0!==n.Vertices?n.Vertices.a:[],h=void 0!==n.Indexes?n.Indexes.a:[],o=3*t.attributes.position.count,a=new Float32Array(o),u=0;u<h.length;u++){var c=3*h[u];a[c]=r[3*u],a[1+c]=r[3*u+1],a[2+c]=r[3*u+2]}o=new E(this.genBuffers({vertexIndices:i,vertexPositions:a}).vertex,3);o.name=e||n.attrName,o.applyMatrix4(s),t.morphAttributes.position.push(o)},parseNormals:function(t){var i=t.MappingInformationType,n=t.ReferenceInformationType,s=t.Normals.a,e=[];return"IndexToDirect"===n&&("NormalIndex"in t?e=t.NormalIndex.a:"NormalsIndex"in t&&(e=t.NormalsIndex.a)),{dataSize:3,buffer:s,indices:e,mappingType:i,referenceType:n}},parseUVs:function(t){var i=t.MappingInformationType,n=t.ReferenceInformationType,s=[];return{dataSize:2,buffer:t.UV.a,indices:s="IndexToDirect"===n?t.UVIndex.a:s,mappingType:i,referenceType:n}},parseVertexColors:function(t){var i=t.MappingInformationType,n=t.ReferenceInformationType,s=[];return{dataSize:4,buffer:t.Colors.a,indices:s="IndexToDirect"===n?t.ColorIndex.a:s,mappingType:i,referenceType:n}},parseMaterialIndices:function(t){var i=t.MappingInformationType,n=t.ReferenceInformationType;if("NoMappingInformation"===i)return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:n};for(var s=t.Materials.a,e=[],r=0;r<s.length;++r)e.push(r);return{dataSize:1,buffer:s,indices:e,mappingType:i,referenceType:n}},parseNurbsGeometry:function(t){var i=parseInt(t.Order);if(isNaN(i))return console.error("THREE.FBXLoader: Invalid Order %s given for geometry ID: %s",t.Order,t.id),new Ri;for(var n=i-1,i=t.KnotVector.a,s=[],e=t.Points.a,r=0,h=e.length;r<h;r+=4)s.push((new M).fromArray(e,r));if("Closed"===t.Form)s.push(s[0]);else if("Periodic"===t.Form)for(var o=n,a=i.length-1-o,r=0;r<n;++r)s.push(s[r]);var t=new $s(n,i,s,o,a).getPoints(7*s.length),u=new Float32Array(3*t.length),i=(t.forEach(function(t,i){t.toArray(u,3*i)}),new Ri);return i.setAttribute("position",new y(u,3)),i}},oe.prototype={constructor:oe,parse:function(){var t=[],i=this.parseClips();if(void 0!==i)for(var n in i){n=i[n],n=this.addClip(n);t.push(n)}return t},parseClips:function(){var t;if(void 0!==B.Objects.AnimationCurve)return t=this.parseAnimationCurveNodes(),this.parseAnimationCurves(t),t=this.parseAnimationLayers(t),this.parseAnimStacks(t)},parseAnimationCurveNodes:function(){var t,i=B.Objects.AnimationCurveNode,n=new Map;for(t in i){var s=i[t];null!==s.attrName.match(/S|R|T|DeformPercent/)&&(s={id:s.id,attr:s.attrName,curves:{}},n.set(s.id,s))}return n},parseAnimationCurves:function(t){var i,n=B.Objects.AnimationCurve;for(i in n){var s,e={id:n[i].id,times:n[i].KeyTime.a.map(de),values:n[i].KeyValueFloat.a},r=P.get(e.id);void 0!==r&&(s=r.parents[0].ID,(r=r.parents[0].relationship).match(/X/)?t.get(s).curves.x=e:r.match(/Y/)?t.get(s).curves.y=e:r.match(/Z/)?t.get(s).curves.z=e:r.match(/d|DeformPercent/)&&t.has(s)&&(t.get(s).curves.morph=e))}},parseAnimationLayers:function(o){var t,i=B.Objects.AnimationLayer,n=new Map;for(t in i){var a=[],s=P.get(parseInt(t));void 0!==s&&(s.children.forEach(function(t,i){var n,s,e,r,h;o.has(t.ID)&&(void 0!==(n=o.get(t.ID)).curves.x||void 0!==n.curves.y||void 0!==n.curves.z?(void 0===a[i]&&void 0!==(e=P.get(t.ID).parents.filter(function(t){return void 0!==t.relationship})[0].ID)&&(h={modelName:(r=B.Objects.Model[e.toString()]).attrName?c.sanitizeNodeName(r.attrName):"",ID:r.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]},L.traverse(function(t){t.ID===r.id&&(h.transform=t.matrix,t.userData.transformData)&&(h.eulerOrder=t.userData.transformData.eulerOrder)}),h.transform||(h.transform=new m),"PreRotation"in r&&(h.preRotation=r.PreRotation.value),"PostRotation"in r&&(h.postRotation=r.PostRotation.value),a[i]=h),a[i]&&(a[i][n.attr]=n)):void 0!==n.curves.morph&&(void 0===a[i]&&(t=P.get(t.ID).parents.filter(function(t){return void 0!==t.relationship})[0].ID,s=P.get(t).parents[0].ID,s=P.get(s).parents[0].ID,e=P.get(s).parents[0].ID,h={modelName:(r=B.Objects.Model[e]).attrName?c.sanitizeNodeName(r.attrName):"",morphName:B.Objects.Deformer[t].attrName},a[i]=h),a[i][n.attr]=n))}),n.set(parseInt(t),a))}return n},parseAnimStacks:function(t){var i,n=B.Objects.AnimationStack,s={};for(i in n){var e=P.get(parseInt(i)).children,e=(1<e.length&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers."),t.get(e[0].ID));s[i]={name:n[i].attrName,layer:e}}return s},addClip:function(t){var i=[],n=this;return t.layer.forEach(function(t){i=i.concat(n.generateTracks(t))}),new ct(t.name,-1,i)},generateTracks:function(t){var i=[],n=new g,s=new l,e=new g;return t.transform&&t.transform.decompose(n,s,e),n=n.toArray(),s=(new d).setFromQuaternion(s,t.eulerOrder).toArray(),e=e.toArray(),void 0!==t.T&&0<Object.keys(t.T.curves).length&&void 0!==(n=this.generateVectorTrack(t.modelName,t.T.curves,n,"position"))&&i.push(n),void 0!==t.R&&0<Object.keys(t.R.curves).length&&void 0!==(n=this.generateRotationTrack(t.modelName,t.R.curves,s,t.preRotation,t.postRotation,t.eulerOrder))&&i.push(n),void 0!==t.S&&0<Object.keys(t.S.curves).length&&void 0!==(s=this.generateVectorTrack(t.modelName,t.S.curves,e,"scale"))&&i.push(s),void 0!==t.DeformPercent&&void 0!==(n=this.generateMorphTrack(t))&&i.push(n),i},generateVectorTrack:function(t,i,n,s){var e=this.getTimesForAllAxes(i);return new ut(t+"."+s,e,this.getKeyframeTrackValues(e,i,n))},generateRotationTrack:function(t,i,n,s,e,r){void 0!==i.x&&(this.interpolateRotations(i.x),i.x.values=i.x.values.map(w.degToRad)),void 0!==i.y&&(this.interpolateRotations(i.y),i.y.values=i.y.values.map(w.degToRad)),void 0!==i.z&&(this.interpolateRotations(i.z),i.z.values=i.z.values.map(w.degToRad));for(var h=this.getTimesForAllAxes(i),o=this.getKeyframeTrackValues(h,i,n),a=(void 0!==s&&((s=s.map(w.degToRad)).push(r),s=(new d).fromArray(s),s=(new l).setFromEuler(s)),void 0!==e&&((e=e.map(w.degToRad)).push(r),e=(new d).fromArray(e),e=(new l).setFromEuler(e).inverse()),new l),u=new d,c=[],f=0;f<o.length;f+=3)u.set(o[f],o[f+1],o[f+2],r),a.setFromEuler(u),void 0!==s&&a.premultiply(s),void 0!==e&&a.multiply(e),a.toArray(c,f/3*4);return new ot(t+".quaternion",h,c)},generateMorphTrack:function(t){var i=t.DeformPercent.curves.morph,n=i.values.map(function(t){return t/100}),s=L.getObjectByName(t.modelName).morphTargetDictionary[t.morphName];return new et(t.modelName+".morphTargetInfluences["+s+"]",i.times,n)},getTimesForAllAxes:function(t){var i=[];return void 0!==t.x&&(i=i.concat(t.x.times)),void 0!==t.y&&(i=i.concat(t.y.times)),i=(i=void 0!==t.z?i.concat(t.z.times):i).sort(function(t,i){return t-i}).filter(function(t,i,n){return n.indexOf(t)==i})},getKeyframeTrackValues:function(t,i,n){var s=n,e=[],r=-1,h=-1,o=-1;return t.forEach(function(t){i.x&&(r=i.x.times.indexOf(t)),i.y&&(h=i.y.times.indexOf(t)),i.z&&(o=i.z.times.indexOf(t)),-1!==r?(t=i.x.values[r],e.push(t),s[0]=t):e.push(s[0]),-1!==h?(t=i.y.values[h],e.push(t),s[1]=t):e.push(s[1]),-1!==o?(t=i.z.values[o],e.push(t),s[2]=t):e.push(s[2])}),e},interpolateRotations:function(t){for(var i=1;i<t.values.length;i++){var n=t.values[i-1],s=t.values[i]-n,e=Math.abs(s);if(180<=e){for(var e=e/180,r=s/e,h=n+r,s=t.times[i-1],o=(t.times[i]-s)/e,a=s+o,u=[],c=[];a<t.times[i];)u.push(a),a+=o,c.push(h),h+=r;t.times=Me(t.times,i,u),t.values=Me(t.values,i,c)}}}},ae.prototype={constructor:ae,getPrevNode:function(){return this.nodeStack[this.currentIndent-2]},getCurrentNode:function(){return this.nodeStack[this.currentIndent-1]},getCurrentProp:function(){return this.currentProp},pushStack:function(t){this.nodeStack.push(t),this.currentIndent+=1},popStack:function(){this.nodeStack.pop(),--this.currentIndent},setCurrentProp:function(t,i){this.currentProp=t,this.currentPropName=i},parse:function(t){this.currentIndent=0,this.allNodes=new fe,this.nodeStack=[],this.currentProp=[],this.currentPropName="";var r=this,h=t.split(/[\r\n]+/);return h.forEach(function(t,i){var n,s=t.match(/^[\s\t]*;/),e=t.match(/^[\s\t]*$/);s||e||(s=t.match("^\\t{"+r.currentIndent+"}(\\w+):(.*){",""),e=t.match("^\\t{"+r.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),n=t.match("^\\t{"+(r.currentIndent-1)+"}}"),s?r.parseNodeBegin(t,s):e?r.parseNodeProperty(t,e,h[++i]):n?r.popStack():t.match(/^[^\s\t}]/)&&r.parseNodePropertyContinued(t))}),this.allNodes},parseNodeBegin:function(t,i){var n=i[1].trim().replace(/^"/,"").replace(/"$/,""),i=i[2].split(",").map(function(t){return t.trim().replace(/^"/,"").replace(/"$/,"")}),s={name:n},i=this.parseNodeAttr(i),e=this.getCurrentNode();0===this.currentIndent?this.allNodes.add(n,s):n in e?("PoseNode"===n?e.PoseNode.push(s):void 0!==e[n].id&&(e[n]={},e[n][e[n].id]=e[n]),""!==i.id&&(e[n][i.id]=s)):"number"==typeof i.id?(e[n]={},e[n][i.id]=s):"Properties70"!==n&&(e[n]="PoseNode"===n?[s]:s),"number"==typeof i.id&&(s.id=i.id),""!==i.name&&(s.attrName=i.name),""!==i.type&&(s.attrType=i.type),this.pushStack(s)},parseNodeAttr:function(t){var i=t[0],n=(""!==t[0]&&(i=parseInt(t[0]),isNaN(i))&&(i=t[0]),""),s="";return 1<t.length&&(n=t[1].replace(/^(\w+)::/,""),s=t[2]),{id:i,name:n,type:s}},parseNodeProperty:function(t,i,n){var s=i[1].replace(/^"/,"").replace(/"$/,"").trim(),i=i[2].replace(/^"/,"").replace(/"$/,"").trim(),n=("Content"===s&&","===i&&(i=n.replace(/"/g,"").replace(/,$/,"").trim()),this.getCurrentNode());if("Properties70"===n.name)this.parseNodeSpecialProperty(t,s,i);else{if("C"===s){for(var t=i.split(",").slice(1),e=parseInt(t[0]),t=parseInt(t[1]),r=(r=i.split(",").slice(3)).map(function(t){return t.trim().replace(/^"/,"")}),s="connections",h=i=[e,t],o=r,a=0,u=h.length,c=o.length;a<c;a++,u++)h[u]=o[a];void 0===n[s]&&(n[s]=[])}"Node"===s&&(n.id=i),s in n&&Array.isArray(n[s])?n[s].push(i):"a"!==s?n[s]=i:n.a=i,this.setCurrentProp(n,s),"a"===s&&","!==i.slice(-1)&&(n.a=me(i))}},parseNodePropertyContinued:function(t){var i=this.getCurrentNode();i.a+=t,","!==t.slice(-1)&&(i.a=me(i.a))},parseNodeSpecialProperty:function(t,i,n){var n=n.split('",').map(function(t){return t.trim().replace(/^\"/,"").replace(/\s/,"_")}),s=n[0],e=n[1],r=n[2],h=n[3],o=n[4];switch(e){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":o=parseFloat(o);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":o=me(o)}this.getPrevNode()[s]={type:e,type2:r,flag:h,value:o},this.setCurrentProp(this.getPrevNode(),s)}},ue.prototype={constructor:ue,parse:function(t){for(var i=new ce(t),n=(i.skip(23),i.getUint32()),s=new fe;!this.endOfContent(i);){var e=this.parseNode(i,n);null!==e&&s.add(e.name,e)}return s},endOfContent:function(t){return t.size()%16==0?(t.getOffset()+160+16&-16)>=t.size():t.getOffset()+160+16>=t.size()},parseNode:function(t,i){var n={},s=7500<=i?t.getUint64():t.getUint32(),e=7500<=i?t.getUint64():t.getUint32(),r=(7500<=i?t.getUint64():t.getUint32(),t.getUint8()),h=t.getString(r);if(0===s)return null;for(var o=[],a=0;a<e;a++)o.push(this.parseProperty(t));var r=0<o.length?o[0]:"",u=1<o.length?o[1]:"",c=2<o.length?o[2]:"";for(n.singleProperty=1===e&&t.getOffset()===s;s>t.getOffset();){var f=this.parseNode(t,i);null!==f&&this.parseSubNode(h,n,f)}return n.propertyList=o,"number"==typeof r&&(n.id=r),""!==u&&(n.attrName=u),""!==c&&(n.attrType=c),""!==h&&(n.name=h),n},parseSubNode:function(t,i,n){var s,e,r,h,o;!0===n.singleProperty?(e=n.propertyList[0],Array.isArray(e)?(i[n.name]=n).a=e:i[n.name]=e):"Connections"===t&&"C"===n.name?(s=[],n.propertyList.forEach(function(t,i){0!==i&&s.push(t)}),void 0===i.connections&&(i.connections=[]),i.connections.push(s)):"Properties70"===n.name?Object.keys(n).forEach(function(t){i[t]=n[t]}):"Properties70"===t&&"P"===n.name?(e=n.propertyList[0],t=n.propertyList[1],r=n.propertyList[2],h=n.propertyList[3],0===e.indexOf("Lcl ")&&(e=e.replace("Lcl ","Lcl_")),o="Color"===(t=0===t.indexOf("Lcl ")?t.replace("Lcl ","Lcl_"):t)||"ColorRGB"===t||"Vector"===t||"Vector3D"===t||0===t.indexOf("Lcl_")?[n.propertyList[4],n.propertyList[5],n.propertyList[6]]:n.propertyList[4],i[e]={type:t,type2:r,flag:h,value:o}):void 0===i[n.name]?"number"==typeof n.id?(i[n.name]={},i[n.name][n.id]=n):i[n.name]=n:"PoseNode"===n.name?(Array.isArray(i[n.name])||(i[n.name]=[i[n.name]]),i[n.name].push(n)):void 0===i[n.name][n.id]&&(i[n.name][n.id]=n)},parseProperty:function(t){var i=t.getString(1);switch(i){case"C":return t.getBoolean();case"D":return t.getFloat64();case"F":return t.getFloat32();case"I":return t.getInt32();case"L":return t.getInt64();case"R":var n=t.getUint32();return t.getArrayBuffer(n);case"S":n=t.getUint32();return t.getString(n);case"Y":return t.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var s=t.getUint32(),n=t.getUint32(),e=t.getUint32();if(0===n)switch(i){case"b":case"c":return t.getBooleanArray(s);case"d":return t.getFloat64Array(s);case"f":return t.getFloat32Array(s);case"i":return t.getInt32Array(s);case"l":return t.getInt64Array(s)}void 0===Ks&&console.error("THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js");var r=new ce(new Ks.Inflate(new Uint8Array(t.getArrayBuffer(e))).decompress().buffer);switch(i){case"b":case"c":return r.getBooleanArray(s);case"d":return r.getFloat64Array(s);case"f":return r.getFloat32Array(s);case"i":return r.getInt32Array(s);case"l":return r.getInt64Array(s)}default:throw new Error("THREE.FBXLoader: Unknown property type "+i)}}},ce.prototype={constructor:ce,getOffset:function(){return this.offset},size:function(){return this.dv.buffer.byteLength},skip:function(t){this.offset+=t},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(t){for(var i=[],n=0;n<t;n++)i.push(this.getBoolean());return i},getUint8:function(){var t=this.dv.getUint8(this.offset);return this.offset+=1,t},getInt16:function(){var t=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,t},getInt32:function(){var t=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,t},getInt32Array:function(t){for(var i=[],n=0;n<t;n++)i.push(this.getInt32());return i},getUint32:function(){var t=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,t},getInt64:function(){var t,i;return this.littleEndian?(t=this.getUint32(),i=this.getUint32()):(i=this.getUint32(),t=this.getUint32()),2147483648&i?(i=4294967295&~i,-(4294967296*(i=4294967295===(t=4294967295&~t)?i+1&4294967295:i)+(t=t+1&4294967295))):4294967296*i+t},getInt64Array:function(t){for(var i=[],n=0;n<t;n++)i.push(this.getInt64());return i},getUint64:function(){var t,i;return this.littleEndian?(t=this.getUint32(),i=this.getUint32()):(i=this.getUint32(),t=this.getUint32()),4294967296*i+t},getFloat32:function(){var t=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t},getFloat32Array:function(t){for(var i=[],n=0;n<t;n++)i.push(this.getFloat32());return i},getFloat64:function(){var t=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t},getFloat64Array:function(t){for(var i=[],n=0;n<t;n++)i.push(this.getFloat64());return i},getArrayBuffer:function(t){var i=this.dv.buffer.slice(this.offset,this.offset+t);return this.offset+=t,i},getString:function(t){for(var i=[],n=0;n<t;n++)i[n]=this.getUint8();var s=i.indexOf(0);return 0<=s&&(i=i.slice(0,s)),jn.decodeText(new Uint8Array(i))}},fe.prototype={constructor:fe,add:function(t,i){this[t]=i}},Js=[],te=new d,ie=new g;var ge,ye={FBXLoader:ee},Ee=window.fengmap;for(ge in ye)Ee[ge]=ye[ge];I.default=Ee}],s={},e.m=n,e.c=s,e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"st",{value:!0})},e.t=function(i,t){if(1&t&&(i=e(i)),8&t)return i;if(4&t&&"object"==typeof i&&i&&i.st)return i;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:i}),2&t&&"string"!=typeof i)for(var s in i)e.d(n,s,function(t){return i[t]}.bind(null,s));return n},e.n=function(t){var i=t&&t.st?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},e.p="",e(e.s=0).default;function e(t){var i;return(s[t]||(i=s[t]={i:t,l:!1,exports:{}},n[t].call(i.exports,i,i.exports,e),i.l=!0,i)).exports}var n,s});