mxdraw 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mxdraw.umd.js
CHANGED
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
//!\ DECLARE ALIAS AFTER assign prototype !
|
|
17
17
|
Object.assign(Interpolant.prototype,{beforeStart_:Interpolant.prototype.copySampleValue_,afterEnd_:Interpolant.prototype.copySampleValue_}),CubicInterpolant.prototype=Object.assign(Object.create(Interpolant.prototype),{constructor:CubicInterpolant,DefaultSettings_:{endingStart:ZeroCurvatureEnding,endingEnd:ZeroCurvatureEnding},intervalChanged_:function(e,t,n){var r=this.parameterPositions,i=e-2,a=e+1,o=r[i],s=r[a];if(void 0===o)switch(this.getSettings_().endingStart){case ZeroSlopeEnding:i=e,o=2*t-n;break;case WrapAroundEnding:o=t+r[i=r.length-2]-r[i+1];break;default:i=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case ZeroSlopeEnding:a=e,s=2*n-t;break;case WrapAroundEnding:a=1,s=n+r[1]-r[0];break;default:a=e-1,s=t}var l=.5*(n-t),c=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(s-n),this._offsetPrev=i*c,this._offsetNext=a*c},interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,c=this._offsetPrev,u=this._offsetNext,h=this._weightPrev,p=this._weightNext,d=(n-t)/(r-t),f=d*d,m=f*d,g=-h*m+2*h*f-h*d,v=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*d+1,y=(-1-p)*m+(1.5+p)*f+.5*d,x=p*m-p*f,_=0;_!==o;++_)i[_]=g*a[c+_]+v*a[l+_]+y*a[s+_]+x*a[u+_];return i}}),LinearInterpolant.prototype=Object.assign(Object.create(Interpolant.prototype),{constructor:LinearInterpolant,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,c=(n-t)/(r-t),u=1-c,h=0;h!==o;++h)i[h]=a[l+h]*u+a[s+h]*c;return i}}),DiscreteInterpolant.prototype=Object.assign(Object.create(Interpolant.prototype),{constructor:DiscreteInterpolant,interpolate_:function(e){return this.copySampleValue_(e-1)}}),Object.assign(KeyframeTrack,{toJSON:function(e){var t,n=e.constructor;if(void 0!==n.toJSON)t=n.toJSON(e);else{t={name:e.name,times:AnimationUtils.convertArray(e.times,Array),values:AnimationUtils.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t}}),Object.assign(KeyframeTrack.prototype,{constructor:KeyframeTrack,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:InterpolateLinear,InterpolantFactoryMethodDiscrete:function(e){return new DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new LinearInterpolant(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new CubicInterpolant(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case InterpolateDiscrete:t=this.InterpolantFactoryMethodDiscrete;break;case InterpolateLinear:t=this.InterpolantFactoryMethodLinear;break;case InterpolateSmooth:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return InterpolateDiscrete;case this.InterpolantFactoryMethodLinear:return InterpolateLinear;case this.InterpolantFactoryMethodSmooth:return InterpolateSmooth}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,r=t.length;n!==r;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,r=n.length,i=0,a=r-1;i!==r&&n[i]<e;)++i;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==i||a!==r){i>=a&&(i=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=AnimationUtils.arraySlice(n,i,a),this.values=AnimationUtils.arraySlice(this.values,i*o,a*o)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==i;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(null!==a&&a>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(void 0!==r&&AnimationUtils.isTypedArray(r)){o=0;for(var l=r.length;o!==l;++o){var c=r[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),e=!1;break}}}return e},optimize:function(){for(var e=AnimationUtils.arraySlice(this.times),t=AnimationUtils.arraySlice(this.values),n=this.getValueSize(),r=this.getInterpolation()===InterpolateSmooth,i=1,a=e.length-1,o=1;o<a;++o){var s=!1,l=e[o];if(l!==e[o+1]&&(1!==o||l!==l[0]))if(r)s=!0;else for(var c=o*n,u=c-n,h=c+n,p=0;p!==n;++p){var d=t[c+p];if(d!==t[u+p]||d!==t[h+p]){s=!0;break}}if(s){if(o!==i){e[i]=e[o];var f=o*n,m=i*n;for(p=0;p!==n;++p)t[m+p]=t[f+p]}++i}}if(a>0){e[i]=e[a];for(f=a*n,m=i*n,p=0;p!==n;++p)t[m+p]=t[f+p];++i}return i!==e.length?(this.times=AnimationUtils.arraySlice(e,0,i),this.values=AnimationUtils.arraySlice(t,0,i*n)):(this.times=e,this.values=t),this},clone:function(){var e=AnimationUtils.arraySlice(this.times,0),t=AnimationUtils.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),BooleanKeyframeTrack.prototype=Object.assign(Object.create(KeyframeTrack.prototype),{constructor:BooleanKeyframeTrack,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:InterpolateDiscrete,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ColorKeyframeTrack.prototype=Object.assign(Object.create(KeyframeTrack.prototype),{constructor:ColorKeyframeTrack,ValueTypeName:"color"}),NumberKeyframeTrack.prototype=Object.assign(Object.create(KeyframeTrack.prototype),{constructor:NumberKeyframeTrack,ValueTypeName:"number"}),QuaternionLinearInterpolant.prototype=Object.assign(Object.create(Interpolant.prototype),{constructor:QuaternionLinearInterpolant,interpolate_:function(e,t,n,r){for(var i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=(n-t)/(r-t),c=s+o;s!==c;s+=4)Quaternion.slerpFlat(i,0,a,s-o,a,s,l);return i}}),QuaternionKeyframeTrack.prototype=Object.assign(Object.create(KeyframeTrack.prototype),{constructor:QuaternionKeyframeTrack,ValueTypeName:"quaternion",DefaultInterpolation:InterpolateLinear,InterpolantFactoryMethodLinear:function(e){return new QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),StringKeyframeTrack.prototype=Object.assign(Object.create(KeyframeTrack.prototype),{constructor:StringKeyframeTrack,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:InterpolateDiscrete,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),VectorKeyframeTrack.prototype=Object.assign(Object.create(KeyframeTrack.prototype),{constructor:VectorKeyframeTrack,ValueTypeName:"vector"}),Object.assign(AnimationClip,{parse:function(e){for(var t=[],n=e.tracks,r=1/(e.fps||1),i=0,a=n.length;i!==a;++i)t.push(parseKeyframeTrack(n[i]).scale(r));return new AnimationClip(e.name,e.duration,t)},toJSON:function(e){for(var t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid},i=0,a=n.length;i!==a;++i)t.push(KeyframeTrack.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){for(var i=t.length,a=[],o=0;o<i;o++){var s=[],l=[];s.push((o+i-1)%i,o,(o+1)%i),l.push(0,1,0);var c=AnimationUtils.getKeyframeOrder(s);s=AnimationUtils.sortedArray(s,1,c),l=AnimationUtils.sortedArray(l,1,c),r||0!==s[0]||(s.push(i),l.push(l[0])),a.push(new NumberKeyframeTrack(".morphTargetInfluences["+t[o].name+"]",s,l).scale(1/n))}return new AnimationClip(e,-1,a)},findByName:function(e,t){var n=e;if(!Array.isArray(e)){var r=e;n=r.geometry&&r.geometry.animations||r.animations}for(var i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var r={},i=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],l=s.name.match(i);if(l&&l.length>1){var c=r[h=l[1]];c||(r[h]=c=[]),c.push(s)}}var u=[];for(var h in r)u.push(AnimationClip.CreateFromMorphTargetSequence(h,r[h],t,n));return u},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,r,i){if(0!==n.length){var a=[],o=[];AnimationUtils.flattenJSON(n,a,o,r),0!==a.length&&i.push(new e(t,a,o))}},r=[],i=e.name||"default",a=e.length||-1,o=e.fps||30,s=e.hierarchy||[],l=0;l<s.length;l++){var c=s[l].keys;if(c&&0!==c.length)if(c[0].morphTargets){for(var u={},h=0;h<c.length;h++)if(c[h].morphTargets)for(var p=0;p<c[h].morphTargets.length;p++)u[c[h].morphTargets[p]]=-1;for(var d in u){var f=[],m=[];for(p=0;p!==c[h].morphTargets.length;++p){var g=c[h];f.push(g.time),m.push(g.morphTarget===d?1:0)}r.push(new NumberKeyframeTrack(".morphTargetInfluence["+d+"]",f,m))}a=u.length*(o||1)}else{var v=".bones["+t[l].name+"]";n(VectorKeyframeTrack,v+".position",c,"pos",r),n(QuaternionKeyframeTrack,v+".quaternion",c,"rot",r),n(VectorKeyframeTrack,v+".scale",c,"scl",r)}}return 0===r.length?null:new AnimationClip(i,a,r)}}),Object.assign(AnimationClip.prototype,{resetDuration:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var r=this.tracks[t];e=Math.max(e,r.times[r.times.length-1])}return this.duration=e,this},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},validate:function(){for(var e=!0,t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this},clone:function(){for(var e=[],t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new AnimationClip(this.name,this.duration,e)}});var Cache={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function LoadingManager(e,t,n){var r=this,i=!1,a=0,o=0,s=void 0,l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===i&&void 0!==r.onStart&&r.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(i=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){var t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(var t=0,n=l.length;t<n;t+=2){var r=l[t],i=l[t+1];if(r.global&&(r.lastIndex=0),r.test(e))return i}return null}}var DefaultLoadingManager=new LoadingManager;function Loader(e){this.manager=void 0!==e?e:DefaultLoadingManager,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}Object.assign(Loader.prototype,{load:function(){},parse:function(){},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this}});var loading={};function FileLoader(e){Loader.call(this,e)}function AnimationLoader(e){Loader.call(this,e)}function CompressedTextureLoader(e){Loader.call(this,e)}function DataTextureLoader(e){Loader.call(this,e)}function ImageLoader(e){Loader.call(this,e)}function CubeTextureLoader(e){Loader.call(this,e)}function TextureLoader(e){Loader.call(this,e)}function Curve(){this.type="Curve",this.arcLengthDivisions=200}function EllipseCurve(e,t,n,r,i,a,o,s){Curve.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=r||1,this.aStartAngle=i||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function ArcCurve(e,t,n,r,i,a){EllipseCurve.call(this,e,t,n,n,r,i,a),this.type="ArcCurve"}function CubicPoly(){var e=0,t=0,n=0,r=0;function i(i,a,o,s){e=i,t=o,n=-3*i+3*a-2*o-s,r=2*i-2*a+o+s}return{initCatmullRom:function(e,t,n,r,a){i(t,n,a*(n-e),a*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,a,o,s){var l=(t-e)/a-(n-e)/(a+o)+(n-t)/o,c=(n-t)/o-(r-t)/(o+s)+(r-n)/s;i(t,n,l*=o,c*=o)},calc:function(i){var a=i*i;return e+t*i+n*a+r*(a*i)}}}FileLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:FileLoader,load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Cache.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;if(void 0===loading[e]){var o=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(o){var s=o[1],l=!!o[2],c=o[3];c=decodeURIComponent(c),l&&(c=atob(c));try{var u,h=(this.responseType||"").toLowerCase();switch(h){case"arraybuffer":case"blob":for(var p=new Uint8Array(c.length),d=0;d<c.length;d++)p[d]=c.charCodeAt(d);u="blob"===h?new Blob([p.buffer],{type:s}):p.buffer;break;case"document":var f=new DOMParser;u=f.parseFromString(c,s);break;case"json":u=JSON.parse(c);break;default:u=c}setTimeout((function(){t&&t(u),i.manager.itemEnd(e)}),0)}catch(t){setTimeout((function(){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}),0)}}else{loading[e]=[],loading[e].push({onLoad:t,onProgress:n,onError:r});var m=new XMLHttpRequest;for(var g in m.open("GET",e,!0),m.addEventListener("load",(function(t){var n=this.response,r=loading[e];if(delete loading[e],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Cache.add(e,n);for(var a=0,o=r.length;a<o;a++){(s=r[a]).onLoad&&s.onLoad(n)}i.manager.itemEnd(e)}else{for(a=0,o=r.length;a<o;a++){var s;(s=r[a]).onError&&s.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}}),!1),m.addEventListener("progress",(function(t){for(var n=loading[e],r=0,i=n.length;r<i;r++){var a=n[r];a.onProgress&&a.onProgress(t)}}),!1),m.addEventListener("error",(function(t){var n=loading[e];delete loading[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}),!1),m.addEventListener("abort",(function(t){var n=loading[e];delete loading[e];for(var r=0,a=n.length;r<a;r++){var o=n[r];o.onError&&o.onError(t)}i.manager.itemError(e),i.manager.itemEnd(e)}),!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return i.manager.itemStart(e),m}loading[e].push({onLoad:t,onProgress:n,onError:r})},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),AnimationLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:AnimationLoader,load:function(e,t,n,r){var i=this,a=new FileLoader(i.manager);a.setPath(i.path),a.load(e,(function(e){t(i.parse(JSON.parse(e)))}),n,r)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var r=AnimationClip.parse(e[n]);t.push(r)}return t}}),CompressedTextureLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:CompressedTextureLoader,load:function(e,t,n,r){var i=this,a=[],o=new CompressedTexture;o.image=a;var s=new FileLoader(this.manager);function l(l){s.load(e[l],(function(e){var n=i.parse(e,!0);a[l]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(c+=1)&&(1===n.mipmapCount&&(o.minFilter=LinearFilter),o.format=n.format,o.needsUpdate=!0,t&&t(o))}),n,r)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(e))for(var c=0,u=0,h=e.length;u<h;++u)l(u);else s.load(e,(function(e){var n=i.parse(e,!0);if(n.isCubemap)for(var r=n.mipmaps.length/n.mipmapCount,s=0;s<r;s++){a[s]={mipmaps:[]};for(var l=0;l<n.mipmapCount;l++)a[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+l]),a[s].format=n.format,a[s].width=n.width,a[s].height=n.height}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;1===n.mipmapCount&&(o.minFilter=LinearFilter),o.format=n.format,o.needsUpdate=!0,t&&t(o)}),n,r);return o}}),DataTextureLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:DataTextureLoader,load:function(e,t,n,r){var i=this,a=new DataTexture,o=new FileLoader(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(e,(function(e){var n=i.parse(e);n&&(void 0!==n.image?a.image=n.image:void 0!==n.data&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data),a.wrapS=void 0!==n.wrapS?n.wrapS:ClampToEdgeWrapping,a.wrapT=void 0!==n.wrapT?n.wrapT:ClampToEdgeWrapping,a.magFilter=void 0!==n.magFilter?n.magFilter:LinearFilter,a.minFilter=void 0!==n.minFilter?n.minFilter:LinearFilter,a.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(a.format=n.format),void 0!==n.type&&(a.type=n.type),void 0!==n.mipmaps&&(a.mipmaps=n.mipmaps,a.minFilter=LinearMipmapLinearFilter),1===n.mipmapCount&&(a.minFilter=LinearFilter),a.needsUpdate=!0,t&&t(a,n))}),n,r),a}}),ImageLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:ImageLoader,load:function(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Cache.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),Cache.add(e,this),t&&t(this),i.manager.itemEnd(e)}function l(t){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}return o.addEventListener("load",s,!1),o.addEventListener("error",l,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),i.manager.itemStart(e),o.src=e,o}}),CubeTextureLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:CubeTextureLoader,load:function(e,t,n,r){var i=new CubeTexture,a=new ImageLoader(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(n){a.load(e[n],(function(e){i.images[n]=e,6===++o&&(i.needsUpdate=!0,t&&t(i))}),void 0,r)}for(var l=0;l<e.length;++l)s(l);return i}}),TextureLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:TextureLoader,load:function(e,t,n,r){var i=new Texture,a=new ImageLoader(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,(function(n){i.image=n;var r=e.search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/);i.format=r?RGBFormat:RGBAFormat,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}),Object.assign(Curve.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n,r=[],i=this.getPoint(0),a=0;for(r.push(0),n=1;n<=e;n++)a+=(t=this.getPoint(n/e)).distanceTo(i),r.push(a),i=t;return this.cacheArcLengths=r,r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,r=this.getLengths(),i=0,a=r.length;n=t||e*r[a-1];for(var o,s=0,l=a-1;s<=l;)if((o=r[i=Math.floor(s+(l-s)/2)]-n)<0)s=i+1;else{if(!(o>0)){l=i;break}l=i-1}if(r[i=l]===n)return i/(a-1);var c=r[i];return(i+(n-c)/(r[i+1]-c))/(a-1)},getTangent:function(e){var t=1e-4,n=e-t,r=e+t;n<0&&(n=0),r>1&&(r=1);var i=this.getPoint(n);return this.getPoint(r).clone().sub(i).normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var n,r,i,a=new Vector3,o=[],s=[],l=[],c=new Vector3,u=new Matrix4;for(n=0;n<=e;n++)r=n/e,o[n]=this.getTangentAt(r),o[n].normalize();s[0]=new Vector3,l[0]=new Vector3;var h=Number.MAX_VALUE,p=Math.abs(o[0].x),d=Math.abs(o[0].y),f=Math.abs(o[0].z);for(p<=h&&(h=p,a.set(1,0,0)),d<=h&&(h=d,a.set(0,1,0)),f<=h&&a.set(0,0,1),c.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],c),l[0].crossVectors(o[0],s[0]),n=1;n<=e;n++)s[n]=s[n-1].clone(),l[n]=l[n-1].clone(),c.crossVectors(o[n-1],o[n]),c.length()>Number.EPSILON&&(c.normalize(),i=Math.acos(MathUtils.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(u.makeRotationAxis(c,i))),l[n].crossVectors(o[n],s[n]);if(!0===t)for(i=Math.acos(MathUtils.clamp(s[0].dot(s[e]),-1,1)),i/=e,o[0].dot(c.crossVectors(s[0],s[e]))>0&&(i=-i),n=1;n<=e;n++)s[n].applyMatrix4(u.makeRotationAxis(o[n],i*n)),l[n].crossVectors(o[n],s[n]);return{tangents:o,normals:s,binormals:l}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),EllipseCurve.prototype=Object.create(Curve.prototype),EllipseCurve.prototype.constructor=EllipseCurve,EllipseCurve.prototype.isEllipseCurve=!0,EllipseCurve.prototype.getPoint=function(e,t){for(var n=t||new Vector2,r=2*Math.PI,i=this.aEndAngle-this.aStartAngle,a=Math.abs(i)<Number.EPSILON;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=a?0:r),!0!==this.aClockwise||a||(i===r?i=-r:i-=r);var o=this.aStartAngle+e*i,s=this.aX+this.xRadius*Math.cos(o),l=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var c=Math.cos(this.aRotation),u=Math.sin(this.aRotation),h=s-this.aX,p=l-this.aY;s=h*c-p*u+this.aX,l=h*u+p*c+this.aY}return n.set(s,l)},EllipseCurve.prototype.copy=function(e){return Curve.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},EllipseCurve.prototype.toJSON=function(){var e=Curve.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},EllipseCurve.prototype.fromJSON=function(e){return Curve.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},ArcCurve.prototype=Object.create(EllipseCurve.prototype),ArcCurve.prototype.constructor=ArcCurve,ArcCurve.prototype.isArcCurve=!0;var tmp=new Vector3,px=new CubicPoly,py=new CubicPoly,pz=new CubicPoly;function CatmullRomCurve3(e,t,n,r){Curve.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=r||.5}function CatmullRom(e,t,n,r,i){var a=.5*(r-t),o=.5*(i-n),s=e*e;return(2*n-2*r+a+o)*(e*s)+(-3*n+3*r-2*a-o)*s+a*e+n}function QuadraticBezierP0(e,t){var n=1-e;return n*n*t}function QuadraticBezierP1(e,t){return 2*(1-e)*e*t}function QuadraticBezierP2(e,t){return e*e*t}function QuadraticBezier(e,t,n,r){return QuadraticBezierP0(e,t)+QuadraticBezierP1(e,n)+QuadraticBezierP2(e,r)}function CubicBezierP0(e,t){var n=1-e;return n*n*n*t}function CubicBezierP1(e,t){var n=1-e;return 3*n*n*e*t}function CubicBezierP2(e,t){return 3*(1-e)*e*e*t}function CubicBezierP3(e,t){return e*e*e*t}function CubicBezier(e,t,n,r,i){return CubicBezierP0(e,t)+CubicBezierP1(e,n)+CubicBezierP2(e,r)+CubicBezierP3(e,i)}function CubicBezierCurve(e,t,n,r){Curve.call(this),this.type="CubicBezierCurve",this.v0=e||new Vector2,this.v1=t||new Vector2,this.v2=n||new Vector2,this.v3=r||new Vector2}function CubicBezierCurve3(e,t,n,r){Curve.call(this),this.type="CubicBezierCurve3",this.v0=e||new Vector3,this.v1=t||new Vector3,this.v2=n||new Vector3,this.v3=r||new Vector3}function LineCurve(e,t){Curve.call(this),this.type="LineCurve",this.v1=e||new Vector2,this.v2=t||new Vector2}function LineCurve3(e,t){Curve.call(this),this.type="LineCurve3",this.v1=e||new Vector3,this.v2=t||new Vector3}function QuadraticBezierCurve(e,t,n){Curve.call(this),this.type="QuadraticBezierCurve",this.v0=e||new Vector2,this.v1=t||new Vector2,this.v2=n||new Vector2}function QuadraticBezierCurve3(e,t,n){Curve.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new Vector3,this.v1=t||new Vector3,this.v2=n||new Vector3}function SplineCurve(e){Curve.call(this),this.type="SplineCurve",this.points=e||[]}CatmullRomCurve3.prototype=Object.create(Curve.prototype),CatmullRomCurve3.prototype.constructor=CatmullRomCurve3,CatmullRomCurve3.prototype.isCatmullRomCurve3=!0,CatmullRomCurve3.prototype.getPoint=function(e,t){var n,r,i,a,o=t||new Vector3,s=this.points,l=s.length,c=(l-(this.closed?0:1))*e,u=Math.floor(c),h=c-u;if(this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/l)+1)*l:0===h&&u===l-1&&(u=l-2,h=1),this.closed||u>0?n=s[(u-1)%l]:(tmp.subVectors(s[0],s[1]).add(s[0]),n=tmp),r=s[u%l],i=s[(u+1)%l],this.closed||u+2<l?a=s[(u+2)%l]:(tmp.subVectors(s[l-1],s[l-2]).add(s[l-1]),a=tmp),"centripetal"===this.curveType||"chordal"===this.curveType){var p="chordal"===this.curveType?.5:.25,d=Math.pow(n.distanceToSquared(r),p),f=Math.pow(r.distanceToSquared(i),p),m=Math.pow(i.distanceToSquared(a),p);f<1e-4&&(f=1),d<1e-4&&(d=f),m<1e-4&&(m=f),px.initNonuniformCatmullRom(n.x,r.x,i.x,a.x,d,f,m),py.initNonuniformCatmullRom(n.y,r.y,i.y,a.y,d,f,m),pz.initNonuniformCatmullRom(n.z,r.z,i.z,a.z,d,f,m)}else"catmullrom"===this.curveType&&(px.initCatmullRom(n.x,r.x,i.x,a.x,this.tension),py.initCatmullRom(n.y,r.y,i.y,a.y,this.tension),pz.initCatmullRom(n.z,r.z,i.z,a.z,this.tension));return o.set(px.calc(h),py.calc(h),pz.calc(h)),o},CatmullRomCurve3.prototype.copy=function(e){Curve.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},CatmullRomCurve3.prototype.toJSON=function(){var e=Curve.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},CatmullRomCurve3.prototype.fromJSON=function(e){Curve.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new Vector3).fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},CubicBezierCurve.prototype=Object.create(Curve.prototype),CubicBezierCurve.prototype.constructor=CubicBezierCurve,CubicBezierCurve.prototype.isCubicBezierCurve=!0,CubicBezierCurve.prototype.getPoint=function(e,t){var n=t||new Vector2,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(CubicBezier(e,r.x,i.x,a.x,o.x),CubicBezier(e,r.y,i.y,a.y,o.y)),n},CubicBezierCurve.prototype.copy=function(e){return Curve.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},CubicBezierCurve.prototype.toJSON=function(){var e=Curve.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},CubicBezierCurve.prototype.fromJSON=function(e){return Curve.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},CubicBezierCurve3.prototype=Object.create(Curve.prototype),CubicBezierCurve3.prototype.constructor=CubicBezierCurve3,CubicBezierCurve3.prototype.isCubicBezierCurve3=!0,CubicBezierCurve3.prototype.getPoint=function(e,t){var n=t||new Vector3,r=this.v0,i=this.v1,a=this.v2,o=this.v3;return n.set(CubicBezier(e,r.x,i.x,a.x,o.x),CubicBezier(e,r.y,i.y,a.y,o.y),CubicBezier(e,r.z,i.z,a.z,o.z)),n},CubicBezierCurve3.prototype.copy=function(e){return Curve.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},CubicBezierCurve3.prototype.toJSON=function(){var e=Curve.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},CubicBezierCurve3.prototype.fromJSON=function(e){return Curve.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},LineCurve.prototype=Object.create(Curve.prototype),LineCurve.prototype.constructor=LineCurve,LineCurve.prototype.isLineCurve=!0,LineCurve.prototype.getPoint=function(e,t){var n=t||new Vector2;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},LineCurve.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},LineCurve.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},LineCurve.prototype.copy=function(e){return Curve.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},LineCurve.prototype.toJSON=function(){var e=Curve.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},LineCurve.prototype.fromJSON=function(e){return Curve.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},LineCurve3.prototype=Object.create(Curve.prototype),LineCurve3.prototype.constructor=LineCurve3,LineCurve3.prototype.isLineCurve3=!0,LineCurve3.prototype.getPoint=function(e,t){var n=t||new Vector3;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},LineCurve3.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},LineCurve3.prototype.copy=function(e){return Curve.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},LineCurve3.prototype.toJSON=function(){var e=Curve.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},LineCurve3.prototype.fromJSON=function(e){return Curve.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},QuadraticBezierCurve.prototype=Object.create(Curve.prototype),QuadraticBezierCurve.prototype.constructor=QuadraticBezierCurve,QuadraticBezierCurve.prototype.isQuadraticBezierCurve=!0,QuadraticBezierCurve.prototype.getPoint=function(e,t){var n=t||new Vector2,r=this.v0,i=this.v1,a=this.v2;return n.set(QuadraticBezier(e,r.x,i.x,a.x),QuadraticBezier(e,r.y,i.y,a.y)),n},QuadraticBezierCurve.prototype.copy=function(e){return Curve.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},QuadraticBezierCurve.prototype.toJSON=function(){var e=Curve.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},QuadraticBezierCurve.prototype.fromJSON=function(e){return Curve.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},QuadraticBezierCurve3.prototype=Object.create(Curve.prototype),QuadraticBezierCurve3.prototype.constructor=QuadraticBezierCurve3,QuadraticBezierCurve3.prototype.isQuadraticBezierCurve3=!0,QuadraticBezierCurve3.prototype.getPoint=function(e,t){var n=t||new Vector3,r=this.v0,i=this.v1,a=this.v2;return n.set(QuadraticBezier(e,r.x,i.x,a.x),QuadraticBezier(e,r.y,i.y,a.y),QuadraticBezier(e,r.z,i.z,a.z)),n},QuadraticBezierCurve3.prototype.copy=function(e){return Curve.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},QuadraticBezierCurve3.prototype.toJSON=function(){var e=Curve.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},QuadraticBezierCurve3.prototype.fromJSON=function(e){return Curve.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},SplineCurve.prototype=Object.create(Curve.prototype),SplineCurve.prototype.constructor=SplineCurve,SplineCurve.prototype.isSplineCurve=!0,SplineCurve.prototype.getPoint=function(e,t){var n=t||new Vector2,r=this.points,i=(r.length-1)*e,a=Math.floor(i),o=i-a,s=r[0===a?a:a-1],l=r[a],c=r[a>r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return n.set(CatmullRom(o,s.x,l.x,c.x,u.x),CatmullRom(o,s.y,l.y,c.y,u.y)),n},SplineCurve.prototype.copy=function(e){Curve.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push(r.clone())}return this},SplineCurve.prototype.toJSON=function(){var e=Curve.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var r=this.points[t];e.points.push(r.toArray())}return e},SplineCurve.prototype.fromJSON=function(e){Curve.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var r=e.points[t];this.points.push((new Vector2).fromArray(r))}return this};var Curves=Object.freeze({__proto__:null,ArcCurve:ArcCurve,CatmullRomCurve3:CatmullRomCurve3,CubicBezierCurve:CubicBezierCurve,CubicBezierCurve3:CubicBezierCurve3,EllipseCurve:EllipseCurve,LineCurve:LineCurve,LineCurve3:LineCurve3,QuadraticBezierCurve:QuadraticBezierCurve,QuadraticBezierCurve3:QuadraticBezierCurve3,SplineCurve:SplineCurve});function CurvePath(){Curve.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Path(e){CurvePath.call(this),this.type="Path",this.currentPoint=new Vector2,e&&this.setFromPoints(e)}function Shape(e){Path.call(this,e),this.uuid=MathUtils.generateUUID(),this.type="Shape",this.holes=[]}function Light(e,t){Object3D.call(this),this.type="Light",this.color=new Color(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function HemisphereLight(e,t,n){Light.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Object3D.DefaultUp),this.updateMatrix(),this.groundColor=new Color(t)}function LightShadow(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new Vector2(512,512),this.map=null,this.mapPass=null,this.matrix=new Matrix4,this._frustum=new Frustum,this._frameExtents=new Vector2(1,1),this._viewportCount=1,this._viewports=[new Vector4(0,0,1,1)]}function SpotLightShadow(){LightShadow.call(this,new PerspectiveCamera(50,1,.5,500))}function SpotLight(e,t,n,r,i,a){Light.call(this,e,t),this.type="SpotLight",this.position.copy(Object3D.DefaultUp),this.updateMatrix(),this.target=new Object3D,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==a?a:1,this.shadow=new SpotLightShadow}function PointLightShadow(){LightShadow.call(this,new PerspectiveCamera(90,1,.5,500)),this._frameExtents=new Vector2(4,2),this._viewportCount=6,this._viewports=[new Vector4(2,1,1,1),new Vector4(0,1,1,1),new Vector4(3,1,1,1),new Vector4(1,1,1,1),new Vector4(3,0,1,1),new Vector4(1,0,1,1)],this._cubeDirections=[new Vector3(1,0,0),new Vector3(-1,0,0),new Vector3(0,0,1),new Vector3(0,0,-1),new Vector3(0,1,0),new Vector3(0,-1,0)],this._cubeUps=[new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,0,1),new Vector3(0,0,-1)]}function PointLight(e,t,n,r){Light.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==r?r:1,this.shadow=new PointLightShadow}function OrthographicCamera(e,t,n,r,i,a){Camera.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==e?e:-1,this.right=void 0!==t?t:1,this.top=void 0!==n?n:1,this.bottom=void 0!==r?r:-1,this.near=void 0!==i?i:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function DirectionalLightShadow(){LightShadow.call(this,new OrthographicCamera(-5,5,5,-5,.5,500))}function DirectionalLight(e,t){Light.call(this,e,t),this.type="DirectionalLight",this.position.copy(Object3D.DefaultUp),this.updateMatrix(),this.target=new Object3D,this.shadow=new DirectionalLightShadow}function AmbientLight(e,t){Light.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function RectAreaLight(e,t,n,r){Light.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==r?r:10}function MaterialLoader(e){Loader.call(this,e),this.textures={}}CurvePath.prototype=Object.assign(Object.create(Curve.prototype),{constructor:CurvePath,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new LineCurve(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=t){var i=n[r]-t,a=this.curves[r],o=a.getLength(),s=0===o?0:1-i/o;return a.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],r=0,i=this.curves;r<i.length;r++)for(var a=i[r],o=a&&a.isEllipseCurve?2*e:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?e*a.points.length:e,s=a.getPoints(o),l=0;l<s.length;l++){var c=s[l];t&&t.equals(c)||(n.push(c),t=c)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){Curve.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=Curve.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var r=this.curves[t];e.curves.push(r.toJSON())}return e},fromJSON:function(e){Curve.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var r=e.curves[t];this.curves.push((new Curves[r.type]).fromJSON(r))}return this}}),Path.prototype=Object.assign(Object.create(CurvePath.prototype),{constructor:Path,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this},moveTo:function(e,t){return this.currentPoint.set(e,t),this},lineTo:function(e,t){var n=new LineCurve(this.currentPoint.clone(),new Vector2(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this},quadraticCurveTo:function(e,t,n,r){var i=new QuadraticBezierCurve(this.currentPoint.clone(),new Vector2(e,t),new Vector2(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this},bezierCurveTo:function(e,t,n,r,i,a){var o=new CubicBezierCurve(this.currentPoint.clone(),new Vector2(e,t),new Vector2(n,r),new Vector2(i,a));return this.curves.push(o),this.currentPoint.set(i,a),this},splineThru:function(e){var t=new SplineCurve([this.currentPoint.clone()].concat(e));return this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this},arc:function(e,t,n,r,i,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,r,i,a),this},absarc:function(e,t,n,r,i,a){return this.absellipse(e,t,n,n,r,i,a),this},ellipse:function(e,t,n,r,i,a,o,s){var l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(e+l,t+c,n,r,i,a,o,s),this},absellipse:function(e,t,n,r,i,a,o,s){var l=new EllipseCurve(e,t,n,r,i,a,o,s);if(this.curves.length>0){var c=l.getPoint(0);c.equals(this.currentPoint)||this.lineTo(c.x,c.y)}this.curves.push(l);var u=l.getPoint(1);return this.currentPoint.copy(u),this},copy:function(e){return CurvePath.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=CurvePath.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return CurvePath.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Shape.prototype=Object.assign(Object.create(Path.prototype),{constructor:Shape,getPointsHoles:function(e){for(var t=[],n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){Path.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push(r.clone())}return this},toJSON:function(){var e=Path.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var r=this.holes[t];e.holes.push(r.toJSON())}return e},fromJSON:function(e){Path.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var r=e.holes[t];this.holes.push((new Path).fromJSON(r))}return this}}),Light.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:Light,isLight:!0,copy:function(e){return Object3D.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=Object3D.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),HemisphereLight.prototype=Object.assign(Object.create(Light.prototype),{constructor:HemisphereLight,isHemisphereLight:!0,copy:function(e){return Light.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(LightShadow.prototype,{_projScreenMatrix:new Matrix4,_lightPositionWorld:new Vector3,_lookTarget:new Vector3,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(e){var t=this.camera,n=this.matrix,r=this._projScreenMatrix,i=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(e.matrixWorld),t.position.copy(a),i.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(i),t.updateMatrixWorld(),r.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(r),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)},getViewport:function(e){return this._viewports[e]},getFrameExtents:function(){return this._frameExtents},copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),SpotLightShadow.prototype=Object.assign(Object.create(LightShadow.prototype),{constructor:SpotLightShadow,isSpotLightShadow:!0,updateMatrices:function(e){var t=this.camera,n=2*MathUtils.RAD2DEG*e.angle,r=this.mapSize.width/this.mapSize.height,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),LightShadow.prototype.updateMatrices.call(this,e)}}),SpotLight.prototype=Object.assign(Object.create(Light.prototype),{constructor:SpotLight,isSpotLight:!0,copy:function(e){return Light.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),PointLightShadow.prototype=Object.assign(Object.create(LightShadow.prototype),{constructor:PointLightShadow,isPointLightShadow:!0,updateMatrices:function(e,t){void 0===t&&(t=0);var n=this.camera,r=this.matrix,i=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;i.setFromMatrixPosition(e.matrixWorld),n.position.copy(i),a.copy(n.position),a.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(a),n.updateMatrixWorld(),r.makeTranslation(-i.x,-i.y,-i.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}}),PointLight.prototype=Object.assign(Object.create(Light.prototype),{constructor:PointLight,isPointLight:!0,copy:function(e){return Light.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),OrthographicCamera.prototype=Object.assign(Object.create(Camera.prototype),{constructor:OrthographicCamera,isOrthographicCamera:!0,copy:function(e,t){return Camera.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,r,i,a){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2,i=n-e,a=n+e,o=r+t,s=r-t;if(null!==this.view&&this.view.enabled){var l=(this.right-this.left)/this.view.fullWidth/this.zoom,c=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a=(i+=l*this.view.offsetX)+l*this.view.width,s=(o-=c*this.view.offsetY)-c*this.view.height}this.projectionMatrix.makeOrthographic(i,a,o,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=Object3D.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}),DirectionalLightShadow.prototype=Object.assign(Object.create(LightShadow.prototype),{constructor:DirectionalLightShadow,isDirectionalLightShadow:!0,updateMatrices:function(e){LightShadow.prototype.updateMatrices.call(this,e)}}),DirectionalLight.prototype=Object.assign(Object.create(Light.prototype),{constructor:DirectionalLight,isDirectionalLight:!0,copy:function(e){return Light.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),AmbientLight.prototype=Object.assign(Object.create(Light.prototype),{constructor:AmbientLight,isAmbientLight:!0}),RectAreaLight.prototype=Object.assign(Object.create(Light.prototype),{constructor:RectAreaLight,isRectAreaLight:!0,copy:function(e){return Light.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=Light.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),MaterialLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:MaterialLoader,load:function(e,t,n,r){var i=this,a=new FileLoader(i.manager);a.setPath(i.path),a.load(e,(function(e){t(i.parse(JSON.parse(e)))}),n,r)},parse:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]}var r=new Materials[e.type];if(void 0!==e.uuid&&(r.uuid=e.uuid),void 0!==e.name&&(r.name=e.name),void 0!==e.color&&r.color.setHex(e.color),void 0!==e.roughness&&(r.roughness=e.roughness),void 0!==e.metalness&&(r.metalness=e.metalness),void 0!==e.sheen&&(r.sheen=(new Color).setHex(e.sheen)),void 0!==e.emissive&&r.emissive.setHex(e.emissive),void 0!==e.specular&&r.specular.setHex(e.specular),void 0!==e.shininess&&(r.shininess=e.shininess),void 0!==e.clearcoat&&(r.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(r.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.vertexColors&&(r.vertexColors=e.vertexColors),void 0!==e.fog&&(r.fog=e.fog),void 0!==e.flatShading&&(r.flatShading=e.flatShading),void 0!==e.blending&&(r.blending=e.blending),void 0!==e.combine&&(r.combine=e.combine),void 0!==e.side&&(r.side=e.side),void 0!==e.opacity&&(r.opacity=e.opacity),void 0!==e.transparent&&(r.transparent=e.transparent),void 0!==e.alphaTest&&(r.alphaTest=e.alphaTest),void 0!==e.depthTest&&(r.depthTest=e.depthTest),void 0!==e.depthWrite&&(r.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(r.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(r.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(r.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(r.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(r.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(r.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(r.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(r.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(r.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(r.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(r.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(r.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(r.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(r.rotation=e.rotation),1!==e.linewidth&&(r.linewidth=e.linewidth),void 0!==e.dashSize&&(r.dashSize=e.dashSize),void 0!==e.gapSize&&(r.gapSize=e.gapSize),void 0!==e.scale&&(r.scale=e.scale),void 0!==e.polygonOffset&&(r.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(r.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(r.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(r.skinning=e.skinning),void 0!==e.morphTargets&&(r.morphTargets=e.morphTargets),void 0!==e.morphNormals&&(r.morphNormals=e.morphNormals),void 0!==e.dithering&&(r.dithering=e.dithering),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.toneMapped&&(r.toneMapped=e.toneMapped),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.uniforms)for(var i in e.uniforms){var a=e.uniforms[i];switch(r.uniforms[i]={},a.type){case"t":r.uniforms[i].value=n(a.value);break;case"c":r.uniforms[i].value=(new Color).setHex(a.value);break;case"v2":r.uniforms[i].value=(new Vector2).fromArray(a.value);break;case"v3":r.uniforms[i].value=(new Vector3).fromArray(a.value);break;case"v4":r.uniforms[i].value=(new Vector4).fromArray(a.value);break;case"m3":r.uniforms[i].value=(new Matrix3).fromArray(a.value);case"m4":r.uniforms[i].value=(new Matrix4).fromArray(a.value);break;default:r.uniforms[i].value=a.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var o in e.extensions)r.extensions[o]=e.extensions[o];if(void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap),r.transparent=!0),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){var s=e.normalScale;!1===Array.isArray(s)&&(s=[s,s]),r.normalScale=(new Vector2).fromArray(s)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new Vector2).fromArray(e.clearcoatNormalScale)),r},setTextures:function(e){return this.textures=e,this}});var LoaderUtils={decodeText:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}},extractUrlBase:function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}};function InstancedBufferGeometry(){BufferGeometry.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function InstancedBufferAttribute(e,t,n,r){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),BufferAttribute.call(this,e,t,n),this.meshPerAttribute=r||1}function BufferGeometryLoader(e){Loader.call(this,e)}InstancedBufferGeometry.prototype=Object.assign(Object.create(BufferGeometry.prototype),{constructor:InstancedBufferGeometry,isInstancedBufferGeometry:!0,copy:function(e){return BufferGeometry.prototype.copy.call(this,e),this.maxInstancedCount=e.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e=BufferGeometry.prototype.toJSON.call(this);return e.maxInstancedCount=this.maxInstancedCount,e.isInstancedBufferGeometry=!0,e}}),InstancedBufferAttribute.prototype=Object.assign(Object.create(BufferAttribute.prototype),{constructor:InstancedBufferAttribute,isInstancedBufferAttribute:!0,copy:function(e){return BufferAttribute.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=BufferAttribute.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}),BufferGeometryLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:BufferGeometryLoader,load:function(e,t,n,r){var i=this,a=new FileLoader(i.manager);a.setPath(i.path),a.load(e,(function(e){t(i.parse(JSON.parse(e)))}),n,r)},parse:function(e){var t=e.isInstancedBufferGeometry?new InstancedBufferGeometry:new BufferGeometry,n=e.data.index;if(void 0!==n){var r=new TYPED_ARRAYS[n.type](n.array);t.setIndex(new BufferAttribute(r,1))}var i=e.data.attributes;for(var a in i){var o=i[a],s=(r=new TYPED_ARRAYS[o.type](o.array),new(o.isInstancedBufferAttribute?InstancedBufferAttribute:BufferAttribute)(r,o.itemSize,o.normalized));void 0!==o.name&&(s.name=o.name),t.setAttribute(a,s)}var l=e.data.morphAttributes;if(l)for(var a in l){for(var c=l[a],u=[],h=0,p=c.length;h<p;h++){o=c[h],s=new BufferAttribute(r=new TYPED_ARRAYS[o.type](o.array),o.itemSize,o.normalized);void 0!==o.name&&(s.name=o.name),u.push(s)}t.morphAttributes[a]=u}e.data.morphTargetsRelative&&(t.morphTargetsRelative=!0);var d=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==d){h=0;for(var f=d.length;h!==f;++h){var m=d[h];t.addGroup(m.start,m.count,m.materialIndex)}}var g=e.data.boundingSphere;if(void 0!==g){var v=new Vector3;void 0!==g.center&&v.fromArray(g.center),t.boundingSphere=new Sphere(v,g.radius)}return e.name&&(t.name=e.name),e.userData&&(t.userData=e.userData),t}});var TYPED_ARRAYS={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function ObjectLoader(e){Loader.call(this,e)}ObjectLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:ObjectLoader,load:function(e,t,n,r){var i=this,a=""===this.path?LoaderUtils.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;var o=new FileLoader(i.manager);o.setPath(this.path),o.load(e,(function(n){var a=null;try{a=JSON.parse(n)}catch(t){return void 0!==r&&r(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}var o=a.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?i.parse(a,t):console.error("THREE.ObjectLoader: Can't load "+e)}),n,r)},parse:function(e,t){var n=this.parseShape(e.shapes),r=this.parseGeometries(e.geometries,n),i=this.parseImages(e.images,(function(){void 0!==t&&t(s)})),a=this.parseTextures(e.textures,i),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,r,o);return e.animations&&(s.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},parseShape:function(e){var t={};if(void 0!==e)for(var n=0,r=e.length;n<r;n++){var i=(new Shape).fromJSON(e[n]);t[i.uuid]=i}return t},parseGeometries:function(e,t){var n={};if(void 0!==e)for(var r=new BufferGeometryLoader,i=0,a=e.length;i<a;i++){var o,s=e[i];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new Geometries[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new Geometries[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new Geometries[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new Geometries[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new Geometries[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new Geometries[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":o=new Geometries[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new Geometries[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new Geometries[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new Geometries[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new Geometries[s.type]((new Curves[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new Geometries[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new Geometries[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var l=[],c=0,u=s.shapes.length;c<u;c++){var h=t[s.shapes[c]];l.push(h)}o=new Geometries[s.type](l,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(l=[],c=0,u=s.shapes.length;c<u;c++){h=t[s.shapes[c]];l.push(h)}var p=s.options.extrudePath;void 0!==p&&(s.options.extrudePath=(new Curves[p.type]).fromJSON(p)),o=new Geometries[s.type](l,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=r.parse(s);break;case"Geometry":if("THREE"in window&&"LegacyJSONLoader"in THREE)o=(new THREE.LegacyJSONLoader).parse(s,this.resourcePath).geometry;else console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),!0===o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}return n},parseMaterials:function(e,t){var n={},r={};if(void 0!==e){var i=new MaterialLoader;i.setTextures(t);for(var a=0,o=e.length;a<o;a++){var s=e[a];if("MultiMaterial"===s.type){for(var l=[],c=0;c<s.materials.length;c++){var u=s.materials[c];void 0===n[u.uuid]&&(n[u.uuid]=i.parse(u)),l.push(n[u.uuid])}r[s.uuid]=l}else void 0===n[s.uuid]&&(n[s.uuid]=i.parse(s)),r[s.uuid]=n[s.uuid]}}return r},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=AnimationClip.parse(r);void 0!==r.uuid&&(i.uuid=r.uuid),t.push(i)}return t},parseImages:function(e,t){var n=this,r={};function i(e){return n.manager.itemStart(e),a.load(e,(function(){n.manager.itemEnd(e)}),void 0,(function(){n.manager.itemError(e),n.manager.itemEnd(e)}))}if(void 0!==e&&e.length>0){var a=new ImageLoader(new LoadingManager(t));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=e.length;o<s;o++){var l=e[o],c=l.url;if(Array.isArray(c)){r[l.uuid]=[];for(var u=0,h=c.length;u<h;u++){var p=c[u],d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(p)?p:n.resourcePath+p;r[l.uuid].push(i(d))}}else{d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:n.resourcePath+l.url;r[l.uuid]=i(d)}}}return r},parseTextures:function(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var r={};if(void 0!==e)for(var i=0,a=e.length;i<a;i++){var o,s=e[i];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),(o=Array.isArray(t[s.image])?new CubeTexture(t[s.image]):new Texture(t[s.image])).needsUpdate=!0,o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.mapping&&(o.mapping=n(s.mapping,TEXTURE_MAPPING)),void 0!==s.offset&&o.offset.fromArray(s.offset),void 0!==s.repeat&&o.repeat.fromArray(s.repeat),void 0!==s.center&&o.center.fromArray(s.center),void 0!==s.rotation&&(o.rotation=s.rotation),void 0!==s.wrap&&(o.wrapS=n(s.wrap[0],TEXTURE_WRAPPING),o.wrapT=n(s.wrap[1],TEXTURE_WRAPPING)),void 0!==s.format&&(o.format=s.format),void 0!==s.type&&(o.type=s.type),void 0!==s.encoding&&(o.encoding=s.encoding),void 0!==s.minFilter&&(o.minFilter=n(s.minFilter,TEXTURE_FILTER)),void 0!==s.magFilter&&(o.magFilter=n(s.magFilter,TEXTURE_FILTER)),void 0!==s.anisotropy&&(o.anisotropy=s.anisotropy),void 0!==s.flipY&&(o.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(o.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(o.unpackAlignment=s.unpackAlignment),r[s.uuid]=o}return r},parseObject:function(e,t,n){var r;function i(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function a(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],r=0,i=e.length;r<i;r++){var a=e[r];void 0===n[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),t.push(n[a])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}switch(e.type){case"Scene":r=new Scene,void 0!==e.background&&Number.isInteger(e.background)&&(r.background=new Color(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?r.fog=new Fog(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(r.fog=new FogExp2(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":r=new PerspectiveCamera(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(r.focus=e.focus),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.filmGauge&&(r.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(r.filmOffset=e.filmOffset),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"OrthographicCamera":r=new OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(r.zoom=e.zoom),void 0!==e.view&&(r.view=Object.assign({},e.view));break;case"AmbientLight":r=new AmbientLight(e.color,e.intensity);break;case"DirectionalLight":r=new DirectionalLight(e.color,e.intensity);break;case"PointLight":r=new PointLight(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":r=new RectAreaLight(e.color,e.intensity,e.width,e.height);break;case"SpotLight":r=new SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":r=new HemisphereLight(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=i(e.geometry),s=a(e.material);r=o.bones&&o.bones.length>0?new SkinnedMesh(o,s):new Mesh(o,s);break;case"InstancedMesh":o=i(e.geometry),s=a(e.material);var l=e.count,c=e.instanceMatrix;(r=new InstancedMesh(o,s,l)).instanceMatrix=new BufferAttribute(new Float32Array(c.array),16);break;case"LOD":r=new LOD;break;case"Line":r=new Line(i(e.geometry),a(e.material),e.mode);break;case"LineLoop":r=new LineLoop(i(e.geometry),a(e.material));break;case"LineSegments":r=new LineSegments(i(e.geometry),a(e.material));break;case"PointCloud":case"Points":r=new Points(i(e.geometry),a(e.material));break;case"Sprite":r=new Sprite(a(e.material));break;case"Group":r=new Group;break;default:r=new Object3D}if(r.uuid=e.uuid,void 0!==e.name&&(r.name=e.name),void 0!==e.matrix?(r.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(r.matrixAutoUpdate=e.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(void 0!==e.position&&r.position.fromArray(e.position),void 0!==e.rotation&&r.rotation.fromArray(e.rotation),void 0!==e.quaternion&&r.quaternion.fromArray(e.quaternion),void 0!==e.scale&&r.scale.fromArray(e.scale)),void 0!==e.castShadow&&(r.castShadow=e.castShadow),void 0!==e.receiveShadow&&(r.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(r.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(r.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&r.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(r.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(r.visible=e.visible),void 0!==e.frustumCulled&&(r.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(r.renderOrder=e.renderOrder),void 0!==e.userData&&(r.userData=e.userData),void 0!==e.layers&&(r.layers.mask=e.layers),void 0!==e.children)for(var u=e.children,h=0;h<u.length;h++)r.add(this.parseObject(u[h],t,n));if("LOD"===e.type){void 0!==e.autoUpdate&&(r.autoUpdate=e.autoUpdate);for(var p=e.levels,d=0;d<p.length;d++){var f=p[d],m=r.getObjectByProperty("uuid",f.object);void 0!==m&&r.addLevel(m,f.distance)}}return r}});var TEXTURE_MAPPING={UVMapping:UVMapping,CubeReflectionMapping:CubeReflectionMapping,CubeRefractionMapping:CubeRefractionMapping,EquirectangularReflectionMapping:EquirectangularReflectionMapping,EquirectangularRefractionMapping:EquirectangularRefractionMapping,SphericalReflectionMapping:SphericalReflectionMapping,CubeUVReflectionMapping:CubeUVReflectionMapping,CubeUVRefractionMapping:CubeUVRefractionMapping},TEXTURE_WRAPPING={RepeatWrapping:RepeatWrapping,ClampToEdgeWrapping:ClampToEdgeWrapping,MirroredRepeatWrapping:MirroredRepeatWrapping},TEXTURE_FILTER={NearestFilter:NearestFilter,NearestMipmapNearestFilter:NearestMipmapNearestFilter,NearestMipmapLinearFilter:NearestMipmapLinearFilter,LinearFilter:LinearFilter,LinearMipmapNearestFilter:LinearMipmapNearestFilter,LinearMipmapLinearFilter:LinearMipmapLinearFilter},_context;function ImageBitmapLoader(e){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),Loader.call(this,e),this.options=void 0}function ShapePath(){this.type="ShapePath",this.color=new Color,this.subPaths=[],this.currentPath=null}function Font(e){this.type="Font",this.data=e}function createPaths(e,t,n){for(var r=Array.from?Array.from(e):String(e).split(""),i=t/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,o=[],s=0,l=0,c=0;c<r.length;c++){var u=r[c];if("\n"===u)s=0,l-=a;else{var h=createPath(u,i,s,l,n);s+=h.offsetX,o.push(h.path)}}return o}function createPath(e,t,n,r,i){var a=i.glyphs[e]||i.glyphs["?"];if(a){var o,s,l,c,u,h,p,d,f=new ShapePath;if(a.o)for(var m=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),g=0,v=m.length;g<v;){switch(m[g++]){case"m":o=m[g++]*t+n,s=m[g++]*t+r,f.moveTo(o,s);break;case"l":o=m[g++]*t+n,s=m[g++]*t+r,f.lineTo(o,s);break;case"q":l=m[g++]*t+n,c=m[g++]*t+r,u=m[g++]*t+n,h=m[g++]*t+r,f.quadraticCurveTo(u,h,l,c);break;case"b":l=m[g++]*t+n,c=m[g++]*t+r,u=m[g++]*t+n,h=m[g++]*t+r,p=m[g++]*t+n,d=m[g++]*t+r,f.bezierCurveTo(u,h,p,d,l,c)}}return{offsetX:a.ha*t,path:f}}console.error('THREE.Font: character "'+e+'" does not exists in font family '+i.familyName+".")}function FontLoader(e){Loader.call(this,e)}ImageBitmapLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:ImageBitmapLoader,setOptions:function(e){return this.options=e,this},load:function(e,t,n,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,a=Cache.get(e);if(void 0!==a)return i.manager.itemStart(e),setTimeout((function(){t&&t(a),i.manager.itemEnd(e)}),0),a;fetch(e).then((function(e){return e.blob()})).then((function(e){return void 0===i.options?createImageBitmap(e):createImageBitmap(e,i.options)})).then((function(n){Cache.add(e,n),t&&t(n),i.manager.itemEnd(e)})).catch((function(t){r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)})),i.manager.itemStart(e)}}),Object.assign(ShapePath.prototype,{moveTo:function(e,t){return this.currentPath=new Path,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this},lineTo:function(e,t){return this.currentPath.lineTo(e,t),this},quadraticCurveTo:function(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this},bezierCurveTo:function(e,t,n,r,i,a){return this.currentPath.bezierCurveTo(e,t,n,r,i,a),this},splineThru:function(e){return this.currentPath.splineThru(e),this},toShapes:function(e,t){function n(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n],a=new Shape;a.curves=i.curves,t.push(a)}return t}function r(e,t){for(var n=t.length,r=!1,i=n-1,a=0;a<n;i=a++){var o=t[i],s=t[a],l=s.x-o.x,c=s.y-o.y;if(Math.abs(c)>Number.EPSILON){if(c<0&&(o=t[a],l=-l,s=t[i],c=-c),e.y<o.y||e.y>s.y)continue;if(e.y===o.y){if(e.x===o.x)return!0}else{var u=c*(e.x-o.x)-l*(e.y-o.y);if(0===u)return!0;if(u<0)continue;r=!r}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return r}var i=ShapeUtils.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return n(a);var o,s,l,c=[];if(1===a.length)return s=a[0],(l=new Shape).curves=s.curves,c.push(l),c;var u=!i(a[0].getPoints());u=e?!u:u;var h,p,d=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var v=0,y=a.length;v<y;v++)o=i(h=(s=a[v]).getPoints()),(o=e?!o:o)?(!u&&f[g]&&g++,f[g]={s:new Shape,p:h},f[g].s.curves=s.curves,u&&g++,m[g]=[]):m[g].push({h:s,p:h[0]});if(!f[0])return n(a);if(f.length>1){for(var x=!1,_=[],b=0,M=f.length;b<M;b++)d[b]=[];for(b=0,M=f.length;b<M;b++)for(var w=m[b],S=0;S<w.length;S++){for(var T=w[S],E=!0,C=0;C<f.length;C++)r(T.p,f[C].p)&&(b!==C&&_.push({froms:b,tos:C,hole:S}),E?(E=!1,d[C].push(T)):x=!0);E&&d[b].push(T)}_.length>0&&(x||(m=d))}v=0;for(var A=f.length;v<A;v++){l=f[v].s,c.push(l);for(var L=0,P=(p=m[v]).length;L<P;L++)l.holes.push(p[L].h)}return c}}),Object.assign(Font.prototype,{isFont:!0,generateShapes:function(e,t){void 0===t&&(t=100);for(var n=[],r=createPaths(e,t,this.data),i=0,a=r.length;i<a;i++)Array.prototype.push.apply(n,r[i].toShapes());return n}}),FontLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:FontLoader,load:function(e,t,n,r){var i=this,a=new FileLoader(this.manager);a.setPath(this.path),a.load(e,(function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var r=i.parse(n);t&&t(r)}),n,r)},parse:function(e){return new Font(e)}});var AudioContext={getContext:function(){return void 0===_context&&(_context=new(window.AudioContext||window.webkitAudioContext)),_context},setContext:function(e){_context=e}};function AudioLoader(e){Loader.call(this,e)}function SphericalHarmonics3(){this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new Vector3)}function LightProbe(e,t){Light.call(this,void 0,t),this.sh=void 0!==e?e:new SphericalHarmonics3}function HemisphereLightProbe(e,t,n){LightProbe.call(this,void 0,n);var r=(new Color).set(e),i=(new Color).set(t),a=new Vector3(r.r,r.g,r.b),o=new Vector3(i.r,i.g,i.b),s=Math.sqrt(Math.PI),l=s*Math.sqrt(.75);this.sh.coefficients[0].copy(a).add(o).multiplyScalar(s),this.sh.coefficients[1].copy(a).sub(o).multiplyScalar(l)}function AmbientLightProbe(e,t){LightProbe.call(this,void 0,t);var n=(new Color).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}AudioLoader.prototype=Object.assign(Object.create(Loader.prototype),{constructor:AudioLoader,load:function(e,t,n,r){var i=new FileLoader(this.manager);i.setResponseType("arraybuffer"),i.setPath(this.path),i.load(e,(function(e){var n=e.slice(0);AudioContext.getContext().decodeAudioData(n,(function(e){t(e)}))}),n,r)}}),Object.assign(SphericalHarmonics3.prototype,{isSphericalHarmonics3:!0,set:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this},zero:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this},getAt:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScale(a[1],.488603*r),t.addScale(a[2],.488603*i),t.addScale(a[3],.488603*n),t.addScale(a[4],n*r*1.092548),t.addScale(a[5],r*i*1.092548),t.addScale(a[6],.315392*(3*i*i-1)),t.addScale(a[7],n*i*1.092548),t.addScale(a[8],.546274*(n*n-r*r)),t},getIrradianceAt:function(e,t){var n=e.x,r=e.y,i=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScale(a[1],1.023328*r),t.addScale(a[2],1.023328*i),t.addScale(a[3],1.023328*n),t.addScale(a[4],.858086*n*r),t.addScale(a[5],.858086*r*i),t.addScale(a[6],.743125*i*i-.247708),t.addScale(a[7],.858086*n*i),t.addScale(a[8],.429043*(n*n-r*r)),t},add:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this},scale:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this},lerp:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this},equals:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0},copy:function(e){return this.set(e.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(e,t){void 0===t&&(t=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);for(var n=this.coefficients,r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}}),Object.assign(SphericalHarmonics3,{getBasisAt:function(e,t){var n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}),LightProbe.prototype=Object.assign(Object.create(Light.prototype),{constructor:LightProbe,isLightProbe:!0,copy:function(e){return Light.prototype.copy.call(this,e),this.sh.copy(e.sh),this.intensity=e.intensity,this},toJSON:function(e){return Light.prototype.toJSON.call(this,e)}}),HemisphereLightProbe.prototype=Object.assign(Object.create(LightProbe.prototype),{constructor:HemisphereLightProbe,isHemisphereLightProbe:!0,copy:function(e){return LightProbe.prototype.copy.call(this,e),this},toJSON:function(e){return LightProbe.prototype.toJSON.call(this,e)}}),AmbientLightProbe.prototype=Object.assign(Object.create(LightProbe.prototype),{constructor:AmbientLightProbe,isAmbientLightProbe:!0,copy:function(e){return LightProbe.prototype.copy.call(this,e),this},toJSON:function(e){return LightProbe.prototype.toJSON.call(this,e)}});var _eyeRight=new Matrix4,_eyeLeft=new Matrix4;function StereoCamera(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}function Clock(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}Object.assign(StereoCamera.prototype,{update:function(e){var t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;var n,r,i=e.projectionMatrix.clone(),a=t.eyeSep/2,o=a*t.near/t.focus,s=t.near*Math.tan(MathUtils.DEG2RAD*t.fov*.5)/t.zoom;_eyeLeft.elements[12]=-a,_eyeRight.elements[12]=a,n=-s*t.aspect+o,r=s*t.aspect+o,i.elements[0]=2*t.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraL.projectionMatrix.copy(i),n=-s*t.aspect-o,r=s*t.aspect-o,i.elements[0]=2*t.near/(r-n),i.elements[8]=(r+n)/(r-n),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(_eyeLeft),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(_eyeRight)}}),Object.assign(Clock.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}});var _position$2=new Vector3,_quaternion$3=new Quaternion,_scale$1=new Vector3,_orientation=new Vector3;function AudioListener(){Object3D.call(this),this.type="AudioListener",this.context=AudioContext.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Clock}function Audio(e){Object3D.call(this),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this._startedAt=0,this._pausedAt=0,this.filters=[]}AudioListener.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:AudioListener,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this},updateMatrixWorld:function(e){Object3D.prototype.updateMatrixWorld.call(this,e);var t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(_position$2,_quaternion$3,_scale$1),_orientation.set(0,0,-1).applyQuaternion(_quaternion$3),t.positionX){var r=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(_position$2.x,r),t.positionY.linearRampToValueAtTime(_position$2.y,r),t.positionZ.linearRampToValueAtTime(_position$2.z,r),t.forwardX.linearRampToValueAtTime(_orientation.x,r),t.forwardY.linearRampToValueAtTime(_orientation.y,r),t.forwardZ.linearRampToValueAtTime(_orientation.z,r),t.upX.linearRampToValueAtTime(n.x,r),t.upY.linearRampToValueAtTime(n.y,r),t.upZ.linearRampToValueAtTime(n.z,r)}else t.setPosition(_position$2.x,_position$2.y,_position$2.z),t.setOrientation(_orientation.x,_orientation.y,_orientation.z,n.x,n.y,n.z)}}),Audio.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:Audio,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setMediaElementSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this},setMediaStreamSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(e){if(void 0===e&&(e=0),!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+e;var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._pausedAt+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._pausedAt=(this.context.currentTime-this._startedAt)*this.playbackRate,this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this._pausedAt=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e||(e=[]),!0===this.isPlaying?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},setDetune:function(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},setLoopStart:function(e){return this.loopStart=e,this},setLoopEnd:function(e){return this.loopEnd=e,this},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}});var _position$3=new Vector3,_quaternion$4=new Quaternion,_scale$2=new Vector3,_orientation$1=new Vector3;function PositionalAudio(e){Audio.call(this,e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function AudioAnalyser(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function PropertyMixer(e,t,n){this.binding=e,this.valueSize=n;var r,i=Float64Array;switch(t){case"quaternion":r=this._slerp;break;case"string":case"bool":i=Array,r=this._select;break;default:r=this._lerp}this.buffer=new i(4*n),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}PositionalAudio.prototype=Object.assign(Object.create(Audio.prototype),{constructor:PositionalAudio,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){return this.panner.refDistance=e,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){return this.panner.rolloffFactor=e,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){return this.panner.distanceModel=e,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){return this.panner.maxDistance=e,this},setDirectionalCone:function(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(e){if(Object3D.prototype.updateMatrixWorld.call(this,e),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(_position$3,_quaternion$4,_scale$2),_orientation$1.set(0,0,1).applyQuaternion(_quaternion$4);var t=this.panner;if(t.positionX){var n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(_position$3.x,n),t.positionY.linearRampToValueAtTime(_position$3.y,n),t.positionZ.linearRampToValueAtTime(_position$3.z,n),t.orientationX.linearRampToValueAtTime(_orientation$1.x,n),t.orientationY.linearRampToValueAtTime(_orientation$1.y,n),t.orientationZ.linearRampToValueAtTime(_orientation$1.z,n)}else t.setPosition(_position$3.x,_position$3.y,_position$3.z),t.setOrientation(_orientation$1.x,_orientation$1.y,_orientation$1.z)}}}),Object.assign(AudioAnalyser.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),Object.assign(PropertyMixer.prototype,{accumulate:function(e,t){var n=this.buffer,r=this.valueSize,i=e*r+r,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==r;++o)n[i+o]=n[o];a=t}else{var s=t/(a+=t);this._mixBufferRegion(n,i,0,s,r)}this.cumulativeWeight=a},apply:function(e){var t=this.valueSize,n=this.buffer,r=e*t+t,i=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,i<1){var o=3*t;this._mixBufferRegion(n,r,o,1-i,t)}for(var s=t,l=t+t;s!==l;++s)if(n[s]!==n[s+t]){a.setValue(n,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,r=3*n;e.getValue(t,r);for(var i=n,a=r;i!==a;++i)t[i]=t[r+i%n];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,n,r,i){if(r>=.5)for(var a=0;a!==i;++a)e[t+a]=e[n+a]},_slerp:function(e,t,n,r){Quaternion.slerpFlat(e,t,e,t,e,n,r)},_lerp:function(e,t,n,r,i){for(var a=1-r,o=0;o!==i;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*r}}});var _RESERVED_CHARS_RE="\\[\\]\\.:\\/",_reservedRe=new RegExp("["+_RESERVED_CHARS_RE+"]","g"),_wordChar="[^"+_RESERVED_CHARS_RE+"]",_wordCharOrDot="[^"+_RESERVED_CHARS_RE.replace("\\.","")+"]",_directoryRe=/((?:WC+[\/:])*)/.source.replace("WC",_wordChar),_nodeRe=/(WCOD+)?/.source.replace("WCOD",_wordCharOrDot),_objectRe=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",_wordChar),_propertyRe=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",_wordChar),_trackRe=new RegExp("^"+_directoryRe+_nodeRe+_objectRe+_propertyRe+"$"),_supportedObjectNames=["material","materials","bones"];function Composite(e,t,n){var r=n||PropertyBinding.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function PropertyBinding(e,t,n){this.path=t,this.parsedPath=n||PropertyBinding.parseTrackName(t),this.node=PropertyBinding.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function AnimationObjectGroup(){this.uuid=MathUtils.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}function AnimationAction(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var r=t.tracks,i=r.length,a=new Array(i),o={endingStart:ZeroCurvatureEnding,endingEnd:ZeroCurvatureEnding},s=0;s!==i;++s){var l=r[s].createInterpolant(null);a[s]=l,l.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=LoopRepeat,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function AnimationMixer(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Uniform(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function InstancedInterleavedBuffer(e,t,n){InterleavedBuffer.call(this,e,t),this.meshPerAttribute=n||1}function Raycaster(e,t,n,r){this.ray=new Ray(e,t),this.near=n||0,this.far=r||1/0,this.camera=null,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function ascSort(e,t){return e.distance-t.distance}function intersectObject(e,t,n,r){if(!1!==e.visible&&(e.raycast(t,n),!0===r))for(var i=e.children,a=0,o=i.length;a<o;a++)intersectObject(i[a],t,n,!0)}function Spherical(e,t,n){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==n?n:0,this}function Cylindrical(e,t,n){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==n?n:0,this}Object.assign(Composite.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(PropertyBinding,{Composite:Composite,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new PropertyBinding.Composite(e,t,n):new PropertyBinding(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(_reservedRe,"")},parseTrackName:function(e){var t=_trackRe.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){var i=n.nodeName.substring(r+1);-1!==_supportedObjectNames.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||""===t||"root"===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var r=function(e){for(var n=0;n<e.length;n++){var i=e[n];if(i.name===t||i.uuid===t)return i;var a=r(i.children);if(a)return a}return null},i=r(e.children);if(i)return i}return null}}),Object.assign(PropertyBinding.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)e[t++]=n[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++]},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,r=0,i=n.length;r!==i;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,r=t.propertyName,i=t.propertyIndex;if(e||(e=PropertyBinding.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var a=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var o=0;o<e.length;o++)if(e[o].name===a){a=o;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==a){if(void 0===e[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[a]}}var s=e[r];if(void 0!==s){var l=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?l=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate);var c=this.BindingType.Direct;if(void 0!==i){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(e.geometry.morphAttributes.position[o].name===i){i=o;break}}else{if(!e.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(o=0;o<this.node.geometry.morphTargets.length;o++)if(e.geometry.morphTargets[o].name===i){i=o;break}}}c=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=i}else void 0!==s.fromArray&&void 0!==s.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(c=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][l]}else{var u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+r+" but it wasn't found.",e)}}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._getValue_unbound,this.setValue=this._setValue_unbound}}),
|
|
18
18
|
//!\ DECLARE ALIAS AFTER assign prototype !
|
|
19
|
-
Object.assign(PropertyBinding.prototype,{_getValue_unbound:PropertyBinding.prototype.getValue,_setValue_unbound:PropertyBinding.prototype.setValue}),Object.assign(AnimationObjectGroup.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,l=void 0,c=0,u=arguments.length;c!==u;++c){var h=arguments[c],p=h.uuid,d=r[p];if(void 0===d){d=t++,r[p]=d,e.push(h);for(var f=0,m=s;f!==m;++f)o[f].push(new PropertyBinding(h,i[f],a[f]))}else if(d<n){l=e[d];var g=--n,v=e[g];r[v.uuid]=d,e[d]=v,r[p]=g,e[g]=h;for(f=0,m=s;f!==m;++f){var y=o[f],x=y[g],_=y[d];y[d]=x,void 0===_&&(_=new PropertyBinding(h,i[f],a[f])),y[g]=_}}else e[d]!==l&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var e=this._objects,t=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,i=r.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],l=s.uuid,c=n[l];if(void 0!==c&&c>=t){var u=t++,h=e[u];n[h.uuid]=c,e[c]=h,n[l]=u,e[u]=s;for(var p=0,d=i;p!==d;++p){var f=r[p],m=f[u],g=f[c];f[c]=m,f[u]=g}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,a=i.length,o=0,s=arguments.length;o!==s;++o){var l=arguments[o],c=l.uuid,u=r[c];if(void 0!==u)if(delete r[c],u<n){var h=--n,p=e[h],d=e[y=--t];r[p.uuid]=u,e[u]=p,r[d.uuid]=h,e[h]=d,e.pop();for(var f=0,m=a;f!==m;++f){var g=(x=i[f])[h],v=x[y];x[u]=g,x[h]=v,x.pop()}}else{var y;r[(d=e[y=--t]).uuid]=u,e[u]=d,e.pop();for(f=0,m=a;f!==m;++f){var x;(x=i[f])[u]=x[y],x.pop()}}}this.nCachedObjects_=n},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(void 0!==r)return i[r];var a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,c=this.nCachedObjects_,u=new Array(l);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(var h=c,p=s.length;h!==p;++h){var d=s[h];u[h]=new PropertyBinding(d,e,t)}return u},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}}),Object.assign(AnimationAction.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var r=this._clip.duration,i=e._clip.duration,a=i/r,o=r/i;e.warp(1,a,t),this.warp(o,1,t)}return this},crossFadeTo:function(e,t,n){return e.crossFadeFrom(this,t,n)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,n){var r=this._mixer,i=r.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,l=a.sampleValues;return s[0]=i,s[1]=i+n,l[0]=e/o,l[1]=t/o,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var a=(e-i)*n;if(a<0||0===n)return;this._startTime=null,t=n*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(s>0)for(var l=this._interpolants,c=this._propertyBindings,u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(r,s)}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e,n=this._clip.duration,r=this.loop,i=this._loopCount,a=r===LoopPingPong;if(0===e)return-1===i?t:a&&1==(1&i)?n-t:t;if(r===LoopOnce){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(t>=n)t=n;else{if(!(t<0)){this.time=t;break e}t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),t>=n||t<0){var o=Math.floor(t/n);t-=n*o,i+=Math.abs(o);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=e>0?n:0,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var l=e<0;this._setEndings(l,!l,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=t,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=t;if(a&&1==(1&i))return n-t}return t},_setEndings:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=ZeroSlopeEnding,r.endingEnd=ZeroSlopeEnding):(r.endingStart=e?this.zeroSlopeAtStart?ZeroSlopeEnding:ZeroCurvatureEnding:WrapAroundEnding,r.endingEnd=t?this.zeroSlopeAtEnd?ZeroSlopeEnding:ZeroCurvatureEnding:WrapAroundEnding)},_scheduleFading:function(e,t,n){var r=this._mixer,i=r.time,a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}}),AnimationMixer.prototype=Object.assign(Object.create(EventDispatcher.prototype),{constructor:AnimationMixer,_bindAction:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,l=this._bindingsByRootAndName,c=l[s];void 0===c&&(c={},l[s]=c);for(var u=0;u!==i;++u){var h=r[u],p=h.name,d=c[p];if(void 0!==d)a[u]=d;else{if(void 0!==(d=a[u])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=t&&t._propertyBindings[u].binding.parsedPath;++(d=new PropertyMixer(PropertyBinding.create(n,p,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(d,s,p),a[u]=d}o[u].resultBuffer=d.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var r=this._actions,i=this._actionsByClip,a=i[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=a;else{var o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;var i=e._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,l=s[s.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,s[c]=l,s.pop(),e._byClipCacheIndex=null,delete o.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_addInactiveBinding:function(e,t,n){var r=this._bindingsByRootAndName,i=r[t],a=this._bindings;void 0===i&&(i={},r[t]=i),i[n]=e,e._cacheIndex=a.length,a.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=t[t.length-1],l=e._cacheIndex;s._cacheIndex=l,t[l]=s,t.pop(),delete o[i],0===Object.keys(o).length&&delete a[r]},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&((n=new LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=t,e[t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?AnimationClip.findByName(n,e):e,a=null!==i?i.uuid:e,o=this._actionsByClip[a],s=null;if(void 0!==o){var l=o.actionByRoot[r];if(void 0!==l)return l;s=o.knownActions[0],null===i&&(i=s._clip)}if(null===i)return null;var c=new AnimationAction(this,i,t);return this._bindAction(c,s),this._addInactiveAction(c,a,r),c},existingAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?AnimationClip.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[r]||null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,n=this._bindings,r=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var i=0;i!==t;++i)e[i].reset();for(i=0;i!==r;++i)n[i].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1,o=0;o!==n;++o){t[o]._update(r,e,i,a)}var s=this._bindings,l=this._nActiveBindings;for(o=0;o!==l;++o)s[o].apply(a);return this},setTime:function(e){this.time=0;for(var t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var a=i.knownActions,o=0,s=a.length;o!==s;++o){var l=a[o];this._deactivateAction(l);var c=l._cacheIndex,u=t[t.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,u._cacheIndex=c,t[c]=u,t.pop(),this._removeInactiveBindingsForAction(l)}delete r[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot[t];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}var a=this._bindingsByRootAndName[t];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),Uniform.prototype.clone=function(){return new Uniform(void 0===this.value.clone?this.value:this.value.clone())},InstancedInterleavedBuffer.prototype=Object.assign(Object.create(InterleavedBuffer.prototype),{constructor:InstancedInterleavedBuffer,isInstancedInterleavedBuffer:!0,copy:function(e){return InterleavedBuffer.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Object.assign(Raycaster.prototype,{linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t,n){var r=n||[];return intersectObject(e,this,r,t),r.sort(ascSort),r},intersectObjects:function(e,t,n){var r=n||[];if(!1===Array.isArray(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,a=e.length;i<a;i++)intersectObject(e[i],this,r,t);return r.sort(ascSort),r}}),Object.assign(Spherical.prototype,{set:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){var e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(MathUtils.clamp(t/this.radius,-1,1))),this}}),Object.assign(Cylindrical.prototype,{set:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}});var _vector$7=new Vector2;function Box2(e,t){this.min=void 0!==e?e:new Vector2(1/0,1/0),this.max=void 0!==t?t:new Vector2(-1/0,-1/0)}Object.assign(Box2.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=_vector$7.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new Vector2),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new Vector2),this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new Vector2),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new Vector2),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return _vector$7.copy(e).clamp(this.min,this.max).sub(e).length()},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var _startP=new Vector3,_startEnd=new Vector3;function Line3(e,t){this.start=void 0!==e?e:new Vector3,this.end=void 0!==t?t:new Vector3}function ImmediateRenderObject(e){Object3D.call(this),this.material=e,this.render=function(){}}Object.assign(Line3.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new Vector3),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new Vector3),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new Vector3),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){_startP.subVectors(e,this.start),_startEnd.subVectors(this.end,this.start);var n=_startEnd.dot(_startEnd),r=_startEnd.dot(_startP)/n;return t&&(r=MathUtils.clamp(r,0,1)),r},closestPointToPoint:function(e,t,n){var r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Vector3),this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),ImmediateRenderObject.prototype=Object.create(Object3D.prototype),ImmediateRenderObject.prototype.constructor=ImmediateRenderObject,ImmediateRenderObject.prototype.isImmediateRenderObject=!0;var _vector$8=new Vector3;function SpotLightHelper(e,t){Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new BufferGeometry,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,a=1;i<32;i++,a++){var o=i/32*Math.PI*2,s=a/32*Math.PI*2;r.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}n.setAttribute("position",new Float32BufferAttribute(r,3));var l=new LineBasicMaterial({fog:!1});this.cone=new LineSegments(n,l),this.add(this.cone),this.update()}SpotLightHelper.prototype=Object.create(Object3D.prototype),SpotLightHelper.prototype.constructor=SpotLightHelper,SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},SpotLightHelper.prototype.update=function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),_vector$8.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(_vector$8),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var _vector$9=new Vector3,_boneMatrix=new Matrix4,_matrixWorldInv=new Matrix4;function getBoneList(e){var t=[];e&&e.isBone&&t.push(e);for(var n=0;n<e.children.length;n++)t.push.apply(t,getBoneList(e.children[n]));return t}function SkeletonHelper(e){for(var t=getBoneList(e),n=new BufferGeometry,r=[],i=[],a=new Color(0,0,1),o=new Color(0,1,0),s=0;s<t.length;s++){var l=t[s];l.parent&&l.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}n.setAttribute("position",new Float32BufferAttribute(r,3)),n.setAttribute("color",new Float32BufferAttribute(i,3));var c=new LineBasicMaterial({vertexColors:VertexColors,depthTest:!1,depthWrite:!1,transparent:!0});LineSegments.call(this,n,c),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function PointLightHelper(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var r=new SphereBufferGeometry(t,4,2),i=new MeshBasicMaterial({wireframe:!0,fog:!1});Mesh.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}SkeletonHelper.prototype=Object.create(LineSegments.prototype),SkeletonHelper.prototype.constructor=SkeletonHelper,SkeletonHelper.prototype.updateMatrixWorld=function(e){var t=this.bones,n=this.geometry,r=n.getAttribute("position");_matrixWorldInv.getInverse(this.root.matrixWorld);for(var i=0,a=0;i<t.length;i++){var o=t[i];o.parent&&o.parent.isBone&&(_boneMatrix.multiplyMatrices(_matrixWorldInv,o.matrixWorld),_vector$9.setFromMatrixPosition(_boneMatrix),r.setXYZ(a,_vector$9.x,_vector$9.y,_vector$9.z),_boneMatrix.multiplyMatrices(_matrixWorldInv,o.parent.matrixWorld),_vector$9.setFromMatrixPosition(_boneMatrix),r.setXYZ(a+1,_vector$9.x,_vector$9.y,_vector$9.z),a+=2)}n.getAttribute("position").needsUpdate=!0,Object3D.prototype.updateMatrixWorld.call(this,e)},PointLightHelper.prototype=Object.create(Mesh.prototype),PointLightHelper.prototype.constructor=PointLightHelper,PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},PointLightHelper.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var _vector$a=new Vector3,_color1=new Color,_color2=new Color;function HemisphereLightHelper(e,t,n){Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new OctahedronBufferGeometry(t);r.rotateY(.5*Math.PI),this.material=new MeshBasicMaterial({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=VertexColors);var i=r.getAttribute("position"),a=new Float32Array(3*i.count);r.setAttribute("color",new BufferAttribute(a,3)),this.add(new Mesh(r,this.material)),this.update()}function GridHelper(e,t,n,r){e=e||10,t=t||10,n=new Color(void 0!==n?n:4473924),r=new Color(void 0!==r?r:8947848);for(var i=t/2,a=e/t,o=e/2,s=[],l=[],c=0,u=0,h=-o;c<=t;c++,h+=a){s.push(-o,0,h,o,0,h),s.push(h,0,-o,h,0,o);var p=c===i?n:r;p.toArray(l,u),u+=3,p.toArray(l,u),u+=3,p.toArray(l,u),u+=3,p.toArray(l,u),u+=3}var d=new BufferGeometry;d.setAttribute("position",new Float32BufferAttribute(s,3)),d.setAttribute("color",new Float32BufferAttribute(l,3));var f=new LineBasicMaterial({vertexColors:VertexColors});LineSegments.call(this,d,f)}function PolarGridHelper(e,t,n,r,i,a){e=e||10,t=t||16,n=n||8,r=r||64,i=new Color(void 0!==i?i:4473924),a=new Color(void 0!==a?a:8947848);var o,s,l,c,u,h,p,d=[],f=[];for(c=0;c<=t;c++)l=c/t*(2*Math.PI),o=Math.sin(l)*e,s=Math.cos(l)*e,d.push(0,0,0),d.push(o,0,s),p=1&c?i:a,f.push(p.r,p.g,p.b),f.push(p.r,p.g,p.b);for(c=0;c<=n;c++)for(p=1&c?i:a,h=e-e/n*c,u=0;u<r;u++)l=u/r*(2*Math.PI),o=Math.sin(l)*h,s=Math.cos(l)*h,d.push(o,0,s),f.push(p.r,p.g,p.b),l=(u+1)/r*(2*Math.PI),o=Math.sin(l)*h,s=Math.cos(l)*h,d.push(o,0,s),f.push(p.r,p.g,p.b);var m=new BufferGeometry;m.setAttribute("position",new Float32BufferAttribute(d,3)),m.setAttribute("color",new Float32BufferAttribute(f,3));var g=new LineBasicMaterial({vertexColors:VertexColors});LineSegments.call(this,m,g)}HemisphereLightHelper.prototype=Object.create(Object3D.prototype),HemisphereLightHelper.prototype.constructor=HemisphereLightHelper,HemisphereLightHelper.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},HemisphereLightHelper.prototype.update=function(){var e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var t=e.geometry.getAttribute("color");_color1.copy(this.light.color),_color2.copy(this.light.groundColor);for(var n=0,r=t.count;n<r;n++){var i=n<r/2?_color1:_color2;t.setXYZ(n,i.r,i.g,i.b)}t.needsUpdate=!0}e.lookAt(_vector$a.setFromMatrixPosition(this.light.matrixWorld).negate())},GridHelper.prototype=Object.assign(Object.create(LineSegments.prototype),{constructor:GridHelper,copy:function(e){return LineSegments.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return(new this.constructor).copy(this)}}),PolarGridHelper.prototype=Object.create(LineSegments.prototype),PolarGridHelper.prototype.constructor=PolarGridHelper;var _v1$5=new Vector3,_v2$3=new Vector3,_v3$1=new Vector3;function DirectionalLightHelper(e,t,n){Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);var r=new BufferGeometry;r.setAttribute("position",new Float32BufferAttribute([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var i=new LineBasicMaterial({fog:!1});this.lightPlane=new Line(r,i),this.add(this.lightPlane),(r=new BufferGeometry).setAttribute("position",new Float32BufferAttribute([0,0,0,0,0,1],3)),this.targetLine=new Line(r,i),this.add(this.targetLine),this.update()}DirectionalLightHelper.prototype=Object.create(Object3D.prototype),DirectionalLightHelper.prototype.constructor=DirectionalLightHelper,DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},DirectionalLightHelper.prototype.update=function(){_v1$5.setFromMatrixPosition(this.light.matrixWorld),_v2$3.setFromMatrixPosition(this.light.target.matrixWorld),_v3$1.subVectors(_v2$3,_v1$5),this.lightPlane.lookAt(_v2$3),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(_v2$3),this.targetLine.scale.z=_v3$1.length()};var _vector$b=new Vector3,_camera=new Camera;function CameraHelper(e){var t=new BufferGeometry,n=new LineBasicMaterial({color:16777215,vertexColors:FaceColors}),r=[],i=[],a={},o=new Color(16755200),s=new Color(16711680),l=new Color(43775),c=new Color(16777215),u=new Color(3355443);function h(e,t,n){p(e,n),p(t,n)}function p(e,t){r.push(0,0,0),i.push(t.r,t.g,t.b),void 0===a[e]&&(a[e]=[]),a[e].push(r.length/3-1)}h("n1","n2",o),h("n2","n4",o),h("n4","n3",o),h("n3","n1",o),h("f1","f2",o),h("f2","f4",o),h("f4","f3",o),h("f3","f1",o),h("n1","f1",o),h("n2","f2",o),h("n3","f3",o),h("n4","f4",o),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",l),h("u2","u3",l),h("u3","u1",l),h("c","t",c),h("p","c",u),h("cn1","cn2",u),h("cn3","cn4",u),h("cf1","cf2",u),h("cf3","cf4",u),t.setAttribute("position",new Float32BufferAttribute(r,3)),t.setAttribute("color",new Float32BufferAttribute(i,3)),LineSegments.call(this,t,n),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function setPoint(e,t,n,r,i,a,o){_vector$b.set(i,a,o).unproject(r);var s=t[e];if(void 0!==s)for(var l=n.getAttribute("position"),c=0,u=s.length;c<u;c++)l.setXYZ(s[c],_vector$b.x,_vector$b.y,_vector$b.z)}CameraHelper.prototype=Object.create(LineSegments.prototype),CameraHelper.prototype.constructor=CameraHelper,CameraHelper.prototype.update=function(){var e=this.geometry,t=this.pointMap;_camera.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),setPoint("c",t,e,_camera,0,0,-1),setPoint("t",t,e,_camera,0,0,1),setPoint("n1",t,e,_camera,-1,-1,-1),setPoint("n2",t,e,_camera,1,-1,-1),setPoint("n3",t,e,_camera,-1,1,-1),setPoint("n4",t,e,_camera,1,1,-1),setPoint("f1",t,e,_camera,-1,-1,1),setPoint("f2",t,e,_camera,1,-1,1),setPoint("f3",t,e,_camera,-1,1,1),setPoint("f4",t,e,_camera,1,1,1),setPoint("u1",t,e,_camera,.7,1.1,-1),setPoint("u2",t,e,_camera,-.7,1.1,-1),setPoint("u3",t,e,_camera,0,2,-1),setPoint("cf1",t,e,_camera,-1,0,1),setPoint("cf2",t,e,_camera,1,0,1),setPoint("cf3",t,e,_camera,0,-1,1),setPoint("cf4",t,e,_camera,0,1,1),setPoint("cn1",t,e,_camera,-1,0,-1),setPoint("cn2",t,e,_camera,1,0,-1),setPoint("cn3",t,e,_camera,0,-1,-1),setPoint("cn4",t,e,_camera,0,1,-1),e.getAttribute("position").needsUpdate=!0};var _box$3=new Box3;function BoxHelper(e,t){this.object=e,void 0===t&&(t=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new BufferGeometry;i.setIndex(new BufferAttribute(n,1)),i.setAttribute("position",new BufferAttribute(r,3)),LineSegments.call(this,i,new LineBasicMaterial({color:t})),this.matrixAutoUpdate=!1,this.update()}function Box3Helper(e,t){this.type="Box3Helper",this.box=e,t=t||16776960;var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new BufferGeometry;r.setIndex(new BufferAttribute(n,1)),r.setAttribute("position",new Float32BufferAttribute([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),LineSegments.call(this,r,new LineBasicMaterial({color:t})),this.geometry.computeBoundingSphere()}function PlaneHelper(e,t,n){this.type="PlaneHelper",this.plane=e,this.size=void 0===t?1:t;var r=void 0!==n?n:16776960,i=new BufferGeometry;i.setAttribute("position",new Float32BufferAttribute([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),i.computeBoundingSphere(),Line.call(this,i,new LineBasicMaterial({color:r}));var a=new BufferGeometry;a.setAttribute("position",new Float32BufferAttribute([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new Mesh(a,new MeshBasicMaterial({color:r,opacity:.2,transparent:!0,depthWrite:!1})))}BoxHelper.prototype=Object.create(LineSegments.prototype),BoxHelper.prototype.constructor=BoxHelper,BoxHelper.prototype.update=function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&_box$3.setFromObject(this.object),!_box$3.isEmpty()){var t=_box$3.min,n=_box$3.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}},BoxHelper.prototype.setFromObject=function(e){return this.object=e,this.update(),this},BoxHelper.prototype.copy=function(e){return LineSegments.prototype.copy.call(this,e),this.object=e.object,this},BoxHelper.prototype.clone=function(){return(new this.constructor).copy(this)},Box3Helper.prototype=Object.create(LineSegments.prototype),Box3Helper.prototype.constructor=Box3Helper,Box3Helper.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),Object3D.prototype.updateMatrixWorld.call(this,e))},PlaneHelper.prototype=Object.create(Line.prototype),PlaneHelper.prototype.constructor=PlaneHelper,PlaneHelper.prototype.updateMatrixWorld=function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?BackSide:FrontSide,this.lookAt(this.plane.normal),Object3D.prototype.updateMatrixWorld.call(this,e)};var _axis=new Vector3,_lineGeometry,_coneGeometry;function ArrowHelper(e,t,n,r,i,a){Object3D.call(this),void 0===e&&(e=new Vector3(0,0,1)),void 0===t&&(t=new Vector3(0,0,0)),void 0===n&&(n=1),void 0===r&&(r=16776960),void 0===i&&(i=.2*n),void 0===a&&(a=.2*i),void 0===_lineGeometry&&((_lineGeometry=new BufferGeometry).setAttribute("position",new Float32BufferAttribute([0,0,0,0,1,0],3)),(_coneGeometry=new CylinderBufferGeometry(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new Line(_lineGeometry,new LineBasicMaterial({color:r})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Mesh(_coneGeometry,new MeshBasicMaterial({color:r})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,a)}function AxesHelper(e){var t=[0,0,0,e=e||1,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new BufferGeometry;n.setAttribute("position",new Float32BufferAttribute(t,3)),n.setAttribute("color",new Float32BufferAttribute([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var r=new LineBasicMaterial({vertexColors:VertexColors});LineSegments.call(this,n,r)}ArrowHelper.prototype=Object.create(Object3D.prototype),ArrowHelper.prototype.constructor=ArrowHelper,ArrowHelper.prototype.setDirection=function(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{_axis.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(_axis,t)}},ArrowHelper.prototype.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},ArrowHelper.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},ArrowHelper.prototype.copy=function(e){return Object3D.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},ArrowHelper.prototype.clone=function(){return(new this.constructor).copy(this)},AxesHelper.prototype=Object.create(LineSegments.prototype),AxesHelper.prototype.constructor=AxesHelper;var LOD_MIN=4,LOD_MAX=8,EXTRA_LOD_SIGMA=[.125,.215,.35,.446,.526,.582],TOTAL_LODS=LOD_MAX-LOD_MIN+1+EXTRA_LOD_SIGMA.length,MAX_SAMPLES=20,ENCODINGS={[LinearEncoding]:0,[sRGBEncoding]:1,[RGBEEncoding]:2,[RGBM7Encoding]:3,[RGBM16Encoding]:4,[RGBDEncoding]:5,[GammaEncoding]:6},_flatCamera=new OrthographicCamera,_blurMaterial=_getBlurShader(MAX_SAMPLES),{_lodPlanes:_lodPlanes,_sizeLods:_sizeLods,_sigmas:_sigmas}=_createPlanes();function _createPlanes(){for(var e=[],t=[],n=[],r=LOD_MAX,i=0;i<TOTAL_LODS;i++){var a=Math.pow(2,r);t.push(a);var o=1/a;i>LOD_MAX-LOD_MIN?o=EXTRA_LOD_SIGMA[i-LOD_MAX+LOD_MIN-1]:0==i&&(o=0),n.push(o);for(var s=1/(a-1),l=-s/2,c=1+s/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=new Float32Array(108),p=new Float32Array(72),d=new Float32Array(36),f=0;f<6;f++){var m=f%3*2/3-1,g=f>2?0:-1,v=[m,g,0,m+2/3,g,0,m+2/3,g+1,0,m,g,0,m+2/3,g+1,0,m,g+1,0];h.set(v,18*f),p.set(u,12*f);var y=[f,f,f,f,f,f];d.set(y,6*f)}var x=new BufferGeometry;x.setAttribute("position",new BufferAttribute(h,3)),x.setAttribute("uv",new BufferAttribute(p,2)),x.setAttribute("faceIndex",new BufferAttribute(d,1)),e.push(x),r>LOD_MIN&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function _getBlurShader(e){var t=new RawShaderMaterial({defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(e)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new Vector3(0,1,0)},inputEncoding:{value:ENCODINGS[LinearEncoding]},outputEncoding:{value:ENCODINGS[LinearEncoding]}},vertexShader:_getCommonVertexShader(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n${_getEncodings()}\n\n#define ENVMAP_TYPE_CUBE_UV\n#include <cube_uv_reflection_fragment>\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tfor (int i = 0; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfor (int dir = -1; dir < 2; dir += 2) {\n\t\t\tif (i == 0 && dir == 1)\n\t\t\t\tcontinue;\n\t\t\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\t\t\tif (all(equal(axis, vec3(0.0))))\n\t\t\t\taxis = cross(vec3(0.0, 1.0, 0.0), vOutputDirection);\n\t\t\taxis = normalize(axis);\n\t\t\tfloat theta = dTheta * float(dir * i);\n\t\t\tfloat cosTheta = cos(theta);\n\t\t\t// Rodrigues' axis-angle rotation\n\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t\t\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\t\t\tgl_FragColor.rgb +=\n\t\t\t\t\tweights[i] * bilinearCubeUV(envMap, sampleDirection, mipInt);\n\t\t}\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:NoBlending,depthTest:!1,depthWrite:!1});return t.type="SphericalGaussianBlur",t}function _getCommonVertexShader(){return"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t"}function _getEncodings(){return"\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t"}function Spline(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),CatmullRomCurve3.call(this,e),this.type="catmullrom"}Curve.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Curve.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(CurvePath.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new Geometry,n=0,r=e.length;n<r;n++){var i=e[n];t.vertices.push(new Vector3(i.x,i.y,i.z||0))}return t}}),Object.assign(Path.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),Spline.prototype=Object.create(CatmullRomCurve3.prototype),Object.assign(Spline.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),GridHelper.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},SkeletonHelper.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(Loader.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),LoaderUtils.extractUrlBase(e)}}),Loader.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(ObjectLoader.prototype,{setTexturePath:function(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}),Object.assign(Box2.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(Box3.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Frustum.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},Line3.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(MathUtils,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),MathUtils.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),MathUtils.ceilPowerOfTwo(e)}}),Object.assign(Matrix3.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(Matrix4.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new Vector3).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,a)}}),Plane.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},Quaternion.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(Ray.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(Triangle.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(Triangle,{barycoordFromPoint:function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Triangle.getBarycoord(e,t,n,r,i)},normal:function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Triangle.getNormal(e,t,n,r)}}),Object.assign(Shape.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new ExtrudeGeometry(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new ShapeGeometry(this,e)}}),Object.assign(Vector2.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Vector3.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Vector4.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Geometry.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.assign(Object3D.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(Object3D.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(Mesh.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(Mesh.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),TrianglesDrawMode},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(LOD.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Skeleton.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),SkinnedMesh.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Curve.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),PerspectiveCamera.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Light.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(BufferAttribute.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===DynamicDrawUsage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(DynamicDrawUsage)}}}),Object.assign(BufferAttribute.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?DynamicDrawUsage:StaticDrawUsage),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(BufferGeometry.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new BufferAttribute(arguments[1],arguments[2])))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(BufferGeometry.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(InterleavedBuffer.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===DynamicDrawUsage},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(InterleavedBuffer.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?DynamicDrawUsage:StaticDrawUsage),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(ExtrudeBufferGeometry.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(Uniform.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(Material.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Color}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=e===FlatShading}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(MeshPhongMaterial.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(ShaderMaterial.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(WebGLRenderer.prototype,{clearTarget:function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(WebGLRenderer.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?sRGBEncoding:LinearEncoding}}}),Object.defineProperties(WebGLShadowMap.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(WebGLRenderTarget.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(Audio.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new AudioLoader).load(e,(function(e){t.setBuffer(e)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),AudioAnalyser.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},CubeCamera.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},ImageUtils.crossOrigin=void 0,ImageUtils.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new TextureLoader;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},ImageUtils.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new CubeTextureLoader;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},ImageUtils.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},ImageUtils.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:REVISION}}));class SVGLoader extends Loader{constructor(e){super(e),this.defaultDPI=90,this.defaultUnit="px"}load(e,t,n,r){const i=this,a=new FileLoader(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{t(i.parse(n))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e){const t=this;function n(e,t,n,i,a,o,s,l){if(0==t||0==n)return void e.lineTo(l.x,l.y);i=i*Math.PI/180,t=Math.abs(t),n=Math.abs(n);const c=(s.x-l.x)/2,u=(s.y-l.y)/2,h=Math.cos(i)*c+Math.sin(i)*u,p=-Math.sin(i)*c+Math.cos(i)*u;let d=t*t,f=n*n;const m=h*h,g=p*p,v=m/d+g/f;if(v>1){const e=Math.sqrt(v);d=(t*=e)*t,f=(n*=e)*n}const y=d*g+f*m,x=(d*f-y)/y;let _=Math.sqrt(Math.max(0,x));a===o&&(_=-_);const b=_*t*p/n,M=-_*n*h/t,w=Math.cos(i)*b-Math.sin(i)*M+(s.x+l.x)/2,S=Math.sin(i)*b+Math.cos(i)*M+(s.y+l.y)/2,T=r(1,0,(h-b)/t,(p-M)/n),E=r((h-b)/t,(p-M)/n,(-h-b)/t,(-p-M)/n)%(2*Math.PI);e.currentPath.absellipse(w,S,t,n,T,T+E,0===o,i)}function r(e,t,n,r){const i=e*n+t*r,a=Math.sqrt(e*e+t*t)*Math.sqrt(n*n+r*r);let o=Math.acos(Math.max(-1,Math.min(1,i/a)));return e*r-t*n<0&&(o=-o),o}function i(e,t){t=Object.assign({},t);let n={};if(e.hasAttribute("class")){const t=e.getAttribute("class").split(/\s/).filter(Boolean).map((e=>e.trim()));for(let e=0;e<t.length;e++)n=Object.assign(n,d["."+t[e]])}function r(r,i,a){void 0===a&&(a=function(e){return e.startsWith("url")&&console.warn("SVGLoader: url access in attributes is not implemented."),e}),e.hasAttribute(r)&&(t[i]=a(e.getAttribute(r))),n[r]&&(t[i]=a(n[r])),e.style&&""!==e.style[r]&&(t[i]=a(e.style[r]))}function i(e){return Math.max(0,Math.min(1,c(e)))}function a(e){return Math.max(0,c(e))}return e.hasAttribute("id")&&(n=Object.assign(n,d["#"+e.getAttribute("id")])),r("fill","fill"),r("fill-opacity","fillOpacity",i),r("fill-rule","fillRule"),r("opacity","opacity",i),r("stroke","stroke"),r("stroke-opacity","strokeOpacity",i),r("stroke-width","strokeWidth",a),r("stroke-linejoin","strokeLineJoin"),r("stroke-linecap","strokeLineCap"),r("stroke-miterlimit","strokeMiterLimit",a),r("visibility","visibility"),t}function a(e,t){return e-(t-e)}function o(e,t,n){if("string"!=typeof e)throw new TypeError("Invalid input: "+typeof e);const r={SEPARATOR:/[ \t\r\n\,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};let i=0,a=!0,o="",s="";const l=[];function c(e,t,n){const r=new SyntaxError('Unexpected character "'+e+'" at index '+t+".");throw r.partial=n,r}function u(){""!==o&&(""===s?l.push(Number(o)):l.push(Number(o)*Math.pow(10,Number(s)))),o="",s=""}let h;const p=e.length;for(let d=0;d<p;d++)if(h=e[d],Array.isArray(t)&&t.includes(l.length%n)&&r.FLAGS.test(h))i=1,o=h,u();else{if(0===i){if(r.WHITESPACE.test(h))continue;if(r.DIGIT.test(h)||r.SIGN.test(h)){i=1,o=h;continue}if(r.POINT.test(h)){i=2,o=h;continue}r.COMMA.test(h)&&(a&&c(h,d,l),a=!0)}if(1===i){if(r.DIGIT.test(h)){o+=h;continue}if(r.POINT.test(h)){o+=h,i=2;continue}if(r.EXP.test(h)){i=3;continue}r.SIGN.test(h)&&1===o.length&&r.SIGN.test(o[0])&&c(h,d,l)}if(2===i){if(r.DIGIT.test(h)){o+=h;continue}if(r.EXP.test(h)){i=3;continue}r.POINT.test(h)&&"."===o[o.length-1]&&c(h,d,l)}if(3===i){if(r.DIGIT.test(h)){s+=h;continue}if(r.SIGN.test(h)){if(""===s){s+=h;continue}1===s.length&&r.SIGN.test(s)&&c(h,d,l)}}r.WHITESPACE.test(h)?(u(),i=0,a=!1):r.COMMA.test(h)?(u(),i=0,a=!0):r.SIGN.test(h)?(u(),i=1,o=h):r.POINT.test(h)?(u(),i=2,o=h):c(h,d,l)}return u(),l}const s=["mm","cm","in","pt","pc","px"],l={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:12,pc:1,px:-1},px:{px:1}};function c(e){let n,r="px";if("string"==typeof e||e instanceof String)for(let t=0,n=s.length;t<n;t++){const n=s[t];if(e.endsWith(n)){r=n,e=e.substring(0,e.length-n.length);break}}return"px"===r&&"px"!==t.defaultUnit?n=l.in[t.defaultUnit]/t.defaultDPI:(n=l[r][t.defaultUnit],n<0&&(n=l[r].in*t.defaultDPI)),n*parseFloat(e)}function u(e){const t=e.elements;return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function h(e){const t=e.elements;return Math.sqrt(t[3]*t[3]+t[4]*t[4])}const p=[],d={},f=[],m=new Matrix3,g=new Matrix3,v=new Matrix3,y=new Matrix3,x=new Vector2,_=new Vector3,b=new Matrix3,M=(new DOMParser).parseFromString(e,"image/svg+xml");!function e(t,r){if(1!==t.nodeType)return;const s=function(e){if(!(e.hasAttribute("transform")||"use"===e.nodeName&&(e.hasAttribute("x")||e.hasAttribute("y"))))return null;const t=function(e){const t=new Matrix3,n=m;if("use"===e.nodeName&&(e.hasAttribute("x")||e.hasAttribute("y"))){const n=c(e.getAttribute("x")),r=c(e.getAttribute("y"));t.translate(n,r)}if(e.hasAttribute("transform")){const r=e.getAttribute("transform").split(")");for(let e=r.length-1;e>=0;e--){const i=r[e].trim();if(""===i)continue;const a=i.indexOf("("),s=i.length;if(a>0&&a<s){const e=i.substr(0,a),t=o(i.substr(a+1,s-a-1));switch(n.identity(),e){case"translate":if(t.length>=1){const e=t[0];let r=e;t.length>=2&&(r=t[1]),n.translate(e,r)}break;case"rotate":if(t.length>=1){let e=0,r=0,i=0;e=-t[0]*Math.PI/180,t.length>=3&&(r=t[1],i=t[2]),g.identity().translate(-r,-i),v.identity().rotate(e),y.multiplyMatrices(v,g),g.identity().translate(r,i),n.multiplyMatrices(g,y)}break;case"scale":if(t.length>=1){const e=t[0];let r=e;t.length>=2&&(r=t[1]),n.scale(e,r)}break;case"skewX":1===t.length&&n.set(1,Math.tan(t[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":1===t.length&&n.set(1,0,0,Math.tan(t[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":6===t.length&&n.set(t[0],t[2],t[4],t[1],t[3],t[5],0,0,1)}}t.premultiply(n)}}return t}(e);f.length>0&&t.premultiply(f[f.length-1]);return b.copy(t),f.push(t),t}(t);let l=!0,M=null;switch(t.nodeName){case"svg":break;case"style":!function(e){if(!e.sheet||!e.sheet.cssRules||!e.sheet.cssRules.length)return;for(let t=0;t<e.sheet.cssRules.length;t++){const n=e.sheet.cssRules[t];if(1!==n.type)continue;const r=n.selectorText.split(/,/gm).filter(Boolean).map((e=>e.trim()));for(let e=0;e<r.length;e++)d[r[e]]=Object.assign(d[r[e]]||{},n.style)}}(t);break;case"g":r=i(t,r);break;case"path":r=i(t,r),t.hasAttribute("d")&&(M=function(e){const t=new ShapePath,r=new Vector2,i=new Vector2,s=new Vector2;let l=!0,c=!1;const u=e.getAttribute("d").match(/[a-df-z][^a-df-z]*/gi);for(let e=0,h=u.length;e<h;e++){const h=u[e],p=h.charAt(0),d=h.substr(1).trim();let f;switch(!0===l&&(c=!0,l=!1),p){case"M":f=o(d);for(let e=0,n=f.length;e<n;e+=2)r.x=f[e+0],r.y=f[e+1],i.x=r.x,i.y=r.y,0===e?t.moveTo(r.x,r.y):t.lineTo(r.x,r.y),0===e&&s.copy(r);break;case"H":f=o(d);for(let e=0,n=f.length;e<n;e++)r.x=f[e],i.x=r.x,i.y=r.y,t.lineTo(r.x,r.y),0===e&&!0===c&&s.copy(r);break;case"V":f=o(d);for(let e=0,n=f.length;e<n;e++)r.y=f[e],i.x=r.x,i.y=r.y,t.lineTo(r.x,r.y),0===e&&!0===c&&s.copy(r);break;case"L":f=o(d);for(let e=0,n=f.length;e<n;e+=2)r.x=f[e+0],r.y=f[e+1],i.x=r.x,i.y=r.y,t.lineTo(r.x,r.y),0===e&&!0===c&&s.copy(r);break;case"C":f=o(d);for(let e=0,n=f.length;e<n;e+=6)t.bezierCurveTo(f[e+0],f[e+1],f[e+2],f[e+3],f[e+4],f[e+5]),i.x=f[e+2],i.y=f[e+3],r.x=f[e+4],r.y=f[e+5],0===e&&!0===c&&s.copy(r);break;case"S":f=o(d);for(let e=0,n=f.length;e<n;e+=4)t.bezierCurveTo(a(r.x,i.x),a(r.y,i.y),f[e+0],f[e+1],f[e+2],f[e+3]),i.x=f[e+0],i.y=f[e+1],r.x=f[e+2],r.y=f[e+3],0===e&&!0===c&&s.copy(r);break;case"Q":f=o(d);for(let e=0,n=f.length;e<n;e+=4)t.quadraticCurveTo(f[e+0],f[e+1],f[e+2],f[e+3]),i.x=f[e+0],i.y=f[e+1],r.x=f[e+2],r.y=f[e+3],0===e&&!0===c&&s.copy(r);break;case"T":f=o(d);for(let e=0,n=f.length;e<n;e+=2){const n=a(r.x,i.x),o=a(r.y,i.y);t.quadraticCurveTo(n,o,f[e+0],f[e+1]),i.x=n,i.y=o,r.x=f[e+0],r.y=f[e+1],0===e&&!0===c&&s.copy(r)}break;case"A":f=o(d,[3,4],7);for(let e=0,a=f.length;e<a;e+=7){if(f[e+5]==r.x&&f[e+6]==r.y)continue;const a=r.clone();r.x=f[e+5],r.y=f[e+6],i.x=r.x,i.y=r.y,n(t,f[e],f[e+1],f[e+2],f[e+3],f[e+4],a,r),0===e&&!0===c&&s.copy(r)}break;case"m":f=o(d);for(let e=0,n=f.length;e<n;e+=2)r.x+=f[e+0],r.y+=f[e+1],i.x=r.x,i.y=r.y,0===e?t.moveTo(r.x,r.y):t.lineTo(r.x,r.y),0===e&&s.copy(r);break;case"h":f=o(d);for(let e=0,n=f.length;e<n;e++)r.x+=f[e],i.x=r.x,i.y=r.y,t.lineTo(r.x,r.y),0===e&&!0===c&&s.copy(r);break;case"v":f=o(d);for(let e=0,n=f.length;e<n;e++)r.y+=f[e],i.x=r.x,i.y=r.y,t.lineTo(r.x,r.y),0===e&&!0===c&&s.copy(r);break;case"l":f=o(d);for(let e=0,n=f.length;e<n;e+=2)r.x+=f[e+0],r.y+=f[e+1],i.x=r.x,i.y=r.y,t.lineTo(r.x,r.y),0===e&&!0===c&&s.copy(r);break;case"c":f=o(d);for(let e=0,n=f.length;e<n;e+=6)t.bezierCurveTo(r.x+f[e+0],r.y+f[e+1],r.x+f[e+2],r.y+f[e+3],r.x+f[e+4],r.y+f[e+5]),i.x=r.x+f[e+2],i.y=r.y+f[e+3],r.x+=f[e+4],r.y+=f[e+5],0===e&&!0===c&&s.copy(r);break;case"s":f=o(d);for(let e=0,n=f.length;e<n;e+=4)t.bezierCurveTo(a(r.x,i.x),a(r.y,i.y),r.x+f[e+0],r.y+f[e+1],r.x+f[e+2],r.y+f[e+3]),i.x=r.x+f[e+0],i.y=r.y+f[e+1],r.x+=f[e+2],r.y+=f[e+3],0===e&&!0===c&&s.copy(r);break;case"q":f=o(d);for(let e=0,n=f.length;e<n;e+=4)t.quadraticCurveTo(r.x+f[e+0],r.y+f[e+1],r.x+f[e+2],r.y+f[e+3]),i.x=r.x+f[e+0],i.y=r.y+f[e+1],r.x+=f[e+2],r.y+=f[e+3],0===e&&!0===c&&s.copy(r);break;case"t":f=o(d);for(let e=0,n=f.length;e<n;e+=2){const n=a(r.x,i.x),o=a(r.y,i.y);t.quadraticCurveTo(n,o,r.x+f[e+0],r.y+f[e+1]),i.x=n,i.y=o,r.x=r.x+f[e+0],r.y=r.y+f[e+1],0===e&&!0===c&&s.copy(r)}break;case"a":f=o(d,[3,4],7);for(let e=0,a=f.length;e<a;e+=7){if(0==f[e+5]&&0==f[e+6])continue;const a=r.clone();r.x+=f[e+5],r.y+=f[e+6],i.x=r.x,i.y=r.y,n(t,f[e],f[e+1],f[e+2],f[e+3],f[e+4],a,r),0===e&&!0===c&&s.copy(r)}break;case"Z":case"z":t.currentPath.autoClose=!0,t.currentPath.curves.length>0&&(r.copy(s),t.currentPath.currentPoint.copy(r),l=!0);break;default:console.warn(h)}c=!1}return t}(t));break;case"rect":r=i(t,r),M=function(e){const t=c(e.getAttribute("x")||0),n=c(e.getAttribute("y")||0),r=c(e.getAttribute("rx")||e.getAttribute("ry")||0),i=c(e.getAttribute("ry")||e.getAttribute("rx")||0),a=c(e.getAttribute("width")),o=c(e.getAttribute("height")),s=.448084975506,l=new ShapePath;l.moveTo(t+r,n),l.lineTo(t+a-r,n),(0!==r||0!==i)&&l.bezierCurveTo(t+a-r*s,n,t+a,n+i*s,t+a,n+i);l.lineTo(t+a,n+o-i),(0!==r||0!==i)&&l.bezierCurveTo(t+a,n+o-i*s,t+a-r*s,n+o,t+a-r,n+o);l.lineTo(t+r,n+o),(0!==r||0!==i)&&l.bezierCurveTo(t+r*s,n+o,t,n+o-i*s,t,n+o-i);l.lineTo(t,n+i),(0!==r||0!==i)&&l.bezierCurveTo(t,n+i*s,t+r*s,n,t+r,n);return l}(t);break;case"polygon":r=i(t,r),M=function(e){function t(e,t,n){const a=c(t),o=c(n);0===i?r.moveTo(a,o):r.lineTo(a,o),i++}const n=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,r=new ShapePath;let i=0;return e.getAttribute("points").replace(n,t),r.currentPath.autoClose=!0,r}(t);break;case"polyline":r=i(t,r),M=function(e){function t(e,t,n){const a=c(t),o=c(n);0===i?r.moveTo(a,o):r.lineTo(a,o),i++}const n=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,r=new ShapePath;let i=0;return e.getAttribute("points").replace(n,t),r.currentPath.autoClose=!1,r}(t);break;case"circle":r=i(t,r),M=function(e){const t=c(e.getAttribute("cx")||0),n=c(e.getAttribute("cy")||0),r=c(e.getAttribute("r")||0),i=new Path;i.absarc(t,n,r,0,2*Math.PI);const a=new ShapePath;return a.subPaths.push(i),a}(t);break;case"ellipse":r=i(t,r),M=function(e){const t=c(e.getAttribute("cx")||0),n=c(e.getAttribute("cy")||0),r=c(e.getAttribute("rx")||0),i=c(e.getAttribute("ry")||0),a=new Path;a.absellipse(t,n,r,i,0,2*Math.PI);const o=new ShapePath;return o.subPaths.push(a),o}(t);break;case"line":r=i(t,r),M=function(e){const t=c(e.getAttribute("x1")||0),n=c(e.getAttribute("y1")||0),r=c(e.getAttribute("x2")||0),i=c(e.getAttribute("y2")||0),a=new ShapePath;return a.moveTo(t,n),a.lineTo(r,i),a.currentPath.autoClose=!1,a}(t);break;case"defs":l=!1;break;case"use":r=i(t,r);const s=t.href.baseVal.substring(1),u=t.viewportElement.getElementById(s);u?e(u,r):console.warn("SVGLoader: 'use node' references non-existent node id: "+s)}if(M&&(void 0!==r.fill&&"none"!==r.fill&&M.color.setStyle(r.fill),function(e,t){function n(e){_.set(e.x,e.y,1).applyMatrix3(t),e.set(_.x,_.y)}const r=function(e){return 0!==e.elements[1]||0!==e.elements[3]}(t),i=e.subPaths;for(let e=0,a=i.length;e<a;e++){const a=i[e].curves;for(let e=0;e<a.length;e++){const i=a[e];i.isLineCurve?(n(i.v1),n(i.v2)):i.isCubicBezierCurve?(n(i.v0),n(i.v1),n(i.v2),n(i.v3)):i.isQuadraticBezierCurve?(n(i.v0),n(i.v1),n(i.v2)):i.isEllipseCurve&&(r&&console.warn("SVGLoader: Elliptic arc or ellipse rotation or skewing is not implemented."),x.set(i.aX,i.aY),n(x),i.aX=x.x,i.aY=x.y,i.xRadius*=u(t),i.yRadius*=h(t))}}}(M,b),p.push(M),M.userData={node:t,style:r}),l){const n=t.childNodes;for(let t=0;t<n.length;t++)e(n[t],r)}s&&(f.pop(),f.length>0?b.copy(f[f.length-1]):b.identity())}(M.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4});return{paths:p,xml:M.documentElement}}static createShapes(e){const t=999999999,n=0,r=1,i=2,a=3,o=4,s=5,l=6,c={loc:n,t:0};function u(e,t,r,a){const o=e.x,s=t.x,l=r.x,u=a.x,p=e.y,d=t.y,f=r.y,m=a.y,g=(u-l)*(p-f)-(m-f)*(o-l),v=(m-f)*(s-o)-(u-l)*(d-p),y=g/v,x=((s-o)*(p-f)-(d-p)*(o-l))/v;if(0===v&&0!==g||y<=0||y>=1||x<0||x>1)return null;if(0===g&&0===v){for(let l=0;l<2;l++){if(h(0===l?r:a,e,t),c.loc==n){const e=0===l?r:a;return{x:e.x,y:e.y,t:c.t}}if(c.loc==i){return{x:+(o+c.t*(s-o)).toPrecision(10),y:+(p+c.t*(d-p)).toPrecision(10),t:c.t}}}return null}for(let i=0;i<2;i++)if(h(0===i?r:a,e,t),c.loc==n){const e=0===i?r:a;return{x:e.x,y:e.y,t:c.t}}return{x:+(o+y*(s-o)).toPrecision(10),y:+(p+y*(d-p)).toPrecision(10),t:y}}function h(e,t,u){const h=u.x-t.x,p=u.y-t.y,d=e.x-t.x,f=e.y-t.y,m=h*f-d*p;if(e.x===t.x&&e.y===t.y)return c.loc=n,void(c.t=0);if(e.x===u.x&&e.y===u.y)return c.loc=r,void(c.t=1);if(m<-Number.EPSILON)return void(c.loc=a);if(m>Number.EPSILON)return void(c.loc=o);if(h*d<0||p*f<0)return void(c.loc=s);if(Math.sqrt(h*h+p*p)<Math.sqrt(d*d+f*f))return void(c.loc=l);let g;g=0!==h?d/h:f/p,c.loc=i,c.t=g}function p(e,t,n){const r=new Vector2;t.getCenter(r);const i=[];return n.forEach((t=>{if(t.boundingBox.containsPoint(r)){const n=function(e,t){const n=[],r=[];for(let i=1;i<e.length;i++){const a=e[i-1],o=e[i];for(let e=1;e<t.length;e++){const i=u(a,o,t[e-1],t[e]);null!==i&&void 0===n.find((e=>e.t<=i.t+Number.EPSILON&&e.t>=i.t-Number.EPSILON))&&(n.push(i),r.push(new Vector2(i.x,i.y)))}}return r}(e,t.points);n.forEach((e=>{i.push({identifier:t.identifier,isCW:t.isCW,point:e})}))}})),i.sort(((e,t)=>e.point.x-t.point.x)),i}let d=0,f=t,m=-999999999,g=e.subPaths.map((e=>{const n=e.getPoints();let r=-999999999,i=t,a=-999999999,o=t;for(let e=0;e<n.length;e++){const t=n[e];t.y>r&&(r=t.y),t.y<i&&(i=t.y),t.x>a&&(a=t.x),t.x<o&&(o=t.x)}return m<=a&&(m=a+1),f>=o&&(f=o-1),{curves:e.curves,points:n,isCW:ShapeUtils.isClockWise(n),identifier:d++,boundingBox:new Box2(new Vector2(o,i),new Vector2(a,r))}}));g=g.filter((e=>e.points.length>1));const v=g.map((t=>function(e,t,n,r,i){null!=i&&""!==i||(i="nonzero");const a=new Vector2;e.boundingBox.getCenter(a);const o=p([new Vector2(n,a.y),new Vector2(r,a.y)],e.boundingBox,t);o.sort(((e,t)=>e.point.x-t.point.x));const s=[],l=[];o.forEach((t=>{t.identifier===e.identifier?s.push(t):l.push(t)}));const c=s[0].point.x,u=[];let h=0;for(;h<l.length&&l[h].point.x<c;)u.length>0&&u[u.length-1]===l[h].identifier?u.pop():u.push(l[h].identifier),h++;if(u.push(e.identifier),"evenodd"===i){const t=u.length%2==0,n=u[u.length-2];return{identifier:e.identifier,isHole:t,for:n}}if("nonzero"===i){let n=!0,r=null,i=null;for(let e=0;e<u.length;e++){const a=u[e];n?(i=t[a].isCW,n=!1,r=a):i!==t[a].isCW&&(i=t[a].isCW,n=!0)}return{identifier:e.identifier,isHole:n,for:r}}console.warn('fill-rule: "'+i+'" is currently not implemented.')}(t,g,f,m,e.userData.style.fillRule))),y=[];return g.forEach((e=>{if(!v[e.identifier].isHole){const t=new Shape;t.curves=e.curves;v.filter((t=>t.isHole&&t.for===e.identifier)).forEach((e=>{const n=g[e.identifier],r=new Path;r.curves=n.curves,t.holes.push(r)})),y.push(t)}})),y}static getStrokeStyle(e,t,n,r,i){return{strokeColor:t=void 0!==t?t:"#000",strokeWidth:e=void 0!==e?e:1,strokeLineJoin:n=void 0!==n?n:"miter",strokeLineCap:r=void 0!==r?r:"butt",strokeMiterLimit:i=void 0!==i?i:4}}static pointsToStroke(e,t,n,r){const i=[],a=[],o=[];if(0===SVGLoader.pointsToStrokeWithBuffers(e,t,n,r,i,a,o))return null;const s=new BufferGeometry;return s.setAttribute("position",new Float32BufferAttribute(i,3)),s.setAttribute("normal",new Float32BufferAttribute(a,3)),s.setAttribute("uv",new Float32BufferAttribute(o,2)),s}static pointsToStrokeWithBuffers(e,t,n,r,i,a,o,s){const l=new Vector2,c=new Vector2,u=new Vector2,h=new Vector2,p=new Vector2,d=new Vector2,f=new Vector2,m=new Vector2,g=new Vector2,v=new Vector2,y=new Vector2,x=new Vector2,_=new Vector2,b=new Vector2,M=new Vector2,w=new Vector2,S=new Vector2;n=void 0!==n?n:12,r=void 0!==r?r:.001,s=void 0!==s?s:0,e=function(e){let t=!1;for(let n=1,i=e.length-1;n<i;n++)if(e[n].distanceTo(e[n+1])<r){t=!0;break}if(!t)return e;const n=[];n.push(e[0]);for(let t=1,i=e.length-1;t<i;t++)e[t].distanceTo(e[t+1])>=r&&n.push(e[t]);return n.push(e[e.length-1]),n}(e);const T=e.length;if(T<2)return 0;const E=e[0].equals(e[T-1]);let C,A,L=e[0];const P=t.strokeWidth/2,D=1/(T-1);let R,O,I,B,N=0,F=!1,k=0,G=3*s,V=2*s;z(e[0],e[1],l).multiplyScalar(P),m.copy(e[0]).sub(l),g.copy(e[0]).add(l),v.copy(m),y.copy(g);for(let n=1;n<T;n++){C=e[n],A=n===T-1?E?e[1]:void 0:e[n+1];const r=l;if(z(L,C,r),u.copy(r).multiplyScalar(P),x.copy(C).sub(u),_.copy(C).add(u),R=N+D,O=!1,void 0!==A){z(C,A,c),u.copy(c).multiplyScalar(P),b.copy(C).sub(u),M.copy(C).add(u),I=!0,u.subVectors(A,L),r.dot(u)<0&&(I=!1),1===n&&(F=I),u.subVectors(A,C),u.normalize();const e=Math.abs(r.dot(u));if(0!==e){const n=P/e;u.multiplyScalar(-n),h.subVectors(C,L),p.copy(h).setLength(n).add(u),w.copy(p).negate();const r=p.length(),i=h.length();h.divideScalar(i),d.subVectors(A,C);const a=d.length();switch(d.divideScalar(a),h.dot(w)<i&&d.dot(w)<a&&(O=!0),S.copy(p).add(C),w.add(C),B=!1,O?I?(M.copy(w),_.copy(w)):(b.copy(w),x.copy(w)):H(),t.strokeLineJoin){case"bevel":W(I,O,R);break;case"round":q(I,O),I?j(C,x,b,R,0):j(C,M,_,R,1);break;default:const e=P*t.strokeMiterLimit/r;if(e<1){if("miter-clip"!==t.strokeLineJoin){W(I,O,R);break}q(I,O),I?(d.subVectors(S,x).multiplyScalar(e).add(x),f.subVectors(S,b).multiplyScalar(e).add(b),U(x,R,0),U(d,R,0),U(C,R,.5),U(C,R,.5),U(d,R,0),U(f,R,0),U(C,R,.5),U(f,R,0),U(b,R,0)):(d.subVectors(S,_).multiplyScalar(e).add(_),f.subVectors(S,M).multiplyScalar(e).add(M),U(_,R,1),U(d,R,1),U(C,R,.5),U(C,R,.5),U(d,R,1),U(f,R,1),U(C,R,.5),U(f,R,1),U(M,R,1))}else O?(I?(U(g,N,1),U(m,N,0),U(S,R,0),U(g,N,1),U(S,R,0),U(w,R,1)):(U(g,N,1),U(m,N,0),U(S,R,1),U(m,N,0),U(w,R,0),U(S,R,1)),I?b.copy(S):M.copy(S)):I?(U(x,R,0),U(S,R,0),U(C,R,.5),U(C,R,.5),U(S,R,0),U(b,R,0)):(U(_,R,1),U(S,R,1),U(C,R,.5),U(C,R,.5),U(S,R,1),U(M,R,1)),B=!0}}else H()}else H();E||n!==T-1||J(e[0],v,y,I,!0,N),N=R,L=C,m.copy(b),g.copy(M)}if(E){if(O&&i){let e=S,t=w;F!==I&&(e=w,t=S),I?(B||F)&&(t.toArray(i,0),t.toArray(i,9),B&&e.toArray(i,3)):!B&&F||(t.toArray(i,3),t.toArray(i,9),B&&e.toArray(i,0))}}else J(C,x,_,I,!1,R);return k;function z(e,t,n){return n.subVectors(t,e),n.set(-n.y,n.x).normalize()}function U(e,t,n){i&&(i[G]=e.x,i[G+1]=e.y,i[G+2]=0,a&&(a[G]=0,a[G+1]=0,a[G+2]=1),G+=3,o&&(o[V]=t,o[V+1]=n,V+=2)),k+=3}function j(e,t,r,i,a){l.copy(t).sub(e).normalize(),c.copy(r).sub(e).normalize();let o=Math.PI;const s=l.dot(c);Math.abs(s)<1&&(o=Math.abs(Math.acos(s))),o/=n,u.copy(t);for(let t=0,r=n-1;t<r;t++)h.copy(u).rotateAround(e,o),U(u,i,a),U(h,i,a),U(e,i,.5),u.copy(h);U(h,i,a),U(r,i,a),U(e,i,.5)}function H(){U(g,N,1),U(m,N,0),U(x,R,0),U(g,N,1),U(x,R,1),U(_,R,0)}function W(e,t,n){t?e?(U(g,N,1),U(m,N,0),U(x,R,0),U(g,N,1),U(x,R,0),U(w,R,1),U(x,n,0),U(b,n,0),U(w,n,.5)):(U(g,N,1),U(m,N,0),U(_,R,1),U(m,N,0),U(w,R,0),U(_,R,1),U(_,n,1),U(M,n,0),U(w,n,.5)):e?(U(x,n,0),U(b,n,0),U(C,n,.5)):(U(_,n,1),U(M,n,0),U(C,n,.5))}function q(e,t){t&&(e?(U(g,N,1),U(m,N,0),U(x,R,0),U(g,N,1),U(x,R,0),U(w,R,1),U(x,N,0),U(C,R,.5),U(w,R,1),U(C,R,.5),U(b,N,0),U(w,R,1)):(U(g,N,1),U(m,N,0),U(_,R,1),U(m,N,0),U(w,R,0),U(_,R,1),U(_,N,1),U(w,R,0),U(C,R,.5),U(C,R,.5),U(w,R,0),U(M,N,1)))}function J(e,n,r,a,o,s){switch(t.strokeLineCap){case"round":o?j(e,r,n,s,.5):j(e,n,r,s,.5);break;case"square":if(o)l.subVectors(n,e),c.set(l.y,-l.x),u.addVectors(l,c).add(e),h.subVectors(c,l).add(e),a?(u.toArray(i,3),h.toArray(i,0),h.toArray(i,9)):(u.toArray(i,3),u.toArray(i,9),h.toArray(i,0));else{l.subVectors(r,e),c.set(l.y,-l.x),u.addVectors(l,c).add(e),h.subVectors(c,l).add(e);const t=i.length;a?(u.toArray(i,t-3),h.toArray(i,t-6),h.toArray(i,t-12)):(u.toArray(i,t-6),h.toArray(i,t-3),h.toArray(i,t-12))}}}}}function setGeometryPostion(e,t){for(var n=0;n<e.vertices.length;n++)e.vertices[n].x+=t.x,e.vertices[n].y+=t.y,e.vertices[n].z+=t.z}function mixin(e){e.createImage=function(e,t,n,r,i){(new TextureLoader).load(r,(function(n){var r=new PlaneGeometry(t,t),a=new MeshLambertMaterial({map:n,transparent:!0,side:DoubleSide});a.map&&(a.map.needsUpdate=!0),setGeometryPostion(r,e);var o=new Mesh(r,a);o.material.depthTest=!1,i&&i(o)}),void 0,(function(e){console.log(e),i&&i(null)}))},e.loadSVG=function(e,t,n,r,i,a){(new SVGLoader).load(e,(function(e){var o=[],s=e.paths,l=new Group;l.scale.multiplyScalar(r),l.position.x=t,l.position.y=n;for(var c=0;c<s.length;c++){var u=s[c],h=u.userData.style.fill;if(void 0!==h&&"none"!==h){for(var p=new MeshBasicMaterial({color:i||(new Color).setStyle(h),opacity:u.userData.style.fillOpacity,transparent:u.userData.style.fillOpacity<1,side:DoubleSide,depthWrite:!1,wireframe:false}),d=SVGLoader.createShapes(u),f=0;f<d.length;f++){var m=new Mesh(y=new ShapeBufferGeometry(d[f]),p);l.add(m)}o.push(p)}var g=u.userData.style.stroke;if(void 0!==g&&"none"!==g){p=new MeshBasicMaterial({color:i||(new Color).setStyle(g),opacity:u.userData.style.strokeOpacity,transparent:u.userData.style.strokeOpacity<1,side:DoubleSide,depthWrite:!1,wireframe:false}),f=0;for(var v=u.subPaths.length;f<v;f++){var y,x=u.subPaths[f];if(y=SVGLoader.pointsToStroke(x.getPoints(),u.userData.style,12,.001)){m=new Mesh(y,p);l.add(m)}}o.push(p)}}a&&a(l,o)}))}}function floorPowerOfTwo(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function formatString(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++)e=e.replace("{".concat(r,"}"),t[r]);return e}var MxThreeJS=function(){function e(){this.createImage=function(){},this.loadSVG=function(){}}return e.prototype.createLine=function(e,t,n){var r=new Geometry,i=new LineBasicMaterial({color:n});return r.vertices.push(e,t),new Line(r,i)},e.prototype.createCircle=function(e,t,n){var r=new CircleGeometry(t,64,3,2*Math.PI),i=new LineBasicMaterial({color:n});r.vertices.shift();var a=new LineLoop(r,i);return a.position.x=e.x,a.position.y=e.y,a.position.z=e.z,a},e.prototype.createPoint=function(e,t){var n=new Geometry;return n.vertices.push(e),new Points(n,new PointsMaterial({color:t,size:3}))},e.prototype.creatTextSprite=function(e,t,n,r,i){var a,o=256,s=document.createElement("canvas"),l=s.getContext("2d"),c=formatString("normal {0}px Arial","256");if(null==l)return null;l.font=c,a=2*floorPowerOfTwo(l.measureText(e).width),s.width=a,s.height=o,l.font=c,l.textAlign="center",l.textBaseline="middle";var u=formatString("#{0}",i.toString(16));l.fillStyle=u,l.fillText(e,a/2,128);var h=new Texture(s);h.needsUpdate=!0;var p=new SpriteMaterial({transparent:!0,depthTest:!1,map:h});p.rotation=r;var d=new Sprite(p);return d.scale.set(a/o*n,n,1),d.position.set(t.x,t.y,t.z),d},e.prototype.createTriangle=function(e,t,n){if(void 0===n&&(n=1),e.length<3)return null;for(var r=e.length,i=new Geometry,a=0;a+2<r;a+=3){i.vertices.push(e[a]),i.vertices.push(e[a+1]),i.vertices.push(e[a+2]);var o=new Face3(a,a+1,a+2);i.faces.push(o)}return i.computeFaceNormals(),i.computeVertexNormals(),new Mesh(i,new MeshBasicMaterial({color:t,transparent:!0,depthTest:!1,side:DoubleSide,opacity:n}))},e.prototype.createLines=function(e,t){var n=new Geometry;return n.vertices=e,new Line(n,new LineBasicMaterial({color:t}))},e.prototype.createDashedLines=function(e,t,n,r){var i=new Geometry;i.vertices=e;var a=new Line(i,new LineDashedMaterial({color:t,dashSize:n,gapSize:r}));return a.computeLineDistances(),a},e}(),MxThreeJS$1=new MxThreeJS,_MrxDbgUiPrPoint;mixin(MxThreeJS$1);var MrxDbgUiPrPointClass=function(){function e(){_MrxDbgUiPrPoint=new(store.state.MxFun.getMxJigCmdManager().getMrxDbgUiPrPointClass())}return e.prototype.keyWords=function(){return _MrxDbgUiPrPoint.keyWords()},e.prototype.setKeyWords=function(e){return _MrxDbgUiPrPoint.setKeyWords(e)},e.prototype.message=function(){return _MrxDbgUiPrPoint.message()},e.prototype.setMessage=function(e){return _MrxDbgUiPrPoint.setMessage(e)},e.prototype.keyWordPicked=function(){return _MrxDbgUiPrPoint.keyWordPicked()},e.prototype.isKeyWordPicked=function(e){return _MrxDbgUiPrPoint.isKeyWordPicked(e)},e.prototype.setUserDraw=function(e){return _MrxDbgUiPrPoint.setUserDraw(e._get?e._get():e)},e.prototype.value=function(){return _MrxDbgUiPrPoint.value()},e.prototype.valueDocCoord=function(){return _MrxDbgUiPrPoint.valueDocCoord()},e.prototype.basePt=function(){return _MrxDbgUiPrPoint.basePt()},e.prototype.setBasePt=function(e){return _MrxDbgUiPrPoint.setBasePt(e)},e.prototype.setUseBasePt=function(e){return _MrxDbgUiPrPoint.setUseBasePt(e)},e.prototype.go=function(e){return _MrxDbgUiPrPoint.go(e)},e.prototype.goWhile=function(e,t){return _MrxDbgUiPrPoint.goWhile(e,t)},e.prototype.drawReserve=function(e){return _MrxDbgUiPrPoint.drawReserve(e)},e}(),_McEdGetPointWorldDraw,McEdGetPointWorldDrawObjectClass=function(){function e(){_McEdGetPointWorldDraw=new(store.state.MxFun.getMxJigCmdManager().McEdGetPointWorldDrawObjectClass()),this._get=function(){return _McEdGetPointWorldDraw}}return e.prototype.drawCircle=function(e,t){return _McEdGetPointWorldDraw.drawCircle(e,t)},e.prototype.drawLine=function(e,t){return _McEdGetPointWorldDraw.drawLine(e,t)},e.prototype.drawEntity=function(e){return _McEdGetPointWorldDraw.drawEntity(e)},e.prototype.drawText=function(e,t,n,r){return _McEdGetPointWorldDraw.drawText(e,t,n,r)},e.prototype.setDraw=function(e){return _McEdGetPointWorldDraw.setDraw(e)},e}(),MrxDbgUiPrBaseReturn;function useCanvasResizeListener(e,t,n){if(void 0===n&&(n=void 0),store.state.isLoadCanvasResizeListene||(require("element-resize-event-polyfill"),store.commit("setIsLoadCanvasResizeListene",!0)),store.state.MxFun)if(e){var r=createCanvasParent(t);e.addEvent("addResizeEvent",(function(e){r.addEventListener("resize",(function(t){n&&n(t),e(t)}),!1)}))}else console.error("请确保mxdrawObj参数 是通过调用MxFun.createMxObject的callback回调函数拿到的mxDraw对象");else console.error("请先调用useCoreCode方法! ")}!function(e){e[e.kCancel=-2]="kCancel",e[e.kNone=-1]="kNone",e[e.kOk=0]="kOk",e[e.kKeyWord=1]="kKeyWord"}(MrxDbgUiPrBaseReturn||(MrxDbgUiPrBaseReturn={}));var MrxDbgUiPrBaseReturn$1=MrxDbgUiPrBaseReturn,MxFun$1=new MxFun,mxdraw={MxFun:MxFun$1,MxThreeJS:MxThreeJS$1,McEdGetPointWorldDrawObjectClass:McEdGetPointWorldDrawObjectClass,MrxDbgUiPrPointClass:MrxDbgUiPrPointClass,MrxDbgUiPrBaseReturn:MrxDbgUiPrBaseReturn$1,useCanvasResizeListener:useCanvasResizeListener,useCoreCode:useCoreCode,store:store$1};exports.MxFun=MxFun$1,exports.MxThreeJS=MxThreeJS$1,exports.McEdGetPointWorldDrawObjectClass=McEdGetPointWorldDrawObjectClass,exports.MrxDbgUiPrPointClass=MrxDbgUiPrPointClass,exports.MrxDbgUiPrBaseReturn=MrxDbgUiPrBaseReturn$1,exports.useCanvasResizeListener=useCanvasResizeListener,exports.useCoreCode=useCoreCode,exports.store=store$1,exports.default=mxdraw,Object.defineProperty(exports,"__esModule",{value:!0})}));
|
|
19
|
+
Object.assign(PropertyBinding.prototype,{_getValue_unbound:PropertyBinding.prototype.getValue,_setValue_unbound:PropertyBinding.prototype.setValue}),Object.assign(AnimationObjectGroup.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,l=void 0,c=0,u=arguments.length;c!==u;++c){var h=arguments[c],p=h.uuid,d=r[p];if(void 0===d){d=t++,r[p]=d,e.push(h);for(var f=0,m=s;f!==m;++f)o[f].push(new PropertyBinding(h,i[f],a[f]))}else if(d<n){l=e[d];var g=--n,v=e[g];r[v.uuid]=d,e[d]=v,r[p]=g,e[g]=h;for(f=0,m=s;f!==m;++f){var y=o[f],x=y[g],_=y[d];y[d]=x,void 0===_&&(_=new PropertyBinding(h,i[f],a[f])),y[g]=_}}else e[d]!==l&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var e=this._objects,t=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,i=r.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],l=s.uuid,c=n[l];if(void 0!==c&&c>=t){var u=t++,h=e[u];n[h.uuid]=c,e[c]=h,n[l]=u,e[u]=s;for(var p=0,d=i;p!==d;++p){var f=r[p],m=f[u],g=f[c];f[c]=m,f[u]=g}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,i=this._bindings,a=i.length,o=0,s=arguments.length;o!==s;++o){var l=arguments[o],c=l.uuid,u=r[c];if(void 0!==u)if(delete r[c],u<n){var h=--n,p=e[h],d=e[y=--t];r[p.uuid]=u,e[u]=p,r[d.uuid]=h,e[h]=d,e.pop();for(var f=0,m=a;f!==m;++f){var g=(x=i[f])[h],v=x[y];x[u]=g,x[h]=v,x.pop()}}else{var y;r[(d=e[y=--t]).uuid]=u,e[u]=d,e.pop();for(f=0,m=a;f!==m;++f){var x;(x=i[f])[u]=x[y],x.pop()}}}this.nCachedObjects_=n},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,r=n[e],i=this._bindings;if(void 0!==r)return i[r];var a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,c=this.nCachedObjects_,u=new Array(l);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(var h=c,p=s.length;h!==p;++h){var d=s[h];u[h]=new PropertyBinding(d,e,t)}return u},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}}),Object.assign(AnimationAction.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var r=this._clip.duration,i=e._clip.duration,a=i/r,o=r/i;e.warp(1,a,t),this.warp(o,1,t)}return this},crossFadeTo:function(e,t,n){return e.crossFadeFrom(this,t,n)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,n){var r=this._mixer,i=r.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=r._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,l=a.sampleValues;return s[0]=i,s[1]=i+n,l[0]=e/o,l[1]=t/o,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,n,r){if(this.enabled){var i=this._startTime;if(null!==i){var a=(e-i)*n;if(a<0||0===n)return;this._startTime=null,t=n*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(s>0)for(var l=this._interpolants,c=this._propertyBindings,u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(r,s)}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e,n=this._clip.duration,r=this.loop,i=this._loopCount,a=r===LoopPingPong;if(0===e)return-1===i?t:a&&1==(1&i)?n-t:t;if(r===LoopOnce){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(t>=n)t=n;else{if(!(t<0)){this.time=t;break e}t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),t>=n||t<0){var o=Math.floor(t/n);t-=n*o,i+=Math.abs(o);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=e>0?n:0,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var l=e<0;this._setEndings(l,!l,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=t,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=t;if(a&&1==(1&i))return n-t}return t},_setEndings:function(e,t,n){var r=this._interpolantSettings;n?(r.endingStart=ZeroSlopeEnding,r.endingEnd=ZeroSlopeEnding):(r.endingStart=e?this.zeroSlopeAtStart?ZeroSlopeEnding:ZeroCurvatureEnding:WrapAroundEnding,r.endingEnd=t?this.zeroSlopeAtEnd?ZeroSlopeEnding:ZeroCurvatureEnding:WrapAroundEnding)},_scheduleFading:function(e,t,n){var r=this._mixer,i=r.time,a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}}),AnimationMixer.prototype=Object.assign(Object.create(EventDispatcher.prototype),{constructor:AnimationMixer,_bindAction:function(e,t){var n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,l=this._bindingsByRootAndName,c=l[s];void 0===c&&(c={},l[s]=c);for(var u=0;u!==i;++u){var h=r[u],p=h.name,d=c[p];if(void 0!==d)a[u]=d;else{if(void 0!==(d=a[u])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=t&&t._propertyBindings[u].binding.parsedPath;++(d=new PropertyMixer(PropertyBinding.create(n,p,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(d,s,p),a[u]=d}o[u].resultBuffer=d.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}for(var i=e._propertyBindings,a=0,o=i.length;a!==o;++a){var s=i[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var r=this._actions,i=this._actionsByClip,a=i[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,i[t]=a;else{var o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;var i=e._clip.uuid,a=this._actionsByClip,o=a[i],s=o.knownActions,l=s[s.length-1],c=e._byClipCacheIndex;l._byClipCacheIndex=c,s[c]=l,s.pop(),e._byClipCacheIndex=null,delete o.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete a[i],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,r=t.length;n!==r;++n){var i=t[n];0==--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_addInactiveBinding:function(e,t,n){var r=this._bindingsByRootAndName,i=r[t],a=this._bindings;void 0===i&&(i={},r[t]=i),i[n]=e,e._cacheIndex=a.length,a.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,r=n.rootNode.uuid,i=n.path,a=this._bindingsByRootAndName,o=a[r],s=t[t.length-1],l=e._cacheIndex;s._cacheIndex=l,t[l]=s,t.pop(),delete o[i],0===Object.keys(o).length&&delete a[r]},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,i=t[r];e._cacheIndex=r,t[r]=e,i._cacheIndex=n,t[n]=i},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&((n=new LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=t,e[t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,i=t[r];e.__cacheIndex=r,t[r]=e,i.__cacheIndex=n,t[n]=i},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?AnimationClip.findByName(n,e):e,a=null!==i?i.uuid:e,o=this._actionsByClip[a],s=null;if(void 0!==o){var l=o.actionByRoot[r];if(void 0!==l)return l;s=o.knownActions[0],null===i&&(i=s._clip)}if(null===i)return null;var c=new AnimationAction(this,i,t);return this._bindAction(c,s),this._addInactiveAction(c,a,r),c},existingAction:function(e,t){var n=t||this._root,r=n.uuid,i="string"==typeof e?AnimationClip.findByName(n,e):e,a=i?i.uuid:e,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[r]||null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,n=this._bindings,r=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var i=0;i!==t;++i)e[i].reset();for(i=0;i!==r;++i)n[i].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1,o=0;o!==n;++o){t[o]._update(r,e,i,a)}var s=this._bindings,l=this._nActiveBindings;for(o=0;o!==l;++o)s[o].apply(a);return this},setTime:function(e){this.time=0;for(var t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,r=this._actionsByClip,i=r[n];if(void 0!==i){for(var a=i.knownActions,o=0,s=a.length;o!==s;++o){var l=a[o];this._deactivateAction(l);var c=l._cacheIndex,u=t[t.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,u._cacheIndex=c,t[c]=u,t.pop(),this._removeInactiveBindingsForAction(l)}delete r[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var r in n){var i=n[r].actionByRoot[t];void 0!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}var a=this._bindingsByRootAndName[t];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),Uniform.prototype.clone=function(){return new Uniform(void 0===this.value.clone?this.value:this.value.clone())},InstancedInterleavedBuffer.prototype=Object.assign(Object.create(InterleavedBuffer.prototype),{constructor:InstancedInterleavedBuffer,isInstancedInterleavedBuffer:!0,copy:function(e){return InterleavedBuffer.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Object.assign(Raycaster.prototype,{linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t,n){var r=n||[];return intersectObject(e,this,r,t),r.sort(ascSort),r},intersectObjects:function(e,t,n){var r=n||[];if(!1===Array.isArray(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),r;for(var i=0,a=e.length;i<a;i++)intersectObject(e[i],this,r,t);return r.sort(ascSort),r}}),Object.assign(Spherical.prototype,{set:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){var e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(MathUtils.clamp(t/this.radius,-1,1))),this}}),Object.assign(Cylindrical.prototype,{set:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}});var _vector$7=new Vector2;function Box2(e,t){this.min=void 0!==e?e:new Vector2(1/0,1/0),this.max=void 0!==t?t:new Vector2(-1/0,-1/0)}Object.assign(Box2.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=_vector$7.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new Vector2),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new Vector2),this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new Vector2),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new Vector2),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return _vector$7.copy(e).clamp(this.min,this.max).sub(e).length()},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var _startP=new Vector3,_startEnd=new Vector3;function Line3(e,t){this.start=void 0!==e?e:new Vector3,this.end=void 0!==t?t:new Vector3}function ImmediateRenderObject(e){Object3D.call(this),this.material=e,this.render=function(){}}Object.assign(Line3.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new Vector3),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new Vector3),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new Vector3),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){_startP.subVectors(e,this.start),_startEnd.subVectors(this.end,this.start);var n=_startEnd.dot(_startEnd),r=_startEnd.dot(_startP)/n;return t&&(r=MathUtils.clamp(r,0,1)),r},closestPointToPoint:function(e,t,n){var r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Vector3),this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),ImmediateRenderObject.prototype=Object.create(Object3D.prototype),ImmediateRenderObject.prototype.constructor=ImmediateRenderObject,ImmediateRenderObject.prototype.isImmediateRenderObject=!0;var _vector$8=new Vector3;function SpotLightHelper(e,t){Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new BufferGeometry,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,a=1;i<32;i++,a++){var o=i/32*Math.PI*2,s=a/32*Math.PI*2;r.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}n.setAttribute("position",new Float32BufferAttribute(r,3));var l=new LineBasicMaterial({fog:!1});this.cone=new LineSegments(n,l),this.add(this.cone),this.update()}SpotLightHelper.prototype=Object.create(Object3D.prototype),SpotLightHelper.prototype.constructor=SpotLightHelper,SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},SpotLightHelper.prototype.update=function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),_vector$8.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(_vector$8),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var _vector$9=new Vector3,_boneMatrix=new Matrix4,_matrixWorldInv=new Matrix4;function getBoneList(e){var t=[];e&&e.isBone&&t.push(e);for(var n=0;n<e.children.length;n++)t.push.apply(t,getBoneList(e.children[n]));return t}function SkeletonHelper(e){for(var t=getBoneList(e),n=new BufferGeometry,r=[],i=[],a=new Color(0,0,1),o=new Color(0,1,0),s=0;s<t.length;s++){var l=t[s];l.parent&&l.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),i.push(a.r,a.g,a.b),i.push(o.r,o.g,o.b))}n.setAttribute("position",new Float32BufferAttribute(r,3)),n.setAttribute("color",new Float32BufferAttribute(i,3));var c=new LineBasicMaterial({vertexColors:VertexColors,depthTest:!1,depthWrite:!1,transparent:!0});LineSegments.call(this,n,c),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function PointLightHelper(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var r=new SphereBufferGeometry(t,4,2),i=new MeshBasicMaterial({wireframe:!0,fog:!1});Mesh.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}SkeletonHelper.prototype=Object.create(LineSegments.prototype),SkeletonHelper.prototype.constructor=SkeletonHelper,SkeletonHelper.prototype.updateMatrixWorld=function(e){var t=this.bones,n=this.geometry,r=n.getAttribute("position");_matrixWorldInv.getInverse(this.root.matrixWorld);for(var i=0,a=0;i<t.length;i++){var o=t[i];o.parent&&o.parent.isBone&&(_boneMatrix.multiplyMatrices(_matrixWorldInv,o.matrixWorld),_vector$9.setFromMatrixPosition(_boneMatrix),r.setXYZ(a,_vector$9.x,_vector$9.y,_vector$9.z),_boneMatrix.multiplyMatrices(_matrixWorldInv,o.parent.matrixWorld),_vector$9.setFromMatrixPosition(_boneMatrix),r.setXYZ(a+1,_vector$9.x,_vector$9.y,_vector$9.z),a+=2)}n.getAttribute("position").needsUpdate=!0,Object3D.prototype.updateMatrixWorld.call(this,e)},PointLightHelper.prototype=Object.create(Mesh.prototype),PointLightHelper.prototype.constructor=PointLightHelper,PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},PointLightHelper.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var _vector$a=new Vector3,_color1=new Color,_color2=new Color;function HemisphereLightHelper(e,t,n){Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new OctahedronBufferGeometry(t);r.rotateY(.5*Math.PI),this.material=new MeshBasicMaterial({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=VertexColors);var i=r.getAttribute("position"),a=new Float32Array(3*i.count);r.setAttribute("color",new BufferAttribute(a,3)),this.add(new Mesh(r,this.material)),this.update()}function GridHelper(e,t,n,r){e=e||10,t=t||10,n=new Color(void 0!==n?n:4473924),r=new Color(void 0!==r?r:8947848);for(var i=t/2,a=e/t,o=e/2,s=[],l=[],c=0,u=0,h=-o;c<=t;c++,h+=a){s.push(-o,0,h,o,0,h),s.push(h,0,-o,h,0,o);var p=c===i?n:r;p.toArray(l,u),u+=3,p.toArray(l,u),u+=3,p.toArray(l,u),u+=3,p.toArray(l,u),u+=3}var d=new BufferGeometry;d.setAttribute("position",new Float32BufferAttribute(s,3)),d.setAttribute("color",new Float32BufferAttribute(l,3));var f=new LineBasicMaterial({vertexColors:VertexColors});LineSegments.call(this,d,f)}function PolarGridHelper(e,t,n,r,i,a){e=e||10,t=t||16,n=n||8,r=r||64,i=new Color(void 0!==i?i:4473924),a=new Color(void 0!==a?a:8947848);var o,s,l,c,u,h,p,d=[],f=[];for(c=0;c<=t;c++)l=c/t*(2*Math.PI),o=Math.sin(l)*e,s=Math.cos(l)*e,d.push(0,0,0),d.push(o,0,s),p=1&c?i:a,f.push(p.r,p.g,p.b),f.push(p.r,p.g,p.b);for(c=0;c<=n;c++)for(p=1&c?i:a,h=e-e/n*c,u=0;u<r;u++)l=u/r*(2*Math.PI),o=Math.sin(l)*h,s=Math.cos(l)*h,d.push(o,0,s),f.push(p.r,p.g,p.b),l=(u+1)/r*(2*Math.PI),o=Math.sin(l)*h,s=Math.cos(l)*h,d.push(o,0,s),f.push(p.r,p.g,p.b);var m=new BufferGeometry;m.setAttribute("position",new Float32BufferAttribute(d,3)),m.setAttribute("color",new Float32BufferAttribute(f,3));var g=new LineBasicMaterial({vertexColors:VertexColors});LineSegments.call(this,m,g)}HemisphereLightHelper.prototype=Object.create(Object3D.prototype),HemisphereLightHelper.prototype.constructor=HemisphereLightHelper,HemisphereLightHelper.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},HemisphereLightHelper.prototype.update=function(){var e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var t=e.geometry.getAttribute("color");_color1.copy(this.light.color),_color2.copy(this.light.groundColor);for(var n=0,r=t.count;n<r;n++){var i=n<r/2?_color1:_color2;t.setXYZ(n,i.r,i.g,i.b)}t.needsUpdate=!0}e.lookAt(_vector$a.setFromMatrixPosition(this.light.matrixWorld).negate())},GridHelper.prototype=Object.assign(Object.create(LineSegments.prototype),{constructor:GridHelper,copy:function(e){return LineSegments.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return(new this.constructor).copy(this)}}),PolarGridHelper.prototype=Object.create(LineSegments.prototype),PolarGridHelper.prototype.constructor=PolarGridHelper;var _v1$5=new Vector3,_v2$3=new Vector3,_v3$1=new Vector3;function DirectionalLightHelper(e,t,n){Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);var r=new BufferGeometry;r.setAttribute("position",new Float32BufferAttribute([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var i=new LineBasicMaterial({fog:!1});this.lightPlane=new Line(r,i),this.add(this.lightPlane),(r=new BufferGeometry).setAttribute("position",new Float32BufferAttribute([0,0,0,0,0,1],3)),this.targetLine=new Line(r,i),this.add(this.targetLine),this.update()}DirectionalLightHelper.prototype=Object.create(Object3D.prototype),DirectionalLightHelper.prototype.constructor=DirectionalLightHelper,DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},DirectionalLightHelper.prototype.update=function(){_v1$5.setFromMatrixPosition(this.light.matrixWorld),_v2$3.setFromMatrixPosition(this.light.target.matrixWorld),_v3$1.subVectors(_v2$3,_v1$5),this.lightPlane.lookAt(_v2$3),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(_v2$3),this.targetLine.scale.z=_v3$1.length()};var _vector$b=new Vector3,_camera=new Camera;function CameraHelper(e){var t=new BufferGeometry,n=new LineBasicMaterial({color:16777215,vertexColors:FaceColors}),r=[],i=[],a={},o=new Color(16755200),s=new Color(16711680),l=new Color(43775),c=new Color(16777215),u=new Color(3355443);function h(e,t,n){p(e,n),p(t,n)}function p(e,t){r.push(0,0,0),i.push(t.r,t.g,t.b),void 0===a[e]&&(a[e]=[]),a[e].push(r.length/3-1)}h("n1","n2",o),h("n2","n4",o),h("n4","n3",o),h("n3","n1",o),h("f1","f2",o),h("f2","f4",o),h("f4","f3",o),h("f3","f1",o),h("n1","f1",o),h("n2","f2",o),h("n3","f3",o),h("n4","f4",o),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",l),h("u2","u3",l),h("u3","u1",l),h("c","t",c),h("p","c",u),h("cn1","cn2",u),h("cn3","cn4",u),h("cf1","cf2",u),h("cf3","cf4",u),t.setAttribute("position",new Float32BufferAttribute(r,3)),t.setAttribute("color",new Float32BufferAttribute(i,3)),LineSegments.call(this,t,n),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function setPoint(e,t,n,r,i,a,o){_vector$b.set(i,a,o).unproject(r);var s=t[e];if(void 0!==s)for(var l=n.getAttribute("position"),c=0,u=s.length;c<u;c++)l.setXYZ(s[c],_vector$b.x,_vector$b.y,_vector$b.z)}CameraHelper.prototype=Object.create(LineSegments.prototype),CameraHelper.prototype.constructor=CameraHelper,CameraHelper.prototype.update=function(){var e=this.geometry,t=this.pointMap;_camera.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),setPoint("c",t,e,_camera,0,0,-1),setPoint("t",t,e,_camera,0,0,1),setPoint("n1",t,e,_camera,-1,-1,-1),setPoint("n2",t,e,_camera,1,-1,-1),setPoint("n3",t,e,_camera,-1,1,-1),setPoint("n4",t,e,_camera,1,1,-1),setPoint("f1",t,e,_camera,-1,-1,1),setPoint("f2",t,e,_camera,1,-1,1),setPoint("f3",t,e,_camera,-1,1,1),setPoint("f4",t,e,_camera,1,1,1),setPoint("u1",t,e,_camera,.7,1.1,-1),setPoint("u2",t,e,_camera,-.7,1.1,-1),setPoint("u3",t,e,_camera,0,2,-1),setPoint("cf1",t,e,_camera,-1,0,1),setPoint("cf2",t,e,_camera,1,0,1),setPoint("cf3",t,e,_camera,0,-1,1),setPoint("cf4",t,e,_camera,0,1,1),setPoint("cn1",t,e,_camera,-1,0,-1),setPoint("cn2",t,e,_camera,1,0,-1),setPoint("cn3",t,e,_camera,0,-1,-1),setPoint("cn4",t,e,_camera,0,1,-1),e.getAttribute("position").needsUpdate=!0};var _box$3=new Box3;function BoxHelper(e,t){this.object=e,void 0===t&&(t=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),i=new BufferGeometry;i.setIndex(new BufferAttribute(n,1)),i.setAttribute("position",new BufferAttribute(r,3)),LineSegments.call(this,i,new LineBasicMaterial({color:t})),this.matrixAutoUpdate=!1,this.update()}function Box3Helper(e,t){this.type="Box3Helper",this.box=e,t=t||16776960;var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new BufferGeometry;r.setIndex(new BufferAttribute(n,1)),r.setAttribute("position",new Float32BufferAttribute([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),LineSegments.call(this,r,new LineBasicMaterial({color:t})),this.geometry.computeBoundingSphere()}function PlaneHelper(e,t,n){this.type="PlaneHelper",this.plane=e,this.size=void 0===t?1:t;var r=void 0!==n?n:16776960,i=new BufferGeometry;i.setAttribute("position",new Float32BufferAttribute([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),i.computeBoundingSphere(),Line.call(this,i,new LineBasicMaterial({color:r}));var a=new BufferGeometry;a.setAttribute("position",new Float32BufferAttribute([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new Mesh(a,new MeshBasicMaterial({color:r,opacity:.2,transparent:!0,depthWrite:!1})))}BoxHelper.prototype=Object.create(LineSegments.prototype),BoxHelper.prototype.constructor=BoxHelper,BoxHelper.prototype.update=function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&_box$3.setFromObject(this.object),!_box$3.isEmpty()){var t=_box$3.min,n=_box$3.max,r=this.geometry.attributes.position,i=r.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=t.x,i[4]=n.y,i[5]=n.z,i[6]=t.x,i[7]=t.y,i[8]=n.z,i[9]=n.x,i[10]=t.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=t.z,i[15]=t.x,i[16]=n.y,i[17]=t.z,i[18]=t.x,i[19]=t.y,i[20]=t.z,i[21]=n.x,i[22]=t.y,i[23]=t.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}},BoxHelper.prototype.setFromObject=function(e){return this.object=e,this.update(),this},BoxHelper.prototype.copy=function(e){return LineSegments.prototype.copy.call(this,e),this.object=e.object,this},BoxHelper.prototype.clone=function(){return(new this.constructor).copy(this)},Box3Helper.prototype=Object.create(LineSegments.prototype),Box3Helper.prototype.constructor=Box3Helper,Box3Helper.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),Object3D.prototype.updateMatrixWorld.call(this,e))},PlaneHelper.prototype=Object.create(Line.prototype),PlaneHelper.prototype.constructor=PlaneHelper,PlaneHelper.prototype.updateMatrixWorld=function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?BackSide:FrontSide,this.lookAt(this.plane.normal),Object3D.prototype.updateMatrixWorld.call(this,e)};var _axis=new Vector3,_lineGeometry,_coneGeometry;function ArrowHelper(e,t,n,r,i,a){Object3D.call(this),void 0===e&&(e=new Vector3(0,0,1)),void 0===t&&(t=new Vector3(0,0,0)),void 0===n&&(n=1),void 0===r&&(r=16776960),void 0===i&&(i=.2*n),void 0===a&&(a=.2*i),void 0===_lineGeometry&&((_lineGeometry=new BufferGeometry).setAttribute("position",new Float32BufferAttribute([0,0,0,0,1,0],3)),(_coneGeometry=new CylinderBufferGeometry(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new Line(_lineGeometry,new LineBasicMaterial({color:r})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Mesh(_coneGeometry,new MeshBasicMaterial({color:r})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,i,a)}function AxesHelper(e){var t=[0,0,0,e=e||1,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new BufferGeometry;n.setAttribute("position",new Float32BufferAttribute(t,3)),n.setAttribute("color",new Float32BufferAttribute([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var r=new LineBasicMaterial({vertexColors:VertexColors});LineSegments.call(this,n,r)}ArrowHelper.prototype=Object.create(Object3D.prototype),ArrowHelper.prototype.constructor=ArrowHelper,ArrowHelper.prototype.setDirection=function(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{_axis.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(_axis,t)}},ArrowHelper.prototype.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},ArrowHelper.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},ArrowHelper.prototype.copy=function(e){return Object3D.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},ArrowHelper.prototype.clone=function(){return(new this.constructor).copy(this)},AxesHelper.prototype=Object.create(LineSegments.prototype),AxesHelper.prototype.constructor=AxesHelper;var LOD_MIN=4,LOD_MAX=8,EXTRA_LOD_SIGMA=[.125,.215,.35,.446,.526,.582],TOTAL_LODS=LOD_MAX-LOD_MIN+1+EXTRA_LOD_SIGMA.length,MAX_SAMPLES=20,ENCODINGS={[LinearEncoding]:0,[sRGBEncoding]:1,[RGBEEncoding]:2,[RGBM7Encoding]:3,[RGBM16Encoding]:4,[RGBDEncoding]:5,[GammaEncoding]:6},_flatCamera=new OrthographicCamera,_blurMaterial=_getBlurShader(MAX_SAMPLES),{_lodPlanes:_lodPlanes,_sizeLods:_sizeLods,_sigmas:_sigmas}=_createPlanes();function _createPlanes(){for(var e=[],t=[],n=[],r=LOD_MAX,i=0;i<TOTAL_LODS;i++){var a=Math.pow(2,r);t.push(a);var o=1/a;i>LOD_MAX-LOD_MIN?o=EXTRA_LOD_SIGMA[i-LOD_MAX+LOD_MIN-1]:0==i&&(o=0),n.push(o);for(var s=1/(a-1),l=-s/2,c=1+s/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],h=new Float32Array(108),p=new Float32Array(72),d=new Float32Array(36),f=0;f<6;f++){var m=f%3*2/3-1,g=f>2?0:-1,v=[m,g,0,m+2/3,g,0,m+2/3,g+1,0,m,g,0,m+2/3,g+1,0,m,g+1,0];h.set(v,18*f),p.set(u,12*f);var y=[f,f,f,f,f,f];d.set(y,6*f)}var x=new BufferGeometry;x.setAttribute("position",new BufferAttribute(h,3)),x.setAttribute("uv",new BufferAttribute(p,2)),x.setAttribute("faceIndex",new BufferAttribute(d,1)),e.push(x),r>LOD_MIN&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function _getBlurShader(e){var t=new RawShaderMaterial({defines:{n:e},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(e)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new Vector3(0,1,0)},inputEncoding:{value:ENCODINGS[LinearEncoding]},outputEncoding:{value:ENCODINGS[LinearEncoding]}},vertexShader:_getCommonVertexShader(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n${_getEncodings()}\n\n#define ENVMAP_TYPE_CUBE_UV\n#include <cube_uv_reflection_fragment>\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tfor (int i = 0; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfor (int dir = -1; dir < 2; dir += 2) {\n\t\t\tif (i == 0 && dir == 1)\n\t\t\t\tcontinue;\n\t\t\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\t\t\tif (all(equal(axis, vec3(0.0))))\n\t\t\t\taxis = cross(vec3(0.0, 1.0, 0.0), vOutputDirection);\n\t\t\taxis = normalize(axis);\n\t\t\tfloat theta = dTheta * float(dir * i);\n\t\t\tfloat cosTheta = cos(theta);\n\t\t\t// Rodrigues' axis-angle rotation\n\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t\t\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\t\t\tgl_FragColor.rgb +=\n\t\t\t\t\tweights[i] * bilinearCubeUV(envMap, sampleDirection, mipInt);\n\t\t}\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:NoBlending,depthTest:!1,depthWrite:!1});return t.type="SphericalGaussianBlur",t}function _getCommonVertexShader(){return"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t"}function _getEncodings(){return"\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t"}function Spline(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),CatmullRomCurve3.call(this,e),this.type="catmullrom"}Curve.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(Curve.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(CurvePath.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new Geometry,n=0,r=e.length;n<r;n++){var i=e[n];t.vertices.push(new Vector3(i.x,i.y,i.z||0))}return t}}),Object.assign(Path.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),Spline.prototype=Object.create(CatmullRomCurve3.prototype),Object.assign(Spline.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),GridHelper.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},SkeletonHelper.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(Loader.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),LoaderUtils.extractUrlBase(e)}}),Loader.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(ObjectLoader.prototype,{setTexturePath:function(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}),Object.assign(Box2.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(Box3.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Frustum.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},Line3.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(MathUtils,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),MathUtils.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),MathUtils.ceilPowerOfTwo(e)}}),Object.assign(Matrix3.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(Matrix4.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new Vector3).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,a)}}),Plane.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},Quaternion.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(Ray.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(Triangle.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(Triangle,{barycoordFromPoint:function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Triangle.getBarycoord(e,t,n,r,i)},normal:function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Triangle.getNormal(e,t,n,r)}}),Object.assign(Shape.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new ExtrudeGeometry(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new ShapeGeometry(this,e)}}),Object.assign(Vector2.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Vector3.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Vector4.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Geometry.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.assign(Object3D.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(Object3D.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(Mesh.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(Mesh.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),TrianglesDrawMode},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(LOD.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Skeleton.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),SkinnedMesh.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Curve.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),PerspectiveCamera.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Light.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(BufferAttribute.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===DynamicDrawUsage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(DynamicDrawUsage)}}}),Object.assign(BufferAttribute.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?DynamicDrawUsage:StaticDrawUsage),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(BufferGeometry.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new BufferAttribute(arguments[1],arguments[2])))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(BufferGeometry.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(InterleavedBuffer.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===DynamicDrawUsage},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(InterleavedBuffer.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?DynamicDrawUsage:StaticDrawUsage),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(ExtrudeBufferGeometry.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(Uniform.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(Material.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Color}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=e===FlatShading}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(MeshPhongMaterial.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(ShaderMaterial.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(WebGLRenderer.prototype,{clearTarget:function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(WebGLRenderer.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?sRGBEncoding:LinearEncoding}}}),Object.defineProperties(WebGLShadowMap.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(WebGLRenderTarget.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(Audio.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new AudioLoader).load(e,(function(e){t.setBuffer(e)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),AudioAnalyser.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},CubeCamera.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},ImageUtils.crossOrigin=void 0,ImageUtils.loadTexture=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var i=new TextureLoader;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},ImageUtils.loadTextureCube=function(e,t,n,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var i=new CubeTextureLoader;i.setCrossOrigin(this.crossOrigin);var a=i.load(e,n,void 0,r);return t&&(a.mapping=t),a},ImageUtils.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},ImageUtils.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:REVISION}}));class SVGLoader extends Loader{constructor(e){super(e),this.defaultDPI=90,this.defaultUnit="px"}load(e,t,n,r){const i=this,a=new FileLoader(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{t(i.parse(n))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)}parse(e){const t=this;function n(e,t,n,i,a,o,s,l){if(0==t||0==n)return void e.lineTo(l.x,l.y);i=i*Math.PI/180,t=Math.abs(t),n=Math.abs(n);const c=(s.x-l.x)/2,u=(s.y-l.y)/2,h=Math.cos(i)*c+Math.sin(i)*u,p=-Math.sin(i)*c+Math.cos(i)*u;let d=t*t,f=n*n;const m=h*h,g=p*p,v=m/d+g/f;if(v>1){const e=Math.sqrt(v);d=(t*=e)*t,f=(n*=e)*n}const y=d*g+f*m,x=(d*f-y)/y;let _=Math.sqrt(Math.max(0,x));a===o&&(_=-_);const b=_*t*p/n,M=-_*n*h/t,w=Math.cos(i)*b-Math.sin(i)*M+(s.x+l.x)/2,S=Math.sin(i)*b+Math.cos(i)*M+(s.y+l.y)/2,T=r(1,0,(h-b)/t,(p-M)/n),E=r((h-b)/t,(p-M)/n,(-h-b)/t,(-p-M)/n)%(2*Math.PI);e.currentPath.absellipse(w,S,t,n,T,T+E,0===o,i)}function r(e,t,n,r){const i=e*n+t*r,a=Math.sqrt(e*e+t*t)*Math.sqrt(n*n+r*r);let o=Math.acos(Math.max(-1,Math.min(1,i/a)));return e*r-t*n<0&&(o=-o),o}function i(e,t){t=Object.assign({},t);let n={};if(e.hasAttribute("class")){const t=e.getAttribute("class").split(/\s/).filter(Boolean).map((e=>e.trim()));for(let e=0;e<t.length;e++)n=Object.assign(n,d["."+t[e]])}function r(r,i,a){void 0===a&&(a=function(e){return e.startsWith("url")&&console.warn("SVGLoader: url access in attributes is not implemented."),e}),e.hasAttribute(r)&&(t[i]=a(e.getAttribute(r))),n[r]&&(t[i]=a(n[r])),e.style&&""!==e.style[r]&&(t[i]=a(e.style[r]))}function i(e){return Math.max(0,Math.min(1,c(e)))}function a(e){return Math.max(0,c(e))}return e.hasAttribute("id")&&(n=Object.assign(n,d["#"+e.getAttribute("id")])),r("fill","fill"),r("fill-opacity","fillOpacity",i),r("fill-rule","fillRule"),r("opacity","opacity",i),r("stroke","stroke"),r("stroke-opacity","strokeOpacity",i),r("stroke-width","strokeWidth",a),r("stroke-linejoin","strokeLineJoin"),r("stroke-linecap","strokeLineCap"),r("stroke-miterlimit","strokeMiterLimit",a),r("visibility","visibility"),t}function a(e,t){return e-(t-e)}function o(e,t,n){if("string"!=typeof e)throw new TypeError("Invalid input: "+typeof e);const r={SEPARATOR:/[ \t\r\n\,.\-+]/,WHITESPACE:/[ \t\r\n]/,DIGIT:/[\d]/,SIGN:/[-+]/,POINT:/\./,COMMA:/,/,EXP:/e/i,FLAGS:/[01]/};let i=0,a=!0,o="",s="";const l=[];function c(e,t,n){const r=new SyntaxError('Unexpected character "'+e+'" at index '+t+".");throw r.partial=n,r}function u(){""!==o&&(""===s?l.push(Number(o)):l.push(Number(o)*Math.pow(10,Number(s)))),o="",s=""}let h;const p=e.length;for(let d=0;d<p;d++)if(h=e[d],Array.isArray(t)&&t.includes(l.length%n)&&r.FLAGS.test(h))i=1,o=h,u();else{if(0===i){if(r.WHITESPACE.test(h))continue;if(r.DIGIT.test(h)||r.SIGN.test(h)){i=1,o=h;continue}if(r.POINT.test(h)){i=2,o=h;continue}r.COMMA.test(h)&&(a&&c(h,d,l),a=!0)}if(1===i){if(r.DIGIT.test(h)){o+=h;continue}if(r.POINT.test(h)){o+=h,i=2;continue}if(r.EXP.test(h)){i=3;continue}r.SIGN.test(h)&&1===o.length&&r.SIGN.test(o[0])&&c(h,d,l)}if(2===i){if(r.DIGIT.test(h)){o+=h;continue}if(r.EXP.test(h)){i=3;continue}r.POINT.test(h)&&"."===o[o.length-1]&&c(h,d,l)}if(3===i){if(r.DIGIT.test(h)){s+=h;continue}if(r.SIGN.test(h)){if(""===s){s+=h;continue}1===s.length&&r.SIGN.test(s)&&c(h,d,l)}}r.WHITESPACE.test(h)?(u(),i=0,a=!1):r.COMMA.test(h)?(u(),i=0,a=!0):r.SIGN.test(h)?(u(),i=1,o=h):r.POINT.test(h)?(u(),i=2,o=h):c(h,d,l)}return u(),l}const s=["mm","cm","in","pt","pc","px"],l={mm:{mm:1,cm:.1,in:1/25.4,pt:72/25.4,pc:6/25.4,px:-1},cm:{mm:10,cm:1,in:1/2.54,pt:72/2.54,pc:6/2.54,px:-1},in:{mm:25.4,cm:2.54,in:1,pt:72,pc:6,px:-1},pt:{mm:25.4/72,cm:2.54/72,in:1/72,pt:1,pc:6/72,px:-1},pc:{mm:25.4/6,cm:2.54/6,in:1/6,pt:12,pc:1,px:-1},px:{px:1}};function c(e){let n,r="px";if("string"==typeof e||e instanceof String)for(let t=0,n=s.length;t<n;t++){const n=s[t];if(e.endsWith(n)){r=n,e=e.substring(0,e.length-n.length);break}}return"px"===r&&"px"!==t.defaultUnit?n=l.in[t.defaultUnit]/t.defaultDPI:(n=l[r][t.defaultUnit],n<0&&(n=l[r].in*t.defaultDPI)),n*parseFloat(e)}function u(e){const t=e.elements;return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function h(e){const t=e.elements;return Math.sqrt(t[3]*t[3]+t[4]*t[4])}const p=[],d={},f=[],m=new Matrix3,g=new Matrix3,v=new Matrix3,y=new Matrix3,x=new Vector2,_=new Vector3,b=new Matrix3,M=(new DOMParser).parseFromString(e,"image/svg+xml");!function e(t,r){if(1!==t.nodeType)return;const s=function(e){if(!(e.hasAttribute("transform")||"use"===e.nodeName&&(e.hasAttribute("x")||e.hasAttribute("y"))))return null;const t=function(e){const t=new Matrix3,n=m;if("use"===e.nodeName&&(e.hasAttribute("x")||e.hasAttribute("y"))){const n=c(e.getAttribute("x")),r=c(e.getAttribute("y"));t.translate(n,r)}if(e.hasAttribute("transform")){const r=e.getAttribute("transform").split(")");for(let e=r.length-1;e>=0;e--){const i=r[e].trim();if(""===i)continue;const a=i.indexOf("("),s=i.length;if(a>0&&a<s){const e=i.substr(0,a),t=o(i.substr(a+1,s-a-1));switch(n.identity(),e){case"translate":if(t.length>=1){const e=t[0];let r=e;t.length>=2&&(r=t[1]),n.translate(e,r)}break;case"rotate":if(t.length>=1){let e=0,r=0,i=0;e=-t[0]*Math.PI/180,t.length>=3&&(r=t[1],i=t[2]),g.identity().translate(-r,-i),v.identity().rotate(e),y.multiplyMatrices(v,g),g.identity().translate(r,i),n.multiplyMatrices(g,y)}break;case"scale":if(t.length>=1){const e=t[0];let r=e;t.length>=2&&(r=t[1]),n.scale(e,r)}break;case"skewX":1===t.length&&n.set(1,Math.tan(t[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":1===t.length&&n.set(1,0,0,Math.tan(t[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":6===t.length&&n.set(t[0],t[2],t[4],t[1],t[3],t[5],0,0,1)}}t.premultiply(n)}}return t}(e);f.length>0&&t.premultiply(f[f.length-1]);return b.copy(t),f.push(t),t}(t);let l=!0,M=null;switch(t.nodeName){case"svg":break;case"style":!function(e){if(!e.sheet||!e.sheet.cssRules||!e.sheet.cssRules.length)return;for(let t=0;t<e.sheet.cssRules.length;t++){const n=e.sheet.cssRules[t];if(1!==n.type)continue;const r=n.selectorText.split(/,/gm).filter(Boolean).map((e=>e.trim()));for(let e=0;e<r.length;e++)d[r[e]]=Object.assign(d[r[e]]||{},n.style)}}(t);break;case"g":r=i(t,r);break;case"path":r=i(t,r),t.hasAttribute("d")&&(M=function(e){const t=new ShapePath,r=new Vector2,i=new Vector2,s=new Vector2;let l=!0,c=!1;const u=e.getAttribute("d").match(/[a-df-z][^a-df-z]*/gi);for(let e=0,h=u.length;e<h;e++){const h=u[e],p=h.charAt(0),d=h.substr(1).trim();let f;switch(!0===l&&(c=!0,l=!1),p){case"M":f=o(d);for(let e=0,n=f.length;e<n;e+=2)r.x=f[e+0],r.y=f[e+1],i.x=r.x,i.y=r.y,0===e?t.moveTo(r.x,r.y):t.lineTo(r.x,r.y),0===e&&s.copy(r);break;case"H":f=o(d);for(let e=0,n=f.length;e<n;e++)r.x=f[e],i.x=r.x,i.y=r.y,t.lineTo(r.x,r.y),0===e&&!0===c&&s.copy(r);break;case"V":f=o(d);for(let e=0,n=f.length;e<n;e++)r.y=f[e],i.x=r.x,i.y=r.y,t.lineTo(r.x,r.y),0===e&&!0===c&&s.copy(r);break;case"L":f=o(d);for(let e=0,n=f.length;e<n;e+=2)r.x=f[e+0],r.y=f[e+1],i.x=r.x,i.y=r.y,t.lineTo(r.x,r.y),0===e&&!0===c&&s.copy(r);break;case"C":f=o(d);for(let e=0,n=f.length;e<n;e+=6)t.bezierCurveTo(f[e+0],f[e+1],f[e+2],f[e+3],f[e+4],f[e+5]),i.x=f[e+2],i.y=f[e+3],r.x=f[e+4],r.y=f[e+5],0===e&&!0===c&&s.copy(r);break;case"S":f=o(d);for(let e=0,n=f.length;e<n;e+=4)t.bezierCurveTo(a(r.x,i.x),a(r.y,i.y),f[e+0],f[e+1],f[e+2],f[e+3]),i.x=f[e+0],i.y=f[e+1],r.x=f[e+2],r.y=f[e+3],0===e&&!0===c&&s.copy(r);break;case"Q":f=o(d);for(let e=0,n=f.length;e<n;e+=4)t.quadraticCurveTo(f[e+0],f[e+1],f[e+2],f[e+3]),i.x=f[e+0],i.y=f[e+1],r.x=f[e+2],r.y=f[e+3],0===e&&!0===c&&s.copy(r);break;case"T":f=o(d);for(let e=0,n=f.length;e<n;e+=2){const n=a(r.x,i.x),o=a(r.y,i.y);t.quadraticCurveTo(n,o,f[e+0],f[e+1]),i.x=n,i.y=o,r.x=f[e+0],r.y=f[e+1],0===e&&!0===c&&s.copy(r)}break;case"A":f=o(d,[3,4],7);for(let e=0,a=f.length;e<a;e+=7){if(f[e+5]==r.x&&f[e+6]==r.y)continue;const a=r.clone();r.x=f[e+5],r.y=f[e+6],i.x=r.x,i.y=r.y,n(t,f[e],f[e+1],f[e+2],f[e+3],f[e+4],a,r),0===e&&!0===c&&s.copy(r)}break;case"m":f=o(d);for(let e=0,n=f.length;e<n;e+=2)r.x+=f[e+0],r.y+=f[e+1],i.x=r.x,i.y=r.y,0===e?t.moveTo(r.x,r.y):t.lineTo(r.x,r.y),0===e&&s.copy(r);break;case"h":f=o(d);for(let e=0,n=f.length;e<n;e++)r.x+=f[e],i.x=r.x,i.y=r.y,t.lineTo(r.x,r.y),0===e&&!0===c&&s.copy(r);break;case"v":f=o(d);for(let e=0,n=f.length;e<n;e++)r.y+=f[e],i.x=r.x,i.y=r.y,t.lineTo(r.x,r.y),0===e&&!0===c&&s.copy(r);break;case"l":f=o(d);for(let e=0,n=f.length;e<n;e+=2)r.x+=f[e+0],r.y+=f[e+1],i.x=r.x,i.y=r.y,t.lineTo(r.x,r.y),0===e&&!0===c&&s.copy(r);break;case"c":f=o(d);for(let e=0,n=f.length;e<n;e+=6)t.bezierCurveTo(r.x+f[e+0],r.y+f[e+1],r.x+f[e+2],r.y+f[e+3],r.x+f[e+4],r.y+f[e+5]),i.x=r.x+f[e+2],i.y=r.y+f[e+3],r.x+=f[e+4],r.y+=f[e+5],0===e&&!0===c&&s.copy(r);break;case"s":f=o(d);for(let e=0,n=f.length;e<n;e+=4)t.bezierCurveTo(a(r.x,i.x),a(r.y,i.y),r.x+f[e+0],r.y+f[e+1],r.x+f[e+2],r.y+f[e+3]),i.x=r.x+f[e+0],i.y=r.y+f[e+1],r.x+=f[e+2],r.y+=f[e+3],0===e&&!0===c&&s.copy(r);break;case"q":f=o(d);for(let e=0,n=f.length;e<n;e+=4)t.quadraticCurveTo(r.x+f[e+0],r.y+f[e+1],r.x+f[e+2],r.y+f[e+3]),i.x=r.x+f[e+0],i.y=r.y+f[e+1],r.x+=f[e+2],r.y+=f[e+3],0===e&&!0===c&&s.copy(r);break;case"t":f=o(d);for(let e=0,n=f.length;e<n;e+=2){const n=a(r.x,i.x),o=a(r.y,i.y);t.quadraticCurveTo(n,o,r.x+f[e+0],r.y+f[e+1]),i.x=n,i.y=o,r.x=r.x+f[e+0],r.y=r.y+f[e+1],0===e&&!0===c&&s.copy(r)}break;case"a":f=o(d,[3,4],7);for(let e=0,a=f.length;e<a;e+=7){if(0==f[e+5]&&0==f[e+6])continue;const a=r.clone();r.x+=f[e+5],r.y+=f[e+6],i.x=r.x,i.y=r.y,n(t,f[e],f[e+1],f[e+2],f[e+3],f[e+4],a,r),0===e&&!0===c&&s.copy(r)}break;case"Z":case"z":t.currentPath.autoClose=!0,t.currentPath.curves.length>0&&(r.copy(s),t.currentPath.currentPoint.copy(r),l=!0);break;default:console.warn(h)}c=!1}return t}(t));break;case"rect":r=i(t,r),M=function(e){const t=c(e.getAttribute("x")||0),n=c(e.getAttribute("y")||0),r=c(e.getAttribute("rx")||e.getAttribute("ry")||0),i=c(e.getAttribute("ry")||e.getAttribute("rx")||0),a=c(e.getAttribute("width")),o=c(e.getAttribute("height")),s=.448084975506,l=new ShapePath;l.moveTo(t+r,n),l.lineTo(t+a-r,n),(0!==r||0!==i)&&l.bezierCurveTo(t+a-r*s,n,t+a,n+i*s,t+a,n+i);l.lineTo(t+a,n+o-i),(0!==r||0!==i)&&l.bezierCurveTo(t+a,n+o-i*s,t+a-r*s,n+o,t+a-r,n+o);l.lineTo(t+r,n+o),(0!==r||0!==i)&&l.bezierCurveTo(t+r*s,n+o,t,n+o-i*s,t,n+o-i);l.lineTo(t,n+i),(0!==r||0!==i)&&l.bezierCurveTo(t,n+i*s,t+r*s,n,t+r,n);return l}(t);break;case"polygon":r=i(t,r),M=function(e){function t(e,t,n){const a=c(t),o=c(n);0===i?r.moveTo(a,o):r.lineTo(a,o),i++}const n=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,r=new ShapePath;let i=0;return e.getAttribute("points").replace(n,t),r.currentPath.autoClose=!0,r}(t);break;case"polyline":r=i(t,r),M=function(e){function t(e,t,n){const a=c(t),o=c(n);0===i?r.moveTo(a,o):r.lineTo(a,o),i++}const n=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,r=new ShapePath;let i=0;return e.getAttribute("points").replace(n,t),r.currentPath.autoClose=!1,r}(t);break;case"circle":r=i(t,r),M=function(e){const t=c(e.getAttribute("cx")||0),n=c(e.getAttribute("cy")||0),r=c(e.getAttribute("r")||0),i=new Path;i.absarc(t,n,r,0,2*Math.PI);const a=new ShapePath;return a.subPaths.push(i),a}(t);break;case"ellipse":r=i(t,r),M=function(e){const t=c(e.getAttribute("cx")||0),n=c(e.getAttribute("cy")||0),r=c(e.getAttribute("rx")||0),i=c(e.getAttribute("ry")||0),a=new Path;a.absellipse(t,n,r,i,0,2*Math.PI);const o=new ShapePath;return o.subPaths.push(a),o}(t);break;case"line":r=i(t,r),M=function(e){const t=c(e.getAttribute("x1")||0),n=c(e.getAttribute("y1")||0),r=c(e.getAttribute("x2")||0),i=c(e.getAttribute("y2")||0),a=new ShapePath;return a.moveTo(t,n),a.lineTo(r,i),a.currentPath.autoClose=!1,a}(t);break;case"defs":l=!1;break;case"use":r=i(t,r);const s=t.href.baseVal.substring(1),u=t.viewportElement.getElementById(s);u?e(u,r):console.warn("SVGLoader: 'use node' references non-existent node id: "+s)}if(M&&(void 0!==r.fill&&"none"!==r.fill&&M.color.setStyle(r.fill),function(e,t){function n(e){_.set(e.x,e.y,1).applyMatrix3(t),e.set(_.x,_.y)}const r=function(e){return 0!==e.elements[1]||0!==e.elements[3]}(t),i=e.subPaths;for(let e=0,a=i.length;e<a;e++){const a=i[e].curves;for(let e=0;e<a.length;e++){const i=a[e];i.isLineCurve?(n(i.v1),n(i.v2)):i.isCubicBezierCurve?(n(i.v0),n(i.v1),n(i.v2),n(i.v3)):i.isQuadraticBezierCurve?(n(i.v0),n(i.v1),n(i.v2)):i.isEllipseCurve&&(r&&console.warn("SVGLoader: Elliptic arc or ellipse rotation or skewing is not implemented."),x.set(i.aX,i.aY),n(x),i.aX=x.x,i.aY=x.y,i.xRadius*=u(t),i.yRadius*=h(t))}}}(M,b),p.push(M),M.userData={node:t,style:r}),l){const n=t.childNodes;for(let t=0;t<n.length;t++)e(n[t],r)}s&&(f.pop(),f.length>0?b.copy(f[f.length-1]):b.identity())}(M.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4});return{paths:p,xml:M.documentElement}}static createShapes(e){const t=999999999,n=0,r=1,i=2,a=3,o=4,s=5,l=6,c={loc:n,t:0};function u(e,t,r,a){const o=e.x,s=t.x,l=r.x,u=a.x,p=e.y,d=t.y,f=r.y,m=a.y,g=(u-l)*(p-f)-(m-f)*(o-l),v=(m-f)*(s-o)-(u-l)*(d-p),y=g/v,x=((s-o)*(p-f)-(d-p)*(o-l))/v;if(0===v&&0!==g||y<=0||y>=1||x<0||x>1)return null;if(0===g&&0===v){for(let l=0;l<2;l++){if(h(0===l?r:a,e,t),c.loc==n){const e=0===l?r:a;return{x:e.x,y:e.y,t:c.t}}if(c.loc==i){return{x:+(o+c.t*(s-o)).toPrecision(10),y:+(p+c.t*(d-p)).toPrecision(10),t:c.t}}}return null}for(let i=0;i<2;i++)if(h(0===i?r:a,e,t),c.loc==n){const e=0===i?r:a;return{x:e.x,y:e.y,t:c.t}}return{x:+(o+y*(s-o)).toPrecision(10),y:+(p+y*(d-p)).toPrecision(10),t:y}}function h(e,t,u){const h=u.x-t.x,p=u.y-t.y,d=e.x-t.x,f=e.y-t.y,m=h*f-d*p;if(e.x===t.x&&e.y===t.y)return c.loc=n,void(c.t=0);if(e.x===u.x&&e.y===u.y)return c.loc=r,void(c.t=1);if(m<-Number.EPSILON)return void(c.loc=a);if(m>Number.EPSILON)return void(c.loc=o);if(h*d<0||p*f<0)return void(c.loc=s);if(Math.sqrt(h*h+p*p)<Math.sqrt(d*d+f*f))return void(c.loc=l);let g;g=0!==h?d/h:f/p,c.loc=i,c.t=g}function p(e,t,n){const r=new Vector2;t.getCenter(r);const i=[];return n.forEach((t=>{if(t.boundingBox.containsPoint(r)){const n=function(e,t){const n=[],r=[];for(let i=1;i<e.length;i++){const a=e[i-1],o=e[i];for(let e=1;e<t.length;e++){const i=u(a,o,t[e-1],t[e]);null!==i&&void 0===n.find((e=>e.t<=i.t+Number.EPSILON&&e.t>=i.t-Number.EPSILON))&&(n.push(i),r.push(new Vector2(i.x,i.y)))}}return r}(e,t.points);n.forEach((e=>{i.push({identifier:t.identifier,isCW:t.isCW,point:e})}))}})),i.sort(((e,t)=>e.point.x-t.point.x)),i}let d=0,f=t,m=-999999999,g=e.subPaths.map((e=>{const n=e.getPoints();let r=-999999999,i=t,a=-999999999,o=t;for(let e=0;e<n.length;e++){const t=n[e];t.y>r&&(r=t.y),t.y<i&&(i=t.y),t.x>a&&(a=t.x),t.x<o&&(o=t.x)}return m<=a&&(m=a+1),f>=o&&(f=o-1),{curves:e.curves,points:n,isCW:ShapeUtils.isClockWise(n),identifier:d++,boundingBox:new Box2(new Vector2(o,i),new Vector2(a,r))}}));g=g.filter((e=>e.points.length>1));const v=g.map((t=>function(e,t,n,r,i){null!=i&&""!==i||(i="nonzero");const a=new Vector2;e.boundingBox.getCenter(a);const o=p([new Vector2(n,a.y),new Vector2(r,a.y)],e.boundingBox,t);o.sort(((e,t)=>e.point.x-t.point.x));const s=[],l=[];o.forEach((t=>{t.identifier===e.identifier?s.push(t):l.push(t)}));const c=s[0].point.x,u=[];let h=0;for(;h<l.length&&l[h].point.x<c;)u.length>0&&u[u.length-1]===l[h].identifier?u.pop():u.push(l[h].identifier),h++;if(u.push(e.identifier),"evenodd"===i){const t=u.length%2==0,n=u[u.length-2];return{identifier:e.identifier,isHole:t,for:n}}if("nonzero"===i){let n=!0,r=null,i=null;for(let e=0;e<u.length;e++){const a=u[e];n?(i=t[a].isCW,n=!1,r=a):i!==t[a].isCW&&(i=t[a].isCW,n=!0)}return{identifier:e.identifier,isHole:n,for:r}}console.warn('fill-rule: "'+i+'" is currently not implemented.')}(t,g,f,m,e.userData.style.fillRule))),y=[];return g.forEach((e=>{if(!v[e.identifier].isHole){const t=new Shape;t.curves=e.curves;v.filter((t=>t.isHole&&t.for===e.identifier)).forEach((e=>{const n=g[e.identifier],r=new Path;r.curves=n.curves,t.holes.push(r)})),y.push(t)}})),y}static getStrokeStyle(e,t,n,r,i){return{strokeColor:t=void 0!==t?t:"#000",strokeWidth:e=void 0!==e?e:1,strokeLineJoin:n=void 0!==n?n:"miter",strokeLineCap:r=void 0!==r?r:"butt",strokeMiterLimit:i=void 0!==i?i:4}}static pointsToStroke(e,t,n,r){const i=[],a=[],o=[];if(0===SVGLoader.pointsToStrokeWithBuffers(e,t,n,r,i,a,o))return null;const s=new BufferGeometry;return s.setAttribute("position",new Float32BufferAttribute(i,3)),s.setAttribute("normal",new Float32BufferAttribute(a,3)),s.setAttribute("uv",new Float32BufferAttribute(o,2)),s}static pointsToStrokeWithBuffers(e,t,n,r,i,a,o,s){const l=new Vector2,c=new Vector2,u=new Vector2,h=new Vector2,p=new Vector2,d=new Vector2,f=new Vector2,m=new Vector2,g=new Vector2,v=new Vector2,y=new Vector2,x=new Vector2,_=new Vector2,b=new Vector2,M=new Vector2,w=new Vector2,S=new Vector2;n=void 0!==n?n:12,r=void 0!==r?r:.001,s=void 0!==s?s:0,e=function(e){let t=!1;for(let n=1,i=e.length-1;n<i;n++)if(e[n].distanceTo(e[n+1])<r){t=!0;break}if(!t)return e;const n=[];n.push(e[0]);for(let t=1,i=e.length-1;t<i;t++)e[t].distanceTo(e[t+1])>=r&&n.push(e[t]);return n.push(e[e.length-1]),n}(e);const T=e.length;if(T<2)return 0;const E=e[0].equals(e[T-1]);let C,A,L=e[0];const P=t.strokeWidth/2,D=1/(T-1);let R,O,I,B,N=0,F=!1,k=0,G=3*s,V=2*s;z(e[0],e[1],l).multiplyScalar(P),m.copy(e[0]).sub(l),g.copy(e[0]).add(l),v.copy(m),y.copy(g);for(let n=1;n<T;n++){C=e[n],A=n===T-1?E?e[1]:void 0:e[n+1];const r=l;if(z(L,C,r),u.copy(r).multiplyScalar(P),x.copy(C).sub(u),_.copy(C).add(u),R=N+D,O=!1,void 0!==A){z(C,A,c),u.copy(c).multiplyScalar(P),b.copy(C).sub(u),M.copy(C).add(u),I=!0,u.subVectors(A,L),r.dot(u)<0&&(I=!1),1===n&&(F=I),u.subVectors(A,C),u.normalize();const e=Math.abs(r.dot(u));if(0!==e){const n=P/e;u.multiplyScalar(-n),h.subVectors(C,L),p.copy(h).setLength(n).add(u),w.copy(p).negate();const r=p.length(),i=h.length();h.divideScalar(i),d.subVectors(A,C);const a=d.length();switch(d.divideScalar(a),h.dot(w)<i&&d.dot(w)<a&&(O=!0),S.copy(p).add(C),w.add(C),B=!1,O?I?(M.copy(w),_.copy(w)):(b.copy(w),x.copy(w)):H(),t.strokeLineJoin){case"bevel":W(I,O,R);break;case"round":q(I,O),I?j(C,x,b,R,0):j(C,M,_,R,1);break;default:const e=P*t.strokeMiterLimit/r;if(e<1){if("miter-clip"!==t.strokeLineJoin){W(I,O,R);break}q(I,O),I?(d.subVectors(S,x).multiplyScalar(e).add(x),f.subVectors(S,b).multiplyScalar(e).add(b),U(x,R,0),U(d,R,0),U(C,R,.5),U(C,R,.5),U(d,R,0),U(f,R,0),U(C,R,.5),U(f,R,0),U(b,R,0)):(d.subVectors(S,_).multiplyScalar(e).add(_),f.subVectors(S,M).multiplyScalar(e).add(M),U(_,R,1),U(d,R,1),U(C,R,.5),U(C,R,.5),U(d,R,1),U(f,R,1),U(C,R,.5),U(f,R,1),U(M,R,1))}else O?(I?(U(g,N,1),U(m,N,0),U(S,R,0),U(g,N,1),U(S,R,0),U(w,R,1)):(U(g,N,1),U(m,N,0),U(S,R,1),U(m,N,0),U(w,R,0),U(S,R,1)),I?b.copy(S):M.copy(S)):I?(U(x,R,0),U(S,R,0),U(C,R,.5),U(C,R,.5),U(S,R,0),U(b,R,0)):(U(_,R,1),U(S,R,1),U(C,R,.5),U(C,R,.5),U(S,R,1),U(M,R,1)),B=!0}}else H()}else H();E||n!==T-1||J(e[0],v,y,I,!0,N),N=R,L=C,m.copy(b),g.copy(M)}if(E){if(O&&i){let e=S,t=w;F!==I&&(e=w,t=S),I?(B||F)&&(t.toArray(i,0),t.toArray(i,9),B&&e.toArray(i,3)):!B&&F||(t.toArray(i,3),t.toArray(i,9),B&&e.toArray(i,0))}}else J(C,x,_,I,!1,R);return k;function z(e,t,n){return n.subVectors(t,e),n.set(-n.y,n.x).normalize()}function U(e,t,n){i&&(i[G]=e.x,i[G+1]=e.y,i[G+2]=0,a&&(a[G]=0,a[G+1]=0,a[G+2]=1),G+=3,o&&(o[V]=t,o[V+1]=n,V+=2)),k+=3}function j(e,t,r,i,a){l.copy(t).sub(e).normalize(),c.copy(r).sub(e).normalize();let o=Math.PI;const s=l.dot(c);Math.abs(s)<1&&(o=Math.abs(Math.acos(s))),o/=n,u.copy(t);for(let t=0,r=n-1;t<r;t++)h.copy(u).rotateAround(e,o),U(u,i,a),U(h,i,a),U(e,i,.5),u.copy(h);U(h,i,a),U(r,i,a),U(e,i,.5)}function H(){U(g,N,1),U(m,N,0),U(x,R,0),U(g,N,1),U(x,R,1),U(_,R,0)}function W(e,t,n){t?e?(U(g,N,1),U(m,N,0),U(x,R,0),U(g,N,1),U(x,R,0),U(w,R,1),U(x,n,0),U(b,n,0),U(w,n,.5)):(U(g,N,1),U(m,N,0),U(_,R,1),U(m,N,0),U(w,R,0),U(_,R,1),U(_,n,1),U(M,n,0),U(w,n,.5)):e?(U(x,n,0),U(b,n,0),U(C,n,.5)):(U(_,n,1),U(M,n,0),U(C,n,.5))}function q(e,t){t&&(e?(U(g,N,1),U(m,N,0),U(x,R,0),U(g,N,1),U(x,R,0),U(w,R,1),U(x,N,0),U(C,R,.5),U(w,R,1),U(C,R,.5),U(b,N,0),U(w,R,1)):(U(g,N,1),U(m,N,0),U(_,R,1),U(m,N,0),U(w,R,0),U(_,R,1),U(_,N,1),U(w,R,0),U(C,R,.5),U(C,R,.5),U(w,R,0),U(M,N,1)))}function J(e,n,r,a,o,s){switch(t.strokeLineCap){case"round":o?j(e,r,n,s,.5):j(e,n,r,s,.5);break;case"square":if(o)l.subVectors(n,e),c.set(l.y,-l.x),u.addVectors(l,c).add(e),h.subVectors(c,l).add(e),a?(u.toArray(i,3),h.toArray(i,0),h.toArray(i,9)):(u.toArray(i,3),u.toArray(i,9),h.toArray(i,0));else{l.subVectors(r,e),c.set(l.y,-l.x),u.addVectors(l,c).add(e),h.subVectors(c,l).add(e);const t=i.length;a?(u.toArray(i,t-3),h.toArray(i,t-6),h.toArray(i,t-12)):(u.toArray(i,t-6),h.toArray(i,t-3),h.toArray(i,t-12))}}}}}function setGeometryPostion(e,t){for(var n=0;n<e.vertices.length;n++)e.vertices[n].x+=t.x,e.vertices[n].y+=t.y,e.vertices[n].z+=t.z}function mixin(e){e.createImage=function(e,t,n,r,i){(new TextureLoader).load(r,(function(n){var r=new PlaneGeometry(t,t),a=new MeshLambertMaterial({map:n,transparent:!0,side:DoubleSide});a.map&&(a.map.needsUpdate=!0),setGeometryPostion(r,e);var o=new Mesh(r,a);o.material.depthTest=!1,i&&i(o)}),void 0,(function(e){console.log(e),i&&i(null)}))},e.loadSVG=function(e,t,n,r,i,a){(new SVGLoader).load(e,(function(e){var o=[],s=e.paths,l=new Group;l.scale.multiplyScalar(r),l.position.x=t,l.position.y=n,l.scale.y*=-1;for(var c=0;c<s.length;c++){var u=s[c],h=u.userData.style.fill;if(void 0!==h&&"none"!==h){for(var p=new MeshBasicMaterial({color:i||(new Color).setStyle(h),opacity:u.userData.style.fillOpacity,transparent:u.userData.style.fillOpacity<1,side:DoubleSide,depthWrite:!1,wireframe:false}),d=SVGLoader.createShapes(u),f=0;f<d.length;f++){var m=new Mesh(y=new ShapeBufferGeometry(d[f]),p);l.add(m)}o.push(p)}var g=u.userData.style.stroke;if(void 0!==g&&"none"!==g){p=new MeshBasicMaterial({color:i||(new Color).setStyle(g),opacity:u.userData.style.strokeOpacity,transparent:u.userData.style.strokeOpacity<1,side:DoubleSide,depthWrite:!1,wireframe:false}),f=0;for(var v=u.subPaths.length;f<v;f++){var y,x=u.subPaths[f];if(y=SVGLoader.pointsToStroke(x.getPoints(),u.userData.style,12,.001)){m=new Mesh(y,p);l.add(m)}}o.push(p)}}a&&a(l,o)}))}}function floorPowerOfTwo(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}function formatString(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r++)e=e.replace("{".concat(r,"}"),t[r]);return e}var MxThreeJS=function(){function e(){this.createImage=function(){},this.loadSVG=function(){}}return e.prototype.createLine=function(e,t,n){var r=new Geometry,i=new LineBasicMaterial({color:n});return r.vertices.push(e,t),new Line(r,i)},e.prototype.createCircle=function(e,t,n){var r=new CircleGeometry(t,64,3,2*Math.PI),i=new LineBasicMaterial({color:n});r.vertices.shift();var a=new LineLoop(r,i);return a.position.x=e.x,a.position.y=e.y,a.position.z=e.z,a},e.prototype.createPoint=function(e,t){var n=new Geometry;return n.vertices.push(e),new Points(n,new PointsMaterial({color:t,size:3}))},e.prototype.creatTextSprite=function(e,t,n,r,i){var a,o=256,s=document.createElement("canvas"),l=s.getContext("2d"),c=formatString("normal {0}px Arial","256");if(null==l)return null;l.font=c,a=2*floorPowerOfTwo(l.measureText(e).width),s.width=a,s.height=o,l.font=c,l.textAlign="center",l.textBaseline="middle";var u=formatString("#{0}",i.toString(16));l.fillStyle=u,l.fillText(e,a/2,128);var h=new Texture(s);h.needsUpdate=!0;var p=new SpriteMaterial({transparent:!0,depthTest:!1,map:h});p.rotation=r;var d=new Sprite(p);return d.scale.set(a/o*n,n,1),d.position.set(t.x,t.y,t.z),d},e.prototype.createTriangle=function(e,t,n){if(void 0===n&&(n=1),e.length<3)return null;for(var r=e.length,i=new Geometry,a=0;a+2<r;a+=3){i.vertices.push(e[a]),i.vertices.push(e[a+1]),i.vertices.push(e[a+2]);var o=new Face3(a,a+1,a+2);i.faces.push(o)}return i.computeFaceNormals(),i.computeVertexNormals(),new Mesh(i,new MeshBasicMaterial({color:t,transparent:!0,depthTest:!1,side:DoubleSide,opacity:n}))},e.prototype.createLines=function(e,t){var n=new Geometry;return n.vertices=e,new Line(n,new LineBasicMaterial({color:t}))},e.prototype.createDashedLines=function(e,t,n,r){var i=new Geometry;i.vertices=e;var a=new Line(i,new LineDashedMaterial({color:t,dashSize:n,gapSize:r}));return a.computeLineDistances(),a},e}(),MxThreeJS$1=new MxThreeJS,_MrxDbgUiPrPoint;mixin(MxThreeJS$1);var MrxDbgUiPrPointClass=function(){function e(){_MrxDbgUiPrPoint=new(store.state.MxFun.getMxJigCmdManager().getMrxDbgUiPrPointClass())}return e.prototype.keyWords=function(){return _MrxDbgUiPrPoint.keyWords()},e.prototype.setKeyWords=function(e){return _MrxDbgUiPrPoint.setKeyWords(e)},e.prototype.message=function(){return _MrxDbgUiPrPoint.message()},e.prototype.setMessage=function(e){return _MrxDbgUiPrPoint.setMessage(e)},e.prototype.keyWordPicked=function(){return _MrxDbgUiPrPoint.keyWordPicked()},e.prototype.isKeyWordPicked=function(e){return _MrxDbgUiPrPoint.isKeyWordPicked(e)},e.prototype.setUserDraw=function(e){return _MrxDbgUiPrPoint.setUserDraw(e._get?e._get():e)},e.prototype.value=function(){return _MrxDbgUiPrPoint.value()},e.prototype.valueDocCoord=function(){return _MrxDbgUiPrPoint.valueDocCoord()},e.prototype.basePt=function(){return _MrxDbgUiPrPoint.basePt()},e.prototype.setBasePt=function(e){return _MrxDbgUiPrPoint.setBasePt(e)},e.prototype.setUseBasePt=function(e){return _MrxDbgUiPrPoint.setUseBasePt(e)},e.prototype.go=function(e){return _MrxDbgUiPrPoint.go(e)},e.prototype.goWhile=function(e,t){return _MrxDbgUiPrPoint.goWhile(e,t)},e.prototype.drawReserve=function(e){return _MrxDbgUiPrPoint.drawReserve(e)},e}(),_McEdGetPointWorldDraw,McEdGetPointWorldDrawObjectClass=function(){function e(){_McEdGetPointWorldDraw=new(store.state.MxFun.getMxJigCmdManager().McEdGetPointWorldDrawObjectClass()),this._get=function(){return _McEdGetPointWorldDraw}}return e.prototype.drawCircle=function(e,t){return _McEdGetPointWorldDraw.drawCircle(e,t)},e.prototype.drawLine=function(e,t){return _McEdGetPointWorldDraw.drawLine(e,t)},e.prototype.drawEntity=function(e){return _McEdGetPointWorldDraw.drawEntity(e)},e.prototype.drawText=function(e,t,n,r){return _McEdGetPointWorldDraw.drawText(e,t,n,r)},e.prototype.setDraw=function(e){return _McEdGetPointWorldDraw.setDraw(e)},e}(),MrxDbgUiPrBaseReturn;function useCanvasResizeListener(e,t,n){if(void 0===n&&(n=void 0),store.state.isLoadCanvasResizeListene||(require("element-resize-event-polyfill"),store.commit("setIsLoadCanvasResizeListene",!0)),store.state.MxFun)if(e){var r=createCanvasParent(t);e.addEvent("addResizeEvent",(function(e){r.addEventListener("resize",(function(t){n&&n(t),e(t)}),!1)}))}else console.error("请确保mxdrawObj参数 是通过调用MxFun.createMxObject的callback回调函数拿到的mxDraw对象");else console.error("请先调用useCoreCode方法! ")}!function(e){e[e.kCancel=-2]="kCancel",e[e.kNone=-1]="kNone",e[e.kOk=0]="kOk",e[e.kKeyWord=1]="kKeyWord"}(MrxDbgUiPrBaseReturn||(MrxDbgUiPrBaseReturn={}));var MrxDbgUiPrBaseReturn$1=MrxDbgUiPrBaseReturn,MxFun$1=new MxFun,mxdraw={MxFun:MxFun$1,MxThreeJS:MxThreeJS$1,McEdGetPointWorldDrawObjectClass:McEdGetPointWorldDrawObjectClass,MrxDbgUiPrPointClass:MrxDbgUiPrPointClass,MrxDbgUiPrBaseReturn:MrxDbgUiPrBaseReturn$1,useCanvasResizeListener:useCanvasResizeListener,useCoreCode:useCoreCode,store:store$1};exports.MxFun=MxFun$1,exports.MxThreeJS=MxThreeJS$1,exports.McEdGetPointWorldDrawObjectClass=McEdGetPointWorldDrawObjectClass,exports.MrxDbgUiPrPointClass=MrxDbgUiPrPointClass,exports.MrxDbgUiPrBaseReturn=MrxDbgUiPrBaseReturn$1,exports.useCanvasResizeListener=useCanvasResizeListener,exports.useCoreCode=useCoreCode,exports.store=store$1,exports.default=mxdraw,Object.defineProperty(exports,"__esModule",{value:!0})}));
|
|
20
20
|
//# sourceMappingURL=mxdraw.umd.js.map
|