/*! For license information please see LICENSES */ (window.webpackJsonp=window.webpackJsonp||[]).push([[14],{0:function(t,e,n){"use strict";(function(t,r){n.d(e,"e",(function(){return o})),n.d(e,"g",(function(){return l})),n.d(e,"f",(function(){return c})),n.d(e,"c",(function(){return f})),n.d(e,"a",(function(){return d})),n.d(e,"b",(function(){return m})),n.d(e,"d",(function(){return v}));var o="undefined"!=typeof window?window:t.exports&&void 0!==r?r:{},c=function(t){var e={},n=t.document,r=t.GreenSockGlobals=t.GreenSockGlobals||t;if(r.TweenLite)return r.TweenLite;var a,i,p,o,c,l,h,f=function(t){var i,a=t.split("."),p=r;for(i=0;i-1;)(d=_[n[i]]||new x(n[i],[])).gsClass?(l[i]=d.gsClass,y--):h&&d.sc.push(this);if(0===y&&o)for(m=(a=("com.greensock."+t).split(".")).pop(),v=f(a.join("."))[m]=this.gsClass=o.apply(o,l),c&&(r[m]=e[m]=v),i=0;i-1;)for(c=f[i],o=r?T("easing."+c,null,!0):d.easing[c]||{},l=m.length;--l>-1;)h=m[l],E[c+"."+h]=E[h+c]=o[h]=t.getRatio?t:t[h]||new t};for((p=S.prototype)._calcEnd=!1,p.getRatio=function(p){if(this._func)return this._params[0]=p,this._func.apply(null,this._params);var t=this._type,e=this._power,n=1===t?1-p:2===t?p:p<.5?2*p:2*(1-p);return 1===e?n*=n:2===e?n*=n*n:3===e?n*=n*n*n:4===e&&(n*=n*n*n*n),1===t?1-n:2===t?n:p<.5?n/2:1-n/2},i=(a=["Linear","Quad","Cubic","Quart","Quint,Strong"]).length;--i>-1;)p=a[i]+",Power"+i,A(new S(null,null,1,i),p,"easeOut",!0),A(new S(null,null,2,i),p,"easeIn"+(0===i?",easeNone":"")),A(new S(null,null,3,i),p,"easeInOut");E.linear=d.easing.Linear.easeIn,E.swing=d.easing.Quad.easeInOut;var P=T("events.EventDispatcher",(function(t){this._listeners={},this._eventTarget=t||this}));(p=P.prototype).addEventListener=function(t,e,n,r,l){l=l||0;var h,i,f=this._listeners[t],d=0;for(this!==o||c||o.wake(),null==f&&(this._listeners[t]=f=[]),i=f.length;--i>-1;)(h=f[i]).c===e&&h.s===n?f.splice(i,1):0===d&&h.pr-1;)if(n[i].c===e)return void n.splice(i,1)},p.dispatchEvent=function(t){var i,e,n,r=this._listeners[t];if(r)for((i=r.length)>1&&(r=r.slice(0)),e=this._eventTarget;--i>-1;)(n=r[i])&&(n.up?n.c.call(n.s||e,{type:t,target:e}):n.c.call(n.s||e))};var O=t.requestAnimationFrame,C=t.cancelAnimationFrame,D=Date.now||function(){return(new Date).getTime()},R=D();for(i=(a=["ms","moz","webkit","o"]).length;--i>-1&&!O;)O=t[a[i]+"RequestAnimationFrame"],C=t[a[i]+"CancelAnimationFrame"]||t[a[i]+"CancelRequestAnimationFrame"];T("Ticker",(function(t,e){var r,l,h,f,d,m=this,y=D(),_=!(!1===e||!O)&&"auto",x=500,w=33,T=function(t){var e,n,o=D()-R;o>x&&(y+=o-w),R+=o,m.time=(R-y)/1e3,e=m.time-d,(!r||e>0||!0===t)&&(m.frame++,d+=e+(e>=f?.004:f-e),n=!0),!0!==t&&(h=l(T)),n&&m.dispatchEvent("tick")};P.call(m),m.time=m.frame=0,m.tick=function(){T(!0)},m.lagSmoothing=function(t,e){if(!arguments.length)return x<1/1e-8;x=t||1/1e-8,w=Math.min(e,x,0)},m.sleep=function(){null!=h&&(_&&C?C(h):clearTimeout(h),l=v,h=null,m===o&&(c=!1))},m.wake=function(t){null!==h?m.sleep():t?y+=-R+(R=D()):m.frame>10&&(R=D()-x+5),l=0===r?v:_&&O?O:function(t){return setTimeout(t,1e3*(d-m.time)+1|0)},m===o&&(c=!0),T(2)},m.fps=function(t){if(!arguments.length)return r;f=1/((r=t)||60),d=this.time+f,m.wake()},m.useRAF=function(t){if(!arguments.length)return _;m.sleep(),_=t,m.fps(r)},m.fps(t),setTimeout((function(){"auto"===_&&m.frame<5&&"hidden"!==(n||{}).visibilityState&&m.useRAF(!1)}),1500)})),(p=d.Ticker.prototype=new d.events.EventDispatcher).constructor=d.Ticker;var L=T("core.Animation",(function(t,e){if(this.vars=e=e||{},this._duration=this._totalDuration=t||0,this._delay=Number(e.delay)||0,this._timeScale=1,this._active=!!e.immediateRender,this.data=e.data,this._reversed=!!e.reversed,tt){c||o.wake();var n=this.vars.useFrames?Q:tt;n.add(this,n._time),this.vars.paused&&this.paused(!0)}}));o=L.ticker=new d.Ticker,(p=L.prototype)._dirty=p._gc=p._initted=p._paused=!1,p._totalTime=p._time=0,p._rawPrevTime=-1,p._next=p._last=p._onUpdate=p._timeline=p.timeline=null,p._paused=!1;var k=function(){c&&D()-R>2e3&&("hidden"!==(n||{}).visibilityState||!o.lagSmoothing())&&o.wake();var t=setTimeout(k,2e3);t.unref&&t.unref()};k(),p.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},p.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},p.resume=function(t,e){return null!=t&&this.seek(t,e),this.paused(!1)},p.seek=function(time,t){return this.totalTime(Number(time),!1!==t)},p.restart=function(t,e){return this.reversed(!1).paused(!1).totalTime(t?-this._delay:0,!1!==e,!0)},p.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},p.render=function(time,t,e){},p.invalidate=function(){return this._time=this._totalTime=0,this._initted=this._gc=!1,this._rawPrevTime=-1,!this._gc&&this.timeline||this._enabled(!0),this},p.isActive=function(){var t,e=this._timeline,n=this._startTime;return!e||!this._gc&&!this._paused&&e.isActive()&&(t=e.rawTime(!0))>=n&&t-1;)"{self}"===t[i]&&(e[i]=this);return e},p._callback=function(t){var e=this.vars,n=e[t],r=e[t+"Params"],o=e[t+"Scope"]||e.callbackScope||this;switch(r?r.length:0){case 0:n.call(o);break;case 1:n.call(o,r[0]);break;case 2:n.call(o,r[0],r[1]);break;default:n.apply(o,r)}},p.eventCallback=function(t,e,n,r){if("on"===(t||"").substr(0,2)){var o=this.vars;if(1===arguments.length)return o[t];null==e?delete o[t]:(o[t]=e,o[t+"Params"]=y(n)&&-1!==n.join("").indexOf("{self}")?this._swapSelfInParams(n):n,o[t+"Scope"]=r),"onUpdate"===t&&(this._onUpdate=e)}return this},p.delay=function(t){return arguments.length?(this._timeline.smoothChildTiming&&this.startTime(this._startTime+t-this._delay),this._delay=t,this):this._delay},p.duration=function(t){return arguments.length?(this._duration=this._totalDuration=t,this._uncache(!0),this._timeline.smoothChildTiming&&this._time>0&&this._timethis._duration?this._duration:t,e)):this._time},p.totalTime=function(time,t,e){if(c||o.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(time<0&&!e&&(time+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var n=this._totalDuration,r=this._timeline;if(time>n&&!e&&(time=n),this._startTime=(this._paused?this._pauseTime:r._time)-(this._reversed?n-time:time)/this._timeScale,r._dirty||this._uncache(!1),r._timeline)for(;r._timeline;)r._timeline._time!==(r._startTime+r._totalTime)/r._timeScale&&r.totalTime(r._totalTime,!0),r=r._timeline}this._gc&&this._enabled(!0,!1),this._totalTime===time&&0!==this._duration||(N.length&&nt(),this.render(time,t,!1),N.length&&nt())}return this},p.progress=p.totalProgress=function(t,e){var n=this.duration();return arguments.length?this.totalTime(n*t,e):n?this._time/n:this.ratio},p.startTime=function(t){return arguments.length?(t!==this._startTime&&(this._startTime=t,this.timeline&&this.timeline._sortChildren&&this.timeline.add(this,t-this._delay)),this):this._startTime},p.endTime=function(t){return this._startTime+(0!=t?this.totalDuration():this.duration())/this._timeScale},p.timeScale=function(t){if(!arguments.length)return this._timeScale;var e,n;for(t=t||1e-8,this._timeline&&this._timeline.smoothChildTiming&&(n=(e=this._pauseTime)||0===e?e:this._timeline.totalTime(),this._startTime=n-(n-this._startTime)*this._timeScale/t),this._timeScale=t,n=this.timeline;n&&n.timeline;)n._dirty=!0,n.totalDuration(),n=n.timeline;return this},p.reversed=function(t){return arguments.length?(t!=this._reversed&&(this._reversed=t,this.totalTime(this._timeline&&!this._timeline.smoothChildTiming?this.totalDuration()-this._totalTime:this._totalTime,!0)),this):this._reversed},p.paused=function(t){if(!arguments.length)return this._paused;var e,n,r=this._timeline;return t!=this._paused&&r&&(c||t||o.wake(),n=(e=r.rawTime())-this._pauseTime,!t&&r.smoothChildTiming&&(this._startTime+=n,this._uncache(!1)),this._pauseTime=t?e:null,this._paused=t,this._active=this.isActive(),!t&&0!==n&&this._initted&&this.duration()&&(e=r.smoothChildTiming?this._totalTime:(e-this._startTime)/this._timeScale,this.render(e,e===this._totalTime,!0))),this._gc&&!t&&this._enabled(!0,!1),this};var I=T("core.SimpleTimeline",(function(t){L.call(this,0,t),this.autoRemoveChildren=this.smoothChildTiming=!0}));(p=I.prototype=new L).constructor=I,p.kill()._gc=!1,p._first=p._last=p._recent=null,p._sortChildren=!1,p.add=p.insert=function(t,e,n,r){var o,c;if(t._startTime=Number(e||0)+t._delay,t._paused&&this!==t._timeline&&(t._pauseTime=this.rawTime()-(t._timeline.rawTime()-t._pauseTime)),t.timeline&&t.timeline._remove(t,!0),t.timeline=t._timeline=this,t._gc&&t._enabled(!0,!0),o=this._last,this._sortChildren)for(c=t._startTime;o&&o._startTime>c;)o=o._prev;return o?(t._next=o._next,o._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=o,this._recent=t,this._timeline&&this._uncache(!0),this},p._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),t._next=t._prev=t.timeline=null,t===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},p.render=function(time,t,e){var n,r=this._first;for(this._totalTime=this._time=this._rawPrevTime=time;r;)n=r._next,(r._active||time>=r._startTime&&!r._paused&&!r._gc)&&(r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(time-r._startTime)*r._timeScale,t,e):r.render((time-r._startTime)*r._timeScale,t,e)),r=n},p.rawTime=function(){return c||o.wake(),this._totalTime};var j=T("TweenLite",(function(e,n,r){if(L.call(this,n,r),this.render=j.prototype.render,null==e)throw"Cannot tween a null target.";this.target=e="string"!=typeof e?e:j.selector(e)||e;var i,o,c,l=e.jquery||e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodeType&&e[0].style&&!e.nodeType),h=this.vars.overwrite;if(this._overwrite=h=null==h?K[j.defaultOverwrite]:"number"==typeof h?h>>0:K[h],(l||e instanceof Array||e.push&&y(e))&&"number"!=typeof e[0])for(this._targets=c=m(e),this._propLookup=[],this._siblings=[],i=0;i1&&ot(o,this,null,1,this._siblings[i])):"string"==typeof(o=c[i--]=j.selector(o))&&c.splice(i+1,1):c.splice(i--,1);else this._propLookup={},this._siblings=it(e,this,!1),1===h&&this._siblings.length>1&&ot(e,this,null,1,this._siblings);(this.vars.immediateRender||0===n&&0===this._delay&&!1!==this.vars.immediateRender)&&(this._time=-1e-8,this.render(Math.min(0,-this._delay)))}),!0),F=function(e){return e&&e.length&&e!==t&&e[0]&&(e[0]===t||e[0].nodeType&&e[0].style&&!e.nodeType)};(p=j.prototype=new L).constructor=j,p.kill()._gc=!1,p.ratio=0,p._firstPT=p._targets=p._overwrittenProps=p._startAt=null,p._notifyPluginsOfEnabled=p._lazy=!1,j.version="2.1.2",j.defaultEase=p._ease=new S(null,null,1,1),j.defaultOverwrite="auto",j.ticker=o,j.autoSleep=120,j.lagSmoothing=function(t,e){o.lagSmoothing(t,e)},j.selector=t.$||t.jQuery||function(e){var r=t.$||t.jQuery;return r?(j.selector=r,r(e)):(n||(n=t.document),n?n.querySelectorAll?n.querySelectorAll(e):n.getElementById("#"===e.charAt(0)?e.substr(1):e):e)};var N=[],B={},z=/(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,V=/[\+-]=-?[\.\d]/,G=function(t){for(var e,n=this._firstPT;n;)e=n.blob?1===t&&null!=this.end?this.end:t?this.join(""):this.start:n.c*t+n.s,n.m?e=n.m.call(this._tween,e,this._target||n.t,this._tween):e<1e-6&&e>-1e-6&&!n.blob&&(e=0),n.f?n.fp?n.t[n.p](n.fp,e):n.t[n.p](e):n.t[n.p]=e,n=n._next},H=function(t){return(1e3*t|0)/1e3+""},U=function(t,e,filter,n){var r,o,c,i,l,h,f,a=[],d=0,s="",m=0;for(a.start=t,a.end=e,t=a[0]=t+"",e=a[1]=e+"",filter&&(filter(a),t=a[0],e=a[1]),a.length=0,r=t.match(z)||[],o=e.match(z)||[],n&&(n._next=null,n.blob=1,a._firstPT=a._applyPT=n),l=o.length,i=0;i=et){for(p in et=o.frame+(parseInt(j.autoSleep,10)||120),Z){for(i=(a=Z[p].tweens).length;--i>-1;)a[i]._gc&&a.splice(i,1);0===a.length&&delete Z[p]}if((!(p=tt._first)||p._paused)&&j.autoSleep&&!Q._first&&1===o._listeners.tick.length){for(;p&&p._paused;)p=p._next;p||o.sleep()}}},o.addEventListener("tick",L._updateRoot);var it=function(t,e,n){var a,i,r=t._gsTweenID;if(Z[r||(t._gsTweenID=r="t"+J++)]||(Z[r]={target:t,tweens:[]}),e&&((a=Z[r].tweens)[i=a.length]=e,n))for(;--i>-1;)a[i]===e&&a.splice(i,1);return Z[r].tweens},at=function(t,e,n,r){var o,c,l=t.vars.onOverwrite;return l&&(o=l(t,e,n,r)),(l=j.onOverwrite)&&(c=l(t,e,n,r)),!1!==o&&!1!==c},ot=function(t,e,n,r,o){var i,c,l,h;if(1===r||r>=4){for(h=o.length,i=0;i-1;)(l=o[i])===e||l._gc||l._paused||(l._timeline!==e._timeline?(f=f||st(e,0,y),0===st(l,f,y)&&(m[v++]=l)):l._startTime<=d&&l._startTime+l.totalDuration()/l._timeScale>d&&((y||!l._initted)&&d-l._startTime<=2e-8||(m[v++]=l)));for(i=v;--i>-1;)if(h=(l=m[i])._firstPT,2===r&&l._kill(n,t,e)&&(c=!0),2!==r||!l._firstPT&&l._initted&&h){if(2!==r&&!at(l,e))continue;l._enabled(!1,!1)&&(c=!0)}return c},st=function(t,e,n){for(var r=t._timeline,o=r._timeScale,c=t._startTime;r._timeline;){if(c+=r._startTime,o*=r._timeScale,r._paused)return-100;r=r._timeline}return(c/=o)>e?c-e:n&&c===e||!t._initted&&c-e<2e-8?1e-8:(c+=t.totalDuration()/t._timeScale/o)>e+1e-8?0:c-e-1e-8};p._init=function(){var i,t,e,p,n,r,o=this.vars,c=this._overwrittenProps,l=this._duration,h=!!o.immediateRender,f=o.ease,d=this._startAt;if(o.startAt){for(p in d&&(d.render(-1,!0),d.kill()),n={},o.startAt)n[p]=o.startAt[p];if(n.data="isStart",n.overwrite=!1,n.immediateRender=!0,n.lazy=h&&!1!==o.lazy,n.startAt=n.delay=null,n.onUpdate=o.onUpdate,n.onUpdateParams=o.onUpdateParams,n.onUpdateScope=o.onUpdateScope||o.callbackScope||this,this._startAt=j.to(this.target||{},0,n),h)if(this._time>0)this._startAt=null;else if(0!==l)return}else if(o.runBackwards&&0!==l)if(d)d.render(-1,!0),d.kill(),this._startAt=null;else{for(p in 0!==this._time&&(h=!1),e={},o)$[p]&&"autoCSS"!==p||(e[p]=o[p]);if(e.overwrite=0,e.data="isFromStart",e.lazy=h&&!1!==o.lazy,e.immediateRender=h,this._startAt=j.to(this.target,0,e),h){if(0===this._time)return}else this._startAt._init(),this._startAt._enabled(!1),this.vars.immediateRender&&(this._startAt=null)}if(this._ease=f=f?f instanceof S?f:"function"==typeof f?new S(f,o.easeParams):E[f]||j.defaultEase:j.defaultEase,o.easeParams instanceof Array&&f.config&&(this._ease=f.config.apply(f,o.easeParams)),this._easeType=this._ease._type,this._easePower=this._ease._power,this._firstPT=null,this._targets)for(r=this._targets.length,i=0;i-1;)n[h._overwriteProps[i]]=this._firstPT;(h._priority||h._onInitAllProps)&&(l=!0),(h._onDisable||h._onEnable)&&(this._notifyPluginsOfEnabled=!0),f._next&&(f._next._prev=f)}else n[p]=W.call(this,e,p,"get",d,p,0,null,this.vars.stringFilter,c);return o&&this._kill(o,e)?this._initProps(e,n,r,o,c):this._overwrite>1&&this._firstPT&&r.length>1&&ot(e,this,n,this._overwrite,r)?(this._kill(n,e),this._initProps(e,n,r,o,c)):(this._firstPT&&(!1!==this.vars.lazy&&this._duration||this.vars.lazy&&!this._duration)&&(B[e._gsTweenID]=!0),l)},p.render=function(time,t,e){var n,r,o,c,l=this._time,h=this._duration,f=this._rawPrevTime;if(time>=h-1e-8&&time>=0)this._totalTime=this._time=h,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1,this._reversed||(n=!0,r="onComplete",e=e||this._timeline.autoRemoveChildren),0===h&&(this._initted||!this.vars.lazy||e)&&(this._startTime===this._timeline._duration&&(time=0),(f<0||time<=0&&time>=-1e-8||1e-8===f&&"isPause"!==this.data)&&f!==time&&(e=!0,f>1e-8&&(r="onReverseComplete")),this._rawPrevTime=c=!t||time||f===time?time:1e-8);else if(time<1e-8)this._totalTime=this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==l||0===h&&f>0)&&(r="onReverseComplete",n=this._reversed),time>-1e-8?time=0:time<0&&(this._active=!1,0===h&&(this._initted||!this.vars.lazy||e)&&(f>=0&&(1e-8!==f||"isPause"!==this.data)&&(e=!0),this._rawPrevTime=c=!t||time||f===time?time:1e-8)),(!this._initted||this._startAt&&this._startAt.progress())&&(e=!0);else if(this._totalTime=this._time=time,this._easeType){var d=time/h,m=this._easeType,v=this._easePower;(1===m||3===m&&d>=.5)&&(d=1-d),3===m&&(d*=2),1===v?d*=d:2===v?d*=d*d:3===v?d*=d*d*d:4===v&&(d*=d*d*d*d),this.ratio=1===m?1-d:2===m?d:time/h<.5?d/2:1-d/2}else this.ratio=this._ease.getRatio(time/h);if(this._time!==l||e){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!e&&this._firstPT&&(!1!==this.vars.lazy&&this._duration||this.vars.lazy&&!this._duration))return this._time=this._totalTime=l,this._rawPrevTime=f,N.push(this),void(this._lazy=[time,t]);this._time&&!n?this.ratio=this._ease.getRatio(this._time/h):n&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(!1!==this._lazy&&(this._lazy=!1),this._active||!this._paused&&this._time!==l&&time>=0&&(this._active=!0),0===l&&(this._startAt&&(time>=0?this._startAt.render(time,!0,e):r||(r="_dummyGS")),this.vars.onStart&&(0===this._time&&0!==h||t||this._callback("onStart"))),o=this._firstPT;o;)o.f?o.t[o.p](o.c*this.ratio+o.s):o.t[o.p]=o.c*this.ratio+o.s,o=o._next;this._onUpdate&&(time<0&&this._startAt&&-1e-4!==time&&this._startAt.render(time,!0,e),t||(this._time!==l||n||e)&&this._callback("onUpdate")),r&&(this._gc&&!e||(time<0&&this._startAt&&!this._onUpdate&&-1e-4!==time&&this._startAt.render(time,!0,e),n&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!t&&this.vars[r]&&this._callback(r),0===h&&1e-8===this._rawPrevTime&&1e-8!==c&&(this._rawPrevTime=0)))}},p._kill=function(t,e,n){if("all"===t&&(t=null),null==t&&(null==e||e===this.target))return this._lazy=!1,this._enabled(!1,!1);e="string"!=typeof e?e||this._targets||this.target:j.selector(e)||e;var i,r,p,o,c,l,h,f,d,m=n&&this._time&&n._startTime===this._startTime&&this._timeline===n._timeline,v=this._firstPT;if((y(e)||F(e))&&"number"!=typeof e[0])for(i=e.length;--i>-1;)this._kill(t,e[i],n)&&(l=!0);else{if(this._targets){for(i=this._targets.length;--i>-1;)if(e===this._targets[i]){c=this._propLookup[i]||{},this._overwrittenProps=this._overwrittenProps||[],r=this._overwrittenProps[i]=t?this._overwrittenProps[i]||{}:"all";break}}else{if(e!==this.target)return!1;c=this._propLookup,r=this._overwrittenProps=t?this._overwrittenProps||{}:"all"}if(c){if(h=t||c,f=t!==r&&"all"!==r&&t!==c&&("object"!=typeof t||!t._tempKill),n&&(j.onOverwrite||this.vars.onOverwrite)){for(p in h)c[p]&&(d||(d=[]),d.push(p));if((d||!t)&&!at(this,n,e,d))return!1}for(p in h)(o=c[p])&&(m&&(o.f?o.t[o.p](o.s):o.t[o.p]=o.s,l=!0),o.pg&&o.t._kill(h)&&(l=!0),o.pg&&0!==o.t._overwriteProps.length||(o._prev?o._prev._next=o._next:o===this._firstPT&&(this._firstPT=o._next),o._next&&(o._next._prev=o._prev),o._next=o._prev=null),delete c[p]),f&&(r[p]=1);!this._firstPT&&this._initted&&v&&this._enabled(!1,!1)}}return l},p.invalidate=function(){this._notifyPluginsOfEnabled&&j._onPluginEvent("_onDisable",this);var t=this._time;return this._firstPT=this._overwrittenProps=this._startAt=this._onUpdate=null,this._notifyPluginsOfEnabled=this._active=this._lazy=!1,this._propLookup=this._targets?{}:[],L.prototype.invalidate.call(this),this.vars.immediateRender&&(this._time=-1e-8,this.render(t,!1,!1!==this.vars.lazy)),this},p._enabled=function(t,e){if(c||o.wake(),t&&this._gc){var i,n=this._targets;if(n)for(i=n.length;--i>-1;)this._siblings[i]=it(n[i],this,!0);else this._siblings=it(this.target,this,!0)}return L.prototype._enabled.call(this,t,e),!(!this._notifyPluginsOfEnabled||!this._firstPT)&&j._onPluginEvent(t?"_onEnable":"_onDisable",this)},j.to=function(t,e,n){return new j(t,e,n)},j.from=function(t,e,n){return n.runBackwards=!0,n.immediateRender=0!=n.immediateRender,new j(t,e,n)},j.fromTo=function(t,e,n,r){return r.startAt=n,r.immediateRender=0!=r.immediateRender&&0!=n.immediateRender,new j(t,e,r)},j.delayedCall=function(t,e,n,r,o){return new j(e,0,{delay:t,onComplete:e,onCompleteParams:n,callbackScope:r,onReverseComplete:e,onReverseCompleteParams:n,immediateRender:!1,lazy:!1,useFrames:o,overwrite:0})},j.set=function(t,e){return new j(t,0,e)},j.getTweensOf=function(t,e){if(null==t)return[];var i,a,n,r;if(t="string"!=typeof t?t:j.selector(t)||t,(y(t)||F(t))&&"number"!=typeof t[0]){for(i=t.length,a=[];--i>-1;)a=a.concat(j.getTweensOf(t[i],e));for(i=a.length;--i>-1;)for(r=a[i],n=i;--n>-1;)r===a[n]&&a.splice(i,1)}else if(t._gsTweenID)for(i=(a=it(t).concat()).length;--i>-1;)(a[i]._gc||e&&!a[i].isActive())&&a.splice(i,1);return a||[]},j.killTweensOf=j.killDelayedCallsTo=function(t,e,n){"object"==typeof e&&(n=e,e=!1);for(var a=j.getTweensOf(t,e),i=a.length;--i>-1;)a[i]._kill(n,t)};var ct=T("plugins.TweenPlugin",(function(t,e){this._overwriteProps=(t||"").split(","),this._propName=this._overwriteProps[0],this._priority=e||0,this._super=ct.prototype}),!0);if(p=ct.prototype,ct.version="1.19.0",ct.API=2,p._firstPT=null,p._addTween=W,p.setRatio=G,p._kill=function(t){var i,a=this._overwriteProps,e=this._firstPT;if(null!=t[this._propName])this._overwriteProps=[];else for(i=a.length;--i>-1;)null!=t[a[i]]&&a.splice(i,1);for(;e;)null!=t[e.n]&&(e._next&&(e._next._prev=e._prev),e._prev?(e._prev._next=e._next,e._prev=null):this._firstPT===e&&(this._firstPT=e._next)),e=e._next;return!1},p._mod=p._roundProps=function(t){for(var e,n=this._firstPT;n;)(e=t[this._propName]||null!=n.n&&t[n.n.split(this._propName+"_").join("")])&&"function"==typeof e&&(2===n.f?n.t._applyPT.m=e:n.m=e),n=n._next},j._onPluginEvent=function(t,e){var n,r,o,c,l,h=e._firstPT;if("_onInitAllProps"===t){for(;h;){for(l=h._next,r=o;r&&r.pr>h.pr;)r=r._next;(h._prev=r?r._prev:c)?h._prev._next=h:o=h,(h._next=r)?r._prev=h:c=h,h=l}h=e._firstPT=o}for(;h;)h.pg&&"function"==typeof h.t[t]&&h.t[t]()&&(n=!0),h=h._next;return n},ct.activate=function(t){for(var i=t.length;--i>-1;)t[i].API===ct.API&&(X[(new t[i])._propName]=t[i]);return!0},w.plugin=function(t){if(!(t&&t.propName&&t.init&&t.API))throw"illegal plugin definition.";var e,n=t.propName,r=t.priority||0,o=t.overwriteProps,map={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},c=T("plugins."+n.charAt(0).toUpperCase()+n.substr(1)+"Plugin",(function(){ct.call(this,n,r),this._overwriteProps=o||[]}),!0===t.global),p=c.prototype=new ct(n);for(e in p.constructor=c,c.API=t.API,map)"function"==typeof t[e]&&(p[map[e]]=t[e]);return c.version=t.version,ct.activate([c]),c},a=t._gsQueue){for(i=0;i0?1:+t}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var output=Object(t),e=1;e>8&255]+An[t>>16&255]+An[t>>24&255]+"-"+An[255&e]+An[e>>8&255]+"-"+An[e>>16&15|64]+An[e>>24&255]+"-"+An[63&n|128]+An[n>>8&255]+"-"+An[n>>16&255]+An[n>>24&255]+An[255&r]+An[r>>8&255]+An[r>>16&255]+An[r>>24&255]).toUpperCase()},clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,r,o){return r+(t-e)*(o-r)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*Pn.DEG2RAD},radToDeg:function(t){return t*Pn.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}};function On(t,e){this.x=t||0,this.y=e||0}function Cn(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==r?r:1}Object.defineProperties(On.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(On.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(s){return this.x+=s,this.y+=s,this},addVectors:function(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this},addScaledVector:function(t,s){return this.x+=t.x*s,this.y+=t.y*s,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(s){return this.x-=s,this.y-=s,this},subVectors:function(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var n=Math.cos(e),s=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*n-o*s+t.x,this.y=r*s+o*n+t.y,this}}),Object.assign(Cn,{slerp:function(t,e,n,r){return n.copy(t).slerp(e,r)},slerpFlat:function(t,e,n,r,o,c,l){var h=n[r+0],f=n[r+1],d=n[r+2],m=n[r+3],v=o[c+0],y=o[c+1],_=o[c+2],x=o[c+3];if(m!==x||h!==v||f!==y||d!==_){var s=1-l,w=h*v+f*y+d*_+m*x,T=w>=0?1:-1,M=1-w*w;if(M>Number.EPSILON){var S=Math.sqrt(M),E=Math.atan2(S,w*T);s=Math.sin(s*E)/S,l=Math.sin(l*E)/S}var A=l*T;if(h=h*s+v*A,f=f*s+y*A,d=d*s+_*A,m=m*s+x*A,s===1-l){var P=1/Math.sqrt(h*h+f*f+d*d+m*m);h*=P,f*=P,d*=P,m*=P}}t[e]=h,t[e+1]=f,t[e+2]=d,t[e+3]=m}}),Object.defineProperties(Cn.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}}),Object.assign(Cn.prototype,{isQuaternion:!0,set:function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,r=t._y,o=t._z,c=t.order,l=Math.cos,h=Math.sin,f=l(n/2),d=l(r/2),m=l(o/2),v=h(n/2),y=h(r/2),_=h(o/2);return"XYZ"===c?(this._x=v*d*m+f*y*_,this._y=f*y*m-v*d*_,this._z=f*d*_+v*y*m,this._w=f*d*m-v*y*_):"YXZ"===c?(this._x=v*d*m+f*y*_,this._y=f*y*m-v*d*_,this._z=f*d*_-v*y*m,this._w=f*d*m+v*y*_):"ZXY"===c?(this._x=v*d*m-f*y*_,this._y=f*y*m+v*d*_,this._z=f*d*_+v*y*m,this._w=f*d*m-v*y*_):"ZYX"===c?(this._x=v*d*m-f*y*_,this._y=f*y*m+v*d*_,this._z=f*d*_-v*y*m,this._w=f*d*m+v*y*_):"YZX"===c?(this._x=v*d*m+f*y*_,this._y=f*y*m+v*d*_,this._z=f*d*_-v*y*m,this._w=f*d*m-v*y*_):"XZY"===c&&(this._x=v*d*m-f*y*_,this._y=f*y*m-v*d*_,this._z=f*d*_+v*y*m,this._w=f*d*m+v*y*_),!1!==e&&this._onChangeCallback(),this},setFromAxisAngle:function(t,e){var n=e/2,s=Math.sin(n);return this._x=t.x*s,this._y=t.y*s,this._z=t.z*s,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(t){var s,e=t.elements,n=e[0],r=e[4],o=e[8],c=e[1],l=e[5],h=e[9],f=e[2],d=e[6],m=e[10],v=n+l+m;return v>0?(s=.5/Math.sqrt(v+1),this._w=.25/s,this._x=(d-h)*s,this._y=(o-f)*s,this._z=(c-r)*s):n>l&&n>m?(s=2*Math.sqrt(1+n-l-m),this._w=(d-h)/s,this._x=.25*s,this._y=(r+c)/s,this._z=(o+f)/s):l>m?(s=2*Math.sqrt(1+l-n-m),this._w=(o-f)/s,this._x=(r+c)/s,this._y=.25*s,this._z=(h+d)/s):(s=2*Math.sqrt(1+m-n-l),this._w=(c-r)/s,this._x=(o+f)/s,this._y=(h+d)/s,this._z=.25*s),this._onChangeCallback(),this},setFromUnitVectors:function(t,e){var n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()},angleTo:function(q){return 2*Math.acos(Math.abs(Pn.clamp(this.dot(q),-1,1)))},rotateTowards:function(q,t){var e=this.angleTo(q);if(0===e)return this;var n=Math.min(1,t/e);return this.slerp(q,n),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},multiply:function(q,p){return void 0!==p?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(q,p)):this.multiplyQuaternions(this,q)},premultiply:function(q){return this.multiplyQuaternions(q,this)},multiplyQuaternions:function(a,b){var t=a._x,e=a._y,n=a._z,r=a._w,o=b._x,c=b._y,l=b._z,h=b._w;return this._x=t*h+r*o+e*l-n*c,this._y=e*h+r*c+n*o-t*l,this._z=n*h+r*l+t*c-e*o,this._w=r*h-t*o-e*c-n*l,this._onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,r=this._y,o=this._z,c=this._w,l=c*t._w+n*t._x+r*t._y+o*t._z;if(l<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,l=-l):this.copy(t),l>=1)return this._w=c,this._x=n,this._y=r,this._z=o,this;var h=1-l*l;if(h<=Number.EPSILON){var s=1-e;return this._w=s*c+e*this._w,this._x=s*n+e*this._x,this._y=s*r+e*this._y,this._z=s*o+e*this._z,this.normalize(),this._onChangeCallback(),this}var f=Math.sqrt(h),d=Math.atan2(f,l),m=Math.sin((1-e)*d)/f,v=Math.sin(e*d)/f;return this._w=c*m+this._w*v,this._x=n*m+this._x*v,this._y=r*m+this._y*v,this._z=o*m+this._z*v,this._onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}});var Dn=new Ln,Rn=new Cn;function Ln(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}Object.assign(Ln.prototype,{isVector3:!0,set:function(t,e,n){return this.x=t,this.y=e,this.z=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(s){return this.x+=s,this.y+=s,this.z+=s,this},addVectors:function(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this},addScaledVector:function(t,s){return this.x+=t.x*s,this.y+=t.y*s,this.z+=t.z*s,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(s){return this.x-=s,this.y-=s,this.z-=s,this},subVectors:function(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(a,b){return this.x=a.x*b.x,this.y=a.y*b.y,this.z=a.z*b.z,this},applyEuler:function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Rn.setFromEuler(t))},applyAxisAngle:function(t,e){return this.applyQuaternion(Rn.setFromAxisAngle(t,e))},applyMatrix3:function(t){var e=this.x,n=this.y,r=this.z,o=t.elements;return this.x=o[0]*e+o[3]*n+o[6]*r,this.y=o[1]*e+o[4]*n+o[7]*r,this.z=o[2]*e+o[5]*n+o[8]*r,this},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},applyMatrix4:function(t){var e=this.x,n=this.y,r=this.z,o=t.elements,c=1/(o[3]*e+o[7]*n+o[11]*r+o[15]);return this.x=(o[0]*e+o[4]*n+o[8]*r+o[12])*c,this.y=(o[1]*e+o[5]*n+o[9]*r+o[13])*c,this.z=(o[2]*e+o[6]*n+o[10]*r+o[14])*c,this},applyQuaternion:function(q){var t=this.x,e=this.y,n=this.z,r=q.x,o=q.y,c=q.z,l=q.w,h=l*t+o*n-c*e,f=l*e+c*t-r*n,d=l*n+r*e-o*t,m=-r*t-o*e-c*n;return this.x=h*l+m*-r+f*-c-d*-o,this.y=f*l+m*-o+d*-r-h*-c,this.z=d*l+m*-c+h*-o-f*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){var e=this.x,n=this.y,r=this.z,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*r,this.y=o[1]*e+o[5]*n+o[9]*r,this.z=o[2]*e+o[6]*n+o[10]*r,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(a,b){var t=a.x,e=a.y,n=a.z,r=b.x,o=b.y,c=b.z;return this.x=e*c-n*o,this.y=n*r-t*c,this.z=t*o-e*r,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:function(t){return Dn.copy(this).projectOnVector(t),this.sub(Dn)},reflect:function(t){return this.sub(Dn.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());0===e&&console.error("THREE.Vector3: angleTo() can't handle zero length vectors.");var n=this.dot(t)/e;return Math.acos(Pn.clamp(n,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(s){return this.setFromSphericalCoords(s.radius,s.phi,s.theta)},setFromSphericalCoords:function(t,e,n){var r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}});var kn,In=new Ln;function jn(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.assign(jn.prototype,{isMatrix3:!0,set:function(t,e,n,r,o,c,l,h,f){var d=this.elements;return d[0]=t,d[1]=r,d[2]=l,d[3]=e,d[4]=o,d[5]=h,d[6]=n,d[7]=c,d[8]=f,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToBufferAttribute:function(t){for(var i=0,e=t.count;i2048||canvas.height>2048?canvas.toDataURL("image/jpeg",.6):canvas.toDataURL("image/png")}},Nn=0;function Bn(image,t,e,n,r,o,c,l,h,f){Object.defineProperty(this,"id",{value:Nn++}),this.uuid=Pn.generateUUID(),this.name="",this.image=void 0!==image?image:Bn.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:Bn.DEFAULT_MAPPING,this.wrapS=void 0!==e?e:Pt,this.wrapT=void 0!==n?n:Pt,this.magFilter=void 0!==r?r:It,this.minFilter=void 0!==o?o:Nt,this.anisotropy=void 0!==h?h:1,this.format=void 0!==c?c:te,this.type=void 0!==l?l:zt,this.offset=new On(0,0),this.repeat=new On(1,1),this.center=new On(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new jn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==f?f:Ge,this.version=0,this.onUpdate=null}function zn(t,e,n,r){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==r?r:1}function Vn(t,e,n){this.width=t,this.height=e,this.scissor=new zn(0,0,t,e),this.scissorTest=!1,this.viewport=new zn(0,0,t,e),n=n||{},this.texture=new Bn(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:It,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function Gn(t,e,n){Vn.call(this,t,e,n),this.samples=4}Bn.DEFAULT_IMAGE=void 0,Bn.DEFAULT_MAPPING=bt,Bn.prototype=Object.assign(Object.create(En.prototype),{constructor:Bn,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(source){return this.name=source.name,this.image=source.image,this.mipmaps=source.mipmaps.slice(0),this.mapping=source.mapping,this.wrapS=source.wrapS,this.wrapT=source.wrapT,this.magFilter=source.magFilter,this.minFilter=source.minFilter,this.anisotropy=source.anisotropy,this.format=source.format,this.type=source.type,this.offset.copy(source.offset),this.repeat.copy(source.repeat),this.center.copy(source.center),this.rotation=source.rotation,this.matrixAutoUpdate=source.matrixAutoUpdate,this.matrix.copy(source.matrix),this.generateMipmaps=source.generateMipmaps,this.premultiplyAlpha=source.premultiplyAlpha,this.flipY=source.flipY,this.unpackAlignment=source.unpackAlignment,this.encoding=source.encoding,this},toJSON:function(meta){var t=void 0===meta||"string"==typeof meta;if(!t&&void 0!==meta.textures[this.uuid])return meta.textures[this.uuid];var output={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var image=this.image;if(void 0===image.uuid&&(image.uuid=Pn.generateUUID()),!t&&void 0===meta.images[image.uuid]){var e;if(Array.isArray(image)){e=[];for(var i=0,n=image.length;i1)switch(this.wrapS){case At:t.x=t.x-Math.floor(t.x);break;case Pt:t.x=t.x<0?0:1;break;case Ot:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case At:t.y=t.y-Math.floor(t.y);break;case Pt:t.y=t.y<0?0:1;break;case Ot:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(Bn.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.defineProperties(zn.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(zn.prototype,{isVector4:!0,set:function(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(s){return this.x+=s,this.y+=s,this.z+=s,this.w+=s,this},addVectors:function(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this.w=a.w+b.w,this},addScaledVector:function(t,s){return this.x+=t.x*s,this.y+=t.y*s,this.z+=t.z*s,this.w+=t.w*s,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(s){return this.x-=s,this.y-=s,this.z-=s,this.w-=s,this},subVectors:function(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z,this.w=a.w-b.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,n=this.y,r=this.z,o=this.w,c=t.elements;return this.x=c[0]*e+c[4]*n+c[8]*r+c[12]*o,this.y=c[1]*e+c[5]*n+c[9]*r+c[13]*o,this.z=c[2]*e+c[6]*n+c[10]*r+c[14]*o,this.w=c[3]*e+c[7]*n+c[11]*r+c[15]*o,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(q){this.w=2*Math.acos(q.w);var s=Math.sqrt(1-q.w*q.w);return s<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=q.x/s,this.y=q.y/s,this.z=q.z/s),this},setAxisAngleFromRotationMatrix:function(t){var e,n,r,o,c=t.elements,l=c[0],h=c[4],f=c[8],d=c[1],m=c[5],v=c[9],y=c[2],_=c[6],x=c[10];if(Math.abs(h-d)<.01&&Math.abs(f-y)<.01&&Math.abs(v-_)<.01){if(Math.abs(h+d)<.1&&Math.abs(f+y)<.1&&Math.abs(v+_)<.1&&Math.abs(l+m+x-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var w=(l+1)/2,T=(m+1)/2,M=(x+1)/2,S=(h+d)/4,E=(f+y)/4,A=(v+_)/4;return w>T&&w>M?w<.01?(n=0,r=.707106781,o=.707106781):(r=S/(n=Math.sqrt(w)),o=E/n):T>M?T<.01?(n=.707106781,r=0,o=.707106781):(n=S/(r=Math.sqrt(T)),o=A/r):M<.01?(n=.707106781,r=.707106781,o=0):(n=E/(o=Math.sqrt(M)),r=A/o),this.set(n,r,o,e),this}var s=Math.sqrt((_-v)*(_-v)+(f-y)*(f-y)+(d-h)*(d-h));return Math.abs(s)<.001&&(s=1),this.x=(_-v)/s,this.y=(f-y)/s,this.z=(d-h)/s,this.w=Math.acos((l+m+x-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),Vn.prototype=Object.assign(Object.create(En.prototype),{constructor:Vn,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(source){return this.width=source.width,this.height=source.height,this.viewport.copy(source.viewport),this.texture=source.texture.clone(),this.depthBuffer=source.depthBuffer,this.stencilBuffer=source.stencilBuffer,this.depthTexture=source.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Gn.prototype=Object.assign(Object.create(Vn.prototype),{constructor:Gn,isWebGLMultisampleRenderTarget:!0,copy:function(source){return Vn.prototype.copy.call(this,source),this.samples=source.samples,this}});var Hn=new Ln,Un=new Jn,Wn=new Ln(0,0,0),qn=new Ln(1,1,1),Yn=new Ln,Xn=new Ln,Zn=new Ln;function Jn(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(Jn.prototype,{isMatrix4:!0,set:function(t,e,n,r,o,c,l,h,f,d,m,v,y,_,x,w){var T=this.elements;return T[0]=t,T[4]=e,T[8]=n,T[12]=r,T[1]=o,T[5]=c,T[9]=l,T[13]=h,T[2]=f,T[6]=d,T[10]=m,T[14]=v,T[3]=y,T[7]=_,T[11]=x,T[15]=w,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new Jn).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},copyPosition:function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},extractBasis:function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},extractRotation:function(t){var e=this.elements,n=t.elements,r=1/Hn.setFromMatrixColumn(t,0).length(),o=1/Hn.setFromMatrixColumn(t,1).length(),c=1/Hn.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*o,e[5]=n[5]*o,e[6]=n[6]*o,e[7]=0,e[8]=n[8]*c,e[9]=n[9]*c,e[10]=n[10]*c,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,n=t.x,r=t.y,o=t.z,a=Math.cos(n),b=Math.sin(n),c=Math.cos(r),l=Math.sin(r),h=Math.cos(o),f=Math.sin(o);if("XYZ"===t.order){var d=a*h,m=a*f,v=b*h,y=b*f;e[0]=c*h,e[4]=-c*f,e[8]=l,e[1]=m+v*l,e[5]=d-y*l,e[9]=-b*c,e[2]=y-d*l,e[6]=v+m*l,e[10]=a*c}else if("YXZ"===t.order){var _=c*h,x=c*f,w=l*h,T=l*f;e[0]=_+T*b,e[4]=w*b-x,e[8]=a*l,e[1]=a*f,e[5]=a*h,e[9]=-b,e[2]=x*b-w,e[6]=T+_*b,e[10]=a*c}else if("ZXY"===t.order){_=c*h,x=c*f,w=l*h,T=l*f;e[0]=_-T*b,e[4]=-a*f,e[8]=w+x*b,e[1]=x+w*b,e[5]=a*h,e[9]=T-_*b,e[2]=-a*l,e[6]=b,e[10]=a*c}else if("ZYX"===t.order){d=a*h,m=a*f,v=b*h,y=b*f;e[0]=c*h,e[4]=v*l-m,e[8]=d*l+y,e[1]=c*f,e[5]=y*l+d,e[9]=m*l-v,e[2]=-l,e[6]=b*c,e[10]=a*c}else if("YZX"===t.order){var M=a*c,S=a*l,E=b*c,A=b*l;e[0]=c*h,e[4]=A-M*f,e[8]=E*f+S,e[1]=f,e[5]=a*h,e[9]=-b*h,e[2]=-l*h,e[6]=S*f+E,e[10]=M-A*f}else if("XZY"===t.order){M=a*c,S=a*l,E=b*c,A=b*l;e[0]=c*h,e[4]=-f,e[8]=l*h,e[1]=M*f+A,e[5]=a*h,e[9]=S*f-E,e[2]=E*f-S,e[6]=b*h,e[10]=A*f+M}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(q){return this.compose(Wn,q,qn)},lookAt:function(t,e,n){var r=this.elements;return Zn.subVectors(t,e),0===Zn.lengthSq()&&(Zn.z=1),Zn.normalize(),Yn.crossVectors(n,Zn),0===Yn.lengthSq()&&(1===Math.abs(n.z)?Zn.x+=1e-4:Zn.z+=1e-4,Zn.normalize(),Yn.crossVectors(n,Zn)),Yn.normalize(),Xn.crossVectors(Zn,Yn),r[0]=Yn.x,r[4]=Xn.x,r[8]=Zn.x,r[1]=Yn.y,r[5]=Xn.y,r[9]=Zn.y,r[2]=Yn.z,r[6]=Xn.z,r[10]=Zn.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(a,b){var t=a.elements,e=b.elements,n=this.elements,r=t[0],o=t[4],c=t[8],l=t[12],h=t[1],f=t[5],d=t[9],m=t[13],v=t[2],y=t[6],_=t[10],x=t[14],w=t[3],T=t[7],M=t[11],S=t[15],E=e[0],A=e[4],P=e[8],O=e[12],C=e[1],D=e[5],R=e[9],L=e[13],k=e[2],I=e[6],j=e[10],F=e[14],N=e[3],B=e[7],z=e[11],V=e[15];return n[0]=r*E+o*C+c*k+l*N,n[4]=r*A+o*D+c*I+l*B,n[8]=r*P+o*R+c*j+l*z,n[12]=r*O+o*L+c*F+l*V,n[1]=h*E+f*C+d*k+m*N,n[5]=h*A+f*D+d*I+m*B,n[9]=h*P+f*R+d*j+m*z,n[13]=h*O+f*L+d*F+m*V,n[2]=v*E+y*C+_*k+x*N,n[6]=v*A+y*D+_*I+x*B,n[10]=v*P+y*R+_*j+x*z,n[14]=v*O+y*L+_*F+x*V,n[3]=w*E+T*C+M*k+S*N,n[7]=w*A+T*D+M*I+S*B,n[11]=w*P+T*R+M*j+S*z,n[15]=w*O+T*L+M*F+S*V,this},multiplyScalar:function(s){var t=this.elements;return t[0]*=s,t[4]*=s,t[8]*=s,t[12]*=s,t[1]*=s,t[5]*=s,t[9]*=s,t[13]*=s,t[2]*=s,t[6]*=s,t[10]*=s,t[14]*=s,t[3]*=s,t[7]*=s,t[11]*=s,t[15]*=s,this},applyToBufferAttribute:function(t){for(var i=0,e=t.count;i1){for(var i=0;i1){for(var i=0;i0){object.children=[];for(i=0;i0&&(output.geometries=h),f.length>0&&(output.materials=f),d.length>0&&(output.textures=d),m.length>0&&(output.images=m),r.length>0&&(output.shapes=r)}return output.object=object,output;function v(t){var e=[];for(var n in t){var data=t[n];delete data.metadata,e.push(data)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(source,t){if(void 0===t&&(t=!0),this.name=source.name,this.up.copy(source.up),this.position.copy(source.position),this.quaternion.copy(source.quaternion),this.scale.copy(source.scale),this.matrix.copy(source.matrix),this.matrixWorld.copy(source.matrixWorld),this.matrixAutoUpdate=source.matrixAutoUpdate,this.matrixWorldNeedsUpdate=source.matrixWorldNeedsUpdate,this.layers.mask=source.layers.mask,this.visible=source.visible,this.castShadow=source.castShadow,this.receiveShadow=source.receiveShadow,this.frustumCulled=source.frustumCulled,this.renderOrder=source.renderOrder,this.userData=JSON.parse(JSON.stringify(source.userData)),!0===t)for(var i=0;il)return!1}return!0}Object.assign(Rr.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,n=1/0,r=1/0,o=-1/0,c=-1/0,l=-1/0,i=0,h=t.length;io&&(o=f),d>c&&(c=d),m>l&&(l=m)}return this.min.set(e,n,r),this.max.set(o,c,l),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,r=1/0,o=-1/0,c=-1/0,l=-1/0,i=0,h=t.count;io&&(o=f),d>c&&(c=d),m>l&&(l=m)}return this.min.set(e,n,r),this.max.set(o,c,l),this},setFromPoints:function(t){this.makeEmpty();for(var i=0,e=t.length;ithis.max.x||t.ythis.max.y||t.zthis.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new Ln),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)},intersectsSphere:function(t){return this.clampPoint(t.center,_r),_r.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){var e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant},intersectsTriangle:function(t){if(this.isEmpty())return!1;this.getCenter(Pr),Or.subVectors(this.max,Pr),wr.subVectors(t.a,Pr),Tr.subVectors(t.b,Pr),Mr.subVectors(t.c,Pr),Sr.subVectors(Tr,wr),Er.subVectors(Mr,Tr),Ar.subVectors(wr,Mr);var e=[0,-Sr.z,Sr.y,0,-Er.z,Er.y,0,-Ar.z,Ar.y,Sr.z,0,-Sr.x,Er.z,0,-Er.x,Ar.z,0,-Ar.x,-Sr.y,Sr.x,0,-Er.y,Er.x,0,-Ar.y,Ar.x,0];return!!Lr(e,wr,Tr,Mr,Or)&&(!!Lr(e=[1,0,0,0,1,0,0,0,1],wr,Tr,Mr,Or)&&(Cr.crossVectors(Sr,Er),Lr(e=[Cr.x,Cr.y,Cr.z],wr,Tr,Mr,Or)))},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new Ln),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return _r.copy(t).clamp(this.min,this.max).sub(t).length()},getBoundingSphere:function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(_r).length(),t},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(t){return this.isEmpty()||(yr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),yr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),yr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),yr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),yr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),yr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),yr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),yr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(yr)),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var kr=new Rr;function Ir(t,e){this.center=void 0!==t?t:new Ln,this.radius=void 0!==e?e:0}Object.assign(Ir.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(t,e){var n=this.center;void 0!==e?n.copy(e):kr.setFromPoints(t).getCenter(n);for(var r=0,i=0,o=t.length;ithis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new Rr),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}});var jr=new Ln,Fr=new Ln,Nr=new Ln,Br=new Ln,zr=new Ln,Vr=new Ln,Gr=new Ln;function Hr(t,e){this.origin=void 0!==t?t:new Ln,this.direction=void 0!==e?e:new Ln(0,0,-1)}Object.assign(Hr.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new Ln),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(t){return this.origin.copy(this.at(t,jr)),this},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new Ln),e.subVectors(t,this.origin);var n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(t){var e=jr.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(jr.copy(this.direction).multiplyScalar(e).add(this.origin),jr.distanceToSquared(t))},distanceSqToSegment:function(t,e,n,r){Fr.copy(t).add(e).multiplyScalar(.5),Nr.copy(e).sub(t).normalize(),Br.copy(this.origin).sub(Fr);var o,c,l,h,f=.5*t.distanceTo(e),d=-this.direction.dot(Nr),m=Br.dot(this.direction),v=-Br.dot(Nr),y=Br.lengthSq(),_=Math.abs(1-d*d);if(_>0)if(c=d*m-v,h=f*_,(o=d*v-m)>=0)if(c>=-h)if(c<=h){var x=1/_;l=(o*=x)*(o+d*(c*=x)+2*m)+c*(d*o+c+2*v)+y}else c=f,l=-(o=Math.max(0,-(d*c+m)))*o+c*(c+2*v)+y;else c=-f,l=-(o=Math.max(0,-(d*c+m)))*o+c*(c+2*v)+y;else c<=-h?l=-(o=Math.max(0,-(-d*f+m)))*o+(c=o>0?-f:Math.min(Math.max(-f,-v),f))*(c+2*v)+y:c<=h?(o=0,l=(c=Math.min(Math.max(-f,-v),f))*(c+2*v)+y):l=-(o=Math.max(0,-(d*f+m)))*o+(c=o>0?f:Math.min(Math.max(-f,-v),f))*(c+2*v)+y;else c=d>0?-f:f,l=-(o=Math.max(0,-(d*c+m)))*o+c*(c+2*v)+y;return n&&n.copy(this.direction).multiplyScalar(o).add(this.origin),r&&r.copy(Nr).multiplyScalar(c).add(Fr),l},intersectSphere:function(t,e){jr.subVectors(t.center,this.origin);var n=jr.dot(this.direction),r=jr.dot(jr)-n*n,o=t.radius*t.radius;if(r>o)return null;var c=Math.sqrt(o-r),l=n-c,h=n+c;return l<0&&h<0?null:l<0?this.at(h,e):this.at(l,e)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null},intersectPlane:function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var n,r,o,c,l,h,f=1/this.direction.x,d=1/this.direction.y,m=1/this.direction.z,v=this.origin;return f>=0?(n=(t.min.x-v.x)*f,r=(t.max.x-v.x)*f):(n=(t.max.x-v.x)*f,r=(t.min.x-v.x)*f),d>=0?(o=(t.min.y-v.y)*d,c=(t.max.y-v.y)*d):(o=(t.max.y-v.y)*d,c=(t.min.y-v.y)*d),n>c||o>r?null:((o>n||n!=n)&&(n=o),(c=0?(l=(t.min.z-v.z)*m,h=(t.max.z-v.z)*m):(l=(t.max.z-v.z)*m,h=(t.min.z-v.z)*m),n>h||l>r?null:((l>n||n!=n)&&(n=l),(h=0?n:r,e)))},intersectsBox:function(t){return null!==this.intersectBox(t,jr)},intersectTriangle:function(a,b,t,e,n){zr.subVectors(b,a),Vr.subVectors(t,a),Gr.crossVectors(zr,Vr);var r,o=this.direction.dot(Gr);if(o>0){if(e)return null;r=1}else{if(!(o<0))return null;r=-1,o=-o}Br.subVectors(this.origin,a);var c=r*this.direction.dot(Vr.crossVectors(Br,Vr));if(c<0)return null;var l=r*this.direction.dot(zr.cross(Br));if(l<0)return null;if(c+l>o)return null;var h=-r*Br.dot(Gr);return h<0?null:this.at(h/o,n)},applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}});var Ur=new Ln,Wr=new Ln,qr=new jn;function Yr(t,e){this.normal=void 0!==t?t:new Ln(1,0,0),this.constant=void 0!==e?e:0}Object.assign(Yr.prototype,{isPlane:!0,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,n,r){return this.normal.set(t,e,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(a,b,t){var e=Ur.subVectors(t,b).cross(Wr.subVectors(a,b)).normalize();return this.setFromNormalAndCoplanarPoint(e,a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new Ln),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(line,t){void 0===t&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new Ln);var e=line.delta(Ur),n=this.normal.dot(e);if(0===n)return 0===this.distanceToPoint(line.start)?t.copy(line.start):void 0;var r=-(line.start.dot(this.normal)+this.constant)/n;return r<0||r>1?void 0:t.copy(e).multiplyScalar(r).add(line.start)},intersectsLine:function(line){var t=this.distanceToPoint(line.start),e=this.distanceToPoint(line.end);return t<0&&e>0||e<0&&t>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new Ln),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,e){var n=e||qr.getNormalMatrix(t),r=this.coplanarPoint(Ur).applyMatrix4(t),o=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(o),this},translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}});var Xr=new Ln,Zr=new Ln,Jr=new Ln,$r=new Ln,Kr=new Ln,Qr=new Ln,ti=new Ln,ei=new Ln,ni=new Ln,ri=new Ln;function ii(a,b,t){this.a=void 0!==a?a:new Ln,this.b=void 0!==b?b:new Ln,this.c=void 0!==t?t:new Ln}Object.assign(ii,{getNormal:function(a,b,t,e){void 0===e&&(console.warn("THREE.Triangle: .getNormal() target is now required"),e=new Ln),e.subVectors(t,b),Xr.subVectors(a,b),e.cross(Xr);var n=e.lengthSq();return n>0?e.multiplyScalar(1/Math.sqrt(n)):e.set(0,0,0)},getBarycoord:function(t,a,b,e,n){Xr.subVectors(e,a),Zr.subVectors(b,a),Jr.subVectors(t,a);var r=Xr.dot(Xr),o=Xr.dot(Zr),c=Xr.dot(Jr),l=Zr.dot(Zr),h=Zr.dot(Jr),f=r*l-o*o;if(void 0===n&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),n=new Ln),0===f)return n.set(-2,-1,-1);var d=1/f,u=(l*c-o*h)*d,m=(r*h-o*c)*d;return n.set(1-u-m,m,u)},containsPoint:function(t,a,b,e){return ii.getBarycoord(t,a,b,e,$r),$r.x>=0&&$r.y>=0&&$r.x+$r.y<=1},getUV:function(t,e,n,r,o,c,l,h){return this.getBarycoord(t,e,n,r,$r),h.set(0,0),h.addScaledVector(o,$r.x),h.addScaledVector(c,$r.y),h.addScaledVector(l,$r.z),h},isFrontFacing:function(a,b,t,e){return Xr.subVectors(t,b),Zr.subVectors(a,b),Xr.cross(Zr).dot(e)<0}}),Object.assign(ii.prototype,{set:function(a,b,t){return this.a.copy(a),this.b.copy(b),this.c.copy(t),this},setFromPointsAndIndices:function(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){return Xr.subVectors(this.c,this.b),Zr.subVectors(this.a,this.b),.5*Xr.cross(Zr).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new Ln),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return ii.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new Yr),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return ii.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,n,r,o){return ii.getUV(t,this.a,this.b,this.c,e,n,r,o)},containsPoint:function(t){return ii.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return ii.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(p,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new Ln);var e,n,a=this.a,b=this.b,r=this.c;Kr.subVectors(b,a),Qr.subVectors(r,a),ei.subVectors(p,a);var o=Kr.dot(ei),c=Qr.dot(ei);if(o<=0&&c<=0)return t.copy(a);ni.subVectors(p,b);var l=Kr.dot(ni),h=Qr.dot(ni);if(l>=0&&h<=l)return t.copy(b);var f=o*h-l*c;if(f<=0&&o>=0&&l<=0)return e=o/(o-l),t.copy(a).addScaledVector(Kr,e);ri.subVectors(p,r);var d=Kr.dot(ri),m=Qr.dot(ri);if(m>=0&&d<=m)return t.copy(r);var v=d*c-o*m;if(v<=0&&c>=0&&m<=0)return n=c/(c-m),t.copy(a).addScaledVector(Qr,n);var y=l*m-d*h;if(y<=0&&h-l>=0&&d-m>=0)return ti.subVectors(r,b),n=(h-l)/(h-l+(d-m)),t.copy(b).addScaledVector(ti,n);var _=1/(y+v+f);return e=v*_,n=f*_,t.copy(a).addScaledVector(Kr,e).addScaledVector(Qr,n)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}});var ai={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},oi={h:0,s:0,l:0},si={h:0,s:0,l:0};function ci(t,g,b){return void 0===g&&void 0===b?this.set(t):this.setRGB(t,g,b)}function ui(p,q,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?p+6*(q-p)*t:t<.5?q:t<2/3?p+6*(q-p)*(2/3-t):p}function hi(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function fi(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function di(a,b,t,e,n,r){this.a=a,this.b=b,this.c=t,this.normal=e&&e.isVector3?e:new Ln,this.vertexNormals=Array.isArray(e)?e:[],this.color=n&&n.isColor?n:new ci,this.vertexColors=Array.isArray(n)?n:[],this.materialIndex=void 0!==r?r:0}Object.assign(ci.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,g,b){return this.r=t,this.g=g,this.b=b,this},setHSL:function(t,s,e){if(t=Pn.euclideanModulo(t,1),s=Pn.clamp(s,0,1),e=Pn.clamp(e,0,1),0===s)this.r=this.g=this.b=e;else{var p=e<=.5?e*(1+s):e+s-e*s,q=2*e-p;this.r=ui(q,p,t+1/3),this.g=ui(q,p,t),this.b=ui(q,p,t-1/3)}return this},setStyle:function(style){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+style+" will be ignored.")}var e;if(e=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(style)){var n,r=e[1],o=e[2];switch(r){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,t(n[5]),this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,t(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var c=parseFloat(n[1])/360,s=parseInt(n[2],10)/100,l=parseInt(n[3],10)/100;return t(n[5]),this.setHSL(c,s,l)}}}else if(e=/^\#([A-Fa-f0-9]+)$/.exec(style)){var h=e[1],f=h.length;if(3===f)return this.r=parseInt(h.charAt(0)+h.charAt(0),16)/255,this.g=parseInt(h.charAt(1)+h.charAt(1),16)/255,this.b=parseInt(h.charAt(2)+h.charAt(2),16)/255,this;if(6===f)return this.r=parseInt(h.charAt(0)+h.charAt(1),16)/255,this.g=parseInt(h.charAt(2)+h.charAt(3),16)/255,this.b=parseInt(h.charAt(4)+h.charAt(5),16)/255,this}return style&&style.length>0?this.setColorName(style):this},setColorName:function(style){var t=ai[style];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+style),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=hi(t.r),this.g=hi(t.g),this.b=hi(t.b),this},copyLinearToSRGB:function(t){return this.r=fi(t.r),this.g=fi(t.g),this.b=fi(t.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,n,r=this.r,g=this.g,b=this.b,o=Math.max(r,g,b),c=Math.min(r,g,b),l=(c+o)/2;if(c===o)e=0,n=0;else{var h=o-c;switch(n=l<=.5?h/(o+c):h/(2-o-c),o){case r:e=(g-b)/h+(ge&&(e=t[i]);return e}mi.prototype=Object.assign(Object.create(En.prototype),{constructor:mi,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var n=t[e];if(void 0!==n)if("shading"!==e){var r=this[e];void 0!==r?r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=n===E;else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(meta){var t=void 0===meta||"string"==typeof meta;t&&(meta={textures:{},images:{}});var data={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function e(t){var e=[];for(var n in t){var data=t[n];delete data.metadata,e.push(data)}return e}if(data.uuid=this.uuid,data.type=this.type,""!==this.name&&(data.name=this.name),this.color&&this.color.isColor&&(data.color=this.color.getHex()),void 0!==this.roughness&&(data.roughness=this.roughness),void 0!==this.metalness&&(data.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(data.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(data.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(data.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(data.specular=this.specular.getHex()),void 0!==this.shininess&&(data.shininess=this.shininess),void 0!==this.clearcoat&&(data.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(data.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(data.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(meta).uuid,data.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(data.map=this.map.toJSON(meta).uuid),this.matcap&&this.matcap.isTexture&&(data.matcap=this.matcap.toJSON(meta).uuid),this.alphaMap&&this.alphaMap.isTexture&&(data.alphaMap=this.alphaMap.toJSON(meta).uuid),this.lightMap&&this.lightMap.isTexture&&(data.lightMap=this.lightMap.toJSON(meta).uuid),this.aoMap&&this.aoMap.isTexture&&(data.aoMap=this.aoMap.toJSON(meta).uuid,data.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(data.bumpMap=this.bumpMap.toJSON(meta).uuid,data.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(data.normalMap=this.normalMap.toJSON(meta).uuid,data.normalMapType=this.normalMapType,data.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(data.displacementMap=this.displacementMap.toJSON(meta).uuid,data.displacementScale=this.displacementScale,data.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(data.roughnessMap=this.roughnessMap.toJSON(meta).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(data.metalnessMap=this.metalnessMap.toJSON(meta).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(data.emissiveMap=this.emissiveMap.toJSON(meta).uuid),this.specularMap&&this.specularMap.isTexture&&(data.specularMap=this.specularMap.toJSON(meta).uuid),this.envMap&&this.envMap.isTexture&&(data.envMap=this.envMap.toJSON(meta).uuid,data.reflectivity=this.reflectivity,data.refractionRatio=this.refractionRatio,void 0!==this.combine&&(data.combine=this.combine),void 0!==this.envMapIntensity&&(data.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(data.gradientMap=this.gradientMap.toJSON(meta).uuid),void 0!==this.size&&(data.size=this.size),void 0!==this.sizeAttenuation&&(data.sizeAttenuation=this.sizeAttenuation),this.blending!==R&&(data.blending=this.blending),!0===this.flatShading&&(data.flatShading=this.flatShading),this.side!==T&&(data.side=this.side),this.vertexColors!==P&&(data.vertexColors=this.vertexColors),this.opacity<1&&(data.opacity=this.opacity),!0===this.transparent&&(data.transparent=this.transparent),data.depthFunc=this.depthFunc,data.depthTest=this.depthTest,data.depthWrite=this.depthWrite,data.stencilWrite=this.stencilWrite,data.stencilWriteMask=this.stencilWriteMask,data.stencilFunc=this.stencilFunc,data.stencilRef=this.stencilRef,data.stencilFuncMask=this.stencilFuncMask,data.stencilFail=this.stencilFail,data.stencilZFail=this.stencilZFail,data.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(data.rotation=this.rotation),!0===this.polygonOffset&&(data.polygonOffset=!0),0!==this.polygonOffsetFactor&&(data.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(data.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(data.linewidth=this.linewidth),void 0!==this.dashSize&&(data.dashSize=this.dashSize),void 0!==this.gapSize&&(data.gapSize=this.gapSize),void 0!==this.scale&&(data.scale=this.scale),!0===this.dithering&&(data.dithering=!0),this.alphaTest>0&&(data.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(data.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(data.wireframe=this.wireframe),this.wireframeLinewidth>1&&(data.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(data.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(data.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(data.morphTargets=!0),!0===this.morphNormals&&(data.morphNormals=!0),!0===this.skinning&&(data.skinning=!0),!1===this.visible&&(data.visible=!1),!1===this.toneMapped&&(data.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(data.userData=this.userData),t){var n=e(meta.textures),r=e(meta.images);n.length>0&&(data.textures=n),r.length>0&&(data.images=r)}return data},clone:function(){return(new this.constructor).copy(this)},copy:function(source){this.name=source.name,this.fog=source.fog,this.blending=source.blending,this.side=source.side,this.flatShading=source.flatShading,this.vertexTangents=source.vertexTangents,this.vertexColors=source.vertexColors,this.opacity=source.opacity,this.transparent=source.transparent,this.blendSrc=source.blendSrc,this.blendDst=source.blendDst,this.blendEquation=source.blendEquation,this.blendSrcAlpha=source.blendSrcAlpha,this.blendDstAlpha=source.blendDstAlpha,this.blendEquationAlpha=source.blendEquationAlpha,this.depthFunc=source.depthFunc,this.depthTest=source.depthTest,this.depthWrite=source.depthWrite,this.stencilWriteMask=source.stencilWriteMask,this.stencilFunc=source.stencilFunc,this.stencilRef=source.stencilRef,this.stencilFuncMask=source.stencilFuncMask,this.stencilFail=source.stencilFail,this.stencilZFail=source.stencilZFail,this.stencilZPass=source.stencilZPass,this.stencilWrite=source.stencilWrite;var t=source.clippingPlanes,e=null;if(null!==t){var n=t.length;e=new Array(n);for(var i=0;i!==n;++i)e[i]=t[i].clone()}return this.clippingPlanes=e,this.clipIntersection=source.clipIntersection,this.clipShadows=source.clipShadows,this.shadowSide=source.shadowSide,this.colorWrite=source.colorWrite,this.precision=source.precision,this.polygonOffset=source.polygonOffset,this.polygonOffsetFactor=source.polygonOffsetFactor,this.polygonOffsetUnits=source.polygonOffsetUnits,this.dithering=source.dithering,this.alphaTest=source.alphaTest,this.premultipliedAlpha=source.premultipliedAlpha,this.visible=source.visible,this.toneMapped=source.toneMapped,this.userData=JSON.parse(JSON.stringify(source.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(mi.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),vi.prototype=Object.create(mi.prototype),vi.prototype.constructor=vi,vi.prototype.isMeshBasicMaterial=!0,vi.prototype.copy=function(source){return mi.prototype.copy.call(this,source),this.color.copy(source.color),this.map=source.map,this.lightMap=source.lightMap,this.lightMapIntensity=source.lightMapIntensity,this.aoMap=source.aoMap,this.aoMapIntensity=source.aoMapIntensity,this.specularMap=source.specularMap,this.alphaMap=source.alphaMap,this.envMap=source.envMap,this.combine=source.combine,this.reflectivity=source.reflectivity,this.refractionRatio=source.refractionRatio,this.wireframe=source.wireframe,this.wireframeLinewidth=source.wireframeLinewidth,this.wireframeLinecap=source.wireframeLinecap,this.wireframeLinejoin=source.wireframeLinejoin,this.skinning=source.skinning,this.morphTargets=source.morphTargets,this},Object.defineProperty(gi.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(gi.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(source){return this.name=source.name,this.array=new source.array.constructor(source.array),this.itemSize=source.itemSize,this.count=source.count,this.normalized=source.normalized,this.usage=source.usage,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(var i=0,r=this.itemSize;i0,l=o[1]&&o[1].length>0,h=t.morphTargets,f=h.length;if(f>0){e=[];for(var i=0;i0){d=[];for(i=0;i0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(i=0;i65535?Mi:wi)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToBufferAttribute(e),e.needsUpdate=!0);var n=this.attributes.normal;void 0!==n&&((new jn).getNormalMatrix(t).applyToBufferAttribute(n),n.needsUpdate=!0);var r=this.attributes.tangent;void 0!==r&&((new jn).getNormalMatrix(t).applyToBufferAttribute(r),r.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return Ci.makeRotationX(t),this.applyMatrix(Ci),this},rotateY:function(t){return Ci.makeRotationY(t),this.applyMatrix(Ci),this},rotateZ:function(t){return Ci.makeRotationZ(t),this.applyMatrix(Ci),this},translate:function(t,e,n){return Ci.makeTranslation(t,e,n),this.applyMatrix(Ci),this},scale:function(t,e,n){return Ci.makeScale(t,e,n),this.applyMatrix(Ci),this},lookAt:function(t){return Di.lookAt(t),Di.updateMatrix(),this.applyMatrix(Di.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ri).negate(),this.translate(Ri.x,Ri.y,Ri.z),this},setFromObject:function(object){var t=object.geometry;if(object.isPoints||object.isLine){var e=new Si(3*t.vertices.length,3),n=new Si(3*t.colors.length,3);if(this.setAttribute("position",e.copyVector3sArray(t.vertices)),this.setAttribute("color",n.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var r=new Si(t.lineDistances.length,1);this.setAttribute("lineDistance",r.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else object.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(t){for(var e=[],i=0,n=t.length;i0){var n=new Float32Array(3*t.normals.length);this.setAttribute("normal",new gi(n,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var r=new Float32Array(3*t.colors.length);this.setAttribute("color",new gi(r,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var o=new Float32Array(2*t.uvs.length);this.setAttribute("uv",new gi(o,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var c=new Float32Array(2*t.uvs2.length);this.setAttribute("uv2",new gi(c,2).copyVector2sArray(t.uvs2))}for(var l in this.groups=t.groups,t.morphTargets){for(var h=[],f=t.morphTargets[l],i=0,d=f.length;i0){var y=new Si(4*t.skinIndices.length,4);this.setAttribute("skinIndex",y.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var _=new Si(4*t.skinWeights.length,4);this.setAttribute("skinWeight",_.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Rr);var t=this.attributes.position,e=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(var i=0,n=e.length;i0&&(data.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var e in t)void 0!==t[e]&&(data[e]=t[e]);return data}data.data={attributes:{}};var n=this.index;null!==n&&(data.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});var r=this.attributes;for(var e in r){var o=(m=r[e]).toJSON();""!==m.name&&(o.name=m.name),data.data.attributes[e]=o}var c={},l=!1;for(var e in this.morphAttributes){for(var h=this.morphAttributes[e],f=[],i=0,d=h.length;i0&&(c[e]=f,l=!0)}l&&(data.data.morphAttributes=c,data.data.morphTargetsRelative=this.morphTargetsRelative);var v=this.groups;v.length>0&&(data.data.groups=JSON.parse(JSON.stringify(v)));var y=this.boundingSphere;return null!==y&&(data.data.boundingSphere={center:y.center.toArray(),radius:y.radius}),data},clone:function(){return(new ji).copy(this)},copy:function(source){var t,i,e;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=source.name;var n=source.index;null!==n&&this.setIndex(n.clone());var r=source.attributes;for(t in r){var o=r[t];this.setAttribute(t,o.clone())}var c=source.morphAttributes;for(t in c){var l=[],h=c[t];for(i=0,e=h.length;ie.far?null:{distance:h,point:Qi.clone(),object:object}}function na(object,t,e,n,r,o,c,l,h,a,b,f){zi.fromBufferAttribute(r,a),Vi.fromBufferAttribute(r,b),Gi.fromBufferAttribute(r,f);var d=object.morphTargetInfluences;if(t.morphTargets&&o&&d){qi.set(0,0,0),Yi.set(0,0,0),Xi.set(0,0,0);for(var i=0,m=o.length;i0){var l=o[c[0]];if(void 0!==l)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=l.length;t0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){var n,r=this.geometry,o=this.material,c=this.matrixWorld;if(void 0!==o&&(null===r.boundingSphere&&r.computeBoundingSphere(),Bi.copy(r.boundingSphere),Bi.applyMatrix4(c),!1!==t.ray.intersectsSphere(Bi)&&(Fi.getInverse(c),Ni.copy(t.ray).applyMatrix4(Fi),null===r.boundingBox||!1!==Ni.intersectsBox(r.boundingBox))))if(this.drawMode===Be){if(r.isBufferGeometry){var a,b,l,i,h,f,d,m,v,y=r.index,_=r.attributes.position,x=r.morphAttributes.position,w=r.morphTargetsRelative,T=r.attributes.uv,M=r.attributes.uv2,S=r.groups,E=r.drawRange;if(null!==y)if(Array.isArray(o))for(i=0,f=S.length;i0&&(C=k);for(var I=0,j=L.length;I0)for(i=0;i0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,n;for(this.computeFaceNormals(),t=0,e=this.faces.length;t0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var i,t,e,n,r;for(e=0,n=this.faces.length;e=0;i--){var _=v[i];for(this.faces.splice(_,1),c=0,l=this.faceVertexUvs.length;c0,x=v.vertexNormals.length>0,w=1!==v.color.r||1!==v.color.g||1!==v.color.b,T=v.vertexColors.length>0,M=0;if(M=P(M,0,0),M=P(M,1,!0),M=P(M,2,!1),M=P(M,3,y),M=P(M,4,_),M=P(M,5,x),M=P(M,6,w),M=P(M,7,T),o.push(M),o.push(v.a,v.b,v.c),o.push(v.materialIndex),y){var S=this.faceVertexUvs[0][i];o.push(D(S[0]),D(S[1]),D(S[2]))}if(_&&o.push(O(v.normal)),x){var E=v.vertexNormals;o.push(O(E[0]),O(E[1]),O(E[2]))}if(w&&o.push(C(v.color)),T){var A=v.vertexColors;o.push(C(A[0]),C(A[1]),C(A[2]))}}function P(t,e,n){return n?t|1<0&&(data.data.colors=h),d.length>0&&(data.data.uvs=[d]),data.data.faces=o,data},clone:function(){return(new sa).copy(this)},copy:function(source){var i,t,e,n,r,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=source.name;var c=source.vertices;for(i=0,t=c.length;i0?1:-1,d.push(I.x,I.y,I.z),m.push(M/x),m.push(1-S/w),L+=1}}for(S=0;S0&&(data.defines=this.defines),data.vertexShader=this.vertexShader,data.fragmentShader=this.fragmentShader;var n={};for(var r in this.extensions)!0===this.extensions[r]&&(n[r]=!0);return Object.keys(n).length>0&&(data.extensions=n),data},pa.prototype=Object.assign(Object.create(vr.prototype),{constructor:pa,isCamera:!0,copy:function(source,t){return vr.prototype.copy.call(this,source,t),this.matrixWorldInverse.copy(source.matrixWorldInverse),this.projectionMatrix.copy(source.projectionMatrix),this.projectionMatrixInverse.copy(source.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new Ln),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){vr.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),ma.prototype=Object.assign(Object.create(pa.prototype),{constructor:ma,isPerspectiveCamera:!0,copy:function(source,t){return pa.prototype.copy.call(this,source,t),this.fov=source.fov,this.zoom=source.zoom,this.near=source.near,this.far=source.far,this.focus=source.focus,this.aspect=source.aspect,this.view=null===source.view?null:Object.assign({},source.view),this.filmGauge=source.filmGauge,this.filmOffset=source.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*Pn.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*Pn.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Pn.RAD2DEG*Math.atan(Math.tan(.5*Pn.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,r,o,c){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=o,this.view.height=c,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*Pn.DEG2RAD*this.fov)/this.zoom,n=2*e,r=this.aspect*n,o=-.5*r,view=this.view;if(null!==this.view&&this.view.enabled){var c=view.fullWidth,l=view.fullHeight;o+=view.offsetX*r/c,e-=view.offsetY*n/l,r*=view.width/c,n*=view.height/l}var h=this.filmOffset;0!==h&&(o+=t*h/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+r,e,e-n,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(meta){var data=vr.prototype.toJSON.call(this,meta);return data.object.fov=this.fov,data.object.zoom=this.zoom,data.object.near=this.near,data.object.far=this.far,data.object.focus=this.focus,data.object.aspect=this.aspect,null!==this.view&&(data.object.view=Object.assign({},this.view)),data.object.filmGauge=this.filmGauge,data.object.filmOffset=this.filmOffset,data}});function va(t,e,n,r){vr.call(this),this.type="CubeCamera";var o=new ma(90,1,t,e);o.up.set(0,-1,0),o.lookAt(new Ln(1,0,0)),this.add(o);var c=new ma(90,1,t,e);c.up.set(0,-1,0),c.lookAt(new Ln(-1,0,0)),this.add(c);var l=new ma(90,1,t,e);l.up.set(0,0,1),l.lookAt(new Ln(0,1,0)),this.add(l);var h=new ma(90,1,t,e);h.up.set(0,0,-1),h.lookAt(new Ln(0,-1,0)),this.add(h);var f=new ma(90,1,t,e);f.up.set(0,-1,0),f.lookAt(new Ln(0,0,1)),this.add(f);var d=new ma(90,1,t,e);d.up.set(0,-1,0),d.lookAt(new Ln(0,0,-1)),this.add(d),r=r||{format:Qt,magFilter:It,minFilter:It},this.renderTarget=new ga(n,n,r),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var n=t.getRenderTarget(),r=this.renderTarget,m=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,t.setRenderTarget(r,0),t.render(e,o),t.setRenderTarget(r,1),t.render(e,c),t.setRenderTarget(r,2),t.render(e,l),t.setRenderTarget(r,3),t.render(e,h),t.setRenderTarget(r,4),t.render(e,f),r.texture.generateMipmaps=m,t.setRenderTarget(r,5),t.render(e,d),t.setRenderTarget(n)},this.clear=function(t,e,n,r){for(var o=t.getRenderTarget(),c=this.renderTarget,i=0;i<6;i++)t.setRenderTarget(c,i),t.clear(e,n,r);t.setRenderTarget(o)}}function ga(t,e,n){Vn.call(this,t,e,n)}function ya(data,t,e,n,r,o,c,l,h,f,d,m){Bn.call(this,null,o,c,l,h,f,n,r,d,m),this.image={data:data||null,width:t||1,height:e||1},this.magFilter=void 0!==h?h:Ct,this.minFilter=void 0!==f?f:Ct,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}va.prototype=Object.create(vr.prototype),va.prototype.constructor=va,ga.prototype=Object.create(Vn.prototype),ga.prototype.constructor=ga,ga.prototype.isWebGLRenderTargetCube=!0,ga.prototype.fromEquirectangularTexture=function(t,e){this.texture.type=e.type,this.texture.format=e.format,this.texture.encoding=e.encoding;var n=new gr,r={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include ","\t#include ","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#define RECIPROCAL_PI 0.31830988618","#define RECIPROCAL_PI2 0.15915494","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV;","\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;","\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},o=new da({type:"CubemapFromEquirect",uniforms:la(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:M,blending:D});o.uniforms.tEquirect.value=e;var c=new ta(new ua(5,5,5),o);n.add(c);var l=new va(1,10,1);return l.renderTarget=this,l.renderTarget.texture.name="CubeCameraTexture",l.update(t,n),c.geometry.dispose(),c.material.dispose(),this},ya.prototype=Object.create(Bn.prototype),ya.prototype.constructor=ya,ya.prototype.isDataTexture=!0;var ba=new Ir,_a=new Ln;function xa(t,e,n,r,o,c){this.planes=[void 0!==t?t:new Yr,void 0!==e?e:new Yr,void 0!==n?n:new Yr,void 0!==r?r:new Yr,void 0!==o?o:new Yr,void 0!==c?c:new Yr]}Object.assign(xa.prototype,{set:function(t,e,n,r,o,c){var l=this.planes;return l[0].copy(t),l[1].copy(e),l[2].copy(n),l[3].copy(r),l[4].copy(o),l[5].copy(c),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,i=0;i<6;i++)e[i].copy(t.planes[i]);return this},setFromMatrix:function(t){var e=this.planes,n=t.elements,r=n[0],o=n[1],c=n[2],l=n[3],h=n[4],f=n[5],d=n[6],m=n[7],v=n[8],y=n[9],_=n[10],x=n[11],w=n[12],T=n[13],M=n[14],S=n[15];return e[0].setComponents(l-r,m-h,x-v,S-w).normalize(),e[1].setComponents(l+r,m+h,x+v,S+w).normalize(),e[2].setComponents(l+o,m+f,x+y,S+T).normalize(),e[3].setComponents(l-o,m-f,x-y,S-T).normalize(),e[4].setComponents(l-c,m-d,x-_,S-M).normalize(),e[5].setComponents(l+c,m+d,x+_,S+M).normalize(),this},intersectsObject:function(object){var t=object.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),ba.copy(t.boundingSphere).applyMatrix4(object.matrixWorld),this.intersectsSphere(ba)},intersectsSprite:function(t){return ba.center.set(0,0,0),ba.radius=.7071067811865476,ba.applyMatrix4(t.matrixWorld),this.intersectsSphere(ba)},intersectsSphere:function(t){for(var e=this.planes,n=t.center,r=-t.radius,i=0;i<6;i++){if(e[i].distanceToPoint(n)0?t.max.x:t.min.x,_a.y=n.normal.y>0?t.max.y:t.min.y,_a.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(_a)<0)return!1}return!0},containsPoint:function(t){for(var e=this.planes,i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}});var wa={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\ttransformedNormal = mat3( instanceMatrix ) * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = normalMatrix * objectTangent;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryReflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) { \n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = saturate( clearcoat );\tmaterial.clearcoatRoughness = clamp( clearcoatRoughness, 0.04, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( pointLight.shadow, directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( spotLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( directionalLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_normalmap_pars_fragment:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpack2HalfToRGBA( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpack2HalfToRGBA( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = ( floor( uv * size - 0.5 ) + 0.5 ) * texelSize;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= all( bvec2( directionalLight.shadow, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= all( bvec2( spotLight.shadow, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= all( bvec2( pointLight.shadow, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n}",shadow_vert:"#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},Ta={common:{diffuse:{value:new ci(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new jn},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new On(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ci(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new ci(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new jn}},sprite:{diffuse:{value:new ci(15658734)},opacity:{value:1},center:{value:new On(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new jn}}},Ma={basic:{uniforms:ha([Ta.common,Ta.specularmap,Ta.envmap,Ta.aomap,Ta.lightmap,Ta.fog]),vertexShader:wa.meshbasic_vert,fragmentShader:wa.meshbasic_frag},lambert:{uniforms:ha([Ta.common,Ta.specularmap,Ta.envmap,Ta.aomap,Ta.lightmap,Ta.emissivemap,Ta.fog,Ta.lights,{emissive:{value:new ci(0)}}]),vertexShader:wa.meshlambert_vert,fragmentShader:wa.meshlambert_frag},phong:{uniforms:ha([Ta.common,Ta.specularmap,Ta.envmap,Ta.aomap,Ta.lightmap,Ta.emissivemap,Ta.bumpmap,Ta.normalmap,Ta.displacementmap,Ta.gradientmap,Ta.fog,Ta.lights,{emissive:{value:new ci(0)},specular:{value:new ci(1118481)},shininess:{value:30}}]),vertexShader:wa.meshphong_vert,fragmentShader:wa.meshphong_frag},standard:{uniforms:ha([Ta.common,Ta.envmap,Ta.aomap,Ta.lightmap,Ta.emissivemap,Ta.bumpmap,Ta.normalmap,Ta.displacementmap,Ta.roughnessmap,Ta.metalnessmap,Ta.fog,Ta.lights,{emissive:{value:new ci(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:wa.meshphysical_vert,fragmentShader:wa.meshphysical_frag},matcap:{uniforms:ha([Ta.common,Ta.bumpmap,Ta.normalmap,Ta.displacementmap,Ta.fog,{matcap:{value:null}}]),vertexShader:wa.meshmatcap_vert,fragmentShader:wa.meshmatcap_frag},points:{uniforms:ha([Ta.points,Ta.fog]),vertexShader:wa.points_vert,fragmentShader:wa.points_frag},dashed:{uniforms:ha([Ta.common,Ta.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:wa.linedashed_vert,fragmentShader:wa.linedashed_frag},depth:{uniforms:ha([Ta.common,Ta.displacementmap]),vertexShader:wa.depth_vert,fragmentShader:wa.depth_frag},normal:{uniforms:ha([Ta.common,Ta.bumpmap,Ta.normalmap,Ta.displacementmap,{opacity:{value:1}}]),vertexShader:wa.normal_vert,fragmentShader:wa.normal_frag},sprite:{uniforms:ha([Ta.sprite,Ta.fog]),vertexShader:wa.sprite_vert,fragmentShader:wa.sprite_frag},background:{uniforms:{uvTransform:{value:new jn},t2D:{value:null}},vertexShader:wa.background_vert,fragmentShader:wa.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:wa.cube_vert,fragmentShader:wa.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:wa.equirect_vert,fragmentShader:wa.equirect_frag},distanceRGBA:{uniforms:ha([Ta.common,Ta.displacementmap,{referencePosition:{value:new Ln},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:wa.distanceRGBA_vert,fragmentShader:wa.distanceRGBA_frag},shadow:{uniforms:ha([Ta.lights,Ta.fog,{color:{value:new ci(0)},opacity:{value:1}}]),vertexShader:wa.shadow_vert,fragmentShader:wa.shadow_frag}};function Sa(){var t=null,e=!1,n=null;function r(time,o){!1!==e&&(n(time,o),t.requestAnimationFrame(r))}return{start:function(){!0!==e&&null!==n&&(t.requestAnimationFrame(r),e=!0)},stop:function(){e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function Ea(t){var e=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),e.get(t)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);var data=e.get(n);data&&(t.deleteBuffer(data.buffer),e.delete(n))},update:function(n,r){n.isInterleavedBufferAttribute&&(n=n.data);var data=e.get(n);void 0===data?e.set(n,function(e,n){var r=e.array,o=e.usage,c=t.createBuffer();t.bindBuffer(n,c),t.bufferData(n,r,o),e.onUploadCallback();var l=5126;return r instanceof Float32Array?l=5126:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?l=5123:r instanceof Int16Array?l=5122:r instanceof Uint32Array?l=5125:r instanceof Int32Array?l=5124:r instanceof Int8Array?l=5120:r instanceof Uint8Array&&(l=5121),{buffer:c,type:l,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version}}(n,r)):data.version0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var c="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext,l=void 0!==n.precision?n.precision:"highp",h=o(l);h!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",h,"instead."),l=h);var f=!0===n.logarithmicDepthBuffer,d=t.getParameter(34930),m=t.getParameter(35660),v=t.getParameter(3379),y=t.getParameter(34076),_=t.getParameter(34921),x=t.getParameter(36347),w=t.getParameter(36348),T=t.getParameter(36349),M=m>0,S=c||!!e.get("OES_texture_float");return{isWebGL2:c,getMaxAnisotropy:function(){if(void 0!==r)return r;var n=e.get("EXT_texture_filter_anisotropic");return r=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:o,precision:l,logarithmicDepthBuffer:f,maxTextures:d,maxVertexTextures:m,maxTextureSize:v,maxCubemapSize:y,maxAttributes:_,maxVertexUniforms:x,maxVaryings:w,maxFragmentUniforms:T,vertexTextures:M,floatFragmentTextures:S,floatVertexTextures:M&&S,maxSamples:c?t.getParameter(36183):0}}function Ra(){var t=this,e=null,n=0,r=!1,o=!1,c=new Yr,l=new jn,h={value:null,needsUpdate:!1};function f(){h.value!==e&&(h.value=e,h.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function d(e,n,r,o){var f=null!==e?e.length:0,d=null;if(0!==f){if(d=h.value,!0!==o||null===d){var m=r+4*f,v=n.matrixWorldInverse;l.getNormalMatrix(v),(null===d||d.length65535?Mi:wi)(n,1);m.version=l,e.update(m,34963);var v=o.get(t);v&&e.remove(v),o.set(t,m)}return{get:function(object,t){var e=r.get(t);return e||(t.addEventListener("dispose",c),t.isBufferGeometry?e=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new ji).setFromObject(object)),e=t._bufferGeometry),r.set(t,e),n.memory.geometries++,e)},update:function(t){var n=t.index,r=t.attributes;for(var o in null!==n&&e.update(n,34963),r)e.update(r[o],34962);var c=t.morphAttributes;for(var o in c)for(var l=c[o],i=0,h=l.length;i0)return t;var o=e*n,c=Ya[o];if(void 0===c&&(c=new Float32Array(o),Ya[o]=c),0!==e){r.toArray(c,0);for(var i=1,l=0;i!==e;++i)l+=n,t[i].toArray(c,l)}return c}function Qa(a,b){if(a.length!==b.length)return!1;for(var i=0,t=a.length;i/gm;function Xo(t){return t.replace(Yo,Zo)}function Zo(t,e){var n=wa[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Xo(n)}var Jo=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function $o(t){return t.replace(Jo,Ko)}function Ko(t,e,n,r){for(var o="",i=parseInt(e);i0?t.gammaFactor:1,C=c.isWebGL2?"":function(t,e,n){return[(t=t||{}).derivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Uo).join("\n")}(r.extensions,c,e),D=function(t){var e=[];for(var n in t){var r=t[n];!1!==r&&e.push("#define "+n+" "+r)}return e.join("\n")}(y),R=v.createProgram(),L=c.numMultiviewViews;if(r.isRawShaderMaterial?((l=[D].filter(Uo).join("\n")).length>0&&(l+="\n"),(h=[C,D].filter(Uo).join("\n")).length>0&&(h+="\n")):(l=[Qo(c),"#define SHADER_NAME "+o.name,D,c.instancing?"#define USE_INSTANCING":"",c.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+O,"#define MAX_BONES "+c.maxBones,c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fogExp2?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.envMap?"#define "+A:"",c.lightMap?"#define USE_LIGHTMAP":"",c.aoMap?"#define USE_AOMAP":"",c.emissiveMap?"#define USE_EMISSIVEMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.normalMap&&c.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",c.normalMap&&c.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",c.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",c.displacementMap&&c.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.roughnessMap?"#define USE_ROUGHNESSMAP":"",c.metalnessMap?"#define USE_METALNESSMAP":"",c.alphaMap?"#define USE_ALPHAMAP":"",c.vertexTangents?"#define USE_TANGENT":"",c.vertexColors?"#define USE_COLOR":"",c.vertexUvs?"#define USE_UV":"",c.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",c.flatShading?"#define FLAT_SHADED":"",c.skinning?"#define USE_SKINNING":"",c.useVertexTexture?"#define BONE_TEXTURE":"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.morphNormals&&!1===c.flatShading?"#define USE_MORPHNORMALS":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+S:"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":"",c.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",c.logarithmicDepthBuffer&&(c.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Uo).join("\n"),h=[C,Qo(c),"#define SHADER_NAME "+o.name,D,c.alphaTest?"#define ALPHATEST "+c.alphaTest+(c.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+O,c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fogExp2?"#define FOG_EXP2":"",c.map?"#define USE_MAP":"",c.matcap?"#define USE_MATCAP":"",c.envMap?"#define USE_ENVMAP":"",c.envMap?"#define "+E:"",c.envMap?"#define "+A:"",c.envMap?"#define "+P:"",c.lightMap?"#define USE_LIGHTMAP":"",c.aoMap?"#define USE_AOMAP":"",c.emissiveMap?"#define USE_EMISSIVEMAP":"",c.bumpMap?"#define USE_BUMPMAP":"",c.normalMap?"#define USE_NORMALMAP":"",c.normalMap&&c.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",c.normalMap&&c.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",c.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",c.specularMap?"#define USE_SPECULARMAP":"",c.roughnessMap?"#define USE_ROUGHNESSMAP":"",c.metalnessMap?"#define USE_METALNESSMAP":"",c.alphaMap?"#define USE_ALPHAMAP":"",c.sheen?"#define USE_SHEEN":"",c.vertexTangents?"#define USE_TANGENT":"",c.vertexColors?"#define USE_COLOR":"",c.vertexUvs?"#define USE_UV":"",c.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",c.gradientMap?"#define USE_GRADIENTMAP":"",c.flatShading?"#define FLAT_SHADED":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.flipSided?"#define FLIP_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapEnabled?"#define "+S:"",c.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",c.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",c.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",c.logarithmicDepthBuffer&&(c.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",(r.extensions&&r.extensions.shaderTextureLOD||c.envMap)&&(c.isWebGL2||e.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",c.toneMapping!==ft?"#define TONE_MAPPING":"",c.toneMapping!==ft?wa.tonemapping_pars_fragment:"",c.toneMapping!==ft?Ho("toneMapping",c.toneMapping):"",c.dithering?"#define DITHERING":"",c.outputEncoding||c.mapEncoding||c.matcapEncoding||c.envMapEncoding||c.emissiveMapEncoding?wa.encodings_pars_fragment:"",c.mapEncoding?Go("mapTexelToLinear",c.mapEncoding):"",c.matcapEncoding?Go("matcapTexelToLinear",c.matcapEncoding):"",c.envMapEncoding?Go("envMapTexelToLinear",c.envMapEncoding):"",c.emissiveMapEncoding?Go("emissiveMapTexelToLinear",c.emissiveMapEncoding):"",c.outputEncoding?(f="linearToOutputTexel",d=c.outputEncoding,m=zo(d),"vec4 "+f+"( vec4 value ) { return LinearTo"+m[0]+m[1]+"; }"):"",c.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(Uo).join("\n")),T=qo(T=Wo(T=Xo(T),c),c),M=qo(M=Wo(M=Xo(M),c),c),T=$o(T),M=$o(M),c.isWebGL2&&!r.isRawShaderMaterial){var k=!1,I=/^\s*#version\s+300\s+es\s*\n/;r.isShaderMaterial&&null!==T.match(I)&&null!==M.match(I)&&(k=!0,T=T.replace(I,""),M=M.replace(I,"")),l=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+l,h=["#version 300 es\n","#define varying in",k?"":"out highp vec4 pc_fragColor;",k?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+h,L>0&&(l=(l=l.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","layout(num_views = "+L+") in;","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace(["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;"].join("\n"),["uniform mat4 modelViewMatrices["+L+"];","uniform mat4 projectionMatrices["+L+"];","uniform mat4 viewMatrices["+L+"];","uniform mat3 normalMatrices["+L+"];","#define modelViewMatrix modelViewMatrices[VIEW_ID]","#define projectionMatrix projectionMatrices[VIEW_ID]","#define viewMatrix viewMatrices[VIEW_ID]","#define normalMatrix normalMatrices[VIEW_ID]"].join("\n")),h=(h=h.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace("uniform mat4 viewMatrix;",["uniform mat4 viewMatrices["+L+"];","#define viewMatrix viewMatrices[VIEW_ID]"].join("\n")))}var j,F,N=h+M,B=No(v,35633,l+T),z=No(v,35632,N);if(v.attachShader(R,B),v.attachShader(R,z),void 0!==r.index0AttributeName?v.bindAttribLocation(R,0,r.index0AttributeName):!0===c.morphTargets&&v.bindAttribLocation(R,0,"position"),v.linkProgram(R),t.debug.checkShaderErrors){var V=v.getProgramInfoLog(R).trim(),G=v.getShaderInfoLog(B).trim(),H=v.getShaderInfoLog(z).trim(),U=!0,W=!0;if(!1===v.getProgramParameter(R,35714)){U=!1;var Y=Vo(v,B,"vertex"),X=Vo(v,z,"fragment");console.error("THREE.WebGLProgram: shader error: ",v.getError(),"35715",v.getProgramParameter(R,35715),"gl.getProgramInfoLog",V,Y,X)}else""!==V?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",V):""!==G&&""!==H||(W=!1);W&&(this.diagnostics={runnable:U,material:r,programLog:V,vertexShader:{log:G,prefix:l},fragmentShader:{log:H,prefix:h}})}return v.deleteShader(B),v.deleteShader(z),this.getUniforms=function(){return void 0===j&&(j=new Fo(v,R)),j},this.getAttributes=function(){return void 0===F&&(F=function(t,e){for(var n={},r=t.getProgramParameter(e,35721),i=0;i0,maxBones:E,useVertexTexture:l,morphTargets:e.morphTargets,morphNormals:e.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:r.directional.length,numPointLights:r.point.length,numSpotLights:r.spot.length,numRectAreaLights:r.rectArea.length,numHemiLights:r.hemi.length,numDirLightShadows:r.directionalShadowMap.length,numPointLightShadows:r.pointShadowMap.length,numSpotLightShadows:r.spotShadowMap.length,numClippingPlanes:x,numClipIntersection:w,dithering:e.dithering,shadowMapEnabled:t.shadowMap.enabled&&v.length>0,shadowMapType:t.shadowMap.type,toneMapping:e.toneMapped?t.toneMapping:ft,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:e.premultipliedAlpha,alphaTest:e.alphaTest,doubleSided:e.side===S,flipSided:e.side===M,depthPacking:void 0!==e.depthPacking&&e.depthPacking}},this.getProgramCacheKey=function(e,n){var r=[];if(n.shaderID?r.push(n.shaderID):(r.push(e.fragmentShader),r.push(e.vertexShader)),void 0!==e.defines)for(var o in e.defines)r.push(o),r.push(e.defines[o]);for(var i=0;i1&&n.sort(rs),r.length>1&&r.sort(is)}}}function os(){var t=new WeakMap;function e(n){var r=n.target;r.removeEventListener("dispose",e),t.delete(r)}return{get:function(n,r){var o,c=t.get(n);return void 0===c?(o=new as,t.set(n,new WeakMap),t.get(n).set(r,o),n.addEventListener("dispose",e)):void 0===(o=c.get(r))&&(o=new as,c.set(r,o)),o},dispose:function(){t=new WeakMap}}}function ss(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new Ln,color:new ci,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new On};break;case"SpotLight":n={position:new Ln,direction:new Ln,color:new ci,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new On};break;case"PointLight":n={position:new Ln,color:new ci,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new On,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new Ln,skyColor:new ci,groundColor:new ci};break;case"RectAreaLight":n={color:new ci,position:new Ln,halfWidth:new Ln,halfHeight:new Ln}}return t[e.id]=n,n}}}var cs=0;function us(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function ls(){for(var t=new ss,e={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},i=0;i<9;i++)e.probe.push(new Ln);var n=new Ln,r=new Jn,o=new Jn;return{setup:function(c,l,h){for(var f=0,g=0,b=0,i=0;i<9;i++)e.probe[i].set(0,0,0);var d=0,m=0,v=0,y=0,_=0,x=0,w=0,T=0,M=h.matrixWorldInverse;c.sort(us),i=0;for(var S=c.length;i\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpack2HalfToRGBA ( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),y=v.clone();y.defines.HORIZONAL_PASS=1;var x=new ji;x.setAttribute("position",new gi(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var E=new ta(x,v),A=this;function P(shadow,n){var r=e.update(E);v.uniforms.shadow_pass.value=shadow.map.texture,v.uniforms.resolution.value=shadow.mapSize,v.uniforms.radius.value=shadow.radius,t.setRenderTarget(shadow.mapPass),t.clear(),t.renderBufferDirect(n,null,r,v,E,null),y.uniforms.shadow_pass.value=shadow.mapPass.texture,y.uniforms.resolution.value=shadow.mapSize,y.uniforms.radius.value=shadow.radius,t.setRenderTarget(shadow.map),t.clear(),t.renderBufferDirect(n,null,r,y,E,null)}function O(t,e,n){var r=t<<0|e<<1|n<<2,o=h[r];return void 0===o&&(o=new ds({depthPacking:$e,morphTargets:t,skinning:e}),h[r]=o),o}function C(t,e,n){var r=t<<0|e<<1|n<<2,o=f[r];return void 0===o&&(o=new ps({morphTargets:t,skinning:e}),f[r]=o),o}function R(object,e,n,r,o,c){var l=object.geometry,h=null,f=O,v=object.customDepthMaterial;if(!0===n.isPointLight&&(f=C,v=object.customDistanceMaterial),void 0===v){var y=!1;!0===e.morphTargets&&(!0===l.isBufferGeometry?y=l.morphAttributes&&l.morphAttributes.position&&l.morphAttributes.position.length>0:!0===l.isGeometry&&(y=l.morphTargets&&l.morphTargets.length>0));var _=!1;!0===object.isSkinnedMesh&&(!0===e.skinning?_=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",object)),h=f(y,_,!0===object.isInstancedMesh)}else h=v;if(t.localClippingEnabled&&!0===e.clipShadows&&0!==e.clippingPlanes.length){var x=h.uuid,T=e.uuid,M=d[x];void 0===M&&(M={},d[x]=M);var S=M[T];void 0===S&&(S=h.clone(),M[T]=S),h=S}return h.visible=e.visible,h.wireframe=e.wireframe,h.side=c===w?null!==e.shadowSide?e.shadowSide:e.side:null!==e.shadowSide?e.shadowSide:m[e.side],h.clipShadows=e.clipShadows,h.clippingPlanes=e.clippingPlanes,h.clipIntersection=e.clipIntersection,h.wireframeLinewidth=e.wireframeLinewidth,h.linewidth=e.linewidth,!0===n.isPointLight&&!0===h.isMeshDistanceMaterial&&(h.referencePosition.setFromMatrixPosition(n.matrixWorld),h.nearDistance=r,h.farDistance=o),h}function L(object,n,o,c,l){if(!1!==object.visible){if(object.layers.test(n.layers)&&(object.isMesh||object.isLine||object.isPoints)&&(object.castShadow||object.receiveShadow&&l===w)&&(!object.frustumCulled||r.intersectsObject(object))){object.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,object.matrixWorld);var h=e.update(object),f=object.material;if(Array.isArray(f))for(var d=h.groups,m=0,v=d.length;mn||o.y>n)&&(console.warn("THREE.WebGLShadowMap:",x,"has shadow exceeding max texture size, reducing"),o.x>n&&(c.x=Math.floor(n/T.x),o.x=c.x*T.x,shadow.mapSize.x=c.x),o.y>n&&(c.y=Math.floor(n/T.y),o.y=c.y*T.y,shadow.mapSize.y=c.y)),null===shadow.map&&!shadow.isPointLightShadow&&this.type===w){var M={minFilter:It,magFilter:It,format:te};shadow.map=new Vn(o.x,o.y,M),shadow.map.texture.name=x.name+".shadowMap",shadow.mapPass=new Vn(o.x,o.y,M),shadow.camera.updateProjectionMatrix()}if(null===shadow.map){M={minFilter:Ct,magFilter:Ct,format:te};shadow.map=new Vn(o.x,o.y,M),shadow.map.texture.name=x.name+".shadowMap",shadow.camera.updateProjectionMatrix()}t.setRenderTarget(shadow.map),t.clear();for(var S=shadow.getViewportCount(),E=0;E=1):-1!==xt.indexOf("OpenGL ES")&&(_t=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(xt)[1]),bt=_t>=2);var wt=null,Tt={},Mt=new zn,St=new zn;function Et(e,n,r){var data=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var i=0;in||image.height>n)&&(r=n/Math.max(image.width,image.height)),r<1||!0===t){if("undefined"!=typeof HTMLImageElement&&image instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&image instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&image instanceof ImageBitmap){var o=t?Pn.floorPowerOfTwo:Math.floor,c=o(r*image.width),l=o(r*image.height);void 0===h&&(h=w(c,l));var canvas=e?w(c,l):h;return canvas.width=c,canvas.height=l,canvas.getContext("2d").drawImage(image,0,0,c,l),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+image.width+"x"+image.height+") to ("+c+"x"+l+")."),canvas}return"data"in image&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+image.width+"x"+image.height+")."),image}return image}function M(image){return Pn.isPowerOfTwo(image.width)&&Pn.isPowerOfTwo(image.height)}function S(t,e){return t.generateMipmaps&&e&&t.minFilter!==Ct&&t.minFilter!==It}function E(e,n,o,c){t.generateMipmap(e),r.get(n).__maxMipLevel=Math.log(Math.max(o,c))*Math.LOG2E}function A(t,n){if(!1===f)return t;var r=t;return 6403===t&&(5126===n&&(r=33326),5131===n&&(r=33325),5121===n&&(r=33321)),6407===t&&(5126===n&&(r=34837),5131===n&&(r=34843),5121===n&&(r=32849)),6408===t&&(5126===n&&(r=34836),5131===n&&(r=34842),5121===n&&(r=32856)),33325===r||33326===r||34842===r||34836===r?e.get("EXT_color_buffer_float"):34843!==r&&34837!==r||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),r}function P(t){return t===Ct||t===Dt||t===Lt?9728:9729}function O(e){var n=e.target;n.removeEventListener("dispose",O),function(e){var n=r.get(e);if(void 0===n.__webglInit)return;t.deleteTexture(n.__webglTexture),r.remove(e)}(n),n.isVideoTexture&&_.delete(n),l.memory.textures--}function C(e){var n=e.target;n.removeEventListener("dispose",C),function(e){var n=r.get(e),o=r.get(e.texture);if(!e)return;void 0!==o.__webglTexture&&t.deleteTexture(o.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLRenderTargetCube)for(var i=0;i<6;i++)t.deleteFramebuffer(n.__webglFramebuffer[i]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[i]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer);if(e.isWebGLMultiviewRenderTarget){t.deleteTexture(n.__webglColorTexture),t.deleteTexture(n.__webglDepthStencilTexture),l.memory.textures-=2;i=0;for(var c=n.__webglViewFramebuffers.length;i0&&e.__version!==t.version){var image=t.image;if(void 0===image)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==image.complete)return void B(e,t,slot);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+slot),n.bindTexture(3553,e.__webglTexture)}function L(e,slot){if(6===e.image.length){var o=r.get(e);if(e.version>0&&o.__version!==e.version){N(o,e),n.activeTexture(33984+slot),n.bindTexture(34067,o.__webglTexture),t.pixelStorei(37440,e.flipY);for(var l=e&&e.isCompressedTexture,h=e.image[0]&&e.image[0].isDataTexture,d=[],i=0;i<6;i++)d[i]=l||h?h?e.image[i].image:e.image[i]:T(e.image[i],!1,!0,m);var v,image=d[0],y=M(image)||f,_=c.convert(e.format),x=c.convert(e.type),w=A(_,x);if(F(34067,e,y),l){for(i=0;i<6;i++){v=d[i].mipmaps;for(var P=0;P1||r.get(c).__currentAnisotropy)&&(t.texParameterf(n,h.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(c.anisotropy,o.getMaxAnisotropy())),r.get(c).__currentAnisotropy=c.anisotropy)}}function N(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",O),e.__webglTexture=t.createTexture(),l.memory.textures++)}function B(e,r,slot){var o=3553;r.isDataTexture2DArray&&(o=35866),r.isDataTexture3D&&(o=32879),N(e,r),n.activeTexture(33984+slot),n.bindTexture(o,e.__webglTexture),t.pixelStorei(37440,r.flipY),t.pixelStorei(37441,r.premultiplyAlpha),t.pixelStorei(3317,r.unpackAlignment);var l=function(t){return!f&&(t.wrapS!==Pt||t.wrapT!==Pt||t.minFilter!==Ct&&t.minFilter!==It)}(r)&&!1===M(r.image),image=T(r.image,l,!1,v),h=M(image)||f,d=c.convert(r.format),m=c.convert(r.type),y=A(d,m);F(o,r,h);var _,x=r.mipmaps;if(r.isDepthTexture){if(y=6402,r.type===qt){if(!1===f)throw new Error("Float Depth Texture only supported in WebGL2.0");y=36012}else f&&(y=33189);r.format===ie&&6402===y&&r.type!==Ht&&r.type!==Wt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=Ht,m=c.convert(r.type)),r.format===ae&&(y=34041,r.type!==$t&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=$t,m=c.convert(r.type))),n.texImage2D(3553,0,y,image.width,image.height,0,d,m,null)}else if(r.isDataTexture)if(x.length>0&&h){for(var i=0,w=x.length;i0&&h){for(i=0,w=x.length;i=d&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+d),D+=1,t},this.resetTextureUnits=function(){D=0},this.setTexture2D=R,this.setTexture2DArray=function(t,slot){var e=r.get(t);t.version>0&&e.__version!==t.version?B(e,t,slot):(n.activeTexture(33984+slot),n.bindTexture(35866,e.__webglTexture))},this.setTexture3D=function(t,slot){var e=r.get(t);t.version>0&&e.__version!==t.version?B(e,t,slot):(n.activeTexture(33984+slot),n.bindTexture(32879,e.__webglTexture))},this.setTextureCube=L,this.setTextureCubeDynamic=k,this.setupRenderTarget=function(o){var h=r.get(o),d=r.get(o.texture);o.addEventListener("dispose",C),d.__webglTexture=t.createTexture(),l.memory.textures++;var m=!0===o.isWebGLRenderTargetCube,v=!0===o.isWebGLMultisampleRenderTarget,y=!0===o.isWebGLMultiviewRenderTarget,_=M(o)||f;if(m){h.__webglFramebuffer=[];for(var i=0;i<6;i++)h.__webglFramebuffer[i]=t.createFramebuffer()}else if(h.__webglFramebuffer=t.createFramebuffer(),v)if(f){h.__webglMultisampledFramebuffer=t.createFramebuffer(),h.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,h.__webglColorRenderbuffer);var x=A(c.convert(o.texture.format),c.convert(o.texture.type)),w=H(o);t.renderbufferStorageMultisample(36161,w,x,o.width,o.height),t.bindFramebuffer(36160,h.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,h.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),o.depthBuffer&&(h.__webglDepthRenderbuffer=t.createRenderbuffer(),V(h.__webglDepthRenderbuffer,o,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(y){var T=o.width,P=o.height,O=o.numViews;t.bindFramebuffer(36160,h.__webglFramebuffer);var D=e.get("OVR_multiview2");l.memory.textures+=2;var R=t.createTexture();t.bindTexture(35866,R),t.texParameteri(35866,10240,9728),t.texParameteri(35866,10241,9728),t.texImage3D(35866,0,32856,T,P,O,0,6408,5121,null),D.framebufferTextureMultiviewOVR(36160,36064,R,0,0,O);var L=t.createTexture();t.bindTexture(35866,L),t.texParameteri(35866,10240,9728),t.texParameteri(35866,10241,9728),t.texImage3D(35866,0,35056,T,P,O,0,34041,34042,null),D.framebufferTextureMultiviewOVR(36160,33306,L,0,0,O);var k=new Array(O);for(i=0;iv)return!1;for(var i=1,n=e.length;i=0){var f=r[l];if(void 0!==f){var d=f.normalized,m=f.itemSize;if(void 0===(A=P.get(f)))continue;var v=A.buffer,y=A.type,M=A.bytesPerElement;if(f.isInterleavedBufferAttribute){var data=f.data,S=data.stride,E=f.offset;data&&data.isInstancedInterleavedBuffer?(T.enableAttributeAndDivisor(h,data.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=data.meshPerAttribute*data.count)):T.enableAttribute(h),_.bindBuffer(34962,v),_.vertexAttribPointer(h,m,y,d,S*M,E*M)}else f.isInstancedBufferAttribute?(T.enableAttributeAndDivisor(h,f.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=f.meshPerAttribute*f.count)):T.enableAttribute(h),_.bindBuffer(34962,v),_.vertexAttribPointer(h,m,y,d,0,0)}else if("instanceMatrix"===l){var A;if(void 0===(A=P.get(object.instanceMatrix)))continue;v=A.buffer,y=A.type;T.enableAttributeAndDivisor(h+0,1),T.enableAttributeAndDivisor(h+1,1),T.enableAttributeAndDivisor(h+2,1),T.enableAttributeAndDivisor(h+3,1),_.bindBuffer(34962,v),_.vertexAttribPointer(h+0,4,y,!1,64,0),_.vertexAttribPointer(h+1,4,y,!1,64,16),_.vertexAttribPointer(h+2,4,y,!1,64,32),_.vertexAttribPointer(h+3,4,y,!1,64,48)}else if(void 0!==c){var O=c[l];if(void 0!==O)switch(O.length){case 2:_.vertexAttrib2fv(h,O);break;case 3:_.vertexAttrib3fv(h,O);break;case 4:_.vertexAttrib4fv(h,O);break;default:_.vertexAttrib1fv(h,O)}}}}T.disableUnusedAttributes()}(object,n,r,l),null!==f&&_.bindBuffer(34963,m.buffer));var M=1/0;null!==f?M=f.count:void 0!==d&&(M=d.count);var S=n.drawRange.start*v,E=n.drawRange.count*v,A=null!==o?o.start*v:0,C=null!==o?o.count*v:1/0,D=Math.max(S,A),R=Math.min(M,S+E,A+C)-1,L=Math.max(0,R-D+1);if(0!==L){if(object.isMesh)if(!0===r.wireframe)T.setLineWidth(r.wireframeLinewidth*mt()),y.setMode(1);else switch(object.drawMode){case Be:y.setMode(4);break;case ze:y.setMode(5);break;case Ve:y.setMode(6)}else if(object.isLine){var k=r.linewidth;void 0===k&&(k=1),T.setLineWidth(k*mt()),object.isLineSegments?y.setMode(1):object.isLineLoop?y.setMode(2):y.setMode(3)}else object.isPoints?y.setMode(0):object.isSprite&&y.setMode(4);object.isInstancedMesh?y.renderInstances(n,D,L,object.count):n.isInstancedBufferGeometry?y.renderInstances(n,D,L,n.maxInstancedCount):y.render(D,L)}}},this.compile=function(t,e){(y=L.get(t,e)).init(),t.traverse((function(object){object.isLight&&(y.pushLight(object),object.castShadow&&y.pushShadow(object))})),y.setupLights(e),t.traverse((function(object){if(object.material)if(Array.isArray(object.material))for(var i=0;i=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(i=0;i=0&&t.numSupportedMorphNormals++}var _=n.shader.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(n.numClippingPlanes=ct.numPlanes,n.numIntersection=ct.numIntersection,_.clippingPlanes=ct.uniform),n.fog=e,n.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),n.lightsStateVersion=c,n.needsLights&&(_.ambientLightColor.value=r.state.ambient,_.lightProbe.value=r.state.probe,_.directionalLights.value=r.state.directional,_.spotLights.value=r.state.spot,_.rectAreaLights.value=r.state.rectArea,_.pointLights.value=r.state.point,_.hemisphereLights.value=r.state.hemi,_.directionalShadowMap.value=r.state.directionalShadowMap,_.directionalShadowMatrix.value=r.state.directionalShadowMatrix,_.spotShadowMap.value=r.state.spotShadowMap,_.spotShadowMatrix.value=r.state.spotShadowMatrix,_.pointShadowMap.value=r.state.pointShadowMap,_.pointShadowMatrix.value=r.state.pointShadowMatrix);var x=n.program.getUniforms(),w=Fo.seqWithValue(x.seq,_);n.uniformsList=w}function Dt(t,e,n,object){A.resetTextureUnits();var r=E.get(n),o=y.state.lights;if(ut&&(lt||t!==Z)){var c=t===Z&&n.id===Y;ct.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,r,c)}n.version===r.__version&&(void 0===r.program||n.fog&&r.fog!==e||r.needsLights&&r.lightsStateVersion!==o.state.version?n.needsUpdate=!0:void 0===r.numClippingPlanes||r.numClippingPlanes===ct.numPlanes&&r.numIntersection===ct.numIntersection||(n.needsUpdate=!0)),n.version!==r.__version&&(Ct(n,e,object),r.__version=n.version);var l,h,f=!1,d=!1,m=!1,v=r.program,x=v.getUniforms(),S=r.shader.uniforms;if(T.useProgram(v.program)&&(f=!0,d=!0,m=!0),n.id!==Y&&(Y=n.id,d=!0),f||Z!==t){if(v.numMultiviewViews>0?bt.updateCameraProjectionMatricesUniform(t,x):x.setValue(_,"projectionMatrix",t.projectionMatrix),w.logarithmicDepthBuffer&&x.setValue(_,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),Z!==t&&(Z=t,d=!0,m=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap){var P=x.map.cameraPosition;void 0!==P&&P.setValue(_,ft.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&x.setValue(_,"isOrthographic",!0===t.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&(v.numMultiviewViews>0?bt.updateCameraViewMatricesUniform(t,x):x.setValue(_,"viewMatrix",t.matrixWorldInverse))}if(n.skinning){x.setOptional(_,object,"bindMatrix"),x.setOptional(_,object,"bindMatrixInverse");var O=object.skeleton;if(O){var C=O.bones;if(w.floatVertexTextures){if(void 0===O.boneTexture){var D=Math.sqrt(4*C.length);D=Pn.ceilPowerOfTwo(D),D=Math.max(D,4);var R=new Float32Array(D*D*4);R.set(O.boneMatrices);var L=new ya(R,D,D,te,qt);O.boneMatrices=R,O.boneTexture=L,O.boneTextureSize=D}x.setValue(_,"boneTexture",O.boneTexture,A),x.setValue(_,"boneTextureSize",O.boneTextureSize)}else x.setOptional(_,O,"boneMatrices")}}return(d||r.receiveShadow!==object.receiveShadow)&&(r.receiveShadow=object.receiveShadow,x.setValue(_,"receiveShadow",object.receiveShadow)),d&&(x.setValue(_,"toneMappingExposure",B.toneMappingExposure),x.setValue(_,"toneMappingWhitePoint",B.toneMappingWhitePoint),r.needsLights&&(h=m,(l=S).ambientLightColor.needsUpdate=h,l.lightProbe.needsUpdate=h,l.directionalLights.needsUpdate=h,l.pointLights.needsUpdate=h,l.spotLights.needsUpdate=h,l.rectAreaLights.needsUpdate=h,l.hemisphereLights.needsUpdate=h),e&&n.fog&&function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}(S,e),n.isMeshBasicMaterial?Rt(S,n):n.isMeshLambertMaterial?(Rt(S,n),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(S,n)):n.isMeshPhongMaterial?(Rt(S,n),n.isMeshToonMaterial?function(t,e){Lt(t,e),e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(S,n):Lt(S,n)):n.isMeshStandardMaterial?(Rt(S,n),n.isMeshPhysicalMaterial?function(t,e){kt(t,e),t.reflectivity.value=e.reflectivity,t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.sheen&&t.sheen.value.copy(e.sheen);e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,e.side===M&&t.clearcoatNormalScale.value.negate());t.transparency.value=e.transparency}(S,n):kt(S,n)):n.isMeshMatcapMaterial?(Rt(S,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===M&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===M&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(S,n)):n.isMeshDepthMaterial?(Rt(S,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(S,n)):n.isMeshDistanceMaterial?(Rt(S,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias);t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(S,n)):n.isMeshNormalMaterial?(Rt(S,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===M&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===M&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(S,n)):n.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(S,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(S,n)):n.isPointsMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*nt,t.scale.value=.5*et,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);var n;e.map?n=e.map:e.alphaMap&&(n=e.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(S,n):n.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);var n;e.map?n=e.map:e.alphaMap&&(n=e.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(S,n):n.isShadowMaterial&&(S.color.value.copy(n.color),S.opacity.value=n.opacity),void 0!==S.ltc_1&&(S.ltc_1.value=Ta.LTC_1),void 0!==S.ltc_2&&(S.ltc_2.value=Ta.LTC_2),Fo.upload(_,r.uniformsList,S,A),n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Fo.upload(_,r.uniformsList,S,A),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&x.setValue(_,"center",object.center),v.numMultiviewViews>0?bt.updateObjectMatricesUniforms(object,t,x):(x.setValue(_,"modelViewMatrix",object.modelViewMatrix),x.setValue(_,"normalMatrix",object.normalMatrix)),x.setValue(_,"modelMatrix",object.matrixWorld),v}function Rt(t,e){var n;t.opacity.value=e.opacity,e.color&&t.diffuse.value.copy(e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap),e.envMap&&(t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio,t.maxMipLevel.value=E.get(e.envMap).__maxMipLevel),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity),e.map?n=e.map:e.specularMap?n=e.specularMap:e.displacementMap?n=e.displacementMap:e.normalMap?n=e.normalMap:e.bumpMap?n=e.bumpMap:e.roughnessMap?n=e.roughnessMap:e.metalnessMap?n=e.metalnessMap:e.alphaMap?n=e.alphaMap:e.emissiveMap&&(n=e.emissiveMap),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}function Lt(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===M&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===M&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function kt(t,e){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===M&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===M&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}Et.setAnimationLoop((function(time){yt.isPresenting()||St&&St(time)})),"undefined"!=typeof window&&Et.setContext(window),this.setAnimationLoop=function(t){St=t,yt.setAnimationLoop(t),Et.start()},this.render=function(t,e){var n,r;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),e&&e.isCamera){if(!z){X.geometry=null,X.program=null,X.wireframe=!1,Y=-1,Z=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),yt.enabled&&yt.isPresenting()&&(e=yt.getCamera(e)),(y=L.get(t,e)).init(),t.onBeforeRender(B,t,e,n||U),ht.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),st.setFromMatrix(ht),lt=this.localClippingEnabled,ut=ct.init(this.clippingPlanes,lt,e),(v=R.get(t,e)).init(),At(t,e,0,B.sortObjects),!0===B.sortObjects&&v.sort(),ut&&ct.beginShadows();var o=y.state.shadowsArray;_t.render(o,t,e),y.setupLights(e),ut&&ct.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),yt.enabled&&bt.isAvailable()&&bt.attachCamera(e),k.render(v,t,e,r);var c=v.opaque,l=v.transparent;if(t.overrideMaterial){var h=t.overrideMaterial;c.length&&Pt(c,t,e,h),l.length&&Pt(l,t,e,h)}else c.length&&Pt(c,t,e),l.length&&Pt(l,t,e);t.onAfterRender(B,t,e),null!==U&&(A.updateRenderTargetMipmap(U),A.updateMultisampleRenderTarget(U)),T.buffers.depth.setTest(!0),T.buffers.depth.setMask(!0),T.buffers.color.setMask(!0),T.setPolygonOffset(!1),yt.enabled&&(bt.isAvailable()&&bt.detachCamera(e),yt.submitFrame()),v=null,y=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){V!==t&&null===U&&_.bindFramebuffer(36160,t),V=t},this.getActiveCubeFace=function(){return G},this.getActiveMipmapLevel=function(){return H},this.getRenderTarget=function(){return U},this.setRenderTarget=function(t,e,n){U=t,G=e,H=n,t&&void 0===E.get(t).__webglFramebuffer&&A.setupRenderTarget(t);var r=V,o=!1;if(t){var c=E.get(t).__webglFramebuffer;t.isWebGLRenderTargetCube?(r=c[e||0],o=!0):r=t.isWebGLMultisampleRenderTarget?E.get(t).__webglMultisampledFramebuffer:c,$.copy(t.viewport),K.copy(t.scissor),Q=t.scissorTest}else $.copy(it).multiplyScalar(nt).floor(),K.copy(at).multiplyScalar(nt).floor(),Q=ot;if(W!==r&&(_.bindFramebuffer(36160,r),W=r),T.viewport($),T.scissor(K),T.setScissorTest(Q),o){var l=E.get(t.texture);_.framebufferTexture2D(36160,36064,34069+(e||0),l.__webglTexture,n||0)}},this.readRenderTargetPixels=function(t,e,n,r,o,c,l){if(t&&t.isWebGLRenderTarget){var h=E.get(t).__webglFramebuffer;if(t.isWebGLRenderTargetCube&&void 0!==l&&(h=h[l]),h){var f=!1;h!==W&&(_.bindFramebuffer(36160,h),f=!0);try{var d=t.texture,m=d.format,v=d.type;if(m!==te&&N.convert(m)!==_.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(v===zt||N.convert(v)===_.getParameter(35738)||v===qt&&(w.isWebGL2||x.get("OES_texture_float")||x.get("WEBGL_color_buffer_float"))||v===Yt&&(w.isWebGL2?x.get("EXT_color_buffer_float"):x.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===_.checkFramebufferStatus(36160)?e>=0&&e<=t.width-r&&n>=0&&n<=t.height-o&&_.readPixels(e,n,r,o,N.convert(m),N.convert(v),c):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{f&&_.bindFramebuffer(36160,W)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,n){void 0===n&&(n=0);var r=Math.pow(2,-n),o=Math.floor(e.image.width*r),c=Math.floor(e.image.height*r),l=N.convert(e.format);A.setTexture2D(e,0),_.copyTexImage2D(3553,n,l,t.x,t.y,o,c,0),T.unbindTexture()},this.copyTextureToTexture=function(t,e,n,r){var o=e.image.width,c=e.image.height,l=N.convert(n.format),h=N.convert(n.type);A.setTexture2D(n,0),e.isDataTexture?_.texSubImage2D(3553,r||0,t.x,t.y,o,c,l,h,e.image.data):_.texSubImage2D(3553,r||0,t.x,t.y,l,h,e.image),T.unbindTexture()},this.initTexture=function(t){A.setTexture2D(t,0),T.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Cs(t,e){this.name="",this.color=new ci(t),this.density=void 0!==e?e:25e-5}function Ds(t,e,n){this.name="",this.color=new ci(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function Rs(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=gn,this.updateRange={offset:0,count:-1},this.version=0}function Ls(t,e,n,r){this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===r}function ks(t){mi.call(this),this.type="SpriteMaterial",this.color=new ci(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}Object.assign(As.prototype,En.prototype),Object.assign(Ps.prototype,En.prototype),Object.assign(Cs.prototype,{isFogExp2:!0,clone:function(){return new Cs(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(Ds.prototype,{isFog:!0,clone:function(){return new Ds(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(Rs.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Rs.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(source){return this.array=new source.array.constructor(source.array),this.count=source.count,this.stride=source.stride,this.usage=source.usage,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(var i=0,r=this.stride;it.far||e.push({distance:h,point:Is.clone(),uv:ii.getUV(Is,Vs,Gs,Hs,Us,Ws,qs,new On),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(source){return vr.prototype.copy.call(this,source),void 0!==source.center&&this.center.copy(source.center),this}});var Zs=new Ln,Js=new Ln;function $s(){vr.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function Ks(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),ta.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Jn,this.bindMatrixInverse=new Jn}$s.prototype=Object.assign(Object.create(vr.prototype),{constructor:$s,isLOD:!0,copy:function(source){vr.prototype.copy.call(this,source,!1);for(var t=source.levels,i=0,e=t.length;i0){for(var i=1,n=e.length;i0){Zs.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(Zs);this.getObjectForDistance(n).raycast(t,e)}},update:function(t){var e=this.levels;if(e.length>1){Zs.setFromMatrixPosition(t.matrixWorld),Js.setFromMatrixPosition(this.matrixWorld);var n=Zs.distanceTo(Js);e[0].object.visible=!0;for(var i=1,r=e.length;i=e[i].distance;i++)e[i-1].object.visible=!1,e[i].object.visible=!0;for(;i0&&(ac[0].instanceId=o,ac[0].object=this,e.push(ac[0]),ac.length=0)},setMatrixAt:function(t,e){e.toArray(this.instanceMatrix.array,16*t)},updateMorphTargets:function(){}}),cc.prototype=Object.create(mi.prototype),cc.prototype.constructor=cc,cc.prototype.isLineBasicMaterial=!0,cc.prototype.copy=function(source){return mi.prototype.copy.call(this,source),this.color.copy(source.color),this.linewidth=source.linewidth,this.linecap=source.linecap,this.linejoin=source.linejoin,this};var uc=new Ln,lc=new Ln,hc=new Jn,fc=new Hr,dc=new Ir;function pc(t,e,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),vr.call(this),this.type="Line",this.geometry=void 0!==t?t:new ji,this.material=void 0!==e?e:new cc({color:16777215*Math.random()})}pc.prototype=Object.assign(Object.create(vr.prototype),{constructor:pc,isLine:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[0],i=1,r=e.count;il))m.applyMatrix4(this.matrixWorld),(S=t.ray.origin.distanceTo(m))t.far||e.push({distance:S,point:d.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}else for(i=0,w=_.length/3-1;il))m.applyMatrix4(this.matrixWorld),(S=t.ray.origin.distanceTo(m))t.far||e.push({distance:S,point:d.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else if(r.isGeometry){var T=r.vertices,M=T.length;for(i=0;il))m.applyMatrix4(this.matrixWorld),(S=t.ray.origin.distanceTo(m))t.far||e.push({distance:S,point:d.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var mc=new Ln,vc=new Ln;function gc(t,e){pc.call(this,t,e),this.type="LineSegments"}function yc(t,e){pc.call(this,t,e),this.type="LineLoop"}function bc(t){mi.call(this),this.type="PointsMaterial",this.color=new ci(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}gc.prototype=Object.assign(Object.create(pc.prototype),{constructor:gc,isLineSegments:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[],i=0,r=e.count;io.far)return;c.push({distance:f,distanceToRay:Math.sqrt(l),point:h,index:e,face:null,object:object})}}function Ec(video,t,e,n,r,o,c,l,h){Bn.call(this,video,t,e,n,r,o,c,l,h),this.format=void 0!==c?c:Qt,this.minFilter=void 0!==o?o:It,this.magFilter=void 0!==r?r:It,this.generateMipmaps=!1}function Ac(t,e,n,r,o,c,l,h,f,d,m,v){Bn.call(this,null,c,l,h,f,d,r,o,m,v),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function Pc(canvas,t,e,n,r,o,c,l,h){Bn.call(this,canvas,t,e,n,r,o,c,l,h),this.needsUpdate=!0}function Oc(t,e,n,r,o,c,l,h,f,d){if((d=void 0!==d?d:ie)!==ie&&d!==ae)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&d===ie&&(n=Ht),void 0===n&&d===ae&&(n=$t),Bn.call(this,null,r,o,c,l,h,d,n,f),this.image={width:t,height:e},this.magFilter=void 0!==l?l:Ct,this.minFilter=void 0!==h?h:Ct,this.flipY=!1,this.generateMipmaps=!1}function Cc(t){ji.call(this),this.type="WireframeGeometry";var i,e,n,r,ol,o,c,l,h,f,d=[],m=[0,0],v={},y=["a","b","c"];if(t&&t.isGeometry){var _=t.faces;for(i=0,n=_.length;i=0?(t(u-f,w,v),y.subVectors(m,v)):(t(u+f,w,v),y.subVectors(v,m)),w-f>=0?(t(u,w-f,v),_.subVectors(m,v)):(t(u,w+f,v),_.subVectors(v,m)),d.crossVectors(y,_).normalize(),l.push(d.x,d.y,d.z),h.push(u,w)}}for(i=0;i.9&&o<.1&&(t<.2&&(c[i+0]+=1),e<.2&&(c[i+2]+=1),n<.2&&(c[i+4]+=1))}}()}(),this.setAttribute("position",new Si(o,3)),this.setAttribute("normal",new Si(o.slice(),3)),this.setAttribute("uv",new Si(c,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function Ic(t,e){sa.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new jc(t,e)),this.mergeVertices()}function jc(t,e){kc.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Fc(t,e){sa.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Nc(t,e)),this.mergeVertices()}function Nc(t,e){kc.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Bc(t,e){sa.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new zc(t,e)),this.mergeVertices()}function zc(t,e){var n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];kc.call(this,r,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Vc(t,e){sa.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Gc(t,e)),this.mergeVertices()}function Gc(t,e){var n=(1+Math.sqrt(5))/2,r=1/n,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r];kc.call(this,o,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Hc(path,t,e,n,r,o){sa.call(this),this.type="TubeGeometry",this.parameters={path:path,tubularSegments:t,radius:e,radialSegments:n,closed:r},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var c=new Uc(path,t,e,n,r);this.tangents=c.tangents,this.normals=c.normals,this.binormals=c.binormals,this.fromBufferGeometry(c),this.mergeVertices()}function Uc(path,t,e,n,r){ji.call(this),this.type="TubeBufferGeometry",this.parameters={path:path,tubularSegments:t,radius:e,radialSegments:n,closed:r},t=t||64,e=e||1,n=n||8,r=r||!1;var o=path.computeFrenetFrames(t,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var i,c,l=new Ln,h=new Ln,f=new On,d=new Ln,m=[],v=[],y=[],_=[];function x(i){d=path.getPointAt(i/t,d);var r=o.normals[i],f=o.binormals[i];for(c=0;c<=n;c++){var y=c/n*Math.PI*2,_=Math.sin(y),x=-Math.cos(y);h.x=x*r.x+_*f.x,h.y=x*r.y+_*f.y,h.z=x*r.z+_*f.z,h.normalize(),v.push(h.x,h.y,h.z),l.x=d.x+e*h.x,l.y=d.y+e*h.y,l.z=d.z+e*h.z,m.push(l.x,l.y,l.z)}}!function(){for(i=0;i0){var l=o[c[0]];if(void 0!==l)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=l.length;t0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Ec.prototype=Object.assign(Object.create(Bn.prototype),{constructor:Ec,isVideoTexture:!0,update:function(){var video=this.image;video.readyState>=video.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Ac.prototype=Object.create(Bn.prototype),Ac.prototype.constructor=Ac,Ac.prototype.isCompressedTexture=!0,Pc.prototype=Object.create(Bn.prototype),Pc.prototype.constructor=Pc,Pc.prototype.isCanvasTexture=!0,Oc.prototype=Object.create(Bn.prototype),Oc.prototype.constructor=Oc,Oc.prototype.isDepthTexture=!0,Cc.prototype=Object.create(ji.prototype),Cc.prototype.constructor=Cc,Dc.prototype=Object.create(sa.prototype),Dc.prototype.constructor=Dc,Rc.prototype=Object.create(ji.prototype),Rc.prototype.constructor=Rc,Lc.prototype=Object.create(sa.prototype),Lc.prototype.constructor=Lc,kc.prototype=Object.create(ji.prototype),kc.prototype.constructor=kc,Ic.prototype=Object.create(sa.prototype),Ic.prototype.constructor=Ic,jc.prototype=Object.create(kc.prototype),jc.prototype.constructor=jc,Fc.prototype=Object.create(sa.prototype),Fc.prototype.constructor=Fc,Nc.prototype=Object.create(kc.prototype),Nc.prototype.constructor=Nc,Bc.prototype=Object.create(sa.prototype),Bc.prototype.constructor=Bc,zc.prototype=Object.create(kc.prototype),zc.prototype.constructor=zc,Vc.prototype=Object.create(sa.prototype),Vc.prototype.constructor=Vc,Gc.prototype=Object.create(kc.prototype),Gc.prototype.constructor=Gc,Hc.prototype=Object.create(sa.prototype),Hc.prototype.constructor=Hc,Uc.prototype=Object.create(ji.prototype),Uc.prototype.constructor=Uc,Uc.prototype.toJSON=function(){var data=ji.prototype.toJSON.call(this);return data.path=this.parameters.path.toJSON(),data},Wc.prototype=Object.create(sa.prototype),Wc.prototype.constructor=Wc,qc.prototype=Object.create(ji.prototype),qc.prototype.constructor=qc,Yc.prototype=Object.create(sa.prototype),Yc.prototype.constructor=Yc,Xc.prototype=Object.create(ji.prototype),Xc.prototype.constructor=Xc;var Zc=function(data,t,e){e=e||2;var n,r,o,c,l,h,f,d=t&&t.length,m=d?t[0]*e:data.length,v=Jc(data,0,m,e,!0),y=[];if(!v||v.next===v.prev)return y;if(d&&(v=function(data,t,e,n){var i,r,o,c,l,h=[];for(i=0,r=t.length;i80*e){n=o=data[0],r=c=data[1];for(var i=e;io&&(o=l),h>c&&(c=h);f=0!==(f=Math.max(o-n,c-r))?1/f:0}return Kc(v,y,e,n,r,f),y};function Jc(data,t,e,n,r){var i,o;if(r===function(data,t,e,n){for(var r=0,i=t,o=e-n;i0)for(i=t;i=t;i-=n)o=du(i,data[i],data[i+1],o);return o&&uu(o,o.next)&&(pu(o),o=o.next),o}function $c(t,e){if(!t)return t;e||(e=t);var n,p=t;do{if(n=!1,p.steiner||!uu(p,p.next)&&0!==area(p.prev,p,p.next))p=p.next;else{if(pu(p),(p=e=p.prev)===p.next)break;n=!0}}while(n||p!==e);return e}function Kc(t,e,n,r,o,c,l){if(t){!l&&c&&function(t,e,n,r){var p=t;do{null===p.z&&(p.z=au(p.x,p.y,e,n,r)),p.prevZ=p.prev,p.nextZ=p.next,p=p.next}while(p!==t);p.prevZ.nextZ=null,p.prevZ=null,function(t){var i,p,q,e,n,r,o,c,l=1;do{for(p=t,t=null,n=null,r=0;p;){for(r++,q=p,o=0,i=0;i0||c>0&&q;)0!==o&&(0===c||!q||p.z<=q.z)?(e=p,p=p.nextZ,o--):(e=q,q=q.nextZ,c--),n?n.nextZ=e:t=e,e.prevZ=n,n=e;p=q}n.nextZ=null,l*=2}while(r>1)}(p)}(t,r,o,c);for(var h,f,d=t;t.prev!==t.next;)if(h=t.prev,f=t.next,c?tu(t,r,o,c):Qc(t))e.push(h.i/n),e.push(t.i/n),e.push(f.i/n),pu(t),t=f.next,d=f.next;else if((t=f)===d){l?1===l?Kc(t=eu(t,e,n),e,n,r,o,c,2):2===l&&nu(t,e,n,r,o,c):Kc($c(t),e,n,r,o,c,1);break}}}function Qc(t){var a=t.prev,b=t,e=t.next;if(area(a,b,e)>=0)return!1;for(var p=t.next.next;p!==t.prev;){if(su(a.x,a.y,b.x,b.y,e.x,e.y,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function tu(t,e,n,r){var a=t.prev,b=t,o=t.next;if(area(a,b,o)>=0)return!1;for(var c=a.xb.x?a.x>o.x?a.x:o.x:b.x>o.x?b.x:o.x,f=a.y>b.y?a.y>o.y?a.y:o.y:b.y>o.y?b.y:o.y,d=au(c,l,e,n,r),m=au(h,f,e,n,r),p=t.prevZ,v=t.nextZ;p&&p.z>=d&&v&&v.z<=m;){if(p!==t.prev&&p!==t.next&&su(a.x,a.y,b.x,b.y,o.x,o.y,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,v!==t.prev&&v!==t.next&&su(a.x,a.y,b.x,b.y,o.x,o.y,v.x,v.y)&&area(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;p&&p.z>=d;){if(p!==t.prev&&p!==t.next&&su(a.x,a.y,b.x,b.y,o.x,o.y,p.x,p.y)&&area(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;v&&v.z<=m;){if(v!==t.prev&&v!==t.next&&su(a.x,a.y,b.x,b.y,o.x,o.y,v.x,v.y)&&area(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function eu(t,e,n){var p=t;do{var a=p.prev,b=p.next.next;!uu(a,b)&&lu(a,p,p.next,b)&&hu(a,b)&&hu(b,a)&&(e.push(a.i/n),e.push(p.i/n),e.push(b.i/n),pu(p),pu(p.next),p=t=b),p=p.next}while(p!==t);return p}function nu(t,e,n,r,o,c){var a=t;do{for(var b=a.next.next;b!==a.prev;){if(a.i!==b.i&&cu(a,b)){var l=fu(a,b);return a=$c(a,a.next),l=$c(l,l.next),Kc(a,e,n,r,o,c),void Kc(l,e,n,r,o,c)}b=b.next}a=a.next}while(a!==t)}function ru(a,b){return a.x-b.x}function iu(t,e){if(e=function(t,e){var n,p=e,r=t.x,o=t.y,c=-1/0;do{if(o<=p.y&&o>=p.next.y&&p.next.y!==p.y){var l=p.x+(o-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(l<=r&&l>c){if(c=l,l===r){if(o===p.y)return p;if(o===p.next.y)return p.next}n=p.x=p.x&&p.x>=d&&r!==p.x&&su(on.x)&&hu(p,t)&&(n=p,v=h),p=p.next;return n}(t,e)){var b=fu(e,t);$c(b,b.next)}}function au(t,e,n,r,o){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*o)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*o)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ou(t){var p=t,e=t;do{(p.x=0&&(t-l)*(r-h)-(n-l)*(e-h)>=0&&(n-l)*(c-h)-(o-l)*(r-h)>=0}function cu(a,b){return a.next.i!==b.i&&a.prev.i!==b.i&&!function(a,b){var p=a;do{if(p.i!==a.i&&p.next.i!==a.i&&p.i!==b.i&&p.next.i!==b.i&&lu(p,p.next,a,b))return!0;p=p.next}while(p!==a);return!1}(a,b)&&hu(a,b)&&hu(b,a)&&function(a,b){var p=a,t=!1,e=(a.x+b.x)/2,n=(a.y+b.y)/2;do{p.y>n!=p.next.y>n&&p.next.y!==p.y&&e<(p.next.x-p.x)*(n-p.y)/(p.next.y-p.y)+p.x&&(t=!t),p=p.next}while(p!==a);return t}(a,b)}function area(p,q,t){return(q.y-p.y)*(t.x-q.x)-(q.x-p.x)*(t.y-q.y)}function uu(t,e){return t.x===e.x&&t.y===e.y}function lu(t,e,n,r){return!!(uu(t,n)&&uu(e,r)||uu(t,r)&&uu(n,e))||area(t,e,n)>0!=area(t,e,r)>0&&area(n,r,t)>0!=area(n,r,e)>0}function hu(a,b){return area(a.prev,a,a.next)<0?area(a,b,a.next)>=0&&area(a,a.prev,b)>=0:area(a,b,a.prev)<0||area(a,a.next,b)<0}function fu(a,b){var t=new mu(a.i,a.x,a.y),e=new mu(b.i,b.x,b.y),n=a.next,r=b.prev;return a.next=b,b.prev=a,t.next=n,n.prev=t,e.next=t,t.prev=e,r.next=e,e.prev=r,e}function du(i,t,e,n){var p=new mu(i,t,e);return n?(p.next=n.next,p.prev=n,n.next.prev=p,n.next=p):(p.prev=p,p.next=p),p}function pu(p){p.next.prev=p.prev,p.prev.next=p.next,p.prevZ&&(p.prevZ.nextZ=p.nextZ),p.nextZ&&(p.nextZ.prevZ=p.prevZ)}function mu(i,t,e){this.i=i,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var vu={area:function(t){for(var e=t.length,a=0,p=e-1,q=0;q2&&t[e-1].equals(t[0])&&t.pop()}function yu(t,e){for(var i=0;iNumber.EPSILON){var y=Math.sqrt(m),_=Math.sqrt(f*f+d*d),x=e.x-h/y,w=e.y+l/y,T=((n.x-d/_-x)*d-(n.y+f/_-w)*f)/(l*d-h*f),M=(r=x+l*T-t.x)*r+(o=w+h*T-t.y)*o;if(M<=2)return new On(r,o);c=Math.sqrt(M/2)}else{var S=!1;l>Number.EPSILON?f>Number.EPSILON&&(S=!0):l<-Number.EPSILON?f<-Number.EPSILON&&(S=!0):Math.sign(h)===Math.sign(d)&&(S=!0),S?(r=-h,o=l,c=Math.sqrt(m)):(r=l,o=h,c=Math.sqrt(m/2))}return new On(r/c,o/c)}for(var Y=[],i=0,X=j.length,Z=X-1,J=i+1;i=0;b--){for(B=b/_,z=m*Math.cos(B*Math.PI/2),N=v*Math.sin(B*Math.PI/2)+y,i=0,X=j.length;i=0;){n=i,(r=i-1)<0&&(r=t.length-1);var s=0,o=h+2*_;for(s=0;s0)&&x.push(a,b,O),(f!==n-1||d0&&M(!0),e>0&&M(!1)),this.setIndex(d),this.setAttribute("position",new Si(m,3)),this.setAttribute("normal",new Si(v,3)),this.setAttribute("uv",new Si(y,2))}function Fu(t,e,n,r,o,c,l){Iu.call(this,0,t,e,n,r,o,c,l),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:o,thetaStart:c,thetaLength:l}}function Nu(t,e,n,r,o,c,l){ju.call(this,0,t,e,n,r,o,c,l),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:r,openEnded:o,thetaStart:c,thetaLength:l}}function Bu(t,e,n,r){sa.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},this.fromBufferGeometry(new zu(t,e,n,r)),this.mergeVertices()}function zu(t,e,n,r){ji.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:r},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var i,s,o=[],c=[],l=[],h=[],f=new Ln,d=new On;for(c.push(0,0,0),l.push(0,0,1),h.push(.5,.5),s=0,i=3;s<=e;s++,i+=3){var m=n+s/e*r;f.x=t*Math.cos(m),f.y=t*Math.sin(m),c.push(f.x,f.y,f.z),l.push(0,0,1),d.x=(c[i]/t+1)/2,d.y=(c[i+1]/t+1)/2,h.push(d.x,d.y)}for(i=1;i<=e;i++)o.push(i,i+1,0);this.setIndex(o),this.setAttribute("position",new Si(c,3)),this.setAttribute("normal",new Si(l,3)),this.setAttribute("uv",new Si(h,2))}Tu.prototype=Object.create(sa.prototype),Tu.prototype.constructor=Tu,Mu.prototype=Object.create(_u.prototype),Mu.prototype.constructor=Mu,Su.prototype=Object.create(sa.prototype),Su.prototype.constructor=Su,Eu.prototype=Object.create(ji.prototype),Eu.prototype.constructor=Eu,Au.prototype=Object.create(sa.prototype),Au.prototype.constructor=Au,Pu.prototype=Object.create(ji.prototype),Pu.prototype.constructor=Pu,Ou.prototype=Object.create(sa.prototype),Ou.prototype.constructor=Ou,Cu.prototype=Object.create(ji.prototype),Cu.prototype.constructor=Cu,Du.prototype=Object.create(sa.prototype),Du.prototype.constructor=Du,Du.prototype.toJSON=function(){var data=sa.prototype.toJSON.call(this);return Lu(this.parameters.shapes,data)},Ru.prototype=Object.create(ji.prototype),Ru.prototype.constructor=Ru,Ru.prototype.toJSON=function(){var data=ji.prototype.toJSON.call(this);return Lu(this.parameters.shapes,data)},ku.prototype=Object.create(ji.prototype),ku.prototype.constructor=ku,Iu.prototype=Object.create(sa.prototype),Iu.prototype.constructor=Iu,ju.prototype=Object.create(ji.prototype),ju.prototype.constructor=ju,Fu.prototype=Object.create(Iu.prototype),Fu.prototype.constructor=Fu,Nu.prototype=Object.create(ju.prototype),Nu.prototype.constructor=Nu,Bu.prototype=Object.create(sa.prototype),Bu.prototype.constructor=Bu,zu.prototype=Object.create(ji.prototype),zu.prototype.constructor=zu;var Vu=Object.freeze({__proto__:null,WireframeGeometry:Cc,ParametricGeometry:Dc,ParametricBufferGeometry:Rc,TetrahedronGeometry:Ic,TetrahedronBufferGeometry:jc,OctahedronGeometry:Fc,OctahedronBufferGeometry:Nc,IcosahedronGeometry:Bc,IcosahedronBufferGeometry:zc,DodecahedronGeometry:Vc,DodecahedronBufferGeometry:Gc,PolyhedronGeometry:Lc,PolyhedronBufferGeometry:kc,TubeGeometry:Hc,TubeBufferGeometry:Uc,TorusKnotGeometry:Wc,TorusKnotBufferGeometry:qc,TorusGeometry:Yc,TorusBufferGeometry:Xc,TextGeometry:Tu,TextBufferGeometry:Mu,SphereGeometry:Su,SphereBufferGeometry:Eu,RingGeometry:Au,RingBufferGeometry:Pu,PlaneGeometry:Aa,PlaneBufferGeometry:Pa,LatheGeometry:Ou,LatheBufferGeometry:Cu,ShapeGeometry:Du,ShapeBufferGeometry:Ru,ExtrudeGeometry:bu,ExtrudeBufferGeometry:_u,EdgesGeometry:ku,ConeGeometry:Fu,ConeBufferGeometry:Nu,CylinderGeometry:Iu,CylinderBufferGeometry:ju,CircleGeometry:Bu,CircleBufferGeometry:zu,BoxGeometry:ca,BoxBufferGeometry:ua});function Gu(t){mi.call(this),this.type="ShadowMaterial",this.color=new ci(0),this.transparent=!0,this.setValues(t)}function Hu(t){da.call(this,t),this.type="RawShaderMaterial"}function Uu(t){mi.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new ci(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ci(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ke,this.normalScale=new On(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Wu(t){Uu.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearcoat=0,this.clearcoatRoughness=0,this.sheen=null,this.clearcoatNormalScale=new On(1,1),this.clearcoatNormalMap=null,this.transparency=0,this.setValues(t)}function qu(t){mi.call(this),this.type="MeshPhongMaterial",this.color=new ci(16777215),this.specular=new ci(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ci(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ke,this.normalScale=new On(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ut,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Yu(t){qu.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(t)}function Xu(t){mi.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ke,this.normalScale=new On(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Zu(t){mi.call(this),this.type="MeshLambertMaterial",this.color=new ci(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ci(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ut,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Ju(t){mi.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ci(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ke,this.normalScale=new On(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function $u(t){cc.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}Gu.prototype=Object.create(mi.prototype),Gu.prototype.constructor=Gu,Gu.prototype.isShadowMaterial=!0,Gu.prototype.copy=function(source){return mi.prototype.copy.call(this,source),this.color.copy(source.color),this},Hu.prototype=Object.create(da.prototype),Hu.prototype.constructor=Hu,Hu.prototype.isRawShaderMaterial=!0,Uu.prototype=Object.create(mi.prototype),Uu.prototype.constructor=Uu,Uu.prototype.isMeshStandardMaterial=!0,Uu.prototype.copy=function(source){return mi.prototype.copy.call(this,source),this.defines={STANDARD:""},this.color.copy(source.color),this.roughness=source.roughness,this.metalness=source.metalness,this.map=source.map,this.lightMap=source.lightMap,this.lightMapIntensity=source.lightMapIntensity,this.aoMap=source.aoMap,this.aoMapIntensity=source.aoMapIntensity,this.emissive.copy(source.emissive),this.emissiveMap=source.emissiveMap,this.emissiveIntensity=source.emissiveIntensity,this.bumpMap=source.bumpMap,this.bumpScale=source.bumpScale,this.normalMap=source.normalMap,this.normalMapType=source.normalMapType,this.normalScale.copy(source.normalScale),this.displacementMap=source.displacementMap,this.displacementScale=source.displacementScale,this.displacementBias=source.displacementBias,this.roughnessMap=source.roughnessMap,this.metalnessMap=source.metalnessMap,this.alphaMap=source.alphaMap,this.envMap=source.envMap,this.envMapIntensity=source.envMapIntensity,this.refractionRatio=source.refractionRatio,this.wireframe=source.wireframe,this.wireframeLinewidth=source.wireframeLinewidth,this.wireframeLinecap=source.wireframeLinecap,this.wireframeLinejoin=source.wireframeLinejoin,this.skinning=source.skinning,this.morphTargets=source.morphTargets,this.morphNormals=source.morphNormals,this},Wu.prototype=Object.create(Uu.prototype),Wu.prototype.constructor=Wu,Wu.prototype.isMeshPhysicalMaterial=!0,Wu.prototype.copy=function(source){return Uu.prototype.copy.call(this,source),this.defines={STANDARD:"",PHYSICAL:""},this.reflectivity=source.reflectivity,this.clearcoat=source.clearcoat,this.clearcoatRoughness=source.clearcoatRoughness,source.sheen?this.sheen=(this.sheen||new ci).copy(source.sheen):this.sheen=null,this.clearcoatNormalMap=source.clearcoatNormalMap,this.clearcoatNormalScale.copy(source.clearcoatNormalScale),this.transparency=source.transparency,this},qu.prototype=Object.create(mi.prototype),qu.prototype.constructor=qu,qu.prototype.isMeshPhongMaterial=!0,qu.prototype.copy=function(source){return mi.prototype.copy.call(this,source),this.color.copy(source.color),this.specular.copy(source.specular),this.shininess=source.shininess,this.map=source.map,this.lightMap=source.lightMap,this.lightMapIntensity=source.lightMapIntensity,this.aoMap=source.aoMap,this.aoMapIntensity=source.aoMapIntensity,this.emissive.copy(source.emissive),this.emissiveMap=source.emissiveMap,this.emissiveIntensity=source.emissiveIntensity,this.bumpMap=source.bumpMap,this.bumpScale=source.bumpScale,this.normalMap=source.normalMap,this.normalMapType=source.normalMapType,this.normalScale.copy(source.normalScale),this.displacementMap=source.displacementMap,this.displacementScale=source.displacementScale,this.displacementBias=source.displacementBias,this.specularMap=source.specularMap,this.alphaMap=source.alphaMap,this.envMap=source.envMap,this.combine=source.combine,this.reflectivity=source.reflectivity,this.refractionRatio=source.refractionRatio,this.wireframe=source.wireframe,this.wireframeLinewidth=source.wireframeLinewidth,this.wireframeLinecap=source.wireframeLinecap,this.wireframeLinejoin=source.wireframeLinejoin,this.skinning=source.skinning,this.morphTargets=source.morphTargets,this.morphNormals=source.morphNormals,this},Yu.prototype=Object.create(qu.prototype),Yu.prototype.constructor=Yu,Yu.prototype.isMeshToonMaterial=!0,Yu.prototype.copy=function(source){return qu.prototype.copy.call(this,source),this.gradientMap=source.gradientMap,this},Xu.prototype=Object.create(mi.prototype),Xu.prototype.constructor=Xu,Xu.prototype.isMeshNormalMaterial=!0,Xu.prototype.copy=function(source){return mi.prototype.copy.call(this,source),this.bumpMap=source.bumpMap,this.bumpScale=source.bumpScale,this.normalMap=source.normalMap,this.normalMapType=source.normalMapType,this.normalScale.copy(source.normalScale),this.displacementMap=source.displacementMap,this.displacementScale=source.displacementScale,this.displacementBias=source.displacementBias,this.wireframe=source.wireframe,this.wireframeLinewidth=source.wireframeLinewidth,this.skinning=source.skinning,this.morphTargets=source.morphTargets,this.morphNormals=source.morphNormals,this},Zu.prototype=Object.create(mi.prototype),Zu.prototype.constructor=Zu,Zu.prototype.isMeshLambertMaterial=!0,Zu.prototype.copy=function(source){return mi.prototype.copy.call(this,source),this.color.copy(source.color),this.map=source.map,this.lightMap=source.lightMap,this.lightMapIntensity=source.lightMapIntensity,this.aoMap=source.aoMap,this.aoMapIntensity=source.aoMapIntensity,this.emissive.copy(source.emissive),this.emissiveMap=source.emissiveMap,this.emissiveIntensity=source.emissiveIntensity,this.specularMap=source.specularMap,this.alphaMap=source.alphaMap,this.envMap=source.envMap,this.combine=source.combine,this.reflectivity=source.reflectivity,this.refractionRatio=source.refractionRatio,this.wireframe=source.wireframe,this.wireframeLinewidth=source.wireframeLinewidth,this.wireframeLinecap=source.wireframeLinecap,this.wireframeLinejoin=source.wireframeLinejoin,this.skinning=source.skinning,this.morphTargets=source.morphTargets,this.morphNormals=source.morphNormals,this},Ju.prototype=Object.create(mi.prototype),Ju.prototype.constructor=Ju,Ju.prototype.isMeshMatcapMaterial=!0,Ju.prototype.copy=function(source){return mi.prototype.copy.call(this,source),this.defines={MATCAP:""},this.color.copy(source.color),this.matcap=source.matcap,this.map=source.map,this.bumpMap=source.bumpMap,this.bumpScale=source.bumpScale,this.normalMap=source.normalMap,this.normalMapType=source.normalMapType,this.normalScale.copy(source.normalScale),this.displacementMap=source.displacementMap,this.displacementScale=source.displacementScale,this.displacementBias=source.displacementBias,this.alphaMap=source.alphaMap,this.skinning=source.skinning,this.morphTargets=source.morphTargets,this.morphNormals=source.morphNormals,this},$u.prototype=Object.create(cc.prototype),$u.prototype.constructor=$u,$u.prototype.isLineDashedMaterial=!0,$u.prototype.copy=function(source){return cc.prototype.copy.call(this,source),this.scale=source.scale,this.dashSize=source.dashSize,this.gapSize=source.gapSize,this};var Ku=Object.freeze({__proto__:null,ShadowMaterial:Gu,SpriteMaterial:ks,RawShaderMaterial:Hu,ShaderMaterial:da,PointsMaterial:bc,MeshPhysicalMaterial:Wu,MeshStandardMaterial:Uu,MeshPhongMaterial:qu,MeshToonMaterial:Yu,MeshNormalMaterial:Xu,MeshLambertMaterial:Zu,MeshDepthMaterial:ds,MeshDistanceMaterial:ps,MeshBasicMaterial:vi,MeshMatcapMaterial:Ju,LineDashedMaterial:$u,LineBasicMaterial:cc,Material:mi}),Qu={arraySlice:function(t,e,n){return Qu.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(object){return ArrayBuffer.isView(object)&&!(object instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,n=new Array(e),i=0;i!==e;++i)n[i]=i;return n.sort((function(i,e){return t[i]-t[e]})),n},sortedArray:function(t,e,n){for(var r=t.length,o=new t.constructor(r),i=0,c=0;c!==r;++i)for(var l=n[i]*e,h=0;h!==e;++h)o[c++]=t[l+h];return o},flattenJSON:function(t,e,n,r){for(var i=1,o=t[0];void 0!==o&&void 0===o[r];)o=t[i++];if(void 0!==o){var c=o[r];if(void 0!==c)if(Array.isArray(c))do{void 0!==(c=o[r])&&(e.push(o.time),n.push.apply(n,c)),o=t[i++]}while(void 0!==o);else if(void 0!==c.toArray)do{void 0!==(c=o[r])&&(e.push(o.time),c.toArray(n,n.length)),o=t[i++]}while(void 0!==o);else do{void 0!==(c=o[r])&&(e.push(o.time),n.push(c)),o=t[i++]}while(void 0!==o)}},subclip:function(t,e,n,r,o){o=o||30;var c=t.clone();c.name=e;for(var l=[],i=0;i=r)){f.push(track.times[m]);for(var y=0;yc.tracks[i].times[0]&&(_=c.tracks[i].times[0]);for(i=0;i=o)break t;var h=e[1];t=(o=e[--n-1]))break e}c=n,n=0}for(;n>>1;te;)--c;if(++c,0!==o||c!==r){o>=c&&(o=(c=Math.max(c,1))-1);var l=this.getValueSize();this.times=Qu.arraySlice(n,o,c),this.values=Qu.arraySlice(this.values,o*l,c*l)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,r=this.values,o=n.length;0===o&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var c=null,i=0;i!==o;i++){var l=n[i];if("number"==typeof l&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,i,l),t=!1;break}if(null!==c&&c>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,i,l,c),t=!1;break}c=l}if(void 0!==r&&Qu.isTypedArray(r)){i=0;for(var h=r.length;i!==h;++i){var f=r[i];if(isNaN(f)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,i,f),t=!1;break}}}return t},optimize:function(){for(var t=this.times,e=this.values,n=this.getValueSize(),r=this.getInterpolation()===Ie,o=1,c=t.length-1,i=1;i0){t[o]=t[c];for(y=c*n,_=o*n,m=0;m!==n;++m)e[_+m]=e[y+m];++o}return o!==t.length&&(this.times=Qu.arraySlice(t,0,o),this.values=Qu.arraySlice(e,0,o*n)),this},clone:function(){var t=Qu.arraySlice(this.times,0),e=Qu.arraySlice(this.values,0),track=new(0,this.constructor)(this.name,t,e);return track.createInterpolant=this.createInterpolant,track}}),al.prototype=Object.assign(Object.create(il.prototype),{constructor:al,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Le,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),sl.prototype=Object.assign(Object.create(il.prototype),{constructor:sl,ValueTypeName:"color"}),cl.prototype=Object.assign(Object.create(il.prototype),{constructor:cl,ValueTypeName:"number"}),ll.prototype=Object.assign(Object.create(tl.prototype),{constructor:ll,interpolate_:function(t,e,n,r){for(var o=this.resultBuffer,c=this.sampleValues,l=this.valueSize,h=t*l,f=(n-e)/(r-e),d=h+l;h!==d;h+=4)Cn.slerpFlat(o,0,c,h-l,c,h,f);return o}}),hl.prototype=Object.assign(Object.create(il.prototype),{constructor:hl,ValueTypeName:"quaternion",DefaultInterpolation:ke,InterpolantFactoryMethodLinear:function(t){return new ll(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),fl.prototype=Object.assign(Object.create(il.prototype),{constructor:fl,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Le,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),pl.prototype=Object.assign(Object.create(il.prototype),{constructor:pl,ValueTypeName:"vector"}),Object.assign(ml,{parse:function(t){for(var e=[],n=t.tracks,r=1/(t.fps||1),i=0,o=n.length;i!==o;++i)e.push(vl(n[i]).scale(r));return new ml(t.name,t.duration,e)},toJSON:function(t){for(var e=[],n=t.tracks,r={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid},i=0,o=n.length;i!==o;++i)e.push(il.toJSON(n[i]));return r},CreateFromMorphTargetSequence:function(t,e,n,r){for(var o=e.length,c=[],i=0;i1){var h=r[d=l[1]];h||(r[d]=h=[]),h.push(c)}}var f=[];for(var d in r)f.push(ml.CreateFromMorphTargetSequence(d,r[d],e,n));return f},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,r,o){if(0!==n.length){var c=[],l=[];Qu.flattenJSON(n,c,l,r),0!==c.length&&o.push(new t(e,c,l))}},r=[],o=t.name||"default",c=t.length||-1,l=t.fps||30,h=t.hierarchy||[],f=0;f0||0===t.search(/^data\:image\/jpeg/);o.format=n?Qt:te,o.needsUpdate=!0,void 0!==e&&e(o)}),n,r),o}}),Object.assign(Ol.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(u,t){var e=this.getUtoTmapping(u);return this.getPoint(e,t)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,p,n=[],r=this.getPoint(0),o=0;for(n.push(0),p=1;p<=t;p++)o+=(e=this.getPoint(p/t)).distanceTo(r),n.push(o),r=e;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(u,t){var e,n=this.getLengths(),i=0,r=n.length;e=t||u*n[r-1];for(var o,c=0,l=r-1;c<=l;)if((o=n[i=Math.floor(c+(l-c)/2)]-e)<0)c=i+1;else{if(!(o>0)){l=i;break}l=i-1}if(n[i=l]===e)return i/(r-1);var h=n[i];return(i+(e-h)/(n[i+1]-h))/(r-1)},getTangent:function(t){var e=t-1e-4,n=t+1e-4;e<0&&(e=0),n>1&&(n=1);var r=this.getPoint(e);return this.getPoint(n).clone().sub(r).normalize()},getTangentAt:function(u){var t=this.getUtoTmapping(u);return this.getTangent(t)},computeFrenetFrames:function(t,e){var i,u,n,r=new Ln,o=[],c=[],l=[],h=new Ln,f=new Jn;for(i=0;i<=t;i++)u=i/t,o[i]=this.getTangentAt(u),o[i].normalize();c[0]=new Ln,l[0]=new Ln;var d=Number.MAX_VALUE,m=Math.abs(o[0].x),v=Math.abs(o[0].y),y=Math.abs(o[0].z);for(m<=d&&(d=m,r.set(1,0,0)),v<=d&&(d=v,r.set(0,1,0)),y<=d&&r.set(0,0,1),h.crossVectors(o[0],r).normalize(),c[0].crossVectors(o[0],h),l[0].crossVectors(o[0],c[0]),i=1;i<=t;i++)c[i]=c[i-1].clone(),l[i]=l[i-1].clone(),h.crossVectors(o[i-1],o[i]),h.length()>Number.EPSILON&&(h.normalize(),n=Math.acos(Pn.clamp(o[i-1].dot(o[i]),-1,1)),c[i].applyMatrix4(f.makeRotationAxis(h,n))),l[i].crossVectors(o[i],c[i]);if(!0===e)for(n=Math.acos(Pn.clamp(c[0].dot(c[t]),-1,1)),n/=t,o[0].dot(h.crossVectors(c[0],c[t]))>0&&(n=-n),i=1;i<=t;i++)c[i].applyMatrix4(f.makeRotationAxis(o[i],n*i)),l[i].crossVectors(o[i],c[i]);return{tangents:o,normals:c,binormals:l}},clone:function(){return(new this.constructor).copy(this)},copy:function(source){return this.arcLengthDivisions=source.arcLengthDivisions,this},toJSON:function(){var data={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return data.arcLengthDivisions=this.arcLengthDivisions,data.type=this.type,data},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),Cl.prototype=Object.create(Ol.prototype),Cl.prototype.constructor=Cl,Cl.prototype.isEllipseCurve=!0,Cl.prototype.getPoint=function(t,e){for(var n=e||new On,r=2*Math.PI,o=this.aEndAngle-this.aStartAngle,c=Math.abs(o)r;)o-=r;o0?0:(Math.floor(Math.abs(d)/f)+1)*f:0===m&&d===f-1&&(d=f-2,m=1),this.closed||d>0?n=h[(d-1)%f]:(Ll.subVectors(h[0],h[1]).add(h[0]),n=Ll),r=h[d%f],o=h[(d+1)%f],this.closed||d+2r.length-2?r.length-1:o+1],d=r[o>r.length-3?r.length-1:o+2];return n.set(Nl(c,l.x,h.x,f.x,d.x),Nl(c,l.y,h.y,f.y,d.y)),n},Yl.prototype.copy=function(source){Ol.prototype.copy.call(this,source),this.points=[];for(var i=0,t=source.points.length;i=e){var r=n[i]-e,o=this.curves[i],c=o.getLength(),u=0===c?0:1-r/c;return o.getPointAt(u)}i++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.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 t=[],e=0,i=0,n=this.curves.length;i1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(source){Ol.prototype.copy.call(this,source),this.curves=[];for(var i=0,t=source.curves.length;i0){var d=f.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(f);var m=f.getPoint(1);return this.currentPoint.copy(m),this},copy:function(source){return Zl.prototype.copy.call(this,source),this.currentPoint.copy(source.currentPoint),this},toJSON:function(){var data=Zl.prototype.toJSON.call(this);return data.currentPoint=this.currentPoint.toArray(),data},fromJSON:function(t){return Zl.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),$l.prototype=Object.assign(Object.create(Jl.prototype),{constructor:$l,getPointsHoles:function(t){for(var e=[],i=0,n=this.holes.length;i0){var c=new El(new yl(e));c.setCrossOrigin(this.crossOrigin);for(var i=0,l=t.length;i0?new Ks(o,c):new ta(o,c);break;case"InstancedMesh":o=n(data.geometry),c=r(data.material);var l=data.count,h=data.instanceMatrix;(object=new sc(o,c,l)).instanceMatrix=new gi(new Float32Array(h.array),16);break;case"LOD":object=new $s;break;case"Line":object=new pc(n(data.geometry),r(data.material),data.mode);break;case"LineLoop":object=new yc(n(data.geometry),r(data.material));break;case"LineSegments":object=new gc(n(data.geometry),r(data.material));break;case"PointCloud":case"Points":object=new Mc(n(data.geometry),r(data.material));break;case"Sprite":object=new Ys(r(data.material));break;case"Group":object=new xs;break;default:object=new vr}if(object.uuid=data.uuid,void 0!==data.name&&(object.name=data.name),void 0!==data.matrix?(object.matrix.fromArray(data.matrix),void 0!==data.matrixAutoUpdate&&(object.matrixAutoUpdate=data.matrixAutoUpdate),object.matrixAutoUpdate&&object.matrix.decompose(object.position,object.quaternion,object.scale)):(void 0!==data.position&&object.position.fromArray(data.position),void 0!==data.rotation&&object.rotation.fromArray(data.rotation),void 0!==data.quaternion&&object.quaternion.fromArray(data.quaternion),void 0!==data.scale&&object.scale.fromArray(data.scale)),void 0!==data.castShadow&&(object.castShadow=data.castShadow),void 0!==data.receiveShadow&&(object.receiveShadow=data.receiveShadow),data.shadow&&(void 0!==data.shadow.bias&&(object.shadow.bias=data.shadow.bias),void 0!==data.shadow.radius&&(object.shadow.radius=data.shadow.radius),void 0!==data.shadow.mapSize&&object.shadow.mapSize.fromArray(data.shadow.mapSize),void 0!==data.shadow.camera&&(object.shadow.camera=this.parseObject(data.shadow.camera))),void 0!==data.visible&&(object.visible=data.visible),void 0!==data.frustumCulled&&(object.frustumCulled=data.frustumCulled),void 0!==data.renderOrder&&(object.renderOrder=data.renderOrder),void 0!==data.userData&&(object.userData=data.userData),void 0!==data.layers&&(object.layers.mask=data.layers),void 0!==data.drawMode&&object.setDrawMode(data.drawMode),void 0!==data.children)for(var f=data.children,i=0;iNumber.EPSILON){if(h<0&&(o=e[q],l=-l,c=e[p],h=-h),t.yc.y)continue;if(t.y===o.y){if(t.x===o.x)return!0}else{var f=h*(t.x-o.x)-l*(t.y-o.y);if(0===f)return!0;if(f<0)continue;r=!r}}else{if(t.y!==o.y)continue;if(c.x<=t.x&&t.x<=o.x||o.x<=t.x&&t.x<=c.x)return!0}}return r}var o=vu.isClockWise,c=this.subPaths;if(0===c.length)return[];if(!0===e)return n(c);var l,h,f,d=[];if(1===c.length)return h=c[0],(f=new $l).curves=h.curves,d.push(f),d;var m=!o(c[0].getPoints());m=t?!m:m;var v,y,_=[],x=[],w=[],T=0;x[T]=void 0,w[T]=[];for(var i=0,M=c.length;i1){for(var S=!1,E=[],A=0,P=x.length;A0&&(S||(w=_))}i=0;for(var k=x.length;i0){this.source.connect(this.filters[0]);for(var i=1,t=this.filters.length;i0){this.source.disconnect(this.filters[0]);for(var i=1,t=this.filters.length;i=.5)for(var i=0;i!==o;++i)t[e+i]=t[n+i]},_slerp:function(t,e,n,r){Cn.slerpFlat(t,e,t,e,t,n,r)},_lerp:function(t,e,n,r,o){for(var s=1-r,i=0;i!==o;++i){var c=e+i;t[c]=t[c]*s+t[n+i]*r}}});var Jh=new RegExp("[\\[\\]\\.:\\/]","g"),$h="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Kh=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Qh=/(WCOD+)?/.source.replace("WCOD",$h),tf=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),ef=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),nf=new RegExp("^"+Kh+Qh+tf+ef+"$"),rf=["material","materials","bones"];function af(t,path,e){var n=e||of.parseTrackName(path);this._targetGroup=t,this._bindings=t.subscribe_(path,n)}function of(t,path,e){this.path=path,this.parsedPath=e||of.parseTrackName(path),this.node=of.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function sf(){this.uuid=Pn.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var i=0,e=arguments.length;i!==e;++i)t[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}function cf(t,e,n){this._mixer=t,this._clip=e,this._localRoot=n||null;for(var r=e.tracks,o=r.length,c=new Array(o),l={endingStart:je,endingEnd:je},i=0;i!==o;++i){var h=r[i].createInterpolant(null);c[i]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=c,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=De,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 uf(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function lf(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function hf(t,e,n){Rs.call(this,t,e),this.meshPerAttribute=n||1}function ff(t,e,n,r){this.ray=new Hr(t,e),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 df(a,b){return a.distance-b.distance}function pf(object,t,e,n){if(!1!==object.visible&&(object.raycast(t,e),!0===n))for(var r=object.children,i=0,o=r.length;i=e){var f=e++,d=t[f];n[d.uuid]=h,t[h]=d,n[l]=f,t[f]=object;for(var m=0,v=o;m!==v;++m){var y=r[m],_=y[f],x=y[h];y[h]=_,y[f]=x}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,r=this._indicesByUUID,o=this._bindings,c=o.length,i=0,l=arguments.length;i!==l;++i){var object=arguments[i],h=object.uuid,f=r[h];if(void 0!==f)if(delete r[h],f0)for(var h=this._interpolants,f=this._propertyBindings,d=0,m=h.length;d!==m;++d)h[d].evaluate(c),f[d].accumulate(n,l)}else this._updateWeight(time)},_updateWeight:function(time){var t=0;if(this.enabled){t=this.weight;var e=this._weightInterpolant;if(null!==e){var n=e.evaluate(time)[0];t*=n,time>e.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(time){var t=0;if(!this.paused){t=this.timeScale;var e=this._timeScaleInterpolant;if(null!==e)t*=e.evaluate(time)[0],time>e.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t,t},_updateTime:function(t){var time=this.time+t,e=this._clip.duration,n=this.loop,r=this._loopCount,o=n===Re;if(0===t)return-1===r?time:o&&1==(1&r)?e-time:time;if(n===Ce){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(time>=e)time=e;else{if(!(time<0)){this.time=time;break t}time=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=time,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),time>=e||time<0){var c=Math.floor(time/e);time-=e*c,r+=Math.abs(c);var l=this.repetitions-r;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,time=t>0?e:0,this.time=time,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===l){var h=t<0;this._setEndings(h,!h,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=time,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:c})}}else this.time=time;if(o&&1==(1&r))return e-time}return time},_setEndings:function(t,e,n){var r=this._interpolantSettings;n?(r.endingStart=Fe,r.endingEnd=Fe):(r.endingStart=t?this.zeroSlopeAtStart?Fe:je:Ne,r.endingEnd=e?this.zeroSlopeAtEnd?Fe:je:Ne)},_scheduleFading:function(t,e,n){var r=this._mixer,o=r.time,c=this._weightInterpolant;null===c&&(c=r._lendControlInterpolant(),this._weightInterpolant=c);var l=c.parameterPositions,h=c.sampleValues;return l[0]=o,h[0]=e,l[1]=o+t,h[1]=n,this}}),uf.prototype=Object.assign(Object.create(En.prototype),{constructor:uf,_bindAction:function(t,e){var n=t._localRoot||this._root,r=t._clip.tracks,o=r.length,c=t._propertyBindings,l=t._interpolants,h=n.uuid,f=this._bindingsByRootAndName,d=f[h];void 0===d&&(d={},f[h]=d);for(var i=0;i!==o;++i){var track=r[i],m=track.name,v=d[m];if(void 0!==v)c[i]=v;else{if(void 0!==(v=c[i])){null===v._cacheIndex&&(++v.referenceCount,this._addInactiveBinding(v,h,m));continue}var path=e&&e._propertyBindings[i].binding.parsedPath;++(v=new Zh(of.create(n,m,path),track.ValueTypeName,track.getValueSize())).referenceCount,this._addInactiveBinding(v,h,m),c[i]=v}l[i].resultBuffer=v.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,r=this._actionsByClip[n];this._bindAction(t,r&&r.knownActions[0]),this._addInactiveAction(t,n,e)}for(var o=t._propertyBindings,i=0,c=o.length;i!==c;++i){var l=o[i];0==l.useCount++&&(this._lendBinding(l),l.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,i=0,n=e.length;i!==n;++i){var r=e[i];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&ethis.max.x||t.ythis.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new On),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new On),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return gf.copy(t).clamp(this.min,this.max).sub(t).length()},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var bf=new Ln,_f=new Ln;function xf(t,e){this.start=void 0!==t?t:new Ln,this.end=void 0!==e?e:new Ln}function wf(t){vr.call(this),this.material=t,this.render=function(){}}Object.assign(xf.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(line){return this.start.copy(line.start),this.end.copy(line.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new Ln),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new Ln),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new Ln),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,e){bf.subVectors(t,this.start),_f.subVectors(this.end,this.start);var n=_f.dot(_f),r=_f.dot(bf)/n;return e&&(r=Pn.clamp(r,0,1)),r},closestPointToPoint:function(t,e,n){var r=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Ln),this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(line){return line.start.equals(this.start)&&line.end.equals(this.end)}}),wf.prototype=Object.create(vr.prototype),wf.prototype.constructor=wf,wf.prototype.isImmediateRenderObject=!0;var Tf=new Ln,Mf=new Ln,Sf=new jn,Ef=["a","b","c"];function Af(object,t,e,n){this.object=object,this.size=void 0!==t?t:1;var r=void 0!==e?e:16711680,o=void 0!==n?n:1,c=0,l=this.object.geometry;l&&l.isGeometry?c=3*l.faces.length:l&&l.isBufferGeometry&&(c=l.attributes.normal.count);var h=new ji,f=new Si(2*c*3,3);h.setAttribute("position",f),gc.call(this,h,new cc({color:r,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}Af.prototype=Object.create(gc.prototype),Af.prototype.constructor=Af,Af.prototype.update=function(){this.object.updateMatrixWorld(!0),Sf.getNormalMatrix(this.object.matrixWorld);var t=this.object.matrixWorld,e=this.geometry.attributes.position,n=this.object.geometry;if(n&&n.isGeometry)for(var r=n.vertices,o=n.faces,c=0,i=0,l=o.length;i1&&t.multiplyScalar(1/e),this.children[0].material.color.copy(this.material.color)}},If.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()};var jf=new Ln,Ff=new ci,Nf=new ci;function Bf(t,e,n){vr.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var r=new Nc(e);r.rotateY(.5*Math.PI),this.material=new vi({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=C);var o=r.getAttribute("position"),c=new Float32Array(3*o.count);r.setAttribute("color",new gi(c,3)),this.add(new ta(r,this.material)),this.update()}function zf(t,e){this.lightProbe=t,this.size=e;var n={GAMMA_OUTPUT:""},r=new da({defines:n,uniforms:{sh:{value:this.lightProbe.sh.coefficients},intensity:{value:this.lightProbe.intensity}},vertexShader:["varying vec3 vNormal;","void main() {","\tvNormal = normalize( normalMatrix * normal );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define RECIPROCAL_PI 0.318309886","vec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {","\t// matrix is assumed to be orthogonal","\treturn normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );","}","vec3 linearToOutput( in vec3 a ) {","\t#ifdef GAMMA_OUTPUT","\t\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );","\t#else","\t\treturn a;","\t#endif","}","// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf","vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {","\t// normal is assumed to have unit length","\tfloat x = normal.x, y = normal.y, z = normal.z;","\t// band 0","\tvec3 result = shCoefficients[ 0 ] * 0.886227;","\t// band 1","\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;","\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;","\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;","\t// band 2","\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;","\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;","\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );","\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;","\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );","\treturn result;","}","uniform vec3 sh[ 9 ]; // sh coefficients","uniform float intensity; // light probe intensity","varying vec3 vNormal;","void main() {","\tvec3 normal = normalize( vNormal );","\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );","\tvec3 irradiance = shGetIrradianceAt( worldNormal, sh );","\tvec3 outgoingLight = RECIPROCAL_PI * irradiance * intensity;","\toutgoingLight = linearToOutput( outgoingLight );","\tgl_FragColor = vec4( outgoingLight, 1.0 );","}"].join("\n")}),o=new Eu(1,32,16);ta.call(this,o,r),this.onBeforeRender()}function Vf(t,e,n,r){t=t||10,e=e||10,n=new ci(void 0!==n?n:4473924),r=new ci(void 0!==r?r:8947848);for(var o=e/2,c=t/e,l=t/2,h=[],f=[],i=0,d=0,m=-l;i<=e;i++,m+=c){h.push(-l,0,m,l,0,m),h.push(m,0,-l,m,0,l);var v=i===o?n:r;v.toArray(f,d),d+=3,v.toArray(f,d),d+=3,v.toArray(f,d),d+=3,v.toArray(f,d),d+=3}var y=new ji;y.setAttribute("position",new Si(h,3)),y.setAttribute("color",new Si(f,3));var _=new cc({vertexColors:C});gc.call(this,y,_)}function Gf(t,e,n,r,o,c){t=t||10,e=e||16,n=n||8,r=r||64,o=new ci(void 0!==o?o:4473924),c=new ci(void 0!==c?c:8947848);var l,h,f,i,d,m,v,y=[],_=[];for(i=0;i<=e;i++)f=i/e*(2*Math.PI),l=Math.sin(f)*t,h=Math.cos(f)*t,y.push(0,0,0),y.push(l,0,h),v=1&i?o:c,_.push(v.r,v.g,v.b),_.push(v.r,v.g,v.b);for(i=0;i<=n;i++)for(v=1&i?o:c,m=t-t/n*i,d=0;d.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{ud.set(t.z,0,-t.x).normalize();var e=Math.acos(t.y);this.quaternion.setFromAxisAngle(ud,e)}},ld.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},ld.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},ld.prototype.copy=function(source){return vr.prototype.copy.call(this,source,!1),this.line.copy(source.line),this.cone.copy(source.cone),this},ld.prototype.clone=function(){return(new this.constructor).copy(this)},hd.prototype=Object.create(gc.prototype),hd.prototype.constructor=hd;var pd=0,md=1;function vd(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t}function gd(t){return void 0===t&&(t=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,t.materials=t,t.clone=function(){return t.slice()},t}function yd(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Mc(t,e)}function bd(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Ys(t)}function _d(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Mc(t,e)}function xd(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new bc(t)}function wd(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new bc(t)}function Td(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new bc(t)}function Md(t,e,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new Ln(t,e,n)}function Sd(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new gi(t,e).setDynamic(!0)}function Ed(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new yi(t,e)}function Ad(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new bi(t,e)}function Pd(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new _i(t,e)}function Od(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new xi(t,e)}function Cd(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new wi(t,e)}function Dd(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Ti(t,e)}function Rd(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Mi(t,e)}function Ld(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Si(t,e)}function kd(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Ei(t,e)}function Id(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Fl.call(this,t),this.type="catmullrom",this.closed=!0}function jd(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Fl.call(this,t),this.type="catmullrom"}function Fd(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Fl.call(this,t),this.type="catmullrom"}function Nd(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new hd(t)}function Bd(object,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new id(object,t)}function zd(object,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new gc(new ku(object.geometry),new cc({color:void 0!==t?t:16777215}))}function Vd(object,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new gc(new Cc(object.geometry),new cc({color:void 0!==t?t:16777215}))}function Gd(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new wl(t)}function Hd(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Sl(t)}Ol.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Ol.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(Zl.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new sa,i=0,n=t.length;i0&&void 0!==arguments[0]?arguments[0]:"router-link";return{name:"PrismicLink",functional:!0,props:{field:{type:Object,required:!0}},render:function(e,n){var r=n.props,data=n.data,c=n.children,l=n.parent,h=r.field;if(!h)return null;var f="nuxt-link"===t?l.$prismic.asLink(h):o.a.Link.url(h,l.$prismic.linkResolver);return["Link.Document","Document"].includes(h.link_type)?(data.props=data.props||{},data.props.to=f,e(t,data,c)):(data.attrs=d({},data.attrs,{href:f},h.target&&{target:h.target,rel:"noopener"}),e("a",data,c))}}},y={common:{Embed:{name:"PrismicEmbed",functional:!0,props:{field:{type:Object,required:!0},wrapper:{type:String,required:!1,default:"div"}},render:function(t,e){var n=e.props,data=e.data,r=n.field,o=n.wrapper;if(!r||!r.html)return null;var c=r.embed_url,l=r.type,h=r.provider_name,f=d({},data.attrs,{},c&&{"data-oembed":c},{},l&&{"data-oembed-type":l},{},h&&{"data-oembed-provider":h});return t(o,d({},Object.assign(data,{attrs:f}),{domProps:{innerHTML:r.html}}))}},Image:{name:"PrismicImage",functional:!0,props:{field:{type:Object,required:!0}},render:function(t,e){var n=e.props,data=e.data,r=n.field,o=r.url,c=r.alt,l=r.copyright;return t("img",Object.assign(data,{attrs:d({},data.attrs,{src:o,alt:c,copyright:l})}))}},RichText:{name:"PrismicRichText",functional:!0,props:{field:{type:Array,required:!0},htmlSerializer:{type:Function,required:!1},wrapper:{type:String,required:!1,default:"div"}},render:function(t,e){var n=e.props,data=e.data,o=(e.children,e.parent),c=n.field,l=n.htmlSerializer;return t(n.wrapper,d({},data,{domProps:{innerHTML:r.RichText.asHtml(c,o.$prismic.linkResolver,l||o.$prismic.htmlSerializer)}}))}}},nuxt:{Link:v("nuxt-link","PrismicNuxtLink")},vueRouter:{Link:v()}};function _(t,e){return t?o.a.RichText.asText(t,e):""}function x(t){if(t)return o.a.Date(t)}function w(t,e){t.prototype.$prismic.asHtml=function(t,n,r){return function(t,e,n){if(t)return o.a.RichText.asHtml(t,e,n)}(t,n||e.linkResolver,r||e.htmlSerializer)},t.prototype.$prismic.asText=_,t.prototype.$prismic.richTextAsPlain=_,t.prototype.$prismic.asDate=x,t.prototype.$prismic.asLink=function(link,t){return function(link,t){if(link)return o.a.Link.url(link,t)}(link,t||e.linkResolver)}}var T={install:function(t,e){console.log(e);var n=e.linkType,r=void 0===n?"vueRouter":n;t.prototype.$prismic=l.a,t.prototype.$prismic.endpoint=e.endpoint,t.prototype.$prismic.linkResolver=e.linkResolver,t.prototype.$prismic.htmlSerializer=e.htmlSerializer,t.prototype.$prismic.client=l.a.client(e.endpoint,e.apiOptions),w(t,e);var o=d({},y.common,{},y[r]);Object.entries(o).forEach((function(e){var n=m(e,2),r=(n[0],n[1]);t.component(r.name,r)}))}};e.a=T},143:function(t,e,n){"use strict";function r(t){return parseInt(t,10)}function o(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function c(t,e,n){var r=t.x-e.x,o=t.y-e.y,c=Math.sqrt(r*r+o*o),l=r/c,h=o/c;return{x:e.x+l*n,y:e.y+h*n}}function l(t,e){var n=t.shift();return"M"+n.x+" "+n.y+t.map((function(l,h){var f,d,m,v=t[h+1],y=t[h-1]||n,_=v&&(d=l,m=y,r((f=v).x+m.x)===r(2*d.x)&&r(f.y+m.y)===r(2*d.y));if(!v||_)return"L"+l.x+" "+l.y;var x=Math.min(o(y,l),o(v,l)),w=x/21&&(f=o(t.gradient[0],t.gradient[1],e.length-1));var d=(h-t.barWidth)/2;return e.map((function(e,r){return n("rect",{attrs:{id:"bar-id-"+r,fill:f?f[r]:t.gradient[0]?t.gradient[0]:"#000",x:e.x-d,y:0,width:t.barWidth,height:l-e.y,rx:t.rounding,ry:t.rounding}},[n("animate",{attrs:{attributeName:"height",from:0,to:l-e.y,dur:t.growDuration+"s",fill:"freeze"}}),n("title",{},[e.v])])}))}(this,function(t,e,n){var r=e.minX,o=e.minY,c=e.maxX,l=e.maxY,h=n.max,f=n.min,d=t.map((function(t){return"number"==typeof t?t:t.value})),m=Math.min.apply(Math,d.concat([f]))-.001,v=(c-r)/(d.length-1),y=(l-o)/(Math.max.apply(Math,d.concat([h]))+.001-m);return d.map((function(e,n){var title="number"==typeof t[n]?t[n]:t[n].title;return{x:n*v+r,y:l-(e-m)*y+1e-5*+(n===d.length-1)-1e-5*+(0===n),v:title}}))}(this.data,this.boundary,{max:this.max,min:this.min}),t);return t("g",{attrs:{transform:"scale(1,-1) translate(0,-"+this.boundary.maxY+")"}},e)}},l={name:"Bars",props:{data:{type:Array,required:!0},autoDraw:Boolean,barWidth:{type:Number,default:8},growDuration:{type:Number,default:.5},gradient:{type:Array,default:function(){return["#000"]}},max:{type:Number,default:-1/0},min:{type:Number,default:1/0},height:Number,width:Number,padding:{type:Number,default:8}},render:function(t){if(this.data&&!(this.data.length<2)){var e=this.width,n=this.height,r=this.padding,o=e||300,l=n||75,h={minX:r,minY:r,maxX:o-r,maxY:l-r},f=this.$props;return f.boundary=h,f.id="vue-bars-"+this._uid,t("svg",{attrs:{width:e||"100%",height:n||"25%",viewBox:"0 0 "+o+" "+l}},[t(c,{props:f,ref:"path"})])}},install:function(t){t.component(l.name,l)}};"undefined"!=typeof window&&window.Vue&&window.Vue.use(l),e.a=l},189:function(t,e,n){"use strict";t.exports=function(t,e){return e||(e={}),"string"!=typeof(t=t&&t.__esModule?t.default:t)?t:(/^['"].*['"]$/.test(t)&&(t=t.slice(1,-1)),e.hash&&(t+=e.hash),/["'() \t\n]/.test(t)||e.needQuotes?'"'.concat(t.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):t)}},19:function(t,e,n){t.exports=function(t){function e(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=5)}([function(t,e,n){t.exports=function(t){function e(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=3)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var u=r(n(2)),i=r(n(1));t.exports={Link:u.default,Date:i.default}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if(!t)return null;var e=24==t.length?t.substring(0,22)+":"+t.substring(22,24):t;return new Date(e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={url:function(t,e){return"Document"===t.link_type?e?e(t,t.isBroken):"":t.url}}},function(t,e,n){t.exports=n(0)}])},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}var u=r(n(0)),i=r(n(2));t.exports={Date:u.default.Date,RichText:i.default,Link:u.default.Link}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function a(t,e,n,r,a){switch(e){case p.Elements.heading1:return o("h1",n,a);case p.Elements.heading2:return o("h2",n,a);case p.Elements.heading3:return o("h3",n,a);case p.Elements.heading4:return o("h4",n,a);case p.Elements.heading5:return o("h5",n,a);case p.Elements.heading6:return o("h6",n,a);case p.Elements.paragraph:return o("p",n,a);case p.Elements.preformatted:return function(t){return""+(0,l.default)(t.text)+""}(n);case p.Elements.strong:return o("strong",n,a);case p.Elements.em:return o("em",n,a);case p.Elements.listItem:case p.Elements.oListItem:return o("li",n,a);case p.Elements.list:return o("ul",n,a);case p.Elements.oList:return o("ol",n,a);case p.Elements.image:return function(t,e){var n=e.linkTo?b.Link.url(e.linkTo,t):null,r=e.linkTo&&e.linkTo.target?'target="'+e.linkTo.target+'" rel="noopener"':"",a=[e.label||"","block-img"],u=''+(e.alt||';return'\n

\n '+(n?"'+u+"":u)+"\n

\n "}(t,n);case p.Elements.embed:return function(t){return'\n
\n \n "+t.oembed.html+"\n
\n "}(n);case p.Elements.hyperlink:return function(t,e,n){return"'+n.join("")+""}(t,n,a);case p.Elements.label:return function(t,e){return""+e.join("")+""}(n,a);case p.Elements.span:return function(t){return t?(0,l.default)(t).replace(/\n/g,"
"):""}(r);default:return""}}function u(t){return t.label?' class="'+t.label+'"':""}function o(t,e,n){return"<"+t+u(e)+">"+n.join("")+""}Object.defineProperty(e,"__esModule",{value:!0});var p=n(4),c=r(p),b=n(0),l=r(n(3));e.default={asText:function(t,e){return c.default.asText(t,e)},asHtml:function(t,e,n){return c.default.serialize(t,a.bind(null,e),n).join("")},Elements:p.Elements}},function(t,e,n){"use strict";var a=/["'&<>]/;t.exports=function(t){var e=""+t,n=a.exec(e);if(!n)return e;var r,u="",o=0,i=0;for(o=n.index;o=0;)e=i[n],Object(a.a)(e,t)&&!s(r,e)&&(r[r.length]=e),n-=1;return r}:function(t){return Object(t)!==t?[]:Object.keys(t)},h=Object(r.a)(l);e.a=h},function(t,e,n){"use strict";var r=n(2),a=n(8),u=Object(r.a)(a.a);e.a=u},function(t,e,n){"use strict";e.a=Array.isArray||function(t){return null!=t&&t.length>=0&&"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,n){"use strict";e.a=function(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}},function(t,e,n){"use strict";var r=n(1),a=Object(r.a)((function(t){return function(){return t}}));e.a=a},function(t,e,n){"use strict";var r=n(0),a=Object(r.a)((function(t,e){return e>t?e:t}));e.a=a},function(t,e,n){"use strict";var r=n(0),a=Object(r.a)((function(t,e){for(var n=e,r=0;r=0};var a=n(84)},function(t,e,n){"use strict";var r=n(0),a=n(7),u=n(44),o=Object(r.a)((function(t,e){return Object(a.a)(Object(u.a)(t),e)}));e.a=o},function(t,e,n){"use strict";e.a=function(t){return"[object String]"===Object.prototype.toString.call(t)}},function(t,e,n){"use strict";e.a=function(t,e){return function(){var n=arguments.length;if(0===n)return e();var r=arguments[n-1];return Object(a.a)(r)||"function"!=typeof r[t]?e.apply(this,arguments):r[t].apply(r,Array.prototype.slice.call(arguments,0,n-1))}};var a=n(15)},function(t,e,n){"use strict";var r=n(1),a=n(156),u=Object(r.a)((function(t){return Object(a.a)(t,[])}));e.a=u},function(t,e,n){"use strict";var r=n(0),a=n(22),u=Object(r.a)((function(t,e){var n=t<0?e.length+t:t;return Object(a.a)(e)?e.charAt(n):e[n]}));e.a=u},function(t,e,n){"use strict";var r=n(0),a=n(34),u=n(5),o=n(24),i=Object(r.a)((function(t,e){return Object(u.a)(t+1,(function(){var n=arguments[t];if(null!=n&&Object(a.a)(n[e]))return n[e].apply(n,Array.prototype.slice.call(arguments,0,t));throw new TypeError(Object(o.a)(n)+' does not have a method named "'+e+'"')}))}));e.a=i},function(t,e,n){"use strict";e.a=function(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}},function(t,e,n){"use strict";var r=n(0),a=Object(r.a)((function(t,e){return Number(t)+Number(e)}));e.a=a},function(t,e,n){"use strict";e.a=function t(e,n,r){return function(){for(var o=[],i=0,c=e,s=0;s=arguments.length)?l=n[s]:(l=arguments[i],i+=1),o[s]=l,Object(u.a)(l)||(c-=1),s+=1}return c<=0?r.apply(this,o):Object(a.a)(c,t(e,o,r))}};var a=n(12),u=n(27)},function(t,e,n){"use strict";e.a=function(t,e){for(var n=0,r=e.length,a=Array(r);n0&&t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1))}));e.a=o},function(t,e,n){"use strict";var r=n(2),a=Object(r.a)((function(t,e,n){var r={};for(var a in n)r[a]=n[a];return r[t]=e,r}));e.a=a},function(t,e,n){"use strict";var r=n(0),a=Object(r.a)((function(t,e){switch(t){case 0:return function(){return e.call(this)};case 1:return function(t){return e.call(this,t)};case 2:return function(t,n){return e.call(this,t,n)};case 3:return function(t,n,r){return e.call(this,t,n,r)};case 4:return function(t,n,r,a){return e.call(this,t,n,r,a)};case 5:return function(t,n,r,a,u){return e.call(this,t,n,r,a,u)};case 6:return function(t,n,r,a,u,o){return e.call(this,t,n,r,a,u,o)};case 7:return function(t,n,r,a,u,o,i){return e.call(this,t,n,r,a,u,o,i)};case 8:return function(t,n,r,a,u,o,i,c){return e.call(this,t,n,r,a,u,o,i,c)};case 9:return function(t,n,r,a,u,o,i,c,s){return e.call(this,t,n,r,a,u,o,i,c,s)};case 10:return function(t,n,r,a,u,o,i,c,s,l){return e.call(this,t,n,r,a,u,o,i,c,s,l)};default:throw new Error("First argument to nAry must be a non-negative integer no greater than ten")}}));e.a=a},function(t,e,n){"use strict";e.a=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e,n){"use strict";var r=n(1),a=n(76),u=Object(r.a)((function(t){return Object(a.a)(t.length,t)}));e.a=u},function(t,e,n){"use strict";var r=n(1),a=n(22),u=Object(r.a)((function(t){return Object(a.a)(t)?t.split("").reverse().join(""):Array.prototype.slice.call(t,0).reverse()}));e.a=u},function(t,e,n){"use strict";e.a=function(t,e,n){for(var r=0,a=n.length;re.end?{inner:f.SpanNode.slice(n,n.start,e.end,t),outer:f.SpanNode.slice(n,e.end,n.end,t)}:{inner:n}}(t,e.elected,r);return{inner:u.concat(i.inner),outer:i.outer?o.concat(i.outer):o}}),{inner:[],outer:[]}),r=n.inner,u=n.outer;return[e.elected.setChildren(o(t,r,e.elected.boundaries()))].concat(c(t,u))}function i(t){return function(t,e){return e.reduce((function(e,n){var r=p.last(e);if(r){if(r.some((function(t){return t.isParentOf(n)})))return p.init(e).concat([r.concat(n)]);var a=p.last(r);return a&&t(a,n)?p.init(e).concat([r.concat(n)]):e.concat([[n]])}return[[n]]}),[])}((function(t,e){return t.end>=e.start}),p.sortWith([function(t,e){return t.start-e.start},function(t,e){return t.end-e.end}],t))}function r(t){if(0===t.length)throw new Error("Unable to elect node on empty list");var e=function(t){return t.sort((function(t,e){if(t.isParentOf(e))return-1;if(e.isParentOf(t))return 1;var n=h.PRIORITIES[t.type]-h.PRIORITIES[e.type];return 0===n?t.text.length-e.text.length:n}))}(t);return{elected:e[0],others:e.slice(1)}}function o(t,e,n){if(e.length>0)return function(t,e,n){return e.reduce((function(r,a,u){var o=[],i=0===u&&a.start>n.lower,c=u===e.length-1&&n.upper>a.end;if(i){var s=new f.TextNode(n.lower,a.start,t.slice(n.lower,a.start));o=o.concat(s)}else{var l=e[u-1];if(l&&a.start>l.end){var h=t.slice(l.end,a.start);s=new f.TextNode(l.end,a.start,h),o=o.concat(s)}}return o=o.concat(a),c&&(s=new f.TextNode(a.end,n.upper,t.slice(a.end,n.upper)),o=o.concat(s)),r.concat(o)}),[])}(t,c(t,e),n);var r=t.slice(n.lower,n.upper);return[new f.TextNode(n.lower,n.upper,r)]}function c(t,e){var a=i(p.sortBy((function(t){return t.start}),e)).map(r),n=p.flatten(a.map((function(e){return u(t,e)})));return p.sortBy((function(t){return t.start}),n)}e.__esModule=!0;var p=n(126),l=n(121),b=n(326),h=n(63),f=n(122),d=function(){function t(){}return t.fromRichText=function(t){return{key:l.default(),children:t.reduce((function(t,e,n){if(b.RichTextBlock.isEmbedBlock(e.type)||b.RichTextBlock.isImageBlock(e.type))return t.concat(new f.BlockNode(e.type,e));var r=function(t){var e=t.spans.map((function(e){var n=t.text.slice(e.start,e.end);return new f.SpanNode(e.start,e.end,e.type,n,[],e)})),n={lower:0,upper:t.text.length};return o(t.text,e,n)}(e),a=t[t.length-1];if(b.RichTextBlock.isListItem(e.type)&&a&&a instanceof f.ListBlockNode){var u=new f.ListItemBlockNode(e,r),c=a.addChild(u);return p.init(t).concat(c)}if(b.RichTextBlock.isOrderedListItem(e.type)&&a&&a instanceof f.OrderedListBlockNode){var i=new f.OrderedListItemBlockNode(e,r);return c=a.addChild(i),p.init(t).concat(c)}if(b.RichTextBlock.isListItem(e.type)){u=new f.ListItemBlockNode(e,r);var l=new f.ListBlockNode(b.RichTextBlock.emptyList(),[u]);return t.concat(l)}if(b.RichTextBlock.isOrderedListItem(e.type)){i=new f.OrderedListItemBlockNode(e,r);var s=new f.OrderedListBlockNode(b.RichTextBlock.emptyOrderedList(),[i]);return t.concat(s)}return t.concat(new f.BlockNode(e.type,e,r))}),[])}},t.NODE_TYPES=h.NODE_TYPES,t}();e.default=d},function(t,e,n){"use strict";var r=n(10),a=n(2),u=Object(a.a)((function(t,e,n){if(e>=n.length||e<-n.length)return n;var u=(e<0?n.length:0)+e,o=Object(r.a)(n);return o[u]=t(n[u]),o}));e.a=u},function(t,e,n){"use strict";e.a=function(t){return new a(t)};var a=function(){function t(t){this.f=t}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(t){return t},t.prototype["@@transducer/step"]=function(t,e){return this.f(t,e)},t}()},function(t,e,n){"use strict";var r=n(12),a=n(0),u=Object(a.a)((function(t,e){return Object(r.a)(t.length,(function(){return t.apply(e,arguments)}))}));e.a=u},function(t,e,n){"use strict";var r=n(6),a=Object.prototype.toString;e.a=function(){return"[object Arguments]"===a.call(arguments)?function(t){return"[object Arguments]"===a.call(t)}:function(t){return Object(r.a)("callee",t)}}},function(t,e,n){"use strict";var r=n(0),a=Object(r.a)((function(t,e){return t&&e}));e.a=a},function(t,e,n){"use strict";var r=n(0),a=n(3),u=n(71),o=Object(r.a)(Object(a.a)(["any"],u.a,(function(t,e){for(var n=0;n1){var l=!Object(c.a)(r)&&Object(a.a)(s,r)?r[s]:Object(o.a)(e[1])?[]:{};n=t(Array.prototype.slice.call(e,1),n,l)}if(Object(o.a)(s)&&Object(u.a)(r)){var h=[].concat(r);return h[s]=n,h}return Object(i.a)(s,n,r)}));e.a=s},function(t,e,n){"use strict";var r=n(1),a=Object(r.a)((function(t){return null==t}));e.a=a},function(t,e,n){"use strict";var r=n(0),a=n(8),u=n(45),o=n(5),i=n(7),c=Object(r.a)((function(t,e){var n=Object(o.a)(t,e);return Object(o.a)(t,(function(){return Object(a.a)(u.a,Object(i.a)(n,arguments[0]),Array.prototype.slice.call(arguments,1))}))}));e.a=c},function(t,e,n){"use strict";e.a=function(t){return function e(n){for(var r,u,o,i=[],c=0,s=n.length;c10)throw new Error("Constructor with greater than ten arguments");return 0===t?function(){return new e}:Object(a.a)(Object(u.a)(t,(function(t,n,r,a,u,o,i,c,s,l){switch(arguments.length){case 1:return new e(t);case 2:return new e(t,n);case 3:return new e(t,n,r);case 4:return new e(t,n,r,a);case 5:return new e(t,n,r,a,u);case 6:return new e(t,n,r,a,u,o);case 7:return new e(t,n,r,a,u,o,i);case 8:return new e(t,n,r,a,u,o,i,c);case 9:return new e(t,n,r,a,u,o,i,c,s);case 10:return new e(t,n,r,a,u,o,i,c,s,l)}})))}));e.a=o},function(t,e,n){"use strict";var r=n(0),a=n(30),u=n(5),o=n(18),i=n(21),c=n(14),s=Object(r.a)((function(t,e){return Object(u.a)(Object(c.a)(o.a,0,Object(i.a)("length",e)),(function(){var n=arguments,r=this;return t.apply(r,Object(a.a)((function(t){return t.apply(r,n)}),e))}))}));e.a=s},function(t,e,n){"use strict";var r=n(0),a=Object(r.a)((function(t,e){return null==e||e!=e?t:e}));e.a=a},function(t,e,n){"use strict";var r=n(20),a=n(0),u=Object(a.a)((function(t,e){for(var n=[],a=0,u=t.length;a=0?e.length-t:0,e)}));e.a=u},function(t,e,n){"use strict";var r=n(216),a=n(0),u=Object(a.a)((function(t,e){for(var n,a,u=new r.a,o=[],i=0;i=0;)e=t(n[r],e),r-=1;return e}));e.a=a},function(t,e,n){"use strict";var r=n(0),a=Object(r.a)((function(t,e){var n,r=Number(e),a=0;if(r<0||isNaN(r))throw new RangeError("n must be a non-negative number");for(n=new Array(r);a=t.end},e.prototype.setChildren=function(t){return new e(this.start,this.end,this.type,this.text,t,this.element)},e.slice=function(t,n,r,a){return new e(n,r,t.type,a.slice(n,r),t.children,t.element)},e}(o);e.SpanNode=i;var c=function(t){function e(e,n,r){var a={type:u.NODE_TYPES.span,start:e,end:n,text:r};return t.call(this,e,n,u.NODE_TYPES.span,r,[],a)||this}return r(e,t),e}(i);e.TextNode=c;var s=function(t){function e(e,n,r){return void 0===r&&(r=[]),t.call(this,e,n,r)||this}return r(e,t),e}(o);e.BlockNode=s;var l=function(t){function e(e,n){return t.call(this,u.NODE_TYPES.listItem,e,n)||this}return r(e,t),e}(s);e.ListItemBlockNode=l;var h=function(t){function e(e,n){return t.call(this,u.NODE_TYPES.oListItem,e,n)||this}return r(e,t),e}(s);e.OrderedListItemBlockNode=h;var f=function(t){function e(e,n){return t.call(this,u.NODE_TYPES.oList,e,n)||this}return r(e,t),e.prototype.addChild=function(t){var n=this.children.concat(t);return new e(this.element,n)},e}(s);e.OrderedListBlockNode=f;var p=function(t){function e(e,n){return t.call(this,u.NODE_TYPES.list,e,n)||this}return r(e,t),e.prototype.addChild=function(t){var n=this.children.concat(t);return new e(this.element,n)},e}(s);e.ListBlockNode=p},function(t,e,n){t.exports=n(124)},function(t,e,n){"use strict";e.__esModule=!0;var r=n(125),a=n(64),u=n(327);t.exports={asText:r.default,asTree:a.default.fromRichText,serialize:u.default,Elements:a.default.NODE_TYPES}},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){var n="string"==typeof e?e:" ";return t.map((function(t){return t.text})).join(n)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(127);n.d(e,"F",(function(){return r.a}));var a=n(128);n.d(e,"T",(function(){return a.a}));var u=n(129);n.d(e,"__",(function(){return u.a}));var o=n(28);n.d(e,"add",(function(){return o.a}));var i=n(130);n.d(e,"addIndex",(function(){return i.a}));var c=n(65);n.d(e,"adjust",(function(){return c.a}));var s=n(131);n.d(e,"all",(function(){return s.a}));var l=n(133);n.d(e,"allPass",(function(){return l.a}));var h=n(17);n.d(e,"always",(function(){return h.a}));var f=n(69);n.d(e,"and",(function(){return f.a}));var p=n(70);n.d(e,"any",(function(){return p.a}));var d=n(135);n.d(e,"anyPass",(function(){return d.a}));var b=n(45);n.d(e,"ap",(function(){return b.a}));var m=n(136);n.d(e,"aperture",(function(){return m.a}));var v=n(139);n.d(e,"append",(function(){return v.a}));var y=n(72);n.d(e,"apply",(function(){return y.a}));var _=n(140);n.d(e,"applySpec",(function(){return _.a}));var g=n(141);n.d(e,"applyTo",(function(){return g.a}));var x=n(142);n.d(e,"ascend",(function(){return x.a}));var w=n(32);n.d(e,"assoc",(function(){return w.a}));var T=n(74);n.d(e,"assocPath",(function(){return T.a}));var M=n(143);n.d(e,"binary",(function(){return M.a}));var S=n(67);n.d(e,"bind",(function(){return S.a}));var E=n(144);n.d(e,"both",(function(){return E.a}));var A=n(145);n.d(e,"call",(function(){return A.a}));var P=n(48);n.d(e,"chain",(function(){return P.a}));var O=n(149);n.d(e,"clamp",(function(){return O.a}));var C=n(150);n.d(e,"clone",(function(){return C.a}));var D=n(151);n.d(e,"comparator",(function(){return D.a}));var R=n(152);n.d(e,"complement",(function(){return R.a}));var L=n(50);n.d(e,"compose",(function(){return L.a}));var k=n(82);n.d(e,"composeK",(function(){return k.a}));var I=n(154);n.d(e,"composeP",(function(){return I.a}));var j=n(52);n.d(e,"concat",(function(){return j.a}));var F=n(163);n.d(e,"cond",(function(){return F.a}));var N=n(164);n.d(e,"construct",(function(){return N.a}));var q=n(87);n.d(e,"constructN",(function(){return q.a}));var B=n(165);n.d(e,"contains",(function(){return B.a}));var z=n(88);n.d(e,"converge",(function(){return z.a}));var V=n(166);n.d(e,"countBy",(function(){return V.a}));var G=n(47);n.d(e,"curry",(function(){return G.a}));var H=n(5);n.d(e,"curryN",(function(){return H.a}));var U=n(168);n.d(e,"dec",(function(){return U.a}));var W=n(89);n.d(e,"defaultTo",(function(){return W.a}));var Y=n(169);n.d(e,"descend",(function(){return Y.a}));var X=n(90);n.d(e,"difference",(function(){return X.a}));var Z=n(91);n.d(e,"differenceWith",(function(){return Z.a}));var J=n(92);n.d(e,"dissoc",(function(){return J.a}));var $=n(170);n.d(e,"dissocPath",(function(){return $.a}));var K=n(171);n.d(e,"divide",(function(){return K.a}));var Q=n(94);n.d(e,"drop",(function(){return Q.a}));var tt=n(173);n.d(e,"dropLast",(function(){return tt.a}));var et=n(177);n.d(e,"dropLastWhile",(function(){return et.a}));var rt=n(180);n.d(e,"dropRepeats",(function(){return rt.a}));var nt=n(96);n.d(e,"dropRepeatsWith",(function(){return nt.a}));var it=n(181);n.d(e,"dropWhile",(function(){return it.a}));var at=n(183);n.d(e,"either",(function(){return at.a}));var ot=n(99);n.d(e,"empty",(function(){return ot.a}));var st=n(184);n.d(e,"endsWith",(function(){return st.a}));var ct=n(185);n.d(e,"eqBy",(function(){return ct.a}));var ut=n(186);n.d(e,"eqProps",(function(){return ut.a}));var lt=n(9);n.d(e,"equals",(function(){return lt.a}));var ht=n(187);n.d(e,"evolve",(function(){return ht.a}));var ft=n(53);n.d(e,"filter",(function(){return ft.a}));var pt=n(188);n.d(e,"find",(function(){return pt.a}));var dt=n(190);n.d(e,"findIndex",(function(){return dt.a}));var mt=n(192);n.d(e,"findLast",(function(){return mt.a}));var vt=n(194);n.d(e,"findLastIndex",(function(){return vt.a}));var gt=n(196);n.d(e,"flatten",(function(){return gt.a}));var yt=n(40);n.d(e,"flip",(function(){return yt.a}));var bt=n(197);n.d(e,"forEach",(function(){return bt.a}));var _t=n(198);n.d(e,"forEachObjIndexed",(function(){return _t.a}));var xt=n(199);n.d(e,"fromPairs",(function(){return xt.a}));var wt=n(200);n.d(e,"groupBy",(function(){return wt.a}));var Tt=n(201);n.d(e,"groupWith",(function(){return Tt.a}));var Mt=n(202);n.d(e,"gt",(function(){return Mt.a}));var St=n(203);n.d(e,"gte",(function(){return St.a}));var Et=n(204);n.d(e,"has",(function(){return Et.a}));var At=n(205);n.d(e,"hasIn",(function(){return At.a}));var Pt=n(206);n.d(e,"head",(function(){return Pt.a}));var Ot=n(85);n.d(e,"identical",(function(){return Ot.a}));var Ct=n(58);n.d(e,"identity",(function(){return Ct.a}));var Dt=n(207);n.d(e,"ifElse",(function(){return Dt.a}));var Rt=n(208);n.d(e,"inc",(function(){return Rt.a}));var Lt=n(209);n.d(e,"indexBy",(function(){return Lt.a}));var kt=n(210);n.d(e,"indexOf",(function(){return kt.a}));var It=n(211);n.d(e,"init",(function(){return It.a}));var jt=n(212);n.d(e,"innerJoin",(function(){return jt.a}));var Ft=n(213);n.d(e,"insert",(function(){return Ft.a}));var Nt=n(214);n.d(e,"insertAll",(function(){return Nt.a}));var Bt=n(215);n.d(e,"intersection",(function(){return Bt.a}));var zt=n(217);n.d(e,"intersperse",(function(){return zt.a}));var Vt=n(218);n.d(e,"into",(function(){return Vt.a}));var Gt=n(221);n.d(e,"invert",(function(){return Gt.a}));var Ht=n(222);n.d(e,"invertObj",(function(){return Ht.a}));var Ut=n(26);n.d(e,"invoker",(function(){return Ut.a}));var Wt=n(103);n.d(e,"is",(function(){return Wt.a}));var qt=n(223);n.d(e,"isEmpty",(function(){return qt.a}));var Yt=n(75);n.d(e,"isNil",(function(){return Yt.a}));var Xt=n(224);n.d(e,"join",(function(){return Xt.a}));var Zt=n(104);n.d(e,"juxt",(function(){return Zt.a}));var Jt=n(13);n.d(e,"keys",(function(){return Jt.a}));var $t=n(225);n.d(e,"keysIn",(function(){return $t.a}));var Kt=n(97);n.d(e,"last",(function(){return Kt.a}));var Qt=n(226);n.d(e,"lastIndexOf",(function(){return Qt.a}));var te=n(105);n.d(e,"length",(function(){return te.a}));var ee=n(41);n.d(e,"lens",(function(){return ee.a}));var ne=n(227);n.d(e,"lensIndex",(function(){return ne.a}));var re=n(228);n.d(e,"lensPath",(function(){return re.a}));var ie=n(229);n.d(e,"lensProp",(function(){return ie.a}));var ae=n(35);n.d(e,"lift",(function(){return ae.a}));var oe=n(76);n.d(e,"liftN",(function(){return oe.a}));var se=n(230);n.d(e,"lt",(function(){return se.a}));var ce=n(231);n.d(e,"lte",(function(){return ce.a}));var ue=n(7);n.d(e,"map",(function(){return ue.a}));var le=n(232);n.d(e,"mapAccum",(function(){return le.a}));var he=n(233);n.d(e,"mapAccumRight",(function(){return he.a}));var fe=n(234);n.d(e,"mapObjIndexed",(function(){return fe.a}));var de=n(235);n.d(e,"match",(function(){return de.a}));var pe=n(236);n.d(e,"mathMod",(function(){return pe.a}));var me=n(18);n.d(e,"max",(function(){return me.a}));var ve=n(237);n.d(e,"maxBy",(function(){return ve.a}));var ge=n(107);n.d(e,"mean",(function(){return ge.a}));var ye=n(238);n.d(e,"median",(function(){return ye.a}));var be=n(239);n.d(e,"memoize",(function(){return be.a}));var _e=n(109);n.d(e,"memoizeWith",(function(){return _e.a}));var xe=n(240);n.d(e,"merge",(function(){return xe.a}));var we=n(241);n.d(e,"mergeAll",(function(){return we.a}));var Te=n(242);n.d(e,"mergeDeepLeft",(function(){return Te.a}));var Me=n(243);n.d(e,"mergeDeepRight",(function(){return Me.a}));var Se=n(244);n.d(e,"mergeDeepWith",(function(){return Se.a}));var Ee=n(42);n.d(e,"mergeDeepWithKey",(function(){return Ee.a}));var Ae=n(245);n.d(e,"mergeWith",(function(){return Ae.a}));var Pe=n(62);n.d(e,"mergeWithKey",(function(){return Pe.a}));var Oe=n(246);n.d(e,"min",(function(){return Oe.a}));var Ce=n(247);n.d(e,"minBy",(function(){return Ce.a}));var De=n(248);n.d(e,"modulo",(function(){return De.a}));var Re=n(110);n.d(e,"multiply",(function(){return Re.a}));var Le=n(33);n.d(e,"nAry",(function(){return Le.a}));var ke=n(249);n.d(e,"negate",(function(){return ke.a}));var Ie=n(250);n.d(e,"none",(function(){return Ie.a}));var je=n(80);n.d(e,"not",(function(){return je.a}));var Fe=n(25);n.d(e,"nth",(function(){return Fe.a}));var Ne=n(251);n.d(e,"nthArg",(function(){return Ne.a}));var Be=n(252);n.d(e,"o",(function(){return Be.a}));var ze=n(102);n.d(e,"objOf",(function(){return ze.a}));var Ve=n(253);n.d(e,"of",(function(){return Ve.a}));var Ge=n(255);n.d(e,"omit",(function(){return Ge.a}));var He=n(256);n.d(e,"once",(function(){return He.a}));var Ue=n(98);n.d(e,"or",(function(){return Ue.a}));var We=n(111);n.d(e,"over",(function(){return We.a}));var qe=n(257);n.d(e,"pair",(function(){return qe.a}));var Ye=n(258);n.d(e,"partial",(function(){return Ye.a}));var Xe=n(259);n.d(e,"partialRight",(function(){return Xe.a}));var Ze=n(260);n.d(e,"partition",(function(){return Ze.a}));var Je=n(19);n.d(e,"path",(function(){return Je.a}));var $e=n(261);n.d(e,"pathEq",(function(){return $e.a}));var Ke=n(262);n.d(e,"pathOr",(function(){return Ke.a}));var tr=n(263);n.d(e,"pathSatisfies",(function(){return tr.a}));var Qe=n(264);n.d(e,"pick",(function(){return Qe.a}));var tn=n(113);n.d(e,"pickAll",(function(){return tn.a}));var en=n(265);n.d(e,"pickBy",(function(){return en.a}));var nn=n(81);n.d(e,"pipe",(function(){return nn.a}));var rn=n(266);n.d(e,"pipeK",(function(){return rn.a}));var an=n(83);n.d(e,"pipeP",(function(){return an.a}));var on=n(21);n.d(e,"pluck",(function(){return on.a}));var sn=n(114);n.d(e,"prepend",(function(){return sn.a}));var cn=n(267);n.d(e,"product",(function(){return cn.a}));var un=n(268);n.d(e,"project",(function(){return un.a}));var ln=n(44);n.d(e,"prop",(function(){return ln.a}));var hn=n(269);n.d(e,"propEq",(function(){return hn.a}));var fn=n(270);n.d(e,"propIs",(function(){return fn.a}));var dn=n(271);n.d(e,"propOr",(function(){return dn.a}));var br=n(272);n.d(e,"propSatisfies",(function(){return br.a}));var pn=n(273);n.d(e,"props",(function(){return pn.a}));var mn=n(274);n.d(e,"range",(function(){return mn.a}));var hr=n(14);n.d(e,"reduce",(function(){return hr.a}));var vn=n(39);n.d(e,"reduceBy",(function(){return vn.a}));var gn=n(116);n.d(e,"reduceRight",(function(){return gn.a}));var yn=n(275);n.d(e,"reduceWhile",(function(){return yn.a}));var bn=n(276);n.d(e,"reduced",(function(){return bn.a}));var _n=n(38);n.d(e,"reject",(function(){return _n.a}));var xn=n(93);n.d(e,"remove",(function(){return xn.a}));var wn=n(277);n.d(e,"repeat",(function(){return wn.a}));var Tn=n(278);n.d(e,"replace",(function(){return Tn.a}));var Mn=n(36);n.d(e,"reverse",(function(){return Mn.a}));var Sn=n(279);n.d(e,"scan",(function(){return Sn.a}));var En=n(118);n.d(e,"sequence",(function(){return En.a}));var An=n(280);n.d(e,"set",(function(){return An.a}));var Pn=n(11);n.d(e,"slice",(function(){return Pn.a}));var On=n(281);n.d(e,"sort",(function(){return On.a}));var Cn=n(282);n.d(e,"sortBy",(function(){return Cn.a}));var Dn=n(283);n.d(e,"sortWith",(function(){return Dn.a}));var Rn=n(284);n.d(e,"split",(function(){return Rn.a}));var Ln=n(285);n.d(e,"splitAt",(function(){return Ln.a}));var kn=n(286);n.d(e,"splitEvery",(function(){return kn.a}));var In=n(287);n.d(e,"splitWhen",(function(){return In.a}));var jn=n(288);n.d(e,"startsWith",(function(){return jn.a}));var Fn=n(289);n.d(e,"subtract",(function(){return Fn.a}));var Nn=n(108);n.d(e,"sum",(function(){return Nn.a}));var Bn=n(290);n.d(e,"symmetricDifference",(function(){return Bn.a}));var zn=n(291);n.d(e,"symmetricDifferenceWith",(function(){return zn.a}));var Vn=n(51);n.d(e,"tail",(function(){return Vn.a}));var Gn=n(57);n.d(e,"take",(function(){return Gn.a}));var Hn=n(100);n.d(e,"takeLast",(function(){return Hn.a}));var Un=n(292);n.d(e,"takeLastWhile",(function(){return Un.a}));var Wn=n(293);n.d(e,"takeWhile",(function(){return Wn.a}));var qn=n(295);n.d(e,"tap",(function(){return qn.a}));var Yn=n(297);n.d(e,"test",(function(){return Yn.a}));var Xn=n(117);n.d(e,"times",(function(){return Xn.a}));var Zn=n(299);n.d(e,"toLower",(function(){return Zn.a}));var Jn=n(300);n.d(e,"toPairs",(function(){return Jn.a}));var $n=n(301);n.d(e,"toPairsIn",(function(){return $n.a}));var Kn=n(24);n.d(e,"toString",(function(){return Kn.a}));var Qn=n(302);n.d(e,"toUpper",(function(){return Qn.a}));var er=n(303);n.d(e,"transduce",(function(){return er.a}));var nr=n(304);n.d(e,"transpose",(function(){return nr.a}));var rr=n(305);n.d(e,"traverse",(function(){return rr.a}));var ir=n(306);n.d(e,"trim",(function(){return ir.a}));var ar=n(307);n.d(e,"tryCatch",(function(){return ar.a}));var or=n(49);n.d(e,"type",(function(){return or.a}));var sr=n(308);n.d(e,"unapply",(function(){return sr.a}));var cr=n(309);n.d(e,"unary",(function(){return cr.a}));var ur=n(310);n.d(e,"uncurryN",(function(){return ur.a}));var lr=n(311);n.d(e,"unfold",(function(){return lr.a}));var fr=n(312);n.d(e,"union",(function(){return fr.a}));var dr=n(313);n.d(e,"unionWith",(function(){return dr.a}));var pr=n(60);n.d(e,"uniq",(function(){return pr.a}));var mr=n(101);n.d(e,"uniqBy",(function(){return mr.a}));var vr=n(119);n.d(e,"uniqWith",(function(){return vr.a}));var gr=n(314);n.d(e,"unless",(function(){return gr.a}));var yr=n(315);n.d(e,"unnest",(function(){return yr.a}));var _r=n(316);n.d(e,"until",(function(){return _r.a}));var xr=n(56);n.d(e,"update",(function(){return xr.a}));var wr=n(115);n.d(e,"useWith",(function(){return wr.a}));var Tr=n(73);n.d(e,"values",(function(){return Tr.a}));var Mr=n(317);n.d(e,"valuesIn",(function(){return Mr.a}));var Sr=n(318);n.d(e,"view",(function(){return Sr.a}));var Er=n(319);n.d(e,"when",(function(){return Er.a}));var Ar=n(120);n.d(e,"where",(function(){return Ar.a}));var Pr=n(320);n.d(e,"whereEq",(function(){return Pr.a}));var Or=n(321);n.d(e,"without",(function(){return Or.a}));var Cr=n(322);n.d(e,"xprod",(function(){return Cr.a}));var Dr=n(323);n.d(e,"zip",(function(){return Dr.a}));var Rr=n(324);n.d(e,"zipObj",(function(){return Rr.a}));var Lr=n(325);n.d(e,"zipWith",(function(){return Lr.a}))},function(t,e,n){"use strict";var r=n(17),a=Object(r.a)(!1);e.a=a},function(t,e,n){"use strict";var r=n(17),a=Object(r.a)(!0);e.a=a},function(t,e,n){"use strict";e.a={"@@functional/placeholder":!0}},function(t,e,n){"use strict";var r=n(10),a=n(1),u=n(5),o=Object(a.a)((function(t){return Object(u.a)(t.length,(function(){var e=0,n=arguments[0],a=arguments[arguments.length-1],u=Array.prototype.slice.call(arguments,0);return u[0]=function(){var t=n.apply(this,Object(r.a)(arguments,[e,a]));return e+=1,t},t.apply(this,u)}))}));e.a=o},function(t,e,n){"use strict";var r=n(0),a=n(3),u=n(132),o=Object(r.a)(Object(a.a)(["all"],u.a,(function(t,e){for(var n=0;n=0?r:0);na?1:0}));e.a=a},function(t,e,n){"use strict";var r=n(1),a=n(33),u=Object(r.a)((function(t){return Object(a.a)(2,t)}));e.a=u},function(t,e,n){"use strict";var r=n(0),a=n(34),u=n(69),o=n(35),i=Object(r.a)((function(t,e){return Object(a.a)(t)?function(){return t.apply(this,arguments)&&e.apply(this,arguments)}:Object(o.a)(u.a)(t,e)}));e.a=i},function(t,e,n){"use strict";var r=n(47),a=Object(r.a)((function(t){return t.apply(this,Array.prototype.slice.call(arguments,1))}));e.a=a},function(t,e,n){"use strict";var r=n(0),a=n(147),u=n(7),o=Object(r.a)((function(t,e){return Object(u.a)(t,Object(a.a)(e))}));e.a=o},function(t,e,n){"use strict";var r=n(148),a=n(31),u=n(8),o=n(4);e.a=function(t){var e=function(t){return{"@@transducer/init":o.a.init,"@@transducer/result":function(e){return t["@@transducer/result"](e)},"@@transducer/step":function(e,n){var a=t["@@transducer/step"](e,n);return a["@@transducer/reduced"]?Object(r.a)(a):a}}}(t);return{"@@transducer/init":o.a.init,"@@transducer/result":function(t){return e["@@transducer/result"](t)},"@@transducer/step":function(t,n){return Object(a.a)(n)?Object(u.a)(e,t,n):Object(u.a)(e,t,[n])}}}},function(t,e,n){"use strict";e.a=function(t){return{"@@transducer/value":t,"@@transducer/reduced":!0}}},function(t,e,n){"use strict";var r=n(2),a=Object(r.a)((function(t,e,n){if(t>e)throw new Error("min must not be greater than max in clamp(min, max, value)");return ne?e:n}));e.a=a},function(t,e,n){"use strict";var r=n(78),a=n(1),u=Object(a.a)((function(t){return null!=t&&"function"==typeof t.clone?t.clone():Object(r.a)(t,[],[],!0)}));e.a=u},function(t,e,n){"use strict";var r=n(1),a=Object(r.a)((function(t){return function(e,n){return t(e,n)?-1:t(n,e)?1:0}}));e.a=a},function(t,e,n){"use strict";var r=n(35),a=n(80),u=Object(r.a)(a.a);e.a=u},function(t,e,n){"use strict";e.a=function(t,e){return function(){return e.call(this,t.apply(this,arguments))}}},function(t,e,n){"use strict";e.a=function(){if(0===arguments.length)throw new Error("composeP requires at least one argument");return a.a.apply(this,Object(u.a)(arguments))};var a=n(83),u=n(36)},function(t,e,n){"use strict";e.a=function(t,e){return function(){var n=this;return t.apply(n,arguments).then((function(t){return e.call(n,t)}))}}},function(t,e,n){"use strict";e.a=function t(e,n){var c=function(r){var u=n.concat([e]);return Object(a.a)(r,u)?"":t(r,u)},l=function(t,e){return Object(u.a)((function(e){return Object(r.a)(e)+": "+c(t[e])}),e.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+Object(u.a)(c,e).join(", ")+"))";case"[object Array]":return"["+Object(u.a)(c,e).concat(l(e,Object(s.a)((function(t){return/^\d+$/.test(t)}),Object(o.a)(e)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof e?"new Boolean("+c(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?c(NaN):Object(r.a)(Object(i.a)(e)))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof e?"new Number("+c(e.valueOf())+")":1/e==-1/0?"-0":e.toString(10);case"[object String]":return"object"==typeof e?"new String("+c(e.valueOf())+")":Object(r.a)(e);case"[object Undefined]":return"undefined";default:if("function"==typeof e.toString){var h=e.toString();if("[object Object]"!==h)return h}return"{"+l(e,Object(o.a)(e)).join(", ")+"}"}};var a=n(20),u=n(30),r=n(160),i=n(161),o=n(13),s=n(38)},function(t,e,n){"use strict";function r(t,e,n,r){function i(t,e){return a(t,e,n.slice(),r.slice())}var c=Object(u.a)(t),s=Object(u.a)(e);return!Object(o.a)((function(t,e){return!Object(o.a)(i,e,t)}),s,c)}function a(t,e,n,u){if(Object(s.a)(t,e))return!0;var o=Object(h.a)(t);if(o!==Object(h.a)(e))return!1;if(null==t||null==e)return!1;if("function"==typeof t["fantasy-land/equals"]||"function"==typeof e["fantasy-land/equals"])return"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e)&&"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t);if("function"==typeof t.equals||"function"==typeof e.equals)return"function"==typeof t.equals&&t.equals(e)&&"function"==typeof e.equals&&e.equals(t);switch(o){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===Object(i.a)(t.constructor))return t===e;break;case"Boolean":case"Number":case"String":if(typeof t!=typeof e||!Object(s.a)(t.valueOf(),e.valueOf()))return!1;break;case"Date":if(!Object(s.a)(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(t.source!==e.source||t.global!==e.global||t.ignoreCase!==e.ignoreCase||t.multiline!==e.multiline||t.sticky!==e.sticky||t.unicode!==e.unicode)return!1}for(var f=n.length-1;f>=0;){if(n[f]===t)return u[f]===e;f-=1}switch(o){case"Map":return t.size===e.size&&r(t.entries(),e.entries(),n.concat([t]),u.concat([e]));case"Set":return t.size===e.size&&r(t.values(),e.values(),n.concat([t]),u.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var p=Object(l.a)(t);if(p.length!==Object(l.a)(e).length)return!1;var d=n.concat([t]),b=u.concat([e]);for(f=p.length-1;f>=0;){var m=p[f];if(!Object(c.a)(m,e)||!a(e[m],t[m],d,b))return!1;f-=1}return!0}e.a=a;var u=n(158),o=n(37),i=n(159),c=n(6),s=n(85),l=n(13),h=n(49)},function(t,e,n){"use strict";e.a=function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}},function(t,e,n){"use strict";e.a=function(t){var e=String(t).match(/^function (\w*)/);return null==e?"":e[1]}},function(t,e,n){"use strict";e.a=function(t){return'"'+t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}},function(t,e,n){"use strict";var r=function(t){return(t<10?"0":"")+t},a="function"==typeof Date.prototype.toISOString?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+r(t.getUTCMonth()+1)+"-"+r(t.getUTCDate())+"T"+r(t.getUTCHours())+":"+r(t.getUTCMinutes())+":"+r(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};e.a=a},function(t,e,n){"use strict";var r=n(0),a=n(4),u=function(){function t(t,e){this.xf=e,this.f=t}return t.prototype["@@transducer/init"]=a.a.init,t.prototype["@@transducer/result"]=a.a.result,t.prototype["@@transducer/step"]=function(t,e){return this.f(e)?this.xf["@@transducer/step"](t,e):t},t}(),o=Object(r.a)((function(t,e){return new u(t,e)}));e.a=o},function(t,e,n){"use strict";var r=n(12),a=n(1),u=n(7),o=n(18),i=n(14),c=Object(a.a)((function(t){var e=Object(i.a)(o.a,0,Object(u.a)((function(t){return t[0].length}),t));return Object(r.a)(e,(function(){for(var e=0;ea?-1:r0?(this.n-=1,t):this.xf["@@transducer/step"](t,e)},t}(),o=Object(r.a)((function(t,e){return new u(t,e)}));e.a=o},function(t,e,n){"use strict";var r=n(0),a=n(3),u=n(174),o=n(176),i=Object(r.a)(Object(a.a)([],o.a,u.a));e.a=i},function(t,e,n){"use strict";e.a=function(t,e){return Object(a.a)(t=0&&this.i>=this.n?Object(a.a)(n):n},t}(),i=Object(r.a)((function(t,e){return new o(t,e)}));e.a=i},function(t,e,n){"use strict";var r=n(0),a=n(4),u=function(){function t(t,e){this.xf=e,this.pos=0,this.full=!1,this.acc=new Array(t)}return t.prototype["@@transducer/init"]=a.a.init,t.prototype["@@transducer/result"]=function(t){return this.acc=null,this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,e){return this.full&&(t=this.xf["@@transducer/step"](t,this.acc[this.pos])),this.store(e),t},t.prototype.store=function(t){this.acc[this.pos]=t,this.pos+=1,this.pos===this.acc.length&&(this.pos=0,this.full=!0)},t}(),o=Object(r.a)((function(t,e){return new u(t,e)}));e.a=o},function(t,e,n){"use strict";var r=n(0),a=n(3),u=n(178),o=n(179),i=Object(r.a)(Object(a.a)([],o.a,u.a));e.a=i},function(t,e,n){"use strict";e.a=function(t,e){for(var n=e.length-1;n>=0&&t(e[n]);)n-=1;return Object(a.a)(0,n+1,e)};var a=n(11)},function(t,e,n){"use strict";var r=n(0),a=n(8),u=n(4),o=function(){function t(t,e){this.f=t,this.retained=[],this.xf=e}return t.prototype["@@transducer/init"]=u.a.init,t.prototype["@@transducer/result"]=function(t){return this.retained=null,this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,e){return this.f(e)?this.retain(t,e):this.flush(t,e)},t.prototype.flush=function(t,e){return t=Object(a.a)(this.xf["@@transducer/step"],t,this.retained),this.retained=[],this.xf["@@transducer/step"](t,e)},t.prototype.retain=function(t,e){return this.retained.push(e),t},t}(),i=Object(r.a)((function(t,e){return new o(t,e)}));e.a=i},function(t,e,n){"use strict";var r=n(1),a=n(3),u=n(95),o=n(96),i=n(9),c=Object(r.a)(Object(a.a)([],Object(u.a)(i.a),Object(o.a)(i.a)));e.a=c},function(t,e,n){"use strict";var r=n(0),a=n(3),u=n(182),o=n(11),i=Object(r.a)(Object(a.a)(["dropWhile"],u.a,(function(t,e){for(var n=0,r=e.length;n=0;){if(t(e[n]))return e[n];n-=1}})));e.a=o},function(t,e,n){"use strict";var r=n(0),a=n(4),u=function(){function t(t,e){this.xf=e,this.f=t}return t.prototype["@@transducer/init"]=a.a.init,t.prototype["@@transducer/result"]=function(t){return this.xf["@@transducer/result"](this.xf["@@transducer/step"](t,this.last))},t.prototype["@@transducer/step"]=function(t,e){return this.f(e)&&(this.last=e),t},t}(),o=Object(r.a)((function(t,e){return new u(t,e)}));e.a=o},function(t,e,n){"use strict";var r=n(0),a=n(3),u=n(195),o=Object(r.a)(Object(a.a)([],u.a,(function(t,e){for(var n=e.length-1;n>=0;){if(t(e[n]))return n;n-=1}return-1})));e.a=o},function(t,e,n){"use strict";var r=n(0),a=n(4),u=function(){function t(t,e){this.xf=e,this.f=t,this.idx=-1,this.lastIdx=-1}return t.prototype["@@transducer/init"]=a.a.init,t.prototype["@@transducer/result"]=function(t){return this.xf["@@transducer/result"](this.xf["@@transducer/step"](t,this.lastIdx))},t.prototype["@@transducer/step"]=function(t,e){return this.idx+=1,this.f(e)&&(this.lastIdx=this.idx),t},t}(),o=Object(r.a)((function(t,e){return new u(t,e)}));e.a=o},function(t,e,n){"use strict";var r=n(1),a=n(77),u=Object(r.a)(Object(a.a)(!0));e.a=u},function(t,e,n){"use strict";var r=n(23),a=n(0),u=Object(a.a)(Object(r.a)("forEach",(function(t,e){for(var n=e.length,r=0;re}));e.a=a},function(t,e,n){"use strict";var r=n(0),a=Object(r.a)((function(t,e){return t>=e}));e.a=a},function(t,e,n){"use strict";var r=n(0),a=n(6),u=Object(r.a)(a.a);e.a=u},function(t,e,n){"use strict";var r=n(0),a=Object(r.a)((function(t,e){return t in e}));e.a=a},function(t,e,n){"use strict";var r=n(25),a=Object(r.a)(0);e.a=a},function(t,e,n){"use strict";var r=n(2),a=n(5),u=Object(r.a)((function(t,e,n){return Object(a.a)(Math.max(t.length,e.length,n.length),(function(){return t.apply(this,arguments)?e.apply(this,arguments):n.apply(this,arguments)}))}));e.a=u},function(t,e,n){"use strict";var r=n(28),a=Object(r.a)(1);e.a=a},function(t,e,n){"use strict";var r=n(39),a=Object(r.a)((function(t,e){return e}),null);e.a=a},function(t,e,n){"use strict";var r=n(0),a=n(84),u=n(15),o=Object(r.a)((function(t,e){return"function"!=typeof e.indexOf||Object(u.a)(e)?Object(a.a)(e,t,0):e.indexOf(t)}));e.a=o},function(t,e,n){"use strict";var r=n(11),a=Object(r.a)(0,-1);e.a=a},function(t,e,n){"use strict";var r=n(37),a=n(2),u=n(54),o=Object(a.a)((function(t,e,n){return Object(u.a)((function(e){return Object(r.a)(t,e,n)}),e)}));e.a=o},function(t,e,n){"use strict";var r=n(2),a=Object(r.a)((function(t,e,n){t=t=0?t:n.length;var r=Array.prototype.slice.call(n,0);return r.splice(t,0,e),r}));e.a=a},function(t,e,n){"use strict";var r=n(2),a=Object(r.a)((function(t,e,n){return t=t=0?t:n.length,[].concat(Array.prototype.slice.call(n,0,t),e,Array.prototype.slice.call(n,t))}));e.a=a},function(t,e,n){"use strict";var r=n(20),a=n(0),u=n(54),o=n(40),i=n(60),c=Object(a.a)((function(t,e){var n,a;return t.length>e.length?(n=t,a=e):(n=e,a=t),Object(i.a)(Object(u.a)(Object(o.a)(r.a)(n),a))}));e.a=c},function(t,e,n){"use strict";function r(t,e,n){var r,u=typeof t;switch(u){case"string":case"number":return 0===t&&1/t==-1/0?!!n._items["-0"]||(e&&(n._items["-0"]=!0),!1):null!==n._nativeSet?e?(r=n._nativeSet.size,n._nativeSet.add(t),n._nativeSet.size===r):n._nativeSet.has(t):u in n._items?t in n._items[u]||(e&&(n._items[u][t]=!0),!1):(e&&(n._items[u]={},n._items[u][t]=!0),!1);case"boolean":if(u in n._items){var o=t?1:0;return!!n._items[u][o]||(e&&(n._items[u][o]=!0),!1)}return e&&(n._items[u]=t?[!1,!0]:[!0,!1]),!1;case"function":return null!==n._nativeSet?e?(r=n._nativeSet.size,n._nativeSet.add(t),n._nativeSet.size===r):n._nativeSet.has(t):u in n._items?!!Object(a.a)(t,n._items[u])||(e&&n._items[u].push(t),!1):(e&&(n._items[u]=[t]),!1);case"undefined":return!!n._items[u]||(e&&(n._items[u]=!0),!1);case"object":if(null===t)return!!n._items.null||(e&&(n._items.null=!0),!1);default:return(u=Object.prototype.toString.call(t))in n._items?!!Object(a.a)(t,n._items[u])||(e&&n._items[u].push(t),!1):(e&&(n._items[u]=[t]),!1)}}var a=n(20),u=function(){function t(){this._nativeSet="function"==typeof Set?new Set:null,this._items={}}return t.prototype.add=function(t){return!r(t,!0,this)},t.prototype.has=function(t){return r(t,!1,this)},t}();e.a=u},function(t,e,n){"use strict";var r=n(23),a=n(0),u=Object(a.a)(Object(r.a)("intersperse",(function(t,e){for(var n=[],r=0,a=e.length;r=0;){if(Object(u.a)(e[n],t))return n;n-=1}return-1}return e.lastIndexOf(t)}));e.a=o},function(t,e,n){"use strict";var r=n(1),a=n(41),u=n(25),o=n(56),i=Object(r.a)((function(t){return Object(a.a)(Object(u.a)(t),Object(o.a)(t))}));e.a=i},function(t,e,n){"use strict";var r=n(1),a=n(74),u=n(41),o=n(19),i=Object(r.a)((function(t){return Object(u.a)(Object(o.a)(t),Object(a.a)(t))}));e.a=i},function(t,e,n){"use strict";var r=n(1),a=n(32),u=n(41),o=n(44),i=Object(r.a)((function(t){return Object(u.a)(Object(o.a)(t),Object(a.a)(t))}));e.a=i},function(t,e,n){"use strict";var r=n(0),a=Object(r.a)((function(t,e){return t=0;)u=t(n[r],u[0]),a[r]=u[1],r-=1;return[a,u[0]]}));e.a=a},function(t,e,n){"use strict";var r=n(0),a=n(8),u=n(13),o=Object(r.a)((function(t,e){return Object(a.a)((function(n,r){return n[r]=t(e[r],r,e),n}),{},Object(u.a)(e))}));e.a=o},function(t,e,n){"use strict";var r=n(0),a=Object(r.a)((function(t,e){return e.match(t)||[]}));e.a=a},function(t,e,n){"use strict";var r=n(0),a=n(46),u=Object(r.a)((function(t,e){return Object(a.a)(t)?!Object(a.a)(e)||e<1?NaN:(t%e+e)%e:NaN}));e.a=u},function(t,e,n){"use strict";var r=n(2),a=Object(r.a)((function(t,e,n){return t(n)>t(e)?n:e}));e.a=a},function(t,e,n){"use strict";var r=n(1),a=n(107),u=Object(r.a)((function(t){var e=t.length;if(0===e)return NaN;var n=2-e%2,r=(e-n)/2;return Object(a.a)(Array.prototype.slice.call(t,0).sort((function(t,e){return te?1:0})).slice(r,r+n))}));e.a=u},function(t,e,n){"use strict";var r=n(109),a=n(24),u=Object(r.a)((function(){return Object(a.a)(arguments)}));e.a=u},function(t,e,n){"use strict";var r=n(61),a=n(0),u=Object(a.a)((function(t,e){return Object(r.a)({},t,e)}));e.a=u},function(t,e,n){"use strict";var r=n(61),a=n(1),u=Object(a.a)((function(t){return r.a.apply(null,[{}].concat(t))}));e.a=u},function(t,e,n){"use strict";var r=n(0),a=n(42),u=Object(r.a)((function(t,e){return Object(a.a)((function(t,e,n){return e}),t,e)}));e.a=u},function(t,e,n){"use strict";var r=n(0),a=n(42),u=Object(r.a)((function(t,e){return Object(a.a)((function(t,e,n){return n}),t,e)}));e.a=u},function(t,e,n){"use strict";var r=n(2),a=n(42),u=Object(r.a)((function(t,e,n){return Object(a.a)((function(e,n,r){return t(n,r)}),e,n)}));e.a=u},function(t,e,n){"use strict";var r=n(2),a=n(62),u=Object(r.a)((function(t,e,n){return Object(a.a)((function(e,n,r){return t(n,r)}),e,n)}));e.a=u},function(t,e,n){"use strict";var r=n(0),a=Object(r.a)((function(t,e){return e0&&t(Object(a.a)(e,n))}));e.a=u},function(t,e,n){"use strict";var r=n(0),a=Object(r.a)((function(t,e){for(var n={},r=0;ra?1:0}))}));e.a=a},function(t,e,n){"use strict";var r=n(0),a=Object(r.a)((function(t,e){return Array.prototype.slice.call(e,0).sort((function(e,n){for(var r=0,a=0;0===r&&a=0&&t(e[n]);)n-=1;return Object(a.a)(n+1,1/0,e)}));e.a=u},function(t,e,n){"use strict";var r=n(0),a=n(3),u=n(294),o=n(11),i=Object(r.a)(Object(a.a)(["takeWhile"],u.a,(function(t,e){for(var n=0,r=e.length;n0&&e-1 in t)}C.fn=C.prototype={jquery:"3.4.0",constructor:C,length:0,toArray:function(){return f.call(this)},get:function(t){return null==t?f.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=C.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return C.each(this,t)},map:function(t){return this.pushStack(C.map(this,(function(e,i){return t.call(e,i,e)})))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(i){var t=this.length,e=+i+(i<0?t:0);return this.pushStack(e>=0&&e+~]|"+G+")"+G+"*"),$=new RegExp(G+"|>"),K=new RegExp(W),Q=new RegExp("^"+H+"$"),tt={ID:new RegExp("^#("+H+")"),CLASS:new RegExp("^\\.("+H+")"),TAG:new RegExp("^("+H+"|[*])"),ATTR:new RegExp("^"+U),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+G+"*(even|odd|(([+-]|)(\\d*)n|)"+G+"*(?:([+-]|)"+G+"*(\\d+)|))"+G+"*\\)|)","i"),bool:new RegExp("^(?:"+V+")$","i"),needsContext:new RegExp("^"+G+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+G+"*((?:-\\d)?\\d*)"+G+"*\\)|)(?=[^-]|$)","i")},et=/HTML$/i,nt=/^(?:input|select|textarea|button)$/i,it=/^h\d$/i,at=/^[^{]+\{\s*\[native \w/,ot=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,st=/[+~]/,ct=new RegExp("\\\\([\\da-f]{1,6}"+G+"?|("+G+")|.)","ig"),ut=function(t,e,n){var r="0x"+e-65536;return r!=r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},lt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ht=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ft=function(){m()},pt=Pt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{N.apply(I=B.call(E.childNodes),E.childNodes),I[E.childNodes.length].nodeType}catch(t){N={apply:I.length?function(t,e){F.apply(t,B.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}function mt(t,n,r,o){var l,i,h,f,d,y,w,T=n&&n.ownerDocument,A=n?n.nodeType:9;if(r=r||[],"string"!=typeof t||!t||1!==A&&9!==A&&11!==A)return r;if(!o&&((n?n.ownerDocument||n:E)!==v&&m(n),n=n||v,_)){if(11!==A&&(d=ot.exec(t)))if(l=d[1]){if(9===A){if(!(h=n.getElementById(l)))return r;if(h.id===l)return r.push(h),r}else if(T&&(h=T.getElementById(l))&&M(n,h)&&h.id===l)return r.push(h),r}else{if(d[2])return N.apply(r,n.getElementsByTagName(t)),r;if((l=d[3])&&e.getElementsByClassName&&n.getElementsByClassName)return N.apply(r,n.getElementsByClassName(l)),r}if(e.qsa&&!R[t+" "]&&(!x||!x.test(t))&&(1!==A||"object"!==n.nodeName.toLowerCase())){if(w=t,T=n,1===A&&$.test(t)){for((f=n.getAttribute("id"))?f=f.replace(lt,ht):n.setAttribute("id",f=S),i=(y=c(t)).length;i--;)y[i]="#"+f+" "+At(y[i]);w=y.join(","),T=st.test(t)&&St(n.parentNode)||n}try{return N.apply(r,T.querySelectorAll(w)),r}catch(e){R(t,!0)}finally{f===S&&n.removeAttribute("id")}}}return select(t.replace(X,"$1"),n,r,o)}function vt(){var t=[];return function e(r,o){return t.push(r+" ")>n.cacheLength&&delete e[t.shift()],e[r+" "]=o}}function gt(t){return t[S]=!0,t}function yt(t){var e=v.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function bt(t,e){for(var r=t.split("|"),i=r.length;i--;)n.attrHandle[r[i]]=e}function _t(a,b){var t=b&&a,e=t&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(e)return e;if(t)for(;t=t.nextSibling;)if(t===b)return-1;return a?1:-1}function xt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function wt(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function Tt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&pt(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function Mt(t){return gt((function(e){return e=+e,gt((function(n,r){for(var o,c=t([],n.length,e),i=c.length;i--;)n[o=c[i]]&&(n[o]=!(r[o]=n[o]))}))}))}function St(t){return t&&void 0!==t.getElementsByTagName&&t}for(i in e=mt.support={},o=mt.isXML=function(t){var e=t.namespaceURI,n=(t.ownerDocument||t).documentElement;return!et.test(e||n&&n.nodeName||"HTML")},m=mt.setDocument=function(t){var r,c,l=t?t.ownerDocument||t:E;return l!==v&&9===l.nodeType&&l.documentElement?(y=(v=l).documentElement,_=!o(v),E!==v&&(c=v.defaultView)&&c.top!==c&&(c.addEventListener?c.addEventListener("unload",ft,!1):c.attachEvent&&c.attachEvent("onunload",ft)),e.attributes=yt((function(t){return t.className="i",!t.getAttribute("className")})),e.getElementsByTagName=yt((function(t){return t.appendChild(v.createComment("")),!t.getElementsByTagName("*").length})),e.getElementsByClassName=at.test(v.getElementsByClassName),e.getById=yt((function(t){return y.appendChild(t).id=S,!v.getElementsByName||!v.getElementsByName(S).length})),e.getById?(n.filter.ID=function(t){var e=t.replace(ct,ut);return function(t){return t.getAttribute("id")===e}},n.find.ID=function(t,e){if(void 0!==e.getElementById&&_){var n=e.getElementById(t);return n?[n]:[]}}):(n.filter.ID=function(t){var e=t.replace(ct,ut);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},n.find.ID=function(t,e){if(void 0!==e.getElementById&&_){var n,i,r,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(r=e.getElementsByName(t),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),n.find.TAG=e.getElementsByTagName?function(t,n){return void 0!==n.getElementsByTagName?n.getElementsByTagName(t):e.qsa?n.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},n.find.CLASS=e.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&_)return e.getElementsByClassName(t)},w=[],x=[],(e.qsa=at.test(v.querySelectorAll))&&(yt((function(t){y.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&x.push("[*^$]="+G+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||x.push("\\["+G+"*(?:value|"+V+")"),t.querySelectorAll("[id~="+S+"-]").length||x.push("~="),t.querySelectorAll(":checked").length||x.push(":checked"),t.querySelectorAll("a#"+S+"+*").length||x.push(".#.+[+~]")})),yt((function(t){t.innerHTML="";var input=v.createElement("input");input.setAttribute("type","hidden"),t.appendChild(input).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&x.push("name"+G+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&x.push(":enabled",":disabled"),y.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&x.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),x.push(",.*:")}))),(e.matchesSelector=at.test(T=y.matches||y.webkitMatchesSelector||y.mozMatchesSelector||y.oMatchesSelector||y.msMatchesSelector))&&yt((function(t){e.disconnectedMatch=T.call(t,"*"),T.call(t,"[s!='']:x"),w.push("!=",W)})),x=x.length&&new RegExp(x.join("|")),w=w.length&&new RegExp(w.join("|")),r=at.test(y.compareDocumentPosition),M=r||at.test(y.contains)?function(a,b){var t=9===a.nodeType?a.documentElement:a,e=b&&b.parentNode;return a===e||!(!e||1!==e.nodeType||!(t.contains?t.contains(e):a.compareDocumentPosition&&16&a.compareDocumentPosition(e)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},L=r?function(a,b){if(a===b)return d=!0,0;var t=!a.compareDocumentPosition-!b.compareDocumentPosition;return t||(1&(t=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1)||!e.sortDetached&&b.compareDocumentPosition(a)===t?a===v||a.ownerDocument===E&&M(E,a)?-1:b===v||b.ownerDocument===E&&M(E,b)?1:f?z(f,a)-z(f,b):0:4&t?-1:1)}:function(a,b){if(a===b)return d=!0,0;var t,i=0,e=a.parentNode,n=b.parentNode,r=[a],o=[b];if(!e||!n)return a===v?-1:b===v?1:e?-1:n?1:f?z(f,a)-z(f,b):0;if(e===n)return _t(a,b);for(t=a;t=t.parentNode;)r.unshift(t);for(t=b;t=t.parentNode;)o.unshift(t);for(;r[i]===o[i];)i++;return i?_t(r[i],o[i]):r[i]===E?-1:o[i]===E?1:0},v):v},mt.matches=function(t,e){return mt(t,null,null,e)},mt.matchesSelector=function(t,n){if((t.ownerDocument||t)!==v&&m(t),e.matchesSelector&&_&&!R[n+" "]&&(!w||!w.test(n))&&(!x||!x.test(n)))try{var r=T.call(t,n);if(r||e.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){R(n,!0)}return mt(n,v,null,[t]).length>0},mt.contains=function(t,e){return(t.ownerDocument||t)!==v&&m(t),M(t,e)},mt.attr=function(t,r){(t.ownerDocument||t)!==v&&m(t);var o=n.attrHandle[r.toLowerCase()],c=o&&k.call(n.attrHandle,r.toLowerCase())?o(t,r,!_):void 0;return void 0!==c?c:e.attributes||!_?t.getAttribute(r):(c=t.getAttributeNode(r))&&c.specified?c.value:null},mt.escape=function(t){return(t+"").replace(lt,ht)},mt.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},mt.uniqueSort=function(t){var n,r=[],o=0,i=0;if(d=!e.detectDuplicates,f=!e.sortStable&&t.slice(0),t.sort(L),d){for(;n=t[i++];)n===t[i]&&(o=r.push(i));for(;o--;)t.splice(r[o],1)}return f=null,t},r=mt.getText=function(t){var e,n="",i=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=r(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[i++];)n+=r(e);return n},(n=mt.selectors={cacheLength:50,createPseudo:gt,match:tt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(ct,ut),t[3]=(t[3]||t[4]||t[5]||"").replace(ct,ut),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||mt.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&mt.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return tt.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&K.test(n)&&(e=c(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(ct,ut).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var pattern=O[t+" "];return pattern||(pattern=new RegExp("(^|"+G+")"+t+"("+G+"|$)"))&&O(t,(function(t){return pattern.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(r){var o=mt.attr(r,t);return null==o?"!="===e:!e||(o+="","="===e?o===n:"!="===e?o!==n:"^="===e?n&&0===o.indexOf(n):"*="===e?n&&o.indexOf(n)>-1:"$="===e?n&&o.slice(-n.length)===n:"~="===e?(" "+o.replace(Y," ")+" ").indexOf(n)>-1:"|="===e&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,r,o){var c="nth"!==t.slice(0,3),l="last"!==t.slice(-4),h="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,f){var d,m,v,y,_,x,w=c!==l?"nextSibling":"previousSibling",T=e.parentNode,M=h&&e.nodeName.toLowerCase(),E=!f&&!h,P=!1;if(T){if(c){for(;w;){for(y=e;y=y[w];)if(h?y.nodeName.toLowerCase()===M:1===y.nodeType)return!1;x=w="only"===t&&!x&&"nextSibling"}return!0}if(x=[l?T.firstChild:T.lastChild],l&&E){for(P=(_=(d=(m=(v=(y=T)[S]||(y[S]={}))[y.uniqueID]||(v[y.uniqueID]={}))[t]||[])[0]===A&&d[1])&&d[2],y=_&&T.childNodes[_];y=++_&&y&&y[w]||(P=_=0)||x.pop();)if(1===y.nodeType&&++P&&y===e){m[t]=[A,_,P];break}}else if(E&&(P=_=(d=(m=(v=(y=e)[S]||(y[S]={}))[y.uniqueID]||(v[y.uniqueID]={}))[t]||[])[0]===A&&d[1]),!1===P)for(;(y=++_&&y&&y[w]||(P=_=0)||x.pop())&&((h?y.nodeName.toLowerCase()!==M:1!==y.nodeType)||!++P||(E&&((m=(v=y[S]||(y[S]={}))[y.uniqueID]||(v[y.uniqueID]={}))[t]=[A,P]),y!==e)););return(P-=o)===r||P%r==0&&P/r>=0}}},PSEUDO:function(t,e){var r,o=n.pseudos[t]||n.setFilters[t.toLowerCase()]||mt.error("unsupported pseudo: "+t);return o[S]?o(e):o.length>1?(r=[t,t,"",e],n.setFilters.hasOwnProperty(t.toLowerCase())?gt((function(t,n){for(var r,c=o(t,e),i=c.length;i--;)t[r=z(t,c[i])]=!(n[r]=c[i])})):function(t){return o(t,0,r)}):o}},pseudos:{not:gt((function(t){var input=[],e=[],n=l(t.replace(X,"$1"));return n[S]?gt((function(t,e,r,o){for(var c,l=n(t,null,o,[]),i=t.length;i--;)(c=l[i])&&(t[i]=!(e[i]=c))})):function(t,r,o){return input[0]=t,n(input,null,o,e),input[0]=null,!e.pop()}})),has:gt((function(t){return function(e){return mt(t,e).length>0}})),contains:gt((function(text){return text=text.replace(ct,ut),function(t){return(t.textContent||r(t)).indexOf(text)>-1}})),lang:gt((function(t){return Q.test(t||"")||mt.error("unsupported lang: "+t),t=t.replace(ct,ut).toLowerCase(),function(e){var n;do{if(n=_?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===y},focus:function(t){return t===v.activeElement&&(!v.hasFocus||v.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:Tt(!1),disabled:Tt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!n.pseudos.empty(t)},header:function(t){return it.test(t.nodeName)},input:function(t){return nt.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:Mt((function(){return[0]})),last:Mt((function(t,e){return[e-1]})),eq:Mt((function(t,e,n){return[n<0?n+e:n]})),even:Mt((function(t,e){for(var i=0;ie?e:n;--i>=0;)t.push(i);return t})),gt:Mt((function(t,e,n){for(var i=n<0?n+e:n;++i1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function Ct(t,map,filter,e,n){for(var r,o=[],i=0,c=t.length,l=null!=map;i-1&&(c[d]=!(l[d]=m))}}else T=Ct(T===l?T.splice(_,T.length):T),o?o(null,l,T,f):N.apply(l,T)}))}function Rt(t){for(var e,r,o,c=t.length,l=n.relative[t[0].type],f=l||n.relative[" "],i=l?1:0,d=Pt((function(t){return t===e}),f,!0),m=Pt((function(t){return z(e,t)>-1}),f,!0),v=[function(t,n,r){var o=!l&&(r||n!==h)||((e=n).nodeType?d(t,n,r):m(t,n,r));return e=null,o}];i1&&Ot(v),i>1&&At(t.slice(0,i-1).concat({value:" "===t[i-2].type?"*":""})).replace(X,"$1"),r,i0,o=t.length>0,c=function(c,l,f,d,y){var x,w,T,M=0,i="0",S=c&&[],E=[],P=h,O=c||o&&n.find.TAG("*",y),C=A+=null==P?1:Math.random()||.1,D=O.length;for(y&&(h=l===v||l||y);i!==D&&null!=(x=O[i]);i++){if(o&&x){for(w=0,l||x.ownerDocument===v||(m(x),f=!_);T=t[w++];)if(T(x,l||v,f)){d.push(x);break}y&&(A=C)}r&&((x=!T&&x)&&M--,c&&S.push(x))}if(M+=i,r&&i!==M){for(w=0;T=e[w++];)T(S,E,l,f);if(c){if(M>0)for(;i--;)S[i]||E[i]||(E[i]=j.call(d));E=Ct(E)}N.apply(d,E),y&&!c&&E.length>0&&M+e.length>1&&mt.uniqueSort(d)}return y&&(A=C,h=P),S};return r?gt(c):c}(o,r))).selector=t}return l},select=mt.select=function(t,e,r,o){var i,h,f,d,m,v="function"==typeof t&&t,y=!o&&c(t=v.selector||t);if(r=r||[],1===y.length){if((h=y[0]=y[0].slice(0)).length>2&&"ID"===(f=h[0]).type&&9===e.nodeType&&_&&n.relative[h[1].type]){if(!(e=(n.find.ID(f.matches[0].replace(ct,ut),e)||[])[0]))return r;v&&(e=e.parentNode),t=t.slice(h.shift().value.length)}for(i=tt.needsContext.test(t)?0:h.length;i--&&(f=h[i],!n.relative[d=f.type]);)if((m=n.find[d])&&(o=m(f.matches[0].replace(ct,ut),st.test(h[0].type)&&St(e.parentNode)||e))){if(h.splice(i,1),!(t=o.length&&At(h)))return N.apply(r,o),r;break}}return(v||l(t,y))(o,e,!_,r,!e||st.test(t)&&St(e.parentNode)||e),r},e.sortStable=S.split("").sort(L).join("")===S,e.detectDuplicates=!!d,m(),e.sortDetached=yt((function(t){return 1&t.compareDocumentPosition(v.createElement("fieldset"))})),yt((function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")}))||bt("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),e.attributes&&yt((function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||bt("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),yt((function(t){return null==t.getAttribute("disabled")}))||bt(V,(function(t,e,n){var r;if(!n)return!0===t[e]?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null})),mt}(n);C.find=L,C.expr=L.selectors,C.expr[":"]=C.expr.pseudos,C.uniqueSort=C.unique=L.uniqueSort,C.text=L.getText,C.isXMLDoc=L.isXML,C.contains=L.contains,C.escapeSelector=L.escape;var k=function(t,e,n){for(var r=[],o=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(o&&C(t).is(n))break;r.push(t)}return r},I=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},j=C.expr.match.needsContext;function F(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function B(t,e,n){return S(e)?C.grep(t,(function(t,i){return!!e.call(t,i,t)!==n})):e.nodeType?C.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?C.grep(t,(function(t){return v.call(e,t)>-1!==n})):C.filter(e,t,n)}C.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?C.find.matchesSelector(r,t)?[r]:[]:C.find.matches(t,C.grep(e,(function(t){return 1===t.nodeType})))},C.fn.extend({find:function(t){var i,e,n=this.length,r=this;if("string"!=typeof t)return this.pushStack(C(t).filter((function(){for(i=0;i1?C.uniqueSort(e):e},filter:function(t){return this.pushStack(B(this,t||[],!1))},not:function(t){return this.pushStack(B(this,t||[],!0))},is:function(t){return!!B(this,"string"==typeof t&&j.test(t)?C(t):t||[],!1).length}});var z,V=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(C.fn.init=function(t,e,n){var r,o;if(!t)return this;if(n=n||z,"string"==typeof t){if(!(r="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:V.exec(t))||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof C?e[0]:e,C.merge(this,C.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:l,!0)),N.test(r[1])&&C.isPlainObject(e))for(r in e)S(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}return(o=l.getElementById(r[2]))&&(this[0]=o,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):S(t)?void 0!==n.ready?n.ready(t):t(C):C.makeArray(t,this)}).prototype=C.fn,z=C(l);var G=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function U(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}C.fn.extend({has:function(t){var e=C(t,this),n=e.length;return this.filter((function(){for(var i=0;i-1:1===n.nodeType&&C.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?C.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?v.call(C(t),this[0]):v.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(C.uniqueSort(C.merge(this.get(),C(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),C.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return k(t,"parentNode")},parentsUntil:function(t,i,e){return k(t,"parentNode",e)},next:function(t){return U(t,"nextSibling")},prev:function(t){return U(t,"previousSibling")},nextAll:function(t){return k(t,"nextSibling")},prevAll:function(t){return k(t,"previousSibling")},nextUntil:function(t,i,e){return k(t,"nextSibling",e)},prevUntil:function(t,i,e){return k(t,"previousSibling",e)},siblings:function(t){return I((t.parentNode||{}).firstChild,t)},children:function(t){return I(t.firstChild)},contents:function(t){return void 0!==t.contentDocument?t.contentDocument:(F(t,"template")&&(t=t.content||t),C.merge([],t.childNodes))}},(function(t,e){C.fn[t]=function(n,r){var o=C.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=C.filter(r,o)),this.length>1&&(H[t]||C.uniqueSort(o),G.test(t)&&o.reverse()),this.pushStack(o)}}));var W=/[^\x20\t\r\n\f]+/g;function Y(t){return t}function X(t){throw t}function Z(t,e,n,r){var o;try{t&&S(o=t.promise)?o.call(t).done(e).fail(n):t&&S(o=t.then)?o.call(t,e,n):e.apply(void 0,[t].slice(r))}catch(t){n.apply(void 0,[t])}}C.Callbacks=function(t){t="string"==typeof t?function(t){var object={};return C.each(t.match(W)||[],(function(t,e){object[e]=!0})),object}(t):C.extend({},t);var e,n,r,o,c=[],l=[],h=-1,f=function(){for(o=o||t.once,r=e=!0;l.length;h=-1)for(n=l.shift();++h-1;)c.splice(n,1),n<=h&&h--})),this},has:function(t){return t?C.inArray(t,c)>-1:c.length>0},empty:function(){return c&&(c=[]),this},disable:function(){return o=l=[],c=n="",this},disabled:function(){return!c},lock:function(){return o=l=[],n||e||(c=n=""),this},locked:function(){return!!o},fireWith:function(t,n){return o||(n=[t,(n=n||[]).slice?n.slice():n],l.push(n),e||f()),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!r}};return d},C.extend({Deferred:function(t){var e=[["notify","progress",C.Callbacks("memory"),C.Callbacks("memory"),2],["resolve","done",C.Callbacks("once memory"),C.Callbacks("once memory"),0,"resolved"],["reject","fail",C.Callbacks("once memory"),C.Callbacks("once memory"),1,"rejected"]],r="pending",o={state:function(){return r},always:function(){return c.done(arguments).fail(arguments),this},catch:function(t){return o.then(null,t)},pipe:function(){var t=arguments;return C.Deferred((function(n){C.each(e,(function(i,e){var r=S(t[e[4]])&&t[e[4]];c[e[1]]((function(){var t=r&&r.apply(this,arguments);t&&S(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[e[0]+"With"](this,r?[t]:arguments)}))})),t=null})).promise()},then:function(t,r,o){var c=0;function l(t,e,r,o){return function(){var h=this,f=arguments,d=function(){var n,d;if(!(t=c&&(r!==X&&(h=void 0,f=[n]),e.rejectWith(h,f))}};t?m():(C.Deferred.getStackHook&&(m.stackTrace=C.Deferred.getStackHook()),n.setTimeout(m))}}return C.Deferred((function(n){e[0][3].add(l(0,n,S(o)?o:Y,n.notifyWith)),e[1][3].add(l(0,n,S(t)?t:Y)),e[2][3].add(l(0,n,S(r)?r:X))})).promise()},promise:function(t){return null!=t?C.extend(t,o):o}},c={};return C.each(e,(function(i,t){var n=t[2],l=t[5];o[t[1]]=n.add,l&&n.add((function(){r=l}),e[3-i][2].disable,e[3-i][3].disable,e[0][2].lock,e[0][3].lock),n.add(t[3].fire),c[t[0]]=function(){return c[t[0]+"With"](this===c?void 0:this,arguments),this},c[t[0]+"With"]=n.fireWith})),o.promise(c),t&&t.call(c,c),c},when:function(t){var e=arguments.length,i=e,n=Array(i),r=f.call(arguments),o=C.Deferred(),c=function(i){return function(t){n[i]=this,r[i]=arguments.length>1?f.call(arguments):t,--e||o.resolveWith(n,r)}};if(e<=1&&(Z(t,o.done(c(i)).resolve,o.reject,!e),"pending"===o.state()||S(r[i]&&r[i].then)))return o.then();for(;i--;)Z(r[i],c(i),o.reject);return o.promise()}});var J=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;C.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&J.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},C.readyException=function(t){n.setTimeout((function(){throw t}))};var $=C.Deferred();function K(){l.removeEventListener("DOMContentLoaded",K),n.removeEventListener("load",K),C.ready()}C.fn.ready=function(t){return $.then(t).catch((function(t){C.readyException(t)})),this},C.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--C.readyWait:C.isReady)||(C.isReady=!0,!0!==t&&--C.readyWait>0||$.resolveWith(l,[C]))}}),C.ready.then=$.then,"complete"===l.readyState||"loading"!==l.readyState&&!l.documentElement.doScroll?n.setTimeout(C.ready):(l.addEventListener("DOMContentLoaded",K),n.addEventListener("load",K));var Q=function(t,e,n,r,o,c,l){var i=0,h=t.length,f=null==n;if("object"===O(n))for(i in o=!0,n)Q(t,e,i,n[i],!0,c,l);else if(void 0!==r&&(o=!0,S(r)||(l=!0),f&&(l?(e.call(t,r),e=null):(f=e,e=function(t,e,n){return f.call(C(t),n)})),e))for(;i1,null,!0)},removeData:function(t){return this.each((function(){ct.remove(this,t)}))}}),C.extend({queue:function(t,e,data){var n;if(t)return e=(e||"fx")+"queue",n=st.get(t,e),data&&(!n||Array.isArray(data)?n=st.access(t,e,C.makeArray(data)):n.push(data)),n||[]},dequeue:function(t,e){e=e||"fx";var n=C.queue(t,e),r=n.length,o=n.shift(),c=C._queueHooks(t,e);"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===e&&n.unshift("inprogress"),delete c.stop,o.call(t,(function(){C.dequeue(t,e)}),c)),!r&&c&&c.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return st.get(t,n)||st.access(t,n,{empty:C.Callbacks("once memory").add((function(){st.remove(t,[e+"queue",n])}))})}}),C.fn.extend({queue:function(t,data){var e=2;return"string"!=typeof t&&(data=t,t="fx",e--),arguments.length\x20\t\r\n\f]*)/i,At=/^$|^module$|\/(?:java|ecma)script/i,Pt={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Ot(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&F(t,e)?C.merge([t],n):n}function Ct(t,e){for(var i=0,n=t.length;i-1)o&&o.push(c);else if(d=gt(c),l=Ot(v.appendChild(c),"script"),d&&Ct(l),n)for(m=0;c=l[m++];)At.test(c.type||"")&&n.push(c);return v}div=l.createDocumentFragment().appendChild(l.createElement("div")),(input=l.createElement("input")).setAttribute("type","radio"),input.setAttribute("checked","checked"),input.setAttribute("name","t"),div.appendChild(input),M.checkClone=div.cloneNode(!0).cloneNode(!0).lastChild.checked,div.innerHTML="",M.noCloneChecked=!!div.cloneNode(!0).lastChild.defaultValue;var Lt=/^key/,kt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,It=/^([^.]*)(?:\.(.+)|)/;function jt(){return!0}function Ft(){return!1}function Nt(t,e){return t===function(){try{return l.activeElement}catch(t){}}()==("focus"===e)}function Bt(t,e,n,data,r,o){var c,l;if("object"==typeof e){for(l in"string"!=typeof n&&(data=data||n,n=void 0),e)Bt(t,l,n,data,e[l],o);return t}if(null==data&&null==r?(r=n,data=n=void 0):null==r&&("string"==typeof n?(r=data,data=void 0):(r=data,data=n,n=void 0)),!1===r)r=Ft;else if(!r)return t;return 1===o&&(c=r,(r=function(t){return C().off(t),c.apply(this,arguments)}).guid=c.guid||(c.guid=C.guid++)),t.each((function(){C.event.add(this,e,r,data,n)}))}function zt(t,e,n){n?(st.set(t,e,!1),C.event.add(t,e,{namespace:!1,handler:function(t){var r,o,c=st.get(this,e);if(1&t.isTrigger&&this[e]){if(c)(C.event.special[e]||{}).delegateType&&t.stopPropagation();else if(c=f.call(arguments),st.set(this,e,c),r=n(this,e),this[e](),c!==(o=st.get(this,e))||r?st.set(this,e,!1):o=void 0,c!==o)return t.stopImmediatePropagation(),t.preventDefault(),o}else c&&(st.set(this,e,C.event.trigger(C.extend(c.shift(),C.Event.prototype),c,this)),t.stopImmediatePropagation())}})):C.event.add(t,e,jt)}C.event={global:{},add:function(t,e,n,data,r){var o,c,l,h,f,d,m,v,y,_,x,w=st.get(t);if(w)for(n.handler&&(n=(o=n).handler,r=o.selector),r&&C.find.matchesSelector(vt,r),n.guid||(n.guid=C.guid++),(h=w.events)||(h=w.events={}),(c=w.handle)||(c=w.handle=function(e){return void 0!==C&&C.event.triggered!==e.type?C.event.dispatch.apply(t,arguments):void 0}),f=(e=(e||"").match(W)||[""]).length;f--;)y=x=(l=It.exec(e[f])||[])[1],_=(l[2]||"").split(".").sort(),y&&(m=C.event.special[y]||{},y=(r?m.delegateType:m.bindType)||y,m=C.event.special[y]||{},d=C.extend({type:y,origType:x,data:data,handler:n,guid:n.guid,selector:r,needsContext:r&&C.expr.match.needsContext.test(r),namespace:_.join(".")},o),(v=h[y])||((v=h[y]=[]).delegateCount=0,m.setup&&!1!==m.setup.call(t,data,_,c)||t.addEventListener&&t.addEventListener(y,c)),m.add&&(m.add.call(t,d),d.handler.guid||(d.handler.guid=n.guid)),r?v.splice(v.delegateCount++,0,d):v.push(d),C.event.global[y]=!0)},remove:function(t,e,n,r,o){var c,l,h,f,d,m,v,y,_,x,w,T=st.hasData(t)&&st.get(t);if(T&&(f=T.events)){for(d=(e=(e||"").match(W)||[""]).length;d--;)if(_=w=(h=It.exec(e[d])||[])[1],x=(h[2]||"").split(".").sort(),_){for(v=C.event.special[_]||{},y=f[_=(r?v.delegateType:v.bindType)||_]||[],h=h[2]&&new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=c=y.length;c--;)m=y[c],!o&&w!==m.origType||n&&n.guid!==m.guid||h&&!h.test(m.namespace)||r&&r!==m.selector&&("**"!==r||!m.selector)||(y.splice(c,1),m.selector&&y.delegateCount--,v.remove&&v.remove.call(t,m));l&&!y.length&&(v.teardown&&!1!==v.teardown.call(t,x,T.handle)||C.removeEvent(t,_,T.handle),delete f[_])}else for(_ in f)C.event.remove(t,_+e[d],n,r,!0);C.isEmptyObject(f)&&st.remove(t,"handle events")}},dispatch:function(t){var i,e,n,r,o,c,l=C.event.fix(t),h=new Array(arguments.length),f=(st.get(this,"events")||{})[l.type]||[],d=C.event.special[l.type]||{};for(h[0]=l,i=1;i=1))for(;f!==this;f=f.parentNode||this)if(1===f.nodeType&&("click"!==t.type||!0!==f.disabled)){for(o=[],c={},i=0;i-1:C.find(r,this,null,[f]).length),c[r]&&o.push(n);o.length&&l.push({elem:f,handlers:o})}return f=this,h\x20\t\r\n\f]*)[^>]*)\/>/gi,Gt=/\s*$/g;function Wt(t,content){return F(t,"table")&&F(11!==content.nodeType?content:content.firstChild,"tr")&&C(t).children("tbody")[0]||t}function qt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Yt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Xt(t,e){var i,n,r,o,c,l,h,f;if(1===e.nodeType){if(st.hasData(t)&&(o=st.access(t),c=st.set(e,o),f=o.events))for(r in delete c.handle,c.events={},f)for(i=0,n=f[r].length;i1&&"string"==typeof _&&!M.checkClone&&Ht.test(_))return t.each((function(o){var c=t.eq(o);x&&(e[0]=_.call(this,o,c.html())),Jt(c,e,n,r)}));if(v&&(c=(o=Rt(e,t[0].ownerDocument,!1,t,r)).firstChild,1===o.childNodes.length&&(o=c),c||r)){for(h=(l=C.map(Ot(o,"script"),qt)).length;i")},clone:function(t,e,n){var i,r,o,c,l=t.cloneNode(!0),h=gt(t);if(!(M.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||C.isXMLDoc(t)))for(c=Ot(l),i=0,r=(o=Ot(t)).length;i0&&Ct(c,!h&&Ot(t,"script")),l},cleanData:function(t){for(var data,e,n,r=C.event.special,i=0;void 0!==(e=t[i]);i++)if(at(e)){if(data=e[st.expando]){if(data.events)for(n in data.events)r[n]?C.event.remove(e,n):C.removeEvent(e,n,data.handle);e[st.expando]=void 0}e[ct.expando]&&(e[ct.expando]=void 0)}}}),C.fn.extend({detach:function(t){return $t(this,t,!0)},remove:function(t){return $t(this,t)},text:function(t){return Q(this,(function(t){return void 0===t?C.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Jt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Wt(this,t).appendChild(t)}))},prepend:function(){return Jt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Wt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Jt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Jt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,i=0;null!=(t=this[i]);i++)1===t.nodeType&&(C.cleanData(Ot(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return C.clone(this,t,e)}))},html:function(t){return Q(this,(function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Gt.test(t)&&!Pt[(Et.exec(t)||["",""])[1].toLowerCase()]){t=C.htmlPrefilter(t);try{for(;i=0&&(h+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-c-h-l-.5))||0),h}function de(t,e,n){var r=Qt(t),o=(!M.boxSizingReliable()||n)&&"border-box"===C.css(t,"boxSizing",!1,r),c=o,l=ee(t,e,r),h="offset"+e[0].toUpperCase()+e.slice(1);if(Kt.test(l)){if(!n)return l;l="auto"}return(!M.boxSizingReliable()&&o||"auto"===l||!parseFloat(l)&&"inline"===C.css(t,"display",!1,r))&&t.getClientRects().length&&(o="border-box"===C.css(t,"boxSizing",!1,r),(c=h in t)&&(l=t[h])),(l=parseFloat(l)||0)+fe(t,e,n||(o?"border":"content"),c,r,l)+"px"}function pe(t,e,n,r,o){return new pe.prototype.init(t,e,n,r,o)}C.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=ee(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var o,c,l,h=it(e),f=ce.test(e),style=t.style;if(f||(e=oe(h)),l=C.cssHooks[e]||C.cssHooks[h],void 0===n)return l&&"get"in l&&void 0!==(o=l.get(t,!1,r))?o:style[e];"string"===(c=typeof n)&&(o=pt.exec(n))&&o[1]&&(n=xt(t,e,o),c="number"),null!=n&&n==n&&("number"!==c||f||(n+=o&&o[3]||(C.cssNumber[h]?"":"px")),M.clearCloneStyle||""!==n||0!==e.indexOf("background")||(style[e]="inherit"),l&&"set"in l&&void 0===(n=l.set(t,n,r))||(f?style.setProperty(e,n):style[e]=n))}},css:function(t,e,n,r){var o,c,l,h=it(e);return ce.test(e)||(e=oe(h)),(l=C.cssHooks[e]||C.cssHooks[h])&&"get"in l&&(o=l.get(t,!0,n)),void 0===o&&(o=ee(t,e,r)),"normal"===o&&e in le&&(o=le[e]),""===n||n?(c=parseFloat(o),!0===n||isFinite(c)?c||0:o):o}}),C.each(["height","width"],(function(i,t){C.cssHooks[t]={get:function(e,n,r){if(n)return!se.test(C.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?de(e,t,r):_t(e,ue,(function(){return de(e,t,r)}))},set:function(e,n,r){var o,c=Qt(e),l=!M.scrollboxSize()&&"absolute"===c.position,h=(l||r)&&"border-box"===C.css(e,"boxSizing",!1,c),f=r?fe(e,t,r,h,c):0;return h&&l&&(f-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(c[t])-fe(e,t,"border",!1,c)-.5)),f&&(o=pt.exec(n))&&"px"!==(o[3]||"px")&&(e.style[t]=n,n=C.css(e,t)),he(0,n,f)}}})),C.cssHooks.marginLeft=ne(M.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(ee(t,"marginLeft"))||t.getBoundingClientRect().left-_t(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),C.each({margin:"",padding:"",border:"Width"},(function(t,e){C.cssHooks[t+e]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];i<4;i++)r[t+mt[i]+e]=o[i]||o[i-2]||o[0];return r}},"margin"!==t&&(C.cssHooks[t+e].set=he)})),C.fn.extend({css:function(t,e){return Q(this,(function(t,e,n){var r,o,map={},i=0;if(Array.isArray(e)){for(r=Qt(t),o=e.length;i1)}}),C.Tween=pe,pe.prototype={constructor:pe,init:function(t,e,n,r,o,c){this.elem=t,this.prop=n,this.easing=o||C.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=c||(C.cssNumber[n]?"":"px")},cur:function(){var t=pe.propHooks[this.prop];return t&&t.get?t.get(this):pe.propHooks._default.get(this)},run:function(t){var e,n=pe.propHooks[this.prop];return this.options.duration?this.pos=e=C.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):pe.propHooks._default.set(this),this}},pe.prototype.init.prototype=pe.prototype,pe.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=C.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){C.fx.step[t.prop]?C.fx.step[t.prop](t):1!==t.elem.nodeType||!C.cssHooks[t.prop]&&null==t.elem.style[oe(t.prop)]?t.elem[t.prop]=t.now:C.style(t.elem,t.prop,t.now+t.unit)}}},pe.propHooks.scrollTop=pe.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},C.easing={linear:function(p){return p},swing:function(p){return.5-Math.cos(p*Math.PI)/2},_default:"swing"},C.fx=pe.prototype.init,C.fx.step={};var me,ve,ge=/^(?:toggle|show|hide)$/,ye=/queueHooks$/;function be(){ve&&(!1===l.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(be):n.setTimeout(be,C.fx.interval),C.fx.tick())}function _e(){return n.setTimeout((function(){me=void 0})),me=Date.now()}function xe(t,e){var n,i=0,r={height:t};for(e=e?1:0;i<4;i+=2-e)r["margin"+(n=mt[i])]=r["padding"+n]=t;return e&&(r.opacity=r.width=t),r}function we(t,e,n){for(var r,o=(Te.tweeners[e]||[]).concat(Te.tweeners["*"]),c=0,l=o.length;c1)},removeAttr:function(t){return this.each((function(){C.removeAttr(this,t)}))}}),C.extend({attr:function(t,e,n){var r,o,c=t.nodeType;if(3!==c&&8!==c&&2!==c)return void 0===t.getAttribute?C.prop(t,e,n):(1===c&&C.isXMLDoc(t)||(o=C.attrHooks[e.toLowerCase()]||(C.expr.match.bool.test(e)?Me:void 0)),void 0!==n?null===n?void C.removeAttr(t,e):o&&"set"in o&&void 0!==(r=o.set(t,n,e))?r:(t.setAttribute(e,n+""),n):o&&"get"in o&&null!==(r=o.get(t,e))?r:null==(r=C.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!M.radioValue&&"radio"===e&&F(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,r=e&&e.match(W);if(r&&1===t.nodeType)for(;n=r[i++];)t.removeAttribute(n)}}),Me={set:function(t,e,n){return!1===e?C.removeAttr(t,n):t.setAttribute(n,n),n}},C.each(C.expr.match.bool.source.match(/\w+/g),(function(i,t){var e=Se[t]||C.find.attr;Se[t]=function(t,n,r){var o,c,l=n.toLowerCase();return r||(c=Se[l],Se[l]=o,o=null!=e(t,n,r)?l:null,Se[l]=c),o}}));var Ee=/^(?:input|select|textarea|button)$/i,Ae=/^(?:a|area)$/i;function Pe(t){return(t.match(W)||[]).join(" ")}function Oe(t){return t.getAttribute&&t.getAttribute("class")||""}function Ce(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(W)||[]}C.fn.extend({prop:function(t,e){return Q(this,C.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[C.propFix[t]||t]}))}}),C.extend({prop:function(t,e,n){var r,o,c=t.nodeType;if(3!==c&&8!==c&&2!==c)return 1===c&&C.isXMLDoc(t)||(e=C.propFix[e]||e,o=C.propHooks[e]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(t,n,e))?r:t[e]=n:o&&"get"in o&&null!==(r=o.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=C.find.attr(t,"tabindex");return e?parseInt(e,10):Ee.test(t.nodeName)||Ae.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),M.optSelected||(C.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),C.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){C.propFix[this.toLowerCase()]=this})),C.fn.extend({addClass:function(t){var e,n,r,o,c,l,h,i=0;if(S(t))return this.each((function(e){C(this).addClass(t.call(this,e,Oe(this)))}));if((e=Ce(t)).length)for(;n=this[i++];)if(o=Oe(n),r=1===n.nodeType&&" "+Pe(o)+" "){for(l=0;c=e[l++];)r.indexOf(" "+c+" ")<0&&(r+=c+" ");o!==(h=Pe(r))&&n.setAttribute("class",h)}return this},removeClass:function(t){var e,n,r,o,c,l,h,i=0;if(S(t))return this.each((function(e){C(this).removeClass(t.call(this,e,Oe(this)))}));if(!arguments.length)return this.attr("class","");if((e=Ce(t)).length)for(;n=this[i++];)if(o=Oe(n),r=1===n.nodeType&&" "+Pe(o)+" "){for(l=0;c=e[l++];)for(;r.indexOf(" "+c+" ")>-1;)r=r.replace(" "+c+" "," ");o!==(h=Pe(r))&&n.setAttribute("class",h)}return this},toggleClass:function(t,e){var n=typeof t,r="string"===n||Array.isArray(t);return"boolean"==typeof e&&r?e?this.addClass(t):this.removeClass(t):S(t)?this.each((function(i){C(this).toggleClass(t.call(this,i,Oe(this),e),e)})):this.each((function(){var e,i,o,c;if(r)for(i=0,o=C(this),c=Ce(t);e=c[i++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==n||((e=Oe(this))&&st.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":st.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,i=0;for(e=" "+t+" ";n=this[i++];)if(1===n.nodeType&&(" "+Pe(Oe(n))+" ").indexOf(e)>-1)return!0;return!1}});var De=/\r/g;C.fn.extend({val:function(t){var e,n,r,o=this[0];return arguments.length?(r=S(t),this.each((function(i){var n;1===this.nodeType&&(null==(n=r?t.call(this,i,C(this).val()):t)?n="":"number"==typeof n?n+="":Array.isArray(n)&&(n=C.map(n,(function(t){return null==t?"":t+""}))),(e=C.valHooks[this.type]||C.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,n,"value")||(this.value=n))}))):o?(e=C.valHooks[o.type]||C.valHooks[o.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(De,""):null==n?"":n:void 0}}),C.extend({valHooks:{option:{get:function(t){var e=C.find.attr(t,"value");return null!=e?e:Pe(C.text(t))}},select:{get:function(t){var e,option,i,n=t.options,r=t.selectedIndex,o="select-one"===t.type,c=o?null:[],l=o?r+1:n.length;for(i=r<0?l:o?r:0;i-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),C.each(["radio","checkbox"],(function(){C.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=C.inArray(C(t).val(),e)>-1}},M.checkOn||(C.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),M.focusin="onfocusin"in n;var Re=/^(?:focusinfocus|focusoutblur)$/,Le=function(t){t.stopPropagation()};C.extend(C.event,{trigger:function(t,data,e,r){var i,o,c,h,f,d,m,v,y=[e||l],_=x.call(t,"type")?t.type:t,w=x.call(t,"namespace")?t.namespace.split("."):[];if(o=v=c=e=e||l,3!==e.nodeType&&8!==e.nodeType&&!Re.test(_+C.event.triggered)&&(_.indexOf(".")>-1&&(w=_.split("."),_=w.shift(),w.sort()),f=_.indexOf(":")<0&&"on"+_,(t=t[C.expando]?t:new C.Event(_,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=w.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+w.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=e),data=null==data?[t]:C.makeArray(data,[t]),m=C.event.special[_]||{},r||!m.trigger||!1!==m.trigger.apply(e,data))){if(!r&&!m.noBubble&&!E(e)){for(h=m.delegateType||_,Re.test(h+_)||(o=o.parentNode);o;o=o.parentNode)y.push(o),c=o;c===(e.ownerDocument||l)&&y.push(c.defaultView||c.parentWindow||n)}for(i=0;(o=y[i++])&&!t.isPropagationStopped();)v=o,t.type=i>1?h:m.bindType||_,(d=(st.get(o,"events")||{})[t.type]&&st.get(o,"handle"))&&d.apply(o,data),(d=f&&o[f])&&d.apply&&at(o)&&(t.result=d.apply(o,data),!1===t.result&&t.preventDefault());return t.type=_,r||t.isDefaultPrevented()||m._default&&!1!==m._default.apply(y.pop(),data)||!at(e)||f&&S(e[_])&&!E(e)&&((c=e[f])&&(e[f]=null),C.event.triggered=_,t.isPropagationStopped()&&v.addEventListener(_,Le),e[_](),t.isPropagationStopped()&&v.removeEventListener(_,Le),C.event.triggered=void 0,c&&(e[f]=c)),t.result}},simulate:function(t,e,n){var r=C.extend(new C.Event,n,{type:t,isSimulated:!0});C.event.trigger(r,null,e)}}),C.fn.extend({trigger:function(t,data){return this.each((function(){C.event.trigger(t,data,this)}))},triggerHandler:function(t,data){var e=this[0];if(e)return C.event.trigger(t,data,e,!0)}}),M.focusin||C.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){C.event.simulate(e,t.target,C.event.fix(t))};C.event.special[e]={setup:function(){var r=this.ownerDocument||this,o=st.access(r,e);o||r.addEventListener(t,n,!0),st.access(r,e,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this,o=st.access(r,e)-1;o?st.access(r,e,o):(r.removeEventListener(t,n,!0),st.remove(r,e))}}}));var ke=n.location,Ie=Date.now(),je=/\?/;C.parseXML=function(data){var t;if(!data||"string"!=typeof data)return null;try{t=(new n.DOMParser).parseFromString(data,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||C.error("Invalid XML: "+data),t};var Fe=/\[\]$/,Ne=/\r?\n/g,Be=/^(?:submit|button|image|reset|file)$/i,ze=/^(?:input|select|textarea|keygen)/i;function Ve(t,e,n,r){var o;if(Array.isArray(e))C.each(e,(function(i,e){n||Fe.test(t)?r(t,e):Ve(t+"["+("object"==typeof e&&null!=e?i:"")+"]",e,n,r)}));else if(n||"object"!==O(e))r(t,e);else for(o in e)Ve(t+"["+o+"]",e[o],n,r)}C.param=function(a,t){var e,s=[],n=function(t,e){var n=S(e)?e():e;s[s.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==a)return"";if(Array.isArray(a)||a.jquery&&!C.isPlainObject(a))C.each(a,(function(){n(this.name,this.value)}));else for(e in a)Ve(e,a[e],t,n);return s.join("&")},C.fn.extend({serialize:function(){return C.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=C.prop(this,"elements");return t?C.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!C(this).is(":disabled")&&ze.test(this.nodeName)&&!Be.test(t)&&(this.checked||!St.test(t))})).map((function(i,t){var e=C(this).val();return null==e?null:Array.isArray(e)?C.map(e,(function(e){return{name:t.name,value:e.replace(Ne,"\r\n")}})):{name:t.name,value:e.replace(Ne,"\r\n")}})).get()}});var Ge=/%20/g,He=/#.*$/,Ue=/([?&])_=[^&]*/,We=/^(.*?):[ \t]*([^\r\n]*)$/gm,qe=/^(?:GET|HEAD)$/,Ye=/^\/\//,Xe={},Ze={},Je="*/".concat("*"),$e=l.createElement("a");function Ke(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i=0,o=e.toLowerCase().match(W)||[];if(S(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function Qe(t,e,n,r){var o={},c=t===Ze;function l(h){var f;return o[h]=!0,C.each(t[h]||[],(function(t,h){var d=h(e,n,r);return"string"!=typeof d||c||o[d]?c?!(f=d):void 0:(e.dataTypes.unshift(d),l(d),!1)})),f}return l(e.dataTypes[0])||!o["*"]&&l("*")}function tn(t,e){var n,r,o=C.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((o[n]?t:r||(r={}))[n]=e[n]);return r&&C.extend(!0,t,r),t}$e.href=ke.href,C.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ke.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ke.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Je,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":C.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?tn(tn(t,C.ajaxSettings),e):tn(C.ajaxSettings,t)},ajaxPrefilter:Ke(Xe),ajaxTransport:Ke(Ze),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,o,c,h,f,d,m,v,i,y,s=C.ajaxSetup({},e),_=s.context||s,x=s.context&&(_.nodeType||_.jquery)?C(_):C.event,w=C.Deferred(),T=C.Callbacks("once memory"),M=s.statusCode||{},S={},E={},A="canceled",P={readyState:0,getResponseHeader:function(t){var e;if(m){if(!h)for(h={};e=We.exec(c);)h[e[1].toLowerCase()+" "]=(h[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=h[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return m?c:null},setRequestHeader:function(t,e){return null==m&&(t=E[t.toLowerCase()]=E[t.toLowerCase()]||t,S[t]=e),this},overrideMimeType:function(t){return null==m&&(s.mimeType=t),this},statusCode:function(map){var code;if(map)if(m)P.always(map[P.status]);else for(code in map)M[code]=[M[code],map[code]];return this},abort:function(t){var e=t||A;return r&&r.abort(e),O(0,e),this}};if(w.promise(P),s.url=((t||s.url||ke.href)+"").replace(Ye,ke.protocol+"//"),s.type=e.method||e.type||s.method||s.type,s.dataTypes=(s.dataType||"*").toLowerCase().match(W)||[""],null==s.crossDomain){d=l.createElement("a");try{d.href=s.url,d.href=d.href,s.crossDomain=$e.protocol+"//"+$e.host!=d.protocol+"//"+d.host}catch(t){s.crossDomain=!0}}if(s.data&&s.processData&&"string"!=typeof s.data&&(s.data=C.param(s.data,s.traditional)),Qe(Xe,s,e,P),m)return P;for(i in(v=C.event&&s.global)&&0==C.active++&&C.event.trigger("ajaxStart"),s.type=s.type.toUpperCase(),s.hasContent=!qe.test(s.type),o=s.url.replace(He,""),s.hasContent?s.data&&s.processData&&0===(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&(s.data=s.data.replace(Ge,"+")):(y=s.url.slice(o.length),s.data&&(s.processData||"string"==typeof s.data)&&(o+=(je.test(o)?"&":"?")+s.data,delete s.data),!1===s.cache&&(o=o.replace(Ue,"$1"),y=(je.test(o)?"&":"?")+"_="+Ie+++y),s.url=o+y),s.ifModified&&(C.lastModified[o]&&P.setRequestHeader("If-Modified-Since",C.lastModified[o]),C.etag[o]&&P.setRequestHeader("If-None-Match",C.etag[o])),(s.data&&s.hasContent&&!1!==s.contentType||e.contentType)&&P.setRequestHeader("Content-Type",s.contentType),P.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+("*"!==s.dataTypes[0]?", "+Je+"; q=0.01":""):s.accepts["*"]),s.headers)P.setRequestHeader(i,s.headers[i]);if(s.beforeSend&&(!1===s.beforeSend.call(_,P,s)||m))return P.abort();if(A="abort",T.add(s.complete),P.done(s.success),P.fail(s.error),r=Qe(Ze,s,e,P)){if(P.readyState=1,v&&x.trigger("ajaxSend",[P,s]),m)return P;s.async&&s.timeout>0&&(f=n.setTimeout((function(){P.abort("timeout")}),s.timeout));try{m=!1,r.send(S,O)}catch(t){if(m)throw t;O(-1,t)}}else O(-1,"No Transport");function O(t,e,l,h){var d,y,S,E,A,O=e;m||(m=!0,f&&n.clearTimeout(f),r=void 0,c=h||"",P.readyState=t>0?4:0,d=t>=200&&t<300||304===t,l&&(E=function(s,t,e){for(var n,r,o,c,l=s.contents,h=s.dataTypes;"*"===h[0];)h.shift(),void 0===n&&(n=s.mimeType||t.getResponseHeader("Content-Type"));if(n)for(r in l)if(l[r]&&l[r].test(n)){h.unshift(r);break}if(h[0]in e)o=h[0];else{for(r in e){if(!h[0]||s.converters[r+" "+h[0]]){o=r;break}c||(c=r)}o=o||c}if(o)return o!==h[0]&&h.unshift(o),e[o]}(s,P,l)),E=function(s,t,e,n){var r,o,c,l,h,f={},d=s.dataTypes.slice();if(d[1])for(c in s.converters)f[c.toLowerCase()]=s.converters[c];for(o=d.shift();o;)if(s.responseFields[o]&&(e[s.responseFields[o]]=t),!h&&n&&s.dataFilter&&(t=s.dataFilter(t,s.dataType)),h=o,o=d.shift())if("*"===o)o=h;else if("*"!==h&&h!==o){if(!(c=f[h+" "+o]||f["* "+o]))for(r in f)if((l=r.split(" "))[1]===o&&(c=f[h+" "+l[0]]||f["* "+l[0]])){!0===c?c=f[r]:!0!==f[r]&&(o=l[0],d.unshift(l[1]));break}if(!0!==c)if(c&&s.throws)t=c(t);else try{t=c(t)}catch(t){return{state:"parsererror",error:c?t:"No conversion from "+h+" to "+o}}}return{state:"success",data:t}}(s,E,P,d),d?(s.ifModified&&((A=P.getResponseHeader("Last-Modified"))&&(C.lastModified[o]=A),(A=P.getResponseHeader("etag"))&&(C.etag[o]=A)),204===t||"HEAD"===s.type?O="nocontent":304===t?O="notmodified":(O=E.state,y=E.data,d=!(S=E.error))):(S=O,!t&&O||(O="error",t<0&&(t=0))),P.status=t,P.statusText=(e||O)+"",d?w.resolveWith(_,[y,O,P]):w.rejectWith(_,[P,O,S]),P.statusCode(M),M=void 0,v&&x.trigger(d?"ajaxSuccess":"ajaxError",[P,s,d?y:S]),T.fireWith(_,[P,O]),v&&(x.trigger("ajaxComplete",[P,s]),--C.active||C.event.trigger("ajaxStop")))}return P},getJSON:function(t,data,e){return C.get(t,data,e,"json")},getScript:function(t,e){return C.get(t,void 0,e,"script")}}),C.each(["get","post"],(function(i,t){C[t]=function(e,data,n,r){return S(data)&&(r=r||n,n=data,data=void 0),C.ajax(C.extend({url:e,type:t,dataType:r,data:data,success:n},C.isPlainObject(e)&&e))}})),C._evalUrl=function(t,e){return C.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){C.globalEval(t,e)}})},C.fn.extend({wrapAll:function(html){var t;return this[0]&&(S(html)&&(html=html.call(this[0])),t=C(html,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(html){return S(html)?this.each((function(i){C(this).wrapInner(html.call(this,i))})):this.each((function(){var t=C(this),e=t.contents();e.length?e.wrapAll(html):t.append(html)}))},wrap:function(html){var t=S(html);return this.each((function(i){C(this).wrapAll(t?html.call(this,i):html)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){C(this).replaceWith(this.childNodes)})),this}}),C.expr.pseudos.hidden=function(t){return!C.expr.pseudos.visible(t)},C.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},C.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var en={0:200,1223:204},nn=C.ajaxSettings.xhr();M.cors=!!nn&&"withCredentials"in nn,M.ajax=nn=!!nn,C.ajaxTransport((function(t){var e,r;if(M.cors||nn&&!t.crossDomain)return{send:function(o,c){var i,l=t.xhr();if(l.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(i in t.xhrFields)l[i]=t.xhrFields[i];for(i in t.mimeType&&l.overrideMimeType&&l.overrideMimeType(t.mimeType),t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)l.setRequestHeader(i,o[i]);e=function(t){return function(){e&&(e=r=l.onload=l.onerror=l.onabort=l.ontimeout=l.onreadystatechange=null,"abort"===t?l.abort():"error"===t?"number"!=typeof l.status?c(0,"error"):c(l.status,l.statusText):c(en[l.status]||l.status,l.statusText,"text"!==(l.responseType||"text")||"string"!=typeof l.responseText?{binary:l.response}:{text:l.responseText},l.getAllResponseHeaders()))}},l.onload=e(),r=l.onerror=l.ontimeout=e("error"),void 0!==l.onabort?l.onabort=r:l.onreadystatechange=function(){4===l.readyState&&n.setTimeout((function(){e&&r()}))},e=e("abort");try{l.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),C.ajaxPrefilter((function(s){s.crossDomain&&(s.contents.script=!1)})),C.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(text){return C.globalEval(text),text}}}),C.ajaxPrefilter("script",(function(s){void 0===s.cache&&(s.cache=!1),s.crossDomain&&(s.type="GET")})),C.ajaxTransport("script",(function(s){var script,t;if(s.crossDomain||s.scriptAttrs)return{send:function(e,n){script=C("